Add KiCad files and USB CDC logging support

This commit is contained in:
2025-12-16 08:57:32 +02:00
parent de959b9a8b
commit f3d5e4018b
18 changed files with 7557 additions and 14 deletions

View File

@@ -1,3 +1,9 @@
/*
* Developed by TComLab
* Version: v0.1
* Date: 2025-12-15
*/
#include <stddef.h>
#include "freertos/FreeRTOS.h"
@@ -7,13 +13,21 @@
#include "dcdc_controller.h"
#include "ina226_monitor.h"
#include "uart_mux.h"
#include "usb_cdc_cli.h"
#include "usb_cdc_log.h"
#include "ws2812_status.h"
static const char *TAG = "watch-watch";
void app_main(void)
{
if (usb_cdc_log_init() != ESP_OK) {
ESP_LOGW(TAG, "USB CDC лог недоступний");
} else {
ESP_LOGI(TAG, "USB CDC лог активовано");
}
vTaskDelay(pdMS_TO_TICKS(2000)); // Затримка для стабілізації живлення після перезавантаження
ESP_LOGI(TAG, "Запуск watch-watch systems");
if (dcdc_init() != ESP_OK) {
ESP_LOGE(TAG, "Помилка ініціалізації DCDC контролера");
ws2812_status_init();
@@ -23,6 +37,10 @@ void app_main(void)
if (ws2812_status_init() == ESP_OK) {
ws2812_status_refresh_from_dcdc();
esp_err_t anim_err = ws2812_status_play_bringup_animation(2, 120);
if (anim_err != ESP_OK) {
ESP_LOGW(TAG, "Анімація WS2812 недоступна: %s", esp_err_to_name(anim_err));
}
} else {
ESP_LOGW(TAG, "WS2812 статусний індикатор недоступний");
}
@@ -40,11 +58,7 @@ void app_main(void)
ESP_LOGW(TAG, "UART мультиплексор недоступний");
}
if (usb_cdc_cli_init() != ESP_OK) {
ESP_LOGW(TAG, "USB CDC CLI недоступний");
} else {
ESP_LOGI(TAG, "USB CDC CLI запущено");
}
ESP_LOGI(TAG, "Початок послідовного ввімкнення каналів з інтервалом 4 с");
const TickType_t on_time = pdMS_TO_TICKS(4000);