Optimize G-code / feature dependencies (#18919)

This commit is contained in:
Scott Lahteine 2020-08-06 08:14:00 -05:00 committed by GitHub
parent 6bcfb58cd4
commit 99ba866d8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 632 additions and 189 deletions

View File

@ -189,7 +189,7 @@
#include "feature/leds/tempstat.h"
#endif
#if HAS_CASE_LIGHT
#if ENABLED(CASE_LIGHT_ENABLE)
#include "feature/caselight.h"
#endif
@ -1082,11 +1082,11 @@ void setup() {
OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // OFF
#endif
#if HAS_CASE_LIGHT
#if ENABLED(CASE_LIGHT_ENABLE)
#if DISABLED(CASE_LIGHT_USE_NEOPIXEL)
if (PWM_PIN(CASE_LIGHT_PIN)) SET_PWM(CASE_LIGHT_PIN); else SET_OUTPUT(CASE_LIGHT_PIN);
#endif
SETUP_RUN(update_case_light());
SETUP_RUN(caselight.update_brightness());
#endif
#if ENABLED(MK2_MULTIPLEXER)

View File

@ -25,7 +25,7 @@
#if ENABLED(BINARY_FILE_TRANSFER)
#include "../sd/cardreader.h"
#include "binary_protocol.h"
#include "binary_stream.h"
char* SDFileTransferProtocol::Packet::Open::data = nullptr;
size_t SDFileTransferProtocol::data_waiting, SDFileTransferProtocol::transfer_timeout, SDFileTransferProtocol::idle_timeout;
@ -33,4 +33,4 @@ bool SDFileTransferProtocol::transfer_active, SDFileTransferProtocol::dummy_tran
BinaryStream binaryStream[NUM_SERIAL];
#endif // BINARY_FILE_TRANSFER
#endif

View File

@ -22,14 +22,17 @@
#include "../inc/MarlinConfig.h"
#if HAS_CASE_LIGHT
#if ENABLED(CASE_LIGHT_ENABLE)
uint8_t case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS;
bool case_light_on = CASE_LIGHT_DEFAULT_ON;
#include "caselight.h"
CaseLight caselight;
uint8_t CaseLight::brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS;
bool CaseLight::on = CASE_LIGHT_DEFAULT_ON;
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
#include "leds/leds.h"
LEDColor case_light_color =
LEDColor CaseLight::color =
#ifdef CASE_LIGHT_NEOPIXEL_COLOR
CASE_LIGHT_NEOPIXEL_COLOR
#else
@ -38,34 +41,33 @@ bool case_light_on = CASE_LIGHT_DEFAULT_ON;
;
#endif
/**
* The following are needed because ARM chips ignore a "WRITE(CASE_LIGHT_PIN,x)" command to the pins that
* are directly controlled by the PWM module. In order to turn them off the brightness level needs to be
* set to off. Since we can't use the pwm register to save the last brightness level we need a variable
* to save it.
*/
uint8_t case_light_brightness_sav; // saves brighness info so can restore when "M355 S1" received
bool case_light_arg_flag; // flag to notify if S or P argument type
#ifndef INVERT_CASE_LIGHT
#define INVERT_CASE_LIGHT false
#endif
void update_case_light() {
void CaseLight::update(const bool sflag) {
/**
* The brightness_sav (and sflag) is needed because ARM chips ignore
* a "WRITE(CASE_LIGHT_PIN,x)" command to the pins that are directly
* controlled by the PWM module. In order to turn them off the brightness
* level needs to be set to OFF. Since we can't use the PWM register to
* save the last brightness level we need a variable to save it.
*/
static uint8_t brightness_sav; // Save brightness info for restore on "M355 S1"
if (!(case_light_arg_flag && !case_light_on))
case_light_brightness_sav = case_light_brightness; // save brightness except if this is an S0 argument
if (case_light_arg_flag && case_light_on)
case_light_brightness = case_light_brightness_sav; // restore last brightens if this is an S1 argument
if (on || !sflag)
brightness_sav = brightness; // Save brightness except for M355 S0
if (sflag && on)
brightness = brightness_sav; // Restore last brightness for M355 S1
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) || DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i;
const uint8_t i = on ? brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i;
#endif
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
leds.set_color(
MakeLEDColor(case_light_color.r, case_light_color.g, case_light_color.b, case_light_color.w, n10ct),
MakeLEDColor(color.r, color.g, color.b, color.w, n10ct),
false
);
@ -83,11 +85,11 @@ void update_case_light() {
else
#endif
{
const bool s = case_light_on ? !INVERT_CASE_LIGHT : INVERT_CASE_LIGHT;
const bool s = on ? !INVERT_CASE_LIGHT : INVERT_CASE_LIGHT;
WRITE(CASE_LIGHT_PIN, s ? HIGH : LOW);
}
#endif // !CASE_LIGHT_USE_NEOPIXEL
}
#endif // HAS_CASE_LIGHT
#endif // CASE_LIGHT_ENABLE

View File

@ -21,9 +21,25 @@
*/
#pragma once
extern uint8_t case_light_brightness;
extern bool case_light_on;
extern uint8_t case_light_brightness_sav; // saves brighness info when case_light_on is false
extern bool case_light_arg_flag; // flag to notify if S or P argument type
#include "../inc/MarlinConfigPre.h"
void update_case_light();
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
#include "leds/leds.h"
#endif
class CaseLight {
public:
static uint8_t brightness;
static bool on;
static void update(const bool sflag);
static inline void update_brightness() { update(false); }
static inline void update_enabled() { update(true); }
private:
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
static LEDColor color;
#endif
};
extern CaseLight caselight;

View File

@ -21,7 +21,7 @@
*/
/**
* emergency_parser.cpp - Intercept special commands directly in the serial stream
* e_parser.cpp - Intercept special commands directly in the serial stream
*/
#include "../inc/MarlinConfigPre.h"

View File

@ -22,7 +22,7 @@
#pragma once
/**
* emergency_parser.h - Intercept special commands directly in the serial stream
* e_parser.h - Intercept special commands directly in the serial stream
*/
#include "../inc/MarlinConfigPre.h"

View File

@ -20,45 +20,47 @@
*
*/
#include "../../gcode.h"
#include "../../../inc/MarlinConfig.h"
#if HAS_CASE_LIGHT
#include "../../../feature/caselight.h"
#if ENABLED(CASE_LIGHT_ENABLE)
/**
* M355: Turn case light on/off and set brightness
*
* P<byte> Set case light brightness (PWM pin required - ignored otherwise)
*
* S<bool> Set case light on/off
*
* When S turns on the light on a PWM pin then the current brightness level is used/restored
*
* M355 P200 S0 turns off the light & sets the brightness level
* M355 S1 turns on the light with a brightness of 200 (assuming a PWM pin)
*/
void GcodeSuite::M355() {
uint8_t args = 0;
if (parser.seenval('P')) {
++args, case_light_brightness = parser.value_byte();
case_light_arg_flag = false;
}
if (parser.seenval('S')) {
++args, case_light_on = parser.value_bool();
case_light_arg_flag = true;
}
if (args) update_case_light();
#include "../../../feature/caselight.h"
#include "../../gcode.h"
// always report case light status
SERIAL_ECHO_START();
if (!case_light_on) {
SERIAL_ECHOLNPGM("Case light: off");
}
else {
if (!PWM_PIN(CASE_LIGHT_PIN)) SERIAL_ECHOLNPGM("Case light: on");
else SERIAL_ECHOLNPAIR("Case light: ", case_light_brightness);
}
/**
* M355: Turn case light on/off and set brightness
*
* P<byte> Set case light brightness (PWM pin required - ignored otherwise)
*
* S<bool> Set case light on/off
*
* When S turns on the light on a PWM pin then the current brightness level is used/restored
*
* M355 P200 S0 turns off the light & sets the brightness level
* M355 S1 turns on the light with a brightness of 200 (assuming a PWM pin)
*/
void GcodeSuite::M355() {
bool didset = false;
if (parser.seenval('P')) {
didset = true;
caselight.brightness = parser.value_byte();
}
#endif // HAS_CASE_LIGHT
const bool sflag = parser.seenval('S');
if (sflag) {
didset = true;
caselight.on = parser.value_bool();
}
if (didset) caselight.update(sflag);
// Always report case light status
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Case light: ");
if (!caselight.on)
SERIAL_ECHOLNPGM(STR_OFF);
else {
if (!PWM_PIN(CASE_LIGHT_PIN)) SERIAL_ECHOLNPGM(STR_ON);
else SERIAL_ECHOLN(int(caselight.brightness));
}
}
#endif // CASE_LIGHT_ENABLE

View File

@ -842,7 +842,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 351: M351(); break; // M351: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
#endif
#if HAS_CASE_LIGHT
#if ENABLED(CASE_LIGHT_ENABLE)
case 355: M355(); break; // M355: Set case light brightness
#endif

View File

@ -702,7 +702,7 @@ private:
static void M351();
#endif
TERN_(HAS_CASE_LIGHT, static void M355());
TERN_(CASE_LIGHT_ENABLE, static void M355());
TERN_(REPETIER_GCODE_M360, static void M360());
@ -845,7 +845,7 @@ private:
TERN_(MAGNETIC_PARKING_EXTRUDER, static void M951());
TERN_(TOUCH_SCREEN_CALIBRATION, static void M995());
TERN_(PLATFORM_M997_SUPPORT, static void M997());
static void M999();

View File

@ -93,8 +93,8 @@ void GcodeSuite::M115() {
cap_line(PSTR("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));
// TOGGLE_LIGHTS (M355)
cap_line(PSTR("TOGGLE_LIGHTS"), ENABLED(HAS_CASE_LIGHT));
cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN0(HAS_CASE_LIGHT, PWM_PIN(CASE_LIGHT_PIN)));
cap_line(PSTR("TOGGLE_LIGHTS"), ENABLED(CASE_LIGHT_ENABLE));
cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN0(CASE_LIGHT_ENABLE, PWM_PIN(CASE_LIGHT_PIN)));
// EMERGENCY_PARSER (M108, M112, M410, M876)
cap_line(PSTR("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER));

View File

@ -40,7 +40,7 @@ GCodeQueue queue;
#endif
#if ENABLED(BINARY_FILE_TRANSFER)
#include "../feature/binary_protocol.h"
#include "../feature/binary_stream.h"
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
@ -628,11 +628,10 @@ void GCodeQueue::advance() {
#if ENABLED(SERIAL_STATS_DROPPED_RX)
SERIAL_ECHOLNPAIR("Dropped bytes: ", MYSERIAL0.dropped());
#endif
#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
SERIAL_ECHOLNPAIR("Max RX Queue Size: ", MYSERIAL0.rxMaxEnqueued());
#endif
#endif // !defined(__AVR__) || !defined(USBCON)
#endif
ok_to_send();
}

View File

@ -430,14 +430,6 @@
#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
@ -774,10 +766,3 @@
#ifndef EXTRUDE_MINTEMP
#define EXTRUDE_MINTEMP 170
#endif
/**
* To check if we need the folder src/features/leds
*/
#if ANY(TEMP_STAT_LEDS, HAS_COLOR_LEDS, HAS_CASE_LIGHT, PRINTER_EVENT_LEDS, LED_BACKLIGHT_TIMEOUT, PCA9632_BUZZER, LED_CONTROL_MENU, NEOPIXEL_LED)
#define HAS_LED_FEATURE 1
#endif

View File

@ -1944,9 +1944,6 @@
#if PIN_EXISTS(PHOTOGRAPH)
#define HAS_PHOTOGRAPH 1
#endif
#if PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE)
#define HAS_CASE_LIGHT 1
#endif
// Digital control
#if PIN_EXISTS(STEPPER_RESET)
@ -2223,7 +2220,7 @@
/**
* MIN/MAX case light PWM scaling
*/
#if HAS_CASE_LIGHT
#if ENABLED(CASE_LIGHT_ENABLE)
#ifndef CASE_LIGHT_MAX_PWM
#define CASE_LIGHT_MAX_PWM 255
#elif !WITHIN(CASE_LIGHT_MAX_PWM, 1, 255)

View File

@ -38,7 +38,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
}
#ifdef TOUCH_UI_PORTRAIT
#if EITHER(HAS_CASE_LIGHT, SENSORLESS_HOMING)
#if EITHER(CASE_LIGHT_ENABLE, SENSORLESS_HOMING)
#define GRID_ROWS 9
#else
#define GRID_ROWS 8
@ -59,7 +59,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
#define BACKLASH_POS BTN_POS(2,7), BTN_SIZE(1,1)
#define CASE_LIGHT_POS BTN_POS(1,8), BTN_SIZE(1,1)
#define TMC_HOMING_THRS_POS BTN_POS(2,8), BTN_SIZE(1,1)
#if EITHER(HAS_CASE_LIGHT, SENSORLESS_HOMING)
#if EITHER(CASE_LIGHT_ENABLE, SENSORLESS_HOMING)
#define BACK_POS BTN_POS(1,9), BTN_SIZE(2,1)
#else
#define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1)
@ -91,7 +91,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
.font(Theme::font_medium)
.enabled(ENABLED(HAS_BED_PROBE))
.tag(2) .button( ZPROBE_ZOFFSET_POS, GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
.enabled(ENABLED(HAS_CASE_LIGHT))
.enabled(ENABLED(CASE_LIGHT_ENABLE))
.tag(16).button( CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT))
.tag(3) .button( STEPS_PER_MM_POS, GET_TEXT_F(MSG_STEPS_PER_MM))
.enabled(ENABLED(HAS_TRINAMIC_CONFIG))
@ -149,7 +149,7 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
#endif
case 15: GOTO_SCREEN(DisplayTuningScreen); break;
#if HAS_CASE_LIGHT
#if ENABLED(CASE_LIGHT_ENABLE)
case 16: GOTO_SCREEN(CaseLightScreen); break;
#endif
default: return false;

View File

@ -137,7 +137,7 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
case 4: GOTO_SCREEN(MoveAxisScreen); break;
case 5: injectCommands_P(PSTR("M84")); break;
case 6: GOTO_SCREEN(TemperatureScreen); break;
#if BOTH(TOUCH_UI_COCOA_PRESS, HAS_CASE_LIGHT)
#if BOTH(TOUCH_UI_COCOA_PRESS, CASE_LIGHT_ENABLE)
case 7: GOTO_SCREEN(CaseLightScreen); break;
#else
case 7: GOTO_SCREEN(ChangeFilamentScreen); break;

View File

@ -83,7 +83,7 @@ SCREEN_TABLE {
#else
DECL_SCREEN(JerkScreen),
#endif
#if HAS_CASE_LIGHT
#if ENABLED(CASE_LIGHT_ENABLE)
DECL_SCREEN(CaseLightScreen),
#endif
#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)

View File

@ -63,7 +63,7 @@ enum {
#else
JERK_SCREEN_CACHE,
#endif
#if HAS_CASE_LIGHT
#if ENABLED(CASE_LIGHT_ENABLE)
CASE_LIGHT_SCREEN_CACHE,
#endif
#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
@ -579,7 +579,7 @@ class DefaultAccelerationScreen : public BaseNumericAdjustmentScreen, public Cac
};
#endif
#if HAS_CASE_LIGHT
#if ENABLED(CASE_LIGHT_ENABLE)
class CaseLightScreen : public BaseNumericAdjustmentScreen, public CachedScreen<CASE_LIGHT_SCREEN_CACHE> {
public:
static void onRedraw(draw_mode_t);

View File

@ -599,18 +599,18 @@ namespace ExtUI {
#endif
#endif
#if HAS_CASE_LIGHT
bool getCaseLightState() { return case_light_on; }
#if ENABLED(CASE_LIGHT_ENABLE)
bool getCaseLightState() { return caselight.on; }
void setCaseLightState(const bool value) {
case_light_on = value;
update_case_light();
caselight.on = value;
caselight.update_enabled();
}
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
float getCaseLightBrightness_percent() { return ui8_to_percent(case_light_brightness); }
float getCaseLightBrightness_percent() { return ui8_to_percent(caselight.brightness); }
void setCaseLightBrightness_percent(const float value) {
case_light_brightness = map(constrain(value, 0, 100), 0, 100, 0, 255);
update_case_light();
caselight.brightness = map(constrain(value, 0, 100), 0, 100, 0, 255);
caselight.update_brightness();
}
#endif
#endif

View File

@ -76,8 +76,8 @@
void menu_case_light() {
START_MENU();
BACK_ITEM(MSG_CONFIGURATION);
EDIT_ITEM(percent, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true);
EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
EDIT_ITEM(percent, MSG_CASE_LIGHT_BRIGHTNESS, &caselight.brightness, 0, 255, caselight.update_brightness, true);
EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&caselight.on, caselight.update_enabled);
END_MENU();
}
#endif
@ -97,7 +97,7 @@ void menu_led() {
#endif
SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom);
#endif
//
//
// Set Case light on/off/brightness
//
#if ENABLED(CASE_LIGHT_MENU)
@ -106,7 +106,7 @@ void menu_led() {
SUBMENU(MSG_CASE_LIGHT, menu_case_light);
else
#endif
EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&caselight.on, caselight.update_enabled);
#endif
END_MENU();
}

View File

@ -1,9 +1,36 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(BINARY_FILE_TRANSFER)
/**
* libs/heatshrink/heatshrink_decoder.cpp
*/
#include "heatshrink_decoder.h"
#include <stdlib.h>
#include <string.h>
#include "heatshrink_decoder.h"
#pragma GCC optimize ("O3")
@ -353,3 +380,5 @@ static void push_byte(heatshrink_decoder *hsd, output_info *oi, uint8_t byte) {
oi->buf[(*oi->output_size)++] = byte;
(void)hsd;
}
#endif // BINARY_FILE_TRANSFER

View File

@ -1,13 +1,36 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/**
* libs/heatshrink/heatshrink_decoder.h
*/
#pragma once
#include <stdint.h>
#include <stddef.h>
#include "heatshrink_common.h"
#include "heatshrink_config.h"
#include <stdint.h>
#include <stddef.h>
typedef enum {
HSDR_SINK_OK, /* data sunk, ready to poll */
HSDR_SINK_FULL, /* out of space in internal buffer */

View File

@ -404,7 +404,7 @@ typedef struct SettingsDataStruct {
// HAS_CASE_LIGHT_BRIGHTNESS
//
#if HAS_CASE_LIGHT_BRIGHTNESS
uint8_t case_light_brightness;
uint8_t caselight_brightness; // M355 P
#endif
//
@ -465,7 +465,7 @@ void MarlinSettings::postprocess() {
TERN_(HAS_LINEAR_E_JERK, planner.recalculate_max_e_jerk());
TERN_(HAS_CASE_LIGHT_BRIGHTNESS, update_case_light());
TERN_(HAS_CASE_LIGHT_BRIGHTNESS, caselight.update_brightness());
// Refresh steps_to_mm with the reciprocal of axis_steps_per_mm
// and init stepper.count[], planner.position[] with current_position
@ -1342,7 +1342,7 @@ void MarlinSettings::postprocess() {
// Case Light Brightness
//
#if HAS_CASE_LIGHT_BRIGHTNESS
EEPROM_WRITE(case_light_brightness);
EEPROM_WRITE(caselight.brightness);
#endif
//
@ -2181,8 +2181,8 @@ void MarlinSettings::postprocess() {
// Case Light Brightness
//
#if HAS_CASE_LIGHT_BRIGHTNESS
_FIELD_TEST(case_light_brightness);
EEPROM_READ(case_light_brightness);
_FIELD_TEST(caselight_brightness);
EEPROM_READ(caselight.brightness);
#endif
//
@ -2493,7 +2493,7 @@ void MarlinSettings::reset() {
//
// Case Light Brightness
//
TERN_(HAS_CASE_LIGHT_BRIGHTNESS, case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS);
TERN_(HAS_CASE_LIGHT_BRIGHTNESS, caselight.brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS);
//
// TOUCH_SCREEN_CALIBRATION

View File

@ -65,3 +65,91 @@
#ifdef HAL_PATH
#include HAL_PATH(../../../../Marlin/src/HAL, inc/Conditionals_post.h)
#endif
//
// Conditionals only used for [features]
//
#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 BOTH(ANYCUBIC_LCD_I3MEGA, EXTENSIBLE_UI)
#define HAS_ANYCUBIC_TFT_EXTUI
#endif
#if SAVED_POSITIONS
#define HAS_SAVED_POSITIONS
#endif
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
#define HAS_GCODE_M876
#endif
#if PREHEAT_COUNT
#define HAS_PREHEAT_COUNT
#endif
#if EXTRUDERS
#define HAS_EXTRUDERS
#if EXTRUDERS > 1
#define HAS_MULTI_EXTRUDER
#endif
#endif
#if HAS_LCD_MENU
#if ENABLED(BACKLASH_GCODE)
#define HAS_MENU_BACKLASH
#endif
#if ENABLED(LEVEL_BED_CORNERS)
#define HAS_MENU_BED_CORNERS
#endif
#if ENABLED(CANCEL_OBJECTS)
#define HAS_MENU_CANCELOBJECT
#endif
#if ENABLED(CUSTOM_USER_MENUS)
#define HAS_MENU_CUSTOM
#endif
#if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
#define HAS_MENU_DELTA_CALIBRATE
#endif
#if EITHER(LED_CONTROL_MENU, CASE_LIGHT_MENU)
#define HAS_MENU_LED
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#define HAS_MENU_FILAMENT
#endif
#if ENABLED(SDSUPPORT)
#define HAS_MENU_MEDIA
#endif
#if ENABLED(MIXING_EXTRUDER)
#define HAS_MENU_MIXER
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
#define HAS_MENU_JOB_RECOVERY
#endif
#if HAS_POWER_MONITOR
#define HAS_MENU_POWER_MONITOR
#endif
#if HAS_CUTTER
#define HAS_MENU_CUTTER
#endif
#if HAS_TEMPERATURE
#define HAS_MENU_TEMPERATURE
#endif
#if ENABLED(MMU2_MENUS)
#define HAS_MENU_MMU2
#endif
#if HAS_TRINAMIC_CONFIG
#define HAS_MENU_TMC
#endif
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
#define HAS_MENU_TOUCH_SCREEN
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
#define HAS_MENU_UBL
#endif
#endif

View File

@ -6,41 +6,56 @@ import subprocess
import os
import re
try:
import configparser
import configparser
except ImportError:
import ConfigParser as configparser
import ConfigParser as configparser
from platformio.managers.package import PackageManager
Import("env")
FEATURE_DEPENDENCIES = {}
FEATURE_CONFIG = {}
def add_to_feat_cnf(feature, flines):
feat = FEATURE_CONFIG[feature]
atoms = re.sub(',\\s*', '\n', flines).strip().split('\n')
for dep in atoms:
parts = dep.split('=')
name = parts.pop(0)
rest = '='.join(parts)
if name in ['extra_scripts', 'src_filter', 'lib_ignore']:
feat[name] = rest
else:
feat['lib_deps'] += [dep]
def load_config():
config = configparser.ConfigParser()
config.read("platformio.ini")
items = config.items('features')
for key in items:
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 in ['extra_scripts', 'src_filter', 'lib_ignore']:
FEATURE_DEPENDENCIES[ukey][name] = rest
else:
FEATURE_DEPENDENCIES[ukey]['lib_deps'] += [dep]
feature = key[0].upper()
if not feature in FEATURE_CONFIG:
FEATURE_CONFIG[feature] = { 'lib_deps': [] }
add_to_feat_cnf(feature, key[1])
# Add options matching marlin.MY_OPTION to the pile
all_opts = env.GetProjectOptions()
for n in all_opts:
mat = re.match(r'marlin\.(.+)', n[0])
if mat:
try:
val = env.GetProjectOption(n[0])
except:
val = None
if val:
add_to_feat_cnf(mat.group(1).upper(), val)
def get_all_known_libs():
known_libs = []
for feature in FEATURE_DEPENDENCIES:
if not 'lib_deps' in FEATURE_DEPENDENCIES[feature]:
for feature in FEATURE_CONFIG:
feat = FEATURE_CONFIG[feature]
if not 'lib_deps' in feat:
continue
for dep in FEATURE_DEPENDENCIES[feature]['lib_deps']:
for dep in feat['lib_deps']:
name, _, _ = PackageManager.parse_pkg_uri(dep)
known_libs.append(name)
return known_libs
@ -64,21 +79,23 @@ def force_ignore_unused_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)
print("Ignore libraries:", lib_ignore)
set_env_field('lib_ignore', lib_ignore)
def install_features_dependencies():
def apply_features_config():
load_config()
for feature in FEATURE_DEPENDENCIES:
for feature in FEATURE_CONFIG:
if not env.MarlinFeatureIsEnabled(feature):
continue
if 'lib_deps' in FEATURE_DEPENDENCIES[feature]:
feat = FEATURE_CONFIG[feature]
if 'lib_deps' in feat and len(feat['lib_deps']):
print("Adding lib_deps for %s... " % feature)
# deps to add
# feat to add
deps_to_add = {}
for dep in FEATURE_DEPENDENCIES[feature]['lib_deps']:
for dep in feat['lib_deps']:
name, _, _ = PackageManager.parse_pkg_uri(dep)
deps_to_add[name] = dep
@ -101,27 +118,27 @@ def install_features_dependencies():
# Only add the missing dependencies
set_env_field('lib_deps', deps + list(deps_to_add.values()))
if 'extra_scripts' in FEATURE_DEPENDENCIES[feature]:
print("Executing extra_scripts for %s... " % feature)
env.SConscript(FEATURE_DEPENDENCIES[feature]['extra_scripts'], exports="env")
if 'extra_scripts' in feat:
print("Running extra_scripts for %s... " % feature)
env.SConscript(feat['extra_scripts'], exports="env")
if 'src_filter' in FEATURE_DEPENDENCIES[feature]:
if 'src_filter' in feat:
print("Adding src_filter for %s... " % feature)
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'])
my_srcs = re.findall( r'[+-](<.*?>)', feat['src_filter'])
cur_srcs = re.findall( r'[+-](<.*?>)', src_filter)
for d in my_srcs:
if d in cur_srcs:
src_filter = re.sub(r'[+-]' + d, '', src_filter)
src_filter = FEATURE_DEPENDENCIES[feature]['src_filter'] + ' ' + src_filter
src_filter = feat['src_filter'] + ' ' + src_filter
set_env_field('src_filter', [src_filter])
env.Replace(SRC_FILTER=src_filter)
if 'lib_ignore' in FEATURE_DEPENDENCIES[feature]:
print("Ignoring libs for %s... " % feature)
lib_ignore = env.GetProjectOption('lib_ignore') + [FEATURE_DEPENDENCIES[feature]['lib_ignore']]
if 'lib_ignore' in feat:
print("Adding lib_ignore for %s... " % feature)
lib_ignore = env.GetProjectOption('lib_ignore') + [feat['lib_ignore']]
set_env_field('lib_ignore', lib_ignore)
#
@ -170,7 +187,7 @@ def search_compiler():
# Use the compiler to get a list of all enabled features
#
def load_marlin_features():
if "MARLIN_FEATURES" in env:
if 'MARLIN_FEATURES' in env:
return
# Process defines
@ -199,16 +216,27 @@ def load_marlin_features():
feature = define[8:].strip().decode().split(' ')
feature, definition = feature[0], ' '.join(feature[1:])
marlin_features[feature] = definition
env["MARLIN_FEATURES"] = marlin_features
env['MARLIN_FEATURES'] = marlin_features
#
# Return True if a matching feature is enabled
#
def MarlinFeatureIsEnabled(env, feature):
load_marlin_features()
r = re.compile(feature)
matches = list(filter(r.match, env["MARLIN_FEATURES"]))
return len(matches) > 0
r = re.compile('^' + feature + '$')
found = list(filter(r.match, env['MARLIN_FEATURES']))
# Defines could still be 'false' or '0', so check
some_on = False
if len(found):
for f in found:
val = env['MARLIN_FEATURES'][f]
if val in [ '', '1', 'true' ]:
some_on = True
elif val in env['MARLIN_FEATURES']:
some_on = env.MarlinFeatureIsEnabled(val)
return some_on
#
# Add a method for other PIO scripts to query enabled features
@ -218,5 +246,5 @@ env.AddMethod(MarlinFeatureIsEnabled)
#
# Add dependencies for enabled Marlin features
#
install_features_dependencies()
apply_features_config()
force_ignore_unused_libs()

View File

@ -26,15 +26,160 @@ include_dir = Marlin
#
[common]
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
-<src/lcd/HD44780> -<src/lcd/dwin> -<src/lcd/dogm> -<src/lcd/tft> -<src/lcd/menu>
-<src/lcd/extui/lib/mks_ui> -<src/lcd/extui/lib/dgus> -<src/lcd/extui/lib/ftdi_eve_touch_ui> -<src/lcd/extui/lib/anycubic>
-<src/lcd/HD44780> -<src/lcd/dwin> -<src/lcd/dogm> -<src/lcd/tft>
-<src/lcd/menu>
-<src/lcd/menu/game/game.cpp> -<src/lcd/menu/game/brickout.cpp> -<src/lcd/menu/game/invaders.cpp>
-<src/lcd/menu/game/maze.cpp> -<src/lcd/menu/game/snake.cpp>
-<src/lcd/menu/menu_backlash.cpp>
-<src/lcd/menu/menu_bed_corners.cpp>
-<src/lcd/menu/menu_bed_leveling.cpp>
-<src/lcd/menu/menu_cancelobject.cpp>
-<src/lcd/menu/menu_delta_calibrate.cpp>
-<src/lcd/menu/menu_filament.cpp>
-<src/lcd/menu/menu_info.cpp>
-<src/lcd/menu/menu_job_recovery.cpp>
-<src/lcd/menu/menu_led.cpp>
-<src/lcd/menu/menu_media.cpp>
-<src/lcd/menu/menu_mmu2.cpp>
-<src/lcd/menu/menu_power_monitor.cpp>
-<src/lcd/menu/menu_spindle_laser.cpp>
-<src/lcd/menu/menu_temperature.cpp>
-<src/lcd/menu/menu_tmc.cpp>
-<src/lcd/menu/menu_touch_screen.cpp>
-<src/lcd/menu/menu_ubl.cpp>
-<src/lcd/extui/lib/mks_ui>
-<src/lcd/extui/lib/dgus> -<src/lcd/extui_dgus_lcd.cpp>
-<src/lcd/extui_example.cpp>
-<src/lcd/extui_malyan_lcd.cpp>
-<src/lcd/extui/lib/ftdi_eve_touch_ui>
-<src/lcd/extui/lib/anycubic_i3mega>
-<src/lcd/extui_anycubic_tft.cpp>
-<src/lcd/lcdprint.cpp>
-<src/sd/usb_flashdrive>
-<src/gcode/feature/trinamic>
-<src/feature/backlash.cpp>
-<src/feature/baricuda.cpp> -<src/gcode/feature/baricuda>
-<src/feature/bedlevel/abl> -<src/gcode/bedlevel/abl>
-<src/feature/bedlevel/mbl> -<src/gcode/bedlevel/mbl>
-<src/feature/bedlevel/ubl> -<src/gcode/bedlevel/ubl>
-<src/feature/binary_stream.cpp> -<src/libs/heatshrink>
-<src/feature/bltouch.cpp>
-<src/feature/cancel_object.cpp> -<src/gcode/feature/cancel>
-<src/feature/caselight> -<src/gcode/feature/caselight>
-<src/feature/closedloop.cpp>
-<src/feature/controllerfan.cpp> -<src/gcode/feature/controllerfan>
-<src/feature/dac> -<src/feature/digipot>
-<src/feature/leds>
-<src/feature/direct_stepping.cpp> -<src/gcode/motion/G6.cpp>
-<src/feature/e_parser.cpp>
-<src/feature/encoder_i2c.cpp>
-<src/feature/fanmux.cpp>
-<src/feature/filwidth.cpp> -<src/gcode/feature/filwidth>
-<src/feature/fwretract.cpp> -<src/gcode/feature/fwretract>
-<src/feature/host_actions.cpp>
-<src/feature/hotend_idle.cpp>
-<src/feature/joystick.cpp>
-<src/feature/leds/blinkm.cpp>
-<src/feature/leds/leds.cpp>
-<src/feature/leds/pca9533.cpp>
-<src/feature/leds/pca9632.cpp>
-<src/feature/leds/printer_event_leds.cpp>
-<src/feature/leds/tempstat.cpp>
-<src/feature/max7219.cpp>
-<src/feature/mixing.cpp>
-<src/feature/mmu2> -<src/gcode/feature/prusa_MMU2>
-<src/feature/pause.cpp>
-<src/feature/power.cpp>
-<src/feature/power_monitor.cpp> -<src/gcode/feature/power_monitor>
-<src/feature/powerloss.cpp> -<src/gcode/feature/powerloss>
-<src/feature/probe_temp_comp.cpp>
-<src/feature/runout.cpp> -<src/gcode/feature/runout>
-<src/feature/snmm.cpp>
-<src/feature/solenoid.cpp>
-<src/feature/spindle_laser.cpp> -<src/gcode/control/M3-M5.cpp>
-<src/feature/tmc_util.cpp> -<src/module/stepper/trinamic.cpp>
-<src/feature/twibus.cpp>
-<src/feature/z_stepper_align.cpp>
-<src/gcode/bedlevel/G26.cpp>
-<src/gcode/bedlevel/G35.cpp>
-<src/gcode/bedlevel/G42.cpp>
-<src/gcode/bedlevel/M420.cpp>
-<src/gcode/calibrate/G33.cpp>
-<src/gcode/calibrate/G34_M422.cpp>
-<src/gcode/calibrate/G76_M871.cpp>
-<src/gcode/calibrate/G425.cpp>
-<src/gcode/calibrate/M12.cpp>
-<src/gcode/calibrate/M48.cpp>
-<src/gcode/calibrate/M100.cpp>
-<src/gcode/calibrate/M425.cpp>
-<src/gcode/calibrate/M666.cpp>
-<src/gcode/calibrate/M852.cpp>
-<src/gcode/config/M43.cpp>
-<src/gcode/config/M217.cpp>
-<src/gcode/config/M218.cpp>
-<src/gcode/config/M221.cpp>
-<src/gcode/config/M281.cpp>
-<src/gcode/config/M302.cpp>
-<src/gcode/config/M305.cpp>
-<src/gcode/config/M540.cpp>
-<src/gcode/control/M7-M9.cpp>
-<src/gcode/control/M211.cpp>
-<src/gcode/control/M605.cpp>
-<src/gcode/feature/advance>
-<src/gcode/feature/camera>
-<src/gcode/feature/i2c>
-<src/gcode/feature/L6470>
-<src/gcode/feature/leds/M150.cpp>
-<src/gcode/feature/leds/M7219.cpp>
-<src/gcode/feature/macro>
-<src/gcode/feature/mixing/M163-M165.cpp>
-<src/gcode/feature/mixing/M166.cpp>
-<src/gcode/feature/pause/G27.cpp>
-<src/gcode/feature/pause/G60.cpp>
-<src/gcode/feature/pause/G61.cpp>
-<src/gcode/feature/pause/M125.cpp>
-<src/gcode/feature/pause/M600.cpp>
-<src/gcode/feature/pause/M603.cpp>
-<src/gcode/feature/pause/M701_M702.cpp>
-<src/gcode/feature/trinamic/M122.cpp>
-<src/gcode/feature/trinamic/M569.cpp>
-<src/gcode/feature/trinamic/M906.cpp>
-<src/gcode/feature/trinamic/M911-M914.cpp>
-<src/gcode/geometry/G17-G19.cpp>
-<src/gcode/geometry/G53-G59.cpp>
-<src/gcode/geometry/M206_M428.cpp>
-<src/gcode/host/M16.cpp>
-<src/gcode/host/M113.cpp>
-<src/gcode/host/M360.cpp>
-<src/gcode/host/M876.cpp>
-<src/gcode/lcd/M0_M1.cpp>
-<src/gcode/lcd/M145.cpp>
-<src/gcode/lcd/M250.cpp>
-<src/gcode/lcd/M73.cpp>
-<src/gcode/lcd/M995.cpp>
-<src/gcode/motion/G2_G3.cpp>
-<src/gcode/motion/G5.cpp>
-<src/gcode/motion/G80.cpp>
-<src/gcode/motion/M290.cpp>
-<src/gcode/probe/G30.cpp>
-<src/gcode/probe/G31_G32.cpp>
-<src/gcode/probe/G38.cpp>
-<src/gcode/probe/M401_M402.cpp>
-<src/gcode/probe/M851.cpp>
-<src/gcode/probe/M951.cpp>
-<src/gcode/scara>
-<src/gcode/sd>
-<src/gcode/temp/M104_M109.cpp>
-<src/gcode/units/G20_G21.cpp>
-<src/gcode/units/M149.cpp>
-<src/libs/L64XX> -<src/module/stepper/L64xx.cpp>
-<src/libs/hex_print.cpp>
-<src/libs/least_squares_fit.cpp>
-<src/libs/nozzle.cpp> -<src/gcode/feature/clean>
-<src/module/delta.cpp>
-<src/module/planner_bezier.cpp>
-<src/module/printcounter.cpp>
-<src/module/probe.cpp>
-<src/module/scara.cpp> -<src/gcode/calibrate/M665.cpp>
-<src/module/stepper/TMC26X.cpp>
extra_scripts =
pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
@ -49,12 +194,17 @@ HAS_TFT_LVGL_UI = lvgl=https://github.com/makerbase-mks/MKS-LittlevGL/ar
src_filter=+<src/lcd/extui/lib/mks_ui>
extra_scripts=download_mks_assets.py
HAS_TRINAMIC_CONFIG = TMCStepper@~0.7.1
src_filter=+<src/gcode/feature/trinamic>
src_filter=+<src/feature/tmc_util.cpp> +<src/module/stepper/trinamic.cpp> +<src/gcode/feature/trinamic/M122.cpp> +<src/gcode/feature/trinamic/M906.cpp> +<src/gcode/feature/trinamic/M911-M914.cpp>
HAS_STEALTHCHOP = src_filter=+<src/gcode/feature/trinamic/M569.cpp>
SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip
DIGIPOT_MCP4... = SlowSoftI2CMaster
HAS_I2C_DIGIPOT = SlowSoftI2CMaster
src_filter=+<src/feature/digipot>
HAS_TMC26X = TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
src_filter=+<src/module/TMC26X.cpp>
HAS_L64XX = Arduino-L6470@0.8.0
src_filter=+<src/libs/L64XX> +<src/module/stepper/L64xx.cpp> +<src/gcode/feature/L6470>
NEOPIXEL_LED = Adafruit NeoPixel@1.5.0
src_filter=+<src/feature/leds/neopixel.cpp>
MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0
HAS_GRAPHICAL_LCD = U8glib-HAL@0.4.1
src_filter=+<src/lcd/dogm>
@ -64,17 +214,143 @@ DWIN_CREALITY_LCD = src_filter=+<src/lcd/dwin>
HAS_CHARACTER_LCD = src_filter=+<src/lcd/HD44780>
HAS_GRAPHICAL_TFT = src_filter=+<src/lcd/tft>
HAS_LCD_MENU = src_filter=+<src/lcd/menu>
HAS_DGUS_LCD = src_filter=+<src/lcd/extui/lib/dgus>
TOUCH_UI_FTDI_EVE = src_filter=+<src/lcd/extui/lib/ftdi_eve_touch_ui>
HAS_GAMES = src_filter=+<src/lcd/menu/game/game.cpp>
MARLIN_BRICKOUT = src_filter=+<src/lcd/menu/game/brickout.cpp>
MARLIN_INVADERS = src_filter=+<src/lcd/menu/game/invaders.cpp>
MARLIN_MAZE = src_filter=+<src/lcd/menu/game/maze.cpp>
MARLIN_SNAKE = src_filter=+<src/lcd/menu/game/snake.cpp>
HAS_MENU_BACKLASH = src_filter=+<src/lcd/menu/menu_backlash.cpp>
HAS_MENU_BED_CORNERS = src_filter=+<src/lcd/menu/menu_bed_corners.cpp>
LCD_BED_LEVELING = src_filter=+<src/lcd/menu/menu_bed_leveling.cpp>
HAS_MENU_CANCELOBJECT = src_filter=+<src/lcd/menu/menu_cancelobject.cpp>
HAS_MENU_DELTA_CALIBRATE = src_filter=+<src/lcd/menu/menu_delta_calibrate.cpp>
HAS_MENU_FILAMENT = src_filter=+<src/lcd/menu/menu_filament.cpp>
LCD_INFO_MENU = src_filter=+<src/lcd/menu/menu_info.cpp>
HAS_MENU_JOB_RECOVERY = src_filter=+<src/lcd/menu/menu_job_recovery.cpp>
HAS_MENU_LED = src_filter=+<src/lcd/menu/menu_led.cpp>
HAS_MENU_MEDIA = src_filter=+<src/lcd/menu/menu_media.cpp>
HAS_MENU_MIXER = src_filter=+<src/lcd/menu/menu_mixer.cpp>
HAS_MENU_MMU2 = src_filter=+<src/lcd/menu/menu_mmu2.cpp>
HAS_MENU_POWER_MONITOR = src_filter=+<src/lcd/menu/menu_power_monitor.cpp>
HAS_MENU_CUTTER = src_filter=+<src/lcd/menu/menu_spindle_laser.cpp>
HAS_MENU_TEMPERATURE = src_filter=+<src/lcd/menu/menu_temperature.cpp>
HAS_MENU_TMC = src_filter=+<src/lcd/menu/menu_tmc.cpp>
HAS_MENU_TOUCH_SCREEN = src_filter=+<src/lcd/menu/menu_touch_screen.cpp>
HAS_MENU_UBL = src_filter=+<src/lcd/menu/menu_ubl.cpp>
ANYCUBIC_LCD_I3MEGA = src_filter=+<src/lcd/extui/lib/anycubic_i3mega>
HAS_DGUS_LCD = src_filter=+<src/lcd/extui/lib/dgus> +<src/lcd/extui_dgus_lcd.cpp>
TOUCH_UI_FTDI_EVE = src_filter=+<src/lcd/extui/lib/ftdi_eve_touch_ui>
HAS_ANYCUBIC_TFT_EXTUI = src_filter=+<src/lcd/extui_anycubic_tft.cpp>
EXTUI_EXAMPLE = src_filter=+<src/lcd/extui_example.cpp>
MALYAN_LCD = src_filter=+<src/lcd/extui_malyan_lcd.cpp>
HAS_SPI_LCD = src_filter=+<src/lcd/lcdprint.cpp>
USB_FLASH_DRIVE_SUPPORT = src_filter=+<src/sd/usb_flashdrive>
AUTO_BED_LEVELING_(3POINT|(BI)?LINEAR) = src_filter=+<src/feature/bedlevel/abl> +<src/gcode/bedlevel/abl>
AUTO_BED_LEVELING_BILINEAR = src_filter=+<src/feature/bedlevel/abl>
AUTO_BED_LEVELING_(3POINT|(BI)?LINEAR) = src_filter=+<src/gcode/bedlevel/abl>
MESH_BED_LEVELING = src_filter=+<src/feature/bedlevel/mbl> +<src/gcode/bedlevel/mbl>
AUTO_BED_LEVELING_UBL = src_filter=+<src/feature/bedlevel/ubl> +<src/gcode/bedlevel/ubl>
BACKLASH_COMPENSATION = src_filter=+<src/feature/backlash.cpp>
BARICUDA = src_filter=+<src/feature/baricuda.cpp> +<src/gcode/feature/baricuda>
BINARY_FILE_TRANSFER = src_filter=+<src/feature/binary_stream.cpp> +<src/libs/heatshrink>
BLTOUCH = src_filter=+<src/feature/bltouch.cpp>
CANCEL_OBJECTS = src_filter=+<src/feature/cancel_object.cpp> +<src/gcode/feature/cancel>
CASE_LIGHT_ENABLE = src_filter=+<src/feature/caselight> +<src/gcode/feature/caselight>
EXTERNAL_CLOSED_LOOP_CONTROLLER = src_filter=+<src/feature/closedloop.cpp> +<src/gcode/calibrate/M12.cpp>
USE_CONTROLLER_FAN = src_filter=+<src/feature/controllerfan.cpp>
DAC_STEPPER_CURRENT = src_filter=+<src/feature/dac>
HAS_I2C_DIGIPOT = src_filter=+<src/feature/digipot>
HAS_LED_FEATURE = src_filter=+<src/feature/leds>
(ESP3D_)?WIFISUPPORT = AsyncTCP, ESP Async WebServer
DIRECT_STEPPING = src_filter=+<src/feature/direct_stepping.cpp> +<src/gcode/motion/G6.cpp>
EMERGENCY_PARSER = src_filter=+<src/feature/e_parser.cpp> -<src/gcode/control/M108_*.cpp>
I2C_POSITION_ENCODERS = src_filter=+<src/feature/encoder_i2c.cpp>
HAS_FANMUX = src_filter=+<src/feature/fanmux.cpp>
FILAMENT_WIDTH_SENSOR = src_filter=+<src/feature/filwidth.cpp> +<src/gcode/feature/filwidth>
FWRETRACT = src_filter=+<src/feature/fwretract.cpp> +<src/gcode/feature/fwretract>
HOST_ACTION_COMMANDS = src_filter=+<src/feature/host_actions.cpp>
HOTEND_IDLE_TIMEOUT = src_filter=+<src/feature/hotend_idle.cpp>
JOYSTICK = src_filter=+<src/feature/joystick.cpp>
BLINKM = src_filter=+<src/feature/leds/blinkm.cpp>
HAS_COLOR_LEDS = src_filter=+<src/feature/leds/leds.cpp> +<src/gcode/feature/leds/M150.cpp>
PCA9533 = src_filter=+<src/feature/leds/pca9533.cpp>
PCA9632 = src_filter=+<src/feature/leds/pca9632.cpp>
PRINTER_EVENT_LEDS = src_filter=+<src/feature/leds/printer_event_leds.cpp>
TEMP_STAT_LEDS = src_filter=+<src/feature/leds/tempstat.cpp>
MAX7219_DEBUG = src_filter=+<src/feature/max7219.cpp> +<src/gcode/feature/leds/M7219.cpp>
MIXING_EXTRUDER = src_filter=+<src/feature/mixing.cpp> +<src/gcode/feature/mixing/M163-M165.cpp>
PRUSA_MMU2 = src_filter=+<src/feature/mmu2> +<src/gcode/feature/prusa_MMU2>
ADVANCED_PAUSE_FEATURE = src_filter=+<src/feature/pause.cpp> +<src/gcode/feature/pause/M600.cpp> +<src/gcode/feature/pause/M603.cpp>
AUTO_POWER_CONTROL = src_filter=+<src/feature/power.cpp>
HAS_POWER_MONITOR = src_filter=+<src/feature/power_monitor.cpp> +<src/gcode/feature/power_monitor>
POWER_LOSS_RECOVERY = src_filter=+<src/feature/powerloss.cpp> +<src/gcode/feature/powerloss>
PROBE_TEMP_COMPENSATION = src_filter=+<src/feature/probe_temp_comp.cpp> +<src/gcode/calibrate/G76_M871.cpp>
HAS_FILAMENT_SENSOR = src_filter=+<src/feature/runout.cpp> +<src/gcode/feature/runout>
MK2_MULTIPLEXER = src_filter=+<src/feature/snmm.cpp>
EXT_SOLENOID|MANUAL_SOLENOID_CONTROL = src_filter=+<src/feature/solenoid.cpp>
HAS_CUTTER = src_filter=+<src/feature/spindle_laser.cpp> +<src/gcode/control/M3-M5.cpp>
EXPERIMENTAL_I2CBUS = src_filter=+<src/feature/twibus.cpp> +<src/gcode/feature/i2c>
Z_STEPPER_AUTO_ALIGN = src_filter=+<src/feature/z_stepper_align.cpp> +<src/gcode/calibrate/G34_M422.cpp>
G26_MESH_VALIDATION = src_filter=+<src/gcode/bedlevel/G26.cpp>
ASSISTED_TRAMMING = src_filter=+<src/gcode/bedlevel/G35.cpp>
HAS_MESH = src_filter=+<src/gcode/bedlevel/G42.cpp>
HAS_LEVELING = src_filter=+<src/gcode/bedlevel/M420.cpp>
DELTA_AUTO_CALIBRATION = src_filter=+<src/gcode/calibrate/G33.cpp>
CALIBRATION_GCODE = src_filter=+<src/gcode/calibrate/G425.cpp>
Z_MIN_PROBE_REPEATABILITY_TEST = src_filter=+<src/gcode/calibrate/M48.cpp>
M100_FREE_MEMORY_WATCHER = src_filter=+<src/gcode/calibrate/M100.cpp>
BACKLASH_GCODE = src_filter=+<src/gcode/calibrate/M425.cpp>
IS_KINEMATIC = src_filter=+<src/gcode/calibrate/M665.cpp>
HAS_EXTRA_ENDSTOPS = src_filter=+<src/gcode/calibrate/M666.cpp>
SKEW_CORRECTION_GCODE = src_filter=+<src/gcode/calibrate/M852.cpp>
PINS_DEBUGGING = src_filter=-<src/gcode/config/M43.cpp>
NO_VOLUMETRICS = src_filter=-<src/gcode/config/M200-M205.cpp>
HAS_MULTI_EXTRUDER = src_filter=+<src/gcode/config/M217.cpp>
HAS_HOTEND_OFFSET = src_filter=+<src/gcode/config/M218.cpp>
EDITABLE_SERVO_ANGLES = src_filter=+<src/gcode/config/M281.cpp>
PREVENT_COLD_EXTRUSION = src_filter=+<src/gcode/config/M302.cpp>
HAS_USER_THERMISTORS = src_filter=+<src/gcode/config/M305.cpp>
SD_ABORT_ON_ENDSTOP_HIT = src_filter=+<src/gcode/config/M540.cpp>
COOLANT_CONTROL = src_filter=+<src/gcode/control/M7-M9.cpp>
HAS_SOFTWARE_ENDSTOPS = src_filter=+<src/gcode/control/M211.cpp>
HAS_DUPLICATION_MODE = src_filter=+<src/gcode/control/M605.cpp>
LIN_ADVANCE = src_filter=+<src/gcode/feature/advance>
PHOTO_GCODE = src_filter=+<src/gcode/feature/camera>
CONTROLLER_FAN_EDITABLE = src_filter=+<src/gcode/feature/controllerfan>
GCODE_MACROS = src_filter=+<src/gcode/feature/macro>
GRADIENT_MIX = src_filter=+<src/gcode/feature/mixing/M166.cpp>
HAS_SAVED_POSITIONS = src_filter=+<src/gcode/feature/pause/G60.cpp> +<src/gcode/feature/pause/G61.cpp>
PARK_HEAD_ON_PAUSE = src_filter=+<src/gcode/feature/pause/M125.cpp>
FILAMENT_LOAD_UNLOAD_GCODES = src_filter=+<src/gcode/feature/pause/M701_M702.cpp>
CNC_WORKSPACE_PLANES = src_filter=+<src/gcode/geometry/G17-G19.cpp>
CNC_COORDINATE_SYSTEMS = src_filter=+<src/gcode/geometry/G53-G59.cpp>
HAS_M206_COMMAND = src_filter=+<src/gcode/geometry/M206_M428.cpp>
EXPECTED_PRINTER_CHECK = src_filter=+<src/gcode/host/M16.cpp>
HOST_KEEPALIVE_FEATURE = src_filter=+<src/gcode/host/M113.cpp>
REPETIER_GCODE_M360 = src_filter=+<src/gcode/host/M360.cpp>
HAS_GCODE_M876 = src_filter=+<src/gcode/host/M876.cpp>
HAS_RESUME_CONTINUE = src_filter=+<src/gcode/lcd/M0_M1.cpp>
HAS_PREHEAT_COUNT = src_filter=+<src/gcode/lcd/M145.cpp>
HAS_LCD_CONTRAST = src_filter=+<src/gcode/lcd/M250.cpp>
LCD_SET_PROGRESS_MANUALLY = src_filter=+<src/gcode/lcd/M73.cpp>
TOUCH_SCREEN_CALIBRATION = src_filter=+<src/gcode/lcd/M995.cpp>
ARC_SUPPORT = src_filter=+<src/gcode/motion/G2_G3.cpp>
GCODE_MOTION_MODES = src_filter=+<src/gcode/motion/G80.cpp>
BABYSTEPPING = src_filter=+<src/gcode/motion/M290.cpp>
Z_PROBE_SLED = src_filter=+<src/gcode/probe/G31_G32.cpp>
G38_PROBE_TARGET = src_filter=+<src/gcode/probe/G38.cpp>
MAGNETIC_PARKING_EXTRUDER = src_filter=+<src/gcode/probe/M951.cpp>
SDSUPPORT = src_filter=+<src/gcode/sd>
HAS_EXTRUDERS = src_filter=+<src/gcode/temp/M104_M109.cpp> +<src/gcode/config/M221.cpp>
INCH_MODE_SUPPORT = src_filter=+<src/gcode/units/G20_G21.cpp>
TEMPERATURE_UNITS_SUPPORT = src_filter=+<src/gcode/units/M149.cpp>
NEED_HEX_PRINT = src_filter=+<src/libs/hex_print.cpp>
NEED_LSF = src_filter=+<src/libs/least_squares_fit.cpp>
NOZZLE_PARK_FEATURE = src_filter=+<src/libs/nozzle.cpp> +<src/gcode/feature/pause/G27.cpp>
NOZZLE_CLEAN_FEATURE = src_filter=+<src/libs/nozzle.cpp> +<src/gcode/feature/clean>
DELTA = src_filter=+<src/module/delta.cpp> +<src/gcode/calibrate/M666.cpp>
BEZIER_CURVE_SUPPORT = src_filter=+<src/module/planner_bezier.cpp> +<src/gcode/motion/G5.cpp>
PRINTCOUNTER = src_filter=+<src/module/printcounter.cpp>
HAS_BED_PROBE = src_filter=+<src/module/probe.cpp> +<src/gcode/probe/G30.cpp> +<src/gcode/probe/M401_M402.cpp> +<src/gcode/probe/M851.cpp>
IS_SCARA = src_filter=+<src/module/scara.cpp>
MORGAN_SCARA = src_filter=+<src/gcode/scara>
(ESP3D_)?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
@ -268,14 +544,13 @@ src_filter = ${common.default_src_filter} +<src/HAL/DUE>
[env:DUE_USB]
platform = atmelsam
extends = env:DUE
board = dueUSB
src_filter = ${common.default_src_filter} +<src/HAL/DUE>
[env:DUE_debug]
# Used when WATCHDOG_RESET_MANUAL is enabled
platform = atmelsam
board = due
src_filter = ${common.default_src_filter} +<src/HAL/DUE>
extends = env:DUE
build_flags = ${common.build_flags}
-funwind-tables
-mpoke-function-name
@ -285,8 +560,7 @@ build_flags = ${common.build_flags}
#
[common_DUE_archim]
platform = atmelsam
board = due
src_filter = ${common.default_src_filter} +<src/HAL/DUE>
extends = env:DUE
build_flags = ${common.build_flags}
-DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSBCON
extra_scripts = ${common.extra_scripts}
@ -320,7 +594,7 @@ src_filter = ${common.default_src_filter} +<src/HAL/SAMD51>
lib_deps = ${common.lib_deps}
SoftwareSerialM
Adafruit SPIFlash
SdFat - Adafruit Fork
marlin.SDSUPPORT = SdFat - Adafruit Fork
debug_tool = jlink
#################################
@ -342,8 +616,8 @@ extra_scripts = ${common.extra_scripts}
src_filter = ${common.default_src_filter} +<src/HAL/LPC1768>
lib_deps = ${common.lib_deps}
Servo
LiquidCrystal@1.0.0
Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/1.5.0.zip
marlin.USES_LIQUIDCRYSTAL = LiquidCrystal@1.0.0
marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/1.5.0.zip
build_flags = ${common.build_flags} -DU8G_HAL_LINKS -IMarlin/src/HAL/LPC1768/include -IMarlin/src/HAL/LPC1768/u8g
# debug options for backtrace
#-funwind-tables
@ -426,9 +700,9 @@ extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py
lib_deps = ${common.lib_deps}
Adafruit NeoPixel=https://github.com/ccccmagicboy/Adafruit_NeoPixel#meeb_3dp_use
SoftwareSerialM
USBComposite for STM32F1@0.91
marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ccccmagicboy/Adafruit_NeoPixel#meeb_3dp_use
debug_tool = stlink
upload_protocol = dfu