1 Reply Latest reply on Oct 24, 2018 3:14 AM by AnjanaM_61

    Why can't I exit the while loop ?

      Hello,

       

      I don't understand why my program doesn't exit the main loop when an Rx interrupt occurs. It's working when I delete the loop.

      This is my program :

       

      #include "wiced.h"

      #include "sparcommon.h"

      #include "wiced_platform.h"

      #include "wiced_rtos.h"

      #include "wiced_hal_gpio.h"

      #include "wiced_bt_trace.h"

      #include "wiced_hal_puart.h"

       

       

      char data;

       

      void puar_rx_interrupt_callback(void* unused)

      {

         data = 'b';

      }

       

      APPLICATION_START()

      {

         

          wiced_hal_puart_init();

          wiced_hal_puart_register_interrupt(puar_rx_interrupt_callback);

          wiced_hal_puart_set_watermark_level(1);

       

          data='a';

       

           while(1)

          {

              wiced_hal_puart_write(data);

              wiced_rtos_delay_milliseconds(500,KEEP_THREAD_ACTIVE );

          }

      }

       

      Thank you for your help.