| 903 | } |
| 904 | |
| 905 | void espSampleInstrumentation(modTimer timer, void *refcon, int refconSize) |
| 906 | { |
| 907 | txInteger values[espInstrumentCount]; |
| 908 | int what; |
| 909 | xsMachine *the = *(xsMachine **)refcon; |
| 910 | |
| 911 | #if ESP32 |
| 912 | xSemaphoreTake(gInstrumentMutex, portMAX_DELAY); |
| 913 | #endif |
| 914 | |
| 915 | for (what = kModInstrumentationPixelsDrawn; what <= (kModInstrumentationSlotHeapSize - 1); what++) |
| 916 | values[what - kModInstrumentationPixelsDrawn] = modInstrumentationGet_(the, what); |
| 917 | |
| 918 | if (values[kModInstrumentationTurns - kModInstrumentationPixelsDrawn]) |
| 919 | values[kModInstrumentationTurns - kModInstrumentationPixelsDrawn] -= 1; // ignore the turn that generates instrumentation |
| 920 | |
| 921 | fxSampleInstrumentation(the, espInstrumentCount, values); |
| 922 | |
| 923 | modInstrumentationSet(PixelsDrawn, 0); |
| 924 | modInstrumentationSet(FramesDrawn, 0); |
| 925 | modInstrumentationSet(PocoDisplayListUsed, 0); |
| 926 | modInstrumentationSet(PiuCommandListUsed, 0); |
| 927 | modInstrumentationSet(NetworkBytesRead, 0); |
| 928 | modInstrumentationSet(NetworkBytesWritten, 0); |
| 929 | modInstrumentationSet(Turns, 0); |
| 930 | #if ESP32 |
| 931 | modInstrumentationSet(SPIFlashErases, 0); |
| 932 | #endif |
| 933 | modInstrumentMachineReset(the); |
| 934 | |
| 935 | #if ESP32 |
| 936 | xSemaphoreGive(gInstrumentMutex); |
| 937 | #endif |
| 938 | } |
| 939 | |
| 940 | #if INSTRUMENT_CPULOAD |
| 941 | bool IRAM_ATTR timer_group0_isr(gptimer_handle_t timer, const gptimer_alarm_event_data_t *event, void *ctx) |
nothing calls this directly
no test coverage detected