Merge pull request #39 from XPila/MK3

Serial port ECHO bug fix - for clear eerpom farm_mode will be set to …
This commit is contained in:
XPila 2017-09-15 16:35:38 +02:00 committed by GitHub
commit b196b9a293
4 changed files with 43 additions and 36 deletions

View file

@ -23,7 +23,7 @@
#include "Marlin.h" #include "Marlin.h"
#include "MarlinSerial.h" #include "MarlinSerial.h"
int selectedSerialPort; int selectedSerialPort = 0;
#ifndef AT90USB #ifndef AT90USB
// this next line disables the entire HardwareSerial.cpp, // this next line disables the entire HardwareSerial.cpp,

View file

@ -760,7 +760,7 @@ void setup()
setup_powerhold(); setup_powerhold();
farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE); farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE);
EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no); EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no);
//if ((farm_mode == 0xFF && farm_no == 0) || (farm_no == 0xFFFF)) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode if ((farm_mode == 0xFF && farm_no == 0) || (farm_no == 0xFFFF)) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode
if (farm_no == 0xFFFF) farm_no = 0; if (farm_no == 0xFFFF) farm_no = 0;
if (farm_mode) if (farm_mode)
{ {
@ -5582,6 +5582,13 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
dcode_3(); break; dcode_3(); break;
case 4: // D4 - Read/Write PIN case 4: // D4 - Read/Write PIN
dcode_4(); break; dcode_4(); break;
case 5:
MYSERIAL.println("D5 - Test");
if (code_seen('P'))
selectedSerialPort = (int)code_value();
MYSERIAL.print("selectedSerialPort = ");
MYSERIAL.println(selectedSerialPort, DEC);
break;
/* case 4: /* case 4:
{ {
MYSERIAL.println("D4 - Test"); MYSERIAL.println("D4 - Test");
@ -5619,14 +5626,14 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
#endif #endif
break;*/ break;*/
// break; // break;
case 5: /* case 5:
{ {
/* MYSERIAL.print("tmc2130_rd_MSCNT(0)="); MYSERIAL.print("tmc2130_rd_MSCNT(0)=");
int val = tmc2130_rd_MSCNT(tmc2130_cs[0]); int val = tmc2130_rd_MSCNT(tmc2130_cs[0]);
MYSERIAL.println(val);*/ MYSERIAL.println(val);
homeaxis(0); homeaxis(0);
} }
break; break;*/
case 6: case 6:
{ {
/* MYSERIAL.print("tmc2130_rd_MSCNT(1)="); /* MYSERIAL.print("tmc2130_rd_MSCNT(1)=");
@ -6691,7 +6698,7 @@ void serialecho_temperatures() {
void uvlo_() { void uvlo_() {
//SERIAL_ECHOLNPGM("UVLO"); SERIAL_ECHOLNPGM("UVLO");
save_print_to_eeprom(); save_print_to_eeprom();
float current_position_bckp[2]; float current_position_bckp[2];
int feedrate_bckp = feedrate; int feedrate_bckp = feedrate;

View file

@ -356,7 +356,7 @@ void get_command()
if (selectedSerialPort == 1) if (selectedSerialPort == 1)
{ {
selectedSerialPort = 0; selectedSerialPort = 0;
MYSERIAL.write(serial_char); MYSERIAL.write(serial_char); // for debuging serial line 2 in farm_mode
selectedSerialPort = 1; selectedSerialPort = 1;
} }
TimeSent = millis(); TimeSent = millis();