diff --git a/app/src/processing/app/EditorLineStatus.java b/app/src/processing/app/EditorLineStatus.java index 2fcb8c917..e29fa0c2d 100644 --- a/app/src/processing/app/EditorLineStatus.java +++ b/app/src/processing/app/EditorLineStatus.java @@ -96,7 +96,10 @@ public class EditorLineStatus extends JComponent { public void paintComponent(Graphics g) { if (name=="" && serialport=="") { Map boardPreferences = Base.getBoardPreferences(); - setBoardName(boardPreferences.get("name")); + if (boardPreferences!=null) + setBoardName(boardPreferences.get("name")); + else + setBoardName("-"); setSerialPort(Preferences.get("serial.port")); } g.setColor(background); diff --git a/hardware/arduino/sam/libraries/SPI/SPI.cpp b/hardware/arduino/sam/libraries/SPI/SPI.cpp index 7741d64ad..4c61f2cf2 100644 --- a/hardware/arduino/sam/libraries/SPI/SPI.cpp +++ b/hardware/arduino/sam/libraries/SPI/SPI.cpp @@ -24,7 +24,7 @@ void SPIClass::begin() { SPI_Configure(spi, id, SPI_MR_MSTR | SPI_MR_PS); SPI_Enable(spi); setClockDivider(1); - setDataMode(0); + setDataMode(SPI_MODE0); } void SPIClass::addSlave(uint8_t _channel) { diff --git a/hardware/arduino/sam/libraries/SPI/SPI.h b/hardware/arduino/sam/libraries/SPI/SPI.h index 56d8646f8..7408813f6 100644 --- a/hardware/arduino/sam/libraries/SPI/SPI.h +++ b/hardware/arduino/sam/libraries/SPI/SPI.h @@ -14,10 +14,10 @@ #include "variant.h" #include -#define SPI_MODE0 0x00 -#define SPI_MODE1 0x01 -#define SPI_MODE2 0x02 -#define SPI_MODE3 0x03 +#define SPI_MODE0 0x02 +#define SPI_MODE1 0x00 +#define SPI_MODE2 0x03 +#define SPI_MODE3 0x01 class SPIClass { public: diff --git a/hardware/arduino/sam/libraries/SPI/examples/DueX_ATFlashSignatureCheck/DueX_ATFlashSignatureCheck.ino b/hardware/arduino/sam/libraries/SPI/examples/DueX_ATFlashSignatureCheck/DueX_ATFlashSignatureCheck.ino index 4a4e89a63..4613abfd7 100644 --- a/hardware/arduino/sam/libraries/SPI/examples/DueX_ATFlashSignatureCheck/DueX_ATFlashSignatureCheck.ino +++ b/hardware/arduino/sam/libraries/SPI/examples/DueX_ATFlashSignatureCheck/DueX_ATFlashSignatureCheck.ino @@ -7,7 +7,6 @@ void setup() { Serial1.begin(9600); SPI_0.begin(); SPI_0.addSlave(FLASH_SPI_CHAN); - SPI_0.setDataMode(SPI_MODE2, FLASH_SPI_CHAN); SPI_0.setClockDivider(2); // We are too fast with 1 }