From 70325a6a0ff32986c9a83bace849f597855af093 Mon Sep 17 00:00:00 2001 From: Jeff Eberl Date: Thu, 19 Dec 2019 20:03:42 -0700 Subject: [PATCH] Update test scripts to error on unknown (#16229) --- Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h | 4 ++++ buildroot/bin/opt_disable | 12 +++++++----- buildroot/bin/opt_enable | 12 +++++++----- buildroot/bin/opt_set | 9 +++++++-- buildroot/bin/pins_set | 3 ++- buildroot/share/tests/LPC1768-tests | 2 +- buildroot/share/tests/LPC1769-tests | 8 ++++---- buildroot/share/tests/esp32-tests | 4 ++-- buildroot/share/tests/megaatmega2560-tests | 8 +++++--- config/default/Configuration.h | 4 ++-- 10 files changed, 41 insertions(+), 25 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h index 17cbf20ef..b32b05eac 100644 --- a/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h @@ -68,3 +68,7 @@ #if IS_RE_ARM_BOARD && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI" #endif + +#if ENABLED(BAUD_RATE_GCODE) + #error "BAUD_RATE_GCODE is not yet supported on LPC176x." +#endif diff --git a/buildroot/bin/opt_disable b/buildroot/bin/opt_disable index 1d3615996..11526132e 100755 --- a/buildroot/bin/opt_disable +++ b/buildroot/bin/opt_disable @@ -1,11 +1,13 @@ #!/usr/bin/env bash +# exit on first failure +set -e + SED=$(which gsed || which sed) for opt in "$@" ; do - eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration.h" -done - -for opt in "$@" ; do - eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration_adv.h" + # Logic for returning nonzero based on answer here: https://stackoverflow.com/a/15966279/104648 + eval "${SED} -i '/\([[:blank:]]*\)\(\/\/\)*\([[:blank:]]*\)\(#define \b${opt}\b\)/{s//\1\3\/\/\4/;h};\${x;/./{x;q0};x;q9}' Marlin/Configuration.h" || + eval "${SED} -i '/\([[:blank:]]*\)\(\/\/\)*\([[:blank:]]*\)\(#define \b${opt}\b\)/{s//\1\3\/\/\4/;h};\${x;/./{x;q0};x;q9}' Marlin/Configuration_adv.h" || + (echo "ERROR: opt_disable Can't find ${opt}" >&2 && exit 9) done diff --git a/buildroot/bin/opt_enable b/buildroot/bin/opt_enable index f5540d2c6..96686d6c6 100755 --- a/buildroot/bin/opt_enable +++ b/buildroot/bin/opt_enable @@ -1,11 +1,13 @@ #!/usr/bin/env bash +# exit on first failure +set -e + SED=$(which gsed || which sed) for opt in "$@" ; do - eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration.h" -done - -for opt in "$@" ; do - eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration_adv.h" + # Logic for returning nonzero based on answer here: https://stackoverflow.com/a/15966279/104648 + eval "${SED} -i '/\(\/\/\)*[[:blank:]]*\(#define \b${opt}\b\)/{s//\2/;h};\${x;/./{x;q0};x;q9}' Marlin/Configuration.h" || + eval "${SED} -i '/\(\/\/\)*[[:blank:]]*\(#define \b${opt}\b\)/{s//\2/;h};\${x;/./{x;q0};x;q9}' Marlin/Configuration_adv.h" || + (echo "ERROR: opt_enable Can't find ${opt}" >&2 && exit 9) done diff --git a/buildroot/bin/opt_set b/buildroot/bin/opt_set index ef37a358e..2f6c253c9 100755 --- a/buildroot/bin/opt_set +++ b/buildroot/bin/opt_set @@ -1,6 +1,11 @@ #!/usr/bin/env bash +# exit on first failure +set -e + SED=$(which gsed || which sed) -eval "${SED} -E -i 's/(\/\/)?(#define \b${1}\b).*$/\2 ${2}/g' Marlin/Configuration.h" -eval "${SED} -E -i 's/(\/\/)?(#define \b${1}\b).*$/\2 ${2}/g' Marlin/Configuration_adv.h" +# Logic for returning nonzero based on answer here: https://stackoverflow.com/a/15966279/104648 +eval "${SED} -i '/\(\/\/\)*\([[:blank:]]*\)\(#define \b${1}\b\).*$/{s//\2\3 ${2}/;h};\${x;/./{x;q0};x;q9}' Marlin/Configuration.h" || +eval "${SED} -i '/\(\/\/\)*\([[:blank:]]*\)\(#define \b${1}\b\).*$/{s//\2\3 ${2}/;h};\${x;/./{x;q0};x;q9}' Marlin/Configuration_adv.h" || +(echo "ERROR: opt_set Can't find ${1}" >&2 && exit 9) diff --git a/buildroot/bin/pins_set b/buildroot/bin/pins_set index 2635ae628..87a8692aa 100755 --- a/buildroot/bin/pins_set +++ b/buildroot/bin/pins_set @@ -7,4 +7,5 @@ PIN=$2 VAL=$3 SED=$(which gsed || which sed) -eval "${SED} -E -i 's/(\/\/)?(#define +${PIN}\b).*$/\2 ${VAL}/g' Marlin/src/pins/$DIR/pins_${NAM}.h" +eval "${SED} -i '/\(\/\/\)*\(#define \+${PIN}\b\).*$/{s//\2 ${VAL}/;h};\${x;/./{x;q0};x;q9}' Marlin/src/pins/$DIR/pins_${NAM}.h" || +(echo "ERROR: pins_set Can't find ${PIN}" >&2 && exit 9) diff --git a/buildroot/share/tests/LPC1768-tests b/buildroot/share/tests/LPC1768-tests index e66087a00..327fa37e4 100755 --- a/buildroot/share/tests/LPC1768-tests +++ b/buildroot/share/tests/LPC1768-tests @@ -15,7 +15,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -opt_enable VIKI2 SDSUPPORT SERIAL_PORT2 NEOPIXEL_LED BAUD_RATE_GCODE +opt_enable VIKI2 SDSUPPORT SERIAL_PORT_2 NEOPIXEL_LED opt_set NEOPIXEL_PIN P1_16 exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), NeoPixel" diff --git a/buildroot/share/tests/LPC1769-tests b/buildroot/share/tests/LPC1769-tests index 641c50f3e..6b7ef9725 100755 --- a/buildroot/share/tests/LPC1769-tests +++ b/buildroot/share/tests/LPC1769-tests @@ -21,7 +21,7 @@ opt_enable VIKI2 SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ - Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE BAUD_RATE_GCODE \ + Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA opt_set GRID_MAX_POINTS_X 16 exec_test $1 $2 "Smoothieboard with many features" @@ -33,8 +33,8 @@ exec_test $1 $2 "Smoothieboard with many features" # AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ # FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ # SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ -# SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS BAUD_RATE_GCODE \ -# VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ +# SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS \ +# VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS \ # EXTRA_FAN_SPEED FWRETRACT MENU_ADDAUTOSTART SDCARD_SORT_ALPHA #opt_set FAN_MIN_PWM 50 #opt_set FAN_KICKSTART_TIME 100 @@ -47,7 +47,7 @@ opt_set MOTHERBOARD BOARD_COHESION3D_REMIX opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2130 opt_set Z_DRIVER_TYPE TMC2130 -opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT BAUD_RATE_GCODE \ +opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT \ TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z HYBRID_THRESHOLD \ SENSORLESS_PROBING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY TMC_DEBUG opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN PSU_CONTROL diff --git a/buildroot/share/tests/esp32-tests b/buildroot/share/tests/esp32-tests index 9d44b1434..123d5c320 100755 --- a/buildroot/share/tests/esp32-tests +++ b/buildroot/share/tests/esp32-tests @@ -12,8 +12,8 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_ESPRESSIF_ESP32 opt_enable WIFISUPPORT GCODE_MACROS BAUD_RATE_GCODE -opt_set "WIFI_SSID \"ssid\"" -opt_set "WIFI_PWD \"password\"" +opt_set WIFI_SSID "\"ssid\"" +opt_set WIFI_PWD "\"password\"" opt_set TX_BUFFER_SIZE 64 opt_add WEBSUPPORT exec_test $1 $2 "ESP32 with WIFISUPPORT and WEBSUPPORT" diff --git a/buildroot/share/tests/megaatmega2560-tests b/buildroot/share/tests/megaatmega2560-tests index 1e53b7e9e..7f1536930 100755 --- a/buildroot/share/tests/megaatmega2560-tests +++ b/buildroot/share/tests/megaatmega2560-tests @@ -117,11 +117,13 @@ opt_set LCD_LANGUAGE de opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT \ ULTIMAKERCONTROLLER SDSUPPORT PCA9632 LCD_INFO_MENU \ AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY LCD_BED_LEVELING G26_MESH_VALIDATION MESH_EDIT_MENU \ - M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR \ + M100_FREE_MEMORY_WATCHER \ INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT EXPERIMENTAL_I2CBUS \ NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE \ ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES \ PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 M114_DETAIL +opt_add M100_FREE_MEMORY_DUMPER +opt_add M100_FREE_MEMORY_CORRUPTOR opt_set PWM_MOTOR_CURRENT "{ 1300, 1300, 1250 }" opt_set I2C_SLAVE_ADDRESS 63 exec_test $1 $2 "MINIRAMBO | Ultimaker LCD | M100 | PWM_MOTOR_CURRENT | PRINTCOUNTER | Advanced Pause ..." @@ -179,7 +181,7 @@ opt_enable COREYX USE_XMAX_PLUG MIXING_EXTRUDER GRADIENT_MIX \ FIX_MOUNTED_PROBE AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE FILAMENT_WIDTH_SENSOR \ SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \ SD_ABORT_ON_ENDSTOP_HIT HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT ADVANCED_OK M114_DETAIL \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL EXTRA_FAN_SPEED FWRETRACT + VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS EXTRA_FAN_SPEED FWRETRACT opt_set FAN_MIN_PWM 50 opt_set FAN_KICKSTART_TIME 100 opt_set XY_FREQUENCY_LIMIT 15 @@ -295,7 +297,7 @@ exec_test $1 $2 "Full-featured CR-10S config" # Delta Config (generic) + ABL bilinear + BLTOUCH use_example_configs delta/generic opt_set LCD_LANGUAGE cz -opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR BLTOUCH BLTOUCH_FORCE_5V_MODE +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR BLTOUCH exec_test $1 $2 "RAMPS | DELTA | RRD LCD | ABL Bilinear | BLTOUCH" # diff --git a/config/default/Configuration.h b/config/default/Configuration.h index 225f8fe5f..90351c602 100644 --- a/config/default/Configuration.h +++ b/config/default/Configuration.h @@ -330,9 +330,9 @@ //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin + //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power + #define AUTO_POWER_FANS // Turn on PSU if fans need power #define AUTO_POWER_E_FANS #define AUTO_POWER_CONTROLLERFAN #define AUTO_POWER_CHAMBER_FAN