Rework cControlledRest (for MIN_TIME_ON, MIN_TIME_OFF)

- split up in more simple methods
- clearer structure
This commit is contained in:
jonny
2024-09-06 11:05:31 +02:00
parent e23d37df4c
commit 89cab00acc
3 changed files with 223 additions and 136 deletions

View File

@@ -514,8 +514,8 @@ void controlledArmchair::changeMode(controlMode_t modeNew, bool noBeep)
case controlMode_t::ADJUST_CHAIR:
ESP_LOGW(TAG, "switching from ADJUST_CHAIR mode => turning off adjustment motors...");
// prevent motors from being always on in case of mode switch while joystick is not in center thus motors currently moving
legRest->setState(REST_OFF);
backRest->setState(REST_OFF);
legRest->requestStateChange(REST_OFF);
backRest->requestStateChange(REST_OFF);
break;
}