Skip to content

Commit 1ab0126

Browse files
committed
docs: add comment explaining PCF8574 bitmask in fan_controller
1 parent 758b0b8 commit 1ab0126

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/fan_controller.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ impl FanController {
3636

3737
pub fn fan_on(&mut self) -> Result<(), Box<dyn std::error::Error>> {
3838
debug!("Sending fan on signal [p0: low]");
39+
// 0xFE = p0 low (fan on), p1-p7 high (inactive, no other peripherals on this board)
3940
self.expander
4041
.set(0xFE)
4142
.map_err(|e| format!("Fan on error: {:?}", e))?;
@@ -45,6 +46,7 @@ impl FanController {
4546

4647
pub fn fan_off(&mut self) -> Result<(), Box<dyn std::error::Error>> {
4748
debug!("Sending fan off signal [p0: high]");
49+
// 0xFF = all pins high (fan off, p1-p7 inactive)
4850
self.expander
4951
.set(0xFF)
5052
.map_err(|e| format!("Fan off error: {:?}", e))?;

0 commit comments

Comments
 (0)