mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-06 05:21:22 +03:00
add SLC interrupt routines
This commit is contained in:
parent
a4fa7335ad
commit
56bb877ef0
@ -39,6 +39,7 @@ typedef struct _ETSTIMER_ {
|
||||
|
||||
typedef void (*int_handler_t)(void*);
|
||||
|
||||
#define ETS_SLC_INUM 1
|
||||
#define ETS_SPI_INUM 2
|
||||
#define ETS_GPIO_INUM 4
|
||||
#define ETS_UART_INUM 5
|
||||
@ -54,6 +55,12 @@ typedef void (*int_handler_t)(void*);
|
||||
#define ETS_INTR_UNLOCK() \
|
||||
ets_intr_unlock()
|
||||
|
||||
#define ETS_INTR_ENABLE(inum) \
|
||||
ets_isr_unmask((1<<inum))
|
||||
|
||||
#define ETS_INTR_DISABLE(inum) \
|
||||
ets_isr_mask((1<<inum))
|
||||
|
||||
inline uint32_t ETS_INTR_ENABLED(void)
|
||||
{
|
||||
uint32_t enabled;
|
||||
@ -71,53 +78,61 @@ inline uint32_t ETS_INTR_PENDING(void)
|
||||
#define ETS_CCOMPARE0_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_CCOMPARE0_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_CCOMPARE0_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_CCOMPARE0_INUM)
|
||||
|
||||
#define ETS_CCOMPARE0_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_CCOMPARE0_INUM)
|
||||
|
||||
|
||||
#define ETS_FRC_TIMER1_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_FRC_TIMER1_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_FRC_TIMER1_NMI_INTR_ATTACH(func) \
|
||||
NmiTimSetFunc(func)
|
||||
|
||||
#define ETS_FRC1_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_FRC_TIMER1_INUM)
|
||||
|
||||
#define ETS_FRC1_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_FRC_TIMER1_INUM)
|
||||
|
||||
|
||||
#define ETS_GPIO_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_GPIO_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_GPIO_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_GPIO_INUM)
|
||||
|
||||
#define ETS_GPIO_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_GPIO_INUM)
|
||||
|
||||
|
||||
#define ETS_UART_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_UART_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_SPI_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_SPI_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_INTR_ENABLE(inum) \
|
||||
ets_isr_unmask((1<<inum))
|
||||
|
||||
#define ETS_INTR_DISABLE(inum) \
|
||||
ets_isr_mask((1<<inum))
|
||||
|
||||
#define ETS_SPI_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_SPI_INUM)
|
||||
|
||||
#define ETS_UART_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_UART_INUM)
|
||||
|
||||
#define ETS_UART_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_UART_INUM)
|
||||
|
||||
#define ETS_CCOMPARE0_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_CCOMPARE0_INUM)
|
||||
|
||||
#define ETS_CCOMPARE0_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_CCOMPARE0_INUM)
|
||||
#define ETS_SPI_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_SPI_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_FRC1_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_FRC_TIMER1_INUM)
|
||||
#define ETS_SPI_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_SPI_INUM)
|
||||
|
||||
#define ETS_FRC1_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_FRC_TIMER1_INUM)
|
||||
#define ETS_SPI_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_SPI_INUM)
|
||||
|
||||
#define ETS_GPIO_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_GPIO_INUM)
|
||||
|
||||
#define ETS_GPIO_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_GPIO_INUM)
|
||||
#define ETS_SLC_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_SLC_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_SLC_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_SLC_INUM)
|
||||
|
||||
#define ETS_SLC_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_SLC_INUM)
|
||||
|
||||
|
||||
void *pvPortMalloc(size_t xWantedSize) __attribute__((malloc, alloc_size(1)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user