Просмотр исходного кода

加入温度变化的事件

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 4 лет назад
Родитель
Сommit
8a51916e91
2 измененных файлов с 3 добавлено и 0 удалено
  1. 1 0
      Application/app/event_record.h
  2. 2 0
      Application/app/sox/health.c

+ 1 - 0
Application/app/event_record.h

@@ -17,6 +17,7 @@ typedef enum {
 	Temp_Low_Charger,
 	Min_Cap_For_Full,
 	Min_Cap_For_DisCharger,
+	Temp_Changed
 }event_id_t;
 
 typedef struct {

+ 2 - 0
Application/app/sox/health.c

@@ -585,6 +585,7 @@ void check_temp_state(void){
 			debounce_inc(_work_lower_temp_count);
 			if (debounce_reach_max(_work_lower_temp_count)){
 				_health.is_work_temp_normal = 1;
+				push_event(Temp_Changed, 1);
 				debounce_reset(_work_lower_temp_count);
 			}
 		}else {
@@ -595,6 +596,7 @@ void check_temp_state(void){
 			debounce_inc(_work_lower_temp_count);
 			if (debounce_reach_max(_work_lower_temp_count)){
 				_health.is_work_temp_normal = 0;
+				push_event(Temp_Changed, 0);
 				debounce_reset(_work_lower_temp_count);
 			}
 		}else {