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

Function espSampleInstrumentation

xs/platforms/zephyr/xsHost.c:182–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180extern struct k_mutex gDebugMutex;
181
182void espSampleInstrumentation(modTimer timer, void *refcon, int refconSize)
183{
184 txInteger values[espInstrumentCount];
185 int what;
186 xsMachine *the = *(xsMachine **)refcon;
187
188 k_mutex_lock(&gInstrumentMutex, K_FOREVER);
189
190 for (what = kModInstrumentationPixelsDrawn; what <= (kModInstrumentationSlotHeapSize - 1); what++)
191 values[what - kModInstrumentationPixelsDrawn] = modInstrumentationGet_(the, what);
192
193 if (values[kModInstrumentationTurns - kModInstrumentationPixelsDrawn])
194 values[kModInstrumentationTurns - kModInstrumentationPixelsDrawn] -= 1; // ignore the turn that generates instrumentation
195
196 fxSampleInstrumentation(the, espInstrumentCount, values);
197
198 modInstrumentationSet(PixelsDrawn, 0);
199 modInstrumentationSet(FramesDrawn, 0);
200 modInstrumentationSet(PocoDisplayListUsed, 0);
201 modInstrumentationSet(PiuCommandListUsed, 0);
202#if kModInstrumentationHasNetwork
203 modInstrumentationSet(NetworkBytesRead, 0);
204 modInstrumentationSet(NetworkBytesWritten, 0);
205#endif
206 modInstrumentationSet(Turns, 0);
207 modInstrumentMachineReset(the);
208
209 k_mutex_unlock(&gInstrumentMutex);
210}
211
212#endif
213

Callers

nothing calls this directly

Calls 3

modInstrumentationGet_Function · 0.85
fxSampleInstrumentationFunction · 0.85

Tested by

no test coverage detected