Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "#define CRIT_TIMING IRAM_ATTR" for ESP8266 #147

Open
thjean opened this issue Oct 20, 2024 · 1 comment
Open

Add "#define CRIT_TIMING IRAM_ATTR" for ESP8266 #147

thjean opened this issue Oct 20, 2024 · 1 comment

Comments

@thjean
Copy link

thjean commented Oct 20, 2024

For the ESP8266, timing critical functions like read_bit() should be kept in IRAM by adding
# define CRIT_TIMING IRAM_ATTR for the ESP8266 architecture like this was done for the ESP32.

Without the IRAM_ATTR, I observed that the first call of read_bit() may return a wrong value when the function has to be reloaded into the cache, as this violates the 15us data valid time.

This may be the reason for the sporadic errors observed in #76

@DriekdeGadgetfreak
Copy link

Thanks very much. This helped me a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants