Commit 695a4318 authored by MagoKimbra's avatar MagoKimbra

Add M111 Repetier Debug command

Repetier command for Dryrun
parent b80ba5c6
......@@ -299,5 +299,12 @@ extern void digipot_i2c_set_current( int channel, float current );
extern void digipot_i2c_init();
#endif
// Debug with repetier
extern uint8_t debugLevel;
extern inline bool debugDryrun()
{
return ((debugLevel & 8)!=0);
}
#endif
......@@ -124,6 +124,7 @@
// M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
// Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
// IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
// M111 - Debug mode
// M112 - Emergency stop
// M114 - Output current position to serial port
// M115 - Capabilities string
......@@ -306,6 +307,8 @@ float lastpos[4];
uint8_t active_extruder = 0;
uint8_t active_driver = 0;
uint8_t debugLevel = 0;
int fanSpeed=0;
#ifdef SERVO_ENDSTOPS
int servo_endstops[] = SERVO_ENDSTOPS;
......@@ -3383,9 +3386,8 @@ Sigma_Exit:
#endif // ENABLE_AUTO_BED_LEVELING
case 104: // M104
if(setTargetedHotend(104)){
break;
}
if(setTargetedHotend(104)) break;
if(debugDryrun()) break;
if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
#ifdef DUAL_X_CARRIAGE
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
......@@ -3393,16 +3395,26 @@ Sigma_Exit:
#endif
setWatch();
break;
case 111: // M111 - Debug mode
if (code_seen('S')) debugLevel = code_value();
if (debugDryrun()) {
SERIAL_ECHOLN("DEBUG DRYRUN ENABLED");
setTargetBed(0);
for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
setTargetHotend(0, cur_extruder);
}
}
break;
case 112: // M112 -Emergency Stop
kill();
break;
case 140: // M140 set bed temp
if(debugDryrun()) break;
if (code_seen('S')) setTargetBed(code_value());
break;
case 105 : // M105
if(setTargetedHotend(105)){
break;
}
if(setTargetedHotend(105)) break;
if(debugDryrun()) break;
#if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
SERIAL_PROTOCOLPGM("ok T:");
SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1);
......@@ -3465,9 +3477,8 @@ Sigma_Exit:
break;
case 109:
{// M109 - Wait for extruder heater to reach target.
if(setTargetedHotend(109)){
break;
}
if(setTargetedHotend(109)) break;
if(debugDryrun()) break;
LCD_MESSAGEPGM(MSG_HEATING);
#ifdef AUTOTEMP
autotemp_enabled=false;
......@@ -3558,6 +3569,7 @@ Sigma_Exit:
break;
case 190: // M190 - Wait for bed heater to reach target.
#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
if(debugDryrun()) break;
LCD_MESSAGEPGM(MSG_BED_HEATING);
if (code_seen('S')) {
setTargetBed(code_value());
......
......@@ -567,7 +567,7 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
{
if (active_extruder!=1)
{
if(degHotend(active_extruder)<extrude_min_temp)
if(degHotend(active_extruder)<extrude_min_temp && !debugDryrun())
{
position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
SERIAL_ECHO_START;
......@@ -577,7 +577,7 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
#else // NO NPR2
if(target[E_AXIS]!=position[E_AXIS])
{
if(degHotend(active_extruder)<extrude_min_temp)
if(degHotend(active_extruder)<extrude_min_temp && !debugDryrun())
{
position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
SERIAL_ECHO_START;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment