Use 3 count filter for MHP30 acceleromter (#1762)
* Use 3 count filter for MHP30 acceleromter Requires it to trip 3 times in a row to fire. So really only knocking the unit over trips it off. * Reset shutdown timer forwards on shutdown timeout Default shutdown mode off --------- Co-authored-by: discip <53649486+discip@users.noreply.github.com>
This commit is contained in:
@@ -94,8 +94,10 @@ bool checkExitSoldering(void) {
|
||||
// If we have moved recently; in the last second
|
||||
// Then exit soldering mode
|
||||
|
||||
if (((TickType_t)(xTaskGetTickCount() - lastMovementTime)) < (TickType_t)(TICKS_SECOND)) {
|
||||
// Movement occurred in last update
|
||||
if (((TickType_t)(xTaskGetTickCount() - lastMovementTime)) < (TickType_t)(TICKS_SECOND / 5)) {
|
||||
currentTempTargetDegC = 0;
|
||||
lastMovementTime = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -108,6 +110,8 @@ bool checkExitSoldering(void) {
|
||||
if (shouldShutdown()) {
|
||||
// shutdown
|
||||
currentTempTargetDegC = 0;
|
||||
lastMovementTime = xTaskGetTickCount(); // We manually move the movement time to now such that shutdown timer is reset
|
||||
|
||||
return true; // we want to exit soldering mode
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user