From 5ab57ab2ad6fc340038dc0f0c1f1d0b82dbe0d89 Mon Sep 17 00:00:00 2001 From: Andre Sklenar Date: Tue, 4 Jul 2017 16:25:30 +0200 Subject: [PATCH] Init LCD ASAP for a nice UX --- Firmware/Marlin_main.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index e0b989ac..7bfe171a 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1003,6 +1003,9 @@ void factory_reset(char level, bool quiet) // are initialized by the main() routine provided by the Arduino framework. void setup() { + lcd_init(); + lcd_print_at_PGM(0, 1, PSTR(" Original Prusa ")); + lcd_print_at_PGM(0, 2, PSTR(" 3D Printers ")); setup_killpin(); setup_powerhold(); MYSERIAL.begin(BAUDRATE); @@ -1052,7 +1055,7 @@ void setup() SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(MSG_PLANNER_BUFFER_BYTES); SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); - lcd_update_enable(false); + //lcd_update_enable(false); // why do we need this?? - andre // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) Config_RetrieveSettings(); SdFatUtil::set_stack_guard(); //writes magic number at the end of static variables to protect against overwriting static memory by stack @@ -1065,14 +1068,17 @@ void setup() tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; #endif //HAVE_TMC2130_DRIVERS + st_init(); // Initialize stepper, this enables interrupts! + setup_photpin(); + lcd_print_at_PGM(0, 1, PSTR(" Original Prusa ")); // we need to do this again for some reason, no time to research + lcd_print_at_PGM(0, 2, PSTR(" 3D Printers ")); servo_init(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); - - lcd_init(); + if (!READ(BTN_ENC)) { _delay_ms(1000); @@ -1138,8 +1144,9 @@ void setup() } else { - _delay_ms(1000); // wait 1sec to display the splash screen + //_delay_ms(1000); // wait 1sec to display the splash screen // what's this and why do we need it?? - andre } + @@ -6770,4 +6777,4 @@ void serialecho_temperatures() { SERIAL_PROTOCOLPGM(" B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(""); -} \ No newline at end of file +}