Skip to content
Snippets Groups Projects
Commit be41bd75 authored by Florian Kargl's avatar Florian Kargl
Browse files

fix(pmic): Properly disable AMUX when not in use

parent 78a0e6e6
No related branches found
No related tags found
No related merge requests found
Pipeline #3706 passed
......@@ -52,6 +52,7 @@ void watchdog_clearer_init();
#define BATTERY_CRITICAL 3.40f
enum pmic_amux_signal {
PMIC_AMUX_DISABLED = 0x0,
PMIC_AMUX_CHGIN_U = 0x1,
PMIC_AMUX_CHGIN_I = 0x2,
PMIC_AMUX_BATT_U = 0x3,
......
......@@ -86,7 +86,7 @@ int pmic_read_amux(enum pmic_amux_signal sig, float *result)
ADC_GetData(&adc_data);
/* Turn MUX back to neutral so it does not waste power. */
MAX77650_setMUX_SEL(sig);
MAX77650_setMUX_SEL(PMIC_AMUX_DISABLED);
/* Convert ADC measurement to SI Volts */
float adc_voltage = (float)adc_data / 1023.0f * 1.22f;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment