FreeRTOS Add Boot Time

This commit is contained in:
2024-12-29 17:24:29 +08:00
parent dbfdce8ec9
commit f4f1772db6
8 changed files with 85 additions and 6 deletions

View File

@@ -19,6 +19,7 @@
#include "ZE07CO.hpp"
#include "MHZ14B.hpp"
#include "HC-12.hpp"
#include "boot_time.hpp"
#ifndef PICO_DEFAULT_LED_PIN
#warning pio/hello_pio example requires a board with a regular LED
@@ -109,6 +110,7 @@ int main(int argc, char *argv[])
TaskHandle_t CH4_xHandle = NULL;
TaskHandle_t CO_xHandle = NULL;
TaskHandle_t CO2_xHandle = NULL;
TaskHandle_t BOOT_TIME_xHandle = NULL;
// 板载CPU温度
@@ -146,6 +148,12 @@ int main(int argc, char *argv[])
if (xReturned == errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY) {
printf("CO2() Task Error!");
}
// Boot Time
xReturned = xTaskCreate(BOOT_TIME, "BOOT_TIME task", 512, NULL, tskIDLE_PRIORITY, &BOOT_TIME_xHandle);
if (xReturned == errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY) {
printf("CO2() Task Error!");
}
vTaskStartScheduler();