Closed Di-Strix closed 3 years ago
Thank you for contributing, could you fix a few things?
@strange-v Done
A few more minor changes (commented). Is it okay to have IRAM_ATTR only in definition (.cpp) or should it be in the declaration too (.h)? Honestly, I don't remember.
Because of you're including header file in cpp file then all contents of both files are "merging" together. So you need to define or in the header file(.h) or in the cpp file. In most cases all defines are in the header file, but nothing is stopping you from moving them to the cpp file.
Move IRAM_ATTR define to the MHZ19PWM.cpp?
No, defines should be in the header, it's logical. I'm talking about attributing the method, for example, MHZ19PWM::isr() attributed (ISR_FN_ATTR) in the cpp file, but not in the header. If it is possible to attribute only in one place I'd prefer the header file.
I just tested and seems it is worked. So I'm moving ISR_ATTR to the header
Thank you!
Added ICACHE_RAM_ATTR attribute to isr functions for esp8266 and esp32 boards. Added yield() to waitForData function to avoid WDT reset on esp boards. Fixes issue #9