diff --git a/main/main.c b/main/main.c index d2e8874..09dc369 100644 --- a/main/main.c +++ b/main/main.c @@ -3,13 +3,13 @@ #include "tasks.h" #include -extern QueueHandle_t blink_rate_q; +extern QueueHandle_t blink_cmd_q; void app_main(void) { TaskHandle_t task_handle_blink; TaskHandle_t task_handle_blink_cycle; - blink_rate_q = xQueueCreate(10, sizeof(BlinkCmd_t)); + blink_cmd_q = xQueueCreate(10, sizeof(BlinkCmd_t)); // Static here, since main exits, this becomes a dead pointer almost instantly static BlinkCmd_t initial_command = {.variant = BLINK_STATE, .state = 1}; diff --git a/main/task_blink.c b/main/task_blink.c index 6a977a9..4989b62 100644 --- a/main/task_blink.c +++ b/main/task_blink.c @@ -11,7 +11,7 @@ #include "tasks.h" -QueueHandle_t blink_rate_q; +QueueHandle_t blink_cmd_q; void blink_cmd_print(const BlinkCmd_t *cmd) { printf("BlinkCmd { "); @@ -52,7 +52,7 @@ void task_blink(void *pvParams) { } while (1) { - if (pdPASS == xQueueReceive(blink_rate_q, &command, 0)) + if (pdPASS == xQueueReceive(blink_cmd_q, &command, 0)) blink_cmd_print(&command); switch (command.variant) { @@ -79,28 +79,28 @@ void task_blink_cycle(void *pvParams) { vTaskDelay(pdMS_TO_TICKS(2000)); - if (xQueueSend(blink_rate_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { + if (xQueueSend(blink_cmd_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { printf("Error sending blink command..."); } vTaskDelay(pdMS_TO_TICKS(2000)); cmd.rate = 50; - if (xQueueSend(blink_rate_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { + if (xQueueSend(blink_cmd_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { printf("Error sending blink command..."); } vTaskDelay(pdMS_TO_TICKS(2000)); cmd.rate = 25; - if (xQueueSend(blink_rate_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { + if (xQueueSend(blink_cmd_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { printf("Error sending blink command..."); } vTaskDelay(pdMS_TO_TICKS(2000)); cmd.rate = 500; - if (xQueueSend(blink_rate_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { + if (xQueueSend(blink_cmd_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { printf("Error sending blink command..."); } @@ -108,7 +108,7 @@ void task_blink_cycle(void *pvParams) { cmd.variant = BLINK_STATE; cmd.state = 1; - if (xQueueSend(blink_rate_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { + if (xQueueSend(blink_cmd_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { printf("Error sending blink command..."); } @@ -116,7 +116,7 @@ void task_blink_cycle(void *pvParams) { cmd.variant = BLINK_RATE; cmd.rate = 200; - if (xQueueSend(blink_rate_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { + if (xQueueSend(blink_cmd_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { printf("Error sending blink command..."); } @@ -124,7 +124,7 @@ void task_blink_cycle(void *pvParams) { cmd.variant = BLINK_STATE; cmd.state = 0; - if (xQueueSend(blink_rate_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { + if (xQueueSend(blink_cmd_q, &cmd, pdMS_TO_TICKS(200)) != pdPASS) { printf("Error sending blink command..."); }