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
| 5084 | * |
| 5085 | * During TILT time we still collect information, we just do not act. */ |
| 5086 | void sentinelCheckTiltCondition(void) { |
| 5087 | mstime_t now = mstime(); |
| 5088 | mstime_t delta = now - sentinel.previous_time; |
| 5089 | |
| 5090 | if (delta < 0 || delta > SENTINEL_TILT_TRIGGER) { |
| 5091 | sentinel.tilt = 1; |
| 5092 | sentinel.tilt_start_time = mstime(); |
| 5093 | sentinelEvent(LL_WARNING,"+tilt",NULL,"#tilt mode entered"); |
| 5094 | } |
| 5095 | sentinel.previous_time = mstime(); |
| 5096 | } |
| 5097 | |
| 5098 | void sentinelTimer(void) { |
| 5099 | sentinelCheckTiltCondition(); |
no test coverage detected