The MySensor 1.5 code is not compiling for my Arduino Mega 2560 board
-
The MySensor 1.5 code is not compiling for my Arduino Mega 2560 board.
It misses the RF69_IRQ_NUM define in several files.In file included from C:\Program Files (x86)\Arduino\libraries\MySensors\MyTransportRFM69.h:26:0,
from C:\Program Files (x86)\Arduino\libraries\MySensors\MyTransportRFM69.cpp:21:
C:\Program Files (x86)\Arduino\libraries\MySensors\utility/RFM69.h:78:62: error: 'RF69_IRQ_PIN' was not declared in this scope
RFM69(byte slaveSelectPin=RF69_SPI_CS, byte interruptPin=RF69_IRQ_PIN, bool isRFM69HW=false, byte interruptNum=RF69_IRQ_NUM) {I was able to track the issue down to the RFM69.h file. Line 39 untill 47
// INT0 on AVRs should be connected to RFM69's DIO0 (ex on Atmega328 it's D2, on Atmega644/1284 it's D2) #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega88) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega88__) || defined(__AVR_ATmega32U4__) #define RF69_IRQ_PIN 2 #define RF69_IRQ_NUM 0 #elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) #define RF69_IRQ_PIN 2 #define RF69_IRQ_NUM 2 #endifThe Ardiuno Mega 2560 seams to not match both if's so no define is declared.
by replacing this line
#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)by this line
#elseWill make the code compile, but does not look like the best solution
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login