laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/30188 )
Change subject: firmware/sniffer: Rename global variable 'wt' to 'g_wt' ...................................................................... firmware/sniffer: Rename global variable 'wt' to 'g_wt' It's a bad idea to have a two-character global variable which might easily clash with local variable names. Change-Id: Ic2fac64129d2772a1923f35e48582be3b130a0f2 --- M firmware/libcommon/source/sniffer.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/88/30188/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 6aa5582..56f0b64 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -189,7 +189,7 @@ /*! Waiting Time (WT) * @note defined in ISO/IEC 7816-3:2006(E) section 8.1 and 10.2 */ -static uint32_t wt = 9600; +static uint32_t g_wt = 9600; /*------------------------------------------------------------------------------ * Internal functions @@ -219,8 +219,8 @@ if (0 != d) { wt_d = d; } - wt = wt_wi * 960UL * wt_d; - TRACE_INFO("WT updated (wi=%u, d=%u, cause=%s) to %lu ETU\n\r", wi, d, cause, wt); + g_wt = wt_wi * 960UL * wt_d; + TRACE_INFO("WT updated (wi=%u, d=%u, cause=%s) to %lu ETU\n\r", wi, d, cause, g_wt); } /*! Allocate USB buffer and push + initialize simtrace_msg_hdr @@ -845,7 +845,7 @@ /* Just set the flag and let the main loop handle it */ change_flags |= SNIFF_CHANGE_FLAG_TIMEOUT_WT; /* Reset timeout value */ - wt_remaining = wt; + wt_remaining = g_wt; } else { wt_remaining -= (sniff_usart.base->US_RTOR & 0xffff); /* be sure to subtract the actual timeout since the new might not have been set and reloaded yet */ } @@ -947,7 +947,7 @@ /* Only receive data when sniffing */ USART_SetReceiverEnabled(sniff_usart.base, 1); /* Enable Receiver time-out to detect waiting time (WT) time-out (e.g. unresponsive cards) */ - sniff_usart.base->US_RTOR = wt; + sniff_usart.base->US_RTOR = g_wt; /* Enable interrupt to indicate when data has been received or timeout occurred */ USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); /* Set USB priority lower than USART to not miss sniffing data (both at 0 per default) */ -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30188 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: Ic2fac64129d2772a1923f35e48582be3b130a0f2 Gerrit-Change-Number: 30188 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <lafo...@osmocom.org> Gerrit-MessageType: newchange