forked from SmingHub/Sming
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Right interrupts implementation (more details: https://www.esp8266.c…
- Loading branch information
Showing
6 changed files
with
35 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <user_config.h> | ||
|
||
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"); | ||
} |