mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
PP502x: Hacky technique to switch UARTs based on which IRQ was triggered
This lets us have multiple serial ports enabled, which will help with 4th-gen ipods that have a serial port in the HP jack as well in the dock. Change-Id: I6a00a776020848a6908413e05a6f27bad65b2d8e
This commit is contained in:
parent
85f731c1e0
commit
f27de46472
2 changed files with 21 additions and 4 deletions
|
|
@ -188,12 +188,26 @@ static unsigned char rx_readc(void)
|
|||
return (*base_RBR & 0xFF);
|
||||
}
|
||||
|
||||
void SERIAL_ISR(void)
|
||||
void SERIAL_ISR(int port)
|
||||
{
|
||||
static int badbaud = 0;
|
||||
static bool newpkt = true;
|
||||
char temp;
|
||||
|
||||
if (port && base_RBR != &SER1_RBR) {
|
||||
base_RBR = &SER1_RBR;
|
||||
base_THR = &SER1_THR;
|
||||
base_LCR = &SER1_LCR;
|
||||
base_LSR = &SER1_LSR;
|
||||
base_DLL = &SER1_DLL;
|
||||
} else if (!port && base_RBR != &SER0_RBR) {
|
||||
base_RBR = &SER0_RBR;
|
||||
base_THR = &SER0_THR;
|
||||
base_LCR = &SER0_LCR;
|
||||
base_LSR = &SER0_LSR;
|
||||
base_DLL = &SER0_DLL;
|
||||
}
|
||||
|
||||
while(rx_rdy())
|
||||
{
|
||||
temp = rx_readc();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue