fix problems
This commit is contained in:
@@ -32,6 +32,6 @@
|
||||
/*
|
||||
* firmeware version string
|
||||
*/
|
||||
#define __FIRMWARE__ "2020082101"
|
||||
#define __FIRMWARE__ "2020082103"
|
||||
|
||||
#endif // _CONFIG_H
|
||||
|
||||
@@ -32,14 +32,16 @@ void pmu_setup( TTGOClass *ttgo ) {
|
||||
// enable coulumb counter
|
||||
if ( ttgo->power->EnableCoulombcounter() )
|
||||
log_e("enable coulumb counter failed!");
|
||||
if ( pmu_config.charging_target_voltage <= 4200 ) {
|
||||
if ( ttgo->power->setChargingTargetVoltage( AXP202_TARGET_VOL_4_2V ) )
|
||||
log_e("target voltage 4.2V set failed!");
|
||||
}
|
||||
else {
|
||||
if ( pmu_config.high_charging_target_voltage ) {
|
||||
log_i("set target voltage to 4.36V");
|
||||
if ( ttgo->power->setChargingTargetVoltage( AXP202_TARGET_VOL_4_36V ) )
|
||||
log_e("target voltage 4.36V set failed!");
|
||||
}
|
||||
else {
|
||||
log_i("set target voltage to 4.2V");
|
||||
if ( ttgo->power->setChargingTargetVoltage( AXP202_TARGET_VOL_4_2V ) )
|
||||
log_e("target voltage 4.2V set failed!");
|
||||
}
|
||||
if ( ttgo->power->setChargeControlCur( 300 ) )
|
||||
log_e("charge current set failed!");
|
||||
if ( ttgo->power->setAdcSamplingRate( AXP_ADC_SAMPLING_RATE_200HZ ) )
|
||||
@@ -137,7 +139,7 @@ void pmu_save_config( void ) {
|
||||
doc["silence_wakeup_time_vbplug"] = pmu_config.silence_wakeup_time_vbplug;
|
||||
doc["experimental_power_save"] = pmu_config.experimental_power_save;
|
||||
doc["compute_percent"] = pmu_config.compute_percent;
|
||||
doc["charging_target_voltage"] = pmu_config.charging_target_voltage;
|
||||
doc["high_charging_target_voltage"] = pmu_config.high_charging_target_voltage;
|
||||
doc["designed_battery_cap"] = pmu_config.designed_battery_cap;
|
||||
|
||||
if ( serializeJsonPretty( doc, file ) == 0) {
|
||||
@@ -166,13 +168,13 @@ void pmu_read_config( void ) {
|
||||
log_e("update check deserializeJson() failed: %s", error.c_str() );
|
||||
}
|
||||
else {
|
||||
pmu_config.silence_wakeup = doc["silence_wakeup"].as<bool>() | false;
|
||||
pmu_config.silence_wakeup_time = doc["compute_percent"].as<int8_t>() | 60;
|
||||
pmu_config.silence_wakeup_time_vbplug = doc["compute_percent"].as<int8_t>() | 3;
|
||||
pmu_config.experimental_power_save = doc["experimental_power_save"].as<bool>() | false;
|
||||
pmu_config.compute_percent = doc["compute_percent"].as<bool>() | false;
|
||||
pmu_config.charging_target_voltage = doc["charging_target_voltage"].as<int32_t>() | 4200;
|
||||
pmu_config.designed_battery_cap = doc["designed_battery_cap"].as<int32_t>() | 300;
|
||||
pmu_config.silence_wakeup = doc["silence_wakeup"] | false;
|
||||
pmu_config.silence_wakeup_time = doc["compute_percent"] | 60;
|
||||
pmu_config.silence_wakeup_time_vbplug = doc["compute_percent"] | 3;
|
||||
pmu_config.experimental_power_save = doc["experimental_power_save"] | false;
|
||||
pmu_config.compute_percent = doc["compute_percent"] | false;
|
||||
pmu_config.high_charging_target_voltage = doc["high_charging_target_voltage"] | false;
|
||||
pmu_config.designed_battery_cap = doc["designed_battery_cap"] | 300;
|
||||
}
|
||||
doc.clear();
|
||||
}
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#define PMU_JSON_CONFIG_FILE "/pmu.json"
|
||||
|
||||
typedef struct {
|
||||
int32_t designed_battery_cap = 300;
|
||||
int32_t silence_wakeup_time = 60;
|
||||
int32_t silence_wakeup_time_vbplug = 3;
|
||||
bool high_charging_target_voltage = true;
|
||||
bool compute_percent = false;
|
||||
bool experimental_power_save = false;
|
||||
bool silence_wakeup = true;
|
||||
uint8_t silence_wakeup_time = 60;
|
||||
uint8_t silence_wakeup_time_vbplug = 3;
|
||||
int32_t charging_target_voltage = 3200;
|
||||
int32_t designed_battery_cap = 300;
|
||||
} pmu_config_t;
|
||||
|
||||
/*
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
{"version":"2020082101","host":"http://www.neo-guerillaz.de","file":"ttgo-t-watch2020_v1.ino.bin"}
|
||||
{"version":"2020082103","host":"http://www.neo-guerillaz.de","file":"ttgo-t-watch2020_v1.ino.bin"}
|
||||
|
||||
Reference in New Issue
Block a user