document why value is bit-shifted

This commit is contained in:
bunnie 2025-09-14 02:18:20 +08:00
parent 818717e236
commit 442b3a6431

View file

@ -891,6 +891,7 @@ impl Repl {
let raw = bio_ss.bio.r(utra::bio_bdma::SFR_RXF0);
// crate::println!("raw: {:x}", raw);
raw32 <<= BITS_PER_SAMPLE;
// shift right by one because bit 0 always samples as 0, due to instruction timing
raw32 |= (raw >> 1) & ((1 << BITS_PER_SAMPLE) - 1)
}
*d = raw32;