AnsweredAssumed Answered

How to check which interrupt has fired now?

Question asked by vikranth Nk on Apr 25, 2018
Latest reply on Apr 25, 2018 by Mark Butcher

I am using both receive and transmit interrupts, but in my code interrupt handler is only one for both receive and transmit is it right?

 

Iam using FRDMKE04 dev board,    and    SDK_2.3.1_FRDM-KE04Z

following is my sample code 

#include "board.h"
#include "fsl_uart.h"
#include "pin_mux.h"

 

void UART0_IRQHandler(void)
{

   if(receive interrupt)  ///// I need to know this condition

   {
      uint8_t data;
      /* If new data arrived. */
      if ((kUART_RxDataRegFullFlag | kUART_RxOverrunFlag) & UART_GetStatusFlags(UART0))
      {
            data = UART_ReadByte(UART0);
            // Copy the byte into the local FIFO, if it won't cause an overflow
            if(UART_RxBuffer_WritePtr < EUSART_RX_BUFFER_SIZE)
               {
                  UART_RxBuffer[UART_RxBuffer_WritePtr++] = data;

                  if(UART_RxBuffer_WritePtr >= EUSART_RX_BUFFER_SIZE)
               {
                     UART_RxBuffer_WritePtr = 0;
         }

                  UART_NumBytesInRxBuffer++; /* Update counter */
   }

   elseif(transimit interrupt is fired) ///// I need to know this condition

   {


   }

}

Outcomes