diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 420bd00abb..ebc36bc1af 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1177,19 +1177,21 @@ void process_commands() //ClearToSend(); return; } - //break; + break; case 2: // G2 - CW ARC if(Stopped == false) { get_arc_coordinates(); prepare_arc_move(true); return; } + break; case 3: // G3 - CCW ARC if(Stopped == false) { get_arc_coordinates(); prepare_arc_move(false); return; } + break; case 4: // G4 dwell LCD_MESSAGEPGM(MSG_DWELL); codenum = 0; @@ -1797,7 +1799,7 @@ void process_commands() int pin_number = LED_PIN; if (code_seen('P') && pin_status >= 0 && pin_status <= 255) pin_number = code_value(); - for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++) + for(int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins)/sizeof(int)); i++) { if (sensitive_pins[i] == pin_number) { @@ -2151,8 +2153,9 @@ void process_commands() } break; case 85: // M85 - code_seen('S'); - max_inactive_time = code_value() * 1000; + if(code_seen('S')) { + max_inactive_time = code_value() * 1000; + } break; case 92: // M92 for(int8_t i=0; i < NUM_AXIS; i++) @@ -2273,6 +2276,7 @@ void process_commands() if(tmp_extruder >= EXTRUDERS) { SERIAL_ECHO_START; SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER); + break; } } volumetric_multiplier[tmp_extruder] = 1 / area; diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 737d075754..a199f4e742 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -179,7 +179,7 @@ void PID_autotune(float temp, int extruder, int ncycles) float Kp, Ki, Kd; float max = 0, min = 10000; - if ((extruder > EXTRUDERS) + if ((extruder >= EXTRUDERS) #if (TEMP_BED_PIN <= -1) ||(extruder < 0) #endif @@ -909,7 +909,7 @@ void disable_heater() #endif #endif - #if defined(TEMP_1_PIN) && TEMP_1_PIN > -1 + #if defined(TEMP_1_PIN) && TEMP_1_PIN > -1 && EXTRUDERS > 1 target_temperature[1]=0; soft_pwm[1]=0; #if defined(HEATER_1_PIN) && HEATER_1_PIN > -1 @@ -917,7 +917,7 @@ void disable_heater() #endif #endif - #if defined(TEMP_2_PIN) && TEMP_2_PIN > -1 + #if defined(TEMP_2_PIN) && TEMP_2_PIN > -1 && EXTRUDERS > 2 target_temperature[2]=0; soft_pwm[2]=0; #if defined(HEATER_2_PIN) && HEATER_2_PIN > -1