Skip to content

Commit 3a10b29

Browse files
authored
Merge pull request #920 from pimoroni/patch-inky7-update-timeout
inky73: Add busy wait timeout.
2 parents f1ea35f + 8cf276b commit 3a10b29

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/inky73/inky73.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ namespace pimoroni {
4747
return !(sr.read() & 128);
4848
}
4949

50-
void Inky73::busy_wait() {
51-
while(is_busy()) {
50+
void Inky73::busy_wait(uint timeout_ms) {
51+
absolute_time_t timeout = make_timeout_time_ms(timeout_ms);
52+
while(is_busy() && !time_reached(timeout)) {
5253
tight_loop_contents();
5354
}
5455
}

drivers/inky73/inky73.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace pimoroni {
7070
// Methods
7171
//--------------------------------------------------
7272
public:
73-
void busy_wait();
73+
void busy_wait(uint timeout_ms=45000);
7474
void reset();
7575
void power_off();
7676

0 commit comments

Comments
 (0)