Replace the <= to < in the Command M907, M350 and M351.

The for loop for Axis count over the Array.
Add a break after M907
This commit is contained in:
midopple 2013-05-05 19:19:55 +02:00
parent e3bc420daa
commit db2f157a22

View File

@ -1708,11 +1708,12 @@ void process_commands()
case 907: // M907 Set digital trimpot motor current using axis codes.
{
#if DIGIPOTSS_PIN > -1
for(int i=0;i<=NUM_AXIS;i++) if(code_seen(axis_codes[i])) digipot_current(i,code_value());
for(int i=0;i<NUM_AXIS;i++) if(code_seen(axis_codes[i])) digipot_current(i,code_value());
if(code_seen('B')) digipot_current(4,code_value());
if(code_seen('S')) for(int i=0;i<=4;i++) digipot_current(i,code_value());
#endif
}
break;
case 908: // M908 Control digital trimpot directly.
{
#if DIGIPOTSS_PIN > -1
@ -1727,7 +1728,7 @@ void process_commands()
{
#if X_MS1_PIN > -1
if(code_seen('S')) for(int i=0;i<=4;i++) microstep_mode(i,code_value());
for(int i=0;i<=NUM_AXIS;i++) if(code_seen(axis_codes[i])) microstep_mode(i,(uint8_t)code_value());
for(int i=0;i<NUM_AXIS;i++) if(code_seen(axis_codes[i])) microstep_mode(i,(uint8_t)code_value());
if(code_seen('B')) microstep_mode(4,code_value());
microstep_readings();
#endif
@ -1739,11 +1740,11 @@ void process_commands()
if(code_seen('S')) switch((int)code_value())
{
case 1:
for(int i=0;i<=NUM_AXIS;i++) if(code_seen(axis_codes[i])) microstep_ms(i,code_value(),-1);
for(int i=0;i<NUM_AXIS;i++) if(code_seen(axis_codes[i])) microstep_ms(i,code_value(),-1);
if(code_seen('B')) microstep_ms(4,code_value(),-1);
break;
case 2:
for(int i=0;i<=NUM_AXIS;i++) if(code_seen(axis_codes[i])) microstep_ms(i,-1,code_value());
for(int i=0;i<NUM_AXIS;i++) if(code_seen(axis_codes[i])) microstep_ms(i,-1,code_value());
if(code_seen('B')) microstep_ms(4,-1,code_value());
break;
}