From: Vladimir Garistov Date: Tue, 26 Mar 2024 12:19:10 +0000 (+0200) Subject: FIX: FreeRTOS blink example X-Git-Url: https://kolegite.com/gitweb/?a=commitdiff_plain;h=5904d223e4967d416f13c271ca7a77ce50b5ace6;p=vmks.git FIX: FreeRTOS blink example --- diff --git a/Examples/FreeRTOS/freertos_blink/freertos_blink.ino b/Examples/FreeRTOS/freertos_blink/freertos_blink.ino index 7eada26..ca8dac2 100644 --- a/Examples/FreeRTOS/freertos_blink/freertos_blink.ino +++ b/Examples/FreeRTOS/freertos_blink/freertos_blink.ino @@ -10,22 +10,22 @@ typedef struct } blink_args_t; +blink_args_t args1 = {t: 100 / portTICK_PERIOD_MS, pin: LED1}, + args2 = {t: 500 / portTICK_PERIOD_MS, pin: LED2}; + +TaskHandle_t blink1_handle = NULL; +TaskHandle_t blink2_handle = NULL; + void blink(void *pvParameters); void setup() { - TaskHandle_t blink1_handle = NULL; - TaskHandle_t blink2_handle = NULL; - - blink_args_t args1 = {t: 100 / portTICK_PERIOD_MS, pin: LED1}, - args2 = {t: 500 / portTICK_PERIOD_MS, pin: LED2}; - pinMode(LED1, OUTPUT); pinMode(LED2, OUTPUT); digitalWrite(LED1, LOW); digitalWrite(LED2, LOW); - xTaskCreate(blink, "blink1", THREAD_STACK_SIZE, (void *) &args1, 1, &blink1_handle); - xTaskCreate(blink, "blink2", THREAD_STACK_SIZE, (void *) &args2, 2, &blink2_handle); + xTaskCreate(blink, "blink1", THREAD_STACK_SIZE, (void *const) &args1, 1, &blink1_handle); + xTaskCreate(blink, "blink2", THREAD_STACK_SIZE, (void *const) &args2, 1, &blink2_handle); } void loop()