Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analog.c: Fix pinToMux() for STM32F0xx #19658

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions platforms/chibios/drivers/analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,22 @@ static ADCConversionGroup adcConversionGroup = {
__attribute__((weak)) adc_mux pinToMux(pin_t pin) {
switch (pin) {
#if defined(STM32F0XX)
case A0: return TO_MUX( ADC_CHSELR_CHSEL0, 0 );
case A1: return TO_MUX( ADC_CHSELR_CHSEL1, 0 );
case A2: return TO_MUX( ADC_CHSELR_CHSEL2, 0 );
case A3: return TO_MUX( ADC_CHSELR_CHSEL3, 0 );
case A4: return TO_MUX( ADC_CHSELR_CHSEL4, 0 );
case A5: return TO_MUX( ADC_CHSELR_CHSEL5, 0 );
case A6: return TO_MUX( ADC_CHSELR_CHSEL6, 0 );
case A7: return TO_MUX( ADC_CHSELR_CHSEL7, 0 );
case B0: return TO_MUX( ADC_CHSELR_CHSEL8, 0 );
case B1: return TO_MUX( ADC_CHSELR_CHSEL9, 0 );
case C0: return TO_MUX( ADC_CHSELR_CHSEL10, 0 );
case C1: return TO_MUX( ADC_CHSELR_CHSEL11, 0 );
case C2: return TO_MUX( ADC_CHSELR_CHSEL12, 0 );
case C3: return TO_MUX( ADC_CHSELR_CHSEL13, 0 );
case C4: return TO_MUX( ADC_CHSELR_CHSEL14, 0 );
case C5: return TO_MUX( ADC_CHSELR_CHSEL15, 0 );
case A0: return TO_MUX( 0, 0 );
case A1: return TO_MUX( 1, 0 );
case A2: return TO_MUX( 2, 0 );
case A3: return TO_MUX( 3, 0 );
case A4: return TO_MUX( 4, 0 );
case A5: return TO_MUX( 5, 0 );
case A6: return TO_MUX( 6, 0 );
case A7: return TO_MUX( 7, 0 );
case B0: return TO_MUX( 8, 0 );
case B1: return TO_MUX( 9, 0 );
case C0: return TO_MUX( 10, 0 );
case C1: return TO_MUX( 11, 0 );
case C2: return TO_MUX( 12, 0 );
case C3: return TO_MUX( 13, 0 );
case C4: return TO_MUX( 14, 0 );
case C5: return TO_MUX( 15, 0 );
#elif defined(STM32F3XX)
case A0: return TO_MUX( ADC_CHANNEL_IN1, 0 );
case A1: return TO_MUX( ADC_CHANNEL_IN2, 0 );
Expand Down