#define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2)
#define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel
#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation
#define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm
#define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm
#define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM)
//defines used in the code
#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially
case208:// M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
if(code_seen('F'))
{
if(code_seen('S'))
{
retract_recover_length=code_value();
}
if(code_seen('F'))
{
retract_recover_feedrate=code_value()/60;
}
retract_feedrate=code_value()/60;
}
break;
case209:// M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
if(code_seen('Z'))
{
if(code_seen('S'))
retract_zlift=code_value();
}
}break;
case208:// M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
{
if(code_seen('S'))
{
retract_recover_length=code_value();
}
if(code_seen('F'))
{
retract_recover_feedrate=code_value()/60;
}
}break;
case209:// M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
{
if(code_seen('S'))
{
intt=code_value();
switch(t)
{
intt=code_value();
switch(t)
case0:
{
case0:
{
autoretract_enabled=false;
retracted[0]=false;
#if EXTRUDERS > 1
retracted[1]=false;
#endif
#if EXTRUDERS > 2
retracted[2]=false;
#endif
#if EXTRUDERS > 3
retracted[3]=false;
#endif
}
break;
case1:
{
autoretract_enabled=true;
retracted[0]=false;
#if EXTRUDERS > 1
retracted[1]=false;
#endif
#if EXTRUDERS > 2
retracted[2]=false;
#endif
#if EXTRUDERS > 3
autoretract_enabled=false;
retracted[0]=false;
#if EXTRUDERS > 1
retracted[1]=false;
#endif
#if EXTRUDERS > 2
retracted[2]=false;
#endif
#if EXTRUDERS > 3
retracted[3]=false;
#endif
}break;
case1:
{
autoretract_enabled=true;
retracted[0]=false;
#if EXTRUDERS > 1
retracted[1]=false;
#endif
#if EXTRUDERS > 2
retracted[2]=false;
#endif
#if EXTRUDERS > 3
retracted[3]=false;
#endif
}
break;
default:
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND);
SERIAL_ECHO(cmdbuffer[bufindr]);
SERIAL_ECHOLNPGM("\"");
}
#endif
}break;
default:
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND);
SERIAL_ECHO(cmdbuffer[bufindr]);
SERIAL_ECHOLNPGM("\"");
}
}
break;
#endif // FWRETRACT
#if EXTRUDERS > 1 && !defined(SINGLENOZZLE)
case218:// M218 - set hotend offset (in mm), T<extruder_number> X<offset_on_X> Y<offset_on_Y>
}break;
#endif // FWRETRACT
#ifndef SINGLENOZZLE
#if EXTRUDERS > 1
case218:// M218 - set hotend offset (in mm), T<extruder_number> X<offset_on_X> Y<offset_on_Y>