Skip to content

Commit d1b3af7

Browse files
committed
Fix bit masking of debug leds in set_hdd_led()
1 parent 6905718 commit d1b3af7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ impl Hardware {
620620
/// These are connected to the bit 4 of GPIOA on the MCP23S17.
621621
fn set_hdd_led(&mut self, enabled: bool) {
622622
// LEDs are active-low.
623-
self.debug_leds = (self.debug_leds & 0x17) | u8::from(enabled);
623+
self.debug_leds = (self.debug_leds & 0x1e) | if enabled { 0 } else { 1 };
624624
self.io_chip_write(0x12, self.debug_leds << 3 | self.last_cs);
625625
}
626626

0 commit comments

Comments
 (0)