MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / sentinelCheckTiltCondition

Function sentinelCheckTiltCondition

src/sentinel.cpp:5101–5111  ·  view source on GitHub ↗

This function checks if we need to enter the TITL mode. * * The TILT mode is entered if we detect that between two invocations of the * timer interrupt, a negative amount of time, or too much time has passed. * Note that we expect that more or less just 100 milliseconds will pass * if everything is fine. However we'll see a negative number or a * difference bigger than SENTINEL_TILT_TRIGGER

Source from the content-addressed store, hash-verified

5099 *
5100 * During TILT time we still collect information, we just do not act. */
5101void sentinelCheckTiltCondition(void) {
5102 mstime_t now = mstime();
5103 mstime_t delta = now - sentinel.previous_time;
5104
5105 if (delta < 0 || delta > SENTINEL_TILT_TRIGGER) {
5106 sentinel.tilt = 1;
5107 sentinel.tilt_start_time = mstime();
5108 sentinelEvent(LL_WARNING,"+tilt",NULL,"#tilt mode entered");
5109 }
5110 sentinel.previous_time = mstime();
5111}
5112
5113void sentinelTimer(void) {
5114 sentinelCheckTiltCondition();

Callers 1

sentinelTimerFunction · 0.85

Calls 2

sentinelEventFunction · 0.85
mstimeFunction · 0.70

Tested by

no test coverage detected