summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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