Permalink
Browse files

ATmega32U4 fix, thx mharizanov

  • Loading branch information...
jcw committed Mar 25, 2015
1 parent 916329c commit 40741fe29a6c58726dcca49f7e5aa5dc36d4f6ac
Showing with 11 additions and 11 deletions.
  1. +11 −11 RF69_avr.h
View
@@ -70,17 +70,17 @@ static void spiConfigPins () {
DDRA |= _BV(SPI_MOSI) | _BV(SPI_SCK);
}
#elif defined(__AVR_ATmega32U4__) //Arduino Leonardo
#elif defined(__AVR_ATmega32U4__) //Arduino Leonardo
#define RFM_IRQ 3 // PD0, INT0, Digital3
#define RFM_IRQ 0 // PD0, INT0, Digital3
#define SS_DDR DDRB
#define SS_PORT PORTB
#define SS_BIT 6 // Dig10, PB6
#define SS_BIT 6 // Dig10, PB6
#define SPI_SS 17 // PB0, pin 8, Digital17
#define SPI_MISO 14 // PB3, pin 11, Digital14
#define SPI_MOSI 16 // PB2, pin 10, Digital16
#define SPI_SCK 15 // PB1, pin 9, Digital15
#define SPI_SS 0 // PB0, pin 8, Digital17
#define SPI_MISO 3 // PB3, pin 11, Digital14
#define SPI_MOSI 2 // PB2, pin 10, Digital16
#define SPI_SCK 1 // PB1, pin 9, Digital15
static void spiConfigPins () {
SS_PORT |= _BV(SS_BIT);
@@ -121,14 +121,14 @@ struct PreventInterrupt {
static void spiInit (void) {
spiConfigPins();
#ifdef SPCR
#ifdef SPCR
SPCR = _BV(SPE) | _BV(MSTR);
SPSR |= _BV(SPI2X);
#else
USICR = _BV(USIWM0); // ATtiny
#endif
#endif
// pinMode(RFM_IRQ, INPUT);
// digitalWrite(RFM_IRQ, 1); // pull-up
}

0 comments on commit 40741fe

Please sign in to comment.