Fix up serial sanity check

This commit is contained in:
Scott Lahteine 2017-12-19 19:11:07 -06:00
parent de5ca96654
commit fc9ee1a4de
3 changed files with 10 additions and 18 deletions

View File

@ -55,17 +55,13 @@
#define TX_BUFFER_SIZE 32 #define TX_BUFFER_SIZE 32
#endif #endif
#if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 //#if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
#error "XON/XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." // #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
#endif //#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."
#if !IS_POWER_OF_2(RX_BUFFER_SIZE) || RX_BUFFER_SIZE < 2 //#elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
#error "RX_BUFFER_SIZE must be a power of 2 greater than 1." // #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256."
#endif //#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 RX_BUFFER_SIZE > 256 #if RX_BUFFER_SIZE > 256
typedef uint16_t ring_buffer_pos_t; typedef uint16_t ring_buffer_pos_t;

View File

@ -260,13 +260,9 @@
#ifndef USBCON #ifndef USBCON
#if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
#error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
#endif #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
#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." #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
#endif #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
#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." #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256."
#endif #endif
#elif ENABLED(SERIAL_XON_XOFF) #elif ENABLED(SERIAL_XON_XOFF)

View File

@ -262,7 +262,7 @@ void MarlinSettings::postprocess() {
#if ENABLED(FWRETRACT) #if ENABLED(FWRETRACT)
fwretract.refresh_autoretract(); fwretract.refresh_autoretract();
#endif #endif
// Refresh steps_to_mm with the reciprocal of axis_steps_per_mm // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm
// and init stepper.count[], planner.position[] with current_position // and init stepper.count[], planner.position[] with current_position
planner.refresh_positioning(); planner.refresh_positioning();