Oursource task_fans and task_buzzer

- outsource task_fans and task_buzzer from main.cpp to their source files
- use task parameters to pass necessary configs and objects
- adjust task priorities (display was too low)
This commit is contained in:
jonny_jr9
2024-02-19 13:54:22 +01:00
parent 4951abbcbf
commit 26761f4a80
8 changed files with 73 additions and 48 deletions

View File

@@ -2,6 +2,19 @@
static const char *TAG_BUZZER = "buzzer";
//======================================
//============ buzzer task =============
//======================================
// Task that repeatedly handles the buzzer object (process Queued beeps)
void task_buzzer(void * param_buzzerObject){
ESP_LOGI("task_buzzer", "Start of buzzer task...");
buzzer_t * buzzer = (buzzer_t *)param_buzzerObject;
//run function that waits for a beep events to arrive in the queue
//and processes them
buzzer->processQueue();
}
//============================
//========== init ============
//============================

View File

@@ -53,4 +53,9 @@ class buzzer_t {
};
//======================================
//============ buzzer task =============
//======================================
// Task that repeatedly handles the buzzer object (process Queued beeps)
// Note: pointer to globally initialized buzzer object has to be passed as task-parameter
void task_buzzer(void * param_buzzerObject);

View File

@@ -19,7 +19,7 @@ void task_motorctl( void * task_motorctl_parameters ){
while(1){
objects->motorRight->handle();
objects->motorLeft->handle();
vTaskDelay(10 / portTICK_PERIOD_MS);
vTaskDelay(15 / portTICK_PERIOD_MS);
}
}

View File

@@ -12,6 +12,7 @@ extern "C"
//====== struct/type declarations ======
//=======================================
//global structs and types that need to be available for all boards
//this file is necessary to prevent dependency loop between motordrivers.hpp and motorctl.hpp since
//===============================