chore: remove dead code and fix unsafe patterns
- Remove unused context_build_messages() (superseded by direct cJSON in agent_loop) - Remove unused llm_chat() and its helper extract_text_* functions (superseded by llm_chat_tools) - Remove ota_manager.c from build (never called) - Remove config_screen.c stub from build (no-op module) - Remove unused PWR_KEY_State, Button_GPIO_Get_Level; drop config_screen dependency from button_driver - Fix incorrect type cast in tool_get_time.c (char[64] cast to char**) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,50 +2,41 @@
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_timer.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "ui/config_screen.h"
|
||||
#include "driver/gpio.h"
|
||||
|
||||
void ESP32_Button_init(void){
|
||||
gpio_reset_pin(Button_PIN1);
|
||||
gpio_set_direction(Button_PIN1, GPIO_MODE_INPUT);
|
||||
gpio_set_pull_mode(Button_PIN1, GPIO_PULLUP_ONLY);
|
||||
static void ESP32_Button_init(void){
|
||||
gpio_reset_pin(Button_PIN1);
|
||||
gpio_set_direction(Button_PIN1, GPIO_MODE_INPUT);
|
||||
gpio_set_pull_mode(Button_PIN1, GPIO_PULLUP_ONLY);
|
||||
}
|
||||
uint8_t Button_GPIO_Get_Level(int GPIO_PIN){
|
||||
return (uint8_t)(gpio_get_level(GPIO_PIN));
|
||||
}
|
||||
void Timer_Callback(void *arg){
|
||||
button_ticks();
|
||||
static void Timer_Callback(void *arg){
|
||||
button_ticks();
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct Button BUTTON1;
|
||||
PressEvent BOOT_KEY_State,PWR_KEY_State;
|
||||
uint8_t Read_Button_GPIO_Level(uint8_t button_id)
|
||||
struct Button BUTTON1;
|
||||
PressEvent BOOT_KEY_State;
|
||||
static uint8_t Read_Button_GPIO_Level(uint8_t button_id)
|
||||
{
|
||||
if(!button_id)
|
||||
if(!button_id)
|
||||
return (uint8_t)(gpio_get_level(Button_PIN1));
|
||||
return 0;
|
||||
}
|
||||
void Button_SINGLE_CLICK_Callback(void* btn){
|
||||
struct Button *user_button = (struct Button *)btn;
|
||||
if(user_button == &BUTTON1){
|
||||
BOOT_KEY_State = SINGLE_CLICK;
|
||||
if (config_screen_is_active()) {
|
||||
config_screen_scroll_down();
|
||||
}
|
||||
static void Button_SINGLE_CLICK_Callback(void* btn){
|
||||
struct Button *user_button = (struct Button *)btn;
|
||||
if(user_button == &BUTTON1){
|
||||
BOOT_KEY_State = SINGLE_CLICK;
|
||||
}
|
||||
}
|
||||
void Button_DOUBLE_CLICK_Callback(void* btn){
|
||||
struct Button *user_button = (struct Button *)btn;
|
||||
if(user_button == &BUTTON1){
|
||||
BOOT_KEY_State = DOUBLE_CLICK;
|
||||
static void Button_DOUBLE_CLICK_Callback(void* btn){
|
||||
struct Button *user_button = (struct Button *)btn;
|
||||
if(user_button == &BUTTON1){
|
||||
BOOT_KEY_State = DOUBLE_CLICK;
|
||||
}
|
||||
}
|
||||
void Button_LONG_PRESS_START_Callback(void* btn){
|
||||
struct Button *user_button = (struct Button *)btn;
|
||||
if(user_button == &BUTTON1){
|
||||
BOOT_KEY_State= LONG_PRESS_START;
|
||||
static void Button_LONG_PRESS_START_Callback(void* btn){
|
||||
struct Button *user_button = (struct Button *)btn;
|
||||
if(user_button == &BUTTON1){
|
||||
BOOT_KEY_State= LONG_PRESS_START;
|
||||
}
|
||||
}
|
||||
void button_Init(void)
|
||||
|
||||
Reference in New Issue
Block a user