diff --git a/hardware/arduino/esp8266/cores/esp8266/Arduino.h b/hardware/arduino/esp8266/cores/esp8266/Arduino.h index 4c78bd66c..e0d29efb5 100644 --- a/hardware/arduino/esp8266/cores/esp8266/Arduino.h +++ b/hardware/arduino/esp8266/cores/esp8266/Arduino.h @@ -76,8 +76,11 @@ void yield(void); #define degrees(rad) ((rad)*RAD_TO_DEG) #define sq(x) ((x)*(x)) -#define interrupts() sei() -#define noInterrupts() cli() +void ets_intr_lock(); +void ets_intr_unlock(); + +#define interrupts() ets_intr_unlock(); +#define noInterrupts() ets_intr_lock(); #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) diff --git a/hardware/tools/esp8266/sdk/include/ets_sys.h b/hardware/tools/esp8266/sdk/include/ets_sys.h index 8080f75e0..5b4c62480 100644 --- a/hardware/tools/esp8266/sdk/include/ets_sys.h +++ b/hardware/tools/esp8266/sdk/include/ets_sys.h @@ -81,7 +81,6 @@ typedef struct _ETSTIMER_ { ETS_INTR_DISABLE(ETS_GPIO_INUM) -void ets_isr_attach(int routine, void* something, void *buff); void *pvPortMalloc(size_t xWantedSize); void *pvPortRealloc(void* ptr, size_t xWantedSize); void pvPortFree(void *ptr); @@ -107,7 +106,8 @@ void uart_div_modify(int no, int freq); void ets_isr_mask(int intr); void ets_isr_unmask(int intr); void ets_isr_attach(int intr, void *handler, void *arg); - +void ets_intr_lock(); +void ets_intr_unlock(); #endif /* _ETS_SYS_H */