File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1609,12 +1609,14 @@ void emcmotCommandHandler_locked(void *arg, long servo_period)
16091609 emcmotStatus -> spindle_status [n ].speed = emcmotCommand -> vel ;
16101610 emcmotStatus -> spindle_status [n ].css_factor = emcmotCommand -> ini_maxvel ;
16111611 emcmotStatus -> spindle_status [n ].xoffset = emcmotCommand -> acc ;
1612- if (emcmotCommand -> vel >= 0 ) {
1613- emcmotStatus -> spindle_status [n ].direction = 1 ;
1614- } else {
1615- emcmotStatus -> spindle_status [n ].direction = -1 ;
1616- }
1617- emcmotStatus -> spindle_status [n ].brake = 0 ; //disengage brake
1612+ if (emcmotCommand -> state ) {
1613+ if (emcmotCommand -> vel >= 0 ) {
1614+ emcmotStatus -> spindle_status [n ].direction = 1 ;
1615+ } else {
1616+ emcmotStatus -> spindle_status [n ].direction = -1 ;
1617+ }
1618+ emcmotStatus -> spindle_status [n ].brake = 0 ; //disengage brake
1619+ }
16181620 apply_spindle_limits (& emcmotStatus -> spindle_status [n ]);
16191621 }
16201622 emcmotStatus -> atspeed_next_feed = emcmotCommand -> wait_for_spindle_at_speed ;
Original file line number Diff line number Diff line change @@ -1906,7 +1906,7 @@ static void output_to_hal(void)
19061906 * (emcmot_hal_data -> spindle [spindle_num ].spindle_speed_out_abs ) = fabs (speed );
19071907 * (emcmot_hal_data -> spindle [spindle_num ].spindle_speed_out_rps_abs ) = fabs (speed / 60 );
19081908 * (emcmot_hal_data -> spindle [spindle_num ].spindle_on ) =
1909- ((emcmotStatus -> spindle_status [spindle_num ].state * speed ) != 0 ) ? 1 : 0 ;
1909+ ((emcmotStatus -> spindle_status [spindle_num ].state ) != 0 ) ? 1 : 0 ;
19101910 * (emcmot_hal_data -> spindle [spindle_num ].spindle_forward ) = (speed > 0 ) ? 1 : 0 ;
19111911 * (emcmot_hal_data -> spindle [spindle_num ].spindle_reverse ) = (speed < 0 ) ? 1 : 0 ;
19121912 * (emcmot_hal_data -> spindle [spindle_num ].spindle_brake ) =
You can’t perform that action at this time.
0 commit comments