Change in simtrace2[master]: cardemu: different init for simtrace board which uses uart timers

laforge gerrit-no-reply at lists.osmocom.org
Sun Apr 4 17:54:46 UTC 2021


Hello tsaitgaist,

I'd like you to do a code review. Please visit

    https://gerrit.osmocom.org/c/simtrace2/+/23617

to review the following change.


Change subject: cardemu: different init for simtrace board which uses uart timers
......................................................................

cardemu: different init for simtrace board which uses uart timers

Change-Id: I464f0ce1ec5e60be5f9377186b7d13a5e6dc637e
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 13 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/17/23617/1

diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c
index 1dbd2d3..c6c129d 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -429,7 +429,20 @@
 
 	/* configure USART as ISO-7816 slave (e.g. card) */
 	ISO7816_Init(&cardem_inst[0].usart_info, CLK_SLAVE);
+#ifdef BOARD_simtrace
+	/* simtrace board uses uart timeouts */
+
+	/*  don't use receive timeout timer for now */
+	cardem_inst[0].usart_info.base->US_RTOR = 0;
+	/* enable interrupts to indicate when data has been received or timeout occurred */
+	USART_EnableIt(cardem_inst[0].usart_info.base, US_IER_RXRDY | US_IER_TIMEOUT);
+#else
+	/* enable interrupts to indicate when data has been received */
+	USART_EnableIt(cardem_inst[0].usart_info.base, US_IER_RXRDY );
+#endif
+	/*  enable interrupt requests for the USART peripheral */
 	NVIC_EnableIRQ(USART1_IRQn);
+
 	PIO_ConfigureIt(&pin_usim1_rst, usim1_rst_irqhandler);
 	PIO_EnableIt(&pin_usim1_rst);
 

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I464f0ce1ec5e60be5f9377186b7d13a5e6dc637e
Gerrit-Change-Number: 23617
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: tsaitgaist <kredon at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210404/efacc3ea/attachment.htm>


More information about the gerrit-log mailing list