Skip to content

Commit b094b50

Browse files
committed
xt disable and enable functions
1 parent c328452 commit b094b50

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cores/esp8266/core_esp8266_wiring_digital.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,21 @@ extern void __detachInterrupt(uint8_t pin) {
139139
}
140140
}
141141

142+
static uint32_t interruptState = 0;
143+
144+
void xt_disable_interrupts()
145+
{
146+
__asm__ __volatile__("rsil %0,15":"=a" (interruptState));
147+
__asm__("esync");
148+
__asm__("isync");
149+
__asm__("dsync");
150+
}
151+
void xt_enable_interrupts()
152+
{
153+
__asm__ __volatile__("wsr %0,ps"::"a" (interruptState) : "memory");
154+
__asm__("esync");
155+
}
156+
142157
void initPins() {
143158
//Disable UART interrupts
144159
system_set_os_print(0);

0 commit comments

Comments
 (0)