Merge pull request #920 from pimoroni/patch-inky7-update-timeout
inky73: Add busy wait timeout.
This commit is contained in:
commit
3a10b29f54
|
@ -47,8 +47,9 @@ namespace pimoroni {
|
||||||
return !(sr.read() & 128);
|
return !(sr.read() & 128);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inky73::busy_wait() {
|
void Inky73::busy_wait(uint timeout_ms) {
|
||||||
while(is_busy()) {
|
absolute_time_t timeout = make_timeout_time_ms(timeout_ms);
|
||||||
|
while(is_busy() && !time_reached(timeout)) {
|
||||||
tight_loop_contents();
|
tight_loop_contents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace pimoroni {
|
||||||
// Methods
|
// Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public:
|
public:
|
||||||
void busy_wait();
|
void busy_wait(uint timeout_ms=45000);
|
||||||
void reset();
|
void reset();
|
||||||
void power_off();
|
void power_off();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue