1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

xt disable and enable functions

This commit is contained in:
Makuna 2015-05-06 09:02:14 -07:00
parent c328452651
commit b094b50e18

View File

@ -139,6 +139,21 @@ extern void __detachInterrupt(uint8_t pin) {
}
}
static uint32_t interruptState = 0;
void xt_disable_interrupts()
{
__asm__ __volatile__("rsil %0,15":"=a" (interruptState));
__asm__("esync");
__asm__("isync");
__asm__("dsync");
}
void xt_enable_interrupts()
{
__asm__ __volatile__("wsr %0,ps"::"a" (interruptState) : "memory");
__asm__("esync");
}
void initPins() {
//Disable UART interrupts
system_set_os_print(0);