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:
@@ -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 ============
|
||||
//============================
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
//===============================
|
||||
|
||||
Reference in New Issue
Block a user