summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8702/debug-s5l8702.c
diff options
context:
space:
mode:
authorCástor Muñoz <cmvidal@gmail.com>2016-05-25 23:18:33 +0200
committerCástor Muñoz <cmvidal@gmail.com>2016-05-26 09:05:44 +0200
commitf6ed4f830666b7281308cca4bf90e0000dcfaef4 (patch)
tree5cdcbf641268ec6f9ad551d6c274bd2db384dca1 /firmware/target/arm/s5l8702/debug-s5l8702.c
parentd8989b15b79b4732df147b35bbf0beb39be06065 (diff)
downloadrockbox-f6ed4f830666b7281308cca4bf90e0000dcfaef4.tar.gz
rockbox-f6ed4f830666b7281308cca4bf90e0000dcfaef4.zip
iPod Classic: use PMU interrupts to detect accessories
- Speed auto detection is launched when an accessory is inserted, so the user doesn't need to modify settings to use accessories that operates at different speeds (or when the same accessory is unplugged and plugged again). - UART controller is disabled when no accessory is inserted, not much powersave but everything counts. Change-Id: If20c3617c2a87b6277fd7e0270031030c44fa953
Diffstat (limited to 'firmware/target/arm/s5l8702/debug-s5l8702.c')
-rw-r--r--firmware/target/arm/s5l8702/debug-s5l8702.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/firmware/target/arm/s5l8702/debug-s5l8702.c b/firmware/target/arm/s5l8702/debug-s5l8702.c
index 48a20a97c2..b274b5fc0a 100644
--- a/firmware/target/arm/s5l8702/debug-s5l8702.c
+++ b/firmware/target/arm/s5l8702/debug-s5l8702.c
@@ -138,22 +138,26 @@ bool dbg_hw_info(void)
138 else if(state==2) 138 else if(state==2)
139 { 139 {
140 extern struct uartc_port ser_port; 140 extern struct uartc_port ser_port;
141 int tx_stat, rx_stat, tx_speed, rx_speed; 141 bool opened = !!ser_port.uartc->port_l[ser_port.id];
142 char line_cfg[4]; 142 _DEBUG_PRINTF("UART %d: %s", ser_port.id, opened ? "opened":"closed");
143 int abr_stat; 143 if (opened)
144 uint32_t abr_cnt; 144 {
145 char *abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"}; 145 int tx_stat, rx_stat, tx_speed, rx_speed;
146 146 char line_cfg[4];
147 uartc_port_get_line_info(&ser_port, 147 int abr_stat;
148 &tx_stat, &rx_stat, &tx_speed, &rx_speed, line_cfg); 148 uint32_t abr_cnt;
149 abr_stat = uartc_port_get_abr_info(&ser_port, &abr_cnt); 149 char *abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"};
150 150
151 _DEBUG_PRINTF("UART %d:", ser_port.id); 151 uartc_port_get_line_info(&ser_port,
152 line++; 152 &tx_stat, &rx_stat, &tx_speed, &rx_speed, line_cfg);
153 _DEBUG_PRINTF("line: %s", line_cfg); 153 abr_stat = uartc_port_get_abr_info(&ser_port, &abr_cnt);
154 _DEBUG_PRINTF("Tx: %s, speed: %d", tx_stat ? "On":"Off", tx_speed); 154
155 _DEBUG_PRINTF("Rx: %s, speed: %d", rx_stat ? "On":"Off", rx_speed); 155 line++;
156 _DEBUG_PRINTF("ABR: %s, cnt: %u", abrstatus[abr_stat], abr_cnt); 156 _DEBUG_PRINTF("line: %s", line_cfg);
157 _DEBUG_PRINTF("Tx: %s, speed: %d", tx_stat ? "On":"Off", tx_speed);
158 _DEBUG_PRINTF("Rx: %s, speed: %d", rx_stat ? "On":"Off", rx_speed);
159 _DEBUG_PRINTF("ABR: %s, cnt: %u", abrstatus[abr_stat], abr_cnt);
160 }
157 line++; 161 line++;
158 _DEBUG_PRINTF("n_tx_bytes: %u", ser_port.n_tx_bytes); 162 _DEBUG_PRINTF("n_tx_bytes: %u", ser_port.n_tx_bytes);
159 _DEBUG_PRINTF("n_rx_bytes: %u", ser_port.n_rx_bytes); 163 _DEBUG_PRINTF("n_rx_bytes: %u", ser_port.n_rx_bytes);
@@ -162,7 +166,7 @@ bool dbg_hw_info(void)
162 _DEBUG_PRINTF("n_frame_err: %u", ser_port.n_frame_err); 166 _DEBUG_PRINTF("n_frame_err: %u", ser_port.n_frame_err);
163 _DEBUG_PRINTF("n_break_detect: %u", ser_port.n_break_detect); 167 _DEBUG_PRINTF("n_break_detect: %u", ser_port.n_break_detect);
164 _DEBUG_PRINTF("ABR n_abnormal: %u %u", 168 _DEBUG_PRINTF("ABR n_abnormal: %u %u",
165 ser_port.n_abnormal0, ser_port.n_abnormal1); 169 ser_port.n_abnormal0, ser_port.n_abnormal1);
166 } 170 }
167#endif 171#endif
168 else 172 else