Porting prop board power api to wavtooeasy core

hello ivan i extracted this function from your prop bord power api however i cant seem to figure out the naming convention for this " ADC_Channel_17". i changed the read battery pin to ADC_Channel_14 thinking it would be conneted to pc4 instead of pc0 that you used(ADC_Channel_10)

`uint16_t readBattery()
{
uint16_t battery;
uint16_t vrefint;

// Read VREFINT
while (ADC_GetSoftwareStartConvStatus(ADC1) != RESET);
ADC_RegularChannelConfig(ADC1, ADC_Channel_17, 1, ADC_SampleTime_84Cycles);
ADC_SoftwareStartConv(ADC1);
while (ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET);

vrefint = ADC1->DR;

while (ADC_GetSoftwareStartConvStatus(ADC1) != RESET);
ADC_RegularChannelConfig(ADC1, ADC_Channel_14, 1, ADC_SampleTime_84Cycles);
ADC_SoftwareStartConv(ADC1);
while (ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET);

battery = ADC1->DR;
battery = battery * 1210 / vrefint;

return battery / 0.233f;
}`

The naming convention is the one used by the standard peripheral library from ST. ADC_Channel_17 is defined in the ST libraries.

ADC_Channel_17 is VREFINT and is the internal reference voltage.

If you want to change the ADC pin for battery reading, make sure you are configuring the pin correctly for ADC. See the initADC function.

I can’t seem to read it at all, all I get is zero