From 722fe3c3b84403ef8cec5bc74509014e51f99894 Mon Sep 17 00:00:00 2001 From: LowPowerLab Date: Thu, 30 May 2013 17:47:40 -0400 Subject: [PATCH] Fix for SS pin on MoteinoLeo, Atmega32u4, Arduino Leonardo --- SPIFlash.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SPIFlash.cpp b/SPIFlash.cpp index 5c94046..ca006cb 100644 --- a/SPIFlash.cpp +++ b/SPIFlash.cpp @@ -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 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) { command(SPIFLASH_WRITEENABLE); // Write Enable