Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATtiny2313/4313 support, ATtiny 3 pin mode fix #152

Merged
merged 2 commits into from
Oct 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1563,16 +1563,21 @@ 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)

void SPIClass::begin() {

digitalWrite(SS, HIGH);
pinMode(USCK, OUTPUT);
pinMode(DO, OUTPUT);
pinMode(SS, OUTPUT);
pinMode(DI, INPUT);
USICR = _BV(USIWM0);

Expand Down
2 changes: 1 addition & 1 deletion RF24_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down