summaryrefslogtreecommitdiff
path: root/firmware/src
diff options
context:
space:
mode:
authorMin Xu <min.xu@min-info.net>2014-10-25 21:18:03 +0200
committerHarald Welte <laforge@gnumonks.org>2014-11-11 22:30:54 +0100
commit7e3c9959e1e140753738be9b6d4142f6c2068e3d (patch)
treed4e41e2186730cf09121991f42cc2c4ea77916fa /firmware/src
parent9662f2830a076a089373f3a4e6ecd93515cd108f (diff)
iso_uart: Print more errors, not just overruns
Diffstat (limited to 'firmware/src')
-rw-r--r--firmware/src/simtrace/iso7816_uart.c10
-rw-r--r--firmware/src/simtrace/iso7816_uart.h2
-rw-r--r--firmware/src/simtrace/main_simtrace.c2
3 files changed, 10 insertions, 4 deletions
diff --git a/firmware/src/simtrace/iso7816_uart.c b/firmware/src/simtrace/iso7816_uart.c
index 780340f..e37deba 100644
--- a/firmware/src/simtrace/iso7816_uart.c
+++ b/firmware/src/simtrace/iso7816_uart.c
@@ -125,12 +125,18 @@ static const u_int8_t di_table[] = {
12, 20, 2, 4, 8, 16, 32, 64,
};
-void iso_uart_report_overrun(void)
+void iso_uart_report_errors(void)
{
- static unsigned lastOverrun = 0;
+ static unsigned lastOverrun = 0, lastParity = 0, lastFrame = 0;
if (isoh.stats.overrun != lastOverrun) {
DEBUGPCR("UART overrun: %u", lastOverrun = isoh.stats.overrun);
}
+ if (isoh.stats.frame_err != lastFrame) {
+ DEBUGPCR("UART frame error: %u", lastFrame = isoh.stats.frame_err);
+ }
+ if (isoh.stats.parity_err != lastParity) {
+ DEBUGPCR("UART parity error: %u", lastParity = isoh.stats.parity_err);
+ }
}
void iso_uart_stats_dump(void)
diff --git a/firmware/src/simtrace/iso7816_uart.h b/firmware/src/simtrace/iso7816_uart.h
index c5790c8..969e6f9 100644
--- a/firmware/src/simtrace/iso7816_uart.h
+++ b/firmware/src/simtrace/iso7816_uart.h
@@ -2,13 +2,13 @@
#define SIMTRACE_ISO7816_UART_H
struct simtrace_stats *iso_uart_stats_get(void);
+void iso_uart_report_errors(void);
void iso_uart_stats_dump(void);
void iso_uart_dump(void);
void iso_uart_rst(unsigned int state);
void iso_uart_rx_mode(void);
void iso_uart_clk_master(unsigned int master);
void iso_uart_init(void);
-void iso_uart_report_overrun(void);
void iso_uart_flush(void);
void iso_uart_idleflush(void);
diff --git a/firmware/src/simtrace/main_simtrace.c b/firmware/src/simtrace/main_simtrace.c
index 6bad290..b3f2665 100644
--- a/firmware/src/simtrace/main_simtrace.c
+++ b/firmware/src/simtrace/main_simtrace.c
@@ -236,5 +236,5 @@ void _main_func(void)
}
loopLow++;
- iso_uart_report_overrun();
+ iso_uart_report_errors();
}
personal git repositories of Harald Welte. Your mileage may vary