File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
libraries/Arduino_LED_Matrix/src Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 2
2
cores /arduino /mydebug.cpp
3
3
libraries /Storage /.development
4
4
cores /arduino /mydebug.cpp.donotuse
5
+ .DS_Store
6
+ .DS_Store ?
Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ class ArduinoLEDMatrix {
175
175
}
176
176
if (_callBack != nullptr ){
177
177
_callBack ();
178
+ _sequenceDone = true ;
178
179
}
179
180
}
180
181
memcpy (framebuffer, (uint32_t *)frame, sizeof (frame));
@@ -193,14 +194,22 @@ class ArduinoLEDMatrix {
193
194
}
194
195
void play (bool loop = false ){
195
196
_loop = loop;
197
+ _sequenceDone = false ;
196
198
next ();
197
199
}
200
+ bool sequenceDone (){
201
+ if (_sequenceDone){
202
+ _sequenceDone = false ;
203
+ return true ;
204
+ }
205
+ return false ;
206
+ }
198
207
void loadWrapper (const uint32_t frames[][4 ], uint32_t howMany) {
199
208
_currentFrame = 0 ;
200
209
_frames = (uint32_t *)frames;
201
210
_framesCount = (howMany / 4 ) / sizeof (uint32_t );
202
211
}
203
-
212
+ // WARNING: callbacks are fired from ISR. The execution time will be limited.
204
213
void setCallback (voidFuncPtr callBack){
205
214
_callBack = callBack;
206
215
}
@@ -213,6 +222,7 @@ class ArduinoLEDMatrix {
213
222
uint32_t _lastInterval = 0 ;
214
223
bool _loop = false ;
215
224
FspTimer _ledTimer;
225
+ bool _sequenceDone = false ;
216
226
voidFuncPtr _callBack;
217
227
218
228
static void turnOnLedISR (timer_callback_args_t *arg) {
You can’t perform that action at this time.
0 commit comments