Fix code indentation.
This commit is contained in:
parent
9fb68fb724
commit
55eaa1de83
1 changed files with 109 additions and 109 deletions
|
@ -6793,132 +6793,132 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
|
||||||
|
|
||||||
else if(code_seen('T'))
|
else if(code_seen('T'))
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++);
|
for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++);
|
||||||
|
|
||||||
if ((*(strchr_pointer + index) < '0' || *(strchr_pointer + index) > '9') && *(strchr_pointer + index) != '?') {
|
|
||||||
SERIAL_ECHOLNPGM("Invalid T code.");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (*(strchr_pointer + index) == '?') {
|
|
||||||
tmp_extruder = choose_extruder_menu();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
tmp_extruder = code_value();
|
|
||||||
}
|
|
||||||
snmm_filaments_used |= (1 << tmp_extruder); //for stop print
|
|
||||||
|
|
||||||
if (mmu_enabled)
|
if ((*(strchr_pointer + index) < '0' || *(strchr_pointer + index) > '9') && *(strchr_pointer + index) != '?') {
|
||||||
{
|
SERIAL_ECHOLNPGM("Invalid T code.");
|
||||||
//printf_P(PSTR("T code: %d \n"), tmp_extruder);
|
}
|
||||||
//mmu_printf_P(PSTR("T%d\n"), tmp_extruder);
|
else {
|
||||||
mmu_command(MMU_CMD_T0 + tmp_extruder);
|
if (*(strchr_pointer + index) == '?') {
|
||||||
|
tmp_extruder = choose_extruder_menu();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tmp_extruder = code_value();
|
||||||
|
}
|
||||||
|
snmm_filaments_used |= (1 << tmp_extruder); //for stop print
|
||||||
|
|
||||||
manage_response(true, true);
|
if (mmu_enabled)
|
||||||
mmu_command(MMU_CMD_C0);
|
{
|
||||||
mmu_extruder = tmp_extruder; //filament change is finished
|
//printf_P(PSTR("T code: %d \n"), tmp_extruder);
|
||||||
|
//mmu_printf_P(PSTR("T%d\n"), tmp_extruder);
|
||||||
|
mmu_command(MMU_CMD_T0 + tmp_extruder);
|
||||||
|
|
||||||
if (*(strchr_pointer + index) == '?')// for single material usage with mmu
|
manage_response(true, true);
|
||||||
mmu_load_to_nozzle();
|
mmu_command(MMU_CMD_C0);
|
||||||
}
|
mmu_extruder = tmp_extruder; //filament change is finished
|
||||||
else
|
|
||||||
{
|
if (*(strchr_pointer + index) == '?')// for single material usage with mmu
|
||||||
|
mmu_load_to_nozzle();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
#ifdef SNMM
|
#ifdef SNMM
|
||||||
|
|
||||||
#ifdef LIN_ADVANCE
|
#ifdef LIN_ADVANCE
|
||||||
if (mmu_extruder != tmp_extruder)
|
if (mmu_extruder != tmp_extruder)
|
||||||
clear_current_adv_vars(); //Check if the selected extruder is not the active one and reset LIN_ADVANCE variables if so.
|
clear_current_adv_vars(); //Check if the selected extruder is not the active one and reset LIN_ADVANCE variables if so.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mmu_extruder = tmp_extruder;
|
|
||||||
|
|
||||||
|
mmu_extruder = tmp_extruder;
|
||||||
delay(100);
|
|
||||||
|
|
||||||
disable_e0();
|
|
||||||
disable_e1();
|
|
||||||
disable_e2();
|
|
||||||
|
|
||||||
pinMode(E_MUX0_PIN, OUTPUT);
|
delay(100);
|
||||||
pinMode(E_MUX1_PIN, OUTPUT);
|
|
||||||
|
|
||||||
delay(100);
|
disable_e0();
|
||||||
SERIAL_ECHO_START;
|
disable_e1();
|
||||||
SERIAL_ECHO("T:");
|
disable_e2();
|
||||||
SERIAL_ECHOLN((int)tmp_extruder);
|
|
||||||
switch (tmp_extruder) {
|
|
||||||
case 1:
|
|
||||||
WRITE(E_MUX0_PIN, HIGH);
|
|
||||||
WRITE(E_MUX1_PIN, LOW);
|
|
||||||
|
|
||||||
break;
|
pinMode(E_MUX0_PIN, OUTPUT);
|
||||||
case 2:
|
pinMode(E_MUX1_PIN, OUTPUT);
|
||||||
WRITE(E_MUX0_PIN, LOW);
|
|
||||||
WRITE(E_MUX1_PIN, HIGH);
|
|
||||||
|
|
||||||
break;
|
delay(100);
|
||||||
case 3:
|
SERIAL_ECHO_START;
|
||||||
WRITE(E_MUX0_PIN, HIGH);
|
SERIAL_ECHO("T:");
|
||||||
WRITE(E_MUX1_PIN, HIGH);
|
SERIAL_ECHOLN((int)tmp_extruder);
|
||||||
|
switch (tmp_extruder) {
|
||||||
|
case 1:
|
||||||
|
WRITE(E_MUX0_PIN, HIGH);
|
||||||
|
WRITE(E_MUX1_PIN, LOW);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
case 2:
|
||||||
WRITE(E_MUX0_PIN, LOW);
|
WRITE(E_MUX0_PIN, LOW);
|
||||||
WRITE(E_MUX1_PIN, LOW);
|
WRITE(E_MUX1_PIN, HIGH);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
case 3:
|
||||||
delay(100);
|
WRITE(E_MUX0_PIN, HIGH);
|
||||||
|
WRITE(E_MUX1_PIN, HIGH);
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WRITE(E_MUX0_PIN, LOW);
|
||||||
|
WRITE(E_MUX1_PIN, LOW);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
delay(100);
|
||||||
|
|
||||||
#else //SNMM
|
#else //SNMM
|
||||||
if (tmp_extruder >= EXTRUDERS) {
|
if (tmp_extruder >= EXTRUDERS) {
|
||||||
SERIAL_ECHO_START;
|
SERIAL_ECHO_START;
|
||||||
SERIAL_ECHOPGM("T");
|
SERIAL_ECHOPGM("T");
|
||||||
SERIAL_PROTOCOLLN((int)tmp_extruder);
|
SERIAL_PROTOCOLLN((int)tmp_extruder);
|
||||||
SERIAL_ECHOLNRPGM(_n("Invalid extruder"));////MSG_INVALID_EXTRUDER c=0 r=0
|
SERIAL_ECHOLNRPGM(_n("Invalid extruder"));////MSG_INVALID_EXTRUDER c=0 r=0
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if EXTRUDERS > 1
|
#if EXTRUDERS > 1
|
||||||
boolean make_move = false;
|
boolean make_move = false;
|
||||||
#endif
|
#endif
|
||||||
if (code_seen('F')) {
|
if (code_seen('F')) {
|
||||||
#if EXTRUDERS > 1
|
#if EXTRUDERS > 1
|
||||||
make_move = true;
|
make_move = true;
|
||||||
#endif
|
#endif
|
||||||
next_feedrate = code_value();
|
next_feedrate = code_value();
|
||||||
if (next_feedrate > 0.0) {
|
if (next_feedrate > 0.0) {
|
||||||
feedrate = next_feedrate;
|
feedrate = next_feedrate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if EXTRUDERS > 1
|
#if EXTRUDERS > 1
|
||||||
if (tmp_extruder != active_extruder) {
|
if (tmp_extruder != active_extruder) {
|
||||||
// Save current position to return to after applying extruder offset
|
// Save current position to return to after applying extruder offset
|
||||||
memcpy(destination, current_position, sizeof(destination));
|
memcpy(destination, current_position, sizeof(destination));
|
||||||
// Offset extruder (only by XY)
|
// Offset extruder (only by XY)
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
current_position[i] = current_position[i] -
|
current_position[i] = current_position[i] -
|
||||||
extruder_offset[i][active_extruder] +
|
extruder_offset[i][active_extruder] +
|
||||||
extruder_offset[i][tmp_extruder];
|
extruder_offset[i][tmp_extruder];
|
||||||
}
|
}
|
||||||
// Set the new active extruder and position
|
// Set the new active extruder and position
|
||||||
active_extruder = tmp_extruder;
|
active_extruder = tmp_extruder;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
||||||
// Move to the old position if 'F' was in the parameters
|
// Move to the old position if 'F' was in the parameters
|
||||||
if (make_move && Stopped == false) {
|
if (make_move && Stopped == false) {
|
||||||
prepare_move();
|
prepare_move();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SERIAL_ECHO_START;
|
SERIAL_ECHO_START;
|
||||||
SERIAL_ECHORPGM(_n("Active Extruder: "));////MSG_ACTIVE_EXTRUDER c=0 r=0
|
SERIAL_ECHORPGM(_n("Active Extruder: "));////MSG_ACTIVE_EXTRUDER c=0 r=0
|
||||||
SERIAL_PROTOCOLLN((int)active_extruder);
|
SERIAL_PROTOCOLLN((int)active_extruder);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //SNMM
|
#endif //SNMM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end if(code_seen('T')) (end of T codes)
|
} // end if(code_seen('T')) (end of T codes)
|
||||||
|
|
||||||
else if (code_seen('D')) // D codes (debug)
|
else if (code_seen('D')) // D codes (debug)
|
||||||
|
|
Loading…
Reference in a new issue