benilla-re systems structs docs

CalibrationThreadProc

function · core · orchestration

Address
0x42b9c0 · 86 bytes, up to 0x42ba15
Signature
uint32_t __stdcall (void *unused)
Meaning
Runs the calibration, then frees the time manager and saves the counter rate
Confidence
verified, proof one
Finding
core/time#calibration-thread

Finding: Calibration thread in core: time

The time manager starts a thread, OsTime, which samples the counter and GetTickCount every 250 ms into a ring of 121 samples and estimates the counter's rate over 1, 4, 20 and 120 samples. It picks the shortest span whose estimate strays from the stored rate beyond its tolerance, capped where neighbouring estimates disagree. In mode 0, a pick of the 20- or 120-sample span, or none, stores the 120-sample estimate and switches to mode 1; a 1- or 4-sample pick stores that estimate and stays. In mode 1 a pick stores its estimate and rescales, and returns to mode 0 when the short-span estimates disagree. The switch is not one-way.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 5

Calls and jumps by a bare address, from tables/calls.tsv.