Skip to content

Commit 5fa5e72

Browse files
committed
Fix the Notification will make chip halt
1 parent 60503ce commit 5fa5e72

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

system/libarc32_arduino101/drivers/ipc_uart_ns16550.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,15 @@ void ipc_uart_isr()
177177

178178
while (UART_IRQ_HW_UPDATE(IPC_UART) &&
179179
UART_IRQ_IS_PENDING(IPC_UART)) {
180-
if (UART_IRQ_ERR_DETECTED(IPC_UART)) {
180+
if (UART_IRQ_ERR_DETECTED(IPC_UART))
181+
{
181182
uint8_t c;
182183
if (UART_BREAK_CHECK(IPC_UART)) {
183184
panic(-1);
184185
}
185186
UART_POLL_IN(IPC_UART, &c);
186-
} else if (UART_IRQ_RX_READY(IPC_UART)) {
187+
}
188+
if (UART_IRQ_RX_READY(IPC_UART)) {
187189
int rx_cnt;
188190

189191
while ((rx_cnt =
@@ -241,7 +243,8 @@ void ipc_uart_isr()
241243
}
242244
}
243245
}
244-
} else if (UART_IRQ_TX_READY(IPC_UART)) {
246+
}
247+
if (UART_IRQ_TX_READY(IPC_UART)) {
245248
int tx_len;
246249

247250
if (ipc.tx_state == STATUS_TX_DONE) {
@@ -325,9 +328,8 @@ void ipc_uart_isr()
325328
lsr);
326329
#endif
327330
}
328-
} else {
329-
pr_warning(LOG_MODULE_IPC, "ipc_uart_isr: bad ISR");
330331
}
332+
331333
}
332334
}
333335

system/libarc32_arduino101/framework/src/os/os.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
/************************* MEMORY *************************/
3535

3636
#ifdef TRACK_ALLOCS
37+
#include "infra/log.h"
3738
int alloc_count = 0;
3839
#endif
3940

@@ -45,6 +46,7 @@ void * cfw_alloc(int size, OS_ERR_TYPE * err) {
4546
(*(int*) ptr) = size;
4647
#ifdef TRACK_ALLOCS
4748
alloc_count++;
49+
pr_info(0, "alloc_count - %d", alloc_count);
4850
#endif
4951
interrupt_unlock(flags);
5052
return ptr;
@@ -56,6 +58,7 @@ void cfw_free(void * ptr, OS_ERR_TYPE * err) {
5658
int flags = interrupt_lock();
5759
#ifdef TRACK_ALLOCS
5860
alloc_count--;
61+
pr_info(0, "alloc_countf - %d", alloc_count);
5962
#endif
6063
free(ptr);
6164
interrupt_unlock(flags);
-152 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)