File tree 1 file changed +6
-27
lines changed
hardware/esp8266com/esp8266/cores/esp8266
1 file changed +6
-27
lines changed Original file line number Diff line number Diff line change @@ -118,50 +118,29 @@ int uart_get_debug();
118
118
void ICACHE_RAM_ATTR uart_interrupt_handler (uart_t * uart) {
119
119
120
120
// -------------- UART 0 --------------
121
- uint32_t status = U0IS;
122
121
if (Serial.isRxEnabled ()) {
123
- if (status & (1 << UIFF)) {
124
- while (true ) {
125
- int rx_count = (U0S >> USTXC) & 0xff ;
126
- if (!rx_count)
127
- break ;
128
-
129
- while (rx_count--) {
130
- char c = U0F & 0xff ;
131
- Serial._rx_complete_irq (c);
132
- }
133
- }
122
+ while (U0IS & (1 << UIFF)) {
123
+ Serial._rx_complete_irq ((char )(U0F & 0xff ));
134
124
U0IC = (1 << UIFF);
135
125
}
136
126
}
137
127
if (Serial.isTxEnabled ()) {
138
- if (status & (1 << UIFE)) {
128
+ if (U0IS & (1 << UIFE)) {
139
129
U0IC = (1 << UIFE);
140
130
Serial._tx_empty_irq ();
141
131
}
142
132
}
143
133
144
134
// -------------- UART 1 --------------
145
135
146
- status = U1IS;
147
136
if (Serial1.isRxEnabled ()) {
148
- if (status & (1 << UIFF)) {
149
- while (true ) {
150
- int rx_count = (U1S >> USTXC) & 0xff ;
151
- if (!rx_count)
152
- break ;
153
-
154
- while (rx_count--) {
155
- char c = U1F & 0xff ;
156
- Serial1._rx_complete_irq (c);
157
- }
158
- }
137
+ while (U1IS & (1 << UIFF)) {
138
+ Serial1._rx_complete_irq ((char )(U1F & 0xff ));
159
139
U1IC = (1 << UIFF);
160
140
}
161
141
}
162
142
if (Serial1.isTxEnabled ()) {
163
- status = U1IS;
164
- if (status & (1 << UIFE)) {
143
+ if (U1IS & (1 << UIFE)) {
165
144
U1IC = (1 << UIFE);
166
145
Serial1._tx_empty_irq ();
167
146
}
You can’t perform that action at this time.
0 commit comments