mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
document why value is bit-shifted
This commit is contained in:
parent
818717e236
commit
442b3a6431
1 changed files with 1 additions and 0 deletions
|
|
@ -891,6 +891,7 @@ impl Repl {
|
||||||
let raw = bio_ss.bio.r(utra::bio_bdma::SFR_RXF0);
|
let raw = bio_ss.bio.r(utra::bio_bdma::SFR_RXF0);
|
||||||
// crate::println!("raw: {:x}", raw);
|
// crate::println!("raw: {:x}", raw);
|
||||||
raw32 <<= BITS_PER_SAMPLE;
|
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)
|
raw32 |= (raw >> 1) & ((1 << BITS_PER_SAMPLE) - 1)
|
||||||
}
|
}
|
||||||
*d = raw32;
|
*d = raw32;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue