diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index a0ef55910..61f0c1326 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1016,9 +1016,10 @@ void setup() #ifdef W25X20CL bool w25x20cl_success = w25x20cl_init(); + uint8_t optiboot_status = 1; if (w25x20cl_success) { - optiboot_w25x20cl_enter(); + optiboot_status = optiboot_w25x20cl_enter(); #if (LANG_MODE != 0) //secondary language support update_sec_lang_from_external_flash(); #endif //(LANG_MODE != 0) @@ -1064,9 +1065,12 @@ void setup() } MYSERIAL.begin(BAUDRATE); fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream -#ifndef W25X20CL +#if !((LANG_MODE == 1) && defined(W25X20CL)) || (LANG_MODE == 0) SERIAL_PROTOCOLLNPGM("start"); -#endif //W25X20CL +#else + if (optiboot_status == 1) + SERIAL_PROTOCOLLNPGM("start"); +#endif stdout = uartout; SERIAL_ECHO_START; printf_P(PSTR(" " FW_VERSION_FULL "\n")); diff --git a/Firmware/optiboot_w25x20cl.cpp b/Firmware/optiboot_w25x20cl.cpp index 584c32fed..7cc44801f 100644 --- a/Firmware/optiboot_w25x20cl.cpp +++ b/Firmware/optiboot_w25x20cl.cpp @@ -99,9 +99,9 @@ struct block_t; extern struct block_t *block_buffer; //! @brief Enter an STK500 compatible Optiboot boot loader waiting for flashing the languages to an external flash memory. -void optiboot_w25x20cl_enter() +uint8_t optiboot_w25x20cl_enter() { - if (boot_app_flags & BOOT_APP_FLG_USER0) return; + if (boot_app_flags & BOOT_APP_FLG_USER0) return 1; uint8_t ch; uint8_t rampz = 0; register uint16_t address = 0; @@ -144,12 +144,12 @@ void optiboot_w25x20cl_enter() delayMicroseconds(1); if (++ boot_timer > boot_timeout) // Timeout expired, continue with the application. - return; + return 0; } ch = UDR0; if (pgm_read_byte(ptr ++) != ch) // Magic was not received correctly, continue with the application - return; + return 0; watchdogReset(); } // Send the cfm magic string. diff --git a/Firmware/optiboot_w25x20cl.h b/Firmware/optiboot_w25x20cl.h index dc7d4395c..95c6465f3 100644 --- a/Firmware/optiboot_w25x20cl.h +++ b/Firmware/optiboot_w25x20cl.h @@ -1,6 +1,6 @@ #ifndef OPTIBOOT_W25X20CL_H #define OPTIBOOT_W25X20CL_H -extern void optiboot_w25x20cl_enter(); +extern uint8_t optiboot_w25x20cl_enter(); #endif /* OPTIBOOT_W25X20CL_H */