Skip to content

Commit f7c45a9

Browse files
authored
Merge pull request #1042 from jaeheonshim-forks/inky-blocking-fix
Fix: Properly implement non-blocking update functions for the Inky Frame
2 parents d014b28 + 3811195 commit f7c45a9

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

drivers/inky73/inky73.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ namespace pimoroni {
181181
busy_wait();
182182

183183
command(DRF, {0}); // start display refresh
184-
busy_wait();
185-
184+
186185
if(blocking) {
187186
busy_wait();
188187

libraries/inky_frame/inky_frame.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ namespace pimoroni {
6666
}
6767

6868
void InkyFrame::update(bool blocking) {
69-
while(is_busy()) {
69+
while(blocking && is_busy()) {
7070
tight_loop_contents();
7171
}
7272
uc8159.update((PicoGraphics_PenP4 *)this);
73-
while(is_busy()) {
73+
while(blocking && is_busy()) {
7474
tight_loop_contents();
7575
}
7676
uc8159.power_off();

libraries/inky_frame_7/inky_frame_7.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ namespace pimoroni {
6565
}
6666

6767
void InkyFrame::update(bool blocking) {
68-
while(is_busy()) {
68+
while(blocking && is_busy()) {
6969
tight_loop_contents();
7070
}
7171
inky73.update((PicoGraphics_PenInky7 *)this);
72-
while(is_busy()) {
72+
while(blocking && is_busy()) {
7373
tight_loop_contents();
7474
}
7575
inky73.power_off();

0 commit comments

Comments
 (0)