void c_irq_handler(volatile unsigned int* sp) { unsigned int pendingIrq = Arm_IrqGetPending(); switch (pendingIrq) { case interrupt_source_system_timer: { // Note IRQ has no acccess to peripherals? :( Scheduler_TimerTick((thread_regs*)(sp - 1)); break; } case interrupt_source_uart: { unsigned char read = Uart_Read(); // Echo it back Uart_Send(read); if (read == 'x') { Uart_SendString("\r\n* * * Rebooting. * * *\r\n"); reboot(); } break; } default: printf("Unhandled IRQ pending, id:%d.\n", pendingIrq); break; } }
/******************************************************************************* * @function_name: NFCIrqTXCallback * @function_file: Dr_Uart_NFC.c * @描述:计量L1路发送中断回调函数 * @参数: * @param:ser 串口的参数 *--------------------------------------------------------- * @修改人:ffq (2013-10-09) ******************************************************************************/ static void EMUL1IrqTXCallback(void) { Uart_Send(UART_EMU_L1); }
/******************************************************************************* * @function_name: RS485IrqTXCallback * @function_file: Dr_Uart_RS485.c * @描述:RS485发送中断回调函数 * @入口参数: * @:ser 串口的参数 *--------------------------------------------------------- * @修改人:ffq (2013-10-09) ******************************************************************************/ static void RS485IrqTXCallback(void) { Uart_Send(UART_485); }
/******************************************************************************* * @function_name: MASHIrqTXCallback * @function_file: Dr_Uart_MASH.c * @描述:RS485发送中断回调函数 * @入口参数: * @:ser 串口的参数 *--------------------------------------------------------- * @修改人:ffq (2013-10-09) ******************************************************************************/ static void MASHIrqTXCallback(void) { Uart_Send(UART_MASH); }
/******************************************************************************* * @function_name: IRIrqTXCallback * @function_file: Dr_Uart_IR.c * @描述:IR发送中断回调函数 * @入口参数: 无 * @出口参数: *--------------------------------------------------------- * @修改人:ffq (2013-10-09) ******************************************************************************/ static void IRIrqTXCallback(void) { Uart_Send(UART_IR); }