laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/26997 )


Change subject: card_emu_uart_interrupt: ASSERT if we get called with wrong 
uart_chan
......................................................................

card_emu_uart_interrupt: ASSERT if we get called with wrong uart_chan

This is what we do in all other functions, not sure why this one
wants to silently ignore any such programming errors.

Change-Id: I022eee86a5a3b5077abe59897161578ed960f1b1
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 2 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/97/26997/1

diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index edd500f..7fd069a 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -410,10 +410,9 @@
 /* call-back from card_emu.c to force a USART interrupt */
 void card_emu_uart_interrupt(uint8_t uart_chan)
 {
+       OSMO_ASSERT(uart_chan < ARRAY_SIZE(cardem_inst));
        Usart *usart = get_usart_by_chan(uart_chan);
-       if (!usart) {
-               return;
-       }
+
        if (USART0 == usart) {
                NVIC_SetPendingIRQ(USART0_IRQn);
        } else if (USART1 == usart) {

--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/26997
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I022eee86a5a3b5077abe59897161578ed960f1b1
Gerrit-Change-Number: 26997
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to