Fix for SS pin on MoteinoLeo, Atmega32u4, Arduino Leonardo

This commit is contained in:
LowPowerLab 2013-05-30 17:47:40 -04:00
parent 860fbfb9a0
commit 722fe3c3b8
1 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,10 @@ void SPIFlash::readBytes(long addr, void* buf, word len) {
/// Send a command to the flash chip, pass TRUE for isWrite when its a write command /// Send a command to the flash chip, pass TRUE for isWrite when its a write command
void SPIFlash::command(byte cmd, boolean isWrite){ void SPIFlash::command(byte cmd, boolean isWrite){
#if defined(__AVR_ATmega32U4__) // Arduino Leonardo, MoteinoLeo
DDRB |= B00000001; // Make sure the SS pin (PB0 - used by RFM12B on MoteinoLeo R1) is set as output HIGH!
PORTB |= B00000001;
#endif
if (isWrite) if (isWrite)
{ {
command(SPIFLASH_WRITEENABLE); // Write Enable command(SPIFLASH_WRITEENABLE); // Write Enable