// ----------------------------------------------------------------------------- // This function processes bytes that have been read into the Rx ring buffer // (rx_buffer_) by the Rx interrupt handler. void ProcessIncomingUBlox(void) { static size_t rx_buffer_tail = 0; // Disable the UART interrupt, empty the UART Rx buffer, then re-enable. VIC_ITCmd(UART0_ITLine, DISABLE); ReceiveUBloxData(); VIC_ITCmd(UART0_ITLine, ENABLE); while (rx_buffer_tail != rx_buffer_head_) { // Move the ring buffer tail forward. rx_buffer_tail = (rx_buffer_tail + 1) % UBLOX_RX_BUFFER_LENGTH; ProcessIncomingUBloxByte(rx_buffer_[rx_buffer_tail]); } }
// ----------------------------------------------------------------------------- void UBloxUARTHandler(void) { UART_ClearITPendingBit(UART0, UART_IT_Receive); ReceiveUBloxData(); }