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
| 5099 | * |
| 5100 | * During TILT time we still collect information, we just do not act. */ |
| 5101 | void 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 | |
| 5113 | void sentinelTimer(void) { |
| 5114 | sentinelCheckTiltCondition(); |
no test coverage detected