Fix code indentation.

This commit is contained in:
Marek Bel 2018-08-28 18:26:10 +02:00
parent 9fb68fb724
commit 55eaa1de83

View file

@ -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) != '?') { if ((*(strchr_pointer + index) < '0' || *(strchr_pointer + index) > '9') && *(strchr_pointer + index) != '?') {
SERIAL_ECHOLNPGM("Invalid T code."); SERIAL_ECHOLNPGM("Invalid T code.");
} }
else { else {
if (*(strchr_pointer + index) == '?') { if (*(strchr_pointer + index) == '?') {
tmp_extruder = choose_extruder_menu(); tmp_extruder = choose_extruder_menu();
} }
else { else {
tmp_extruder = code_value(); tmp_extruder = code_value();
} }
snmm_filaments_used |= (1 << tmp_extruder); //for stop print snmm_filaments_used |= (1 << tmp_extruder); //for stop print
if (mmu_enabled) if (mmu_enabled)
{ {
//printf_P(PSTR("T code: %d \n"), tmp_extruder); //printf_P(PSTR("T code: %d \n"), tmp_extruder);
//mmu_printf_P(PSTR("T%d\n"), tmp_extruder); //mmu_printf_P(PSTR("T%d\n"), tmp_extruder);
mmu_command(MMU_CMD_T0 + tmp_extruder); mmu_command(MMU_CMD_T0 + tmp_extruder);
manage_response(true, true); manage_response(true, true);
mmu_command(MMU_CMD_C0); mmu_command(MMU_CMD_C0);
mmu_extruder = tmp_extruder; //filament change is finished mmu_extruder = tmp_extruder; //filament change is finished
if (*(strchr_pointer + index) == '?')// for single material usage with mmu if (*(strchr_pointer + index) == '?')// for single material usage with mmu
mmu_load_to_nozzle(); mmu_load_to_nozzle();
} }
else 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); delay(100);
disable_e0(); disable_e0();
disable_e1(); disable_e1();
disable_e2(); disable_e2();
pinMode(E_MUX0_PIN, OUTPUT); pinMode(E_MUX0_PIN, OUTPUT);
pinMode(E_MUX1_PIN, OUTPUT); pinMode(E_MUX1_PIN, OUTPUT);
delay(100); delay(100);
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHO("T:"); SERIAL_ECHO("T:");
SERIAL_ECHOLN((int)tmp_extruder); SERIAL_ECHOLN((int)tmp_extruder);
switch (tmp_extruder) { switch (tmp_extruder) {
case 1: case 1:
WRITE(E_MUX0_PIN, HIGH); WRITE(E_MUX0_PIN, HIGH);
WRITE(E_MUX1_PIN, LOW); WRITE(E_MUX1_PIN, LOW);
break; break;
case 2: case 2:
WRITE(E_MUX0_PIN, LOW); WRITE(E_MUX0_PIN, LOW);
WRITE(E_MUX1_PIN, HIGH); WRITE(E_MUX1_PIN, HIGH);
break; break;
case 3: case 3:
WRITE(E_MUX0_PIN, HIGH); WRITE(E_MUX0_PIN, HIGH);
WRITE(E_MUX1_PIN, HIGH); WRITE(E_MUX1_PIN, HIGH);
break; break;
default: default:
WRITE(E_MUX0_PIN, LOW); WRITE(E_MUX0_PIN, LOW);
WRITE(E_MUX1_PIN, LOW); WRITE(E_MUX1_PIN, LOW);
break; break;
} }
delay(100); 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)