MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / espSampleInstrumentation

Function espSampleInstrumentation

xs/platforms/nrf52/xsHost.c:311–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309#include "semphr.h"
310
311void 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
338static void cpuTimerHandler(nrf_timer_event_t event_type, void* p_context)

Callers

nothing calls this directly

Calls 3

modInstrumentationGet_Function · 0.85
fxSampleInstrumentationFunction · 0.85

Tested by

no test coverage detected