nodemcu-firmware/app/platform/cpu_esp8266_irq.h
Nathaniel Wesley Filardo 109f500be7
More LED fixes (#3368)
* apa102: remove dead code

We can't store strings of hundreds of thousands of characters in RAM, so
this can't possibly have fired, historically.  Pixbufs are still RAM
objects, so that's still out.  With LFS, it would take a pathological
example to hit the required 400KB TSTRING.

* Add IRQ management functions

* ws2812: fill UART FIFOs with IRQs off

Refactor code to make the use of two fill loops less gross.
2021-01-10 17:19:10 +00:00

16 lines
289 B
C

#pragma once
static inline uint32_t
esp8266_defer_irqs(void)
{
uint32_t state;
__asm__ __volatile__ ("rsil %0, 15" : "=a"(state) : : "memory");
return state;
}
static inline void
esp8266_restore_irqs(uint32_t state)
{
__asm__ __volatile__ ("wsr %0, ps" : : "a"(state) : "memory");
}