| 309 | #include "semphr.h" |
| 310 | |
| 311 | void espSampleInstrumentation(modTimer timer, void *refcon, int refconSize) |
| 312 | { |
| 313 | txInteger values[espInstrumentCount]; |
| 314 | int what; |
| 315 | xsMachine *the = *(xsMachine **)refcon; |
| 316 | |
| 317 | xSemaphoreTake(gInstrumentMutex, portMAX_DELAY); |
| 318 | |
| 319 | for (what = kModInstrumentationPixelsDrawn; what <= (kModInstrumentationSlotHeapSize - 1); what++) |
| 320 | values[what - kModInstrumentationPixelsDrawn] = modInstrumentationGet_(the, what); |
| 321 | |
| 322 | if (values[kModInstrumentationTurns - kModInstrumentationPixelsDrawn]) |
| 323 | values[kModInstrumentationTurns - kModInstrumentationPixelsDrawn] -= 1; // ignore the turn that generates instrumentation |
| 324 | |
| 325 | fxSampleInstrumentation(the, espInstrumentCount, values); |
| 326 | |
| 327 | modInstrumentationSet(PixelsDrawn, 0); |
| 328 | modInstrumentationSet(FramesDrawn, 0); |
| 329 | modInstrumentationSet(PocoDisplayListUsed, 0); |
| 330 | modInstrumentationSet(PiuCommandListUsed, 0); |
| 331 | modInstrumentationSet(Turns, 0); |
| 332 | modInstrumentMachineReset(the); |
| 333 | |
| 334 | xSemaphoreGive(gInstrumentMutex); |
| 335 | } |
| 336 | |
| 337 | #if INSTRUMENT_CPULOAD |
| 338 | static void cpuTimerHandler(nrf_timer_event_t event_type, void* p_context) |
nothing calls this directly
no test coverage detected