Leverage the ability of motion to SetMode to all know axes

pull/114/head
D.R.racer 2021-09-02 12:06:19 +02:00 committed by DRracer
parent 852ca37e8f
commit 09f81f8b33
1 changed files with 1 additions and 5 deletions

View File

@ -273,12 +273,8 @@ void PlanCommand(const mp::RequestMsg &rq) {
void SetMode(uint8_t m) {
mg::globals.SetMotorsMode(m != 0); // remember the last mode set
// distribute the mode to all motors immediately
mm::MotorMode mode = (m == 0) ? mm::Normal : mm::Stealth;
mm::motion.SetMode(mm::Pulley, mode);
mm::motion.SetMode(mm::Selector, mode);
mm::motion.SetMode(mm::Idler, mode);
mm::motion.SetMode((m == 0) ? mm::Normal : mm::Stealth);
}
void ProcessRequestMsg(const mp::RequestMsg &rq) {