Skip to content

Commit 85ee1ee

Browse files
committed
another attempt
1 parent 939cf8b commit 85ee1ee

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cpp/jddisplay.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,13 @@ JDDisplay::JDDisplay(SPI *spi, Pin *cs, Pin *flow) : spi(spi), cs(cs), flow(flow
9797
flow->eventOn(DEVICE_PIN_EVT_RISE);
9898

9999
// set up polling for buttons
100-
EventModel::defaultEventBus->listen(DEVICE_ID_COMPONENT, DEVICE_COMPONENT_EVT_SYSTEM_TICK, this, &JDDisplay::pollButtons);
100+
EventModel::defaultEventBus->listen(DEVICE_ID_COMPONENT, DEVICE_COMPONENT_EVT_SYSTEM_TICK, this,
101+
&JDDisplay::pollButtons, MESSAGE_BUS_LISTENER_IMMEDIATE);
101102
}
102103

103104
void JDDisplay::pollButtons(Event) {
104-
inProgressLock.wait();
105-
step(false);
105+
if (stepWaiting)
106+
step(false);
106107
}
107108

108109
void JDDisplay::sendDone(JDDisplay* jdd) {
@@ -261,7 +262,7 @@ void JDDisplay::step(bool sendImage) {
261262
}
262263

263264
if (!sendImage) {
264-
flushSend();
265+
sendDone(this);
265266
return;
266267
}
267268

0 commit comments

Comments
 (0)