mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
IAP: First steps towards true multiport state
iap_reset_state() and iap_getc() are now passed the logical IAP port (0 is dock/only connector, 1 is headphone connector) Change-Id: I97421146a8cab032b90c9b4eb55b50aa00d73312
This commit is contained in:
parent
e2f2ee88c8
commit
0456ec5630
13 changed files with 32 additions and 20 deletions
|
|
@ -188,11 +188,12 @@ void SERIAL_ISR(int port)
|
|||
static bool newpkt = true;
|
||||
char temp;
|
||||
|
||||
#if defined(IPOD_COLOR) || defined(IPOD_4G) || defined(IPOD_MINI) || defined(IPOD_MINI2G)
|
||||
#ifdef HAVE_IAP_MULTIPORT
|
||||
if (port && SERn != &SER1)
|
||||
SERn = &SER1;
|
||||
else if (!port && SERn != &SER0)
|
||||
SERn = &SER0;
|
||||
port = !port; /* UART0 is headphone, ie IAP1 */
|
||||
#else
|
||||
(void)port;
|
||||
#endif
|
||||
|
|
@ -261,7 +262,7 @@ void SERIAL_ISR(int port)
|
|||
}
|
||||
}
|
||||
}
|
||||
bool pkt = iap_getc(temp);
|
||||
bool pkt = iap_getc(IF_IAP_MP(port,) temp);
|
||||
if(newpkt && !pkt)
|
||||
SERn->autobaud = 0; /* Found good baud */
|
||||
newpkt = pkt;
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ void iap_rx_isr(int len, char *data, char *err, uint32_t abr_cnt)
|
|||
uartc_port_set_rx_mode(&ser_port, UCON_MODE_INTREQ);
|
||||
|
||||
/* enter SOF state */
|
||||
iap_getc(0xff);
|
||||
iap_getc(IF_IAP_MP(0,) 0xff);
|
||||
|
||||
abr_status = ABR_STATUS_SYNCING;
|
||||
sync_retry = 2; /* we are expecting [0xff] 0x55 */
|
||||
|
|
@ -190,7 +190,7 @@ void iap_rx_isr(int len, char *data, char *err, uint32_t abr_cnt)
|
|||
/* process received data */
|
||||
while (len--)
|
||||
{
|
||||
bool sync_done = !iap_getc(*data++);
|
||||
bool sync_done = !iap_getc(IF_IAP_MP(0,) *data++);
|
||||
|
||||
if (abr_status == ABR_STATUS_SYNCING)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ static void iap_rx_isr(int len, char *data, char *err, uint32_t abr_cnt)
|
|||
uartc_port_set_rx_mode(&ser_port, UCON_MODE_INTREQ);
|
||||
|
||||
/* enter SOF state */
|
||||
iap_getc(0xff);
|
||||
iap_getc(IF_IAP_MP(0,) 0xff);
|
||||
|
||||
abr_status = ABR_STATUS_SYNCING;
|
||||
sync_retry = 2; /* we are expecting [0xff] 0x55 */
|
||||
|
|
@ -230,7 +230,7 @@ static void iap_rx_isr(int len, char *data, char *err, uint32_t abr_cnt)
|
|||
/* process received data */
|
||||
while (len--)
|
||||
{
|
||||
bool sync_done = !iap_getc(*data++);
|
||||
bool sync_done = !iap_getc(IF_IAP_MP(0,) *data++);
|
||||
|
||||
if (abr_status == ABR_STATUS_SYNCING)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ static void iap_rx_isr(int len, char *data, char *err, uint32_t abr_cnt)
|
|||
uartc_port_set_rx_mode(&ser_port, UCON_MODE_INTREQ);
|
||||
|
||||
/* enter SOF state */
|
||||
iap_getc(0xff);
|
||||
iap_getc(IF_IAP_MP(0,) 0xff);
|
||||
|
||||
abr_status = ABR_STATUS_SYNCING;
|
||||
sync_retry = 2; /* we are expecting [0xff] 0x55 */
|
||||
|
|
@ -230,7 +230,7 @@ static void iap_rx_isr(int len, char *data, char *err, uint32_t abr_cnt)
|
|||
/* process received data */
|
||||
while (len--)
|
||||
{
|
||||
bool sync_done = !iap_getc(*data++);
|
||||
bool sync_done = !iap_getc(IF_IAP_MP(0,) *data++);
|
||||
|
||||
if (abr_status == ABR_STATUS_SYNCING)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ static void iap_rx_isr(int len, char *data, char *err, uint32_t abr_cnt)
|
|||
uartc_port_set_rx_mode(&ser_port, UCON_MODE_INTREQ);
|
||||
|
||||
/* enter SOF state */
|
||||
iap_getc(0xff);
|
||||
iap_getc(IF_IAP_MP(0,) 0xff);
|
||||
|
||||
abr_status = ABR_STATUS_SYNCING;
|
||||
sync_retry = 2; /* we are expecting [0xff] 0x55 */
|
||||
|
|
@ -230,7 +230,7 @@ static void iap_rx_isr(int len, char *data, char *err, uint32_t abr_cnt)
|
|||
/* process received data */
|
||||
while (len--)
|
||||
{
|
||||
bool sync_done = !iap_getc(*data++);
|
||||
bool sync_done = !iap_getc(IF_IAP_MP(0,) *data++);
|
||||
|
||||
if (abr_status == ABR_STATUS_SYNCING)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue