A fork of pulp-os for the xteink4 adding custom apps
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

add: wfi, shut off display

hansmrtn 8e66b0e3 9a61f3f4

+6 -3
+2 -3
src/bin/main.rs
··· 123 123 } 124 124 125 125 // 2. Check wake events (non-blocking). 126 - // When nothing is pending, idle briefly so we don't spin at full speed. 127 - // TODO: replace with proper WFI once esp-hal wake sources are configured. 126 + // When nothing is pending, WFI suspends the core until the next interrupt. 128 127 let should_poll = match try_wake() { 129 128 Some(WakeReason::Timer) | Some(WakeReason::Multiple) => poller.tick(), 130 129 ··· 139 138 } 140 139 141 140 None => { 142 - delay.delay_millis(1); 141 + pulp_os::kernel::wake::wait_for_interrupt(); 143 142 continue; 144 143 } 145 144 };
+4
src/board/display.rs
··· 251 251 // This is writeImageAgain() in GxEPD2 252 252 self.write_image_partial_physical(cmd::WRITE_RAM_RED, px, py, pw, ph); 253 253 self.write_image_partial_physical(cmd::WRITE_RAM_BW, px, py, pw, ph); 254 + 255 + // Step 4: Power off display controller to save power. 256 + // E-paper retains image without power. Leaving it on draws ~15mA idle. 257 + self.power_off(delay); 254 258 } 255 259 256 260 /// Transform logical region to physical region based on rotation