Interrupt constants not recognised in PlaftformIO


I am using PlatformIO to do some work with an Arduino Due board. Everything worked fine until I started using interrupts read from a quadrature decoder.

Due to keeping other parts of the program running around the encoder measurement, I have a delay() in my main loop to count detections during a regular interval, with the interrupts being turned on just before the delay, and off just after. This stops the interrupts blocking the rest of my program.

This worked well using the Arduino IDE, but after I moved my project over to PlaftormIO (new laptop, and I work with several other platforms and wanted everything in one place), the following line is giving me some problems:

EIFR = bit (INTF0);

Apparently, neither EIFT and INTF0 are declared. I have included “Arduino.h” which I thought would (and indeed did in the IDE) declare these. How can I fix this?

What IDE are you using? What’s your platformio.ini?

I switched from the official Arduino IDE to Atom/PlatformIO. My platformio.ini contains:

platform = atmelsam
board = due
framework = arduino

Cannot reproduce, neither in the Arduino IDE nor in PIO. Using the minimal sketch

#include <Arduino.h>
void setup() {
  EIFR = bit (INTF0);

void loop() { }


 error: 'EIFR' was not declared in this scope

   EIFR = bit (INTF0);

Can you give an example sketch where this value is used and is compilable within Arduino IDE for a Due board? I can also find it nowhere in the entire SAM arduino core. Seems like the EIFR macro/identifier doesn’t exist?