Skip to content

Commit 56bb877

Browse files
John DoeJohn Doe
John Doe
authored and
John Doe
committed
add SLC interrupt routines
1 parent a4fa733 commit 56bb877

File tree

1 file changed

+41
-26
lines changed

1 file changed

+41
-26
lines changed

tools/sdk/include/ets_sys.h

+41-26
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ typedef struct _ETSTIMER_ {
3939

4040
typedef void (*int_handler_t)(void*);
4141

42+
#define ETS_SLC_INUM 1
4243
#define ETS_SPI_INUM 2
4344
#define ETS_GPIO_INUM 4
4445
#define ETS_UART_INUM 5
@@ -54,6 +55,12 @@ typedef void (*int_handler_t)(void*);
5455
#define ETS_INTR_UNLOCK() \
5556
ets_intr_unlock()
5657

58+
#define ETS_INTR_ENABLE(inum) \
59+
ets_isr_unmask((1<<inum))
60+
61+
#define ETS_INTR_DISABLE(inum) \
62+
ets_isr_mask((1<<inum))
63+
5764
inline uint32_t ETS_INTR_ENABLED(void)
5865
{
5966
uint32_t enabled;
@@ -71,53 +78,61 @@ inline uint32_t ETS_INTR_PENDING(void)
7178
#define ETS_CCOMPARE0_INTR_ATTACH(func, arg) \
7279
ets_isr_attach(ETS_CCOMPARE0_INUM, (int_handler_t)(func), (void *)(arg))
7380

81+
#define ETS_CCOMPARE0_ENABLE() \
82+
ETS_INTR_ENABLE(ETS_CCOMPARE0_INUM)
83+
84+
#define ETS_CCOMPARE0_DISABLE() \
85+
ETS_INTR_DISABLE(ETS_CCOMPARE0_INUM)
86+
87+
7488
#define ETS_FRC_TIMER1_INTR_ATTACH(func, arg) \
7589
ets_isr_attach(ETS_FRC_TIMER1_INUM, (int_handler_t)(func), (void *)(arg))
7690

77-
#define ETS_FRC_TIMER1_NMI_INTR_ATTACH(func) \
78-
NmiTimSetFunc(func)
79-
91+
#define ETS_FRC1_INTR_ENABLE() \
92+
ETS_INTR_ENABLE(ETS_FRC_TIMER1_INUM)
93+
94+
#define ETS_FRC1_INTR_DISABLE() \
95+
ETS_INTR_DISABLE(ETS_FRC_TIMER1_INUM)
96+
97+
8098
#define ETS_GPIO_INTR_ATTACH(func, arg) \
8199
ets_isr_attach(ETS_GPIO_INUM, (int_handler_t)(func), (void *)(arg))
82100

83-
#define ETS_UART_INTR_ATTACH(func, arg) \
84-
ets_isr_attach(ETS_UART_INUM, (int_handler_t)(func), (void *)(arg))
85-
86-
#define ETS_SPI_INTR_ATTACH(func, arg) \
87-
ets_isr_attach(ETS_SPI_INUM, (int_handler_t)(func), (void *)(arg))
101+
#define ETS_GPIO_INTR_ENABLE() \
102+
ETS_INTR_ENABLE(ETS_GPIO_INUM)
88103

89-
#define ETS_INTR_ENABLE(inum) \
90-
ets_isr_unmask((1<<inum))
104+
#define ETS_GPIO_INTR_DISABLE() \
105+
ETS_INTR_DISABLE(ETS_GPIO_INUM)
91106

92-
#define ETS_INTR_DISABLE(inum) \
93-
ets_isr_mask((1<<inum))
94107

95-
#define ETS_SPI_INTR_ENABLE() \
96-
ETS_INTR_ENABLE(ETS_SPI_INUM)
108+
#define ETS_UART_INTR_ATTACH(func, arg) \
109+
ets_isr_attach(ETS_UART_INUM, (int_handler_t)(func), (void *)(arg))
97110

98111
#define ETS_UART_INTR_ENABLE() \
99112
ETS_INTR_ENABLE(ETS_UART_INUM)
100113

101114
#define ETS_UART_INTR_DISABLE() \
102115
ETS_INTR_DISABLE(ETS_UART_INUM)
103116

104-
#define ETS_CCOMPARE0_ENABLE() \
105-
ETS_INTR_ENABLE(ETS_CCOMPARE0_INUM)
106117

107-
#define ETS_CCOMPARE0_DISABLE() \
108-
ETS_INTR_DISABLE(ETS_CCOMPARE0_INUM)
118+
#define ETS_SPI_INTR_ATTACH(func, arg) \
119+
ets_isr_attach(ETS_SPI_INUM, (int_handler_t)(func), (void *)(arg))
109120

110-
#define ETS_FRC1_INTR_ENABLE() \
111-
ETS_INTR_ENABLE(ETS_FRC_TIMER1_INUM)
121+
#define ETS_SPI_INTR_ENABLE() \
122+
ETS_INTR_ENABLE(ETS_SPI_INUM)
112123

113-
#define ETS_FRC1_INTR_DISABLE() \
114-
ETS_INTR_DISABLE(ETS_FRC_TIMER1_INUM)
124+
#define ETS_SPI_INTR_DISABLE() \
125+
ETS_INTR_DISABLE(ETS_SPI_INUM)
115126

116-
#define ETS_GPIO_INTR_ENABLE() \
117-
ETS_INTR_ENABLE(ETS_GPIO_INUM)
118127

119-
#define ETS_GPIO_INTR_DISABLE() \
120-
ETS_INTR_DISABLE(ETS_GPIO_INUM)
128+
#define ETS_SLC_INTR_ATTACH(func, arg) \
129+
ets_isr_attach(ETS_SLC_INUM, (int_handler_t)(func), (void *)(arg))
130+
131+
#define ETS_SLC_INTR_ENABLE() \
132+
ETS_INTR_ENABLE(ETS_SLC_INUM)
133+
134+
#define ETS_SLC_INTR_DISABLE() \
135+
ETS_INTR_DISABLE(ETS_SLC_INUM)
121136

122137

123138
void *pvPortMalloc(size_t xWantedSize) __attribute__((malloc, alloc_size(1)));

0 commit comments

Comments
 (0)