From dd0144697dfc460ea0aab149ab0770762317d334 Mon Sep 17 00:00:00 2001 From: zwsd Date: Mon, 26 Sep 2022 19:16:18 +0800 Subject: [PATCH] update --- main/app_main.cpp | 24 ++++++++++++++---------- main/heating_plate.h | 8 +++++++- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/main/app_main.cpp b/main/app_main.cpp index 5a8202f..5609cde 100644 --- a/main/app_main.cpp +++ b/main/app_main.cpp @@ -37,6 +37,13 @@ T_key_structer_t T_key_structer = { .key_now_state = false, }; +/*********************************************************************************************************************** + * ***************************************************heating_plate*************************************************** * + ***********************************************************************************************************************/ +heating_plate_structer_t heating_plate_structer = { + .heating_plate_preheat_finished_flag = false, +}; + static void T_all_light_init(void) { T_power_light_init(&power_state_light_structer); @@ -45,22 +52,19 @@ static void T_all_light_init(void) T_wifi_state_light_init(&wifi_state_light_structer); } -/* 有反应板的处理 */ -void process_camera_identifies_successful_event(void) {} - -/* 没有反应板的处理(加热) */ -void process_camera_identifies_failed_event(void) +void process_key_event(void) { - if (T_temp_get_data() <= 48.0) + if (heating_plate_structer.heating_plate_preheat_finished_flag) { + /* 加热完成 */ + } + else + { + /* 加热未完成 */ T_heating_plate_start(); } } -void process_key_event(void) -{ -} - extern "C" void app_main(void) { T_debug_light_init(); diff --git a/main/heating_plate.h b/main/heating_plate.h index 1a2786c..e2d21c8 100644 --- a/main/heating_plate.h +++ b/main/heating_plate.h @@ -1,4 +1,10 @@ -#pragma once +#pragma once +#include + +typedef struct +{ + bool heating_plate_preheat_finished_flag; +} heating_plate_structer_t; void T_heating_plate_init(void); void T_heating_plate_registered_cb(void);