Merge pull request #368 from XPila/MK3
Missing serial characters debuging
This commit is contained in:
commit
00698b00b6
@ -11,7 +11,7 @@
|
||||
#define FW_version "3.1.1-RC4"
|
||||
#define FW_build 143
|
||||
//#define FW_build --BUILD-NUMBER--
|
||||
#define FW_version_build FW_version " b" STR(FW_build) "a"
|
||||
#define FW_version_build FW_version " b" STR(FW_build) "b"
|
||||
|
||||
|
||||
#define FW_PRUSA3D_MAGIC "PRUSA3DFW"
|
||||
|
@ -129,10 +129,13 @@ void Config_StoreSettings(uint16_t offset, uint8_t level)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LIN_ADVANCE
|
||||
if (level >= 10) {
|
||||
EEPROM_WRITE_VAR(i, extruder_advance_k);
|
||||
EEPROM_WRITE_VAR(i, advance_ed_ratio);
|
||||
}
|
||||
#endif //LIN_ADVANCE
|
||||
|
||||
/*MYSERIAL.print("Top address used:\n");
|
||||
MYSERIAL.print(i);
|
||||
MYSERIAL.print("\n");
|
||||
@ -365,11 +368,14 @@ void Config_RetrieveSettings(uint16_t offset, uint8_t level)
|
||||
EEPROM_READ_VAR(i, filament_size[2]);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef LIN_ADVANCE
|
||||
if (level >= 10) {
|
||||
EEPROM_READ_VAR(i, extruder_advance_k);
|
||||
EEPROM_READ_VAR(i, advance_ed_ratio);
|
||||
}
|
||||
calculate_volumetric_multipliers();
|
||||
#endif //LIN_ADVANCE
|
||||
|
||||
// Call updatePID (similar to when we have processed M301)
|
||||
updatePID();
|
||||
SERIAL_ECHO_START;
|
||||
|
@ -318,7 +318,7 @@
|
||||
* K=0 means advance disabled.
|
||||
* See Marlin documentation for calibration instructions.
|
||||
*/
|
||||
#define LIN_ADVANCE
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#ifdef LIN_ADVANCE
|
||||
#define LIN_ADVANCE_K 0 //Try around 45 for PLA, around 25 for ABS.
|
||||
|
@ -124,6 +124,9 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
|
||||
//#define DEBUG_XSTEP_DUP_PIN 21 //duplicate x-step output to pin 21 (SCL on P3)
|
||||
//#define DEBUG_YSTEP_DUP_PIN 21 //duplicate y-step output to pin 21 (SCL on P3)
|
||||
//#define DEBUG_BLINK_ACTIVE
|
||||
#define DEBUG_DISABLE_FANCHECK //disable fan check (no ISR INT7, check disabled)
|
||||
#define DEBUG_DISABLE_FSENSORCHECK //disable fsensor check (no ISR INT7, check disabled)
|
||||
#define DEBUG_DUMP_TO_2ND_SERIAL //dump received characters to 2nd serial line
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -68,6 +68,9 @@ SIGNAL(M_USARTx_RX_vect)
|
||||
unsigned char c = M_UDRx;
|
||||
if (selectedSerialPort == 0)
|
||||
store_char(c);
|
||||
#ifdef DEBUG_DUMP_TO_2ND_SERIAL
|
||||
UDR1 = c;
|
||||
#endif //DEBUG_DUMP_TO_2ND_SERIAL
|
||||
}
|
||||
}
|
||||
#ifndef SNMM
|
||||
@ -86,6 +89,9 @@ SIGNAL(USART1_RX_vect)
|
||||
unsigned char c = UDR1;
|
||||
if (selectedSerialPort == 1)
|
||||
store_char(c);
|
||||
#ifdef DEBUG_DUMP_TO_2ND_SERIAL
|
||||
M_UDRx = c;
|
||||
#endif //DEBUG_DUMP_TO_2ND_SERIAL
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -111,16 +111,16 @@ class MarlinSerial //: public Stream
|
||||
}
|
||||
*/
|
||||
void write(uint8_t c)
|
||||
{
|
||||
if (selectedSerialPort == 0)
|
||||
{
|
||||
if (selectedSerialPort == 0) {
|
||||
while (!((M_UCSRxA) & (1 << M_UDREx)))
|
||||
;
|
||||
M_UDRx = c;
|
||||
while (!((M_UCSRxA) & (1 << M_UDREx)));
|
||||
M_UDRx = c;
|
||||
}
|
||||
else if (selectedSerialPort == 1) {
|
||||
while (!((UCSR1A) & (1 << UDRE1)))
|
||||
;
|
||||
UDR1 = c;
|
||||
else if (selectedSerialPort == 1)
|
||||
{
|
||||
while (!((UCSR1A) & (1 << UDRE1)));
|
||||
UDR1 = c;
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,7 +144,10 @@ class MarlinSerial //: public Stream
|
||||
rx_buffer.buffer[rx_buffer.head] = c;
|
||||
rx_buffer.head = i;
|
||||
}
|
||||
selectedSerialPort = 0;
|
||||
//selectedSerialPort = 0;
|
||||
#ifdef DEBUG_DUMP_TO_2ND_SERIAL
|
||||
UDR1 = c;
|
||||
#endif //DEBUG_DUMP_TO_2ND_SERIAL
|
||||
}
|
||||
}
|
||||
} else if(selectedSerialPort == 1) {
|
||||
@ -165,7 +168,10 @@ class MarlinSerial //: public Stream
|
||||
rx_buffer.buffer[rx_buffer.head] = c;
|
||||
rx_buffer.head = i;
|
||||
}
|
||||
selectedSerialPort = 1;
|
||||
//selectedSerialPort = 1;
|
||||
#ifdef DEBUG_DUMP_TO_2ND_SERIAL
|
||||
M_UDRx = c;
|
||||
#endif //DEBUG_DUMP_TO_2ND_SERIAL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1112,8 +1112,12 @@ void setup()
|
||||
|
||||
check_babystep(); //checking if Z babystep is in allowed range
|
||||
setup_uvlo_interrupt();
|
||||
#ifndef DEBUG_DISABLE_FANCHECK
|
||||
setup_fan_interrupt();
|
||||
#endif //DEBUG_DISABLE_FANCHECK
|
||||
#ifndef DEBUG_DISABLE_FSENSORCHECK
|
||||
fsensor_setup_interrupt();
|
||||
#endif //DEBUG_DISABLE_FSENSORCHECK
|
||||
for (int i = 0; i<4; i++) EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]);
|
||||
|
||||
#ifndef DEBUG_DISABLE_STARTMSGS
|
||||
@ -1219,6 +1223,10 @@ void fsensor_init() {
|
||||
puts_P(PSTR("DISABLED\n"));
|
||||
fsensor_disable();
|
||||
}
|
||||
#ifdef DEBUG_DISABLE_FSENSORCHECK
|
||||
filament_autoload_enabled = false;
|
||||
fsensor_disable();
|
||||
#endif //DEBUG_DISABLE_FSENSORCHECK
|
||||
}
|
||||
|
||||
#endif //PAT9125
|
||||
|
@ -697,6 +697,7 @@ void manage_heater()
|
||||
#endif
|
||||
} // End extruder for loop
|
||||
|
||||
#ifndef DEBUG_DISABLE_FANCHECK
|
||||
#if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) || \
|
||||
(defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN > -1) || \
|
||||
(defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1)
|
||||
@ -708,6 +709,7 @@ void manage_heater()
|
||||
extruder_autofan_last_check = millis();
|
||||
}
|
||||
#endif
|
||||
#endif //DEBUG_DISABLE_FANCHECK
|
||||
|
||||
#ifndef PIDTEMPBED
|
||||
if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
|
||||
|
@ -3783,7 +3783,7 @@ static void lcd_settings_menu()
|
||||
{
|
||||
MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
|
||||
}
|
||||
|
||||
#ifndef DEBUG_DISABLE_FSENSORCHECK
|
||||
if (FSensorStateMenu == 0) {
|
||||
if (fsensor_not_responding){
|
||||
// Filament sensor not working
|
||||
@ -3807,6 +3807,7 @@ static void lcd_settings_menu()
|
||||
}
|
||||
|
||||
}
|
||||
#endif //DEBUG_DISABLE_FSENSORCHECK
|
||||
|
||||
if (fans_check_enabled == true) {
|
||||
MENU_ITEM(function, MSG_FANS_CHECK_ON, lcd_set_fan_check);
|
||||
@ -5150,11 +5151,13 @@ static void lcd_tune_menu()
|
||||
MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_colorprint_change);//7
|
||||
#endif
|
||||
|
||||
#ifndef DEBUG_DISABLE_FSENSORCHECK
|
||||
if (FSensorStateMenu == 0) {
|
||||
MENU_ITEM(function, MSG_FSENSOR_OFF, lcd_fsensor_state_set);
|
||||
} else {
|
||||
MENU_ITEM(function, MSG_FSENSOR_ON, lcd_fsensor_state_set);
|
||||
}
|
||||
#endif //DEBUG_DISABLE_FSENSORCHECK
|
||||
|
||||
if (SilentModeMenu == 0) MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set);
|
||||
else MENU_ITEM(function, MSG_SILENT_MODE_ON, lcd_silent_mode_set);
|
||||
|
Loading…
Reference in New Issue
Block a user