mirror of
https://github.com/eddyem/eddys_snippets.git
synced 2025-12-06 02:35:12 +03:00
SEWcontrol: allow to set zero speed
This commit is contained in:
parent
d3b4a8b4bc
commit
0da6bce6e9
@ -29,6 +29,7 @@
|
||||
static int help;
|
||||
static glob_pars G = {
|
||||
.path = DEFAULT_SOCKPATH,
|
||||
.setspeed = INT_MAX,
|
||||
};
|
||||
glob_pars *GP = &G;
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ int main(int argc, char **argv){
|
||||
#endif
|
||||
*/
|
||||
CANcmd mesg = CMD_GETSPEED;
|
||||
if(GP->setspeed){
|
||||
if(GP->setspeed != INT_MAX){
|
||||
if(GP->stop) ERRX("Commands 'stop' and 'set speed' can't be together");
|
||||
if(GP->setspeed < -0xffff/5 || GP->setspeed > 0xffff/5) ERRX("Parameter 'set speed' should be |int16_t| < %d", 0xffff/5);
|
||||
mesg = CMD_SETSPEED;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user