增加可以设置基准电压值
This commit is contained in:
parent
c08c3d0604
commit
d0cc549048
@ -268,13 +268,14 @@ int battery_get_percent(){
|
|||||||
return batt_percent;
|
return batt_percent;
|
||||||
}
|
}
|
||||||
//AT+BAT_CALIBRTATION
|
//AT+BAT_CALIBRTATION
|
||||||
int battery_calibration(){
|
int battery_calibration(int calibration_value){
|
||||||
bk_err_t ret = prvStartBatteryAdcOneTime();
|
bk_err_t ret = prvStartBatteryAdcOneTime();
|
||||||
|
|
||||||
if (ret == BK_OK)
|
if (ret == BK_OK)
|
||||||
{
|
{
|
||||||
|
bk_printf("BAT_CALIBRTATION calibration_value: %d \r\n", calibration_value);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
bat_offset = 3980-vol;
|
bat_offset = calibration_value-vol;
|
||||||
|
|
||||||
bk_config_write("bat_offset", (void *)&bat_offset, 4);
|
bk_config_write("bat_offset", (void *)&bat_offset, 4);
|
||||||
bk_config_sync_flash_safely();
|
bk_config_sync_flash_safely();
|
||||||
|
@ -25,7 +25,7 @@ void init_bat_timer();
|
|||||||
void poweron_voice();
|
void poweron_voice();
|
||||||
void poweroff_voice();
|
void poweroff_voice();
|
||||||
|
|
||||||
int battery_calibration();
|
int battery_calibration(int calibration_value);
|
||||||
/**
|
/**
|
||||||
* 获取电量百分百
|
* 获取电量百分百
|
||||||
*/
|
*/
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user