Original project changes: Boot: minor calculation optimization on 12V check

This commit is contained in:
Carsten Schmiemann 2022-11-01 14:22:57 +01:00
parent fa09dc8c71
commit 5d3e4f4efa
1 changed files with 1 additions and 1 deletions

View File

@ -239,7 +239,7 @@ Boot::Boot()
uint32_t adc_level = 0;
for (int i = 0; i < 5; i++)
adc_level += adc1_get_raw(ADC1_CHANNEL_0);
float level_12v = adc_level / 5 / 195.7;
float level_12v = (float) adc_level / 5 / 195.7;
ESP_LOGI(TAG, "12V level: ~%.1fV", level_12v);
if (level_12v > 11.0)
ESP_LOGI(TAG, "12V level sufficient, proceeding with boot");