From ac0ff44a90d80d632aad3fba983c5020b5773535 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Sat, 24 Oct 2015 18:53:31 +0300 Subject: [PATCH 1/2] ATTiny2313/4313 support --- RF24.cpp | 7 +++++++ RF24_config.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/RF24.cpp b/RF24.cpp index 81bd57b00..1f881e1a2 100644 --- a/RF24.cpp +++ b/RF24.cpp @@ -1563,6 +1563,13 @@ void RF24::setRetries(uint8_t delay, uint8_t count) # define DO 5 // PA5 # define USCK 6 // PA4 # define SS 3 // PA7 +#elif defined(__AVR_ATtiny2313__) || defined(__AVR_ATtiny4313__) +// these depend on the core used (check pins_arduino.h) +// tested with google-code core +# define DI 14 // PB5 +# define DO 15 // PB6 +# define USCK 16 // PB7 +# define SS 13 // PB4 #endif #if defined(RF24_TINY) diff --git a/RF24_config.h b/RF24_config.h index 9f36b153e..4f5590763 100644 --- a/RF24_config.h +++ b/RF24_config.h @@ -38,7 +38,7 @@ #include "utility/includes.h" //ATTiny -#elif defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) +#elif defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny2313__) || defined(__AVR_ATtiny4313__) #define RF24_TINY #include "utility/ATTiny/RF24_arch_config.h" From 1376fbd8ce63c730068d2b6c7d160b990b497a3d Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Sat, 24 Oct 2015 18:56:07 +0300 Subject: [PATCH 2/2] Removed usage of hardcoded SS pins --- RF24.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/RF24.cpp b/RF24.cpp index 1f881e1a2..bff117c02 100644 --- a/RF24.cpp +++ b/RF24.cpp @@ -1576,10 +1576,8 @@ void RF24::setRetries(uint8_t delay, uint8_t count) void SPIClass::begin() { - digitalWrite(SS, HIGH); pinMode(USCK, OUTPUT); pinMode(DO, OUTPUT); - pinMode(SS, OUTPUT); pinMode(DI, INPUT); USICR = _BV(USIWM0);