mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
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
This commit is contained in:
parent
d8989b15b7
commit
f6ed4f8306
2 changed files with 73 additions and 28 deletions
|
|
@ -138,22 +138,26 @@ bool dbg_hw_info(void)
|
|||
else if(state==2)
|
||||
{
|
||||
extern struct uartc_port ser_port;
|
||||
int tx_stat, rx_stat, tx_speed, rx_speed;
|
||||
char line_cfg[4];
|
||||
int abr_stat;
|
||||
uint32_t abr_cnt;
|
||||
char *abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"};
|
||||
bool opened = !!ser_port.uartc->port_l[ser_port.id];
|
||||
_DEBUG_PRINTF("UART %d: %s", ser_port.id, opened ? "opened":"closed");
|
||||
if (opened)
|
||||
{
|
||||
int tx_stat, rx_stat, tx_speed, rx_speed;
|
||||
char line_cfg[4];
|
||||
int abr_stat;
|
||||
uint32_t abr_cnt;
|
||||
char *abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"};
|
||||
|
||||
uartc_port_get_line_info(&ser_port,
|
||||
&tx_stat, &rx_stat, &tx_speed, &rx_speed, line_cfg);
|
||||
abr_stat = uartc_port_get_abr_info(&ser_port, &abr_cnt);
|
||||
uartc_port_get_line_info(&ser_port,
|
||||
&tx_stat, &rx_stat, &tx_speed, &rx_speed, line_cfg);
|
||||
abr_stat = uartc_port_get_abr_info(&ser_port, &abr_cnt);
|
||||
|
||||
_DEBUG_PRINTF("UART %d:", ser_port.id);
|
||||
line++;
|
||||
_DEBUG_PRINTF("line: %s", line_cfg);
|
||||
_DEBUG_PRINTF("Tx: %s, speed: %d", tx_stat ? "On":"Off", tx_speed);
|
||||
_DEBUG_PRINTF("Rx: %s, speed: %d", rx_stat ? "On":"Off", rx_speed);
|
||||
_DEBUG_PRINTF("ABR: %s, cnt: %u", abrstatus[abr_stat], abr_cnt);
|
||||
line++;
|
||||
_DEBUG_PRINTF("line: %s", line_cfg);
|
||||
_DEBUG_PRINTF("Tx: %s, speed: %d", tx_stat ? "On":"Off", tx_speed);
|
||||
_DEBUG_PRINTF("Rx: %s, speed: %d", rx_stat ? "On":"Off", rx_speed);
|
||||
_DEBUG_PRINTF("ABR: %s, cnt: %u", abrstatus[abr_stat], abr_cnt);
|
||||
}
|
||||
line++;
|
||||
_DEBUG_PRINTF("n_tx_bytes: %u", ser_port.n_tx_bytes);
|
||||
_DEBUG_PRINTF("n_rx_bytes: %u", ser_port.n_rx_bytes);
|
||||
|
|
@ -162,7 +166,7 @@ bool dbg_hw_info(void)
|
|||
_DEBUG_PRINTF("n_frame_err: %u", ser_port.n_frame_err);
|
||||
_DEBUG_PRINTF("n_break_detect: %u", ser_port.n_break_detect);
|
||||
_DEBUG_PRINTF("ABR n_abnormal: %u %u",
|
||||
ser_port.n_abnormal0, ser_port.n_abnormal1);
|
||||
ser_port.n_abnormal0, ser_port.n_abnormal1);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue