Hi,
I'm using an existing code that works fine with Nano but throws the error when i use Nano Every.
The error is thrown by EnableInterrupt.h library. Any help will be greatly appreciated.
/
/ enableInterrupt(interrupDesignator, userFunction, mode); ==================================
// ===========================================================================================
// ===========================================================================================
// "interruptDesignator" is simply the Arduino pin optionally OR'ed with
// PINCHANGEINTERRUPT (== 0x80)
void enableInterrupt(uint8_t interruptDesignator, interruptFunctionType userFunction, uint8_t mode) {
uint8_t arduinoPin;
uint8_t portNumber=0;
uint8_t portMask=0;
#ifndef NEEDFORSPEED
uint8_t portBitNumber; // when an interrupted pin is found, this will be used to choose the function.
interruptFunctionType *calculatedPointer;
#endif
arduinoPin=interruptDesignator & ~PINCHANGEINTERRUPT;
// *************************************************************************************
// *************************************************************************************
// Pin Change Interrupts
// *************************************************************************************
// *************************************************************************************
#if defined ARDUINO_328
if ( (interruptDesignator & PINCHANGEINTERRUPT) || (arduinoPin != 2 && arduinoPin != 3) ) {
#elif defined MIGHTY1284
if ( (interruptDesignator & PINCHANGEINTERRUPT) || (arduinoPin != 2 && arduinoPin != 10 &&
arduinoPin != 11) ) {
#elif defined ARDUINO_LEONARDO
if ( (arduinoPin > 3) && (arduinoPin != 7) ) {
#endif
#if defined ARDUINO_328 || defined MIGHTY1284 || defined ARDUINO_LEONARDO
portMask=pgm_read_byte(&digital_pin_to_bit_mask_PGM[arduinoPin]);
portNumber=pgm_read_byte(&digital_pin_to_port_PGM[arduinoPin]);
#elif defined ARDUINO_MEGA
// NOTE: PJ2-6 and PE6 & 7 are not exposed on the Arduino, but they are supported here
// for software interrupts and support of non-Arduino platforms which expose more pins.
// PJ2-6 are called pins 70-74, PE6 is pin 75, PE7 is pin 76.
if ( (arduinoPin != 2 && arduinoPin != 3 && arduinoPin != 75 && arduinoPin != 76
&& (arduinoPin < 18 || arduinoPin > 21))
) {
if (arduinoPin > 69) { // Dastardly tricks to support PortJ 2-7
portMask=pgm_read_byte(&digital_pin_to_bit_mask_PGM[arduinoPin-6]); // Steal from PK
portNumber=PJ;
} else {
portMask=pgm_read_byte(&digital_pin_to_bit_mask_PGM[arduinoPin]);
portNumber=pgm_read_byte(&digital_pin_to_port_PGM[arduinoPin]);
}
#else
#error Unsupported Arduino platform
#endif