Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+21 -4
+6 -3
firmware/target/arm/pp/system-pp502x.c
··· 47 47 #if !defined(BOOTLOADER) || defined(HAVE_BOOTLOADER_USB_MODE) 48 48 extern void TIMER1(void); 49 49 extern void TIMER2(void); 50 - extern void SERIAL_ISR(void); 50 + extern void SERIAL_ISR(int port); 51 51 52 52 #if defined(HAVE_ADJUSTABLE_CPU_FREQ) && (NUM_CORES > 1) 53 53 static struct corelock cpufreq_cl SHAREDBSS_ATTR; ··· 187 187 /* end PBELL_VIBE500 */ 188 188 #endif 189 189 #ifdef IPOD_ACCESSORY_PROTOCOL 190 - else if (CPU_HI_INT_STAT & (SER0_MASK | SER1_MASK)) { 191 - SERIAL_ISR(); 190 + else if (CPU_HI_INT_STAT & SER0_MASK) { 191 + SERIAL_ISR(0); 192 + } 193 + else if (CPU_HI_INT_STAT & SER1_MASK) { 194 + SERIAL_ISR(1); 192 195 } 193 196 #endif 194 197 } else {
+15 -1
firmware/target/arm/pp/uart-pp.c
··· 188 188 return (*base_RBR & 0xFF); 189 189 } 190 190 191 - void SERIAL_ISR(void) 191 + void SERIAL_ISR(int port) 192 192 { 193 193 static int badbaud = 0; 194 194 static bool newpkt = true; 195 195 char temp; 196 + 197 + if (port && base_RBR != &SER1_RBR) { 198 + base_RBR = &SER1_RBR; 199 + base_THR = &SER1_THR; 200 + base_LCR = &SER1_LCR; 201 + base_LSR = &SER1_LSR; 202 + base_DLL = &SER1_DLL; 203 + } else if (!port && base_RBR != &SER0_RBR) { 204 + base_RBR = &SER0_RBR; 205 + base_THR = &SER0_THR; 206 + base_LCR = &SER0_LCR; 207 + base_LSR = &SER0_LSR; 208 + base_DLL = &SER0_DLL; 209 + } 196 210 197 211 while(rx_rdy()) 198 212 {