Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding
This commit is contained in:
@@ -147,6 +147,7 @@ vc-fileutils.settings
|
||||
imgui.ini
|
||||
eeprom.dat
|
||||
spi_flash.bin
|
||||
fs.img
|
||||
|
||||
#cmake
|
||||
CMakeLists.txt
|
||||
|
||||
@@ -27,7 +27,7 @@ tests-single-ci:
|
||||
|
||||
tests-single-local:
|
||||
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi
|
||||
export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \
|
||||
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
|
||||
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
|
||||
&& run_tests . $(TEST_TARGET) "$(ONLY_TEST)"
|
||||
.PHONY: tests-single-local
|
||||
@@ -38,7 +38,7 @@ tests-single-local-docker:
|
||||
.PHONY: tests-single-local-docker
|
||||
|
||||
tests-all-local:
|
||||
export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \
|
||||
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
|
||||
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
|
||||
&& for TEST_TARGET in $$(./get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
|
||||
.PHONY: tests-all-local
|
||||
|
||||
@@ -1251,7 +1251,7 @@
|
||||
* 30 : 100kΩ Kis3d Silicone heating mat 200W/300W with 6mm precision cast plate (EN AW 5083) NTC100K - beta 3950
|
||||
* 60 : 100kΩ Maker's Tool Works Kapton Bed Thermistor - beta 3950
|
||||
* 61 : 100kΩ Formbot/Vivedino 350°C Thermistor - beta 3950
|
||||
* 66 : 4.7MΩ Dyze Design High Temperature Thermistor
|
||||
* 66 : 4.7MΩ Dyze Design / Trianglelab T-D500 500°C High Temperature Thermistor
|
||||
* 67 : 500kΩ SliceEngineering 450°C Thermistor
|
||||
* 68 : PT100 amplifier board from Dyze Design
|
||||
* 70 : 100kΩ bq Hephestos 2
|
||||
@@ -1273,6 +1273,7 @@
|
||||
* 110 : Pt100 with 1kΩ pullup (atypical)
|
||||
* 147 : Pt100 with 4.7kΩ pullup
|
||||
* 1010 : Pt1000 with 1kΩ pullup (atypical)
|
||||
* 1022 : Pt1000 with 2.2kΩ pullup
|
||||
* 1047 : Pt1000 with 4.7kΩ pullup (E3D)
|
||||
* 20 : Pt100 with circuit in the Ultimainboard V2.x with mainboard ADC reference voltage = INA826 amplifier-board supply voltage.
|
||||
* NOTE: (1) Must use an ADC input with no pullup. (2) Some INA826 amplifiers are unreliable at 3.3V so consider using sensor 147, 110, or 21.
|
||||
@@ -4532,6 +4533,7 @@
|
||||
//#define ANYCUBIC_LCD_CHIRON
|
||||
#if EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
|
||||
//#define ANYCUBIC_LCD_DEBUG
|
||||
//#define ANYCUBIC_LCD_GCODE_EXT // Add ".gcode" to menu entries for DGUS clone compatibility
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
+38
-37
@@ -1470,9 +1470,6 @@
|
||||
// On the Info Screen, display XY with one decimal place when possible
|
||||
//#define LCD_DECIMAL_SMALL_XY
|
||||
|
||||
// Add an 'M73' G-code to set the current percentage
|
||||
#define LCD_SET_PROGRESS_MANUALLY
|
||||
|
||||
// Show the E position (filament used) during printing
|
||||
//#define LCD_SHOW_E_TOTAL
|
||||
|
||||
@@ -1493,37 +1490,43 @@
|
||||
#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
|
||||
#endif
|
||||
#if ENABLED(NEO2_COLOR_PRESETS)
|
||||
#define NEO2_USER_PRESET_RED 255 // User defined RED value
|
||||
#define NEO2_USER_PRESET_GREEN 128 // User defined GREEN value
|
||||
#define NEO2_USER_PRESET_BLUE 0 // User defined BLUE value
|
||||
#define NEO2_USER_PRESET_WHITE 255 // User defined WHITE value
|
||||
#define NEO2_USER_PRESET_BRIGHTNESS 255 // User defined intensity
|
||||
//#define NEO2_USER_PRESET_STARTUP // Have the printer display the user preset color on startup for the second strip
|
||||
#define NEO2_USER_PRESET_RED 255 // User defined RED value
|
||||
#define NEO2_USER_PRESET_GREEN 128 // User defined GREEN value
|
||||
#define NEO2_USER_PRESET_BLUE 0 // User defined BLUE value
|
||||
#define NEO2_USER_PRESET_WHITE 255 // User defined WHITE value
|
||||
#define NEO2_USER_PRESET_BRIGHTNESS 255 // User defined intensity
|
||||
//#define NEO2_USER_PRESET_STARTUP // Have the printer display the user preset color on startup for the second strip
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // HAS_DISPLAY || DWIN_LCD_PROUI
|
||||
|
||||
// Add the G-code 'M73' to set / report the current job progress
|
||||
#define SET_PROGRESS_MANUALLY
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY)
|
||||
#define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done, otherwise use Marlin's estimate
|
||||
#define SET_REMAINING_TIME // Add 'R' parameter to set remaining time, otherwise use Marlin's estimate
|
||||
//#define SET_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction
|
||||
#if ENABLED(SET_INTERACTION_TIME)
|
||||
#define SHOW_INTERACTION_TIME // Display time until next user interaction ('C' = filament change)
|
||||
#endif
|
||||
//#define M73_REPORT // Report progress to host with 'M73'
|
||||
#endif
|
||||
|
||||
// LCD Print Progress options
|
||||
#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
|
||||
#if CAN_SHOW_REMAINING_TIME
|
||||
#define SHOW_REMAINING_TIME // Display estimated time to completion
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation
|
||||
//#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time
|
||||
#endif
|
||||
#endif
|
||||
// LCD Print Progress options, multiple can be rotated depending on screen layout
|
||||
#if HAS_DISPLAY && EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY)
|
||||
#define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar)
|
||||
#define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E')
|
||||
#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R')
|
||||
|
||||
#if EITHER(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI)
|
||||
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
|
||||
#endif
|
||||
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show/report progress with decimal digits, not all UIs support this
|
||||
|
||||
#if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
|
||||
#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
|
||||
#if ENABLED(LCD_PROGRESS_BAR)
|
||||
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
|
||||
#define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message
|
||||
#define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever)
|
||||
#define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever)
|
||||
//#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it
|
||||
//#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar
|
||||
#endif
|
||||
@@ -1902,14 +1905,8 @@
|
||||
#endif // HAS_GRAPHICAL_LCD
|
||||
|
||||
#if HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI
|
||||
// Show SD percentage next to the progress bar
|
||||
//#define SHOW_SD_PERCENT
|
||||
|
||||
// Enable to save many cycles by drawing a hollow frame on Menu Screens
|
||||
#define MENU_HOLLOW_FRAME
|
||||
|
||||
// Swap the CW/CCW indicators in the graphics overlay
|
||||
//#define OVERLAY_GFX_REVERSE
|
||||
#define MENU_HOLLOW_FRAME // Enable to save many cycles by drawing a hollow frame on Menu Screens
|
||||
//#define OVERLAY_GFX_REVERSE // Swap the CW/CCW indicators in the graphics overlay
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -2176,12 +2173,16 @@
|
||||
*/
|
||||
#define LIN_ADVANCE
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
//#define EXTRA_LIN_ADVANCE_K // Add a second linear advance constant, configurable with M900.
|
||||
#define LIN_ADVANCE_K 0.0 // Unit: mm compression per 1mm/s extruder speed
|
||||
//#define LA_DEBUG // Print debug information to serial during operation. Disable for production use.
|
||||
#define EXPERIMENTAL_SCURVE // Allow S-Curve Acceleration to be used with LA.
|
||||
#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
|
||||
//#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz.
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
#define ADVANCE_K { 0.0 } // (mm) Compression length per 1mm/s extruder speed, per extruder
|
||||
#else
|
||||
#define ADVANCE_K 0.0 // (mm) Compression length applying to all extruders
|
||||
#endif
|
||||
//#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L.
|
||||
//#define LA_DEBUG // Print debug information to serial during operation. Disable for production use.
|
||||
#define EXPERIMENTAL_SCURVE // Allow S-Curve Acceleration to be used with LA.
|
||||
#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
|
||||
//#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz.
|
||||
#endif
|
||||
|
||||
// @section leveling
|
||||
@@ -4262,7 +4263,7 @@
|
||||
|
||||
/**
|
||||
* Mechanical Gantry Calibration
|
||||
* Modern replacement for the Prusa TMC_Z_CALIBRATION.
|
||||
* Modern replacement for the Průša TMC_Z_CALIBRATION.
|
||||
* Adds capability to work with any adjustable current drivers.
|
||||
* Implemented as G34 because M915 is deprecated.
|
||||
* @section calibrate
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
#define STRING_DISTRIBUTION_DATE "2022-09-14"
|
||||
#define STRING_DISTRIBUTION_DATE "2022-10-16"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
|
||||
@@ -210,7 +210,7 @@ public:
|
||||
static void adc_init() {}
|
||||
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch) {}
|
||||
static void adc_enable(const uint8_t /*ch*/) {}
|
||||
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch) { adc_result = analogRead(ch); }
|
||||
|
||||
@@ -247,12 +247,12 @@
|
||||
b <<= 1; // little setup time
|
||||
|
||||
WRITE(SD_SCK_PIN, HIGH);
|
||||
DELAY_NS(spiDelayNS);
|
||||
DELAY_NS_VAR(spiDelayNS);
|
||||
|
||||
b |= (READ(SD_MISO_PIN) != 0);
|
||||
|
||||
WRITE(SD_SCK_PIN, LOW);
|
||||
DELAY_NS(spiDelayNS);
|
||||
DELAY_NS_VAR(spiDelayNS);
|
||||
} while (--bits);
|
||||
return b;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
practice, we need alignment to 256 bytes to make this work in all
|
||||
cases */
|
||||
__attribute__ ((aligned(256)))
|
||||
static DeviceVectors ram_tab = { nullptr };
|
||||
static DeviceVectors ram_tab[61] = { nullptr };
|
||||
|
||||
/**
|
||||
* This function checks if the exception/interrupt table is already in SRAM or not.
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0)
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < int8_t(NUMBER_PINS_TOTAL))
|
||||
#define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0))
|
||||
#define IS_ANALOG(P) WITHIN(P, char(analogInputToDigitalPin(0)), char(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
|
||||
#define pwm_status(pin) (((g_pinStatus[pin] & 0xF) == PIN_STATUS_PWM) && \
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
#
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
import platform
|
||||
current_OS = platform.system()
|
||||
import platform
|
||||
current_OS = platform.system()
|
||||
|
||||
if current_OS == 'Windows':
|
||||
if current_OS == 'Windows':
|
||||
|
||||
Import("env")
|
||||
Import("env")
|
||||
|
||||
# Use bossac.exe on Windows
|
||||
env.Replace(
|
||||
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
|
||||
)
|
||||
# Use bossac.exe on Windows
|
||||
env.Replace(
|
||||
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
|
||||
)
|
||||
|
||||
@@ -62,7 +62,7 @@ void usb_task_idle(void) {
|
||||
// Attend SD card access from the USB MSD -- Prioritize access to improve speed
|
||||
int delay = 2;
|
||||
while (main_b_msc_enable && --delay > 0) {
|
||||
if (udi_msc_process_trans()) delay = 10000;
|
||||
if (udi_msc_process_trans()) delay = 20;
|
||||
|
||||
// Reset the watchdog, just to be sure
|
||||
REG_WDT_CR = WDT_CR_WDRSTT | WDT_CR_KEY(0xA5);
|
||||
|
||||
@@ -73,7 +73,7 @@ if pioutil.is_pio_build():
|
||||
#
|
||||
import getpass
|
||||
user = getpass.getuser()
|
||||
mpath = Path('media', user)
|
||||
mpath = Path('/media', user)
|
||||
drives = [ x for x in mpath.iterdir() if x.is_dir() ]
|
||||
if target_drive in drives: # If target drive is found, use it.
|
||||
target_drive_found = True
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL)
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < int8_t(NUMBER_PINS_TOTAL))
|
||||
#define DIGITAL_PIN_TO_ANALOG_PIN(p) digitalPinToAnalogInput(p)
|
||||
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P)!=-1)
|
||||
#define pwm_status(pin) digitalPinHasPWM(pin)
|
||||
|
||||
@@ -102,17 +102,18 @@ const XrefInfo pin_xref[] PROGMEM = {
|
||||
#define PIN_NUM_ALPHA_LEFT(P) (((P & 0x000F) < 10) ? ('0' + (P & 0x000F)) : '1')
|
||||
#define PIN_NUM_ALPHA_RIGHT(P) (((P & 0x000F) > 9) ? ('0' + (P & 0x000F) - 10) : 0 )
|
||||
#define PORT_NUM(P) ((P >> 4) & 0x0007)
|
||||
#define PORT_ALPHA(P) ('A' + (P >> 4))
|
||||
#define PORT_ALPHA(P) ('A' + (P >> 4))
|
||||
|
||||
/**
|
||||
* Translation of routines & variables used by pinsDebug.h
|
||||
*/
|
||||
|
||||
#if PA0 >= NUM_DIGITAL_PINS
|
||||
#if NUM_ANALOG_FIRST >= NUM_DIGITAL_PINS
|
||||
#define HAS_HIGH_ANALOG_PINS 1
|
||||
#endif
|
||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS + TERN0(HAS_HIGH_ANALOG_PINS, NUM_ANALOG_INPUTS)
|
||||
#define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL)
|
||||
#define NUM_ANALOG_LAST ((NUM_ANALOG_FIRST) + (NUM_ANALOG_INPUTS) - 1)
|
||||
#define NUMBER_PINS_TOTAL ((NUM_DIGITAL_PINS) + TERN0(HAS_HIGH_ANALOG_PINS, NUM_ANALOG_INPUTS))
|
||||
#define VALID_PIN(P) (WITHIN(P, 0, (NUM_DIGITAL_PINS) - 1) || TERN0(HAS_HIGH_ANALOG_PINS, WITHIN(P, NUM_ANALOG_FIRST, NUM_ANALOG_LAST)))
|
||||
#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads
|
||||
#define PRINT_PIN(Q)
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
@@ -168,7 +169,7 @@ bool GET_PINMODE(const pin_t Ard_num) {
|
||||
}
|
||||
|
||||
int8_t digital_pin_to_analog_pin(const pin_t Ard_num) {
|
||||
if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_FIRST + NUM_ANALOG_INPUTS - 1))
|
||||
if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_LAST))
|
||||
return Ard_num - NUM_ANALOG_FIRST;
|
||||
|
||||
const uint32_t ind = digitalPinToAnalogInput(Ard_num);
|
||||
@@ -206,8 +207,11 @@ void port_print(const pin_t Ard_num) {
|
||||
SERIAL_ECHO_SP(7);
|
||||
|
||||
// Print number to be used with M42
|
||||
int calc_p = Ard_num % (NUM_DIGITAL_PINS + 1);
|
||||
if (Ard_num > NUM_DIGITAL_PINS && calc_p > 7) calc_p += 8;
|
||||
int calc_p = Ard_num;
|
||||
if (Ard_num > NUM_DIGITAL_PINS) {
|
||||
calc_p -= NUM_ANALOG_FIRST;
|
||||
if (calc_p > 7) calc_p += 8;
|
||||
}
|
||||
SERIAL_ECHOPGM(" M42 P", calc_p);
|
||||
SERIAL_CHAR(' ');
|
||||
if (calc_p < 100) {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0)
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < int8_t(NUMBER_PINS_TOTAL))
|
||||
#define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0))
|
||||
#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && (P) <= analogInputToDigitalPin(13)) || ((P) >= analogInputToDigitalPin(14) && (P) <= analogInputToDigitalPin(17))
|
||||
#define pwm_status(pin) HAL_pwm_status(pin)
|
||||
|
||||
@@ -347,7 +347,7 @@ void startOrResumeJob() {
|
||||
TERN_(GCODE_REPEAT_MARKERS, repeat.reset());
|
||||
TERN_(CANCEL_OBJECTS, cancelable.reset());
|
||||
TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator = 0);
|
||||
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
ui.reset_remaining_time();
|
||||
#endif
|
||||
}
|
||||
|
||||
+16
-14
@@ -355,20 +355,21 @@
|
||||
#define BOARD_CREALITY_V431_D 4051 // Creality v4.3.1d (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_CREALITY_V452 4052 // Creality v4.5.2 (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_CREALITY_V453 4053 // Creality v4.5.3 (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_CREALITY_V24S1 4054 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7
|
||||
#define BOARD_CREALITY_V24S1_301 4055 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1
|
||||
#define BOARD_CREALITY_V25S1 4056 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro
|
||||
#define BOARD_TRIGORILLA_PRO 4057 // Trigorilla Pro (STM32F103ZE)
|
||||
#define BOARD_FLY_MINI 4058 // FLYmaker FLY MINI (STM32F103RC)
|
||||
#define BOARD_FLSUN_HISPEED 4059 // FLSUN HiSpeedV1 (STM32F103VE)
|
||||
#define BOARD_BEAST 4060 // STM32F103RE Libmaple-based controller
|
||||
#define BOARD_MINGDA_MPX_ARM_MINI 4061 // STM32F103ZE Mingda MD-16
|
||||
#define BOARD_GTM32_PRO_VD 4062 // STM32F103VE controller
|
||||
#define BOARD_ZONESTAR_ZM3E2 4063 // Zonestar ZM3E2 (STM32F103RC)
|
||||
#define BOARD_ZONESTAR_ZM3E4 4064 // Zonestar ZM3E4 V1 (STM32F103VC)
|
||||
#define BOARD_ZONESTAR_ZM3E4V2 4065 // Zonestar ZM3E4 V2 (STM32F103VC)
|
||||
#define BOARD_ERYONE_ERY32_MINI 4066 // Eryone Ery32 mini (STM32F103VE)
|
||||
#define BOARD_PANDA_PI_V29 4067 // Panda Pi V2.9 - Standalone (STM32F103RC)
|
||||
#define BOARD_CREALITY_V521 4054 // Creality v5.2.1 (STM32F103VE) as found in the SV04
|
||||
#define BOARD_CREALITY_V24S1 4055 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7
|
||||
#define BOARD_CREALITY_V24S1_301 4056 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1
|
||||
#define BOARD_CREALITY_V25S1 4057 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro
|
||||
#define BOARD_TRIGORILLA_PRO 4058 // Trigorilla Pro (STM32F103ZE)
|
||||
#define BOARD_FLY_MINI 4059 // FLYmaker FLY MINI (STM32F103RC)
|
||||
#define BOARD_FLSUN_HISPEED 4060 // FLSUN HiSpeedV1 (STM32F103VE)
|
||||
#define BOARD_BEAST 4061 // STM32F103RE Libmaple-based controller
|
||||
#define BOARD_MINGDA_MPX_ARM_MINI 4062 // STM32F103ZE Mingda MD-16
|
||||
#define BOARD_GTM32_PRO_VD 4063 // STM32F103VE controller
|
||||
#define BOARD_ZONESTAR_ZM3E2 4064 // Zonestar ZM3E2 (STM32F103RC)
|
||||
#define BOARD_ZONESTAR_ZM3E4 4065 // Zonestar ZM3E4 V1 (STM32F103VC)
|
||||
#define BOARD_ZONESTAR_ZM3E4V2 4066 // Zonestar ZM3E4 V2 (STM32F103VC)
|
||||
#define BOARD_ERYONE_ERY32_MINI 4067 // Eryone Ery32 mini (STM32F103VE)
|
||||
#define BOARD_PANDA_PI_V29 4068 // Panda Pi V2.9 - Standalone (STM32F103RC)
|
||||
|
||||
//
|
||||
// ARM Cortex-M4F
|
||||
@@ -424,6 +425,7 @@
|
||||
#define BOARD_CREALITY_V24S1_301F4 4240 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4
|
||||
#define BOARD_OPULO_LUMEN_REV4 4241 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
|
||||
#define BOARD_FYSETC_SPIDER_KING407 4242 // FYSETC Spider King407 (STM32F407ZG)
|
||||
#define BOARD_MKS_SKIPR_V1 4243 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
|
||||
|
||||
//
|
||||
// ARM Cortex M7
|
||||
|
||||
@@ -338,6 +338,12 @@
|
||||
#define GANG_N_1(N,K) _GANG_N(N,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K)
|
||||
|
||||
// Macros for initializing arrays
|
||||
#define LIST_26(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
|
||||
#define LIST_25(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y
|
||||
#define LIST_24(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X
|
||||
#define LIST_23(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W
|
||||
#define LIST_22(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V
|
||||
#define LIST_21(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U
|
||||
#define LIST_20(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T
|
||||
#define LIST_19(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S
|
||||
#define LIST_18(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R
|
||||
@@ -732,6 +738,7 @@
|
||||
#define MAPLIST(OP,V...) EVAL(_MAPLIST(OP,V))
|
||||
|
||||
// Temperature Sensor Config
|
||||
#define _HAS_E_TEMP(N) || (TEMP_SENSOR_##N != 0)
|
||||
#define TEMP_SENSOR(N) TEMP_SENSOR_##N
|
||||
#define _HAS_E_TEMP(N) || TEMP_SENSOR(N)
|
||||
#define HAS_E_TEMP_SENSOR (0 REPEAT(EXTRUDERS, _HAS_E_TEMP))
|
||||
#define TEMP_SENSOR_IS_MAX_TC(T) (TEMP_SENSOR_##T == -5 || TEMP_SENSOR_##T == -3 || TEMP_SENSOR_##T == -2)
|
||||
#define TEMP_SENSOR_IS_MAX_TC(T) (TEMP_SENSOR(T) == -5 || TEMP_SENSOR(T) == -3 || TEMP_SENSOR(T) == -2)
|
||||
|
||||
+117
-117
@@ -99,8 +99,8 @@ struct Flags {
|
||||
void set(const int n) { b |= (bits_t)_BV(n); }
|
||||
void clear(const int n) { b &= ~(bits_t)_BV(n); }
|
||||
bool test(const int n) const { return TEST(b, n); }
|
||||
const bool operator[](const int n) { return test(n); }
|
||||
const bool operator[](const int n) const { return test(n); }
|
||||
bool operator[](const int n) { return test(n); }
|
||||
bool operator[](const int n) const { return test(n); }
|
||||
int size() const { return sizeof(b); }
|
||||
};
|
||||
|
||||
@@ -226,8 +226,8 @@ typedef const_float_t const_celsius_float_t;
|
||||
// Helpers
|
||||
#define _RECIP(N) ((N) ? 1.0f / static_cast<float>(N) : 0.0f)
|
||||
#define _ABS(N) ((N) < 0 ? -(N) : (N))
|
||||
#define _LS(N) (N = (T)(uint32_t(N) << v))
|
||||
#define _RS(N) (N = (T)(uint32_t(N) >> v))
|
||||
#define _LS(N) (N = (T)(uint32_t(N) << p))
|
||||
#define _RS(N) (N = (T)(uint32_t(N) >> p))
|
||||
#define FI FORCE_INLINE
|
||||
|
||||
// Forward declarations
|
||||
@@ -347,6 +347,10 @@ struct XYval {
|
||||
FI operator T* () { return pos; }
|
||||
// If any element is true then it's true
|
||||
FI operator bool() { return x || y; }
|
||||
// Smallest element
|
||||
FI T small() const { return _MIN(x, y); }
|
||||
// Largest element
|
||||
FI T large() const { return _MAX(x, y); }
|
||||
|
||||
// Explicit copy and copies with conversion
|
||||
FI XYval<T> copy() const { return *this; }
|
||||
@@ -405,18 +409,18 @@ struct XYval {
|
||||
FI XYval<T> operator* (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
|
||||
FI XYval<T> operator/ (const XYZEval<T> &rs) const { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
|
||||
FI XYval<T> operator/ (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
|
||||
FI XYval<T> operator* (const float &v) const { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
|
||||
FI XYval<T> operator* (const float &v) { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
|
||||
FI XYval<T> operator* (const int &v) const { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
|
||||
FI XYval<T> operator* (const int &v) { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
|
||||
FI XYval<T> operator/ (const float &v) const { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
|
||||
FI XYval<T> operator/ (const float &v) { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
|
||||
FI XYval<T> operator/ (const int &v) const { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
|
||||
FI XYval<T> operator/ (const int &v) { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
|
||||
FI XYval<T> operator>>(const int &v) const { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }
|
||||
FI XYval<T> operator>>(const int &v) { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }
|
||||
FI XYval<T> operator<<(const int &v) const { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
|
||||
FI XYval<T> operator<<(const int &v) { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
|
||||
FI XYval<T> operator* (const float &p) const { XYval<T> ls = *this; ls.x *= p; ls.y *= p; return ls; }
|
||||
FI XYval<T> operator* (const float &p) { XYval<T> ls = *this; ls.x *= p; ls.y *= p; return ls; }
|
||||
FI XYval<T> operator* (const int &p) const { XYval<T> ls = *this; ls.x *= p; ls.y *= p; return ls; }
|
||||
FI XYval<T> operator* (const int &p) { XYval<T> ls = *this; ls.x *= p; ls.y *= p; return ls; }
|
||||
FI XYval<T> operator/ (const float &p) const { XYval<T> ls = *this; ls.x /= p; ls.y /= p; return ls; }
|
||||
FI XYval<T> operator/ (const float &p) { XYval<T> ls = *this; ls.x /= p; ls.y /= p; return ls; }
|
||||
FI XYval<T> operator/ (const int &p) const { XYval<T> ls = *this; ls.x /= p; ls.y /= p; return ls; }
|
||||
FI XYval<T> operator/ (const int &p) { XYval<T> ls = *this; ls.x /= p; ls.y /= p; return ls; }
|
||||
FI XYval<T> operator>>(const int &p) const { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }
|
||||
FI XYval<T> operator>>(const int &p) { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }
|
||||
FI XYval<T> operator<<(const int &p) const { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
|
||||
FI XYval<T> operator<<(const int &p) { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
|
||||
FI const XYval<T> operator-() const { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }
|
||||
FI XYval<T> operator-() { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }
|
||||
|
||||
@@ -430,21 +434,15 @@ struct XYval {
|
||||
FI XYval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; return *this; }
|
||||
FI XYval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
|
||||
FI XYval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
|
||||
FI XYval<T>& operator*=(const float &v) { x *= v; y *= v; return *this; }
|
||||
FI XYval<T>& operator*=(const int &v) { x *= v; y *= v; return *this; }
|
||||
FI XYval<T>& operator>>=(const int &v) { _RS(x); _RS(y); return *this; }
|
||||
FI XYval<T>& operator<<=(const int &v) { _LS(x); _LS(y); return *this; }
|
||||
FI XYval<T>& operator*=(const float &p) { x *= p; y *= p; return *this; }
|
||||
FI XYval<T>& operator*=(const int &p) { x *= p; y *= p; return *this; }
|
||||
FI XYval<T>& operator>>=(const int &p) { _RS(x); _RS(y); return *this; }
|
||||
FI XYval<T>& operator<<=(const int &p) { _LS(x); _LS(y); return *this; }
|
||||
|
||||
// Exact comparisons. For floats a "NEAR" operation may be better.
|
||||
FI bool operator==(const XYval<T> &rs) { return x == rs.x && y == rs.y; }
|
||||
FI bool operator==(const XYZval<T> &rs) { return x == rs.x && y == rs.y; }
|
||||
FI bool operator==(const XYZEval<T> &rs) { return x == rs.x && y == rs.y; }
|
||||
FI bool operator==(const XYval<T> &rs) const { return x == rs.x && y == rs.y; }
|
||||
FI bool operator==(const XYZval<T> &rs) const { return x == rs.x && y == rs.y; }
|
||||
FI bool operator==(const XYZEval<T> &rs) const { return x == rs.x && y == rs.y; }
|
||||
FI bool operator!=(const XYval<T> &rs) { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZval<T> &rs) { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZEval<T> &rs) { return !operator==(rs); }
|
||||
FI bool operator!=(const XYval<T> &rs) const { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
|
||||
@@ -494,10 +492,10 @@ struct XYZval {
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; }
|
||||
#endif
|
||||
#if HAS_V_AXIS
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pm) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; }
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pu) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; }
|
||||
#endif
|
||||
#if HAS_W_AXIS
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pm, const T po) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; v = pv; }
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pu, const T pv) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; v = pv; }
|
||||
#endif
|
||||
|
||||
// Length reduced to one dimension
|
||||
@@ -506,6 +504,10 @@ struct XYZval {
|
||||
FI operator T* () { return pos; }
|
||||
// If any element is true then it's true
|
||||
FI operator bool() { return NUM_AXIS_GANG(x, || y, || z, || i, || j, || k, || u, || v, || w); }
|
||||
// Smallest element
|
||||
FI T small() const { return _MIN(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)); }
|
||||
// Largest element
|
||||
FI T large() const { return _MAX(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)); }
|
||||
|
||||
// Explicit copy and copies with conversion
|
||||
FI XYZval<T> copy() const { XYZval<T> o = *this; return o; }
|
||||
@@ -565,18 +567,18 @@ struct XYZval {
|
||||
FI XYZval<T> operator* (const XYZEval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
|
||||
FI XYZval<T> operator/ (const XYZEval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZval<T> operator/ (const XYZEval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZval<T> operator* (const float &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
|
||||
FI XYZval<T> operator* (const float &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
|
||||
FI XYZval<T> operator* (const int &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
|
||||
FI XYZval<T> operator* (const int &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
|
||||
FI XYZval<T> operator/ (const float &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
|
||||
FI XYZval<T> operator/ (const float &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
|
||||
FI XYZval<T> operator/ (const int &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
|
||||
FI XYZval<T> operator/ (const int &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
|
||||
FI XYZval<T> operator>>(const int &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
|
||||
FI XYZval<T> operator>>(const int &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
|
||||
FI XYZval<T> operator<<(const int &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
|
||||
FI XYZval<T> operator<<(const int &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
|
||||
FI XYZval<T> operator* (const float &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; }
|
||||
FI XYZval<T> operator* (const float &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; }
|
||||
FI XYZval<T> operator* (const int &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; }
|
||||
FI XYZval<T> operator* (const int &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; }
|
||||
FI XYZval<T> operator/ (const float &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; }
|
||||
FI XYZval<T> operator/ (const float &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; }
|
||||
FI XYZval<T> operator/ (const int &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; }
|
||||
FI XYZval<T> operator/ (const int &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; }
|
||||
FI XYZval<T> operator>>(const int &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
|
||||
FI XYZval<T> operator>>(const int &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
|
||||
FI XYZval<T> operator<<(const int &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
|
||||
FI XYZval<T> operator<<(const int &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
|
||||
FI const XYZval<T> operator-() const { XYZval<T> o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; }
|
||||
FI XYZval<T> operator-() { XYZval<T> o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; }
|
||||
|
||||
@@ -593,15 +595,13 @@ struct XYZval {
|
||||
FI XYZval<T>& operator-=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
|
||||
FI XYZval<T>& operator*=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
|
||||
FI XYZval<T>& operator/=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; }
|
||||
FI XYZval<T>& operator*=(const float &v) { NUM_AXIS_CODE(x *= v, y *= v, z *= v, i *= v, j *= v, k *= v, u *= v, v *= v, w *= v); return *this; }
|
||||
FI XYZval<T>& operator*=(const int &v) { NUM_AXIS_CODE(x *= v, y *= v, z *= v, i *= v, j *= v, k *= v, u *= v, v *= v, w *= v); return *this; }
|
||||
FI XYZval<T>& operator>>=(const int &v) { NUM_AXIS_CODE(_RS(x), _RS(y), _RS(z), _RS(i), _RS(j), _RS(k), _RS(u), _RS(v), _RS(w)); return *this; }
|
||||
FI XYZval<T>& operator<<=(const int &v) { NUM_AXIS_CODE(_LS(x), _LS(y), _LS(z), _LS(i), _LS(j), _LS(k), _LS(u), _LS(v), _LS(w)); return *this; }
|
||||
FI XYZval<T>& operator*=(const float &p) { NUM_AXIS_CODE(x *= p, y *= p, z *= p, i *= p, j *= p, k *= p, u *= p, v *= p, w *= p); return *this; }
|
||||
FI XYZval<T>& operator*=(const int &p) { NUM_AXIS_CODE(x *= p, y *= p, z *= p, i *= p, j *= p, k *= p, u *= p, v *= p, w *= p); return *this; }
|
||||
FI XYZval<T>& operator>>=(const int &p) { NUM_AXIS_CODE(_RS(x), _RS(y), _RS(z), _RS(i), _RS(j), _RS(k), _RS(u), _RS(v), _RS(w)); return *this; }
|
||||
FI XYZval<T>& operator<<=(const int &p) { NUM_AXIS_CODE(_LS(x), _LS(y), _LS(z), _LS(i), _LS(j), _LS(k), _LS(u), _LS(v), _LS(w)); return *this; }
|
||||
|
||||
// Exact comparisons. For floats a "NEAR" operation may be better.
|
||||
FI bool operator==(const XYZEval<T> &rs) { return true NUM_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
|
||||
FI bool operator==(const XYZEval<T> &rs) const { return true NUM_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
|
||||
FI bool operator!=(const XYZEval<T> &rs) { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
|
||||
};
|
||||
|
||||
@@ -634,10 +634,10 @@ struct XYZEval {
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; }
|
||||
#endif
|
||||
#if HAS_V_AXIS
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pm) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; }
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pu) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; }
|
||||
#endif
|
||||
#if HAS_W_AXIS
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pm, const T po) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pm; v = pv; }
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pu, const T pv) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; v = pv; }
|
||||
#endif
|
||||
|
||||
// Setters taking struct types and arrays
|
||||
@@ -654,11 +654,15 @@ struct XYZEval {
|
||||
#endif
|
||||
|
||||
// Length reduced to one dimension
|
||||
FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); }
|
||||
FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); }
|
||||
// Pointer to the data as a simple array
|
||||
FI operator T* () { return pos; }
|
||||
FI operator T* () { return pos; }
|
||||
// If any element is true then it's true
|
||||
FI operator bool() { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); }
|
||||
FI operator bool() { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); }
|
||||
// Smallest element
|
||||
FI T small() const { return _MIN(LOGICAL_AXIS_LIST(e, x, y, z, i, j, k, u, v, w)); }
|
||||
// Largest element
|
||||
FI T large() const { return _MAX(LOGICAL_AXIS_LIST(e, x, y, z, i, j, k, u, v, w)); }
|
||||
|
||||
// Explicit copy and copies with conversion
|
||||
FI XYZEval<T> copy() const { XYZEval<T> v = *this; return v; }
|
||||
@@ -684,80 +688,76 @@ struct XYZEval {
|
||||
FI operator const XYZval<T>&() const { return *(const XYZval<T>*)this; }
|
||||
|
||||
// Accessor via an AxisEnum (or any integer) [index]
|
||||
FI T& operator[](const int n) { return pos[n]; }
|
||||
FI const T& operator[](const int n) const { return pos[n]; }
|
||||
FI T& operator[](const int n) { return pos[n]; }
|
||||
FI const T& operator[](const int n) const { return pos[n]; }
|
||||
|
||||
// Assignment operator overrides do the expected thing
|
||||
FI XYZEval<T>& operator= (const T v) { set(LOGICAL_AXIS_LIST_1(v)); return *this; }
|
||||
FI XYZEval<T>& operator= (const XYval<T> &rs) { set(rs.x, rs.y); return *this; }
|
||||
FI XYZEval<T>& operator= (const XYZval<T> &rs) { set(NUM_AXIS_ELEM(rs)); return *this; }
|
||||
FI XYZEval<T>& operator= (const T v) { set(LOGICAL_AXIS_LIST_1(v)); return *this; }
|
||||
FI XYZEval<T>& operator= (const XYval<T> &rs) { set(rs.x, rs.y); return *this; }
|
||||
FI XYZEval<T>& operator= (const XYZval<T> &rs) { set(NUM_AXIS_ELEM(rs)); return *this; }
|
||||
|
||||
// Override other operators to get intuitive behaviors
|
||||
FI XYZEval<T> operator+ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
|
||||
FI XYZEval<T> operator+ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
|
||||
FI XYZEval<T> operator- (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
|
||||
FI XYZEval<T> operator- (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
|
||||
FI XYZEval<T> operator* (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
|
||||
FI XYZEval<T> operator* (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
|
||||
FI XYZEval<T> operator/ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
|
||||
FI XYZEval<T> operator/ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e += rs.e, ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e += rs.e, ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e -= rs.e, ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e -= rs.e, ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= rs.e, ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= rs.e, ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= rs.e, ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= rs.e, ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const float &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= v, ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
|
||||
FI XYZEval<T> operator* (const float &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= v, ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
|
||||
FI XYZEval<T> operator* (const int &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= v, ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
|
||||
FI XYZEval<T> operator* (const int &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= v, ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
|
||||
FI XYZEval<T> operator/ (const float &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= v, ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
|
||||
FI XYZEval<T> operator/ (const float &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= v, ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
|
||||
FI XYZEval<T> operator/ (const int &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= v, ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
|
||||
FI XYZEval<T> operator/ (const int &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= v, ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
|
||||
FI XYZEval<T> operator>>(const int &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_RS(ls.e), _RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
|
||||
FI XYZEval<T> operator>>(const int &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_RS(ls.e), _RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
|
||||
FI XYZEval<T> operator<<(const int &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_LS(ls.e), _LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
|
||||
FI XYZEval<T> operator<<(const int &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_LS(ls.e), _LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
|
||||
FI const XYZEval<T> operator-() const { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); }
|
||||
FI XYZEval<T> operator-() { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); }
|
||||
FI XYZEval<T> operator+ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
|
||||
FI XYZEval<T> operator+ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
|
||||
FI XYZEval<T> operator- (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
|
||||
FI XYZEval<T> operator- (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
|
||||
FI XYZEval<T> operator* (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
|
||||
FI XYZEval<T> operator* (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
|
||||
FI XYZEval<T> operator/ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
|
||||
FI XYZEval<T> operator/ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e += rs.e, ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e += rs.e, ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e -= rs.e, ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e -= rs.e, ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= rs.e, ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= rs.e, ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= rs.e, ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= rs.e, ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
|
||||
FI XYZEval<T> operator* (const float &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= p, ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; }
|
||||
FI XYZEval<T> operator* (const float &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= p, ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; }
|
||||
FI XYZEval<T> operator* (const int &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= p, ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; }
|
||||
FI XYZEval<T> operator* (const int &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= p, ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; }
|
||||
FI XYZEval<T> operator/ (const float &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= p, ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; }
|
||||
FI XYZEval<T> operator/ (const float &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= p, ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; }
|
||||
FI XYZEval<T> operator/ (const int &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= p, ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; }
|
||||
FI XYZEval<T> operator/ (const int &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= p, ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; }
|
||||
FI XYZEval<T> operator>>(const int &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_RS(ls.e), _RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
|
||||
FI XYZEval<T> operator>>(const int &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_RS(ls.e), _RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
|
||||
FI XYZEval<T> operator<<(const int &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_LS(ls.e), _LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
|
||||
FI XYZEval<T> operator<<(const int &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_LS(ls.e), _LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
|
||||
FI const XYZEval<T> operator-() const { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); }
|
||||
FI XYZEval<T> operator-() { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); }
|
||||
|
||||
// Modifier operators
|
||||
FI XYZEval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
|
||||
FI XYZEval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
|
||||
FI XYZEval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
|
||||
FI XYZEval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
|
||||
FI XYZEval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
|
||||
FI XYZEval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator/=(const XYZval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator+=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e += rs.e, x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
|
||||
FI XYZEval<T>& operator-=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e -= rs.e, x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator*=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e *= rs.e, x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator/=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e /= rs.e, x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator*=(const T &v) { LOGICAL_AXIS_CODE(e *= v, x *= v, y *= v, z *= v, i *= v, j *= v, k *= v, u *= v, v *= v, w *= v); return *this; }
|
||||
FI XYZEval<T>& operator>>=(const int &v) { LOGICAL_AXIS_CODE(_RS(e), _RS(x), _RS(y), _RS(z), _RS(i), _RS(j), _RS(k), _RS(u), _RS(v), _RS(w)); return *this; }
|
||||
FI XYZEval<T>& operator<<=(const int &v) { LOGICAL_AXIS_CODE(_LS(e), _LS(x), _LS(y), _LS(z), _LS(i), _LS(j), _LS(k), _LS(u), _LS(v), _LS(w)); return *this; }
|
||||
FI XYZEval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
|
||||
FI XYZEval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
|
||||
FI XYZEval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
|
||||
FI XYZEval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
|
||||
FI XYZEval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
|
||||
FI XYZEval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator/=(const XYZval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator+=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e += rs.e, x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
|
||||
FI XYZEval<T>& operator-=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e -= rs.e, x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator*=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e *= rs.e, x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator/=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e /= rs.e, x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; }
|
||||
FI XYZEval<T>& operator*=(const T &p) { LOGICAL_AXIS_CODE(e *= p, x *= p, y *= p, z *= p, i *= p, j *= p, k *= p, u *= p, v *= p, w *= p); return *this; }
|
||||
FI XYZEval<T>& operator>>=(const int &p) { LOGICAL_AXIS_CODE(_RS(e), _RS(x), _RS(y), _RS(z), _RS(i), _RS(j), _RS(k), _RS(u), _RS(v), _RS(w)); return *this; }
|
||||
FI XYZEval<T>& operator<<=(const int &p) { LOGICAL_AXIS_CODE(_LS(e), _LS(x), _LS(y), _LS(z), _LS(i), _LS(j), _LS(k), _LS(u), _LS(v), _LS(w)); return *this; }
|
||||
|
||||
// Exact comparisons. For floats a "NEAR" operation may be better.
|
||||
FI bool operator==(const XYZval<T> &rs) { return true NUM_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
|
||||
FI bool operator==(const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
|
||||
FI bool operator==(const XYZEval<T> &rs) { return true LOGICAL_AXIS_GANG(&& e == rs.e, && x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
|
||||
FI bool operator==(const XYZEval<T> &rs) const { return true LOGICAL_AXIS_GANG(&& e == rs.e, && x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
|
||||
FI bool operator!=(const XYZval<T> &rs) { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZEval<T> &rs) { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
|
||||
FI bool operator==(const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
|
||||
FI bool operator==(const XYZEval<T> &rs) const { return true LOGICAL_AXIS_GANG(&& e == rs.e, && x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
|
||||
FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
|
||||
};
|
||||
|
||||
#undef _RECIP
|
||||
|
||||
@@ -75,9 +75,9 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) {
|
||||
planner.synchronize();
|
||||
|
||||
// Get the corrected leveled / unleveled position
|
||||
planner.apply_modifiers(current_position); // Physical position with all modifiers
|
||||
planner.leveling_active ^= true; // Toggle leveling between apply and unapply
|
||||
planner.unapply_modifiers(current_position); // Logical position with modifiers removed
|
||||
planner.apply_modifiers(current_position, true); // Physical position with all modifiers
|
||||
planner.leveling_active ^= true; // Toggle leveling between apply and unapply
|
||||
planner.unapply_modifiers(current_position, true); // Logical position with modifiers removed
|
||||
|
||||
sync_plan_position();
|
||||
_report_leveling();
|
||||
|
||||
@@ -407,7 +407,7 @@ void unified_bed_leveling::G29() {
|
||||
z_values[x][x2] += 9.999f; // We want the altered line several mesh points thick
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMeshUpdate(x, x, z_values[x][x]);
|
||||
ExtUI::onMeshUpdate(x, (x2), z_values[x][x2]);
|
||||
ExtUI::onMeshUpdate(x, x2, z_values[x][x2]);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
// Static data members
|
||||
bool EmergencyParser::killed_by_M112, // = false
|
||||
EmergencyParser::quickstop_by_M410,
|
||||
#if ENABLED(SDSUPPORT)
|
||||
EmergencyParser::sd_abort_by_M524,
|
||||
#endif
|
||||
EmergencyParser::enabled;
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
|
||||
@@ -49,7 +49,7 @@ class EmergencyParser {
|
||||
|
||||
public:
|
||||
|
||||
// Currently looking for: M108, M112, M410, M876 S[0-9], S000, P000, R000
|
||||
// Currently looking for: M108, M112, M410, M524, M876 S[0-9], S000, P000, R000
|
||||
enum State : uint8_t {
|
||||
EP_RESET,
|
||||
EP_N,
|
||||
@@ -58,6 +58,9 @@ public:
|
||||
EP_M10, EP_M108,
|
||||
EP_M11, EP_M112,
|
||||
EP_M4, EP_M41, EP_M410,
|
||||
#if ENABLED(SDSUPPORT)
|
||||
EP_M5, EP_M52, EP_M524,
|
||||
#endif
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
EP_M8, EP_M87, EP_M876, EP_M876S, EP_M876SN,
|
||||
#endif
|
||||
@@ -76,6 +79,10 @@ public:
|
||||
static bool killed_by_M112;
|
||||
static bool quickstop_by_M410;
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
static bool sd_abort_by_M524;
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
static uint8_t M876_reason;
|
||||
#endif
|
||||
@@ -145,6 +152,9 @@ public:
|
||||
case ' ': break;
|
||||
case '1': state = EP_M1; break;
|
||||
case '4': state = EP_M4; break;
|
||||
#if ENABLED(SDSUPPORT)
|
||||
case '5': state = EP_M5; break;
|
||||
#endif
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
case '8': state = EP_M8; break;
|
||||
#endif
|
||||
@@ -165,6 +175,11 @@ public:
|
||||
case EP_M4: state = (c == '1') ? EP_M41 : EP_IGNORE; break;
|
||||
case EP_M41: state = (c == '0') ? EP_M410 : EP_IGNORE; break;
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
case EP_M5: state = (c == '2') ? EP_M52 : EP_IGNORE; break;
|
||||
case EP_M52: state = (c == '4') ? EP_M524 : EP_IGNORE; break;
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
|
||||
case EP_M8: state = (c == '7') ? EP_M87 : EP_IGNORE; break;
|
||||
@@ -200,6 +215,9 @@ public:
|
||||
case EP_M108: wait_for_user = wait_for_heatup = false; break;
|
||||
case EP_M112: killed_by_M112 = true; break;
|
||||
case EP_M410: quickstop_by_M410 = true; break;
|
||||
#if ENABLED(SDSUPPORT)
|
||||
case EP_M524: sd_abort_by_M524 = true; break;
|
||||
#endif
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
case EP_M876SN: hostui.handle_response(M876_reason); break;
|
||||
#endif
|
||||
|
||||
@@ -111,20 +111,29 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
|
||||
if (eol) SERIAL_EOL();
|
||||
}
|
||||
|
||||
void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) {
|
||||
void HostUI::prompt_plus(const bool pgm, FSTR_P const ptype, const char * const str, const char extra_char/*='\0'*/) {
|
||||
prompt(ptype, false);
|
||||
PORT_REDIRECT(SerialMask::All);
|
||||
SERIAL_CHAR(' ');
|
||||
SERIAL_ECHOF(fstr);
|
||||
if (pgm)
|
||||
SERIAL_ECHOPGM_P(str);
|
||||
else
|
||||
SERIAL_ECHO(str);
|
||||
if (extra_char != '\0') SERIAL_CHAR(extra_char);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
|
||||
prompt_end();
|
||||
host_prompt_reason = reason;
|
||||
prompt_plus(F("begin"), fstr, extra_char);
|
||||
}
|
||||
void HostUI::prompt_button(FSTR_P const fstr) { prompt_plus(F("button"), fstr); }
|
||||
void HostUI::prompt_begin(const PromptReason reason, const char * const cstr, const char extra_char/*='\0'*/) {
|
||||
prompt_end();
|
||||
host_prompt_reason = reason;
|
||||
prompt_plus(F("begin"), cstr, extra_char);
|
||||
}
|
||||
|
||||
void HostUI::prompt_end() { prompt(F("end")); }
|
||||
void HostUI::prompt_show() { prompt(F("show")); }
|
||||
|
||||
@@ -133,14 +142,26 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
|
||||
if (btn2) prompt_button(btn2);
|
||||
prompt_show();
|
||||
}
|
||||
|
||||
void HostUI::prompt_button(FSTR_P const fstr) { prompt_plus(F("button"), fstr); }
|
||||
void HostUI::prompt_button(const char * const cstr) { prompt_plus(F("button"), cstr); }
|
||||
|
||||
void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
|
||||
prompt_begin(reason, fstr);
|
||||
_prompt_show(btn1, btn2);
|
||||
}
|
||||
void HostUI::prompt_do(const PromptReason reason, const char * const cstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
|
||||
prompt_begin(reason, cstr);
|
||||
_prompt_show(btn1, btn2);
|
||||
}
|
||||
void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
|
||||
prompt_begin(reason, fstr, extra_char);
|
||||
_prompt_show(btn1, btn2);
|
||||
}
|
||||
void HostUI::prompt_do(const PromptReason reason, const char * const cstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
|
||||
prompt_begin(reason, cstr, extra_char);
|
||||
_prompt_show(btn1, btn2);
|
||||
}
|
||||
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
void HostUI::filament_load_prompt() {
|
||||
|
||||
@@ -79,7 +79,14 @@ class HostUI {
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
private:
|
||||
static void prompt(FSTR_P const ptype, const bool eol=true);
|
||||
static void prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0');
|
||||
static void prompt_plus(const bool pgm, FSTR_P const ptype, const char * const str, const char extra_char='\0');
|
||||
static void prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0') {
|
||||
prompt_plus(true, ptype, FTOP(fstr), extra_char);
|
||||
}
|
||||
static void prompt_plus(FSTR_P const ptype, const char * const cstr, const char extra_char='\0') {
|
||||
prompt_plus(false, ptype, cstr, extra_char);
|
||||
}
|
||||
|
||||
static void prompt_show();
|
||||
static void _prompt_show(FSTR_P const btn1, FSTR_P const btn2);
|
||||
|
||||
@@ -93,10 +100,17 @@ class HostUI {
|
||||
static void notify(const char * const message);
|
||||
|
||||
static void prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
|
||||
static void prompt_button(FSTR_P const fstr);
|
||||
static void prompt_begin(const PromptReason reason, const char * const cstr, const char extra_char='\0');
|
||||
static void prompt_end();
|
||||
|
||||
static void prompt_button(FSTR_P const fstr);
|
||||
static void prompt_button(const char * const cstr);
|
||||
|
||||
static void prompt_do(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
|
||||
static void prompt_do(const PromptReason reason, const char * const cstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
|
||||
static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
|
||||
static void prompt_do(const PromptReason reason, const char * const cstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
|
||||
|
||||
static void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
|
||||
if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ MMU2 mmu2;
|
||||
#define MMU_CMD_TIMEOUT 45000UL // 45s timeout for mmu commands (except P0)
|
||||
#define MMU_P0_TIMEOUT 3000UL // Timeout for P0 command: 3seconds
|
||||
|
||||
#define MMU2_COMMAND(S) tx_str(F(S "\n"))
|
||||
#define MMU2_SEND(S) tx_str(F(S "\n"))
|
||||
#define MMU2_RECV(S) rx_str(F(S "\n"))
|
||||
|
||||
#if ENABLED(MMU_EXTRUDER_SENSOR)
|
||||
uint8_t mmu_idl_sens = 0;
|
||||
@@ -131,7 +132,7 @@ void MMU2::reset() {
|
||||
safe_delay(20);
|
||||
WRITE(MMU2_RST_PIN, HIGH);
|
||||
#else
|
||||
MMU2_COMMAND("X0"); // Send soft reset
|
||||
MMU2_SEND("X0"); // Send soft reset
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -157,11 +158,9 @@ void MMU2::mmu_loop() {
|
||||
case -1:
|
||||
if (rx_start()) {
|
||||
prev_P0_request = millis(); // Initialize finda sensor timeout
|
||||
|
||||
DEBUG_ECHOLNPGM("MMU => 'start'");
|
||||
DEBUG_ECHOLNPGM("MMU <= 'S1'");
|
||||
|
||||
MMU2_COMMAND("S1"); // Read Version
|
||||
MMU2_SEND("S1"); // Read Version
|
||||
state = -2;
|
||||
}
|
||||
else if (millis() > 30000) { // 30sec after reset disable MMU
|
||||
@@ -173,10 +172,8 @@ void MMU2::mmu_loop() {
|
||||
case -2:
|
||||
if (rx_ok()) {
|
||||
sscanf(rx_buffer, "%huok\n", &version);
|
||||
|
||||
DEBUG_ECHOLNPGM("MMU => ", version, "\nMMU <= 'S2'");
|
||||
|
||||
MMU2_COMMAND("S2"); // Read Build Number
|
||||
MMU2_SEND("S2"); // Read Build Number
|
||||
state = -3;
|
||||
}
|
||||
break;
|
||||
@@ -191,14 +188,12 @@ void MMU2::mmu_loop() {
|
||||
|
||||
#if ENABLED(MMU2_MODE_12V)
|
||||
DEBUG_ECHOLNPGM("MMU <= 'M1'");
|
||||
|
||||
MMU2_COMMAND("M1"); // Stealth Mode
|
||||
MMU2_SEND("M1"); // Stealth Mode
|
||||
state = -5;
|
||||
|
||||
#else
|
||||
DEBUG_ECHOLNPGM("MMU <= 'P0'");
|
||||
|
||||
MMU2_COMMAND("P0"); // Read FINDA
|
||||
MMU2_SEND("P0"); // Read FINDA
|
||||
state = -4;
|
||||
#endif
|
||||
}
|
||||
@@ -209,10 +204,8 @@ void MMU2::mmu_loop() {
|
||||
// response to M1
|
||||
if (rx_ok()) {
|
||||
DEBUG_ECHOLNPGM("MMU => ok");
|
||||
|
||||
DEBUG_ECHOLNPGM("MMU <= 'P0'");
|
||||
|
||||
MMU2_COMMAND("P0"); // Read FINDA
|
||||
MMU2_SEND("P0"); // Read FINDA
|
||||
state = -4;
|
||||
}
|
||||
break;
|
||||
@@ -250,14 +243,13 @@ void MMU2::mmu_loop() {
|
||||
else if (cmd == MMU_CMD_C0) {
|
||||
// continue loading
|
||||
DEBUG_ECHOLNPGM("MMU <= 'C0'");
|
||||
MMU2_COMMAND("C0");
|
||||
MMU2_SEND("C0");
|
||||
state = 3; // wait for response
|
||||
}
|
||||
else if (cmd == MMU_CMD_U0) {
|
||||
// unload current
|
||||
DEBUG_ECHOLNPGM("MMU <= 'U0'");
|
||||
|
||||
MMU2_COMMAND("U0");
|
||||
MMU2_SEND("U0");
|
||||
state = 3; // wait for response
|
||||
}
|
||||
else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E0 + EXTRUDERS - 1)) {
|
||||
@@ -270,7 +262,7 @@ void MMU2::mmu_loop() {
|
||||
else if (cmd == MMU_CMD_R0) {
|
||||
// recover after eject
|
||||
DEBUG_ECHOLNPGM("MMU <= 'R0'");
|
||||
MMU2_COMMAND("R0");
|
||||
MMU2_SEND("R0");
|
||||
state = 3; // wait for response
|
||||
}
|
||||
else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F0 + EXTRUDERS - 1)) {
|
||||
@@ -285,7 +277,7 @@ void MMU2::mmu_loop() {
|
||||
cmd = MMU_CMD_NONE;
|
||||
}
|
||||
else if (ELAPSED(millis(), prev_P0_request + 300)) {
|
||||
MMU2_COMMAND("P0"); // Read FINDA
|
||||
MMU2_SEND("P0"); // Read FINDA
|
||||
state = 2; // wait for response
|
||||
}
|
||||
|
||||
@@ -314,7 +306,7 @@ void MMU2::mmu_loop() {
|
||||
if (mmu_idl_sens) {
|
||||
if (FILAMENT_PRESENT() && mmu_loading_flag) {
|
||||
DEBUG_ECHOLNPGM("MMU <= 'A'");
|
||||
MMU2_COMMAND("A"); // send 'abort' request
|
||||
MMU2_SEND("A"); // send 'abort' request
|
||||
mmu_idl_sens = 0;
|
||||
DEBUG_ECHOLNPGM("MMU IDLER_SENSOR = 0 - ABORT");
|
||||
}
|
||||
@@ -327,9 +319,9 @@ void MMU2::mmu_loop() {
|
||||
const bool keep_trying = !mmu2s_triggered && last_cmd == MMU_CMD_C0;
|
||||
if (keep_trying) {
|
||||
// MMU ok received but filament sensor not triggered, retrying...
|
||||
DEBUG_ECHOLNPGM("MMU => 'ok' (filament not present in gears)");
|
||||
DEBUG_ECHOLNPGM("MMU => 'ok' (no filament in gears)");
|
||||
DEBUG_ECHOLNPGM("MMU <= 'C0' (keep trying)");
|
||||
MMU2_COMMAND("C0");
|
||||
MMU2_SEND("C0");
|
||||
}
|
||||
#else
|
||||
constexpr bool keep_trying = false;
|
||||
@@ -361,7 +353,7 @@ void MMU2::mmu_loop() {
|
||||
*/
|
||||
bool MMU2::rx_start() {
|
||||
// check for start message
|
||||
return rx_str(F("start\n"));
|
||||
return MMU2_RECV("start");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -440,7 +432,7 @@ void MMU2::clear_rx_buffer() {
|
||||
* Check if we received 'ok' from MMU
|
||||
*/
|
||||
bool MMU2::rx_ok() {
|
||||
if (rx_str(F("ok\n"))) {
|
||||
if (MMU2_RECV("ok")) {
|
||||
prev_P0_request = millis();
|
||||
return true;
|
||||
}
|
||||
@@ -585,7 +577,7 @@ static void mmu2_not_responding() {
|
||||
command(MMU_CMD_T0 + index);
|
||||
manage_response(true, true);
|
||||
mmu_continue_loading();
|
||||
command(MMU_CMD_C0);
|
||||
//command(MMU_CMD_C0);
|
||||
extruder = index;
|
||||
active_extruder = 0;
|
||||
|
||||
@@ -653,13 +645,34 @@ static void mmu2_not_responding() {
|
||||
}
|
||||
|
||||
void MMU2::mmu_continue_loading() {
|
||||
// Try to load the filament a limited number of times
|
||||
bool fil_present = 0;
|
||||
for (uint8_t i = 0; i < MMU_LOADING_ATTEMPTS_NR; i++) {
|
||||
DEBUG_ECHOLNPGM("Additional load attempt #", i);
|
||||
if (FILAMENT_PRESENT()) break;
|
||||
DEBUG_ECHOLNPGM("Load attempt #", i + 1);
|
||||
|
||||
// Done as soon as filament is present
|
||||
fil_present = FILAMENT_PRESENT();
|
||||
if (fil_present) break;
|
||||
|
||||
// Attempt to load the filament, 1mm at a time, for 3s
|
||||
command(MMU_CMD_C0);
|
||||
stepper.enable_extruder();
|
||||
const millis_t expire_ms = millis() + 3000;
|
||||
do {
|
||||
current_position.e += 1;
|
||||
line_to_current_position(MMU_LOAD_FEEDRATE);
|
||||
planner.synchronize();
|
||||
// When (T0 rx->ok) load is ready, but in fact it did not load
|
||||
// successfully or an overload created pressure in the extruder.
|
||||
// Send (C0) to load more and move E_AXIS a little to release pressure.
|
||||
if ((fil_present = FILAMENT_PRESENT())) MMU2_SEND("A");
|
||||
} while (!fil_present && PENDING(millis(), expire_ms));
|
||||
stepper.disable_extruder();
|
||||
manage_response(true, true);
|
||||
}
|
||||
if (!FILAMENT_PRESENT()) {
|
||||
|
||||
// Was the filament still missing in the last check?
|
||||
if (!fil_present) {
|
||||
DEBUG_ECHOLNPGM("Filament never reached sensor, runout");
|
||||
filament_runout();
|
||||
}
|
||||
@@ -682,7 +695,7 @@ static void mmu2_not_responding() {
|
||||
command(MMU_CMD_T0 + index);
|
||||
manage_response(true, true);
|
||||
command(MMU_CMD_C0);
|
||||
extruder = index; //filament change is finished
|
||||
extruder = index; // Filament change is finished
|
||||
active_extruder = 0;
|
||||
stepper.enable_extruder();
|
||||
SERIAL_ECHO_MSG(STR_ACTIVE_EXTRUDER, extruder);
|
||||
@@ -861,7 +874,7 @@ void MMU2::filament_runout() {
|
||||
if (cmd == MMU_CMD_NONE && last_cmd == MMU_CMD_C0) {
|
||||
if (present && !mmu2s_triggered) {
|
||||
DEBUG_ECHOLNPGM("MMU <= 'A'");
|
||||
tx_str(F("A\n"));
|
||||
MMU2_SEND("A");
|
||||
}
|
||||
// Slowly spin the extruder during C0
|
||||
else {
|
||||
|
||||
@@ -86,6 +86,7 @@ private:
|
||||
#endif
|
||||
|
||||
#if ENABLED(MMU_EXTRUDER_SENSOR)
|
||||
#define MMU_LOAD_FEEDRATE 19.02f // (mm/s)
|
||||
static void mmu_continue_loading();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -167,8 +167,6 @@
|
||||
if (parser.seenval('T')) draw_area_max.y = parser.value_linear_units();
|
||||
if (parser.seenval('B')) draw_area_min.y = parser.value_linear_units();
|
||||
if (parser.seenval('H')) polargraph_max_belt_len = parser.value_linear_units();
|
||||
draw_area_size.x = draw_area_max.x - draw_area_min.x;
|
||||
draw_area_size.y = draw_area_max.y - draw_area_min.y;
|
||||
}
|
||||
|
||||
void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
|
||||
|
||||
@@ -313,7 +313,7 @@ void GcodeSuite::M43() {
|
||||
|
||||
// 'P' Get the range of pins to test or watch
|
||||
uint8_t first_pin = PARSED_PIN_INDEX('P', 0),
|
||||
last_pin = parser.seenval('P') ? first_pin : TERN(HAS_HIGH_ANALOG_PINS, NUM_DIGITAL_PINS, NUMBER_PINS_TOTAL) - 1;
|
||||
last_pin = parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1;
|
||||
|
||||
if (first_pin > last_pin) return;
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
#include "../../gcode.h"
|
||||
#include "../../../module/planner.h"
|
||||
|
||||
#if ENABLED(EXTRA_LIN_ADVANCE_K)
|
||||
float other_extruder_advance_K[EXTRUDERS];
|
||||
#if ENABLED(ADVANCE_K_EXTRA)
|
||||
float other_extruder_advance_K[DISTINCT_E];
|
||||
uint8_t lin_adv_slot = 0;
|
||||
#endif
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
* M900: Get or Set Linear Advance K-factor
|
||||
* T<tool> Which tool to address
|
||||
* K<factor> Set current advance K factor (Slot 0).
|
||||
* L<factor> Set secondary advance K factor (Slot 1). Requires EXTRA_LIN_ADVANCE_K.
|
||||
* S<0/1> Activate slot 0 or 1. Requires EXTRA_LIN_ADVANCE_K.
|
||||
* L<factor> Set secondary advance K factor (Slot 1). Requires ADVANCE_K_EXTRA.
|
||||
* S<0/1> Activate slot 0 or 1. Requires ADVANCE_K_EXTRA.
|
||||
*/
|
||||
void GcodeSuite::M900() {
|
||||
|
||||
@@ -58,12 +58,12 @@ void GcodeSuite::M900() {
|
||||
}
|
||||
#endif
|
||||
|
||||
float &kref = planner.extruder_advance_K[tool_index], newK = kref;
|
||||
float &kref = planner.extruder_advance_K[E_INDEX_N(tool_index)], newK = kref;
|
||||
const float oldK = newK;
|
||||
|
||||
#if ENABLED(EXTRA_LIN_ADVANCE_K)
|
||||
#if ENABLED(ADVANCE_K_EXTRA)
|
||||
|
||||
float &lref = other_extruder_advance_K[tool_index];
|
||||
float &lref = other_extruder_advance_K[E_INDEX_N(tool_index)];
|
||||
|
||||
const bool old_slot = TEST(lin_adv_slot, tool_index), // The tool's current slot (0 or 1)
|
||||
new_slot = parser.boolval('S', old_slot); // The passed slot (default = current)
|
||||
@@ -111,9 +111,9 @@ void GcodeSuite::M900() {
|
||||
|
||||
if (!parser.seen_any()) {
|
||||
|
||||
#if ENABLED(EXTRA_LIN_ADVANCE_K)
|
||||
#if ENABLED(ADVANCE_K_EXTRA)
|
||||
|
||||
#if EXTRUDERS < 2
|
||||
#if DISTINCT_E < 2
|
||||
SERIAL_ECHOLNPGM("Advance S", new_slot, " K", kref, "(S", !new_slot, " K", lref, ")");
|
||||
#else
|
||||
EXTRUDER_LOOP() {
|
||||
@@ -127,7 +127,7 @@ void GcodeSuite::M900() {
|
||||
#else
|
||||
|
||||
SERIAL_ECHO_START();
|
||||
#if EXTRUDERS < 2
|
||||
#if DISTINCT_E < 2
|
||||
SERIAL_ECHOLNPGM("Advance K=", planner.extruder_advance_K[0]);
|
||||
#else
|
||||
SERIAL_ECHOPGM("Advance K");
|
||||
@@ -145,7 +145,7 @@ void GcodeSuite::M900() {
|
||||
|
||||
void GcodeSuite::M900_report(const bool forReplay/*=true*/) {
|
||||
report_heading(forReplay, F(STR_LINEAR_ADVANCE));
|
||||
#if EXTRUDERS < 2
|
||||
#if DISTINCT_E < 2
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOLNPGM(" M900 K", planner.extruder_advance_K[0]);
|
||||
#else
|
||||
|
||||
@@ -561,8 +561,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 48: M48(); break; // M48: Z probe repeatability test
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
case 73: M73(); break; // M73: Set progress percentage (for display on LCD)
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY)
|
||||
case 73: M73(); break; // M73: Set progress percentage
|
||||
#endif
|
||||
|
||||
case 75: M75(); break; // M75: Start print timer
|
||||
@@ -600,7 +600,9 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 108: M108(); break; // M108: Cancel Waiting
|
||||
case 112: M112(); break; // M112: Full Shutdown
|
||||
case 410: M410(); break; // M410: Quickstop - Abort all the planned moves.
|
||||
TERN_(HOST_PROMPT_SUPPORT, case 876:) // M876: Handle Host prompt responses
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
case 876: M876(); break; // M876: Handle Host prompt responses
|
||||
#endif
|
||||
#else
|
||||
case 108: case 112: case 410:
|
||||
TERN_(HOST_PROMPT_SUPPORT, case 876:)
|
||||
@@ -793,6 +795,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 250: M250(); break; // M250: Set LCD contrast
|
||||
#endif
|
||||
|
||||
#if HAS_GCODE_M255
|
||||
case 255: M255(); break; // M255: Set LCD Sleep/Backlight Timeout (Minutes)
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
case 256: M256(); break; // M256: Set LCD brightness
|
||||
#endif
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
* M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins (Requires PINS_DEBUGGING)
|
||||
* M48 - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs> S<chizoid>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
|
||||
*
|
||||
* M73 - Set the progress percentage. (Requires LCD_SET_PROGRESS_MANUALLY)
|
||||
* M73 - Set the progress percentage. (Requires SET_PROGRESS_MANUALLY)
|
||||
* M75 - Start the print job timer.
|
||||
* M76 - Pause the print job timer.
|
||||
* M77 - Stop the print job timer.
|
||||
@@ -677,7 +677,7 @@ private:
|
||||
static void M48();
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY)
|
||||
static void M73();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
#include "../../feature/caselight.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_STM32_UID) && !defined(MACHINE_UUID)
|
||||
#include "../../libs/hex_print.h"
|
||||
#endif
|
||||
|
||||
//#define MINIMAL_CAP_LINES // Don't even mention the disabled capabilities
|
||||
|
||||
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
||||
@@ -59,20 +63,37 @@
|
||||
* the capability is not present.
|
||||
*/
|
||||
void GcodeSuite::M115() {
|
||||
SERIAL_ECHOLNPGM(
|
||||
"FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ") "
|
||||
"SOURCE_CODE_URL:" SOURCE_CODE_URL " "
|
||||
"PROTOCOL_VERSION:" PROTOCOL_VERSION " "
|
||||
"MACHINE_TYPE:" MACHINE_NAME " "
|
||||
"EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " "
|
||||
SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin"
|
||||
" " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ")"
|
||||
" SOURCE_CODE_URL:" SOURCE_CODE_URL
|
||||
" PROTOCOL_VERSION:" PROTOCOL_VERSION
|
||||
" MACHINE_TYPE:" MACHINE_NAME
|
||||
" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)
|
||||
#if NUM_AXES != XYZ
|
||||
"AXIS_COUNT:" STRINGIFY(NUM_AXES) " "
|
||||
" AXIS_COUNT:" STRINGIFY(NUM_AXES)
|
||||
#endif
|
||||
#ifdef MACHINE_UUID
|
||||
"UUID:" MACHINE_UUID
|
||||
" UUID:" MACHINE_UUID
|
||||
#endif
|
||||
);
|
||||
|
||||
// STM32UID:111122223333
|
||||
#if ENABLED(HAS_STM32_UID) && !defined(MACHINE_UUID)
|
||||
// STM32 based devices output the CPU device serial number
|
||||
// Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations
|
||||
// https://github.com/opulo-inc/lumenpnp
|
||||
// Although this code should work on all STM32 based boards
|
||||
SERIAL_ECHOPGM(" UUID:");
|
||||
uint32_t *uid_address = (uint32_t*)UID_BASE;
|
||||
LOOP_L_N(i, 3) {
|
||||
const uint32_t UID = uint32_t(READ_REG(*(uid_address)));
|
||||
uid_address += 4U;
|
||||
for (int B = 24; B >= 0; B -= 8) print_hex_byte(UID >> B);
|
||||
}
|
||||
#endif
|
||||
|
||||
SERIAL_EOL();
|
||||
|
||||
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
||||
|
||||
// The port that sent M115
|
||||
@@ -121,7 +142,7 @@ void GcodeSuite::M115() {
|
||||
cap_line(F("LEVELING_DATA"), ENABLED(HAS_LEVELING));
|
||||
|
||||
// BUILD_PERCENT (M73)
|
||||
cap_line(F("BUILD_PERCENT"), ENABLED(LCD_SET_PROGRESS_MANUALLY));
|
||||
cap_line(F("BUILD_PERCENT"), ENABLED(SET_PROGRESS_PERCENT));
|
||||
|
||||
// SOFTWARE_POWER (M80, M81)
|
||||
cap_line(F("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));
|
||||
|
||||
@@ -85,7 +85,12 @@ void GcodeSuite::M0_M1() {
|
||||
|
||||
#endif
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR)));
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
if (parser.string_arg)
|
||||
hostui.prompt_do(PROMPT_USER_CONTINUE, parser.string_arg, FPSTR(CONTINUE_STR));
|
||||
else
|
||||
hostui.prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR));
|
||||
#endif
|
||||
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
|
||||
|
||||
|
||||
@@ -22,21 +22,35 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
#include "../../libs/numtostr.h"
|
||||
|
||||
#if ENABLED(DWIN_LCD_PROUI)
|
||||
#include "../../lcd/e3v2/proui/dwin.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(M73_REPORT)
|
||||
#define M73_REPORT_PRUSA
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M73: Set percentage complete (for display on LCD)
|
||||
*
|
||||
* Example:
|
||||
* M73 P25 ; Set progress to 25%
|
||||
* M73 P25.63 ; Set progress to 25.63%
|
||||
* M73 R456 ; Set remaining time to 456 minutes
|
||||
* M73 C12 ; Set next interaction countdown to 12 minutes
|
||||
* M73 ; Report current values
|
||||
*
|
||||
* Use a shorter-than-Průša report format:
|
||||
* M73 Percent done: ---%; Time left: -----m; Change: -----m;
|
||||
*
|
||||
* When PRINT_PROGRESS_SHOW_DECIMALS is enabled - reports percent with 100 / 23.4 / 3.45 format
|
||||
*
|
||||
*/
|
||||
void GcodeSuite::M73() {
|
||||
|
||||
@@ -46,17 +60,39 @@ void GcodeSuite::M73() {
|
||||
|
||||
#else
|
||||
|
||||
if (parser.seenval('P'))
|
||||
ui.set_progress((PROGRESS_SCALE) > 1
|
||||
? parser.value_float() * (PROGRESS_SCALE)
|
||||
: parser.value_byte()
|
||||
);
|
||||
#if ENABLED(SET_PROGRESS_PERCENT)
|
||||
if (parser.seenval('P'))
|
||||
ui.set_progress((PROGRESS_SCALE) > 1
|
||||
? parser.value_float() * (PROGRESS_SCALE)
|
||||
: parser.value_byte()
|
||||
);
|
||||
#endif
|
||||
|
||||
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
if (parser.seenval('R')) ui.set_remaining_time(60 * parser.value_ulong());
|
||||
#endif
|
||||
|
||||
#if ENABLED(SET_INTERACTION_TIME)
|
||||
if (parser.seenval('C')) ui.set_interaction_time(60 * parser.value_ulong());
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(M73_REPORT)
|
||||
{
|
||||
SERIAL_ECHO_MSG(
|
||||
TERN(M73_REPORT_PRUSA, "M73 Percent done: ", "Progress: ")
|
||||
, TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent())
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
, TERN(M73_REPORT_PRUSA, "; Print time remaining in mins: ", "%; Time left: "), ui.remaining_time / 60
|
||||
#endif
|
||||
#if ENABLED(SET_INTERACTION_TIME)
|
||||
, TERN(M73_REPORT_PRUSA, "; Change in mins: ", "m; Change: "), ui.interaction_time / 60
|
||||
#endif
|
||||
, TERN(M73_REPORT_PRUSA, ";", "m")
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // LCD_SET_PROGRESS_MANUALLY
|
||||
#endif // SET_PROGRESS_MANUALLY
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "../queue.h"
|
||||
#endif
|
||||
|
||||
#if EITHER(LCD_SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
|
||||
#if EITHER(SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
|
||||
#include "../../lcd/marlinui.h"
|
||||
#endif
|
||||
|
||||
@@ -84,7 +84,7 @@ void GcodeSuite::M1001() {
|
||||
process_subcommands_now(F("M77"));
|
||||
|
||||
// Set the progress bar "done" state
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress_done());
|
||||
TERN_(SET_PROGRESS_PERCENT, ui.set_progress_done());
|
||||
|
||||
// Announce SD file completion
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ void GcodeSuite::M23() {
|
||||
for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
|
||||
card.openFileRead(parser.string_arg);
|
||||
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(0));
|
||||
TERN_(SET_PROGRESS_PERCENT, ui.set_progress(0));
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
||||
|
||||
@@ -529,10 +529,6 @@
|
||||
#define HAS_MANUAL_MOVE_MENU 1
|
||||
#endif
|
||||
|
||||
#if ANY(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI, HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL, IS_DWIN_MARLINUI, DWIN_CREALITY_LCD_JYERSUI)
|
||||
#define CAN_SHOW_REMAINING_TIME 1
|
||||
#endif
|
||||
|
||||
#if HAS_MARLINUI_U8GLIB
|
||||
#ifndef LCD_PIXEL_WIDTH
|
||||
#define LCD_PIXEL_WIDTH 128
|
||||
@@ -994,7 +990,7 @@
|
||||
* with shared motion and temperature settings.
|
||||
*
|
||||
* DISTINCT_E is the number of distinguished extruders. By default this
|
||||
* well be 1 which indicates all extruders share the same settings.
|
||||
* will be 1 which indicates all extruders share the same settings.
|
||||
*
|
||||
* E_INDEX_N(E) should be used to get the E index of any item that might be
|
||||
* distinguished.
|
||||
@@ -1484,7 +1480,7 @@
|
||||
#endif
|
||||
#elif ENABLED(TFT_GENERIC)
|
||||
#define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
|
||||
#if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320)
|
||||
#if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600)
|
||||
#define TFT_RES_320x240
|
||||
#endif
|
||||
#if NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
|
||||
@@ -1562,6 +1558,8 @@
|
||||
#elif TFT_HEIGHT == 600
|
||||
#if ENABLED(TFT_INTERFACE_LTDC)
|
||||
#define TFT_1024x600_LTDC
|
||||
#else
|
||||
#define TFT_1024x600_SIM // "Simulation" - for testing purposes only
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@@ -1572,7 +1570,7 @@
|
||||
#define HAS_UI_480x320 1
|
||||
#elif EITHER(TFT_480x272, TFT_480x272_SPI)
|
||||
#define HAS_UI_480x272 1
|
||||
#elif defined(TFT_1024x600_LTDC)
|
||||
#elif EITHER(TFT_1024x600_LTDC, TFT_1024x600_SIM)
|
||||
#define HAS_UI_1024x600 1
|
||||
#endif
|
||||
#if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272)
|
||||
|
||||
@@ -162,9 +162,10 @@
|
||||
#define HID_E6 6
|
||||
#define HID_E7 7
|
||||
|
||||
#define _SENSOR_IS(I,N) || (TEMP_SENSOR_##N == I)
|
||||
#define _SENSOR_IS(I,N) || (TEMP_SENSOR(N) == I)
|
||||
#define _E_SENSOR_IS(I,N) _SENSOR_IS(N,I)
|
||||
#define ANY_THERMISTOR_IS(N) (0 REPEAT2(HOTENDS, _E_SENSOR_IS, N) \
|
||||
#define ANY_E_SENSOR_IS(N) (0 REPEAT2(HOTENDS, _E_SENSOR_IS, N))
|
||||
#define ANY_THERMISTOR_IS(N) ( ANY_E_SENSOR_IS(N) \
|
||||
_SENSOR_IS(N,BED) _SENSOR_IS(N,PROBE) _SENSOR_IS(N,CHAMBER) \
|
||||
_SENSOR_IS(N,COOLER) _SENSOR_IS(N,BOARD) _SENSOR_IS(N,REDUNDANT) )
|
||||
|
||||
@@ -599,10 +600,16 @@
|
||||
#undef MENU_ADDAUTOSTART
|
||||
#endif
|
||||
|
||||
#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
|
||||
#if EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY)
|
||||
#define HAS_PRINT_PROGRESS 1
|
||||
#endif
|
||||
|
||||
#if DISABLED(SET_PROGRESS_MANUALLY)
|
||||
#undef SET_REMAINING_TIME
|
||||
#undef SET_INTERACTION_TIME
|
||||
#undef M73_REPORT
|
||||
#endif
|
||||
|
||||
#if ANY(HAS_MARLINUI_MENU, ULTIPANEL_FEEDMULTIPLY, SOFT_RESET_ON_KILL)
|
||||
#define HAS_ENCODER_ACTION 1
|
||||
#endif
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
#define W_BED_SIZE W_MAX_LENGTH
|
||||
#endif
|
||||
|
||||
// Require 0,0 bed center for Delta and SCARA
|
||||
// Require 0,0 bed center for Delta, SCARA, and Polargraph
|
||||
#if IS_KINEMATIC
|
||||
#define BED_CENTER_AT_0_0
|
||||
#endif
|
||||
@@ -2656,7 +2656,7 @@
|
||||
//
|
||||
// ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface)
|
||||
//
|
||||
#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && !TEMP_SENSOR_IS_MAX_TC(P) && !TEMP_SENSOR_##P##_IS_DUMMY)
|
||||
#define HAS_ADC_TEST(P) (TEMP_SENSOR(P) && PIN_EXISTS(TEMP_##P) && !TEMP_SENSOR_IS_MAX_TC(P) && !TEMP_SENSOR_##P##_IS_DUMMY)
|
||||
#if HOTENDS > 0 && HAS_ADC_TEST(0)
|
||||
#define HAS_TEMP_ADC_0 1
|
||||
#endif
|
||||
|
||||
@@ -587,7 +587,7 @@
|
||||
#elif defined(MKS_LCD12864)
|
||||
#error "MKS_LCD12864 is now MKS_LCD12864A or MKS_LCD12864B."
|
||||
#elif defined(DOGM_SD_PERCENT)
|
||||
#error "DOGM_SD_PERCENT is now SHOW_SD_PERCENT."
|
||||
#error "DOGM_SD_PERCENT is now SHOW_PROGRESS_PERCENT."
|
||||
#elif defined(NEOPIXEL_BKGD_LED_INDEX)
|
||||
#error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
|
||||
#elif defined(TEMP_SENSOR_1_AS_REDUNDANT)
|
||||
@@ -646,6 +646,14 @@
|
||||
#error "TOUCH_IDLE_SLEEP (seconds) is now TOUCH_IDLE_SLEEP_MINS (minutes)."
|
||||
#elif defined(LCD_BACKLIGHT_TIMEOUT)
|
||||
#error "LCD_BACKLIGHT_TIMEOUT (seconds) is now LCD_BACKLIGHT_TIMEOUT_MINS (minutes)."
|
||||
#elif defined(LCD_SET_PROGRESS_MANUALLY)
|
||||
#error "LCD_SET_PROGRESS_MANUALLY is now SET_PROGRESS_MANUALLY."
|
||||
#elif defined(USE_M73_REMAINING_TIME)
|
||||
#error "USE_M73_REMAINING_TIME is now SET_REMAINING_TIME."
|
||||
#elif defined(SHOW_SD_PERCENT)
|
||||
#error "SHOW_SD_PERCENT is now SHOW_PROGRESS_PERCENT."
|
||||
#elif defined(EXTRA_LIN_ADVANCE_K)
|
||||
#error "EXTRA_LIN_ADVANCE_K is now ADVANCE_K_EXTRA."
|
||||
#endif
|
||||
|
||||
// L64xx stepper drivers have been removed
|
||||
@@ -821,7 +829,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
/**
|
||||
* Granular software endstops (Marlin >= 1.1.7)
|
||||
*/
|
||||
#if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
|
||||
#if ENABLED(MIN_SOFTWARE_ENDSTOPS) && NONE(MIN_SOFTWARE_ENDSTOP_Z, POLARGRAPH)
|
||||
#if IS_KINEMATIC
|
||||
#error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
|
||||
#elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
|
||||
@@ -829,7 +837,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
|
||||
#if ENABLED(MAX_SOFTWARE_ENDSTOPS) && NONE(MAX_SOFTWARE_ENDSTOP_Z, POLARGRAPH)
|
||||
#if IS_KINEMATIC
|
||||
#error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
|
||||
#elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
|
||||
@@ -894,8 +902,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
* Progress Bar
|
||||
*/
|
||||
#if ENABLED(LCD_PROGRESS_BAR)
|
||||
#if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
|
||||
#error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
|
||||
#if NONE(SDSUPPORT, SET_PROGRESS_MANUALLY)
|
||||
#error "LCD_PROGRESS_BAR requires SDSUPPORT or SET_PROGRESS_MANUALLY."
|
||||
#elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
|
||||
#error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)."
|
||||
#elif HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI
|
||||
@@ -905,12 +913,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#elif PROGRESS_MSG_EXPIRE < 0
|
||||
#error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
|
||||
#endif
|
||||
#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && NONE(HAS_MARLINUI_U8GLIB, HAS_GRAPHICAL_TFT, HAS_MARLINUI_HD44780, EXTENSIBLE_UI, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
|
||||
#error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_*, OR EXTENSIBLE_UI."
|
||||
#endif
|
||||
|
||||
#if ENABLED(USE_M73_REMAINING_TIME) && DISABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#error "USE_M73_REMAINING_TIME requires LCD_SET_PROGRESS_MANUALLY"
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY) && NONE(SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME)
|
||||
#error "SET_PROGRESS_MANUALLY requires at least one of SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME to be enabled."
|
||||
#endif
|
||||
|
||||
#if HAS_LCDPRINT && LCD_HEIGHT < 4 && ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
|
||||
#error "Displays with fewer than 4 rows of text can't show progress values."
|
||||
#endif
|
||||
|
||||
#if !HAS_MARLINUI_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
|
||||
@@ -1387,10 +1397,15 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
* Linear Advance 1.5 - Check K value range
|
||||
*/
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
static_assert(
|
||||
WITHIN(LIN_ADVANCE_K, 0, 10),
|
||||
"LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
|
||||
);
|
||||
#if DISTINCT_E > 1
|
||||
constexpr float lak[] = ADVANCE_K;
|
||||
static_assert(COUNT(lak) < DISTINCT_E, "The ADVANCE_K array has too many elements (i.e., more than " STRINGIFY(DISTINCT_E) ").");
|
||||
#define _LIN_ASSERT(N) static_assert(N >= COUNT(lak) || WITHIN(lak[N], 0, 10), "ADVANCE_K values must be from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9).");
|
||||
REPEAT(DISTINCT_E, _LIN_ASSERT)
|
||||
#undef _LIN_ASSERT
|
||||
#else
|
||||
static_assert(WITHIN(ADVANCE_K, 0, 10), "ADVANCE_K must be from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9).");
|
||||
#endif
|
||||
#if ENABLED(S_CURVE_ACCELERATION) && DISABLED(EXPERIMENTAL_SCURVE)
|
||||
#error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue."
|
||||
#elif ENABLED(DIRECT_STEPPING)
|
||||
@@ -2331,6 +2346,37 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "TEMP_SENSOR_REDUNDANT 1000 requires REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS and REDUNDANT_BETA in Configuration_adv.h."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Required thermistor 66 (Dyze Design / Trianglelab T-D500) settings
|
||||
* https://docs.dyzedesign.com/hotends.html#_500-%C2%B0c-thermistor
|
||||
*/
|
||||
#if ANY_E_SENSOR_IS(66)
|
||||
#define _BAD_MINTEMP(N) (TEMP_SENSOR(N) == 66 && HEATER_##N##_MINTEMP <= 20)
|
||||
#if _BAD_MINTEMP(0)
|
||||
#error "Thermistor 66 requires HEATER_0_MINTEMP > 20."
|
||||
#elif _BAD_MINTEMP(1)
|
||||
#error "Thermistor 66 requires HEATER_1_MINTEMP > 20."
|
||||
#elif _BAD_MINTEMP(2)
|
||||
#error "Thermistor 66 requires HEATER_2_MINTEMP > 20."
|
||||
#elif _BAD_MINTEMP(3)
|
||||
#error "Thermistor 66 requires HEATER_3_MINTEMP > 20."
|
||||
#elif _BAD_MINTEMP(4)
|
||||
#error "Thermistor 66 requires HEATER_4_MINTEMP > 20."
|
||||
#elif _BAD_MINTEMP(5)
|
||||
#error "Thermistor 66 requires HEATER_5_MINTEMP > 20."
|
||||
#elif _BAD_MINTEMP(6)
|
||||
#error "Thermistor 66 requires HEATER_6_MINTEMP > 20."
|
||||
#elif _BAD_MINTEMP(7)
|
||||
#error "Thermistor 66 requires HEATER_7_MINTEMP > 20."
|
||||
#endif
|
||||
#if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED < 5
|
||||
#error "Thermistor 66 requires MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED ≥ 5."
|
||||
#elif MILLISECONDS_PREHEAT_TIME < 30000
|
||||
#error "Thermistor 66 requires MILLISECONDS_PREHEAT_TIME ≥ 30000."
|
||||
#endif
|
||||
#undef _BAD_MINTEMP
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Required MAX31865 settings
|
||||
*/
|
||||
@@ -4066,10 +4112,6 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
|
||||
#error "COOLANT_FLOOD requires COOLANT_FLOOD_PIN to be defined."
|
||||
#endif
|
||||
|
||||
#if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI, IS_DWIN_MARLINUI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
|
||||
#error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD."
|
||||
#endif
|
||||
|
||||
#if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16
|
||||
#error "ADC_BUTTON_DEBOUNCE_DELAY must be greater than 16."
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2022-09-14"
|
||||
#define STRING_DISTRIBUTION_DATE "2022-10-16"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -711,8 +711,8 @@
|
||||
#warning "Don't forget to update your TFT settings in Configuration.h."
|
||||
#endif
|
||||
|
||||
#if ENABLED(EMIT_CREALITY_422_WARNING)
|
||||
#warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225). (Define EMIT_CREALITY_422_WARNING false to suppress this warning.)"
|
||||
#if ENABLED(EMIT_CREALITY_422_WARNING) && DISABLED(NO_CREALITY_422_DRIVER_WARNING)
|
||||
#warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)"
|
||||
#endif
|
||||
|
||||
#if PRINTCOUNTER_SYNC
|
||||
|
||||
@@ -612,20 +612,6 @@ FORCE_INLINE void _draw_bed_status(const bool blink) {
|
||||
_draw_heater_status(H_BED, TERN0(HAS_LEVELING, blink && planner.leveling_active) ? '_' : LCD_STR_BEDTEMP[0], blink);
|
||||
}
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
|
||||
FORCE_INLINE void _draw_print_progress() {
|
||||
const uint8_t progress = ui.get_progress_percent();
|
||||
lcd_put_u8str(F(TERN(SDSUPPORT, "SD", "P:")));
|
||||
if (progress)
|
||||
lcd_put_u8str(ui8tostr3rj(progress));
|
||||
else
|
||||
lcd_put_u8str(F("---"));
|
||||
lcd_put_lchar('%');
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_PROGRESS_BAR)
|
||||
|
||||
void MarlinUI::draw_progress_bar(const uint8_t percent) {
|
||||
@@ -733,6 +719,56 @@ void MarlinUI::draw_status_message(const bool blink) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
#define TPOFFSET (LCD_WIDTH - 1)
|
||||
static uint8_t timepos = TPOFFSET - 6;
|
||||
static char buffer[14];
|
||||
static lcd_uint_t pc, pr;
|
||||
|
||||
#if ENABLED(SHOW_PROGRESS_PERCENT)
|
||||
void MarlinUI::drawPercent() {
|
||||
const uint8_t progress = ui.get_progress_percent();
|
||||
if (progress) {
|
||||
lcd_moveto(pc, pr);
|
||||
lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
|
||||
lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)));
|
||||
lcd_put_lchar('%');
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
void MarlinUI::drawRemain() {
|
||||
const duration_t remaint = ui.get_remaining_time();
|
||||
if (printJobOngoing()) {
|
||||
timepos = TPOFFSET - remaint.toDigital(buffer);
|
||||
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R');
|
||||
lcd_put_u8str(buffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_INTERACTION_TIME)
|
||||
void MarlinUI::drawInter() {
|
||||
const duration_t interactt = ui.interaction_time;
|
||||
if (printingIsActive() && interactt.value) {
|
||||
timepos = TPOFFSET - interactt.toDigital(buffer);
|
||||
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C');
|
||||
lcd_put_u8str(buffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_ELAPSED_TIME)
|
||||
void MarlinUI::drawElapsed() {
|
||||
const duration_t elapsedt = print_job_timer.duration();
|
||||
if (printJobOngoing()) {
|
||||
timepos = TPOFFSET - elapsedt.toDigital(buffer);
|
||||
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E');
|
||||
//lcd_put_lchar(timepos, 2, LCD_STR_CLOCK[0]);
|
||||
lcd_put_u8str(buffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // HAS_PRINT_PROGRESS
|
||||
|
||||
/**
|
||||
* LCD_INFO_SCREEN_STYLE 0 : Classic Status Screen
|
||||
*
|
||||
@@ -765,35 +801,6 @@ void MarlinUI::draw_status_message(const bool blink) {
|
||||
* |01234567890123456789|
|
||||
*/
|
||||
|
||||
inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos, const bool blink) {
|
||||
char buffer[14];
|
||||
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
const bool show_remain = TERN1(ROTATE_PROGRESS_DISPLAY, blink) && printingIsActive();
|
||||
if (show_remain) {
|
||||
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||
duration_t remaining = ui.get_remaining_time();
|
||||
#else
|
||||
uint8_t progress = ui.get_progress_percent();
|
||||
uint32_t elapsed = print_job_timer.duration();
|
||||
duration_t remaining = (progress > 0) ? ((elapsed * 25600 / progress) >> 8) - elapsed : 0;
|
||||
#endif
|
||||
timepos -= remaining.toDigital(buffer);
|
||||
lcd_put_lchar(timepos, 2, 'R');
|
||||
}
|
||||
#else
|
||||
constexpr bool show_remain = false;
|
||||
#endif
|
||||
|
||||
if (!show_remain) {
|
||||
duration_t elapsed = print_job_timer.duration();
|
||||
timepos -= elapsed.toDigital(buffer);
|
||||
lcd_put_lchar(timepos, 2, LCD_STR_CLOCK[0]);
|
||||
}
|
||||
lcd_put_u8str(buffer);
|
||||
return timepos;
|
||||
}
|
||||
|
||||
void MarlinUI::draw_status_screen() {
|
||||
|
||||
const bool blink = get_blink();
|
||||
@@ -856,8 +863,8 @@ void MarlinUI::draw_status_screen() {
|
||||
#if LCD_WIDTH < 20
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
lcd_moveto(0, 2);
|
||||
_draw_print_progress();
|
||||
pc = 0, pr = 2;
|
||||
rotate_progress();
|
||||
#endif
|
||||
|
||||
#else // LCD_WIDTH >= 20
|
||||
@@ -940,12 +947,11 @@ void MarlinUI::draw_status_screen() {
|
||||
lcd_put_u8str(i16tostr3rj(feedrate_percentage));
|
||||
lcd_put_lchar('%');
|
||||
|
||||
const uint8_t timepos = draw_elapsed_or_remaining_time(LCD_WIDTH - 1, blink);
|
||||
|
||||
#if LCD_WIDTH >= 20
|
||||
lcd_moveto(timepos - 7, 2);
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
_draw_print_progress();
|
||||
pc = timepos - 7, pr = 2;
|
||||
rotate_progress();
|
||||
#else
|
||||
char c;
|
||||
uint16_t per;
|
||||
@@ -1016,7 +1022,7 @@ void MarlinUI::draw_status_screen() {
|
||||
// ========== Line 3 ==========
|
||||
|
||||
//
|
||||
// SD Percent, Hotend 2, or Bed
|
||||
// Progress percent, Hotend 2, or Bed
|
||||
//
|
||||
lcd_moveto(0, 2);
|
||||
#if HOTENDS > 2
|
||||
@@ -1025,24 +1031,17 @@ void MarlinUI::draw_status_screen() {
|
||||
_draw_bed_status(blink);
|
||||
#elif HAS_PRINT_PROGRESS
|
||||
#define DREW_PRINT_PROGRESS 1
|
||||
_draw_print_progress();
|
||||
pc = 0, pr = 2;
|
||||
rotate_progress();
|
||||
#endif
|
||||
|
||||
//
|
||||
// Elapsed Time or SD Percent
|
||||
// All progress strings
|
||||
//
|
||||
lcd_moveto(LCD_WIDTH - 9, 2);
|
||||
|
||||
#if HAS_PRINT_PROGRESS && !DREW_PRINT_PROGRESS
|
||||
|
||||
_draw_print_progress();
|
||||
|
||||
#else
|
||||
|
||||
(void)draw_elapsed_or_remaining_time(LCD_WIDTH - 4, blink);
|
||||
|
||||
pc = LCD_WIDTH - 9, pr = 2;
|
||||
rotate_progress();
|
||||
#endif
|
||||
|
||||
#endif // LCD_INFO_SCREEN_STYLE 1
|
||||
|
||||
// ========= Last Line ========
|
||||
|
||||
@@ -606,7 +606,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
|
||||
const uint8_t progress = ui._get_progress();
|
||||
#if ENABLED(SDSUPPORT)
|
||||
lcd_put_u8str(F("SD"));
|
||||
#elif ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#elif ENABLED(SET_PROGRESS_PERCENT)
|
||||
lcd_put_u8str(F("P:"));
|
||||
#endif
|
||||
if (progress)
|
||||
|
||||
@@ -40,9 +40,7 @@
|
||||
|
||||
#include "../../gcode/parser.h" // for units (and volumetric)
|
||||
|
||||
#if ENABLED(LCD_SHOW_E_TOTAL)
|
||||
#include "../../MarlinCore.h" // for printingIsActive()
|
||||
#endif
|
||||
#include "../../MarlinCore.h" // for printingIsActive()
|
||||
|
||||
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
||||
#include "../../feature/filwidth.h"
|
||||
@@ -445,6 +443,55 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
|
||||
lcd_put_u8str(value);
|
||||
}
|
||||
|
||||
// Prepare strings for progress display
|
||||
#if HAS_PRINT_PROGRESS
|
||||
#define _PRGR_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH))
|
||||
#define PCENTERED 1 // center percent value over progress bar, else align to the right
|
||||
static uint8_t lastProgress = 0xFF;
|
||||
static u8g_uint_t progress_bar_solid_width = 0;
|
||||
#if ENABLED(SHOW_PROGRESS_PERCENT)
|
||||
static char progress_string[5];
|
||||
static u8g_uint_t progress_x_pos;
|
||||
void MarlinUI::drawPercent() {
|
||||
if (progress_string[0]) {
|
||||
lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string);
|
||||
lcd_put_lchar('%');
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
static char remaining_string[10];
|
||||
static u8g_uint_t remaining_x_pos = 0;
|
||||
void MarlinUI::drawRemain() {
|
||||
if (printJobOngoing()){
|
||||
lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("R:"));
|
||||
lcd_put_u8str(remaining_x_pos, EXTRAS_BASELINE, remaining_string);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_INTERACTION_TIME)
|
||||
static char interaction_string[10];
|
||||
static u8g_uint_t interaction_x_pos = 0;
|
||||
void MarlinUI::drawInter() {
|
||||
if (printingIsActive() && interaction_string[0]) {
|
||||
lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("C:"));
|
||||
lcd_put_u8str(interaction_x_pos, EXTRAS_BASELINE, interaction_string);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_ELAPSED_TIME)
|
||||
static char elapsed_string[10];
|
||||
static u8g_uint_t elapsed_x_pos = 0;
|
||||
static uint8_t lastElapsed;
|
||||
void MarlinUI::drawElapsed() {
|
||||
if (printJobOngoing()) {
|
||||
lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("E:"));
|
||||
lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // HAS_PRINT_PROGRESS
|
||||
|
||||
/**
|
||||
* Draw the Status Screen for a 128x64 DOGM (U8glib) display.
|
||||
*
|
||||
@@ -459,30 +506,6 @@ void MarlinUI::draw_status_screen() {
|
||||
static char wstring[5], mstring[4];
|
||||
#endif
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
#if DISABLED(SHOW_SD_PERCENT)
|
||||
#define _SD_INFO_X(len) (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH) / 2 - (len) * (MENU_FONT_WIDTH) / 2)
|
||||
#else
|
||||
#define _SD_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH))
|
||||
#endif
|
||||
|
||||
#if ENABLED(SHOW_SD_PERCENT)
|
||||
static char progress_string[5];
|
||||
#endif
|
||||
static uint8_t lastElapsed = 0xFF, lastProgress = 0xFF;
|
||||
static u8g_uint_t elapsed_x_pos = 0, progress_bar_solid_width = 0;
|
||||
static char elapsed_string[16];
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
static u8g_uint_t estimation_x_pos = 0;
|
||||
static char estimation_string[10];
|
||||
#if BOTH(SHOW_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
|
||||
static u8g_uint_t progress_x_pos = 0;
|
||||
static uint8_t progress_state = 0;
|
||||
static bool prev_blink = 0;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive());
|
||||
|
||||
// At the first page, generate new display values
|
||||
@@ -523,61 +546,59 @@ void MarlinUI::draw_status_screen() {
|
||||
// Progress / elapsed / estimation updates and string formatting to avoid float math on each LCD draw
|
||||
#if HAS_PRINT_PROGRESS
|
||||
const progress_t progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, get_progress_permyriad, get_progress_percent)();
|
||||
duration_t elapsed = print_job_timer.duration();
|
||||
const uint8_t p = progress & 0xFF, ev = elapsed.value & 0xFF;
|
||||
duration_t elapsedt = print_job_timer.duration();
|
||||
const uint8_t p = progress & 0xFF, ev = elapsedt.value & 0xFF;
|
||||
if (p != lastProgress) {
|
||||
lastProgress = p;
|
||||
|
||||
progress_bar_solid_width = u8g_uint_t((PROGRESS_BAR_WIDTH - 2) * (progress / (PROGRESS_SCALE)) * 0.01f);
|
||||
|
||||
#if ENABLED(SHOW_SD_PERCENT)
|
||||
if (progress == 0) {
|
||||
#if ENABLED(SHOW_PROGRESS_PERCENT)
|
||||
if (progress == 0)
|
||||
progress_string[0] = '\0';
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
estimation_string[0] = '\0';
|
||||
estimation_x_pos = _SD_INFO_X(0);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
strcpy(progress_string, TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(progress), ui8tostr3rj(progress / (PROGRESS_SCALE))));
|
||||
|
||||
#if BOTH(SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) // Tri-state progress display mode
|
||||
progress_x_pos = _SD_INFO_X(strlen(progress_string) + 1);
|
||||
#endif
|
||||
progress_x_pos = TERN(PCENTERED, 77, _PRGR_INFO_X(strlen(progress_string) + 1));
|
||||
#endif
|
||||
}
|
||||
|
||||
constexpr bool can_show_days = DISABLED(SHOW_SD_PERCENT) || ENABLED(ROTATE_PROGRESS_DISPLAY);
|
||||
if (ev != lastElapsed) {
|
||||
lastElapsed = ev;
|
||||
const uint8_t len = elapsed.toDigital(elapsed_string, can_show_days && elapsed.value >= 60*60*24L);
|
||||
elapsed_x_pos = _SD_INFO_X(len);
|
||||
#if ENABLED(SHOW_INTERACTION_TIME)
|
||||
if (!(interaction_time)) {
|
||||
interaction_string[0] = '\0';
|
||||
interaction_x_pos = _PRGR_INFO_X(0);
|
||||
}
|
||||
else {
|
||||
const duration_t interactt = ui.interaction_time;
|
||||
interactt.toDigital(interaction_string, interactt.value >= 60*60*24L);
|
||||
interaction_x_pos = _PRGR_INFO_X(strlen(interaction_string));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
if (!(ev & 0x3)) {
|
||||
uint32_t timeval = (0
|
||||
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
|
||||
+ get_remaining_time()
|
||||
#endif
|
||||
);
|
||||
if (!timeval && progress > 0) timeval = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
|
||||
if (!timeval) {
|
||||
estimation_string[0] = '\0';
|
||||
estimation_x_pos = _SD_INFO_X(0);
|
||||
}
|
||||
else {
|
||||
duration_t estimation = timeval;
|
||||
const uint8_t len = estimation.toDigital(estimation_string, can_show_days && estimation.value >= 60*60*24L);
|
||||
estimation_x_pos = _SD_INFO_X(len + !BOTH(SHOW_SD_PERCENT, ROTATE_PROGRESS_DISPLAY));
|
||||
}
|
||||
#if ENABLED(SHOW_ELAPSED_TIME)
|
||||
if (ev != lastElapsed) {
|
||||
lastElapsed = ev;
|
||||
const uint8_t len = elapsedt.toDigital(elapsed_string, elapsedt.value >= 60*60*24L);
|
||||
elapsed_x_pos = _PRGR_INFO_X(len);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
if (!(ev & 0x3)) {
|
||||
uint32_t timeval = get_remaining_time();
|
||||
if (!timeval) {
|
||||
remaining_string[0] = '\0';
|
||||
remaining_x_pos = _PRGR_INFO_X(0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
const duration_t remaint = timeval;
|
||||
const uint8_t len = remaint.toDigital(remaining_string, remaint.value >= 60*60*24L);
|
||||
remaining_x_pos = _PRGR_INFO_X(len);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
const bool blink = get_blink();
|
||||
|
||||
// Status Menu Font
|
||||
set_font(FONT_STATUSMENU);
|
||||
|
||||
@@ -634,6 +655,8 @@ void MarlinUI::draw_status_screen() {
|
||||
u8g.drawBitmapP(STATUS_CHAMBER_X, chambery, STATUS_CHAMBER_BYTEWIDTH, chamberh, CHAMBER_BITMAP(CHAMBER_ALT()));
|
||||
#endif
|
||||
|
||||
const bool blink = ui.get_blink();
|
||||
|
||||
#if DO_DRAW_FAN
|
||||
#if STATUS_FAN_FRAMES > 2
|
||||
static bool old_blink;
|
||||
@@ -664,8 +687,7 @@ void MarlinUI::draw_status_screen() {
|
||||
if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) {
|
||||
// Extruders
|
||||
#if DO_DRAW_HOTENDS
|
||||
LOOP_L_N(e, MAX_HOTEND_DRAW)
|
||||
_draw_hotend_status((heater_id_t)e, blink);
|
||||
LOOP_L_N(e, MAX_HOTEND_DRAW) _draw_hotend_status((heater_id_t)e, blink);
|
||||
#endif
|
||||
|
||||
// Laser / Spindle
|
||||
@@ -757,74 +779,18 @@ void MarlinUI::draw_status_screen() {
|
||||
#endif // SDSUPPORT
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
//
|
||||
// Progress bar frame
|
||||
//
|
||||
|
||||
if (PAGE_CONTAINS(PROGRESS_BAR_Y, PROGRESS_BAR_Y + 3))
|
||||
u8g.drawFrame(PROGRESS_BAR_X, PROGRESS_BAR_Y, PROGRESS_BAR_WIDTH, 4);
|
||||
|
||||
//
|
||||
// Progress bar solid part
|
||||
//
|
||||
|
||||
if (PAGE_CONTAINS(PROGRESS_BAR_Y + 1, PROGRESS_BAR_Y + 2))
|
||||
u8g.drawBox(PROGRESS_BAR_X + 1, PROGRESS_BAR_Y + 1, progress_bar_solid_width, 2);
|
||||
|
||||
if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) {
|
||||
|
||||
#if ALL(SHOW_SD_PERCENT, SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY)
|
||||
|
||||
if (prev_blink != blink) {
|
||||
prev_blink = blink;
|
||||
if (++progress_state >= 3) progress_state = 0;
|
||||
}
|
||||
|
||||
if (progress_state == 0) {
|
||||
if (progress_string[0]) {
|
||||
lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string);
|
||||
lcd_put_lchar('%');
|
||||
}
|
||||
}
|
||||
else if (progress_state == 2 && estimation_string[0]) {
|
||||
lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("R:"));
|
||||
lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
|
||||
}
|
||||
else if (elapsed_string[0]) {
|
||||
lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("E:"));
|
||||
lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
|
||||
}
|
||||
|
||||
#else // !SHOW_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
|
||||
|
||||
//
|
||||
// SD Percent Complete
|
||||
//
|
||||
|
||||
#if ENABLED(SHOW_SD_PERCENT)
|
||||
if (progress_string[0]) {
|
||||
lcd_put_u8str(55, EXTRAS_BASELINE, progress_string); // Percent complete
|
||||
lcd_put_lchar('%');
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Elapsed Time
|
||||
//
|
||||
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
if (blink && estimation_string[0]) {
|
||||
lcd_put_lchar(estimation_x_pos, EXTRAS_BASELINE, 'R');
|
||||
lcd_put_u8str(estimation_string);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
|
||||
|
||||
#endif // !SHOW_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
|
||||
}
|
||||
|
||||
#endif // HAS_PRINT_PROGRESS
|
||||
// Progress strings
|
||||
if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1))
|
||||
ui.rotate_progress();
|
||||
#endif
|
||||
|
||||
//
|
||||
// XYZ Coordinates
|
||||
|
||||
@@ -40,12 +40,38 @@
|
||||
// Lightweight Status Screen for Graphical Display
|
||||
//
|
||||
|
||||
/** One hotend layout
|
||||
* ------------------
|
||||
* |⟱ xxx➜xxx° ✱xxx%
|
||||
* |_ xxx➜xxx° Fxxx%
|
||||
* ||||||||||R•xxx:xx
|
||||
* | status string
|
||||
* ------------------
|
||||
*
|
||||
* hotend temp | fan speed
|
||||
* bed temp | feedrate
|
||||
* progress bar| progress time
|
||||
* status string
|
||||
*
|
||||
* ****************************
|
||||
* Two hotends layout
|
||||
* ------------------
|
||||
* |⟱ xxx➜xxx° ✱xxx%
|
||||
* |⟱ xxx➜xxx°|||||||
|
||||
* |_ xxx➜xxx°Rxxx:xx
|
||||
* | status string
|
||||
* ------------------
|
||||
*
|
||||
* hotend temp | fan speed
|
||||
* hotend temp | progress bar
|
||||
* bed temp | progress time
|
||||
* status string
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(LIGHTWEIGHT_UI)
|
||||
|
||||
#include "status_screen_lite_ST7920.h"
|
||||
|
||||
#include "../marlinui.h"
|
||||
#include "../fontutils.h"
|
||||
#include "../lcdprint.h"
|
||||
@@ -53,12 +79,13 @@
|
||||
#include "../../module/motion.h"
|
||||
#include "../../module/printcounter.h"
|
||||
#include "../../module/temperature.h"
|
||||
#include "../../libs/numtostr.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#include "../../sd/cardreader.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_SHOW_E_TOTAL)
|
||||
#if ENABLED(LCD_SHOW_E_TOTAL) || HAS_PRINT_PROGRESS
|
||||
#include "../../MarlinCore.h" // for printingIsActive
|
||||
#endif
|
||||
|
||||
@@ -72,6 +99,9 @@
|
||||
#define DDRAM_LINE_3 0x08
|
||||
#define DDRAM_LINE_4 0x18
|
||||
|
||||
#include "status_screen_lite_ST7920.h"
|
||||
extern ST7920_Lite_Status_Screen lightUI;
|
||||
|
||||
ST7920_Lite_Status_Screen::st7920_state_t ST7920_Lite_Status_Screen::current_bits;
|
||||
|
||||
void ST7920_Lite_Status_Screen::cmd(const uint8_t cmd) {
|
||||
@@ -442,72 +472,6 @@ void ST7920_Lite_Status_Screen::draw_static_elements() {
|
||||
draw_fan_icon(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Although this is undocumented, the ST7920 allows the character
|
||||
* data buffer (DDRAM) to be used in conjunction with the graphics
|
||||
* bitmap buffer (CGRAM). The contents of the graphics buffer is
|
||||
* XORed with the data from the character generator. This allows
|
||||
* us to make the progress bar out of graphical data (the bar) and
|
||||
* text data (the percentage).
|
||||
*/
|
||||
void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) {
|
||||
#if HOTENDS == 1
|
||||
// If we have only one extruder, draw a long progress bar on the third line
|
||||
constexpr uint8_t top = 1, // Top in pixels
|
||||
bottom = 13, // Bottom in pixels
|
||||
left = 12, // Left edge, in 16-bit words
|
||||
width = 4; // Width of progress bar, in 16-bit words
|
||||
#else
|
||||
constexpr uint8_t top = 16 + 1,
|
||||
bottom = 16 + 13,
|
||||
left = 5,
|
||||
width = 3;
|
||||
#endif
|
||||
const uint8_t char_pcnt = 100 / width; // How many percent does each 16-bit word represent?
|
||||
|
||||
// Draw the progress bar as a bitmap in CGRAM
|
||||
LOOP_S_LE_N(y, top, bottom) {
|
||||
set_gdram_address(left, y);
|
||||
begin_data();
|
||||
LOOP_L_N(x, width) {
|
||||
uint16_t gfx_word = 0x0000;
|
||||
if ((x + 1) * char_pcnt <= value)
|
||||
gfx_word = 0xFFFF; // Draw completely filled bytes
|
||||
else if ((x * char_pcnt) < value)
|
||||
gfx_word = int(0x8000) >> (value % char_pcnt) * 16 / char_pcnt; // Draw partially filled bytes
|
||||
|
||||
// Draw the frame around the progress bar
|
||||
if (y == top || y == bottom)
|
||||
gfx_word = 0xFFFF; // Draw top/bottom border
|
||||
else if (x == width - 1)
|
||||
gfx_word |= 0x0001; // Draw right border
|
||||
else if (x == 0)
|
||||
gfx_word |= 0x8000; // Draw left border
|
||||
write_word(gfx_word);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the percentage as text in DDRAM
|
||||
#if HOTENDS == 1
|
||||
set_ddram_address(DDRAM_LINE_3 + 4);
|
||||
begin_data();
|
||||
write_byte(' ');
|
||||
#else
|
||||
set_ddram_address(DDRAM_LINE_2 + left);
|
||||
begin_data();
|
||||
#endif
|
||||
|
||||
// Draw centered
|
||||
if (value > 9) {
|
||||
write_number(value, 4);
|
||||
write_str(F("% "));
|
||||
}
|
||||
else {
|
||||
write_number(value, 3);
|
||||
write_str(F("% "));
|
||||
}
|
||||
}
|
||||
|
||||
void ST7920_Lite_Status_Screen::draw_fan_icon(const bool whichIcon) {
|
||||
set_ddram_address(DDRAM_LINE_1 + 5);
|
||||
begin_data();
|
||||
@@ -592,22 +556,8 @@ void ST7920_Lite_Status_Screen::draw_fan_speed(const uint8_t value) {
|
||||
write_byte('%');
|
||||
}
|
||||
|
||||
void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed, char suffix) {
|
||||
#if HOTENDS == 1
|
||||
set_ddram_address(DDRAM_LINE_3);
|
||||
#else
|
||||
set_ddram_address(DDRAM_LINE_3 + 5);
|
||||
#endif
|
||||
char str[7];
|
||||
int str_length = elapsed.toDigital(str);
|
||||
str[str_length++] = suffix;
|
||||
begin_data();
|
||||
write_str(str, str_length);
|
||||
}
|
||||
|
||||
void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percentage) {
|
||||
// We only have enough room for the feedrate when
|
||||
// we have one extruder
|
||||
// We only have enough room for the feedrate when we have one extruder
|
||||
#if HOTENDS == 1
|
||||
set_ddram_address(DDRAM_LINE_2 + 6);
|
||||
begin_data();
|
||||
@@ -631,11 +581,9 @@ void ST7920_Lite_Status_Screen::draw_status_message() {
|
||||
write_str(str);
|
||||
while (slen < TEXT_MODE_LCD_WIDTH) { write_byte(' '); ++slen; }
|
||||
}
|
||||
else {
|
||||
// String is larger than the available space in screen.
|
||||
else { // String is larger than the available space in ST7920_Lite_Status_Screen::
|
||||
|
||||
// Get a pointer to the next valid UTF8 character
|
||||
// and the string remaining length
|
||||
// Get a pointer to the next valid UTF8 character and the string remaining length
|
||||
uint8_t rlen;
|
||||
const char *stat = ui.status_and_len(rlen);
|
||||
write_str(stat, TEXT_MODE_LCD_WIDTH);
|
||||
@@ -643,12 +591,12 @@ void ST7920_Lite_Status_Screen::draw_status_message() {
|
||||
// If the remaining string doesn't completely fill the screen
|
||||
if (rlen < TEXT_MODE_LCD_WIDTH) {
|
||||
uint8_t chars = TEXT_MODE_LCD_WIDTH - rlen; // Amount of space left in characters
|
||||
write_byte(' '); // Always at 1+ spaces left, draw a space
|
||||
if (--chars) { // Draw a second space if there's room
|
||||
write_byte(' '); // Always at 1+ spaces left, draw a space
|
||||
if (--chars) { // Draw a second space if there's room
|
||||
write_byte(' ');
|
||||
if (--chars) { // Draw a third space if there's room
|
||||
if (--chars) { // Draw a third space if there's room
|
||||
write_byte(' ');
|
||||
if (--chars) write_str(str, chars); // Print a second copy of the message
|
||||
if (--chars) write_str(str, chars); // Print a second copy of the message
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -715,11 +663,155 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Process progress strings
|
||||
#if HAS_PRINT_PROGRESS
|
||||
static char screenstr[8];
|
||||
|
||||
char * ST7920_Lite_Status_Screen::prepare_time_string(const duration_t &time, char prefix) {
|
||||
static char str[6];
|
||||
memset(&screenstr, 0x20, 8); // fill with spaces to avoid artifacts, not doing right-justification to save cycles
|
||||
screenstr[0] = prefix;
|
||||
TERN_(HOTENDS == 1, screenstr[1] = 0x07;) // add bullet • separator when there is space
|
||||
int str_length = time.toDigital(str);
|
||||
memcpy(&screenstr[TERN(HOTENDS == 1, 2, 1)], str, str_length); //memcpy because we can't have terminator
|
||||
return screenstr;
|
||||
}
|
||||
|
||||
void ST7920_Lite_Status_Screen::draw_progress_string(uint8_t addr, const char *str) {
|
||||
set_ddram_address(addr);
|
||||
begin_data();
|
||||
write_str(str, TERN(HOTENDS == 1, 8, 6));
|
||||
}
|
||||
|
||||
#define PPOS (DDRAM_LINE_3 + TERN(HOTENDS == 1, 4, 5)) // progress string position, in 16-bit words
|
||||
|
||||
#if ENABLED(SHOW_PROGRESS_PERCENT)
|
||||
void MarlinUI::drawPercent() { lightUI.drawPercent(); }
|
||||
void ST7920_Lite_Status_Screen::drawPercent() {
|
||||
#define LSHIFT TERN(HOTENDS == 1, 0, 1)
|
||||
const uint8_t progress = ui.get_progress_percent();
|
||||
memset(&screenstr, 0x20, 8); // fill with spaces to avoid artifacts
|
||||
if (progress){
|
||||
memcpy(&screenstr[2 - LSHIFT], \
|
||||
TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)), \
|
||||
TERN(PRINT_PROGRESS_SHOW_DECIMALS, 4, 3));
|
||||
screenstr[(TERN(PRINT_PROGRESS_SHOW_DECIMALS, 6, 5) - LSHIFT)] = '%';
|
||||
draw_progress_string(PPOS, screenstr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
void MarlinUI::drawRemain() { lightUI.drawRemain(); }
|
||||
void ST7920_Lite_Status_Screen::drawRemain() {
|
||||
const duration_t remaint = TERN0(SET_REMAINING_TIME, ui.get_remaining_time());
|
||||
if (printJobOngoing() && remaint.value) {
|
||||
draw_progress_string( PPOS, prepare_time_string(remaint, 'R'));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_INTERACTION_TIME)
|
||||
void MarlinUI::drawInter() { lightUI.drawInter(); }
|
||||
void ST7920_Lite_Status_Screen::drawInter() {
|
||||
const duration_t interactt = ui.interaction_time;
|
||||
if (printingIsActive() && interactt.value) {
|
||||
draw_progress_string( PPOS, prepare_time_string(interactt, 'C'));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_ELAPSED_TIME)
|
||||
void MarlinUI::drawElapsed() { lightUI.drawElapsed(); }
|
||||
void ST7920_Lite_Status_Screen::drawElapsed() {
|
||||
if (printJobOngoing()) {
|
||||
const duration_t elapsedt = print_job_timer.duration();
|
||||
draw_progress_string( PPOS, prepare_time_string(elapsedt, 'E'));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Although this is undocumented, the ST7920 allows the character
|
||||
* data buffer (DDRAM) to be used in conjunction with the graphics
|
||||
* bitmap buffer (CGRAM). The contents of the graphics buffer is
|
||||
* XORed with the data from the character generator. This allows
|
||||
* us to make the progress bar out of graphical data (the bar) and
|
||||
* text data (the percentage).
|
||||
*/
|
||||
void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) {
|
||||
#if HOTENDS == 1
|
||||
// If we have only one extruder, draw a long progress bar on the third line
|
||||
constexpr uint8_t top = 1, // Top in pixels
|
||||
bottom = 13, // Bottom in pixels
|
||||
left = 8, // Left edge, in 16-bit words
|
||||
width = 4; // Width of progress bar, in 16-bit words
|
||||
#else
|
||||
constexpr uint8_t top = 16 + 1,
|
||||
bottom = 16 + 13,
|
||||
left = 5,
|
||||
width = 3;
|
||||
#endif
|
||||
const uint8_t char_pcnt = 100 / width; // How many percent does each 16-bit word represent?
|
||||
|
||||
// Draw the progress bar as a bitmap in CGRAM
|
||||
// This drawing is a mess and only produce readable result around 25% steps
|
||||
// i.e. 74-76% look fine [|||||||||||||||||||||||| ], but 73% look like this: [|||||||||||||||| | ]
|
||||
// meaning partially filled bytes produce only single vertical line, and i bet they're not supposed to!
|
||||
LOOP_S_LE_N(y, top, bottom) {
|
||||
set_gdram_address(left, y);
|
||||
begin_data();
|
||||
LOOP_L_N(x, width) {
|
||||
uint16_t gfx_word = 0x0000;
|
||||
if ((x + 1) * char_pcnt <= value)
|
||||
gfx_word = 0xFFFF; // Draw completely filled bytes
|
||||
else if ((x * char_pcnt) < value)
|
||||
gfx_word = int16_t(0x8000) >> (value % char_pcnt) * 16 / char_pcnt; // Draw partially filled bytes
|
||||
|
||||
// Draw the frame around the progress bar
|
||||
if (y == top || y == bottom)
|
||||
gfx_word = 0xFFFF; // Draw top/bottom border
|
||||
else if (x == width - 1)
|
||||
gfx_word |= 0x0001; // Draw right border
|
||||
else if (x == 0)
|
||||
gfx_word |= 0x8000; // Draw left border
|
||||
write_word(gfx_word);
|
||||
}
|
||||
}
|
||||
|
||||
// // Draw the percentage as text in DDRAM
|
||||
// #if HOTENDS == 1
|
||||
// set_ddram_address(DDRAM_LINE_3 + 4);
|
||||
// begin_data();
|
||||
// write_byte(' ');
|
||||
// #else
|
||||
// set_ddram_address(DDRAM_LINE_2 + left);
|
||||
// begin_data();
|
||||
// #endif
|
||||
|
||||
// // Draw centered
|
||||
// if (value > 9)
|
||||
// write_number(value, 4);
|
||||
// else
|
||||
// write_number(value, 3);
|
||||
// write_str(F("% "));
|
||||
}
|
||||
|
||||
void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) {
|
||||
|
||||
// Since the progress bar involves writing
|
||||
// quite a few bytes to GDRAM, only do this
|
||||
// when an update is actually necessary.
|
||||
|
||||
const uint8_t progress = ui.get_progress_percent();
|
||||
static uint8_t last_progress = 0;
|
||||
if (forceUpdate || last_progress != progress/2) {
|
||||
last_progress = progress/2; // Because progress bar turns out only 62||46px wide, we only need to redraw it every 2%
|
||||
draw_progress_bar(progress);
|
||||
}
|
||||
}
|
||||
#endif // HAS_PRINT_PROGRESS
|
||||
|
||||
void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
|
||||
if (forceUpdate || indicators_changed()) {
|
||||
const bool blink = ui.get_blink();
|
||||
const duration_t elapsed = print_job_timer.duration();
|
||||
duration_t remaining = TERN0(USE_M73_REMAINING_TIME, ui.get_remaining_time());
|
||||
const uint16_t feedrate_perc = feedrate_percentage;
|
||||
const celsius_t extruder_1_temp = thermalManager.wholeDegHotend(0),
|
||||
extruder_1_target = thermalManager.degTargetHotend(0);
|
||||
@@ -736,30 +828,20 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
|
||||
TERN_(HAS_MULTI_HOTEND, draw_extruder_2_temp(extruder_2_temp, extruder_2_target, forceUpdate));
|
||||
TERN_(HAS_HEATED_BED, draw_bed_temp(bed_temp, bed_target, forceUpdate));
|
||||
|
||||
// Update the fan and bed animations
|
||||
uint8_t spd = thermalManager.fan_speed[0];
|
||||
#if ENABLED(ADAPTIVE_FAN_SLOWING)
|
||||
if (!blink && thermalManager.fan_speed_scaler[0] < 128)
|
||||
spd = thermalManager.scaledFanSpeed(0, spd);
|
||||
#endif
|
||||
draw_fan_speed(thermalManager.pwmToPercent(spd));
|
||||
|
||||
// Draw elapsed/remaining time
|
||||
const bool show_remaining = ENABLED(SHOW_REMAINING_TIME) && (DISABLED(ROTATE_PROGRESS_DISPLAY) || blink);
|
||||
if (show_remaining && !remaining.second()) {
|
||||
const auto progress = ui.get_progress_percent();
|
||||
if (progress)
|
||||
remaining = elapsed.second() * (100 - progress) / progress;
|
||||
}
|
||||
if (show_remaining && remaining.second())
|
||||
draw_print_time(remaining, 'R');
|
||||
else
|
||||
draw_print_time(elapsed);
|
||||
if (spd) draw_fan_icon(blink);
|
||||
TERN_(HAS_HEATED_BED, draw_heat_icon(bed_target > 0 && blink, bed_target > 0));
|
||||
|
||||
draw_feedrate_percentage(feedrate_perc);
|
||||
|
||||
// Update the fan and bed animations
|
||||
if (spd) draw_fan_icon(blink);
|
||||
TERN_(HAS_HEATED_BED, draw_heat_icon(bed_target > 0 && blink, bed_target > 0));
|
||||
// Update and draw progress strings
|
||||
TERN_(HAS_PRINT_PROGRESS, ui.rotate_progress());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,27 +921,6 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) {
|
||||
#if EITHER(LCD_SET_PROGRESS_MANUALLY, SDSUPPORT)
|
||||
|
||||
// Since the progress bar involves writing
|
||||
// quite a few bytes to GDRAM, only do this
|
||||
// when an update is actually necessary.
|
||||
|
||||
static uint8_t last_progress = 0;
|
||||
const uint8_t progress = ui.get_progress_percent();
|
||||
if (forceUpdate || last_progress != progress) {
|
||||
last_progress = progress;
|
||||
draw_progress_bar(progress);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
UNUSED(forceUpdate);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void ST7920_Lite_Status_Screen::update(const bool forceUpdate) {
|
||||
cs();
|
||||
update_indicators(forceUpdate);
|
||||
@@ -902,7 +963,7 @@ void ST7920_Lite_Status_Screen::clear_text_buffer() {
|
||||
}
|
||||
|
||||
void MarlinUI::draw_status_screen() {
|
||||
ST7920_Lite_Status_Screen::update(false);
|
||||
lightUI.update(false);
|
||||
}
|
||||
|
||||
// This method is called before each screen update and
|
||||
@@ -912,9 +973,9 @@ void MarlinUI::lcd_in_status(const bool inStatus) {
|
||||
static bool lastInStatus = false;
|
||||
if (lastInStatus == inStatus) return;
|
||||
if ((lastInStatus = inStatus))
|
||||
ST7920_Lite_Status_Screen::on_entry();
|
||||
lightUI.on_entry();
|
||||
else
|
||||
ST7920_Lite_Status_Screen::on_exit();
|
||||
lightUI.on_exit();
|
||||
}
|
||||
|
||||
#endif // LIGHTWEIGHT_UI
|
||||
|
||||
@@ -75,7 +75,6 @@ class ST7920_Lite_Status_Screen {
|
||||
protected:
|
||||
static void draw_degree_symbol(uint8_t x, uint8_t y, const bool draw);
|
||||
static void draw_static_elements();
|
||||
static void draw_progress_bar(const uint8_t value);
|
||||
static void draw_fan_icon(const bool whichIcon);
|
||||
static void draw_heat_icon(const bool whichIcon, const bool heating);
|
||||
static void draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange);
|
||||
@@ -83,7 +82,12 @@ class ST7920_Lite_Status_Screen {
|
||||
static void draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate=false);
|
||||
static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate=false);
|
||||
static void draw_fan_speed(const uint8_t value);
|
||||
static void draw_print_time(const duration_t &elapsed, char suffix=' ');
|
||||
#if HAS_PRINT_PROGRESS
|
||||
static void draw_progress_bar(const uint8_t value);
|
||||
static char* prepare_time_string(const duration_t &time, char prefix=' ');
|
||||
static void draw_progress_string(uint8_t addr, const char *str);
|
||||
static void update_progress(const bool forceUpdate);
|
||||
#endif
|
||||
static void draw_feedrate_percentage(const uint16_t percentage);
|
||||
static void draw_status_message();
|
||||
static void draw_position(const xyze_pos_t &pos, bool position_known=true);
|
||||
@@ -96,11 +100,18 @@ class ST7920_Lite_Status_Screen {
|
||||
static void update_indicators(const bool forceUpdate);
|
||||
static void update_position(const bool forceUpdate, bool resetChecksum);
|
||||
static void update_status_or_position(bool forceUpdate);
|
||||
static void update_progress(const bool forceUpdate);
|
||||
|
||||
public:
|
||||
static void update(const bool forceUpdate);
|
||||
static void on_entry();
|
||||
static void on_exit();
|
||||
static void clear_text_buffer();
|
||||
#if HAS_PRINT_PROGRESS
|
||||
static void drawPercent();
|
||||
static void drawRemain();
|
||||
static void drawInter();
|
||||
static void drawElapsed();
|
||||
#endif
|
||||
};
|
||||
|
||||
extern ST7920_Lite_Status_Screen lightUI;
|
||||
|
||||
@@ -733,7 +733,7 @@ void CrealityDWINClass::Draw_Print_Screen() {
|
||||
Update_Status_Bar(true);
|
||||
Draw_Print_ProgressBar();
|
||||
Draw_Print_ProgressElapsed();
|
||||
TERN_(USE_M73_REMAINING_TIME, Draw_Print_ProgressRemain());
|
||||
TERN_(SET_REMAINING_TIME, Draw_Print_ProgressRemain());
|
||||
Draw_Print_Filename(true);
|
||||
}
|
||||
|
||||
@@ -759,7 +759,7 @@ void CrealityDWINClass::Draw_Print_ProgressBar() {
|
||||
DWIN_Draw_String(false, DWIN_FONT_MENU, GetColor(eeprom_settings.progress_percent, Percent_Color), Color_Bg_Black, 133, 133, F("%"));
|
||||
}
|
||||
|
||||
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
|
||||
void CrealityDWINClass::Draw_Print_ProgressRemain() {
|
||||
uint16_t remainingtime = ui.get_remaining_time();
|
||||
@@ -2772,7 +2772,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
case ADVANCED_LA:
|
||||
if (draw) {
|
||||
Draw_Menu_Item(row, ICON_MaxAccelerated, F("Lin Advance Kp"));
|
||||
Draw_Menu_Item(row, ICON_MaxAccelerated, F("Lin Advance K"));
|
||||
Draw_Float(planner.extruder_advance_K[0], row, false, 100);
|
||||
}
|
||||
else
|
||||
@@ -4565,8 +4565,8 @@ void CrealityDWINClass::Start_Print(bool sd) {
|
||||
}
|
||||
else
|
||||
strcpy_P(filename, PSTR("Host Print"));
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(0));
|
||||
TERN_(USE_M73_REMAINING_TIME, ui.set_remaining_time(0));
|
||||
TERN_(SET_PROGRESS_PERCENT, ui.set_progress(0));
|
||||
TERN_(SET_REMAINING_TIME, ui.set_remaining_time(0));
|
||||
Draw_Print_Screen();
|
||||
}
|
||||
}
|
||||
@@ -4575,8 +4575,8 @@ void CrealityDWINClass::Stop_Print() {
|
||||
printing = false;
|
||||
sdprint = false;
|
||||
thermalManager.cooldown();
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(100 * (PROGRESS_SCALE)));
|
||||
TERN_(USE_M73_REMAINING_TIME, ui.set_remaining_time(0));
|
||||
TERN_(SET_PROGRESS_PERCENT, ui.set_progress(100 * (PROGRESS_SCALE)));
|
||||
TERN_(SET_REMAINING_TIME, ui.set_remaining_time(0));
|
||||
Draw_Print_confirm();
|
||||
}
|
||||
|
||||
@@ -4653,7 +4653,7 @@ void CrealityDWINClass::Screen_Update() {
|
||||
if (process == Print) {
|
||||
Draw_Print_ProgressBar();
|
||||
Draw_Print_ProgressElapsed();
|
||||
TERN_(USE_M73_REMAINING_TIME, Draw_Print_ProgressRemain());
|
||||
TERN_(SET_REMAINING_TIME, Draw_Print_ProgressRemain());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
static void Draw_Print_Screen();
|
||||
static void Draw_Print_Filename(const bool reset=false);
|
||||
static void Draw_Print_ProgressBar();
|
||||
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
static void Draw_Print_ProgressRemain();
|
||||
#endif
|
||||
static void Draw_Print_ProgressElapsed();
|
||||
|
||||
@@ -374,11 +374,11 @@ void MarlinUI::draw_status_screen() {
|
||||
|
||||
#if ENABLED(DWIN_MARLINUI_PORTRAIT)
|
||||
|
||||
// Portrait mode only shows one value at a time, and will rotate if ROTATE_PROGRESS_DISPLAY
|
||||
// Portrait mode only shows one value at a time, and will rotate if many are enabled
|
||||
dwin_string.set();
|
||||
char prefix = ' ';
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
if (TERN1(ROTATE_PROGRESS_DISPLAY, blink) && print_job_timer.isRunning()) {
|
||||
if (blink && print_job_timer.isRunning()) {
|
||||
time = get_remaining_time();
|
||||
prefix = 'R';
|
||||
}
|
||||
@@ -447,7 +447,7 @@ void MarlinUI::draw_status_screen() {
|
||||
//if (pb_solid < old_solid)
|
||||
DWIN_Draw_Rectangle(1, Color_Bg_Black, pb_left + 1 + pb_solid, pb_top + 1, pb_right - 1, pb_bottom - 1); // Erase the rest
|
||||
|
||||
#if ENABLED(SHOW_SD_PERCENT)
|
||||
#if ENABLED(SHOW_PROGRESS_PERCENT)
|
||||
dwin_string.set(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(progress), ui8tostr3rj(progress / (PROGRESS_SCALE))));
|
||||
dwin_string.add('%');
|
||||
DWIN_Draw_String(
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
#if DISABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
|
||||
#warning "INDIVIDUAL_AXIS_HOMING_SUBMENU is recommended with ProUI."
|
||||
#endif
|
||||
#if DISABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#warning "LCD_SET_PROGRESS_MANUALLY is recommended with ProUI."
|
||||
#if DISABLED(SET_PROGRESS_MANUALLY)
|
||||
#warning "SET_PROGRESS_MANUALLY is recommended with ProUI."
|
||||
#endif
|
||||
#if DISABLED(STATUS_MESSAGE_SCROLLING)
|
||||
#warning "STATUS_MESSAGE_SCROLLING is recommended with ProUI."
|
||||
|
||||
@@ -46,6 +46,12 @@
|
||||
#define SENDLINE_DBG_PGM_VAL(x,y,z) sendLine_P(PSTR(x))
|
||||
#endif
|
||||
|
||||
// Append ".gcode" to filename, if requested. Used for some DGUS-clone displays with built-in filter.
|
||||
// Filenames are limited to 26 characters, so the actual name for the FILENAME can be 20 characters at most.
|
||||
// If a longer string is desired without "extension, use the ALTNAME macro to provide a (longer) alternative.
|
||||
#define SPECIAL_MENU_FILENAME(A) A TERN_(ANYCUBIC_LCD_GCODE_EXT, ".gcode")
|
||||
#define SPECIAL_MENU_ALTNAME(A, B) TERN(ANYCUBIC_LCD_GCODE_EXT, A ".gcode", B)
|
||||
|
||||
AnycubicTFTClass AnycubicTFT;
|
||||
|
||||
char AnycubicTFTClass::TFTcmdbuffer[TFTBUFSIZE][TFT_MAX_CMD_SIZE];
|
||||
@@ -383,8 +389,8 @@ void AnycubicTFTClass::RenderCurrentFileList() {
|
||||
if (!isMediaInserted() && !SpecialMenu) {
|
||||
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02");
|
||||
|
||||
SENDLINE_PGM("<Special_Menu>");
|
||||
SENDLINE_PGM("<Special_Menu>");
|
||||
SENDLINE_PGM("<SPECI~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Special Menu>"));
|
||||
}
|
||||
else {
|
||||
if (CodeSeen('S'))
|
||||
@@ -403,58 +409,58 @@ void AnycubicTFTClass::RenderSpecialMenu(uint16_t selectedNumber) {
|
||||
switch (selectedNumber) {
|
||||
#if ENABLED(PROBE_MANUALLY)
|
||||
case 0: // First Page
|
||||
SENDLINE_PGM("<01ZUp0.1>");
|
||||
SENDLINE_PGM("<Z Up 0.1>");
|
||||
SENDLINE_PGM("<02ZUp0.02>");
|
||||
SENDLINE_PGM("<Z Up 0.02>");
|
||||
SENDLINE_PGM("<03ZDn0.02>");
|
||||
SENDLINE_PGM("<Z Down 0.02>");
|
||||
SENDLINE_PGM("<04ZDn0.1>");
|
||||
SENDLINE_PGM("<Z Down 0.1>");
|
||||
SENDLINE_PGM("<01ZUP~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Z Up 0.1>"));
|
||||
SENDLINE_PGM("<02ZUP~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Z Up 0.02>"));
|
||||
SENDLINE_PGM("<03ZDO~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Z Down 0.02>"));
|
||||
SENDLINE_PGM("<04ZDO~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Z Down 0.1>"));
|
||||
break;
|
||||
|
||||
case 4: // Second Page
|
||||
SENDLINE_PGM("<05PrehtBed>");
|
||||
SENDLINE_PGM("<Preheat bed>");
|
||||
SENDLINE_PGM("<06SMeshLvl>");
|
||||
SENDLINE_PGM("<Start Mesh Leveling>");
|
||||
SENDLINE_PGM("<07MeshNPnt>");
|
||||
SENDLINE_PGM("<Next Mesh Point>");
|
||||
SENDLINE_PGM("<08HtEndPID>");
|
||||
SENDLINE_PGM("<Auto Tune Hotend PID>");
|
||||
SENDLINE_PGM("<05PRE~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Preheat Bed>"));
|
||||
SENDLINE_PGM("<06MES~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_ALTNAME("<Mesh Leveling>", "<Start Mesh Leveling>"));
|
||||
SENDLINE_PGM("<07NEX~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Next Mesh Point>"));
|
||||
SENDLINE_PGM("<08PID~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<PID Tune Hotend>"));
|
||||
break;
|
||||
|
||||
case 8: // Third Page
|
||||
SENDLINE_PGM("<09HtBedPID>");
|
||||
SENDLINE_PGM("<Auto Tune Hotbed PID>");
|
||||
SENDLINE_PGM("<10FWDeflts>");
|
||||
SENDLINE_PGM("<Load FW Defaults>");
|
||||
SENDLINE_PGM("<11SvEEPROM>");
|
||||
SENDLINE_PGM("<Save EEPROM>");
|
||||
SENDLINE_PGM("<Exit>");
|
||||
SENDLINE_PGM("<Exit>");
|
||||
SENDLINE_PGM("<09PID~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<PID Tune Hotbed>"));
|
||||
SENDLINE_PGM("<10FWD~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Load FW Defaults>"));
|
||||
SENDLINE_PGM("<11SAV~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Save EEPROM>"));
|
||||
SENDLINE_PGM("<EXIT_~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Exit>"));
|
||||
break;
|
||||
#else
|
||||
case 0: // First Page
|
||||
SENDLINE_PGM("<01PrehtBed>");
|
||||
SENDLINE_PGM("<Preheat bed>");
|
||||
SENDLINE_PGM("<02ABL>");
|
||||
SENDLINE_PGM("<Auto Bed Leveling>");
|
||||
SENDLINE_PGM("<03HtEndPID>");
|
||||
SENDLINE_PGM("<Auto Tune Hotend PID>");
|
||||
SENDLINE_PGM("<04HtBedPID>");
|
||||
SENDLINE_PGM("<Auto Tune Hotbed PID>");
|
||||
SENDLINE_PGM("<01PRE~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Preheat Bed>"));
|
||||
SENDLINE_PGM("<02ABL~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Auto Bed Leveling>"));
|
||||
SENDLINE_PGM("<03PID~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_ALTNAME("<PID Tune Hotend>", "<Auto Tune Hotend PID>"));
|
||||
SENDLINE_PGM("<04PID~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_ALTNAME("<PID Tune Hotbed>", "<Auto Tune Hotbed PID>"));
|
||||
break;
|
||||
|
||||
case 4: // Second Page
|
||||
SENDLINE_PGM("<05FWDeflts>");
|
||||
SENDLINE_PGM("<Load FW Defaults>");
|
||||
SENDLINE_PGM("<06SvEEPROM>");
|
||||
SENDLINE_PGM("<Save EEPROM>");
|
||||
SENDLINE_PGM("<07SendM108>");
|
||||
SENDLINE_PGM("<Send User Confirmation>");
|
||||
SENDLINE_PGM("<Exit>");
|
||||
SENDLINE_PGM("<Exit>");
|
||||
SENDLINE_PGM("<05FWD~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Load FW Defaults>"));
|
||||
SENDLINE_PGM("<06SAV~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Save EEPROM>"));
|
||||
SENDLINE_PGM("<06SEN~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_ALTNAME("<User Confirmation>", "<Send User Confirmation>"));
|
||||
SENDLINE_PGM("<EXIT_~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Exit>"));
|
||||
break;
|
||||
|
||||
#endif // PROBE_MANUALLY
|
||||
@@ -478,8 +484,8 @@ void AnycubicTFTClass::RenderCurrentFolder(uint16_t selectedNumber) {
|
||||
for (cnt = selectedNumber; cnt <= max_files; cnt++) {
|
||||
if (cnt == 0) { // Special Entry
|
||||
if (currentFileList.isAtRootDir()) {
|
||||
SENDLINE_PGM("<specialmnu>");
|
||||
SENDLINE_PGM("<Special Menu>");
|
||||
SENDLINE_PGM("<SPECI~1.GCO");
|
||||
SENDLINE_PGM(SPECIAL_MENU_FILENAME("<Special Menu>"));
|
||||
}
|
||||
else {
|
||||
SENDLINE_PGM("/..");
|
||||
|
||||
@@ -63,7 +63,7 @@ const uint16_t VPList_Main[] PROGMEM = {
|
||||
VP_XPos, VP_YPos, VP_ZPos,
|
||||
VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#if ENABLED(SET_PROGRESS_PERCENT)
|
||||
VP_PrintProgress_Percentage,
|
||||
#endif
|
||||
0x0000
|
||||
|
||||
@@ -63,7 +63,7 @@ const uint16_t VPList_Main[] PROGMEM = {
|
||||
VP_XPos, VP_YPos, VP_ZPos,
|
||||
VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#if ENABLED(SET_PROGRESS_PERCENT)
|
||||
VP_PrintProgress_Percentage,
|
||||
#endif
|
||||
0x0000
|
||||
|
||||
@@ -135,7 +135,7 @@ const uint16_t VPList_Main[] PROGMEM = {
|
||||
VP_XPos, VP_YPos, VP_ZPos,
|
||||
VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#if ENABLED(SET_PROGRESS_PERCENT)
|
||||
VP_PrintProgress_Percentage,
|
||||
#endif
|
||||
0x0000
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
#include "../../../MarlinCore.h"
|
||||
|
||||
#define DEBUG_DGUSLCD // Uncomment for debug messages
|
||||
//#define DEBUG_DGUSLCD // Uncomment for debug messages
|
||||
#define DEBUG_OUT ENABLED(DEBUG_DGUSLCD)
|
||||
#include "../../../core/debug_out.h"
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "../../../feature/powerloss.h"
|
||||
#endif
|
||||
|
||||
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
#include "../../marlinui.h"
|
||||
#endif
|
||||
|
||||
@@ -244,7 +244,7 @@ void disp_fan_speed() {
|
||||
}
|
||||
|
||||
void disp_print_time() {
|
||||
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
const uint32_t r = ui.get_remaining_time();
|
||||
sprintf_P(public_buf_l, PSTR("%02d:%02d R"), r / 3600, (r % 3600) / 60);
|
||||
#else
|
||||
|
||||
@@ -709,17 +709,17 @@ namespace ExtUI {
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
bool getPowerLossRecoveryEnabled() { return recovery.enabled; }
|
||||
void setPowerLossRecoveryEnabled(const bool value) { recovery.enable(value); }
|
||||
void setPowerLossRecoveryEnabled(const bool value) { recovery.enable(value); }
|
||||
#endif
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
float getLinearAdvance_mm_mm_s(const extruder_t extruder) {
|
||||
return (extruder < EXTRUDERS) ? planner.extruder_advance_K[extruder - E0] : 0;
|
||||
return (extruder < EXTRUDERS) ? planner.extruder_advance_K[E_INDEX_N(extruder - E0)] : 0;
|
||||
}
|
||||
|
||||
void setLinearAdvance_mm_mm_s(const_float_t value, const extruder_t extruder) {
|
||||
if (extruder < EXTRUDERS)
|
||||
planner.extruder_advance_K[extruder - E0] = constrain(value, 0, 10);
|
||||
planner.extruder_advance_K[E_INDEX_N(extruder - E0)] = constrain(value, 0, 10);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -164,6 +164,9 @@ namespace ExtUI {
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
inline uint32_t getProgress_seconds_remaining() { return ui.get_remaining_time(); }
|
||||
#endif
|
||||
#if ENABLED(SHOW_INTERACTION_TIME)
|
||||
inline uint32_t getInteraction_seconds_remaining() { return ui.interaction_time; }
|
||||
#endif
|
||||
|
||||
#if HAS_LEVELING
|
||||
bool getLevelingActive();
|
||||
|
||||
@@ -418,6 +418,12 @@ namespace Language_en {
|
||||
LSTR MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *");
|
||||
LSTR MSG_FILAMENT_UNLOAD = _UxGT("Unload mm");
|
||||
LSTR MSG_FILAMENT_LOAD = _UxGT("Load mm");
|
||||
LSTR MSG_SEGMENTS_PER_SECOND = _UxGT("Segments/Sec");
|
||||
LSTR MSG_DRAW_MIN_X = _UxGT("Draw Min X");
|
||||
LSTR MSG_DRAW_MAX_X = _UxGT("Draw Max X");
|
||||
LSTR MSG_DRAW_MIN_Y = _UxGT("Draw Min Y");
|
||||
LSTR MSG_DRAW_MAX_Y = _UxGT("Draw Max Y");
|
||||
LSTR MSG_MAX_BELT_LEN = _UxGT("Max Belt Len");
|
||||
LSTR MSG_ADVANCE_K = _UxGT("Advance K");
|
||||
LSTR MSG_ADVANCE_K_E = _UxGT("Advance K *");
|
||||
LSTR MSG_CONTRAST = _UxGT("LCD Contrast");
|
||||
|
||||
+50
-25
@@ -79,11 +79,16 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
||||
statusResetFunc_t MarlinUI::status_reset_callback; // = nullptr
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
MarlinUI::progress_t MarlinUI::progress_override; // = 0
|
||||
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY)
|
||||
#if ENABLED(SET_PROGRESS_PERCENT)
|
||||
MarlinUI::progress_t MarlinUI::progress_override; // = 0
|
||||
#endif
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
uint32_t MarlinUI::remaining_time;
|
||||
#endif
|
||||
#if ENABLED(SET_INTERACTION_TIME)
|
||||
uint32_t MarlinUI::interaction_time;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_MULTI_LANGUAGE
|
||||
@@ -153,7 +158,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
||||
bool MarlinUI::lcd_clicked;
|
||||
#endif
|
||||
|
||||
#if EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_JYERSUI)
|
||||
#if LCD_WITH_BLINK
|
||||
|
||||
bool MarlinUI::get_blink() {
|
||||
static uint8_t blink = 0;
|
||||
@@ -191,11 +196,12 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
||||
|
||||
uint8_t MarlinUI::sleep_timeout_minutes; // Initialized by settings.load()
|
||||
millis_t MarlinUI::screen_timeout_millis = 0;
|
||||
void MarlinUI::refresh_screen_timeout() {
|
||||
screen_timeout_millis = sleep_timeout_minutes ? millis() + sleep_timeout_minutes * 60UL * 1000UL : 0;
|
||||
sleep_display(false);
|
||||
}
|
||||
|
||||
#if DISABLED(TFT_COLOR_UI)
|
||||
void MarlinUI::refresh_screen_timeout() {
|
||||
screen_timeout_millis = sleep_timeout_minutes ? millis() + sleep_timeout_minutes * 60UL * 1000UL : 0;
|
||||
sleep_display(false);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void MarlinUI::init() {
|
||||
@@ -1067,7 +1073,7 @@ void MarlinUI::init() {
|
||||
|
||||
#if LCD_BACKLIGHT_TIMEOUT_MINS
|
||||
refresh_backlight_timeout();
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
#elif HAS_DISPLAY_SLEEP && DISABLED(TFT_COLOR_UI)
|
||||
refresh_screen_timeout();
|
||||
#endif
|
||||
|
||||
@@ -1180,9 +1186,9 @@ void MarlinUI::init() {
|
||||
WRITE(LCD_BACKLIGHT_PIN, LOW); // Backlight off
|
||||
backlight_off_ms = 0;
|
||||
}
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
#elif HAS_DISPLAY_SLEEP && DISABLED(TFT_COLOR_UI)
|
||||
if (screen_timeout_millis && ELAPSED(ms, screen_timeout_millis))
|
||||
sleep_display();
|
||||
sleep_display(true);
|
||||
#endif
|
||||
|
||||
// Change state of drawing flag between screen updates
|
||||
@@ -1678,19 +1684,6 @@ void MarlinUI::init() {
|
||||
print_job_timer.start(); // Also called by M24
|
||||
}
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
|
||||
MarlinUI::progress_t MarlinUI::_get_progress() {
|
||||
return (
|
||||
TERN0(LCD_SET_PROGRESS_MANUALLY, (progress_override & PROGRESS_MASK))
|
||||
#if ENABLED(SDSUPPORT)
|
||||
?: TERN(HAS_PRINT_PROGRESS_PERMYRIAD, card.permyriadDone(), card.percentDone())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if HAS_TOUCH_BUTTONS
|
||||
|
||||
//
|
||||
@@ -1724,6 +1717,38 @@ void MarlinUI::init() {
|
||||
|
||||
#endif // HAS_DISPLAY
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
|
||||
MarlinUI::progress_t MarlinUI::_get_progress() {
|
||||
return (
|
||||
TERN0(SET_PROGRESS_PERCENT, (progress_override & PROGRESS_MASK))
|
||||
#if ENABLED(SDSUPPORT)
|
||||
?: TERN(HAS_PRINT_PROGRESS_PERMYRIAD, card.permyriadDone(), card.percentDone())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
#if LCD_WITH_BLINK && DISABLED(HAS_GRAPHICAL_TFT)
|
||||
typedef void (*PrintProgress_t)();
|
||||
void MarlinUI::rotate_progress() { // Renew and redraw all enabled progress strings
|
||||
const PrintProgress_t progFunc[] = {
|
||||
OPTITEM(SHOW_PROGRESS_PERCENT, drawPercent)
|
||||
OPTITEM(SHOW_ELAPSED_TIME, drawElapsed)
|
||||
OPTITEM(SHOW_REMAINING_TIME, drawRemain)
|
||||
OPTITEM(SHOW_INTERACTION_TIME, drawInter)
|
||||
};
|
||||
static bool prev_blink;
|
||||
static uint8_t i;
|
||||
if (prev_blink != get_blink()) {
|
||||
prev_blink = get_blink();
|
||||
if (++i >= COUNT(progFunc)) i = 0;
|
||||
(*progFunc[i])();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // HAS_PRINT_PROGRESS
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "../sd/cardreader.h"
|
||||
#include "../module/motion.h"
|
||||
#include "../libs/buzzer.h"
|
||||
|
||||
#include "buttons.h"
|
||||
|
||||
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
|
||||
@@ -36,7 +35,7 @@
|
||||
#define MULTI_E_MANUAL 1
|
||||
#endif
|
||||
|
||||
#if HAS_DISPLAY
|
||||
#if HAS_PRINT_PROGRESS
|
||||
#include "../module/printcounter.h"
|
||||
#endif
|
||||
|
||||
@@ -86,6 +85,7 @@ typedef bool (*statusResetFunc_t)();
|
||||
#endif // HAS_WIRED_LCD
|
||||
|
||||
#if EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_JYERSUI)
|
||||
#define LCD_WITH_BLINK 1
|
||||
#define LCD_UPDATE_INTERVAL TERN(HAS_TOUCH_BUTTONS, 50, 100)
|
||||
#endif
|
||||
|
||||
@@ -303,19 +303,19 @@ public:
|
||||
#define PROGRESS_SCALE 1U
|
||||
#define PROGRESS_MASK 0x7F
|
||||
#endif
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#if ENABLED(SET_PROGRESS_PERCENT)
|
||||
static progress_t progress_override;
|
||||
static void set_progress(const progress_t p) { progress_override = _MIN(p, 100U * (PROGRESS_SCALE)); }
|
||||
static void set_progress_done() { progress_override = (PROGRESS_MASK + 1U) + 100U * (PROGRESS_SCALE); }
|
||||
static void progress_reset() { if (progress_override & (PROGRESS_MASK + 1U)) set_progress(0); }
|
||||
#endif
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
#if EITHER(SHOW_REMAINING_TIME, SET_PROGRESS_MANUALLY)
|
||||
static uint32_t _calculated_remaining_time() {
|
||||
const duration_t elapsed = print_job_timer.duration();
|
||||
const progress_t progress = _get_progress();
|
||||
return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0;
|
||||
}
|
||||
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
static uint32_t remaining_time;
|
||||
FORCE_INLINE static void set_remaining_time(const uint32_t r) { remaining_time = r; }
|
||||
FORCE_INLINE static uint32_t get_remaining_time() { return remaining_time ?: _calculated_remaining_time(); }
|
||||
@@ -323,12 +323,32 @@ public:
|
||||
#else
|
||||
FORCE_INLINE static uint32_t get_remaining_time() { return _calculated_remaining_time(); }
|
||||
#endif
|
||||
#if ENABLED(SET_INTERACTION_TIME)
|
||||
static uint32_t interaction_time;
|
||||
FORCE_INLINE static void set_interaction_time(const uint32_t r) { interaction_time = r; }
|
||||
FORCE_INLINE static void reset_interaction_time() { set_interaction_time(0); }
|
||||
#endif
|
||||
#endif
|
||||
static progress_t _get_progress();
|
||||
#if HAS_PRINT_PROGRESS_PERMYRIAD
|
||||
FORCE_INLINE static uint16_t get_progress_permyriad() { return _get_progress(); }
|
||||
#endif
|
||||
static uint8_t get_progress_percent() { return uint8_t(_get_progress() / (PROGRESS_SCALE)); }
|
||||
#if LCD_WITH_BLINK
|
||||
#if ENABLED(SHOW_PROGRESS_PERCENT)
|
||||
static void drawPercent();
|
||||
#endif
|
||||
#if ENABLED(SHOW_ELAPSED_TIME)
|
||||
static void drawElapsed();
|
||||
#endif
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
static void drawRemain();
|
||||
#endif
|
||||
#if ENABLED(SHOW_INTERACTION_TIME)
|
||||
static void drawInter();
|
||||
#endif
|
||||
static void rotate_progress();
|
||||
#endif
|
||||
#else
|
||||
static constexpr uint8_t get_progress_percent() { return 0; }
|
||||
#endif
|
||||
@@ -390,7 +410,7 @@ public:
|
||||
static void poweroff();
|
||||
#endif
|
||||
|
||||
#if EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_JYERSUI)
|
||||
#if LCD_WITH_BLINK
|
||||
static bool get_blink();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
|
||||
|
||||
TERN_(HAS_TOUCH_BUTTONS, repeat_delay = BUTTON_DELAY_MENU);
|
||||
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, progress_reset());
|
||||
TERN_(SET_PROGRESS_PERCENT, progress_reset());
|
||||
|
||||
#if BOTH(DOUBLECLICK_FOR_Z_BABYSTEPPING, BABYSTEPPING)
|
||||
static millis_t doubleclick_expire_ms = 0;
|
||||
|
||||
@@ -157,9 +157,9 @@ void menu_backlash();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
#if EXTRUDERS == 1
|
||||
#if DISTINCT_E < 2
|
||||
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10);
|
||||
#elif HAS_MULTI_EXTRUDER
|
||||
#else
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_N(float42_52, e, MSG_ADVANCE_K_E, &planner.extruder_advance_K[e], 0, 10);
|
||||
#endif
|
||||
@@ -677,10 +677,20 @@ void menu_advanced_settings() {
|
||||
|
||||
#if DISABLED(SLIM_LCD_MENUS)
|
||||
|
||||
#if ENABLED(POLARGRAPH)
|
||||
// M665 - Polargraph Settings
|
||||
if (!is_busy) {
|
||||
EDIT_ITEM_FAST(float4, MSG_SEGMENTS_PER_SECOND, &segments_per_second, 100, 9999); // M665 S
|
||||
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MIN_X, &draw_area_min.x, X_MIN_POS, draw_area_max.x - 10); // M665 L
|
||||
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MAX_X, &draw_area_max.x, draw_area_min.x + 10, X_MAX_POS); // M665 R
|
||||
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MIN_Y, &draw_area_min.y, Y_MIN_POS, draw_area_max.y - 10); // M665 T
|
||||
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MAX_Y, &draw_area_max.y, draw_area_min.y + 10, Y_MAX_POS); // M665 B
|
||||
EDIT_ITEM_FAST(float51sign, MSG_MAX_BELT_LEN, &polargraph_max_belt_len, 500, 2000); // M665 H
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_M206_COMMAND
|
||||
//
|
||||
// Set Home Offsets
|
||||
//
|
||||
// M428 - Set Home Offsets
|
||||
ACTION_ITEM(MSG_SET_HOME_OFFSETS, []{ queue.inject(F("M428")); ui.return_to_status(); });
|
||||
#endif
|
||||
|
||||
@@ -732,11 +742,11 @@ void menu_advanced_settings() {
|
||||
#if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
SUBMENU(MSG_FILAMENT, menu_advanced_filament);
|
||||
#elif ENABLED(LIN_ADVANCE)
|
||||
#if EXTRUDERS == 1
|
||||
#if DISTINCT_E < 2
|
||||
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10);
|
||||
#elif HAS_MULTI_EXTRUDER
|
||||
LOOP_L_N(n, E_STEPPERS)
|
||||
EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10);
|
||||
#else
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[e], 0, 10);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -550,7 +550,7 @@ void menu_configuration() {
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT_MINS
|
||||
EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.backlight_timeout_minutes, ui.backlight_timeout_min, ui.backlight_timeout_max, ui.refresh_backlight_timeout);
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
#elif HAS_DISPLAY_SLEEP && DISABLED(TFT_COLOR_UI)
|
||||
EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.sleep_timeout_minutes, ui.sleep_timeout_min, ui.sleep_timeout_max, ui.refresh_screen_timeout);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -210,9 +210,9 @@ void menu_tune() {
|
||||
// Advance K:
|
||||
//
|
||||
#if ENABLED(LIN_ADVANCE) && DISABLED(SLIM_LCD_MENUS)
|
||||
#if EXTRUDERS == 1
|
||||
#if DISTINCT_E < 2
|
||||
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10);
|
||||
#elif HAS_MULTI_EXTRUDER
|
||||
#else
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_N(float42_52, e, MSG_ADVANCE_K_E, &planner.extruder_advance_K[e], 0, 10);
|
||||
#endif
|
||||
|
||||
@@ -124,6 +124,8 @@
|
||||
#define THERMISTOR_NAME "ATC104GT-2 1K"
|
||||
#elif THERMISTOR_ID == 1047
|
||||
#define THERMISTOR_NAME "PT1000 4K7"
|
||||
#elif THERMISTOR_ID == 1022
|
||||
#define THERMISTOR_NAME "PT1000 2K2"
|
||||
#elif THERMISTOR_ID == 1010
|
||||
#define THERMISTOR_NAME "PT1000 1K"
|
||||
#elif THERMISTOR_ID == 147
|
||||
@@ -139,7 +141,7 @@
|
||||
#elif THERMISTOR_ID == 61
|
||||
#define THERMISTOR_NAME "Formbot 350°C"
|
||||
#elif THERMISTOR_ID == 66
|
||||
#define THERMISTOR_NAME "Dyze 4.7M"
|
||||
#define THERMISTOR_NAME "Dyze / TL 4.7M"
|
||||
#elif THERMISTOR_ID == 67
|
||||
#define THERMISTOR_NAME "SliceEng 450°C"
|
||||
|
||||
|
||||
@@ -73,10 +73,10 @@ const char* i8tostr3rj(const int8_t x) {
|
||||
}
|
||||
|
||||
#if HAS_PRINT_PROGRESS_PERMYRIAD
|
||||
// Convert unsigned 16-bit permyriad to percent with 100 / 23 / 23.4 / 3.45 format
|
||||
// Convert unsigned 16-bit permyriad to percent with 100 / 23.4 / 3.45 format
|
||||
const char* permyriadtostr4(const uint16_t xx) {
|
||||
if (xx >= 10000)
|
||||
return "100";
|
||||
return " 100"; // space to keep 4-width alignment
|
||||
else if (xx >= 1000) {
|
||||
conv[3] = DIGIMOD(xx, 1000);
|
||||
conv[4] = DIGIMOD(xx, 100);
|
||||
|
||||
@@ -75,8 +75,8 @@ struct vector_3 {
|
||||
vector_3 operator-(const vector_3 &v) { return vector_3(x - v.x, y - v.y, z - v.z); }
|
||||
vector_3 operator*(const float &v) { return vector_3(x * v, y * v, z * v); }
|
||||
|
||||
operator xy_float_t() { return xy_float_t({ x, y }); }
|
||||
operator xyz_float_t() { return xyz_float_t({ x, y, z }); }
|
||||
operator xy_float_t() { return xy_float_t({ x OPTARG(HAS_Y_AXIS, y) }); }
|
||||
operator xyz_float_t() { return xyz_float_t({ x OPTARG(HAS_Y_AXIS, y) OPTARG(HAS_Z_AXIS, z) }); }
|
||||
|
||||
void debug(FSTR_P const title);
|
||||
};
|
||||
|
||||
@@ -341,7 +341,6 @@ void report_current_position_projected() {
|
||||
can_reach = (
|
||||
a < polargraph_max_belt_len + 1
|
||||
&& b < polargraph_max_belt_len + 1
|
||||
&& (a + b) > _MIN(draw_area_size.x, draw_area_size.y)
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -562,7 +561,8 @@ void do_blocking_move_to(NUM_AXIS_ARGS(const float), const_feedRate_t fr_mm_s/*=
|
||||
const feedRate_t w_feedrate = fr_mm_s ?: homing_feedrate(W_AXIS)
|
||||
);
|
||||
|
||||
#if IS_KINEMATIC
|
||||
#if IS_KINEMATIC && DISABLED(POLARGRAPH)
|
||||
// kinematic machines are expected to home to a point 1.5x their range? never reachable.
|
||||
if (!position_is_reachable(x, y)) return;
|
||||
destination = current_position; // sync destination at the start
|
||||
#endif
|
||||
@@ -919,11 +919,16 @@ void restore_feedrate_and_scaling() {
|
||||
constexpr xy_pos_t offs{0};
|
||||
#endif
|
||||
|
||||
if (TERN1(IS_SCARA, axis_was_homed(X_AXIS) && axis_was_homed(Y_AXIS))) {
|
||||
const float dist_2 = HYPOT2(target.x - offs.x, target.y - offs.y);
|
||||
if (dist_2 > delta_max_radius_2)
|
||||
target *= float(delta_max_radius / SQRT(dist_2)); // 200 / 300 = 0.66
|
||||
}
|
||||
#if ENABLED(POLARGRAPH)
|
||||
LIMIT(target.x, draw_area_min.x, draw_area_max.x);
|
||||
LIMIT(target.y, draw_area_min.y, draw_area_max.y);
|
||||
#else
|
||||
if (TERN1(IS_SCARA, axis_was_homed(X_AXIS) && axis_was_homed(Y_AXIS))) {
|
||||
const float dist_2 = HYPOT2(target.x - offs.x, target.y - offs.y);
|
||||
if (dist_2 > delta_max_radius_2)
|
||||
target *= float(delta_max_radius / SQRT(dist_2)); // 200 / 300 = 0.66
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ float Planner::previous_nominal_speed;
|
||||
#endif
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
float Planner::extruder_advance_K[EXTRUDERS]; // Initialized by settings.load()
|
||||
float Planner::extruder_advance_K[DISTINCT_E]; // Initialized by settings.load()
|
||||
#endif
|
||||
|
||||
#if HAS_POSITION_FLOAT
|
||||
@@ -801,9 +801,12 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t
|
||||
decelerate_steps = 0;
|
||||
|
||||
if (accel != 0) {
|
||||
// Steps required for acceleration, deceleration to/from nominal rate
|
||||
const float nominal_rate_sq = sq(float(block->nominal_rate));
|
||||
float accelerate_steps_float = (nominal_rate_sq - sq(float(initial_rate))) * (0.5f / accel);
|
||||
inverse_accel = 1.0f / accel;
|
||||
const float half_inverse_accel = 0.5f * inverse_accel,
|
||||
nominal_rate_sq = sq(float(block->nominal_rate)),
|
||||
// Steps required for acceleration, deceleration to/from nominal rate
|
||||
decelerate_steps_float = half_inverse_accel * (nominal_rate_sq - sq(float(final_rate)));
|
||||
float accelerate_steps_float = half_inverse_accel * (nominal_rate_sq - sq(float(initial_rate)));
|
||||
accelerate_steps = CEIL(accelerate_steps_float);
|
||||
const float decelerate_steps_float = (nominal_rate_sq - sq(float(final_rate))) * (0.5f / accel);
|
||||
decelerate_steps = FLOOR(decelerate_steps_float);
|
||||
@@ -851,7 +854,7 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
if (block->la_advance_rate) {
|
||||
const float comp = extruder_advance_K[block->extruder] * block->steps.e / block->step_event_count;
|
||||
const float comp = extruder_advance_K[E_INDEX_N(block->extruder)] * block->steps.e / block->step_event_count;
|
||||
block->max_adv_steps = cruise_rate * comp;
|
||||
block->final_adv_steps = final_rate * comp;
|
||||
}
|
||||
@@ -2241,7 +2244,6 @@ bool Planner::_populate_block(
|
||||
|
||||
TERN_(MIXING_EXTRUDER, mixer.populate_block(block->b_color));
|
||||
|
||||
|
||||
#if HAS_FAN
|
||||
FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i];
|
||||
#endif
|
||||
@@ -2538,7 +2540,7 @@ bool Planner::_populate_block(
|
||||
*
|
||||
* de > 0 : Extruder is running forward (e.g., for "Wipe while retracting" (Slic3r) or "Combing" (Cura) moves)
|
||||
*/
|
||||
use_advance_lead = esteps && extruder_advance_K[extruder] && de > 0;
|
||||
use_advance_lead = esteps && extruder_advance_K[E_INDEX_N(extruder)] && de > 0;
|
||||
|
||||
if (use_advance_lead) {
|
||||
float e_D_ratio = (target_float.e - position_float.e) /
|
||||
@@ -2554,7 +2556,7 @@ bool Planner::_populate_block(
|
||||
use_advance_lead = false;
|
||||
else {
|
||||
// Scale E acceleration so that it will be possible to jump to the advance speed.
|
||||
const uint32_t max_accel_steps_per_s2 = MAX_E_JERK(extruder) / (extruder_advance_K[extruder] * e_D_ratio) * steps_per_mm;
|
||||
const uint32_t max_accel_steps_per_s2 = MAX_E_JERK(extruder) / (extruder_advance_K[E_INDEX_N(extruder)] * e_D_ratio) * steps_per_mm;
|
||||
if (TERN0(LA_DEBUG, accel > max_accel_steps_per_s2))
|
||||
SERIAL_ECHOLNPGM("Acceleration limited.");
|
||||
NOMORE(accel, max_accel_steps_per_s2);
|
||||
@@ -2591,7 +2593,7 @@ bool Planner::_populate_block(
|
||||
|
||||
if (use_advance_lead) {
|
||||
// the Bresenham algorithm will convert this step rate into extruder steps
|
||||
block->la_advance_rate = extruder_advance_K[extruder] * block->acceleration_steps_per_s2;
|
||||
block->la_advance_rate = extruder_advance_K[E_INDEX_N(extruder)] * block->acceleration_steps_per_s2;
|
||||
|
||||
// reduce LA ISR frequency by calling it only often enough to ensure that there will
|
||||
// never be more than four extruder steps per call
|
||||
|
||||
@@ -192,11 +192,11 @@ typedef struct PlannerBlock {
|
||||
|
||||
volatile block_flags_t flag; // Block flags
|
||||
|
||||
volatile bool is_fan_sync() { return TERN0(LASER_SYNCHRONOUS_M106_M107, flag.sync_fans); }
|
||||
volatile bool is_pwr_sync() { return TERN0(LASER_POWER_SYNC, flag.sync_laser_pwr); }
|
||||
volatile bool is_sync() { return flag.sync_position || is_fan_sync() || is_pwr_sync(); }
|
||||
volatile bool is_page() { return TERN0(DIRECT_STEPPING, flag.page); }
|
||||
volatile bool is_move() { return !(is_sync() || is_page()); }
|
||||
bool is_fan_sync() { return TERN0(LASER_SYNCHRONOUS_M106_M107, flag.sync_fans); }
|
||||
bool is_pwr_sync() { return TERN0(LASER_POWER_SYNC, flag.sync_laser_pwr); }
|
||||
bool is_sync() { return flag.sync_position || is_fan_sync() || is_pwr_sync(); }
|
||||
bool is_page() { return TERN0(DIRECT_STEPPING, flag.page); }
|
||||
bool is_move() { return !(is_sync() || is_page()); }
|
||||
|
||||
// Fields used by the motion planner to manage acceleration
|
||||
float nominal_speed, // The nominal speed for this block in (mm/sec)
|
||||
@@ -459,7 +459,7 @@ class Planner {
|
||||
#endif
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
static float extruder_advance_K[EXTRUDERS];
|
||||
static float extruder_advance_K[DISTINCT_E];
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,17 +37,12 @@
|
||||
#include "../lcd/marlinui.h"
|
||||
#include "../MarlinCore.h"
|
||||
|
||||
float segments_per_second; // Initialized by settings.load()
|
||||
|
||||
xy_pos_t draw_area_min = { X_MIN_POS, Y_MIN_POS },
|
||||
draw_area_max = { X_MAX_POS, Y_MAX_POS };
|
||||
|
||||
xy_float_t draw_area_size = { X_MAX_POS - X_MIN_POS, Y_MAX_POS - Y_MIN_POS };
|
||||
|
||||
float polargraph_max_belt_len = HYPOT(draw_area_size.x, draw_area_size.y);
|
||||
// Initialized by settings.load()
|
||||
float segments_per_second, polargraph_max_belt_len;
|
||||
xy_pos_t draw_area_min, draw_area_max;
|
||||
|
||||
void inverse_kinematics(const xyz_pos_t &raw) {
|
||||
const float x1 = raw.x - (draw_area_min.x), x2 = (draw_area_max.x) - raw.x, y = raw.y - (draw_area_max.y);
|
||||
const float x1 = raw.x - draw_area_min.x, x2 = draw_area_max.x - raw.x, y = raw.y - draw_area_max.y;
|
||||
delta.set(HYPOT(x1, y), HYPOT(x2, y), raw.z);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
extern float segments_per_second;
|
||||
extern xy_pos_t draw_area_min, draw_area_max;
|
||||
extern xy_float_t draw_area_size;
|
||||
extern float polargraph_max_belt_len;
|
||||
|
||||
void inverse_kinematics(const xyz_pos_t &raw);
|
||||
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
|
||||
#else
|
||||
|
||||
static constexpr xyz_pos_t offset = xyz_pos_t(NUM_AXIS_ARRAY(0, 0, 0, 0, 0, 0)); // See #16767
|
||||
static constexpr xyz_pos_t offset = xyz_pos_t(NUM_AXIS_ARRAY_1(0)); // See #16767
|
||||
|
||||
static bool set_deployed(const bool) { return false; }
|
||||
|
||||
|
||||
@@ -115,8 +115,8 @@
|
||||
#include "../feature/runout.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTRA_LIN_ADVANCE_K)
|
||||
extern float other_extruder_advance_K[EXTRUDERS];
|
||||
#if ENABLED(ADVANCE_K_EXTRA)
|
||||
extern float other_extruder_advance_K[DISTINCT_E];
|
||||
#endif
|
||||
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
@@ -257,7 +257,7 @@ typedef struct SettingsDataStruct {
|
||||
// HAS_BED_PROBE
|
||||
//
|
||||
|
||||
xyz_pos_t probe_offset;
|
||||
xyz_pos_t probe_offset; // M851 X Y Z
|
||||
|
||||
//
|
||||
// ABL_PLANAR
|
||||
@@ -330,7 +330,11 @@ typedef struct SettingsDataStruct {
|
||||
delta_diagonal_rod; // M665 L
|
||||
abc_float_t delta_tower_angle_trim, // M665 X Y Z
|
||||
delta_diagonal_rod_trim; // M665 A B C
|
||||
#elif ENABLED(POLARGRAPH)
|
||||
xy_pos_t draw_area_min, draw_area_max; // M665 L R T B
|
||||
float polargraph_max_belt_len; // M665 H
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -442,7 +446,7 @@ typedef struct SettingsDataStruct {
|
||||
//
|
||||
// LIN_ADVANCE
|
||||
//
|
||||
float planner_extruder_advance_K[_MAX(EXTRUDERS, 1)]; // M900 K planner.extruder_advance_K
|
||||
float planner_extruder_advance_K[DISTINCT_E]; // M900 K planner.extruder_advance_K
|
||||
|
||||
//
|
||||
// HAS_MOTOR_CURRENT_PWM
|
||||
@@ -468,7 +472,7 @@ typedef struct SettingsDataStruct {
|
||||
//
|
||||
// SKEW_CORRECTION
|
||||
//
|
||||
skew_factor_t planner_skew_factor; // M852 I J K planner.skew_factor
|
||||
skew_factor_t planner_skew_factor; // M852 I J K
|
||||
|
||||
//
|
||||
// ADVANCED_PAUSE_FEATURE
|
||||
@@ -642,7 +646,7 @@ void MarlinSettings::postprocess() {
|
||||
|
||||
#if LCD_BACKLIGHT_TIMEOUT_MINS
|
||||
ui.refresh_backlight_timeout();
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
#elif HAS_DISPLAY_SLEEP && DISABLED(TFT_COLOR_UI)
|
||||
ui.refresh_screen_timeout();
|
||||
#endif
|
||||
}
|
||||
@@ -991,6 +995,11 @@ void MarlinSettings::postprocess() {
|
||||
EEPROM_WRITE(delta_diagonal_rod); // 1 float
|
||||
EEPROM_WRITE(delta_tower_angle_trim); // 3 floats
|
||||
EEPROM_WRITE(delta_diagonal_rod_trim); // 3 floats
|
||||
#elif ENABLED(POLARGRAPH)
|
||||
_FIELD_TEST(draw_area_min);
|
||||
EEPROM_WRITE(draw_area_min); // 2 floats
|
||||
EEPROM_WRITE(draw_area_max); // 2 floats
|
||||
EEPROM_WRITE(polargraph_max_belt_len); // 1 float
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -1425,6 +1434,14 @@ void MarlinSettings::postprocess() {
|
||||
_FIELD_TEST(planner_skew_factor);
|
||||
EEPROM_WRITE(planner.skew_factor);
|
||||
|
||||
//
|
||||
// POLARGRAPH
|
||||
//
|
||||
#if ENABLED(POLARGRAPH)
|
||||
_FIELD_TEST(polargraph_max_belt_len);
|
||||
EEPROM_WRITE(polargraph_max_belt_len);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Advanced Pause filament load & unload lengths
|
||||
//
|
||||
@@ -1932,6 +1949,11 @@ void MarlinSettings::postprocess() {
|
||||
EEPROM_READ(delta_diagonal_rod); // 1 float
|
||||
EEPROM_READ(delta_tower_angle_trim); // 3 floats
|
||||
EEPROM_READ(delta_diagonal_rod_trim); // 3 floats
|
||||
#elif ENABLED(POLARGRAPH)
|
||||
_FIELD_TEST(draw_area_min);
|
||||
EEPROM_READ(draw_area_min); // 2 floats
|
||||
EEPROM_READ(draw_area_max); // 2 floats
|
||||
EEPROM_READ(polargraph_max_belt_len); // 1 float
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -2330,7 +2352,7 @@ void MarlinSettings::postprocess() {
|
||||
// Linear Advance
|
||||
//
|
||||
{
|
||||
float extruder_advance_K[_MAX(EXTRUDERS, 1)];
|
||||
float extruder_advance_K[DISTINCT_E];
|
||||
_FIELD_TEST(planner_extruder_advance_K);
|
||||
EEPROM_READ(extruder_advance_K);
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
@@ -2999,6 +3021,10 @@ void MarlinSettings::reset() {
|
||||
delta_diagonal_rod = DELTA_DIAGONAL_ROD;
|
||||
delta_tower_angle_trim = dta;
|
||||
delta_diagonal_rod_trim = ddr;
|
||||
#elif ENABLED(POLARGRAPH)
|
||||
draw_area_min.set(X_MIN_POS, Y_MIN_POS);
|
||||
draw_area_max.set(X_MAX_POS, Y_MAX_POS);
|
||||
polargraph_max_belt_len = POLARGRAPH_MAX_BELT_LEN;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -3170,7 +3196,7 @@ void MarlinSettings::reset() {
|
||||
#if LCD_BACKLIGHT_TIMEOUT_MINS
|
||||
ui.backlight_timeout_minutes = LCD_BACKLIGHT_TIMEOUT_MINS;
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
ui.sleep_timeout_minutes = DISPLAY_SLEEP_MINUTES;
|
||||
ui.sleep_timeout_minutes = TERN(TOUCH_SCREEN, TOUCH_IDLE_SLEEP_MINS, DISPLAY_SLEEP_MINUTES);
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -3209,12 +3235,17 @@ void MarlinSettings::reset() {
|
||||
//
|
||||
// Linear Advance
|
||||
//
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
EXTRUDER_LOOP() {
|
||||
planner.extruder_advance_K[e] = LIN_ADVANCE_K;
|
||||
TERN_(EXTRA_LIN_ADVANCE_K, other_extruder_advance_K[e] = LIN_ADVANCE_K);
|
||||
}
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
constexpr float linAdvanceK[] = ADVANCE_K;
|
||||
EXTRUDER_LOOP() {
|
||||
const float a = linAdvanceK[_MAX(e, COUNT(linAdvanceK) - 1)];
|
||||
planner.extruder_advance_K[e] = a;
|
||||
TERN_(ADVANCE_K_EXTRA, other_extruder_advance_K[e] = a);
|
||||
}
|
||||
#else
|
||||
planner.extruder_advance_K[0] = ADVANCE_K;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -3490,9 +3521,7 @@ void MarlinSettings::reset() {
|
||||
//
|
||||
// LCD Preheat Settings
|
||||
//
|
||||
#if HAS_PREHEAT
|
||||
gcode.M145_report(forReplay);
|
||||
#endif
|
||||
TERN_(HAS_PREHEAT, gcode.M145_report(forReplay));
|
||||
|
||||
//
|
||||
// PID
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "../MarlinCore.h"
|
||||
#include "../HAL/shared/Delay.h"
|
||||
#include "../lcd/marlinui.h"
|
||||
#include "../gcode/gcode.h"
|
||||
|
||||
#include "temperature.h"
|
||||
#include "endstops.h"
|
||||
@@ -63,10 +64,6 @@
|
||||
#include "../feature/host_actions.h"
|
||||
#endif
|
||||
|
||||
#if EITHER(HAS_TEMP_SENSOR, LASER_FEATURE)
|
||||
#include "../gcode/gcode.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(NOZZLE_PARK_FEATURE)
|
||||
#include "../libs/nozzle.h"
|
||||
#endif
|
||||
@@ -1848,6 +1845,14 @@ void Temperature::task() {
|
||||
emergency_parser.quickstop_by_M410 = false; // quickstop_stepper may call idle so clear this now!
|
||||
quickstop_stepper();
|
||||
}
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
if (emergency_parser.sd_abort_by_M524) { // abort SD print immediately
|
||||
emergency_parser.sd_abort_by_M524 = false;
|
||||
card.flag.abort_sd_printing = true;
|
||||
gcode.process_subcommands_now(F("M524"));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!updateTemperaturesIfReady()) return; // Will also reset the watchdog if temperatures are ready
|
||||
@@ -2641,7 +2646,7 @@ void Temperature::init() {
|
||||
temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
|
||||
}while(0)
|
||||
|
||||
#define _MINMAX_TEST(N,M) (HOTENDS > N && TEMP_SENSOR_##N > 0 && TEMP_SENSOR_##N != 998 && TEMP_SENSOR_##N != 999 && defined(HEATER_##N##_##M##TEMP))
|
||||
#define _MINMAX_TEST(N,M) (HOTENDS > N && TEMP_SENSOR(N) > 0 && TEMP_SENSOR(N) != 998 && TEMP_SENSOR(N) != 999 && defined(HEATER_##N##_##M##TEMP))
|
||||
|
||||
#if _MINMAX_TEST(0, MIN)
|
||||
_TEMP_MIN_E(0);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2022 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/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define REVERSE_TEMP_SENSOR_RANGE_1022 1
|
||||
|
||||
// Pt1000 with 1k0 pullup
|
||||
constexpr temp_entry_t temptable_1022[] PROGMEM = {
|
||||
PtLine( 0, 1000, 2200),
|
||||
PtLine( 25, 1000, 2200),
|
||||
PtLine( 50, 1000, 2200),
|
||||
PtLine( 75, 1000, 2200),
|
||||
PtLine(100, 1000, 2200),
|
||||
PtLine(125, 1000, 2200),
|
||||
PtLine(150, 1000, 2200),
|
||||
PtLine(175, 1000, 2200),
|
||||
PtLine(200, 1000, 2200),
|
||||
PtLine(225, 1000, 2200),
|
||||
PtLine(250, 1000, 2200),
|
||||
PtLine(275, 1000, 2200),
|
||||
PtLine(300, 1000, 2200),
|
||||
PtLine(350, 1000, 2200),
|
||||
PtLine(400, 1000, 2200),
|
||||
PtLine(450, 1000, 2200),
|
||||
PtLine(500, 1000, 2200)
|
||||
};
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
* 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
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
* 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
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// R25 = 2.5 MOhm, beta25 = 4500 K, 4.7 kOhm pull-up, DyzeDesign 500 °C Thermistor
|
||||
// R25 = 2.5 MOhm, beta25 = 4500 K, 4.7 kOhm pull-up, DyzeDesign / Trianglelab T-D500 500 °C Thermistor
|
||||
constexpr temp_entry_t temptable_66[] PROGMEM = {
|
||||
{ OV( 17.5), 850 },
|
||||
{ OV( 17.9), 500 },
|
||||
|
||||
@@ -193,6 +193,9 @@ typedef struct { raw_adc_t value; celsius_t celsius; } temp_entry_t;
|
||||
#if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup
|
||||
#include "thermistor_1010.h"
|
||||
#endif
|
||||
#if ANY_THERMISTOR_IS(1022) // Pt1000 with 2k2 pullup
|
||||
#include "thermistor_1022.h"
|
||||
#endif
|
||||
#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup
|
||||
#include "thermistor_1047.h"
|
||||
#endif
|
||||
@@ -335,7 +338,7 @@ static_assert(255 > TEMPTABLE_0_LEN || 255 > TEMPTABLE_1_LEN || 255 > TEMPTABLE_
|
||||
// For thermocouples the highest temperature results in the highest ADC value
|
||||
|
||||
#define _TT_REV(N) REVERSE_TEMP_SENSOR_RANGE_##N
|
||||
#define TT_REV(N) TERN0(TEMP_SENSOR_##N##_IS_THERMISTOR, DEFER4(_TT_REV)(TEMP_SENSOR_##N))
|
||||
#define TT_REV(N) TERN0(TEMP_SENSOR_##N##_IS_THERMISTOR, DEFER4(_TT_REV)(TEMP_SENSOR(N)))
|
||||
#define _TT_REVRAW(N) !TEMP_SENSOR_##N##_IS_THERMISTOR
|
||||
#define TT_REVRAW(N) (TT_REV(N) || _TT_REVRAW(N))
|
||||
|
||||
|
||||
@@ -440,6 +440,11 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // TOOL_SENSOR
|
||||
|
||||
#if ENABLED(SWITCHING_TOOLHEAD)
|
||||
|
||||
inline void switching_toolhead_lock(const bool locked) {
|
||||
#ifdef SWITCHING_TOOLHEAD_SERVO_ANGLES
|
||||
const uint16_t swt_angles[2] = SWITCHING_TOOLHEAD_SERVO_ANGLES;
|
||||
@@ -452,8 +457,6 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
|
||||
#endif
|
||||
}
|
||||
|
||||
#include <bitset>
|
||||
|
||||
void swt_init() {
|
||||
switching_toolhead_lock(true);
|
||||
|
||||
@@ -494,10 +497,6 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
|
||||
#endif // TOOL_SENSOR
|
||||
}
|
||||
|
||||
#endif // TOOL_SENSOR
|
||||
|
||||
#if ENABLED(SWITCHING_TOOLHEAD)
|
||||
|
||||
inline void switching_toolhead_tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
if (no_move) return;
|
||||
|
||||
|
||||
@@ -450,6 +450,19 @@
|
||||
#ifndef TOUCH_OFFSET_Y
|
||||
#define TOUCH_OFFSET_Y 1
|
||||
#endif
|
||||
#elif ENABLED(TFT_RES_1024x600)
|
||||
#ifndef TOUCH_CALIBRATION_X
|
||||
#define TOUCH_CALIBRATION_X 65533
|
||||
#endif
|
||||
#ifndef TOUCH_CALIBRATION_Y
|
||||
#define TOUCH_CALIBRATION_Y 38399
|
||||
#endif
|
||||
#ifndef TOUCH_OFFSET_X
|
||||
#define TOUCH_OFFSET_X 2
|
||||
#endif
|
||||
#ifndef TOUCH_OFFSET_Y
|
||||
#define TOUCH_OFFSET_Y 1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#if NO_EEPROM_SELECTED
|
||||
//#define I2C_EEPROM // EEPROM on I2C-0
|
||||
//#define SDCARD_EEPROM_EMULATION
|
||||
//#undef NO_EEPROM_SELECTED
|
||||
#endif
|
||||
|
||||
#if ENABLED(I2C_EEPROM)
|
||||
|
||||
@@ -591,6 +591,8 @@
|
||||
#include "stm32f1/pins_CREALITY_V24S1_301.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple
|
||||
#elif MB(CREALITY_V25S1)
|
||||
#include "stm32f1/pins_CREALITY_V25S1.h" // STM32F1 env:STM32F103RE_creality_smartPro env:STM32F103RE_creality_smartPro_maple
|
||||
#elif MB(CREALITY_V521)
|
||||
#include "stm32f1/pins_CREALITY_V521.h" // STM32F103VE env:STM32F103VE_creality
|
||||
#elif MB(TRIGORILLA_PRO)
|
||||
#include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro env:trigorilla_pro_maple env:trigorilla_pro_disk
|
||||
#elif MB(FLY_MINI)
|
||||
@@ -707,6 +709,8 @@
|
||||
#include "stm32f4/pins_OPULO_LUMEN_REV4.h" // STM32F4 env:Opulo_Lumen_REV4
|
||||
#elif MB(FYSETC_SPIDER_KING407)
|
||||
#include "stm32f4/pins_FYSETC_SPIDER_KING407.h" // STM32F4 env:FYSETC_SPIDER_KING407
|
||||
#elif MB(MKS_SKIPR_V1)
|
||||
#include "stm32f4/pins_MKS_SKIPR_V1_0.h" // STM32F4 env:mks_skipr_v1 env:mks_skipr_v1_nobootloader
|
||||
|
||||
//
|
||||
// ARM Cortex M7
|
||||
|
||||
@@ -136,27 +136,56 @@
|
||||
|
||||
#ifndef FAN1_PIN
|
||||
#ifdef MK3_FAN_PINS
|
||||
#define FAN1_PIN -1
|
||||
#define FAN1_PIN -1
|
||||
#else
|
||||
#define FAN1_PIN 6
|
||||
#define FAN1_PIN 6
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ------ ------ ------
|
||||
* 84 PH2 | 1 2 | PH6 9 50 MISO | 1 2 | SCK 52 62 PK0 | 1 2 | PJ5 76
|
||||
* 61 PF7 | 3 4 | PD5 82 72 PJ2 | 3 4 | SDSS 77 20 SDA | 3 4 | GND
|
||||
* 59 PF5 | 5 6 PG4 70 14 TX3 | 5 6 MOSI 51 21 SCL | 5 6 RX2 16
|
||||
* 85 PH7 | 7 8 | PG3 71 15 RX3 | 7 8 | RESET GND | 7 8 | TX2 17
|
||||
* GND | 9 10 | 5V GND | 9 10 | PE3 5 5V | 9 10 | 5V
|
||||
* ------ ------ ------
|
||||
* P1 P2 P3
|
||||
*/
|
||||
|
||||
#define EXP1_01_PIN 84
|
||||
#define EXP1_02_PIN 9
|
||||
#define EXP1_03_PIN 61
|
||||
#define EXP1_04_PIN 82
|
||||
#define EXP1_05_PIN 59
|
||||
#define EXP1_06_PIN 70
|
||||
#define EXP1_07_PIN 85
|
||||
#define EXP1_08_PIN 71
|
||||
|
||||
#define EXP2_01_PIN 50
|
||||
#define EXP2_02_PIN 52
|
||||
#define EXP2_03_PIN 72
|
||||
#define EXP2_04_PIN 77
|
||||
#define EXP2_05_PIN 14
|
||||
#define EXP2_06_PIN 51
|
||||
#define EXP2_07_PIN 15
|
||||
#define EXP2_08_PIN -1
|
||||
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
#define SDSS 77
|
||||
#define SDSS EXP2_04_PIN
|
||||
#define LED_PIN 13
|
||||
|
||||
#ifndef CASE_LIGHT_PIN
|
||||
#define CASE_LIGHT_PIN 9
|
||||
#define CASE_LIGHT_PIN EXP1_02_PIN
|
||||
#endif
|
||||
|
||||
//
|
||||
// M3/M4/M5 - Spindle/Laser Control
|
||||
//
|
||||
// use P1 connector for spindle pins
|
||||
#define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM
|
||||
#define SPINDLE_LASER_PWM_PIN EXP1_02_PIN // Hardware PWM
|
||||
#define SPINDLE_LASER_ENA_PIN 18 // Pullup!
|
||||
#define SPINDLE_DIR_PIN 19
|
||||
|
||||
@@ -179,20 +208,20 @@
|
||||
#if IS_ULTIPANEL || TOUCH_UI_ULTIPANEL
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
#define LCD_PINS_RS 85
|
||||
#define LCD_PINS_ENABLE 71
|
||||
#define LCD_PINS_D4 70
|
||||
#define BTN_EN1 61
|
||||
#define BTN_EN2 59
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
#define BTN_EN1 EXP1_03_PIN
|
||||
#define BTN_EN2 EXP1_05_PIN
|
||||
#else
|
||||
#define LCD_PINS_RS 82
|
||||
#define LCD_PINS_ENABLE 61
|
||||
#define LCD_PINS_D4 59
|
||||
#define LCD_PINS_D5 70
|
||||
#define LCD_PINS_D6 85
|
||||
#define LCD_PINS_D7 71
|
||||
#define BTN_EN1 14
|
||||
#define BTN_EN2 72
|
||||
#define LCD_PINS_RS EXP1_04_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_03_PIN
|
||||
#define LCD_PINS_D4 EXP1_05_PIN
|
||||
#define LCD_PINS_D5 EXP1_06_PIN
|
||||
#define LCD_PINS_D6 EXP1_07_PIN
|
||||
#define LCD_PINS_D7 EXP1_08_PIN
|
||||
#define BTN_EN1 EXP2_05_PIN
|
||||
#define BTN_EN2 EXP2_03_PIN
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
|
||||
@@ -200,9 +229,9 @@
|
||||
|
||||
#endif
|
||||
|
||||
#define BTN_ENC 9 // AUX-2
|
||||
#define BEEPER_PIN 84 // AUX-4
|
||||
#define SD_DETECT_PIN 15
|
||||
#define BTN_ENC EXP1_02_PIN // P1
|
||||
#define BEEPER_PIN EXP1_01_PIN // P1
|
||||
#define SD_DETECT_PIN EXP2_07_PIN
|
||||
|
||||
#endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL
|
||||
#endif // HAS_WIRED_LCD
|
||||
|
||||
@@ -161,91 +161,125 @@
|
||||
#define SDIO_SUPPORT
|
||||
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
|
||||
|
||||
#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
|
||||
|
||||
/**
|
||||
* RET6 12864 LCD
|
||||
* ------
|
||||
* PC6 | 1 2 | PB2
|
||||
* PB10 | 3 4 | PB11
|
||||
* PB14 5 6 | PB13
|
||||
* PB12 | 7 8 | PB15
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
*/
|
||||
#define EXP3_01_PIN PC6
|
||||
#define EXP3_02_PIN PB2
|
||||
#define EXP3_03_PIN PB10
|
||||
#define EXP3_04_PIN PB11
|
||||
#define EXP3_05_PIN PB14
|
||||
#define EXP3_06_PIN PB13
|
||||
#define EXP3_07_PIN PB12
|
||||
#define EXP3_08_PIN PB15
|
||||
|
||||
#elif EITHER(VET6_12864_LCD, DWIN_VET6_CREALITY_LCD)
|
||||
|
||||
/**
|
||||
* VET6 12864 LCD
|
||||
* ------
|
||||
* ? | 1 2 | PC5
|
||||
* PB10 | 3 4 | ?
|
||||
* PA6 5 6 | PA5
|
||||
* PA4 | 7 8 | PA7
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
*/
|
||||
#define EXP3_01_PIN -1
|
||||
#define EXP3_02_PIN PC5
|
||||
#define EXP3_03_PIN PB10
|
||||
#define EXP3_04_PIN -1
|
||||
#define EXP3_05_PIN PA6
|
||||
#define EXP3_06_PIN PA5
|
||||
#define EXP3_07_PIN PA4
|
||||
#define EXP3_08_PIN PA7
|
||||
|
||||
#elif EITHER(CR10_STOCKDISPLAY, FYSETC_MINI_12864_2_1)
|
||||
#error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for the LCD with the Creality V4 controller."
|
||||
#endif
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#if ENABLED(RET6_12864_LCD)
|
||||
#define LCD_PINS_RS EXP3_07_PIN
|
||||
#define LCD_PINS_ENABLE EXP3_08_PIN
|
||||
#define LCD_PINS_D4 EXP3_06_PIN
|
||||
|
||||
/**
|
||||
* RET6 12864 LCD
|
||||
* ------
|
||||
* PC6 | 1 2 | PB2
|
||||
* PB10 | 3 4 | PE8
|
||||
* PB14 5 6 | PB13
|
||||
* PB12 | 7 8 | PB15
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
* EXP1
|
||||
*/
|
||||
#define EXP1_01_PIN PC6
|
||||
#define EXP1_02_PIN PB2
|
||||
#define EXP1_03_PIN PB10
|
||||
#define EXP1_04_PIN PE8
|
||||
#define EXP1_05_PIN PB14
|
||||
#define EXP1_06_PIN PB13
|
||||
#define EXP1_07_PIN PB12
|
||||
#define EXP1_08_PIN PB15
|
||||
#define BTN_ENC EXP3_02_PIN
|
||||
#define BTN_EN1 EXP3_03_PIN
|
||||
#define BTN_EN2 EXP3_05_PIN
|
||||
|
||||
#ifndef HAS_PIN_27_BOARD
|
||||
#define BEEPER_PIN EXP1_01_PIN
|
||||
#endif
|
||||
|
||||
#elif ENABLED(VET6_12864_LCD)
|
||||
|
||||
/**
|
||||
* VET6 12864 LCD
|
||||
* ------
|
||||
* ? | 1 2 | PC5
|
||||
* PB10 | 3 4 | ?
|
||||
* PA6 5 6 | PA5
|
||||
* PA4 | 7 8 | PA7
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
* EXP1
|
||||
*/
|
||||
#define EXP1_01_PIN -1
|
||||
#define EXP1_02_PIN PC5
|
||||
#define EXP1_03_PIN PB10
|
||||
#define EXP1_04_PIN -1
|
||||
#define EXP1_05_PIN PA6
|
||||
#define EXP1_06_PIN PA5
|
||||
#define EXP1_07_PIN PA4
|
||||
#define EXP1_08_PIN PA7
|
||||
|
||||
#else
|
||||
#error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the Creality V4 controller."
|
||||
#ifndef HAS_PIN_27_BOARD
|
||||
#define BEEPER_PIN EXP3_01_PIN
|
||||
#endif
|
||||
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
|
||||
#define BTN_ENC EXP1_02_PIN
|
||||
#define BTN_EN1 EXP1_03_PIN
|
||||
#define BTN_EN2 EXP1_05_PIN
|
||||
|
||||
#elif ANY(HAS_DWIN_E3V2, IS_DWIN_MARLINUI, DWIN_VET6_CREALITY_LCD)
|
||||
|
||||
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
|
||||
// RET6 DWIN ENCODER LCD
|
||||
#define EXP1_05_PIN PB14
|
||||
#define EXP1_06_PIN PB13
|
||||
#define EXP1_07_PIN PB12
|
||||
#define EXP1_08_PIN PB15
|
||||
//#define LCD_LED_PIN PB2
|
||||
#else
|
||||
// VET6 DWIN ENCODER LCD
|
||||
#define EXP1_05_PIN PA6
|
||||
#define EXP1_06_PIN PA5
|
||||
#define EXP1_07_PIN PA4
|
||||
#define EXP1_08_PIN PA7
|
||||
#endif
|
||||
|
||||
#define BTN_ENC EXP1_05_PIN
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_07_PIN
|
||||
#define BTN_ENC EXP3_05_PIN
|
||||
#define BTN_EN1 EXP3_08_PIN
|
||||
#define BTN_EN2 EXP3_07_PIN
|
||||
|
||||
#ifndef BEEPER_PIN
|
||||
#define BEEPER_PIN EXP1_06_PIN
|
||||
#define BEEPER_PIN EXP3_06_PIN
|
||||
#endif
|
||||
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
|
||||
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
|
||||
#error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_CREALITY_V4.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning."
|
||||
#endif
|
||||
|
||||
#if SD_CONNECTION_IS(LCD)
|
||||
#error "The LCD SD Card is not connected with this configuration."
|
||||
#endif
|
||||
|
||||
/**
|
||||
*
|
||||
* Board (RET6 12864 LCD) Display
|
||||
* ------ ------
|
||||
* (EN1) PC6 | 1 2 | PB2 (BTN_ENC) 5V |10 9 | GND
|
||||
* (LCD_CS) PB10 | 3 4 | PB11 (LCD RESET) -- | 8 7 | --
|
||||
* (LCD_A0) PB14 5 6 | PB13 (EN2) (DIN) | 6 5 (LCD RESET)
|
||||
* (LCD_SCK)PB12 | 7 8 | PB15 (MOSI) (LCD_A0) | 4 3 | (LCD_CS)
|
||||
* GND | 9 10 | 5V (BTN_ENC) | 2 1 | --
|
||||
* ------ ------
|
||||
* EXP1 EXP1
|
||||
*
|
||||
* ------
|
||||
* ----- -- |10 9 | --
|
||||
* | 1 | VCC (RESET) | 8 7 | --
|
||||
* | 2 | PA13 (DIN) (MOSI) | 6 5 (EN2)
|
||||
* | 3 | PA14 -- | 4 3 | (EN1)
|
||||
* | 4 | GND (LCD_SCK)| 2 1 | --
|
||||
* ----- ------
|
||||
* Debug port EXP2
|
||||
*
|
||||
* Needs custom cable. Connect EN2-EN2, LCD_CS-LCD_CS and so on.
|
||||
* Debug port is just above EXP1. You need to add pins.
|
||||
*
|
||||
*/
|
||||
|
||||
#define BTN_ENC EXP3_02_PIN
|
||||
#define BTN_EN1 EXP3_01_PIN
|
||||
#define BTN_EN2 EXP3_06_PIN
|
||||
#define BEEPER_PIN -1
|
||||
|
||||
#define DOGLCD_CS EXP3_03_PIN
|
||||
#define DOGLCD_A0 EXP3_05_PIN
|
||||
#define DOGLCD_SCK EXP3_07_PIN
|
||||
#define DOGLCD_MOSI EXP3_08_PIN
|
||||
#define LCD_RESET_PIN EXP3_04_PIN
|
||||
|
||||
#define FORCE_SOFT_SPI
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
#define NEOPIXEL_PIN PA13
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
* 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
|
||||
@@ -22,7 +22,7 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* CREALITY 4.2.10 (STM32F103RE / STM32F103RC) board pin assignments
|
||||
* Creality 4.2.10 (STM32F103RE / STM32F103RC) board pin assignments
|
||||
*/
|
||||
|
||||
#include "env_validate.h"
|
||||
@@ -143,85 +143,75 @@
|
||||
#define SDIO_SUPPORT
|
||||
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
|
||||
|
||||
#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
|
||||
|
||||
/**
|
||||
* RET6 12864 LCD
|
||||
* ------
|
||||
* PC6 | 1 2 | PB2
|
||||
* PB10 | 3 4 | PE8
|
||||
* PB14 5 6 | PB13
|
||||
* PB12 | 7 8 | PB15
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
*/
|
||||
#define EXP3_01_PIN PC6
|
||||
#define EXP3_02_PIN PB2
|
||||
#define EXP3_03_PIN PB10
|
||||
#define EXP3_04_PIN PE8
|
||||
#define EXP3_05_PIN PB14
|
||||
#define EXP3_06_PIN PB13
|
||||
#define EXP3_07_PIN PB12
|
||||
#define EXP3_08_PIN PB15
|
||||
|
||||
#elif EITHER(VET6_12864_LCD, DWIN_VET6_CREALITY_LCD)
|
||||
|
||||
/**
|
||||
* VET6 12864 LCD
|
||||
* ------
|
||||
* ? | 1 2 | PC5
|
||||
* PB10 | 3 4 | ?
|
||||
* PA6 5 6 | PA5
|
||||
* PA4 | 7 8 | PA7
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
*/
|
||||
#define EXP3_01_PIN -1
|
||||
#define EXP3_02_PIN PC5
|
||||
#define EXP3_03_PIN PB10
|
||||
#define EXP3_04_PIN -1
|
||||
#define EXP3_05_PIN PA6
|
||||
#define EXP3_06_PIN PA5
|
||||
#define EXP3_07_PIN PA4
|
||||
#define EXP3_08_PIN PA7
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#if ENABLED(RET6_12864_LCD)
|
||||
|
||||
/**
|
||||
* RET6 12864 LCD
|
||||
* ------
|
||||
* PC6 | 1 2 | PB2
|
||||
* PB10 | 3 4 | PE8
|
||||
* PB14 5 6 | PB13
|
||||
* PB12 | 7 8 | PB15
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
* EXP1
|
||||
*/
|
||||
#define EXP1_01_PIN PC6
|
||||
#define EXP1_02_PIN PB2
|
||||
#define EXP1_03_PIN PB10
|
||||
#define EXP1_04_PIN PE8
|
||||
#define EXP1_05_PIN PB14
|
||||
#define EXP1_06_PIN PB13
|
||||
#define EXP1_07_PIN PB12
|
||||
#define EXP1_08_PIN PB15
|
||||
|
||||
#define BEEPER_PIN EXP1_01_PIN
|
||||
|
||||
#elif ENABLED(VET6_12864_LCD)
|
||||
|
||||
/**
|
||||
* VET6 12864 LCD
|
||||
* ------
|
||||
* ? | 1 2 | PC5
|
||||
* PB10 | 3 4 | ?
|
||||
* PA6 5 6 | PA5
|
||||
* PA4 | 7 8 | PA7
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
* EXP1
|
||||
*/
|
||||
#define EXP1_01_PIN -1
|
||||
#define EXP1_02_PIN PC5
|
||||
#define EXP1_03_PIN PB10
|
||||
#define EXP1_04_PIN -1
|
||||
#define EXP1_05_PIN PA6
|
||||
#define EXP1_06_PIN PA5
|
||||
#define EXP1_07_PIN PA4
|
||||
#define EXP1_08_PIN PA7
|
||||
|
||||
#else
|
||||
#if NONE(RET6_12864_LCD, VET6_12864_LCD)
|
||||
#error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the Creality V4 controller."
|
||||
#endif
|
||||
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
#define LCD_PINS_RS EXP3_07_PIN
|
||||
#define LCD_PINS_ENABLE EXP3_08_PIN
|
||||
#define LCD_PINS_D4 EXP3_06_PIN
|
||||
|
||||
#define BTN_ENC EXP1_02_PIN
|
||||
#define BTN_EN1 EXP1_03_PIN
|
||||
#define BTN_EN2 EXP1_05_PIN
|
||||
#define BTN_ENC EXP3_02_PIN
|
||||
#define BTN_EN1 EXP3_03_PIN
|
||||
#define BTN_EN2 EXP3_05_PIN
|
||||
|
||||
#elif HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
|
||||
#define BEEPER_PIN EXP3_01_PIN
|
||||
|
||||
// RET6 DWIN ENCODER LCD
|
||||
#define BTN_ENC PB14
|
||||
#define BTN_EN1 PB15
|
||||
#define BTN_EN2 PB12
|
||||
#elif ANY(DWIN_VET6_CREALITY_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
|
||||
|
||||
//#define LCD_LED_PIN PB2
|
||||
// RET6 / VET6 DWIN ENCODER LCD
|
||||
#define BTN_ENC EXP3_05_PIN
|
||||
#define BTN_EN1 EXP3_08_PIN
|
||||
#define BTN_EN2 EXP3_07_PIN
|
||||
|
||||
//#define LCD_LED_PIN EXP3_02_PIN
|
||||
#ifndef BEEPER_PIN
|
||||
#define BEEPER_PIN PB13
|
||||
#define BEEPER_PIN EXP3_06_PIN
|
||||
#endif
|
||||
|
||||
#elif ENABLED(DWIN_VET6_CREALITY_LCD)
|
||||
|
||||
// VET6 DWIN ENCODER LCD
|
||||
#define BTN_ENC PA6
|
||||
#define BTN_EN1 PA7
|
||||
#define BTN_EN2 PA4
|
||||
|
||||
#define BEEPER_PIN PA5
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
#define BOARD_INFO_NAME "Creality v4.2.2"
|
||||
#define DEFAULT_MACHINE_NAME "Creality3D"
|
||||
|
||||
#ifndef EMIT_CREALITY_422_WARNING
|
||||
#define EMIT_CREALITY_422_WARNING
|
||||
#endif
|
||||
#define EMIT_CREALITY_422_WARNING
|
||||
|
||||
#include "pins_CREALITY_V4.h"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
* 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
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2022 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/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Creality 5.2.1 (STM32F103RE) board pin assignments
|
||||
*/
|
||||
|
||||
#include "env_validate.h"
|
||||
|
||||
#if HOTENDS > 2 || E_STEPPERS > 2
|
||||
#error "Creality v5.2.1 supports up to 2 hotends / E steppers."
|
||||
#endif
|
||||
|
||||
#ifndef BOARD_INFO_NAME
|
||||
#define BOARD_INFO_NAME "Creality V521"
|
||||
#endif
|
||||
#ifndef DEFAULT_MACHINE_NAME
|
||||
#define DEFAULT_MACHINE_NAME "Creality V5.2.1"
|
||||
#endif
|
||||
|
||||
//
|
||||
// EEPROM
|
||||
//
|
||||
#if NO_EEPROM_SELECTED
|
||||
// FLASH
|
||||
//#define FLASH_EEPROM_EMULATION
|
||||
|
||||
// I2C
|
||||
#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 used only for display settings
|
||||
#if ENABLED(IIC_BL24CXX_EEPROM)
|
||||
#define IIC_EEPROM_SDA PC2
|
||||
#define IIC_EEPROM_SCL PC3
|
||||
#define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
|
||||
#else
|
||||
#define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX
|
||||
#define MARLIN_EEPROM_SIZE 0x800 // 2K
|
||||
#endif
|
||||
|
||||
#undef NO_EEPROM_SELECTED
|
||||
#endif
|
||||
|
||||
//
|
||||
// Servos
|
||||
//
|
||||
#define SERVO0_PIN PD13 // BLTouch OUT
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
//
|
||||
#define X_STOP_PIN PD10 // X
|
||||
#define X2_STOP_PIN PE15 // X2
|
||||
#define Y_STOP_PIN PE0 // Y
|
||||
#define Z_STOP_PIN PE1 // Z
|
||||
#define Z2_STOP_PIN PE2 // Z2
|
||||
|
||||
#ifndef Z_MIN_PROBE_PIN
|
||||
#define Z_MIN_PROBE_PIN PD12 // BLTouch IN
|
||||
#endif
|
||||
|
||||
//
|
||||
// Filament Runout Sensor
|
||||
//
|
||||
#define FIL_RUNOUT_PIN PE5 // "Pulled-high"
|
||||
#define FIL_RUNOUT2_PIN PE6 // "Pulled-high"
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
#define X_ENABLE_PIN PC7
|
||||
#define X_STEP_PIN PD15
|
||||
#define X_DIR_PIN PD14
|
||||
|
||||
#define Y_ENABLE_PIN PB9
|
||||
#define Y_STEP_PIN PB7
|
||||
#define Y_DIR_PIN PB6
|
||||
|
||||
#define Z_ENABLE_PIN PB5
|
||||
#define Z_STEP_PIN PB3
|
||||
#define Z_DIR_PIN PD7
|
||||
|
||||
#define E0_ENABLE_PIN PD4
|
||||
#define E0_STEP_PIN PD1
|
||||
#define E0_DIR_PIN PD0
|
||||
|
||||
#define E1_ENABLE_PIN PE7
|
||||
#define E1_STEP_PIN PB1
|
||||
#define E1_DIR_PIN PB0
|
||||
|
||||
#define X2_ENABLE_PIN PE11
|
||||
#define X2_STEP_PIN PE9
|
||||
#define X2_DIR_PIN PE8
|
||||
|
||||
#define Z2_ENABLE_PIN PC5
|
||||
#define Z2_STEP_PIN PA7
|
||||
#define Z2_DIR_PIN PA6
|
||||
|
||||
//
|
||||
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
|
||||
//
|
||||
#define DISABLE_JTAG
|
||||
|
||||
//
|
||||
// Temperature Sensors
|
||||
//
|
||||
#define TEMP_0_PIN PA4 // TH0
|
||||
#define TEMP_1_PIN PA5 // TH1
|
||||
#define TEMP_BED_PIN PA3 // TB1
|
||||
|
||||
//
|
||||
// Heaters / Fans
|
||||
//
|
||||
#define HEATER_0_PIN PA1 // HEATER0
|
||||
#define HEATER_1_PIN PA0 // HEATER1
|
||||
#define HEATER_BED_PIN PA2 // HOT BED
|
||||
|
||||
#define FAN_PIN PB14 // FAN
|
||||
#define FAN1_PIN PB12 // FAN
|
||||
#define FAN_SOFT_PWM
|
||||
|
||||
//
|
||||
// SD Card
|
||||
//
|
||||
#define SD_DETECT_PIN PA8
|
||||
#define SDCARD_CONNECTION ONBOARD
|
||||
#define ONBOARD_SPI_DEVICE 1
|
||||
#define ONBOARD_SD_CS_PIN PC11 // SDSS
|
||||
#define SDIO_SUPPORT
|
||||
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
|
||||
|
||||
#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
|
||||
|
||||
/**
|
||||
* RET6 12864 LCD
|
||||
* ------
|
||||
* PC6 | 1 2 | PB2
|
||||
* PB10 | 3 4 | PE8
|
||||
* PB14 5 6 | PB13
|
||||
* PB12 | 7 8 | PB15
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
*/
|
||||
#define EXP3_01_PIN PC6
|
||||
#define EXP3_02_PIN PB2
|
||||
#define EXP3_03_PIN PB10
|
||||
#define EXP3_04_PIN PE8
|
||||
#define EXP3_05_PIN PB14
|
||||
#define EXP3_06_PIN PB13
|
||||
#define EXP3_07_PIN PB12
|
||||
#define EXP3_08_PIN PB15
|
||||
|
||||
#elif EITHER(VET6_12864_LCD, DWIN_VET6_CREALITY_LCD)
|
||||
|
||||
/**
|
||||
* VET6 12864 LCD
|
||||
* ------
|
||||
* ? | 1 2 | PC5
|
||||
* PB10 | 3 4 | ?
|
||||
* PA6 5 6 | PA5
|
||||
* PA4 | 7 8 | PA7
|
||||
* GND | 9 10 | 5V
|
||||
* ------
|
||||
*/
|
||||
#define EXP3_01_PIN -1
|
||||
#define EXP3_02_PIN PC5
|
||||
#define EXP3_03_PIN PB10
|
||||
#define EXP3_04_PIN -1
|
||||
#define EXP3_05_PIN PA6
|
||||
#define EXP3_06_PIN PA5
|
||||
#define EXP3_07_PIN PA4
|
||||
#define EXP3_08_PIN PA7
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
#if NONE(RET6_12864_LCD, VET6_12864_LCD)
|
||||
#error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the Creality V4 controller."
|
||||
#endif
|
||||
|
||||
#define LCD_PINS_RS EXP3_07_PIN
|
||||
#define LCD_PINS_ENABLE EXP3_08_PIN
|
||||
#define LCD_PINS_D4 EXP3_06_PIN
|
||||
|
||||
#define BTN_ENC EXP3_02_PIN
|
||||
#define BTN_EN1 EXP3_03_PIN
|
||||
#define BTN_EN2 EXP3_05_PIN
|
||||
|
||||
#define BEEPER_PIN EXP3_01_PIN
|
||||
|
||||
#elif ANY(DWIN_VET6_CREALITY_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
|
||||
|
||||
// RET6 / VET6 DWIN ENCODER LCD
|
||||
#define BTN_ENC EXP3_05_PIN
|
||||
#define BTN_EN1 EXP3_08_PIN
|
||||
#define BTN_EN2 EXP3_07_PIN
|
||||
|
||||
//#define LCD_LED_PIN EXP3_02_PIN
|
||||
#ifndef BEEPER_PIN
|
||||
#define BEEPER_PIN EXP3_06_PIN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// DGUS LCDs
|
||||
#if HAS_DGUS_LCD
|
||||
#define LCD_SERIAL_PORT 3
|
||||
#endif
|
||||
@@ -0,0 +1,381 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2022 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/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "env_validate.h"
|
||||
|
||||
#if HOTENDS > 4 || E_STEPPERS > 4
|
||||
#error "MKS SKIPR supports up to 4 hotends / E steppers."
|
||||
#endif
|
||||
|
||||
#define BOARD_INFO_NAME "MKS SKIPR V1.0"
|
||||
|
||||
// Valid SERIAL_PORT values: -1 (USB-C), 1 (direct to RK3328), 3 (USART3 header)
|
||||
|
||||
#define USES_DIAG_JUMPERS
|
||||
|
||||
// Onboard I2C EEPROM
|
||||
#define I2C_EEPROM
|
||||
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB (AT24C32)
|
||||
#define I2C_SCL_PIN PB8
|
||||
#define I2C_SDA_PIN PB9
|
||||
|
||||
//
|
||||
// Servos
|
||||
//
|
||||
#define SERVO0_PIN PA8
|
||||
|
||||
//
|
||||
// Trinamic Stallguard pins // Connector labels
|
||||
#define X_DIAG_PIN PA14 // X-
|
||||
#define Y_DIAG_PIN PA15 // Y-
|
||||
#define Z_DIAG_PIN PB15 // Z-
|
||||
#define E0_DIAG_PIN PA13 // MT-DET
|
||||
#define E1_DIAG_PIN PC5 // NEOPIXEL
|
||||
#define E2_DIAG_PIN PB14 // Z+
|
||||
|
||||
//
|
||||
// Check for additional used endstop pins
|
||||
//
|
||||
#if HAS_EXTRA_ENDSTOPS
|
||||
#define _ENDSTOP_IS_ANY(ES) X2_USE_ENDSTOP == ES || Y2_USE_ENDSTOP == ES || Z2_USE_ENDSTOP == ES || Z3_USE_ENDSTOP == ES || Z4_USE_ENDSTOP == ES
|
||||
#if _ENDSTOP_IS_ANY(_XMIN_) || _ENDSTOP_IS_ANY(_XMAX_)
|
||||
#define NEEDS_X_MINMAX 1
|
||||
#endif
|
||||
#if _ENDSTOP_IS_ANY(_YMIN_) || _ENDSTOP_IS_ANY(_YMAX_)
|
||||
#define NEEDS_Y_MINMAX 1
|
||||
#endif
|
||||
#if _ENDSTOP_IS_ANY(_ZMIN_) || _ENDSTOP_IS_ANY(_ZMAX_)
|
||||
#define NEEDS_Z_MINMAX 1
|
||||
#endif
|
||||
#undef _ENDSTOP_IS_ANY
|
||||
#endif
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
//
|
||||
#ifdef X_STALL_SENSITIVITY
|
||||
#define X_STOP_PIN X_DIAG_PIN // X-
|
||||
#elif EITHER(DUAL_X_CARRIAGE, NEEDS_X_MINMAX)
|
||||
#ifndef X_MIN_PIN
|
||||
#define X_MIN_PIN X_DIAG_PIN // X-
|
||||
#endif
|
||||
#ifndef X_MAX_PIN
|
||||
#define X_MAX_PIN E0_DIAG_PIN // MT-DET
|
||||
#endif
|
||||
#else
|
||||
#define X_STOP_PIN X_DIAG_PIN // X-
|
||||
#endif
|
||||
|
||||
#ifdef Y_STALL_SENSITIVITY
|
||||
#define Y_STOP_PIN Y_DIAG_PIN // Y-
|
||||
#elif NEEDS_Y_MINMAX
|
||||
#ifndef Y_MIN_PIN
|
||||
#define Y_MIN_PIN Y_DIAG_PIN // Y-
|
||||
#endif
|
||||
#ifndef Y_MAX_PIN
|
||||
#define Y_MAX_PIN E1_DIAG_PIN // NEOPIXEL
|
||||
#endif
|
||||
#else
|
||||
#define Y_STOP_PIN Y_DIAG_PIN // Y-
|
||||
#endif
|
||||
|
||||
#ifdef Z_STALL_SENSITIVITY
|
||||
#define Z_STOP_PIN Z_DIAG_PIN // Z-
|
||||
#elif NEEDS_Z_MINMAX
|
||||
#ifndef Z_MIN_PIN
|
||||
#define Z_MIN_PIN Z_DIAG_PIN // Z-
|
||||
#endif
|
||||
#ifndef Z_MAX_PIN
|
||||
#define Z_MAX_PIN E2_DIAG_PIN // Z+
|
||||
#endif
|
||||
#else
|
||||
#define Z_STOP_PIN Z_DIAG_PIN // Z-
|
||||
#endif
|
||||
|
||||
#if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) || ENABLED(USE_PROBE_FOR_Z_HOMING)
|
||||
#ifndef Z_MIN_PROBE
|
||||
#define Z_MIN_PROBE_PIN E2_DIAG_PIN // defaults to 'Z+' connector
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef NEEDS_X_MINMAX
|
||||
#undef NEEDS_Y_MINMAX
|
||||
#undef NEEDS_Z_MINMAX
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
#define X_STEP_PIN PC14
|
||||
#define X_DIR_PIN PC13
|
||||
#define X_ENABLE_PIN PC15
|
||||
#ifndef X_CS_PIN
|
||||
#define X_CS_PIN PE6
|
||||
#endif
|
||||
|
||||
#define Y_STEP_PIN PE5
|
||||
#define Y_DIR_PIN PE4
|
||||
#define Y_ENABLE_PIN PD14
|
||||
#ifndef Y_CS_PIN
|
||||
#define Y_CS_PIN PE3
|
||||
#endif
|
||||
|
||||
#define Z_STEP_PIN PE1 // "Z1"
|
||||
#define Z_DIR_PIN PE0
|
||||
#define Z_ENABLE_PIN PE2
|
||||
#ifndef Z_CS_PIN
|
||||
#define Z_CS_PIN PB7
|
||||
#endif
|
||||
|
||||
#define E0_STEP_PIN PB5
|
||||
#define E0_DIR_PIN PB4
|
||||
#define E0_ENABLE_PIN PB6
|
||||
#ifndef E0_CS_PIN
|
||||
#define E0_CS_PIN PB3
|
||||
#endif
|
||||
|
||||
#define E1_STEP_PIN PD6 // "Z2"
|
||||
#define E1_DIR_PIN PD5
|
||||
#define E1_ENABLE_PIN PD7
|
||||
#ifndef E1_CS_PIN
|
||||
#define E1_CS_PIN PD4
|
||||
#endif
|
||||
|
||||
#define E2_STEP_PIN PD2 // "Z3"
|
||||
#define E2_DIR_PIN PD1
|
||||
#define E2_ENABLE_PIN PD3
|
||||
#ifndef E2_CS_PIN
|
||||
#define E2_CS_PIN PD0
|
||||
#endif
|
||||
|
||||
#define E3_STEP_PIN PC7 // "Z4"
|
||||
#define E3_DIR_PIN PC6
|
||||
#define E3_ENABLE_PIN PC8
|
||||
#ifndef E3_CS_PIN
|
||||
#define E3_CS_PIN PD15
|
||||
#endif
|
||||
|
||||
//
|
||||
// Temperature Sensors
|
||||
//
|
||||
#define TEMP_BED_PIN PC0 // TB
|
||||
#define TEMP_0_PIN PC1 // TH0
|
||||
#define TEMP_1_PIN PC2 // TH1
|
||||
#define TEMP_2_PIN PC3 // TH2
|
||||
|
||||
//
|
||||
// Heaters / Fans
|
||||
//
|
||||
#define HEATER_BED_PIN PD12 // Hotbed
|
||||
#define HEATER_0_PIN PB1 // Heater0
|
||||
#define HEATER_1_PIN PB0 // Heater1
|
||||
#define HEATER_2_PIN PA3 // Heater2
|
||||
|
||||
#define FAN_PIN PA2 // Fan0
|
||||
#define FAN1_PIN PA1 // Fan1
|
||||
#define FAN2_PIN PA0 // Fan2
|
||||
|
||||
//
|
||||
// Software SPI pins for TMC2130 stepper drivers
|
||||
// This board doesn't support hardware SPI there
|
||||
//
|
||||
#if HAS_TMC_SPI
|
||||
#define TMC_USE_SW_SPI
|
||||
#define TMC_SW_MOSI PE14
|
||||
#define TMC_SW_MISO PE13
|
||||
#define TMC_SW_SCK PE12
|
||||
#endif
|
||||
|
||||
//
|
||||
// TMC2208/TMC2209 stepper drivers
|
||||
// This board is routed for one-wire software serial
|
||||
//
|
||||
#if HAS_TMC_UART
|
||||
#define X_SERIAL_TX_PIN PE6
|
||||
#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
|
||||
|
||||
#define Y_SERIAL_TX_PIN PE3
|
||||
#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
|
||||
|
||||
#define Z_SERIAL_TX_PIN PB7
|
||||
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
|
||||
|
||||
#define E0_SERIAL_TX_PIN PB3
|
||||
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
|
||||
|
||||
#define E1_SERIAL_TX_PIN PD4
|
||||
#define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
|
||||
|
||||
#define E2_SERIAL_TX_PIN PD0
|
||||
#define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
|
||||
|
||||
#define E3_SERIAL_TX_PIN PD15
|
||||
#define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
|
||||
|
||||
// Reduce baud rate to improve software serial reliability
|
||||
#define TMC_BAUD_RATE 19200
|
||||
#endif
|
||||
|
||||
/** ------ ------
|
||||
* (BEEPER) PB2 | 1 2 | PE10 (BTN_ENC) (MISO) PA6 | 1 2 | PA5 (SCK)
|
||||
* (LCD_EN) PE11 | 3 4 | PD10 (LCD_RS) (BTN_EN1) PE9 | 3 4 | PA4 (SD_SS)
|
||||
* (LCD_D4) PD9 | 5 6 PD8 (LCD_D5) (BTN_EN2) PE8 | 5 6 PA7 (MOSI)
|
||||
* (LCD_D6) PE15 | 7 8 | PE7 (LCD_D7) (SD_DETECT) PD13 | 7 8 | RESET
|
||||
* GND | 9 10 | 5V GND | 9 10 | --
|
||||
* ------ ------
|
||||
* EXP1 EXP2
|
||||
*/
|
||||
#define EXP1_01_PIN PB2
|
||||
#define EXP1_02_PIN PE10
|
||||
#define EXP1_03_PIN PE11
|
||||
#define EXP1_04_PIN PD10
|
||||
#define EXP1_05_PIN PD9
|
||||
#define EXP1_06_PIN PD8
|
||||
#define EXP1_07_PIN PE15
|
||||
#define EXP1_08_PIN PE7
|
||||
|
||||
#define EXP2_01_PIN PA6
|
||||
#define EXP2_02_PIN PA5
|
||||
#define EXP2_03_PIN PE9
|
||||
#define EXP2_04_PIN PA4
|
||||
#define EXP2_05_PIN PE8
|
||||
#define EXP2_06_PIN PA7
|
||||
#define EXP2_07_PIN PD13
|
||||
#define EXP2_08_PIN -1 // connected to MCU reset
|
||||
|
||||
//
|
||||
// SD Support
|
||||
// Onboard SD card use hardware SPI3 (defined in variant), LCD SD card use hardware SPI1
|
||||
//
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#ifndef SDCARD_CONNECTION
|
||||
#define SDCARD_CONNECTION LCD
|
||||
#endif
|
||||
#if SD_CONNECTION_IS(ONBOARD)
|
||||
//#define SOFTWARE_SPI
|
||||
//#define SD_SPI_SPEED SPI_HALF_SPEED
|
||||
#undef SD_DETECT_STATE
|
||||
#define SD_DETECT_STATE LOW
|
||||
#define SD_DETECT_PIN PC4
|
||||
#elif SD_CONNECTION_IS(LCD)
|
||||
//#define SOFTWARE_SPI
|
||||
//#define SD_SPI_SPEED SPI_QUARTER_SPEED
|
||||
#define SD_SS_PIN EXP2_04_PIN
|
||||
#define SD_SCK_PIN EXP2_02_PIN
|
||||
#define SD_MISO_PIN EXP2_01_PIN
|
||||
#define SD_MOSI_PIN EXP2_06_PIN
|
||||
#define SD_DETECT_PIN EXP2_07_PIN
|
||||
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
|
||||
#error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board"
|
||||
#endif
|
||||
#define SDSS SD_SS_PIN
|
||||
#endif
|
||||
|
||||
//
|
||||
// LCDs and Controllers
|
||||
//
|
||||
#if IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS EXP2_03_PIN
|
||||
#endif
|
||||
|
||||
#elif HAS_WIRED_LCD
|
||||
|
||||
#define BEEPER_PIN EXP1_01_PIN
|
||||
#define BTN_ENC EXP1_02_PIN
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
|
||||
#define BTN_EN1 EXP1_03_PIN
|
||||
#define BTN_EN2 EXP1_05_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
|
||||
#else
|
||||
|
||||
#define LCD_PINS_RS EXP1_04_PIN
|
||||
|
||||
#define BTN_EN1 EXP2_03_PIN
|
||||
#define BTN_EN2 EXP2_05_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXP1_03_PIN
|
||||
#define LCD_PINS_D4 EXP1_05_PIN
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define DOGLCD_CS EXP1_03_PIN
|
||||
#define DOGLCD_A0 EXP1_04_PIN
|
||||
//#define LCD_BACKLIGHT_PIN -1
|
||||
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
|
||||
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#ifndef RGB_LED_R_PIN
|
||||
#define RGB_LED_R_PIN EXP1_06_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_G_PIN
|
||||
#define RGB_LED_G_PIN EXP1_07_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_B_PIN
|
||||
#define RGB_LED_B_PIN EXP1_08_PIN
|
||||
#endif
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define NEOPIXEL_PIN EXP1_06_PIN
|
||||
#endif
|
||||
#endif // !FYSETC_MINI_12864
|
||||
|
||||
#if IS_ULTIPANEL
|
||||
#define LCD_PINS_D5 EXP1_06_PIN
|
||||
#define LCD_PINS_D6 EXP1_07_PIN
|
||||
#define LCD_PINS_D7 EXP1_08_PIN
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // HAS_WIRED_LCD
|
||||
|
||||
// Alter timing for graphical display
|
||||
#if IS_U8GLIB_ST7920
|
||||
#define BOARD_ST7920_DELAY_1 120
|
||||
#define BOARD_ST7920_DELAY_2 80
|
||||
#define BOARD_ST7920_DELAY_3 580
|
||||
#endif
|
||||
|
||||
//
|
||||
// NeoPixel LED
|
||||
//
|
||||
#ifndef NEOPIXEL_PIN
|
||||
#define NEOPIXEL_PIN PC5
|
||||
#endif
|
||||
|
||||
//
|
||||
// MAX31865
|
||||
//
|
||||
#if HAS_MAX31865
|
||||
#define TEMP_0_CS_PIN PD11
|
||||
#define TEMP_0_SCK_PIN PE12
|
||||
#define TEMP_0_MISO_PIN PE13
|
||||
#define TEMP_0_MOSI_PIN PE14
|
||||
#endif
|
||||
@@ -44,6 +44,9 @@
|
||||
|
||||
// I2C MCP3426 (16-Bit, 240SPS, dual-channel ADC)
|
||||
#define HAS_MCP3426_ADC
|
||||
#ifdef STM32F4
|
||||
#define HAS_STM32_UID
|
||||
#endif
|
||||
|
||||
//
|
||||
// Servos
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
|
||||
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
|
||||
#error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_V3_0.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning"
|
||||
#error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_V3_0.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning."
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"build": {
|
||||
"core": "stm32",
|
||||
"cpu": "cortex-m4",
|
||||
"extra_flags": "-DSTM32F4 -DSTM32F407xx",
|
||||
"f_cpu": "168000000L",
|
||||
"offset": "0xC000",
|
||||
"hwids": [
|
||||
[
|
||||
"0x1EAF",
|
||||
"0x0003"
|
||||
],
|
||||
[
|
||||
"0x0483",
|
||||
"0x3748"
|
||||
]
|
||||
],
|
||||
"mcu": "stm32f407vet6",
|
||||
"product_line": "STM32F407xx",
|
||||
"variant": "MARLIN_MKS_SKIPR_V1"
|
||||
},
|
||||
"debug": {
|
||||
"default_tools": [
|
||||
"stlink"
|
||||
],
|
||||
"jlink_device": "STM32F407VE",
|
||||
"openocd_extra_args": [
|
||||
"-c",
|
||||
"reset_config none"
|
||||
],
|
||||
"openocd_target": "stm32f4x",
|
||||
"svd_path": "STM32F40x.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "STM32F407VE (128k RAM, 64k CCM RAM, 512k Flash",
|
||||
"upload": {
|
||||
"disable_flushing": false,
|
||||
"maximum_ram_size": 131072,
|
||||
"maximum_size": 524288,
|
||||
"protocol": "stlink",
|
||||
"protocols": [
|
||||
"stlink",
|
||||
"dfu",
|
||||
"jlink"
|
||||
],
|
||||
"offset_address": "0x0800C000",
|
||||
"require_upload_port": false,
|
||||
"use_1200bps_touch": false,
|
||||
"wait_for_upload_port": false
|
||||
},
|
||||
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f407ve.html",
|
||||
"vendor": "ST"
|
||||
}
|
||||
@@ -4,16 +4,16 @@
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
|
||||
Import("env", "projenv")
|
||||
Import("env", "projenv")
|
||||
|
||||
flash_size = 0
|
||||
vect_tab_addr = 0
|
||||
flash_size = 0
|
||||
vect_tab_addr = 0
|
||||
|
||||
for define in env['CPPDEFINES']:
|
||||
if define[0] == "VECT_TAB_ADDR":
|
||||
vect_tab_addr = define[1]
|
||||
if define[0] == "STM32_FLASH_SIZE":
|
||||
flash_size = define[1]
|
||||
for define in env['CPPDEFINES']:
|
||||
if define[0] == "VECT_TAB_ADDR":
|
||||
vect_tab_addr = define[1]
|
||||
if define[0] == "STM32_FLASH_SIZE":
|
||||
flash_size = define[1]
|
||||
|
||||
print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr))
|
||||
print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size))
|
||||
print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr))
|
||||
print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size))
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
#
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
from os.path import join
|
||||
from os.path import expandvars
|
||||
Import("env")
|
||||
from os.path import join
|
||||
from os.path import expandvars
|
||||
Import("env")
|
||||
|
||||
# Custom HEX from ELF
|
||||
env.AddPostAction(
|
||||
join("$BUILD_DIR", "${PROGNAME}.elf"),
|
||||
env.VerboseAction(" ".join([
|
||||
"$OBJCOPY", "-O ihex", "$TARGET",
|
||||
"\"" + join("$BUILD_DIR", "${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
|
||||
]), "Building $TARGET"))
|
||||
# Custom HEX from ELF
|
||||
env.AddPostAction(
|
||||
join("$BUILD_DIR", "${PROGNAME}.elf"),
|
||||
env.VerboseAction(" ".join([
|
||||
"$OBJCOPY", "-O ihex", "$TARGET",
|
||||
"\"" + join("$BUILD_DIR", "${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
|
||||
]), "Building $TARGET"))
|
||||
|
||||
# In-line command with arguments
|
||||
UPLOAD_TOOL="stm32flash"
|
||||
platform = env.PioPlatform()
|
||||
if platform.get_package_dir("tool-stm32duino") != None:
|
||||
UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")
|
||||
# In-line command with arguments
|
||||
UPLOAD_TOOL="stm32flash"
|
||||
platform = env.PioPlatform()
|
||||
if platform.get_package_dir("tool-stm32duino") != None:
|
||||
UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")
|
||||
|
||||
env.Replace(
|
||||
UPLOADER=UPLOAD_TOOL,
|
||||
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
|
||||
)
|
||||
env.Replace(
|
||||
UPLOADER=UPLOAD_TOOL,
|
||||
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
|
||||
)
|
||||
|
||||
@@ -3,29 +3,29 @@
|
||||
#
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
import shutil,marlin
|
||||
from pathlib import Path
|
||||
import shutil,marlin
|
||||
from pathlib import Path
|
||||
|
||||
Import("env")
|
||||
platform = env.PioPlatform()
|
||||
board = env.BoardConfig()
|
||||
Import("env")
|
||||
platform = env.PioPlatform()
|
||||
board = env.BoardConfig()
|
||||
|
||||
FRAMEWORK_DIR = Path(platform.get_package_dir("framework-arduinoststm32-maple"))
|
||||
assert FRAMEWORK_DIR.is_dir()
|
||||
FRAMEWORK_DIR = Path(platform.get_package_dir("framework-arduinoststm32-maple"))
|
||||
assert FRAMEWORK_DIR.is_dir()
|
||||
|
||||
source_root = Path("buildroot/share/PlatformIO/variants")
|
||||
assert source_root.is_dir()
|
||||
source_root = Path("buildroot/share/PlatformIO/variants")
|
||||
assert source_root.is_dir()
|
||||
|
||||
variant = board.get("build.variant")
|
||||
variant_dir = FRAMEWORK_DIR / "STM32F1/variants" / variant
|
||||
variant = board.get("build.variant")
|
||||
variant_dir = FRAMEWORK_DIR / "STM32F1/variants" / variant
|
||||
|
||||
source_dir = source_root / variant
|
||||
assert source_dir.is_dir()
|
||||
source_dir = source_root / variant
|
||||
assert source_dir.is_dir()
|
||||
|
||||
if variant_dir.is_dir():
|
||||
shutil.rmtree(variant_dir)
|
||||
if variant_dir.is_dir():
|
||||
shutil.rmtree(variant_dir)
|
||||
|
||||
if not variant_dir.is_dir():
|
||||
variant_dir.mkdir()
|
||||
if not variant_dir.is_dir():
|
||||
variant_dir.mkdir()
|
||||
|
||||
marlin.copytree(source_dir, variant_dir)
|
||||
marlin.copytree(source_dir, variant_dir)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user