From fc9ee1a4dedbffc1fd4d5e0934be204280f51f76 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Dec 2017 19:11:07 -0600 Subject: [PATCH] Fix up serial sanity check --- Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h | 18 +++++++----------- Marlin/src/inc/SanityCheck.h | 8 ++------ Marlin/src/module/configuration_store.cpp | 2 +- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h b/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h index 5e7244b2d..a2284e366 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h @@ -55,17 +55,13 @@ #define TX_BUFFER_SIZE 32 #endif -#if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 - #error "XON/XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." -#endif - -#if !IS_POWER_OF_2(RX_BUFFER_SIZE) || RX_BUFFER_SIZE < 2 - #error "RX_BUFFER_SIZE must be a power of 2 greater than 1." -#endif - -#if TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) - #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256." -#endif +//#if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 +// #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." +//#elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) +// #error "RX_BUFFER_SIZE must be a power of 2 greater than 1." +//#elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) +// #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256." +//#endif #if RX_BUFFER_SIZE > 256 typedef uint16_t ring_buffer_pos_t; diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 8c3e18b7c..0f215f1a0 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -260,13 +260,9 @@ #ifndef USBCON #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." - #endif - - #if !IS_POWER_OF_2(RX_BUFFER_SIZE) || RX_BUFFER_SIZE < 2 + #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) #error "RX_BUFFER_SIZE must be a power of 2 greater than 1." - #endif - - #if TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) + #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256." #endif #elif ENABLED(SERIAL_XON_XOFF) diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 402e679fb..38c56602d 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -262,7 +262,7 @@ void MarlinSettings::postprocess() { #if ENABLED(FWRETRACT) fwretract.refresh_autoretract(); #endif - + // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm // and init stepper.count[], planner.position[] with current_position planner.refresh_positioning();