1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-26 07:02:15 +03:00

disable all interrupts when reading from spiffs

this fixes any possible resets caused by interrupt routines trying to
read the flash while there is an ongoing spiffs operation
This commit is contained in:
ficeto
2015-05-16 21:01:51 +03:00
parent 62a460f0b8
commit b902e86cb1
2 changed files with 10 additions and 6 deletions

View File

@ -135,7 +135,7 @@ void ets_intr_unlock();
extern uint32_t interruptsState;
#define interrupts() xt_enable_interrupts(interruptsState)
#define noInterrupts() xt_disable_interrupts(interruptsState, 15)
#define noInterrupts() __asm__ __volatile__("rsil %0,15; esync; isync; dsync" : "=a" (interruptsState))
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )