3 Replies Latest reply on Oct 16, 2017 1:19 AM by user_44413

    How to disable the interrupts in ISR for UART

    user_44413

      Hi all,

      I am using some ISR for UART UART SCB Mode ver 3.2 and using the following code

       

      uint8 flag = 0;

       

       

      CY_ISR(uartInterrupt)

      {

          uint32 source = 0;

           flag = 1;

         

          UART_UartPutString("\nFlag = 1\r\n");

          source = UART_GetRxInterruptSourceMasked();

          UART_ClearRxInterruptSource(source);

         

          UART_UartPutChar(UART_UartGetChar());

          /* `#END` */

      }

       

      int main()

      {

         

           uint32 ch;

          UART_Start();

          UART_SCB_IRQ_StartEx(uartInterrupt);

          //UART_RX_ISR_StartEx(uartInterrupt);

         

          /* Transmit string through UART */

          CyGlobalIntEnable; /* Uncomment this line to enable global interrupts. */

       

          UART_UartPutString ("\r\n***********************************************************************************\r\n");

          UART_UartPutString ("UART Initialisedr\r\n");

       

          for (;;)

          {

              ch = UART_UartGetChar();

       

               if(flag == 1)

              {

                flag = 0;

                ch = UART_UartGetChar();

                UART_UartPutChar(ch);

                UART_UartPutString("\nFlag = 0\r\n");

              }     

       

       

          }

      }

       

      Observation :

       

      1. Control is not coming out from ISR "CY_ISR(uartInterrupt)"

      2. Could not able to clear interrupt

       

      Please help