修复充电时 继续发广播
This commit is contained in:
parent
03e51dbef6
commit
602f73308c
@ -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:
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user