Skip to content

Commit

Permalink
[chibios] Fix ADC reading sample rate error on H7 (reading wrong ADC …
Browse files Browse the repository at this point in the history
…values)
  • Loading branch information
fvantienen committed Jul 31, 2023
1 parent 5a51d5f commit 8580582
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sw/airborne/arch/chibios/mcu_periph/adc_arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void adc_configure(ADCConversionGroup *cfg, uint8_t num_channels, const u

#if defined(STM32H7XX) || defined(STM32F3XX) || defined(STM32G4XX) || defined(STM32L4XX)
cfg->pcsel |= (1 << chan);
cfg->smpr[chan / 10] |= sample_rate << (3 << (chan % 10));
cfg->smpr[chan / 10] |= sample_rate << (3 * (chan % 10));

if (i < 4) {
cfg->sqr[0] |= chan << (6 * (i + 1));
Expand Down

0 comments on commit 8580582

Please sign in to comment.