Remove usage of global variable tmp_extruder in M200.

This commit is contained in:
Marek Bel 2018-08-23 15:58:08 +02:00
parent 3c9047c9cd
commit 0de7668bac

View file

@ -5808,10 +5808,10 @@ Sigma_Exit:
case 200: // M200 D<millimeters> set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). case 200: // M200 D<millimeters> set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).
{ {
tmp_extruder = active_extruder; uint8_t extruder = active_extruder;
if(code_seen('T')) { if(code_seen('T')) {
tmp_extruder = code_value(); extruder = code_value();
if(tmp_extruder >= EXTRUDERS) { if(extruder >= EXTRUDERS) {
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHO(_i("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER c=0 r=0 SERIAL_ECHO(_i("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER c=0 r=0
break; break;
@ -5825,7 +5825,7 @@ Sigma_Exit:
// for all extruders // for all extruders
volumetric_enabled = false; volumetric_enabled = false;
} else { } else {
filament_size[tmp_extruder] = (float)code_value(); filament_size[extruder] = (float)code_value();
// make sure all extruders have some sane value for the filament size // make sure all extruders have some sane value for the filament size
filament_size[0] = (filament_size[0] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : filament_size[0]); filament_size[0] = (filament_size[0] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : filament_size[0]);
#if EXTRUDERS > 1 #if EXTRUDERS > 1