Add support for M0/M1 messages
... route the messages into modules::motion's SetMode of all axes.pull/114/head
parent
315530ec16
commit
1e6194a9b9
|
|
@ -271,6 +271,13 @@ void PlanCommand(const mp::RequestMsg &rq) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetMode(uint8_t m) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
void ProcessRequestMsg(const mp::RequestMsg &rq) {
|
void ProcessRequestMsg(const mp::RequestMsg &rq) {
|
||||||
switch (rq.code) {
|
switch (rq.code) {
|
||||||
case mp::RequestMsgCodes::Button:
|
case mp::RequestMsgCodes::Button:
|
||||||
|
|
@ -283,7 +290,7 @@ void ProcessRequestMsg(const mp::RequestMsg &rq) {
|
||||||
break;
|
break;
|
||||||
case mp::RequestMsgCodes::Mode:
|
case mp::RequestMsgCodes::Mode:
|
||||||
// immediately switch to normal/stealth as requested
|
// immediately switch to normal/stealth as requested
|
||||||
// modules::motion::SetMode();
|
SetMode(rq.value);
|
||||||
break;
|
break;
|
||||||
case mp::RequestMsgCodes::Query:
|
case mp::RequestMsgCodes::Query:
|
||||||
// immediately report progress of currently running command
|
// immediately report progress of currently running command
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue