summaryrefslogtreecommitdiff
path: root/main/battery.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2022-10-12 11:59:42 +1100
committerjacqueline <me@jacqueline.id.au>2022-10-12 11:59:42 +1100
commit4fc5f931acf5bdc582fdad3cb48e6810964198c5 (patch)
tree9057debaa13ec996450a63adf5f3228cd5ff1b54 /main/battery.cpp
parentefd5392f6cf2149369d7d3170400bbe8f2d5c82e (diff)
downloadtangara-fw-4fc5f931acf5bdc582fdad3cb48e6810964198c5.tar.gz
WIP use result<> and RAII
Diffstat (limited to 'main/battery.cpp')
-rw-r--r--main/battery.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/battery.cpp b/main/battery.cpp
index 179a6439..d175ab67 100644
--- a/main/battery.cpp
+++ b/main/battery.cpp
@@ -11,8 +11,8 @@ static esp_adc_cal_characteristics_t calibration;
esp_err_t init_adc(void) {
// Calibration should already be fused into the chip from the factory, so
// we should only need to read it back out again.
- esp_adc_cal_characterize(
- ADC_UNIT_1, ADC_ATTEN_DB_11, ADC_WIDTH_BIT_12, 0, &calibration);
+ esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_11, ADC_WIDTH_BIT_12, 0,
+ &calibration);
// Max battery voltage should be a little over 2V due to our divider, so
// we need the max attenuation to properly handle the full range.
@@ -28,4 +28,4 @@ uint32_t read_battery_voltage(void) {
return esp_adc_cal_raw_to_voltage(raw, &calibration);
}
-} // namespace gay_ipod
+} // namespace gay_ipod