1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-02 13:24:12 +01:00

Merge branch 'platforms-arm' of https://github.com/arduino/ARM into platforms-arm

This commit is contained in:
Thibaut VIARD 2012-04-26 20:20:13 +02:00
commit d0d41ba673
4 changed files with 9 additions and 7 deletions

View File

@ -96,7 +96,10 @@ public class EditorLineStatus extends JComponent {
public void paintComponent(Graphics g) { public void paintComponent(Graphics g) {
if (name=="" && serialport=="") { if (name=="" && serialport=="") {
Map<String, String> boardPreferences = Base.getBoardPreferences(); Map<String, String> boardPreferences = Base.getBoardPreferences();
setBoardName(boardPreferences.get("name")); if (boardPreferences!=null)
setBoardName(boardPreferences.get("name"));
else
setBoardName("-");
setSerialPort(Preferences.get("serial.port")); setSerialPort(Preferences.get("serial.port"));
} }
g.setColor(background); g.setColor(background);

View File

@ -24,7 +24,7 @@ void SPIClass::begin() {
SPI_Configure(spi, id, SPI_MR_MSTR | SPI_MR_PS); SPI_Configure(spi, id, SPI_MR_MSTR | SPI_MR_PS);
SPI_Enable(spi); SPI_Enable(spi);
setClockDivider(1); setClockDivider(1);
setDataMode(0); setDataMode(SPI_MODE0);
} }
void SPIClass::addSlave(uint8_t _channel) { void SPIClass::addSlave(uint8_t _channel) {

View File

@ -14,10 +14,10 @@
#include "variant.h" #include "variant.h"
#include <stdio.h> #include <stdio.h>
#define SPI_MODE0 0x00 #define SPI_MODE0 0x02
#define SPI_MODE1 0x01 #define SPI_MODE1 0x00
#define SPI_MODE2 0x02 #define SPI_MODE2 0x03
#define SPI_MODE3 0x03 #define SPI_MODE3 0x01
class SPIClass { class SPIClass {
public: public:

View File

@ -7,7 +7,6 @@ void setup() {
Serial1.begin(9600); Serial1.begin(9600);
SPI_0.begin(); SPI_0.begin();
SPI_0.addSlave(FLASH_SPI_CHAN); SPI_0.addSlave(FLASH_SPI_CHAN);
SPI_0.setDataMode(SPI_MODE2, FLASH_SPI_CHAN);
SPI_0.setClockDivider(2); // We are too fast with 1 SPI_0.setClockDivider(2); // We are too fast with 1
} }