I do my 4 bytes waiting in task. As I know It’s unreal to run task before scheduler started. I never suspend scheduler, never do critical sections, no mutex or semaphores in my proj.
I hear Beep because of my function BeepMini(). And I look at amo and I see that amo == 1. Why?
int main(void){
USART_0_init();
USART_1_init();
xTaskCreate(vTaskWifiStream, "", 200, NULL, tskIDLE_PRIORITY+1, NULL);
xTaskCreate(vBlinkOnboardUserLED, "", 200, NULL, tskIDLE_PRIORITY+1, NULL);
vTaskStartScheduler();
//we should never be here because of scheduler
while(1);
}
static void vTaskWifiStream( void *pvParameters ){
uint8_t pack[4] = {0};
uint8_t amo = xStreamBufferReceive(UDPStreamBuffer, ( void * )pack, sizeof(pack), portMAX_DELAY);
BeepMini();
while(1);
}