void UART0_IRQHandler() { uint32_t irtype = 0; if (NRF_UART0->EVENTS_TXDRDY) { irtype = 1; } else if (NRF_UART0->EVENTS_RXDRDY) { irtype = 2; } uart_irq(irtype, 0); }
void UART0_IRQHandler() { uint32_t irtype = 0; if((NRF_UART0->INTENSET & 0x80) && NRF_UART0->EVENTS_TXDRDY) { irtype = 1; } else if((NRF_UART0->INTENSET & 0x04) && NRF_UART0->EVENTS_RXDRDY) { irtype = 2; } uart_irq(irtype, 0); }
void vTaskISRHandler( void ) { static uint8_t pending; PROFILER_SUB = 1; /* Which interrupts are pending? */ pending = ioRead8(ITU_IRQ_ACTIVE); ioWrite8(ITU_IRQ_CLEAR, pending); //const uint8_t hex[] = "0123456789ABCDEF"; //ioWrite8(UART_DATA, hex[pending >> 4]); //ioWrite8(UART_DATA, hex[pending & 0x0F]); //ioWrite8(UART_DATA, '|'); BaseType_t do_switch = pdFALSE; if (pending & 0x10) { do_switch = command_interface_irq(); } if (pending & 0x08) { do_switch |= tape_recorder_irq(); } if (pending & 0x04) { do_switch |= usb_irq(); } if (pending & 0x02) { do_switch |= uart_irq(); } if (pending & 0x01) { do_switch |= xTaskIncrementTick(); } if (do_switch != pdFALSE) { vTaskSwitchContext(); } }
static void uart7_irq(void) { uart_irq(UART_7, 6); }
static void uart5_irq(void) { uart_irq(UART_5, 4); }
static void uart3_irq(void) { uart_irq(UART_3, 2); }
static void uart1_irq(void) { uart_irq(UART_1, 0); }
static void uart2_irq(void) { uart_irq((USART_TypeDef*)UART_2, 1); }
void uart4_irq() { uint32_t status_flags = LPUART4->STAT; uart_irq((status_flags & kLPUART_TxDataRegEmptyFlag), (status_flags & kLPUART_RxDataRegFullFlag), 4); }
void uart3_irq() { uart_irq(UART_HAL_IsTxDataRegEmpty(UART3_BASE), UART_HAL_IsRxDataRegFull(UART3_BASE), 3); }
void uart2_irq() { uart_irq(UART_HAL_IsTxDataRegEmpty(UART2_BASE), UART_HAL_IsRxDataRegFull(UART2_BASE), 2); }
void uart1_irq() { uart_irq(UART_HAL_IsTxDataRegEmpty(UART1_BASE), UART_HAL_IsRxDataRegFull(UART1_BASE), 1); }
void uart0_irq() { uart_irq(UART_HAL_IsTxDataRegEmpty(UART0_BASE), UART_HAL_IsRxDataRegFull(UART0_BASE), 0); if (UART_HAL_GetStatusFlag(UART0_BASE, kUartRxOverrun)) UART_HAL_ClearStatusFlag(UART0_BASE, kUartRxOverrun); }
void uart2_irq() {uart_irq((LPC_USART2->STAT & (1 << 2)) ? 2 : 1, 2);}
void uart1_irq() {uart_irq((LPC_USART1->STAT & (1 << 2)) ? 2 : 1, 1);}
static void uart7_irq(void) { uart_irq(6); }
static void uart8_irq(void) { uart_irq(7); }
void uart4_irq() { uart_irq(UART_HAL_IsTxDataRegEmpty(UART4_BASE), UART_HAL_IsRxDataRegFull(UART4_BASE), 4); }
static void uart1_irq(void) { uart_irq((USART_TypeDef*)UART_1, 0); }
static void uart1_irq(void) { uart_irq(0); }
static void uart3_irq(void) { uart_irq((USART_TypeDef*)UART_3, 2); }
static void uart2_irq(void) { uart_irq(1); }
static void uart2_irq(void) { uart_irq(UART_2, 1); }
static void uart3_irq(void) { uart_irq(2); }
static void uart4_irq(void) { uart_irq(UART_4, 3); }
static void uart4_irq(void) { uart_irq(3); }
static void uart6_irq(void) { uart_irq(UART_6, 5); }
static void uart5_irq(void) { uart_irq(4); }
static void uart8_irq(void) { uart_irq(UART_8, 7); }
static void uart6_irq(void) { uart_irq(5); }