Skip to content

Multi threading examples (tasks, queues, semaphores, mutexes) #7660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Feb 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed BasicMultiThreading.ino
  • Loading branch information
PilnyTomas committed Jan 4, 2023
commit ad2968c1bb6b00bef8f0fb9ff8d395124969d37e
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,29 @@ void setup() {
, 1024 // Stack size
, NULL // When no parameter is used, simply pass NULL
, 1 // Priority
, task_handle // With task handle we will be able to manipulate with this task.
, &task_handle // With task handle we will be able to manipulate with this task.
, ARDUINO_RUNNING_CORE // Core on which the task will run
);

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

void loop(){
/*
if(task_handle != NULL){ // Make sure that the task actually exists
delay(10000);
vTaskDelete(task_handle); // Delete task
task_handle = NULL; // prevent calling vTaskDelete on non-existing task
}
*/
}

/*--------------------------------------------------*/
/*---------------------- Tasks ---------------------*/
/*--------------------------------------------------*/

void TaskBlink(void *pvParameters){ // This is a task.
uint32_t blink_delay = (uint32_t) *pvParameters;
uint32_t blink_delay = *((uint32_t*)pvParameters);

/*
Blink
Expand Down