auto-detect DAC

This commit is contained in:
philippe44
2020-02-09 14:22:35 -08:00
parent 90d52dabaf
commit c4b0168370
7 changed files with 77 additions and 36 deletions

View File

@@ -60,7 +60,9 @@ static void battery_callback(TimerHandle_t xTimer) {
*/
void battery_svc_init(void) {
battery.channel = CONFIG_BAT_CHANNEL;
#ifdef CONFIG_BAT_SCALE
battery.scale = atof(CONFIG_BAT_SCALE);
#endif
#ifndef CONFIG_BAT_LOCKED
char *nvs_item = config_alloc_get_default(NVS_TYPE_STR, "bat_config", "n", 0);