From a77e9f330d47f8ec852c96b642acd01f2ee31422 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jul 2020 23:44:45 -0500 Subject: [PATCH 1/6] Fix a compile warning --- Marlin/src/gcode/host/M360.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/src/gcode/host/M360.cpp b/Marlin/src/gcode/host/M360.cpp index 63a0b6dfc44f..146abe24d4a7 100644 --- a/Marlin/src/gcode/host/M360.cpp +++ b/Marlin/src/gcode/host/M360.cpp @@ -115,8 +115,7 @@ void GcodeSuite::M360() { xyz_pos_t cmin = dmin, cmax = dmax; apply_motion_limits(cmin); apply_motion_limits(cmax); - const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(), - wmin = cmin.asLogical(), wmax = cmax.asLogical(); + const xyz_pos_t wmin = cmin.asLogical(), wmax = cmax.asLogical(); PGMSTR(MIN_STR, "Min"); PGMSTR(MAX_STR, "Max"); From 71c0353cca73f5c691bf36c6f1954fd6e071e996 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jul 2020 23:41:19 -0500 Subject: [PATCH 2/6] Specific character LCD libraries --- Marlin/src/inc/Conditionals_LCD.h | 8 ++++++ Marlin/src/lcd/HD44780/ultralcd_HD44780.h | 31 +++++++++-------------- platformio.ini | 3 ++- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 10755c180ea0..972d1042ee42 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -399,6 +399,14 @@ #endif #endif +#if ENABLED(SR_LCD_3W_NL) + // Feature checks for SR_LCD_3W_NL +#elif EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) + #define USES_LIQUIDTWI2 +#elif ANY(HAS_CHARACTER_LCD, LCD_I2C_TYPE_PCF8575, LCD_I2C_TYPE_PCA8574, SR_LCD_2W_NL, LCM1602) + #define USES_LIQUIDCRYSTAL +#endif + #if ENABLED(ULTIPANEL) && DISABLED(NO_LCD_MENUS) #define HAS_LCD_MENU 1 #endif diff --git a/Marlin/src/lcd/HD44780/ultralcd_HD44780.h b/Marlin/src/lcd/HD44780/ultralcd_HD44780.h index 12bf86a1618c..4fce2daa07f6 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_HD44780.h +++ b/Marlin/src/lcd/HD44780/ultralcd_HD44780.h @@ -22,26 +22,13 @@ #pragma once /** - * Implementation of the LCD display routines for a Hitachi HD44780 display. - * These are the most common LCD character displays. + * Hitachi HD44780 display defines and headers */ #include "../../inc/MarlinConfig.h" -#if LCD_HEIGHT > 3 - #include "../../libs/duration_t.h" -#endif - -//////////////////////////////////// -// Setup button and encode mappings for each panel (into 'buttons' variable -// -// This is just to map common functions (across different panels) onto the same -// macro name. The mapping is independent of whether the button is directly connected or -// via a shift/i2c register. - -//////////////////////////////////// -// Create LCD class instance and chipset-specific information #if ENABLED(LCD_I2C_TYPE_PCF8575) + // NOTE: These are register-mapped pins on the PCF8575 controller, not Arduino pins. #define LCD_I2C_PIN_BL 3 #define LCD_I2C_PIN_EN 2 @@ -58,6 +45,7 @@ #define LCD_CLASS LiquidCrystal_I2C #elif ENABLED(LCD_I2C_TYPE_MCP23017) + // For the LED indicators (which may be mapped to different events in update_indicators()) #define LCD_HAS_STATUS_INDICATORS #define LED_A 0x04 //100 @@ -69,40 +57,45 @@ #define LCD_CLASS LiquidTWI2 #elif ENABLED(LCD_I2C_TYPE_MCP23008) + #include #include #define LCD_CLASS LiquidTWI2 #elif ENABLED(LCD_I2C_TYPE_PCA8574) + #include #define LCD_CLASS LiquidCrystal_I2C #elif ENABLED(SR_LCD_2W_NL) + // 2 wire Non-latching LCD SR from: // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection -// extern "C" void __cxa_pure_virtual() { while (1); } #include #include #define LCD_CLASS LiquidCrystal_SR + #elif ENABLED(SR_LCD_3W_NL) -//NewLiquidCrystal was not working for me, but this worked first try -//https://github.com/mikeshub/SailfishLCD -//uses the code directly from Sailfish + // NewLiquidCrystal didn't work, so this uses + // https://github.com/mikeshub/SailfishLCD #include #define LCD_CLASS LiquidCrystalSerial #elif ENABLED(LCM1602) + #include #include #include #define LCD_CLASS LiquidCrystal_I2C #else + // Standard directly connected LCD implementations #include #define LCD_CLASS LiquidCrystal + #endif #include "../fontutils.h" diff --git a/platformio.ini b/platformio.ini index 865755d73fe1..a883c78c19b9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -50,7 +50,8 @@ NEOPIXEL_LED = Adafruit NeoPixel@1.5.0 MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0 HAS_GRAPHICAL_LCD = U8glib-HAL@0.4.1 src_filter=+ -HAS_CHARACTER_LCD = LiquidCrystal@1.5.0, LiquidTWI2@1.2.7 +USES_LIQUIDCRYSTAL = LiquidCrystal@1.5.0 +USES_LIQUIDTWI2 = LiquidTWI2@1.2.7 TOUCH_UI_FTDI_EVE = src_filter=+ HAS_DGUS_LCD = src_filter=+ DWIN_CREALITY_LCD = src_filter=+ From 2e314955b0c0d72286bd17cab8d93be8ca2d4f98 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jul 2020 23:43:14 -0500 Subject: [PATCH 3/6] Remove extra lib deps and ignores --- platformio.ini | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/platformio.ini b/platformio.ini index a883c78c19b9..371ae70425f7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -40,7 +40,6 @@ lib_deps = TFT_LVGL_UI = MKS-LittlevGL=https://github.com/makerbase-mks/MKS-LittlevGL/archive/master.zip src_filter=+ HAS_TRINAMIC_CONFIG = TMCStepper@~0.7.1 -SR_LCD_2W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip DIGIPOT_MCP4018 = SlowSoftI2CMaster DIGIPOT_MCP4451 = SlowSoftI2CMaster @@ -307,14 +306,11 @@ lib_compat_mode = strict extra_scripts = ${common.extra_scripts} Marlin/src/HAL/LPC1768/upload_extra_script.py src_filter = ${common.default_src_filter} + -lib_deps = Servo +lib_deps = ${common.lib_deps} + Servo LiquidCrystal@1.0.0 - U8glib-HAL@0.4.1 - TMCStepper@~0.7.1 Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/1.5.0.zip - SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip build_flags = ${common.build_flags} -DU8G_HAL_LINKS -IMarlin/src/HAL/LPC1768/include -IMarlin/src/HAL/LPC1768/u8g -lib_ignore = LiquidTWI2 # debug options for backtrace #-funwind-tables #-mpoke-function-name @@ -362,8 +358,7 @@ build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + -lib_ignore = - SPI +lib_ignore = SPI lib_deps = ${common.lib_deps} SoftwareSerialM @@ -396,18 +391,10 @@ build_flags = ${common_stm32f1.build_flags} extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py -lib_deps = - TMCStepper@~0.7.1 - Adafruit MAX31865 library@~1.1.0 - U8glib-HAL@0.4.1 - Arduino-L6470@0.8.0 - SlowSoftI2CMaster - LiquidTWI2@1.2.7 +lib_deps = ${common.lib_deps} Adafruit NeoPixel=https://github.com/ccccmagicboy/Adafruit_NeoPixel#meeb_3dp_use - SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip SoftwareSerialM USBComposite for STM32F1@0.91 -lib_ignore = SPI debug_tool = stlink upload_protocol = dfu @@ -499,7 +486,6 @@ lib_deps = ${common_stm32f1.lib_deps} platform = ${common_stm32.platform} board = disco_f407vg build_flags = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F4 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -DHAL_IWDG_MODULE_ENABLED -lib_ignore = Adafruit NeoPixel, TMCStepper src_filter = ${common.default_src_filter} + - # @@ -509,7 +495,6 @@ src_filter = ${common.default_src_filter} + - - # @@ -551,7 +536,6 @@ build_flags = ${common_stm32f1.build_flags} build_unflags = ${common_stm32f1.build_unflags} -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 lib_ignore = ${common_stm32f1.lib_ignore} - LiquidTWI2 # # MKS Robin Mini (STM32F103VET6) @@ -930,8 +914,6 @@ upload_speed = 115200 [env:teensy31] platform = teensy board = teensy31 -lib_deps = ${common.lib_deps} - TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter = ${common.default_src_filter} + # @@ -940,8 +922,6 @@ src_filter = ${common.default_src_filter} + [env:teensy35] platform = teensy board = teensy35 -lib_deps = ${common.lib_deps} - TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter = ${common.default_src_filter} + # @@ -965,6 +945,4 @@ src_filter = ${common.default_src_filter} + platform = atmelavr board = megaatmega2560 build_flags = -c -H -std=gnu++11 -Wall -Os -D__MARLIN_FIRMWARE__ -lib_deps = ${common.lib_deps} - TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter = + From c58aa3df8d6cb75bb6fbec96aba53e45e253a81f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jul 2020 23:43:52 -0500 Subject: [PATCH 4/6] Features are regex --- .../PlatformIO/scripts/common-features-dependencies.py | 6 ++++-- platformio.ini | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py index 72abfdd67b56..1fdc355a4d81 100644 --- a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py @@ -126,7 +126,7 @@ def search_compiler(): # the first path have the compiler for path in env['ENV']['PATH'].split(';'): if not re.search(r'platformio\\packages.*\\bin', path): - continue + continue #print(path) for file in os.listdir(path): if file.endswith("g++.exe"): @@ -172,7 +172,9 @@ def load_marlin_features(): def MarlinFeatureIsEnabled(env, feature): load_marlin_features() - return feature in env["MARLIN_FEATURES"] + r = re.compile(feature) + matches = list(filter(r.match, env["MARLIN_FEATURES"])) + return len(matches) > 0 # add a method for others scripts to check if a feature is enabled env.AddMethod(MarlinFeatureIsEnabled) diff --git a/platformio.ini b/platformio.ini index 371ae70425f7..5033433a2bbb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -41,8 +41,7 @@ TFT_LVGL_UI = MKS-LittlevGL=https://github.com/makerbase-mks/MKS-Littlev src_filter=+ HAS_TRINAMIC_CONFIG = TMCStepper@~0.7.1 SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip -DIGIPOT_MCP4018 = SlowSoftI2CMaster -DIGIPOT_MCP4451 = SlowSoftI2CMaster +DIGIPOT_MCP4... = SlowSoftI2CMaster HAS_TMC26X = TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip HAS_L64XX = Arduino-L6470@0.8.0 NEOPIXEL_LED = Adafruit NeoPixel@1.5.0 From 634fcccb19dfdae097c5e064dea7c5b1dd43e908 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jul 2020 23:44:23 -0500 Subject: [PATCH 5/6] WiFi dependencies --- Marlin/src/pins/pins.h | 1 - .../scripts/common-features-dependencies.py | 2 ++ buildroot/tests/esp32-tests | 3 +-- platformio.ini | 12 +++++------- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 61db5a77f527..e92001a25c9e 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -615,7 +615,6 @@ // #elif MB(ESPRESSIF_ESP32) - #include "esp32/pins_ESP32.h" // ESP32 env:esp32 #elif MB(MRR_ESPA) #include "esp32/pins_MRR_ESPA.h" // ESP32 env:esp32 diff --git a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py index 1fdc355a4d81..9425c56887c0 100644 --- a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py @@ -33,6 +33,8 @@ def load_config(): FEATURE_DEPENDENCIES[key[0].upper()]['extra_scripts'] = rest elif name == 'src_filter': FEATURE_DEPENDENCIES[key[0].upper()]['src_filter'] = rest + elif name == 'lib_ignore': + FEATURE_DEPENDENCIES[key[0].upper()]['lib_ignore'] = rest else: FEATURE_DEPENDENCIES[key[0].upper()]['lib_deps'] += [dep] diff --git a/buildroot/tests/esp32-tests b/buildroot/tests/esp32-tests index ccc01a1c1c8a..992b3ec5ff44 100755 --- a/buildroot/tests/esp32-tests +++ b/buildroot/tests/esp32-tests @@ -11,11 +11,10 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_ESPRESSIF_ESP32 -opt_enable WIFISUPPORT GCODE_MACROS BAUD_RATE_GCODE M115_GEOMETRY_REPORT REPETIER_GCODE_M360 +opt_enable WIFISUPPORT WEBSUPPORT GCODE_MACROS BAUD_RATE_GCODE M115_GEOMETRY_REPORT REPETIER_GCODE_M360 opt_add WIFI_SSID "\"ssid\"" opt_add WIFI_PWD "\"password\"" opt_set TX_BUFFER_SIZE 64 -opt_add WEBSUPPORT exec_test $1 $2 "ESP32 with WIFISUPPORT and WEBSUPPORT" # diff --git a/platformio.ini b/platformio.ini index 5033433a2bbb..c59f2790733a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -54,6 +54,11 @@ TOUCH_UI_FTDI_EVE = src_filter=+ HAS_DGUS_LCD = src_filter=+ DWIN_CREALITY_LCD = src_filter=+ HAS_LCD_MENU = src_filter=+ +(ESP32_)?WIFISUPPORT = AsyncTCP, ESP Async WebServer + ESP3DLib=https://github.com/luc-github/ESP3DLib.git + arduinoWebSockets=https://github.com/Links2004/arduinoWebSockets.git + ESP32SSDP=https://github.com/luc-github/ESP32SSDP.git + lib_ignore=ESPAsyncTCP # # Default values apply to all 'env:' prefixed environments @@ -895,13 +900,6 @@ monitor_speed = 500000 platform = espressif32@1.11.2 board = esp32dev build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0 -lib_deps = ${common.lib_deps} - AsyncTCP=https://github.com/me-no-dev/AsyncTCP/archive/master.zip - ESPAsyncWebServer=https://github.com/me-no-dev/ESPAsyncWebServer/archive/master.zip - ESP3DLib=https://github.com/luc-github/ESP3DLib.git - arduinoWebSockets=https://github.com/Links2004/arduinoWebSockets.git - ESP32SSDP=https://github.com/luc-github/ESP32SSDP.git -lib_ignore = LiquidCrystal, LiquidTWI2, SailfishLCD, ESPAsyncTCP src_filter = ${common.default_src_filter} + upload_speed = 115200 #upload_port = marlinesp.local From 6b2ef1331c87f96b6c7f7351bd18fde3b87feb3e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jul 2020 03:03:15 -0500 Subject: [PATCH 6/6] Minor script tweak --- .../scripts/common-features-dependencies.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py index 9425c56887c0..179af2229421 100644 --- a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py @@ -20,23 +20,24 @@ def load_config(): config.read("platformio.ini") items = config.items('features') for key in items: - deps = re.sub(',\\s*', '\n', key[1]).strip().split('\n') - if not key[0].upper() in FEATURE_DEPENDENCIES: - FEATURE_DEPENDENCIES[key[0].upper()] = { + ukey = key[0].upper() + if not ukey in FEATURE_DEPENDENCIES: + FEATURE_DEPENDENCIES[ukey] = { 'lib_deps': [] } + deps = re.sub(',\\s*', '\n', key[1]).strip().split('\n') for dep in deps: parts = dep.split('=') name = parts.pop(0) rest = '='.join(parts) if name == 'extra_scripts': - FEATURE_DEPENDENCIES[key[0].upper()]['extra_scripts'] = rest + FEATURE_DEPENDENCIES[ukey]['extra_scripts'] = rest elif name == 'src_filter': - FEATURE_DEPENDENCIES[key[0].upper()]['src_filter'] = rest + FEATURE_DEPENDENCIES[ukey]['src_filter'] = rest elif name == 'lib_ignore': - FEATURE_DEPENDENCIES[key[0].upper()]['lib_ignore'] = rest + FEATURE_DEPENDENCIES[ukey]['lib_ignore'] = rest else: - FEATURE_DEPENDENCIES[key[0].upper()]['lib_deps'] += [dep] + FEATURE_DEPENDENCIES[ukey]['lib_deps'] += [dep] def get_all_known_libs(): known_libs = []