-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Typo in Arduino.h constant TIM_DIV265 #2918
Comments
@igrr I think I saw a discussion about this somewhere, but I can't find anything in this repo. Do you know anything about it? If memory serves, the discussion was like @paccerdk says: should the typo be fixed or kept for compatibility to not break people's code. |
Thinking of something like enum {
TIM_DIV1 = 1,
TIM_DIV16 = 2,
TIM_DIV256 = 3,
TIM_DIV265 __attribute__((deprecated)) = TIM_DIV256
}; and then remove TIM_DIV265 in one of the subsequent versions, giving e.g. library authors some time to update the code. |
Relevant: PR #2695 |
@igrr I tried the enum deprecation that you suggested, and it didn't build. A bit of google says that gcc >= 6 is needed. |
with a const that would be possible (link) with our gcc. |
I tried something similar to: The warning didn't trigger, so I left it out. Not sure if I missed something or what. |
For the warning you need deprecated The linker may remove the int if it not used. I did not check that. |
@d-a-v I meant I tried this in Arduino.h and: and the warning didn't trigger. |
Weird, it does here (with the arduino IDE, except if File>Prefs>Warnings>None)
|
... and it seems these two |
To be sure, I tried in Oddwierdly, it needs to be declared exactly as BUILTIN_LED with the
|
I believe line 90 in Arduino/cores/esp8266/Arduino.h (Master) should be:
#define TIM_DIV256 3 //312.5Khz (1 tick = 3.2us - 26843542.4 us max)
and not:
#define TIM_DIV265 3 //312.5Khz (1 tick = 3.2us - 26843542.4 us max)
which it is, currently. (256 and not 265)
I did not submit a pull request or anything, since it might break stuff if corrected.
https://github.com/esp8266/Arduino/blob/master/cores/esp8266/Arduino.h#L90
The text was updated successfully, but these errors were encountered: