Skip to content

Commit d7eaf77

Browse files
Make stopWaveform call interrupt callable
Match the behavior of pre-2.4.2 PWM by allowing stopWaveform to be called from an interrupt. Fixes esp8266#5247
1 parent c8497da commit d7eaf77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp8266/core_esp8266_waveform.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static void initTimer() {
137137
timerRunning = true;
138138
}
139139

140-
static void deinitTimer() {
140+
static void ICACHE_RAM_ATTR deinitTimer() {
141141
timer1_attachInterrupt(NULL);
142142
timer1_disable();
143143
timer1_isr_init();
@@ -202,7 +202,7 @@ int startWaveform(uint8_t pin, uint32_t timeHighUS, uint32_t timeLowUS, uint32_t
202202
}
203203

204204
// Stops a waveform on a pin
205-
int stopWaveform(uint8_t pin) {
205+
int ICACHE_RAM_ATTR stopWaveform(uint8_t pin) {
206206
// Can't possibly need to stop anything if there is no timer active
207207
if (!timerRunning) {
208208
return false;

0 commit comments

Comments
 (0)