From 602f73308c488fe5447831a1ac2a547ffea6beed Mon Sep 17 00:00:00 2001 From: helloyifa Date: Sat, 12 Apr 2025 18:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=85=E7=94=B5=E6=97=B6?= =?UTF-8?q?=20=E7=BB=A7=E7=BB=AD=E5=8F=91=E5=B9=BF=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fw-AC63_BT_SDK/apps/spp_and_le/app_temperature.c | 11 +++++++++++ .../apps/spp_and_le/modules/power/app_charge.c | 1 + 2 files changed, 12 insertions(+) diff --git a/fw-AC63_BT_SDK/apps/spp_and_le/app_temperature.c b/fw-AC63_BT_SDK/apps/spp_and_le/app_temperature.c index 3c9fad8..fd94351 100644 --- a/fw-AC63_BT_SDK/apps/spp_and_le/app_temperature.c +++ b/fw-AC63_BT_SDK/apps/spp_and_le/app_temperature.c @@ -25,6 +25,8 @@ static u16 temer_temperature_detect = 0; //struct app_dev_info_t dev_info; //struct app_dev_config_t dev_config; app_dev_config_t dev_config; + +static int charge_state = 0; void temperature_blink_led() { if (led_state) @@ -305,6 +307,10 @@ static uint8_t reversal(uint8_t data) char err_code[4][20] = {"NOT Connected", "No DONE signal", "DAT Recv Err", "CRC Err"}; void nst1002_read_temperatura(void) { + if(charge_state){ + printf("charging...\r\n"); + return; + } int err, ei; float dtmp; int16_t cal; @@ -418,6 +424,7 @@ void temperature_charge_state(int state){ { //接入充电 case BLE_TEMPERATURE_CHARGE_STATE_CHARGING : + charge_state = 1; printf("BLE_TEMPERATURE_CHARGE_STATE_CHARGING\n"); //关闭低电提示LED temperature_charge_lowpower(0); @@ -431,6 +438,7 @@ void temperature_charge_state(int state){ } //接入充电关闭蓝牙广播 ble_op_adv_enable(0); + ble_module_enable(0); //spple_power_event_to_user(POWER_EVENT_POWER_SOFTOFF); //printf("!!!!!!!!!!!!!! CHARGING POWER OFF!!!!!!!!!!!!!!!!\n"); //printf("BLE_TEMPERATURE_CHARGE_STATE_CHARGING 2\n"); @@ -443,6 +451,7 @@ void temperature_charge_state(int state){ break; //拔出充电 case BLE_TEMPERATURE_CHARGE_STATE_IDLE : + charge_state = 0; printf("BLE_TEMPERATURE_CHARGE_STATE_IDLE\n"); temer_temperature_detect = sys_timer_add(NULL, temperature_detect, dev_config.detect_interval); //temperature_charge_led(0); @@ -450,7 +459,9 @@ void temperature_charge_state(int state){ sys_s_hi_timerout_add(NULL,temperature_poweron_led_timeout,2000); //拔出充电打开蓝牙广播 + ble_module_enable(1); ble_op_adv_enable(1); + break; //低电 case BLE_TEMPERATURE_CHARGE_STATE_LOWPOWER: 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 0f95721..31d65d8 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 @@ -43,6 +43,7 @@ void ldo5v_keep_deal(void) #if TCFG_HANDSHAKE_ENABLE handshake_app_start(2, handshake_complete); #endif + temperature_charge_state(BLE_TEMPERATURE_CHARGE_STATE_CHARGING); } void charge_full_deal(void)