From 9cdd799881a2c57337dffed59df07896c3ca5240 Mon Sep 17 00:00:00 2001 From: helloyifa Date: Thu, 10 Apr 2025 20:22:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=85=E7=94=B5=E9=80=BB?= =?UTF-8?q?=E8=BE=91=20=20=20LED=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E4=BC=A0=E6=84=9F=E5=99=A8=E6=A6=82?= =?UTF-8?q?=E7=8E=87=E8=AF=BB=E5=8F=96=E4=B8=8D=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fw-AC63_BT_SDK/apps/spp_and_le/include/app_temperature.h | 9 +++++++++ .../apps/spp_and_le/modules/power/app_charge.c | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fw-AC63_BT_SDK/apps/spp_and_le/include/app_temperature.h b/fw-AC63_BT_SDK/apps/spp_and_le/include/app_temperature.h index c792abb..0a048fd 100644 --- a/fw-AC63_BT_SDK/apps/spp_and_le/include/app_temperature.h +++ b/fw-AC63_BT_SDK/apps/spp_and_le/include/app_temperature.h @@ -13,6 +13,12 @@ #define BLE_TEMPERATURE_DEVICE_NST1002 1002 #define BLE_TEMPERATURE_DEVICE_NTC 0 +#define BLE_TEMPERATURE_WORK_LED IO_PORTA_07 + +#define BLE_TEMPERATURE_CHARGE_STATE_CHARGING 1 +#define BLE_TEMPERATURE_CHARGE_STATE_FULL 2 +#define BLE_TEMPERATURE_CHARGE_STATE_IDLE 3 + struct app_dev_info_t { u16 temperature_sensor; @@ -34,4 +40,7 @@ void temperature_ble_init(); void temperature_init(void); void ble_receive_callback(u8* data,u16 len); +void temperature_work_led(u8 on); +void temperature_charge_led(u8 on); +void temperature_charge_state(int state); #endif //_APP_TEMPERATURE_H_ diff --git a/fw-AC63_BT_SDK/apps/spp_and_le/modules/power/app_charge.c b/fw-AC63_BT_SDK/apps/spp_and_le/modules/power/app_charge.c index 84b5ba6..0f95721 100644 --- a/fw-AC63_BT_SDK/apps/spp_and_le/modules/power/app_charge.c +++ b/fw-AC63_BT_SDK/apps/spp_and_le/modules/power/app_charge.c @@ -9,7 +9,7 @@ #include "app_main.h" #include "app_power_manage.h" #include "app_handshake.h" - +#include "app_temperature.h" #define LOG_TAG_CONST APP_CHARGE #define LOG_TAG "[APP_CHARGE]" #define LOG_ERROR_ENABLE @@ -52,8 +52,8 @@ void charge_full_deal(void) //power_set_soft_poweroff(); //extern spple_set_soft_poweroff(); //spple_set_soft_poweroff(); - spple_power_event_to_user(POWER_EVENT_POWER_SOFTOFF); - log_info("!!!!!!!!!!!!!! POWER OFF!!!!!!!!!!!!!!!!\n"); + temperature_charge_state(BLE_TEMPERATURE_CHARGE_STATE_FULL); + } void charge_close_deal(void) @@ -69,6 +69,7 @@ void charge_ldo5v_in_deal(void) #else charge_start(); #endif + temperature_charge_state(BLE_TEMPERATURE_CHARGE_STATE_CHARGING); } void charge_ldo5v_off_deal(void) @@ -82,6 +83,7 @@ void charge_ldo5v_off_deal(void) #if TCFG_SYS_LVD_EN vbat_check_init(); #endif + temperature_charge_state(BLE_TEMPERATURE_CHARGE_STATE_IDLE); } int app_charge_event_handler(struct device_event *dev)