kopia lustrzana https://github.com/pimoroni/pimoroni-pico
inky73: Add busy wait timeout.
Add a timeout to fix Inky 7.3" hanging on batteries. Basically assumes the update has finished if it takes > 45s, and allows a subsequent attempt rather than hanging indefinitely. Raised, texted and fixed by w3stbam: https://github.com/pimoroni/pimoroni-pico/pull/900 Rewritten as mentioned in the PR.patch-inky7-update-timeout
rodzic
f1ea35fbbf
commit
8cf276b992
|
@ -47,8 +47,9 @@ namespace pimoroni {
|
|||
return !(sr.read() & 128);
|
||||
}
|
||||
|
||||
void Inky73::busy_wait() {
|
||||
while(is_busy()) {
|
||||
void Inky73::busy_wait(uint timeout_ms) {
|
||||
absolute_time_t timeout = make_timeout_time_ms(timeout_ms);
|
||||
while(is_busy() && !time_reached(timeout)) {
|
||||
tight_loop_contents();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace pimoroni {
|
|||
// Methods
|
||||
//--------------------------------------------------
|
||||
public:
|
||||
void busy_wait();
|
||||
void busy_wait(uint timeout_ms=45000);
|
||||
void reset();
|
||||
void power_off();
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue