void __attribute__ ((interrupt,no_auto_psv)) _U3RXInterrupt(void) { if(gps_enabled()) { // PIC24 requires explicit clear of UART Rx interrupt flag! U3RX_Clear_Intr_Status_Bit; gps_NMEA_rcv(ReadUART3()); } else { csk_uart2_inchar(ReadUART3()); } }
// UART3 RX ISR void __attribute__ ((interrupt,no_auto_psv)) _U3RXInterrupt(void) { // Clear the interrupt status of UART1 RX U3RX_Clear_Intr_Status_Bit; if(DataRdyUART3()) { incoming_char = ReadUART3(); // Get the character coming from USB UART while(BusyUART1()); WriteUART1(incoming_char); // Send the character to the GSM UART while(BusyUART3()); WriteUART3(incoming_char); // Send the character to the USB UART } }
//******************************************************************************************* // UART 3 interrupt handler // it is set at priority level 2 //******************************************************************************************* void __ISR(_UART3_VECTOR, ipl2) IntUart3Handler(void) { unsigned char theChar; // Is this an RX interrupt? if (mU3RXGetIntFlag()) { theChar = ReadUART3(); store_char(theChar, &rx_buffer3); // Clear the RX interrupt Flag (must be AFTER the read) mU3RXClearIntFlag(); } // We don't care about TX interrupt if ( mU3TXGetIntFlag() ) { mU3TXClearIntFlag(); } }