I am writing a code which has several sensors to read, a couple of devices on I2C interface, some MQTT messaging, a TFT display running and some other stuff. Basically, I am using the xTaskCreate function in order to organize the function calling like tasks. Let's say, so far so good, the code is running but I am not sure if the approach is right. At the moment I am not sure for how long can I go this way and how much the code can expand. The following is the pseudo-code for my approach which is very simple:
- void task_function(void)
- {
- Sensor_Init();
- while(1)
- {
- Sensor_Read();
- vTaskDelay(1000/portTICK_PERIOD_MS);
- }
- }
Thanks for you answers in advance
Marko