46 lines
1.1 KiB
C
46 lines
1.1 KiB
C
#include <stdio.h>
|
|
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
#include "freertos/queue.h"
|
|
|
|
#include "esp_log.h"
|
|
|
|
#include "app_lib_wifi_impl.h"
|
|
#include "app_lib_fs_impl.h"
|
|
|
|
#include "user_board.h"
|
|
|
|
void vTaskLEDs(void *pvParameters);
|
|
extern TaskHandle_t xTaskLEDsHandle;
|
|
|
|
void vTasBatteryExample(void *pvParameters);
|
|
extern TaskHandle_t xTaskBatteryExampleHandle;
|
|
|
|
extern TaskHandle_t xTaskEPDExampleHandle;
|
|
void vTaskEPDExample(void *pvParameters);
|
|
|
|
void app_lib_i2c_system_init(void);
|
|
|
|
static const char *TAG = "APP_MAIN";
|
|
|
|
void app_main(void) {
|
|
// Init system peripherals.
|
|
app_lib_i2c_system_init();
|
|
app_lib_start_wifi();
|
|
app_lib_fs_init();
|
|
|
|
ESP_LOGI(TAG, "System initialized, starting tasks.");
|
|
|
|
// Init tasks
|
|
xTaskCreate(vTaskLEDs, "TASK_LEDs", 1024, NULL, 4, &xTaskLEDsHandle);
|
|
xTaskCreate(vTasBatteryExample, "TASK_BAT", 2048, NULL, 4, &xTaskBatteryExampleHandle);
|
|
xTaskCreate(vTaskEPDExample, "TASK_EPD", 2048, NULL, 4, &xTaskEPDExampleHandle);
|
|
|
|
ESP_LOGI(TAG, "Task created, suspending current task.");
|
|
|
|
for(;;) {
|
|
vTaskSuspend(NULL);
|
|
}
|
|
}
|