summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8702/debug-s5l8702.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/s5l8702/debug-s5l8702.c')
-rw-r--r--firmware/target/arm/s5l8702/debug-s5l8702.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8702/debug-s5l8702.c b/firmware/target/arm/s5l8702/debug-s5l8702.c
index c49737756c..a2c6c0b193 100644
--- a/firmware/target/arm/s5l8702/debug-s5l8702.c
+++ b/firmware/target/arm/s5l8702/debug-s5l8702.c
@@ -30,6 +30,9 @@
30#include "power.h" 30#include "power.h"
31#include "pmu-target.h" 31#include "pmu-target.h"
32#include "pcm-target.h" 32#include "pcm-target.h"
33#ifdef HAVE_SERIAL
34#include "uc8702.h"
35#endif
33 36
34#define DEBUG_CANCEL BUTTON_MENU 37#define DEBUG_CANCEL BUTTON_MENU
35 38
@@ -46,7 +49,11 @@ bool dbg_hw_info(void)
46 int line; 49 int line;
47 int i; 50 int i;
48 unsigned int state = 0; 51 unsigned int state = 0;
52#ifdef UC8702_DEBUG
53 const unsigned int max_states=3;
54#else
49 const unsigned int max_states=2; 55 const unsigned int max_states=2;
56#endif
50 57
51 lcd_clear_display(); 58 lcd_clear_display();
52 lcd_setfont(FONT_SYSFIXED); 59 lcd_setfont(FONT_SYSFIXED);
@@ -100,6 +107,41 @@ bool dbg_hw_info(void)
100 _DEBUG_PRINTF("backlight: %s", pmu_read(0x29) ? "on" : "off"); 107 _DEBUG_PRINTF("backlight: %s", pmu_read(0x29) ? "on" : "off");
101 _DEBUG_PRINTF("brightness value: %d", pmu_read(0x28)); 108 _DEBUG_PRINTF("brightness value: %d", pmu_read(0x28));
102 } 109 }
110#ifdef UC8702_DEBUG
111 else if(state==2)
112 {
113 extern struct uartc_port ser_port;
114 int tx_stat, rx_stat, tx_speed, rx_speed;
115 char line_cfg[4];
116 int abr_stat;
117 unsigned int abr_cnt;
118
119 char *abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"};
120
121 uartc_port_get_line_info(&ser_port, &tx_stat, &rx_stat,
122 &tx_speed, &rx_speed, line_cfg);
123
124 abr_stat = uartc_port_get_abr_info(&ser_port, &abr_cnt);
125
126 _DEBUG_PRINTF("UART %d:", ser_port.id);
127 line++;
128 _DEBUG_PRINTF("line: %s", line_cfg);
129 _DEBUG_PRINTF("Tx: %s, speed: %d", tx_stat ? "On":"Off", tx_speed);
130 _DEBUG_PRINTF("Rx: %s, speed: %d", rx_stat ? "On":"Off", rx_speed);
131 _DEBUG_PRINTF("ABR: %s, cnt: %d", abrstatus[abr_stat], abr_cnt);
132 line++;
133 _DEBUG_PRINTF("n_tx_bytes: %u", ser_port.n_tx_bytes);
134 _DEBUG_PRINTF("n_rx_bytes: %u", ser_port.n_rx_bytes);
135 _DEBUG_PRINTF("n_ovr_err: %u", ser_port.n_ovr_err);
136 _DEBUG_PRINTF("n_parity_err: %u", ser_port.n_parity_err);
137 _DEBUG_PRINTF("n_frame_err: %u", ser_port.n_frame_err);
138 _DEBUG_PRINTF("n_break_detect: %u", ser_port.n_break_detect);
139 _DEBUG_PRINTF("n_abnormal0: %u", ser_port.n_abnormal0);
140 _DEBUG_PRINTF("n_abnormal1: %u", ser_port.n_abnormal1);
141
142 sleep(HZ/20);
143 }
144#endif
103 else 145 else
104 { 146 {
105 state=0; 147 state=0;