- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Tags:
- puart interrupt
- uart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You should not use while loop in Application start.
Since application is also running on RTOS thread in parallel with other threads, if you use while loop in Application start it will lead to erratic non-deterministic behavior or dead locks.
Regards,
Anjana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You should not use while loop in Application start.
Since application is also running on RTOS thread in parallel with other threads, if you use while loop in Application start it will lead to erratic non-deterministic behavior or dead locks.
Regards,
Anjana