Compare commits

..

No commits in common. "48fb0c8a4f0e7d4eb23c77652383426718b9209a" and "ab29bdb691b1c5eeffdd4a142d812c60905cc4ed" have entirely different histories.

3 changed files with 329 additions and 361 deletions

View File

@ -268,14 +268,13 @@ int battery_get_percent(){
return batt_percent; return batt_percent;
} }
//AT+BAT_CALIBRTATION //AT+BAT_CALIBRTATION
int battery_calibration(int calibration_value){ int battery_calibration(){
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 = calibration_value-vol; bat_offset = 3980-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();

View File

@ -25,7 +25,7 @@ void init_bat_timer();
void poweron_voice(); void poweron_voice();
void poweroff_voice(); void poweroff_voice();
int battery_calibration(int calibration_value); int battery_calibration();
/** /**
* *
*/ */