-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskDelete.cpp
More file actions
36 lines (28 loc) · 1.04 KB
/
TaskDelete.cpp
File metadata and controls
36 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "esp_log.h"
#include "Queues.h"
#include "DataTypes.h"
#include "TaskDelete.h"
namespace tinyalg::waveu {
static const char* TAG = "TaskDelete";
void waveformDataGenerationTaskDelete() {
data_generation_msg_type_t task_termination_msg = {
.data = false, // Whichever ture or false
.terminationTrigger = true, // Signals termination
};
if (xQueueSend(dataGenerationQueue, (void *)&task_termination_msg, pdMS_TO_TICKS(1000)) != pdPASS) {
ESP_LOGW(TAG, "Requesting termination of waveformDataGenerationTask failed.");
}
}
void waveformDataOutputTaskDelete() {
data_output_msg_type_t task_termination_msg = {
.data = false, // Whichever ture or false
.terminationTrigger = true, // Signals termination
};
if (xQueueSend(dataOutputQueue, (void *)&task_termination_msg, pdMS_TO_TICKS(1000)) != pdPASS) {
ESP_LOGW(TAG, "Requesting termination of waveformDataOutputTask failed.");
}
}
}