vedderb / bldc

The VESC motor control firmware
2.08k stars 1.31k forks source link

COMM_SHUTDOWN command for shutdown/restart #695

Closed surfdado closed 5 months ago

surfdado commented 6 months ago

cmd[0] = 111 // magic number cmd[1] = [force] // 0=normal, 1=force (allow while motor is spinning) cmd[2] = [restart] // 0=shutdown, 1=restart

Obviously, shutdown only works for hardware with shutdown support

vedderb commented 6 months ago

I think the magic number is not needed really. If you connect something that sends undefined commands that pass the checksums you are in trouble anyway.

surfdado commented 6 months ago

Well, since my pin lock PR hasn't gone anywhere there is actually one app with hundreds of users out there that uses that COMM id for pin lock - so the problem is not just hypothetical.

If we agree to define COMM_SHUTDOWN as 155 then we can avoid the magic nr I guess.

surfdado commented 6 months ago

Just force-pushed a fixup to resolve merge conflicts...

vedderb commented 6 months ago

You could put a pin-lock command in-between as a placeholder for now.

surfdado commented 6 months ago

Okay, done and pushed