From dc427314a1c13b7623216c87c3b1b0dcb5263922 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Wed, 26 Jan 2022 16:32:54 +0100 Subject: [PATCH] rework task priorities --- src/lorawan.cpp | 4 ++-- src/main.cpp | 26 +++++++++++++------------- src/mqttclient.cpp | 2 +- src/timekeeper.cpp | 2 +- src/timesync.cpp | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/lorawan.cpp b/src/lorawan.cpp index 32f7f1f7..3414bb9e 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -305,7 +305,7 @@ esp_err_t lmic_init(void) { "lmictask", // name of task 4096, // stack size of task (void *)1, // parameter of the task - 2, // priority of the task + 8, // priority of the task &lmicTask, // task handle 1); // CPU core @@ -314,7 +314,7 @@ esp_err_t lmic_init(void) { "lorasendtask", // name of task 3072, // stack size of task (void *)1, // parameter of the task - 1, // priority of the task + 2, // priority of the task &lorasendTask, // task handle 1); // CPU core diff --git a/src/main.cpp b/src/main.cpp index a2b2cc1a..c3c5af5c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,16 +27,16 @@ licenses. Refer to LICENSE.txt file in repository for more details. Task Core Prio Purpose ------------------------------------------------------------------------------- -ledloop* 0 3 blinks LEDs -spiloop# 0 2 reads/writes data on spi interface -lmictask* 1 2 MCCI LMiC LORAWAN stack -clockloop# 1 4 generates realtime telegrams for external clock -mqttloop# 1 2 reads/writes data on ETH interface -timesync_proc# 1 3 processes realtime time sync requests -irqhandler# 1 2 cyclic tasks (i.e. displayrefresh) triggered by -timers gpsloop* 1 1 reads data from GPS via serial or i2c -lorasendtask# 1 1 feeds data from lora sendqueue to lmcic -rmcd_process# 1 1 Remote command interpreter loop +ledloop* 0 1 blinks LEDs +spiloop# 0 2 reads/writes data on spi interface +lmictask* 1 8 MCCI LMiC LORAWAN stack +clockloop# 1 6 generates realtime telegrams for external clock +mqttloop# 1 5 reads/writes data on ETH interface +timesync_proc# 1 7 processes realtime time sync requests +irqhandler# 1 4 cyclic tasks (i.e. displayrefresh) triggered by +gpsloop* 1 3 reads data from GPS via serial or i2c +lorasendtask# 1 2 feeds data from lora sendqueue to lmcic +rmcd_process# 1 1 Remote command interpreter loop * spinning task # blocked/waiting task @@ -242,7 +242,7 @@ void setup() { "ledloop", // name of task 1024, // stack size of task (void *)1, // parameter of the task - 3, // priority of the task + 1, // priority of the task &ledLoopTask, // task handle 0); // CPU core #endif @@ -328,7 +328,7 @@ void setup() { "gpsloop", // name of task 4096, // stack size of task (void *)1, // parameter of the task - 1, // priority of the task + 3, // priority of the task &GpsTask, // task handle 1); // CPU core } @@ -430,7 +430,7 @@ void setup() { "irqhandler", // name of task 4096, // stack size of task (void *)1, // parameter of the task - 2, // priority of the task + 4, // priority of the task &irqHandlerTask, // task handle 1); // CPU core diff --git a/src/mqttclient.cpp b/src/mqttclient.cpp index d7ddb4bf..c8d85ceb 100644 --- a/src/mqttclient.cpp +++ b/src/mqttclient.cpp @@ -37,7 +37,7 @@ esp_err_t mqtt_init(void) { SEND_QUEUE_SIZE * PAYLOAD_BUFFER_SIZE); ESP_LOGI(TAG, "Starting MQTTloop..."); - xTaskCreatePinnedToCore(mqtt_client_task, "mqttloop", 4096, (void *)NULL, 1, + xTaskCreatePinnedToCore(mqtt_client_task, "mqttloop", 4096, (void *)NULL, 5, &mqttTask, 1); return ESP_OK; } diff --git a/src/timekeeper.cpp b/src/timekeeper.cpp index ab686650..55ea3d77 100644 --- a/src/timekeeper.cpp +++ b/src/timekeeper.cpp @@ -253,7 +253,7 @@ void clock_init(void) { "clockloop", // name of task 3072, // stack size of task (void *)1, // task parameter - 4, // priority of the task + 6, // priority of the task &ClockTask, // task handle 1); // CPU core diff --git a/src/timesync.cpp b/src/timesync.cpp index aa969897..9b2c5f99 100644 --- a/src/timesync.cpp +++ b/src/timesync.cpp @@ -34,7 +34,7 @@ void timesync_init(void) { "timesync_proc", // name of task 4096, // stack size of task (void *)1, // task parameter - 3, // priority of the task + 7, // priority of the task &timeSyncProcTask, // task handle 1); // CPU core }