ESP8266/ESP32: Use FunctionalInterrupt or attachInterruptArg by default#39
ESP8266/ESP32: Use FunctionalInterrupt or attachInterruptArg by default#39mcspr wants to merge 8 commits intoPaulStoffregen:masterfrom
Conversation
|
It is still not buildable though. I raised a question in espressif/arduino-esp32 gitter chat about this issue. Otherwise, idk of a fix other than moving Encoder::update to a global function. |
|
Important thing about examples and ESP8266/ESP32 - we cannot use the pins 6-11 (inclusive). From wroom datasheet:
Same applies for most ESP8266 boards. But, in some configurations it is possible to use pins 9&10. |
|
Surely there is a better way to implement this PR.. still touches lot of code |
|
Maybe this should be PR to esp8266 branch and merged so we could at least test it easier ? |
|
How though? My main interest was to have compatible solution for both boards, but we are at a standstill with update() move for some reason (I have not changed it at all, just made global method instead of static class one)
class Encoder {
...
static void IRAM_ATTR update(...);
...
};
void Encoder::update(...) {
...
}
Sidenote there is also an arduino-devel mailing list discussion regarding attribute use: |
supercede #15
take 2 on #38
Smaller Encoder::attach_interrupt, encoder state arg is stored by the Core instead of us
Two possible implementations, as FunctionalInterrupt status in current Core is uncertain. attachInterruptArg directly exposes that functionality
Note, that only ESP8266 Core >= 2.5.1 places functional interrupt handler in IRAM
Some questions:
Should esp platform check go into a separate header? like interrupt_config.h
Is there a reason we must have .cpp file to build this code as stub library?
edit after latest push