I understand the one thread/task per priority, but I'm struggling to define the details of a thread.
In the case of my use-case:
- I have 2 priorities, so 2 threads => 1. Processing, 2. Measurement
- The Measurement thread contains 3 sensors, one updating at 100Hz, another at 25Hz, and one at 10Hz
Essentially my Measurement thread becomes:
` for(;;) { if (sensor_1_data_ready())process_sensor_1(); if (sensor_2_data_ready())process_sensor_2(); if (sensor_3_data_ready())process_sensor_3();
sleep(10e-3); // vTaskDelay or RTOS equivallent
} `
Is this the common implementation? Or is there a better way of doing this?