Skip to content

Commit

Permalink
[adc] Fix wrong channel shift on STM32C0/G0
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehaenger authored Aug 13, 2024
1 parent 31bbf48 commit 3c039d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modm/platform/adc/stm32f0/adc_impl.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ modm::platform::Adc{{ id }}::setChannels(std::span<const Channel> channels)
uint32_t config = 0xFFFF'FFFF;
for (const auto [i, ch] : modm::enumerate(channels)) {
enableInternalChannel(ch);
config = (config & ~((0xF) << i)) | (std::to_underlying(ch) << i);
config = (config & ~((0xF) << i*4)) | (std::to_underlying(ch) << i*4);
}
ADC1->CHSELR = config;
waitChannelConfigReady();
Expand Down

0 comments on commit 3c039d9

Please sign in to comment.