We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cf47b42 + 748f3f9 commit 9d4208eCopy full SHA for 9d4208e
cores/esp8266/Tone.cpp
@@ -113,11 +113,15 @@ void noTone(uint8_t _pin) {
113
digitalWrite(_pin, LOW);
114
}
115
116
-void t1IntHandler() {
117
- if (toggle_counts[T1INDEX] > 0){
+ICACHE_RAM_ATTR void t1IntHandler() {
+ if (toggle_counts[T1INDEX] != 0){
118
// toggle the pin
119
digitalWrite(tone_pins[T1INDEX], toggle_counts[T1INDEX] % 2);
120
toggle_counts[T1INDEX]--;
121
+ // handle the case of indefinite duration
122
+ if (toggle_counts[T1INDEX] < -2){
123
+ toggle_counts[T1INDEX] = -1;
124
+ }
125
}else{
126
disableTimer(T1INDEX);
127
digitalWrite(tone_pins[T1INDEX], LOW);
0 commit comments