From c5bbadf73bbfa86d83826400fe1cfbda8bba8ba3 Mon Sep 17 00:00:00 2001 From: zwsd Date: Mon, 26 Sep 2022 14:54:20 +0800 Subject: [PATCH] update --- main/app_main.cpp | 11 +++++------ main/key.c | 8 ++++---- main/key.h | 13 +++++++++---- main/light.c | 16 ---------------- main/light.h | 3 +-- main/wifi.c | 12 ++++++------ main/wifi.h | 14 +++++++------- 7 files changed, 32 insertions(+), 45 deletions(-) diff --git a/main/app_main.cpp b/main/app_main.cpp index 764117d..18d69fc 100644 --- a/main/app_main.cpp +++ b/main/app_main.cpp @@ -39,16 +39,15 @@ extern "C" void app_main(void) T_all_light_init(); ble_spp_server_init(); camera_init(); - key_init(); - wifi_init(); + T_key_init(); + T_wifi_init(); - key_registered_cb(); - wifi_registered_cb(); + T_key_registered_cb(); + T_wifi_registered_cb(); while (true) { T_debug_light_schedule(); - T_light_schedule(); - key_schedule(); + T_key_schedule(); } } \ No newline at end of file diff --git a/main/key.c b/main/key.c index 035cf89..97f5962 100644 --- a/main/key.c +++ b/main/key.c @@ -1,17 +1,17 @@ #include "key.h" -void key_init(void) +void T_key_init(void) { } -void key_registered_cb(void) +void T_key_registered_cb(void) { } -void key_on_event(void) +void T_key_on_event(void) { } -void key_schedule(void) +void T_key_schedule(void) { } \ No newline at end of file diff --git a/main/key.h b/main/key.h index bfb05a7..c605879 100644 --- a/main/key.h +++ b/main/key.h @@ -1,6 +1,11 @@ #pragma once -void key_init(void); -void key_registered_cb(void); -void key_on_event(void); -void key_schedule(void); \ No newline at end of file +typedef struct +{ + uint32_t pressed_of_key_count; +} T_key_structer_t; + +void T_key_init(void); +void T_key_registered_cb(void); +void T_key_on_event(void); +void T_key_schedule(void); \ No newline at end of file diff --git a/main/light.c b/main/light.c index 52c9aa9..e98c0ef 100644 --- a/main/light.c +++ b/main/light.c @@ -103,19 +103,3 @@ void T_debug_light_schedule(void) debug_light_time = port_get_ticket(); } } - -void T_light_schedule(void) -{ - if (power_state_light_structer_s->change_flag) - { - } - if (heating_state_light_structer_s->change_flag) - { - } - if (reaction_state_light_structer_s->change_flag) - { - } - if (wifi_state_light_structer_s->change_flag) - { - } -} \ No newline at end of file diff --git a/main/light.h b/main/light.h index a8245df..8e66155 100644 --- a/main/light.h +++ b/main/light.h @@ -80,5 +80,4 @@ void T_reaction_state_light_init(reaction_state_light_structer_t *reaction_state void T_wifi_state_light_init(wifi_state_light_structer_t *wifi_state_light_structer); // Schedule -void T_debug_light_schedule(void); -void T_light_schedule(void); \ No newline at end of file +void T_debug_light_schedule(void); \ No newline at end of file diff --git a/main/wifi.c b/main/wifi.c index 7463f64..2f8b00c 100644 --- a/main/wifi.c +++ b/main/wifi.c @@ -4,14 +4,14 @@ #define WIFI_NAME "ZWSD_ESP32" #define WIFI_PASSWORD "zwsdzwsd" -void wifi_init(void) {} +void T_wifi_init(void) {} -void wifi_registered_cb(void) {} +void T_wifi_registered_cb(void) {} -void wifi_start_connect(void) {} +void T_wifi_start_connect(void) {} -void wifi_stop_connect(void) {} +void T_wifi_stop_connect(void) {} -bool wifi_connect_timeout(void) { return true; } +bool T_wifi_connect_timeout(void) { return true; } -void wifi_send_data(void) {} \ No newline at end of file +void T_wifi_send_data(void) {} \ No newline at end of file diff --git a/main/wifi.h b/main/wifi.h index c23af05..34a6a55 100644 --- a/main/wifi.h +++ b/main/wifi.h @@ -6,11 +6,11 @@ typedef struct { bool wifi_connect_flag; uint8_t wifi_max_connect_num; -} wifi_config_structer_t; +} wifi_structer_t; -void wifi_init(void); -void wifi_registered_cb(void); -void wifi_start_connect(void); -void wifi_stop_connect(void); -bool wifi_connect_timeout(void); -void wifi_send_data(void); \ No newline at end of file +void T_wifi_init(void); +void T_wifi_registered_cb(void); +void T_wifi_start_connect(void); +void T_wifi_stop_connect(void); +bool T_wifi_connect_timeout(void); +void T_wifi_send_data(void); \ No newline at end of file