Skip to content

Commit

Permalink
Fix wrong channel shift
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehaenger committed Aug 12, 2024
1 parent 31bbf48 commit 2f8a8e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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 2f8a8e3

Please sign in to comment.