fix: compiling errors

This commit is contained in:
Terrence
2025-09-12 15:55:55 +08:00
parent f79506d58b
commit 76c19a0f2d
7 changed files with 9 additions and 75 deletions

View File

@@ -5,8 +5,6 @@
#include "oscillator.h" #include "oscillator.h"
static const char* TAG = "Movements";
Otto::Otto() { Otto::Otto() {
is_otto_resting_ = false; is_otto_resting_ = false;
for (int i = 0; i < SERVO_COUNT; i++) { for (int i = 0; i < SERVO_COUNT; i++) {

View File

@@ -6,12 +6,8 @@
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
static const char* TAG = "Oscillator";
extern unsigned long IRAM_ATTR millis(); extern unsigned long IRAM_ATTR millis();
static ledc_channel_t next_free_channel = LEDC_CHANNEL_0;
Oscillator::Oscillator(int trim) { Oscillator::Oscillator(int trim) {
trim_ = trim; trim_ = trim;
diff_limit_ = 0; diff_limit_ = 0;

View File

@@ -4,15 +4,13 @@
{ {
"name": "lilygo-t-cameraplus-s3", "name": "lilygo-t-cameraplus-s3",
"sdkconfig_append": [ "sdkconfig_append": [
"CONFIG_SPIRAM_MODE_QUAD=y", "CONFIG_SPIRAM_MODE_QUAD=y"
"CONFIG_BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3_V1_0_V1_1=y"
] ]
}, },
{ {
"name": "lilygo-t-cameraplus-s3_v1_2", "name": "lilygo-t-cameraplus-s3_v1_2",
"sdkconfig_append": [ "sdkconfig_append": [
"CONFIG_SPIRAM_MODE_QUAD=y", "CONFIG_SPIRAM_MODE_QUAD=y"
"CONFIG_BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3_V1_2=y"
] ]
} }
] ]

View File

@@ -130,7 +130,7 @@ private:
} }
} }
static void touchpad_daemon(void *param) { static void TouchpadDaemon(void *param) {
vTaskDelay(pdMS_TO_TICKS(2000)); vTaskDelay(pdMS_TO_TICKS(2000));
auto &board = (LilygoTCameraPlusS3Board&)Board::GetInstance(); auto &board = (LilygoTCameraPlusS3Board&)Board::GetInstance();
auto touchpad = board.GetTouchpad(); auto touchpad = board.GetTouchpad();
@@ -156,7 +156,7 @@ private:
void InitCst816d() { void InitCst816d() {
ESP_LOGI(TAG, "Init CST816x"); ESP_LOGI(TAG, "Init CST816x");
cst816d_ = new Cst816x(i2c_bus_, CST816_ADDRESS); cst816d_ = new Cst816x(i2c_bus_, CST816_ADDRESS);
xTaskCreate(touchpad_daemon, "tp", 2048, NULL, 5, NULL); xTaskCreate(TouchpadDaemon, "tp", 2048, NULL, 5, NULL);
} }
void InitSpi() { void InitSpi() {

View File

@@ -9,8 +9,6 @@
#include "esp_adc/adc_cali_scheme.h" #include "esp_adc/adc_cali_scheme.h"
#include <math.h> #include <math.h>
#define TAG "power_manager"
class PowerManager { class PowerManager {
private: private:
@@ -28,7 +26,7 @@ private:
bool calibrated = false; bool calibrated = false;
if (!calibrated) { if (!calibrated) {
ESP_LOGI(TAG, "calibration scheme version is %s", "Curve Fitting"); ESP_LOGI("PowerManager", "calibration scheme version is %s", "Curve Fitting");
adc_cali_curve_fitting_config_t cali_config = { adc_cali_curve_fitting_config_t cali_config = {
.unit_id = unit, .unit_id = unit,
.chan = channel, .chan = channel,
@@ -43,13 +41,13 @@ private:
*out_handle = handle; *out_handle = handle;
if (ret == ESP_OK) { if (ret == ESP_OK) {
ESP_LOGI(TAG, "Calibration Success"); ESP_LOGI("PowerManager", "Calibration Success");
} }
else if (ret == ESP_ERR_NOT_SUPPORTED || !calibrated) { else if (ret == ESP_ERR_NOT_SUPPORTED || !calibrated) {
ESP_LOGW(TAG, "eFuse not burnt, skip software calibration"); ESP_LOGW("PowerManager", "eFuse not burnt, skip software calibration");
} }
else { else {
ESP_LOGE(TAG, "Invalid arg or no memory"); ESP_LOGE("PowerManager", "Invalid arg or no memory");
} }
return calibrated; return calibrated;
} }

View File

@@ -19,56 +19,6 @@
#define TAG "CustomLcdDisplay" #define TAG "CustomLcdDisplay"
// Color definitions for dark theme
#define DARK_BACKGROUND_COLOR lv_color_hex(0x121212) // Dark background
#define DARK_TEXT_COLOR lv_color_white() // White text
#define DARK_CHAT_BACKGROUND_COLOR lv_color_hex(0x1E1E1E) // Slightly lighter than background
#define DARK_USER_BUBBLE_COLOR lv_color_hex(0x1A6C37) // Dark green
#define DARK_ASSISTANT_BUBBLE_COLOR lv_color_hex(0x333333) // Dark gray
#define DARK_SYSTEM_BUBBLE_COLOR lv_color_hex(0x2A2A2A) // Medium gray
#define DARK_SYSTEM_TEXT_COLOR lv_color_hex(0xAAAAAA) // Light gray text
#define DARK_BORDER_COLOR lv_color_hex(0x333333) // Dark gray border
#define DARK_LOW_BATTERY_COLOR lv_color_hex(0xFF0000) // Red for dark mode
// Color definitions for light theme
#define LIGHT_BACKGROUND_COLOR lv_color_white() // White background
#define LIGHT_TEXT_COLOR lv_color_black() // Black text
#define LIGHT_CHAT_BACKGROUND_COLOR lv_color_hex(0xE0E0E0) // Light gray background
#define LIGHT_USER_BUBBLE_COLOR lv_color_hex(0x95EC69) // WeChat green
#define LIGHT_ASSISTANT_BUBBLE_COLOR lv_color_white() // White
#define LIGHT_SYSTEM_BUBBLE_COLOR lv_color_hex(0xE0E0E0) // Light gray
#define LIGHT_SYSTEM_TEXT_COLOR lv_color_hex(0x666666) // Dark gray text
#define LIGHT_BORDER_COLOR lv_color_hex(0xE0E0E0) // Light gray border
#define LIGHT_LOW_BATTERY_COLOR lv_color_black() // Black for light mode
// Define dark theme colors
static const ThemeColors DARK_THEME = {
.background = DARK_BACKGROUND_COLOR,
.text = DARK_TEXT_COLOR,
.chat_background = DARK_CHAT_BACKGROUND_COLOR,
.user_bubble = DARK_USER_BUBBLE_COLOR,
.assistant_bubble = DARK_ASSISTANT_BUBBLE_COLOR,
.system_bubble = DARK_SYSTEM_BUBBLE_COLOR,
.system_text = DARK_SYSTEM_TEXT_COLOR,
.border = DARK_BORDER_COLOR,
.low_battery = DARK_LOW_BATTERY_COLOR
};
// Define light theme colors
static const ThemeColors LIGHT_THEME = {
.background = LIGHT_BACKGROUND_COLOR,
.text = LIGHT_TEXT_COLOR,
.chat_background = LIGHT_CHAT_BACKGROUND_COLOR,
.user_bubble = LIGHT_USER_BUBBLE_COLOR,
.assistant_bubble = LIGHT_ASSISTANT_BUBBLE_COLOR,
.system_bubble = LIGHT_SYSTEM_BUBBLE_COLOR,
.system_text = LIGHT_SYSTEM_TEXT_COLOR,
.border = LIGHT_BORDER_COLOR,
.low_battery = LIGHT_LOW_BATTERY_COLOR
};
// Current theme - initialize based on default config
static ThemeColors current_theme = LIGHT_THEME;
static SemaphoreHandle_t trans_done_sem = NULL; static SemaphoreHandle_t trans_done_sem = NULL;
static uint16_t *trans_act; static uint16_t *trans_act;
@@ -331,12 +281,6 @@ CustomLcdDisplay::CustomLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_p
lv_display_set_offset(display_, offset_x, offset_y); lv_display_set_offset(display_, offset_x, offset_y);
} }
// Update the theme
if (current_theme_name_ == "dark") {
current_theme = DARK_THEME;
} else if (current_theme_name_ == "light") {
current_theme = LIGHT_THEME;
}
SetupUI(); SetupUI();
} }

View File

@@ -15,7 +15,7 @@ dependencies:
78/esp_lcd_nv3023: ~1.0.0 78/esp_lcd_nv3023: ~1.0.0
78/esp-wifi-connect: ~2.5.2 78/esp-wifi-connect: ~2.5.2
78/esp-opus-encoder: ~2.4.1 78/esp-opus-encoder: ~2.4.1
78/esp-ml307: ~3.3.2 78/esp-ml307: ~3.3.3
78/xiaozhi-fonts: ~1.5.2 78/xiaozhi-fonts: ~1.5.2
espressif/led_strip: ~3.0.1 espressif/led_strip: ~3.0.1
espressif/esp_codec_dev: ~1.4.0 espressif/esp_codec_dev: ~1.4.0