Hi,
I am moving from FreeRTOS to Zephyr. So I jused some of your simple example for trying to understand basics. I edited it little bit.
I have some default task from example called main. In the main is while loop and in this loop is checked variable startTX. When button is pushed the ISR function sets the variable startTX = true, then in the infinite loop some data are trasnmitted (depends on startTX state). Unfortunetelly this works only when I add k_sleep(10) or LOG_INF("Main completed"); at the end of while.
My question is why the infinite while in the main is not infinite? It looks like the while runs only once and at the end of loop, the Zephyr goes to some idle state and main task is not running. I have only one task main. Time slicing is defult off.
Here is my loop:
while (1) { if (startTx){ LOG_INF("Start TX"); if (ready) { gpio_pin_set_dt(&led,1); ready = false; startTx = false; esb_flush_tx(); err = esb_write_payload(&tx_payload); if (err) { LOG_ERR("Payload write failed, err %d", err); } tx_payload.data[1]++; LOG_INF("Packet sent"); } } //k_sleep(K_MSEC(10)); LOG_INF("Main completed"); }