From: Mikko Rasa Date: Thu, 7 Nov 2013 23:34:35 +0000 (+0200) Subject: Keep zero speed as is X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=57bb90d8019098a9b8fe63093498862ce6551017;p=model-railway-devices.git Keep zero speed as is --- diff --git a/arducontrol/mfx.c b/arducontrol/mfx.c index 6e843aa..293765f 100644 --- a/arducontrol/mfx.c +++ b/arducontrol/mfx.c @@ -429,7 +429,9 @@ uint8_t mfx_command(const uint8_t *cmd, uint8_t length) uint8_t speed_dir = cmd[3]; if((speed_dir&0x7F)==0x7F) return INVALID_VALUE; - ++speed_dir; + // Skip emergency stop + if(speed_dir>0) + ++speed_dir; if(cmd[0]==MFX_SPEED) mfx_speed_packet(addr, speed_dir);