Skip to content

Commit ad2968c

Browse files
committed
Fixed BasicMultiThreading.ino
1 parent f189822 commit ad2968c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libraries/MultiThreading/examples/BasicMultiThreading/BasicMultiThreading.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,29 @@ void setup() {
5757
, 1024 // Stack size
5858
, NULL // When no parameter is used, simply pass NULL
5959
, 1 // Priority
60-
, task_handle // With task handle we will be able to manipulate with this task.
60+
, &task_handle // With task handle we will be able to manipulate with this task.
6161
, ARDUINO_RUNNING_CORE // Core on which the task will run
6262
);
6363

6464
// Now the task scheduler, which takes over control of scheduling individual tasks, is automatically started.
6565
}
6666

6767
void loop(){
68+
/*
6869
if(task_handle != NULL){ // Make sure that the task actually exists
6970
delay(10000);
7071
vTaskDelete(task_handle); // Delete task
7172
task_handle = NULL; // prevent calling vTaskDelete on non-existing task
7273
}
74+
*/
7375
}
7476

7577
/*--------------------------------------------------*/
7678
/*---------------------- Tasks ---------------------*/
7779
/*--------------------------------------------------*/
7880

7981
void TaskBlink(void *pvParameters){ // This is a task.
80-
uint32_t blink_delay = (uint32_t) *pvParameters;
82+
uint32_t blink_delay = *((uint32_t*)pvParameters);
8183

8284
/*
8385
Blink

0 commit comments

Comments
 (0)