Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:

- name: Install PlatformIO
run: |
pip install -U https://github.com/platformio/platformio-core/archive/master.zip
pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
platformio update

- name: Check out the PR
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/gcode/host/M360.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/lcd/M145.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void GcodeSuite::M145() {
if (parser.seenval('H'))
mat.hotend_temp = constrain(parser.value_int(), EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP) - (HOTEND_OVERSHOOT));
#endif
#if TEMP_SENSOR_BED != 0
#if HAS_HEATED_BED
if (parser.seenval('B'))
mat.bed_temp = constrain(parser.value_int(), BED_MINTEMP, BED_MAX_TARGET);
#endif
Expand Down
8 changes: 8 additions & 0 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2020-07-20"
#define STRING_DISTRIBUTION_DATE "2020-07-21"
#endif

/**
Expand Down
31 changes: 12 additions & 19 deletions Marlin/src/lcd/HD44780/ultralcd_HD44780.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -69,40 +57,45 @@
#define LCD_CLASS LiquidTWI2

#elif ENABLED(LCD_I2C_TYPE_MCP23008)

#include <Wire.h>
#include <LiquidTWI2.h>
#define LCD_CLASS LiquidTWI2

#elif ENABLED(LCD_I2C_TYPE_PCA8574)

#include <LiquidCrystal_I2C.h>
#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 <LCD.h>
#include <LiquidCrystal_SR.h>
#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 <SailfishLCD.h>
#define LCD_CLASS LiquidCrystalSerial

#elif ENABLED(LCM1602)

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define LCD_CLASS LiquidCrystal_I2C

#else

// Standard directly connected LCD implementations
#include <LiquidCrystal.h>
#define LCD_CLASS LiquidCrystal

#endif

#include "../fontutils.h"
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/lib/anycubic/anycubic_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ const char newSucc[] PROGMEM = "OK";
#define ANYCUBIC_SERIAL_ECHO(x) ANYCUBIC_SERIAL_PROTOCOL(x)

FORCE_INLINE void AnycubicSerialprintPGM(const char *str) {
char ch=pgm_read_byte(str);
char ch = pgm_read_byte(str);
while (ch) {
AnycubicSerial.write(ch);
ch=pgm_read_byte(++str);
AnycubicSerialClass::write(ch);
ch = pgm_read_byte(++str);
}
}

Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ void DGUSDisplay::WriteVariable(uint16_t adr, uint8_t value) {
WriteVariable(adr, static_cast<const void*>(&value), sizeof(uint8_t));
}

void DGUSDisplay::WriteVariable(uint16_t adr, int8_t value) {
WriteVariable(adr, static_cast<const void*>(&value), sizeof(int8_t));
}

void DGUSDisplay::WriteVariable(uint16_t adr, long value) {
union { long l; char lb[4]; } endian;
char tmp[4];
Expand Down
17 changes: 17 additions & 0 deletions Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,21 @@ class DGUSDisplay {
static void WriteVariable(uint16_t adr, int16_t value);
static void WriteVariable(uint16_t adr, uint16_t value);
static void WriteVariable(uint16_t adr, uint8_t value);
static void WriteVariable(uint16_t adr, int8_t value);
static void WriteVariable(uint16_t adr, long value);

// Utility functions for bridging ui_api and dbus
template<typename T, float(*Getter)(const T), T selector, typename WireType=uint16_t>
static void SetVariable(DGUS_VP_Variable &var) {
WriteVariable(var.VP, (WireType)Getter(selector));
}

template<typename T, void(*Setter)(const float V, const T), T selector>
static void GetVariable(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t newvalue = swap16(*(uint16_t*)val_ptr);
Setter(newvalue, selector);
}

// Until now I did not need to actively read from the display. That's why there is no ReadVariable
// (I extensively use the auto upload of the display)

Expand All @@ -83,11 +96,15 @@ class DGUSDisplay {
static void WritePGM(const char str[], uint8_t len);
static void ProcessRx();

static inline uint16_t swap16(const uint16_t value) { return (value & 0xffU) << 8U | (value >> 8U); }
static rx_datagram_state_t rx_datagram_state;
static uint8_t rx_datagram_len;
static bool Initialized, no_reentrance;
};

#define GET_VARIABLE(f, t, V...) (&DGUSDisplay::GetVariable<decltype(t), f, t, ##V>)
#define SET_VARIABLE(f, t, V...) (&DGUSDisplay::SetVariable<decltype(t), f, t, ##V>)

extern DGUSDisplay dgusdisplay;

// compile-time x^y
Expand Down
7 changes: 5 additions & 2 deletions Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
#include "../../../../../module/planner.h"

#include "../../../../ultralcd.h"
#include "../../../ui_api.h"

#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
uint16_t distanceToMove = 10;
#endif
using namespace ExtUI;

const uint16_t VPList_Boot[] PROGMEM = {
VP_MARLIN_VERSION,
Expand Down Expand Up @@ -190,8 +192,9 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {

// Temperature Data
#if HOTENDS >= 1
VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>),
VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_T_E0_Is, nullptr, nullptr, SET_VARIABLE(getActualTemp_celsius, E0, long)),
VPHELPER(VP_T_E0_Set, nullptr, GET_VARIABLE(setTargetTemp_celsius, E0),
SET_VARIABLE(getTargetTemp_celsius, E0)),
VPHELPER(VP_Flowrate_E0, nullptr, ScreenHandler.HandleFlowRateChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_EPos, &destination.e, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>),
VPHELPER(VP_MOVE_E0, nullptr, &ScreenHandler.HandleManualExtrude, nullptr),
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
89 changes: 58 additions & 31 deletions buildroot/share/PlatformIO/scripts/common-features-dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,54 @@ 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[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 = []
for feature in FEATURE_DEPENDENCIES:
if not 'lib_deps' in FEATURE_DEPENDENCIES[feature]:
continue
for dep in FEATURE_DEPENDENCIES[feature]['lib_deps']:
name, _, _ = PackageManager.parse_pkg_uri(dep)
known_libs.append(name)
return known_libs

def get_all_env_libs():
env_libs = []
lib_deps = env.GetProjectOption("lib_deps")
for dep in lib_deps:
name, _, _ = PackageManager.parse_pkg_uri(dep)
env_libs.append(name)
return env_libs

# We need to ignore all non-used libs,
# so if a lib folder lay forgotten in .pio/lib_deps, it
# will not break compiling
def force_ignore_unused_libs():
env_libs = get_all_env_libs()
known_libs = get_all_known_libs()
diff = (list(set(known_libs) - set(env_libs)))
lib_ignore = env.GetProjectOption("lib_ignore") + diff
print("Ignoring libs: ", lib_ignore)
proj = env.GetProjectConfig()
proj.set("env:" + env["PIOENV"], "lib_ignore", lib_ignore)

def install_features_dependencies():
load_config()
Expand Down Expand Up @@ -66,12 +99,10 @@ def install_features_dependencies():
del deps_to_add[name]

# any left?
if len(deps_to_add) <= 0:
continue

# add only the missing deps
proj = env.GetProjectConfig()
proj.set("env:" + env["PIOENV"], "lib_deps", deps + list(deps_to_add.values()))
if len(deps_to_add) > 0:
# add only the missing deps
proj = env.GetProjectConfig()
proj.set("env:" + env["PIOENV"], "lib_deps", deps + list(deps_to_add.values()))

if 'extra_scripts' in FEATURE_DEPENDENCIES[feature]:
print("Executing extra_scripts for %s... " % feature)
Expand All @@ -80,36 +111,29 @@ def install_features_dependencies():
if 'src_filter' in FEATURE_DEPENDENCIES[feature]:
print("Adding src_filter for %s... " % feature)
proj = env.GetProjectConfig()
src_filter = env.GetProjectOption("src_filter")

src_filter = ' '.join(env.GetProjectOption("src_filter"))
# first we need to remove the references to the same folder
my_srcs = re.findall( r'[+-](<.*?>)', FEATURE_DEPENDENCIES[feature]['src_filter'])
cur_srcs = re.findall( r'[+-](<.*?>)', src_filter[0])
cur_srcs = re.findall( r'[+-](<.*?>)', src_filter)
for d in my_srcs:
if d in cur_srcs:
src_filter[0] = re.sub(r'[+-]' + d, '', src_filter[0])
src_filter = re.sub(r'[+-]' + d, '', src_filter)

src_filter[0] = FEATURE_DEPENDENCIES[feature]['src_filter'] + ' ' + src_filter[0]
proj.set("env:" + env["PIOENV"], "src_filter", src_filter)
src_filter = FEATURE_DEPENDENCIES[feature]['src_filter'] + ' ' + src_filter
proj.set("env:" + env["PIOENV"], "src_filter", [src_filter])
env.Replace(SRC_FILTER=src_filter)

# search the current compiler, considering the OS
def search_compiler():
if env['PLATFORM'] == 'win32':
# the first path have the compiler
compiler_path = None
for path in env['ENV']['PATH'].split(';'):
if re.search(r'platformio\\packages.*\\bin', path):
compiler_path = path
break
if compiler_path == None:
print("Could not find the g++ path")
return None

print(compiler_path)
for file in os.listdir(compiler_path):
if file.endswith("g++.exe"):
return file
if not re.search(r'platformio\\packages.*\\bin', path):
continue
#print(path)
for file in os.listdir(path):
if file.endswith("g++.exe"):
return file
print("Could not find the g++")
return None
else:
Expand Down Expand Up @@ -151,10 +175,13 @@ 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)

# install all dependencies for features enabled in Configuration.h
install_features_dependencies()
force_ignore_unused_libs()
3 changes: 1 addition & 2 deletions buildroot/tests/esp32-tests
Original file line number Diff line number Diff line change
Expand Up @@ -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"

#
Expand Down
Loading