From ff62f72e26678f82f6f8f509f011d596a170f4c1 Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Mon, 17 May 2021 23:29:40 +0200 Subject: [PATCH] Even if a small function, loading any code from flash while in ISR can crash the MCU. --- cores/esp8266/core_esp8266_waveform_phase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/core_esp8266_waveform_phase.cpp b/cores/esp8266/core_esp8266_waveform_phase.cpp index 5f81c52ff3..de2f914121 100644 --- a/cores/esp8266/core_esp8266_waveform_phase.cpp +++ b/cores/esp8266/core_esp8266_waveform_phase.cpp @@ -55,7 +55,7 @@ extern "C" void enablePhaseLockedWaveform (void) // No-op calls to override the PWM implementation extern "C" void _setPWMFreq_weak(uint32_t freq) { (void) freq; } -extern "C" bool _stopPWM_weak(int pin) { (void) pin; return false; } +extern "C" IRAM_ATTR bool _stopPWM_weak(int pin) { (void) pin; return false; } extern "C" bool _setPWM_weak(int pin, uint32_t val, uint32_t range) { (void) pin; (void) val; (void) range; return false; }