173 {
174
175
176
177
182 uint32_t delta_ms = now_ms - s_prev_time;
183 s_prev_time = now_ms;
184
186 if (
Serial.available() > 0) {
188 if (v == 'd') {
190 }
191 }
192 }
193
195
196 const unsigned long start_time =
fl::millis();
197
198
199 for (int i = 0; i < 100; ++i) {
200 MY_MIDI.read();
201 }
202
203 const unsigned long midi_time =
fl::millis() - start_time;
204
205
206
208
209
210
211
212 keyboard.Update(now_ms + delta_ms, delta_ms);
214
216
217
218
219
220
221
222
223
224 const unsigned long start_painting =
fl::millis();
226
227
228
231
232 const unsigned long paint_time =
fl::millis() - start_time;
233 const unsigned long total_time = midi_time + paint_time + keyboard_delta_time;
234
236 float fps = 1.0f/(float(total_time) / 1000.f);
238 Serial.print(
"midi time - ");
Serial.println(midi_time);
239 Serial.print(
"keyboard update time - ");
Serial.println(keyboard_delta_time);
240 Serial.print(
"draw & paint time - ");
Serial.println(paint_time);
241 }
242
245 }
246
247
249}
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
LedRopeTCL led_rope(kNumKeys)
void DbgDoSimulatedKeyboardPress()
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
#define FASTLED_UNUSED(x)
static void Paint(uint32_t now_ms, uint32_t delta_ms, VisState vis_state, KeyboardState *keyboard, LedRopeInterface *light_rope)
ui_state ui_update(uint32_t now_ms, uint32_t delta_ms)