diff --git a/.gitignore b/.gitignore index 0b852d767325..09db344257e7 100755 --- a/.gitignore +++ b/.gitignore @@ -147,6 +147,7 @@ vc-fileutils.settings imgui.ini eeprom.dat spi_flash.bin +fs.img #cmake CMakeLists.txt diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 02df04be9798..9783b2ec6797 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -60,7 +60,7 @@ // @section info // Author info of this build printed to the host during boot and M115 -#define STRING_CONFIG_H_AUTHOR "(Marginally Clever, Makelangelo 5)" // Who made the changes. +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. //#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** @@ -87,7 +87,7 @@ // Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RUMBA + #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif /** @@ -135,7 +135,7 @@ //#define BLUETOOTH // Name displayed in the LCD "Ready" message and Info menu -#define CUSTOM_MACHINE_NAME "Polargraph" +//#define CUSTOM_MACHINE_NAME "3D Printer" // Printer's unique ID, used by some programs to differentiate between machines. // Choose your own or use a service like https://www.uuidgenerator.net/version4 @@ -172,7 +172,7 @@ //#define U_DRIVER_TYPE A4988 //#define V_DRIVER_TYPE A4988 //#define W_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 //#define E1_DRIVER_TYPE A4988 //#define E2_DRIVER_TYPE A4988 //#define E3_DRIVER_TYPE A4988 @@ -872,14 +872,10 @@ //#define BELTPRINTER // Enable for Polargraph Kinematics -#define POLARGRAPH +//#define POLARGRAPH #if ENABLED(POLARGRAPH) #define POLARGRAPH_MAX_BELT_LEN 1035.0 #define POLAR_SEGMENTS_PER_SECOND 5 - #if MOTHERBOARD == BOARD_RUMBA - #define X_MAX_PIN 37 - #define Y_MAX_PIN 36 - #endif #endif // @section delta @@ -1034,8 +1030,8 @@ // Specify here all the endstop connectors that are connected to any endstop or probe. // Almost all printers will be using one per axis. Probes will use one or more of the // extra connectors. Leave undefined any used for non-endstop and non-probe purposes. -//#define USE_XMIN_PLUG -//#define USE_YMIN_PLUG +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG #define USE_ZMIN_PLUG //#define USE_IMIN_PLUG //#define USE_JMIN_PLUG @@ -1043,8 +1039,8 @@ //#define USE_UMIN_PLUG //#define USE_VMIN_PLUG //#define USE_WMIN_PLUG -#define USE_XMAX_PLUG -#define USE_YMAX_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG //#define USE_IMAX_PLUG //#define USE_JMAX_PLUG @@ -1113,8 +1109,8 @@ #define U_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. #define V_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. #define W_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. -#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. -#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. #define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. #define I_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. #define J_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. @@ -1170,18 +1166,18 @@ * Override with M92 * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 80, 80 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 } /** * Default Max Feed Rate (linear=mm/s, rotational=°/s) * Override with M203 * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_FEEDRATE { 300, 300, 300, 300 } +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } //#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 #if ENABLED(LIMITED_MAX_FR_EDITING) - #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 600 } // ...or, set your own edit limits + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits #endif /** @@ -1190,11 +1186,11 @@ * Override with M201 * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 3000, 3000 } +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } //#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 #if ENABLED(LIMITED_MAX_ACCEL_EDITING) - #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 6000 } // ...or, set your own edit limits + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits #endif /** @@ -1217,7 +1213,7 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define CLASSIC_JERK +//#define CLASSIC_JERK #if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 @@ -1642,7 +1638,7 @@ // @section motion // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR true +#define INVERT_X_DIR false #define INVERT_Y_DIR true #define INVERT_Z_DIR false //#define INVERT_I_DIR false @@ -1683,8 +1679,8 @@ // Direction of endstops when homing; 1=MAX, -1=MIN // :[-1,1] -#define X_HOME_DIR 1 -#define Y_HOME_DIR 1 +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 #define Z_HOME_DIR -1 //#define I_HOME_DIR -1 //#define J_HOME_DIR -1 @@ -1696,16 +1692,16 @@ // @section geometry // The size of the printable area -#define X_BED_SIZE 650 -#define Y_BED_SIZE 1000 +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 // Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions. -#define X_MIN_POS (-X_BED_SIZE/2) -#define Y_MIN_POS (-Y_BED_SIZE/2) +#define X_MIN_POS 0 +#define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS (X_BED_SIZE/2) -#define Y_MAX_POS (Y_BED_SIZE/2) -#define Z_MAX_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 200 //#define I_MIN_POS 0 //#define I_MAX_POS 50 //#define J_MIN_POS 0 @@ -1729,7 +1725,7 @@ */ // Min software endstops constrain movement within minimum coordinate bounds -//#define MIN_SOFTWARE_ENDSTOPS +#define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X #define MIN_SOFTWARE_ENDSTOP_Y @@ -1747,13 +1743,13 @@ #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X #define MAX_SOFTWARE_ENDSTOP_Y - //#define MAX_SOFTWARE_ENDSTOP_Z - //#define MAX_SOFTWARE_ENDSTOP_I - //#define MAX_SOFTWARE_ENDSTOP_J - //#define MAX_SOFTWARE_ENDSTOP_K - //#define MAX_SOFTWARE_ENDSTOP_U - //#define MAX_SOFTWARE_ENDSTOP_V - //#define MAX_SOFTWARE_ENDSTOP_W + #define MAX_SOFTWARE_ENDSTOP_Z + #define MAX_SOFTWARE_ENDSTOP_I + #define MAX_SOFTWARE_ENDSTOP_J + #define MAX_SOFTWARE_ENDSTOP_K + #define MAX_SOFTWARE_ENDSTOP_U + #define MAX_SOFTWARE_ENDSTOP_V + #define MAX_SOFTWARE_ENDSTOP_W #endif #if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS) @@ -2067,12 +2063,12 @@ // @section homing // The center of the bed is at (X=0, Y=0) -#define BED_CENTER_AT_0_0 +//#define BED_CENTER_AT_0_0 // Manually set the home position. Leave these undefined for automatic settings. // For DELTA this is the top-center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS -482.65 //(Y_MAX_POS-( sqrt(sq(POLARGRAPH_MAX_BELT_LEN)-sq(X_BED_SIZE/2)))) +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 //#define MANUAL_Z_HOME_POS 0 //#define MANUAL_I_HOME_POS 0 //#define MANUAL_J_HOME_POS 0 @@ -2174,7 +2170,7 @@ * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) */ -#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 //#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release! #define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. #define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load @@ -2459,14 +2455,14 @@ * SD Card support is disabled by default. If your controller has an SD slot, * you must uncomment the following option or it won't work. */ -#define SDSUPPORT +//#define SDSUPPORT /** * SD CARD: ENABLE CRC * * Use CRC checks and retries on the SD communication. */ -#define SD_CHECK_AND_RETRY +//#define SD_CHECK_AND_RETRY /** * LCD Menu Items @@ -2572,7 +2568,7 @@ // // Note: Usually sold with a white PCB. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER +//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // GT2560 (YHCB2004) LCD Display @@ -3338,7 +3334,7 @@ * Set this manually if there are extra servos needing manual control. * Set to 0 to turn off servo support. */ -#define NUM_SERVOS 1 // Note: Servo index starts with 0 for M280-M282 commands +//#define NUM_SERVOS 3 // Note: Servo index starts with 0 for M280-M282 commands // (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. @@ -3346,7 +3342,7 @@ #define SERVO_DELAY { 300 } // Only power servos during movement, otherwise leave off to prevent jitter -#define DEACTIVATE_SERVOS_AFTER_MOVE +//#define DEACTIVATE_SERVOS_AFTER_MOVE // Edit servo angles with M281 and save to EEPROM with M500 //#define EDITABLE_SERVO_ANGLES diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index f23a4675be56..4a60ec613906 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -876,7 +876,7 @@ //#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (linear=mm, rotational=°) Backoff from endstops after homing //#define XY_COUNTERPART_BACKOFF_MM 0 // (mm) Backoff X after homing Y, and vice-versa -#define QUICK_HOME // If G28 contains XY do a diagonal move first +//#define QUICK_HOME // If G28 contains XY do a diagonal move first //#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X //#define HOME_Z_FIRST // Home Z first. Requires a Z-MIN endstop (not a probe). //#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first @@ -1240,7 +1240,7 @@ //#define MICROSTEP32 HIGH,LOW,HIGH // Microstep settings (Requires a board with pins named X_MS1, X_MS2, etc.) -#define MICROSTEP_MODES { 16, 16 } // [1,2,4,8,16] +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] /** * @section stepper motor current @@ -1403,9 +1403,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 @@ -1426,37 +1423,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 +#endif // HAS_DISPLAY || DWIN_LCD_PROUI -// 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 +// 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 - #if EITHER(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI) - //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits - #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') + + //#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 @@ -1799,14 +1802,8 @@ #endif // HAS_MARLINUI_U8GLIB #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 // @@ -2064,12 +2061,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.22 // 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.22 } // (mm) Compression length per 1mm/s extruder speed, per extruder + #else + #define ADVANCE_K 0.22 // (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 @@ -3930,12 +3931,12 @@ * Host Prompt Support enables Marlin to use the host for user prompts so * filament runout and other processes can be managed from the host side. */ -#define HOST_ACTION_COMMANDS +//#define HOST_ACTION_COMMANDS #if ENABLED(HOST_ACTION_COMMANDS) - #define HOST_PAUSE_M76 // Tell the host to pause in response to M76 - #define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback + //#define HOST_PAUSE_M76 // Tell the host to pause in response to M76 + //#define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback #if ENABLED(HOST_PROMPT_SUPPORT) - #define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications + //#define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications #endif //#define HOST_START_MENU_ITEM // Add a menu item that tells the host to start //#define HOST_SHUTDOWN_MENU_ITEM // Add a menu item that tells the host to shut down @@ -4058,7 +4059,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 diff --git a/Marlin/Version.h b/Marlin/Version.h index 98455e411afd..d027ada30ed8 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2022-10-02" +//#define STRING_DISTRIBUTION_DATE "2022-10-12" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/HAL/DUE/upload_extra_script.py b/Marlin/src/HAL/DUE/upload_extra_script.py index 4f7a494512b2..ca12b3b54f43 100644 --- a/Marlin/src/HAL/DUE/upload_extra_script.py +++ b/Marlin/src/HAL/DUE/upload_extra_script.py @@ -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" + ) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 0ea55b7ef458..ea57e3ccd782 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -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 } diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 51d419da0460..74ff44d9905b 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -425,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 diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index cb087204fea6..84a969ad0bdf 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -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 copy() const { return *this; } @@ -500,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 copy() const { XYZval o = *this; return o; } @@ -651,6 +659,10 @@ struct XYZEval { 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); } + // 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 copy() const { XYZEval v = *this; return v; } diff --git a/Marlin/src/gcode/feature/advance/M900.cpp b/Marlin/src/gcode/feature/advance/M900.cpp index db09faa88310..50d968627b6f 100644 --- a/Marlin/src/gcode/feature/advance/M900.cpp +++ b/Marlin/src/gcode/feature/advance/M900.cpp @@ -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 Which tool to address * K Set current advance K factor (Slot 0). - * L 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 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 diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 7c1b776daddd..7edcaa981cd4 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -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,11 +600,13 @@ 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();) // 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:) break; - TERN_(HOST_PROMPT_SUPPORT, case 876: M876();) #endif #if ENABLED(HOST_KEEPALIVE_FEATURE) @@ -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 diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 2b15706395bd..d69298e28b53 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -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 X Y V E L S. (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 @@ class GcodeSuite { static void M48(); #endif - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) + #if ENABLED(SET_PROGRESS_MANUALLY) static void M73(); #endif diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index a244e9802f77..d3338d396dad 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -142,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)); diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index a86eee4d9967..77d93019acaf 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -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 diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 197177882c31..f40435886241 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -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 { diff --git a/Marlin/src/gcode/sd/M23.cpp b/Marlin/src/gcode/sd/M23.cpp index 51bc82413040..8722e9b6de95 100644 --- a/Marlin/src/gcode/sd/M23.cpp +++ b/Marlin/src/gcode/sd/M23.cpp @@ -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 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 5e23cedc4d38..47ae0a6dffbb 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -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. diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index c3f746dc72d0..ba8c3587fec0 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -599,10 +599,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 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c8786f172ae3..1ee4667e3c3c 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -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) && DISABLED(POLARGRAPH) +#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) && DISABLED(POLARGRAPH) +#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) @@ -1328,10 +1338,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) @@ -4038,10 +4053,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 diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 59305c216145..7cd45cd10f20 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2022-10-02" + #define STRING_DISTRIBUTION_DATE "2022-10-12" #endif /** diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index b8dc8db8177a..ba222897fccf 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -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 ======== diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index f3d98ec55584..029a04bf97c8 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -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) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 67039d52de7b..81119c0a1089 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -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_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_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_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 diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 492a79a31108..9ed0d8a9d674 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -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 diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h index 7fe878356b0d..d838ee1a3a68 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h @@ -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; diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index df758da61786..21f93c6b98d4 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -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()); } } diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index 8985647cd131..7e213a65e540 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -188,7 +188,7 @@ class CrealityDWINClass { 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(); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index 8024085ef734..0bd1b2ff2af2 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -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( diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 09c3ca9ab8df..06768ed18f95 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -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." diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp index a4c0997bf8a0..0e825c9e7c33 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp @@ -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 diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp index 4c850183da0f..6e4c76ca68df 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp @@ -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 diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp index 86920d6841c9..ae8d9565e3f5 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp @@ -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 diff --git a/Marlin/src/lcd/extui/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/mks_ui/draw_printing.cpp index be596c874074..5dc3861f6525 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_printing.cpp @@ -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 diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index f4d02d8cca4a..967fb1021d19 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -712,17 +712,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 diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index bf32c5703e36..c2ce52ba4c1e 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -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(); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 2f30da001fef..00b0d62e1ae0 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -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; @@ -1677,19 +1682,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 // @@ -1723,6 +1715,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 + 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) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index d2e370890727..b1a98248bb71 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -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 @@ class MarlinUI { #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 @@ class MarlinUI { #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 @@ class MarlinUI { static void poweroff(); #endif - #if EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_JYERSUI) + #if LCD_WITH_BLINK static bool get_blink(); #endif diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 9dd74988f32a..7ae1078f4deb 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -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; diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index e79fe55938e3..19e38820184d 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -109,9 +109,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 @@ -687,11 +687,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 diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index bc5200196717..79d87bb6ca92 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -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 diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp index f4d47983d225..594255aea81e 100644 --- a/Marlin/src/libs/numtostr.cpp +++ b/Marlin/src/libs/numtostr.cpp @@ -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); diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 76455d05d336..dadbfab29724 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -561,8 +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 && !ENABLED(POLARGRAPH) - // kinematic machines are expected to home to a point 1.5x their range? never reachable. + #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 @@ -920,10 +920,8 @@ void restore_feedrate_and_scaling() { #endif #if ENABLED(POLARGRAPH) - target.x = _MIN(target.x, draw_area_max.x); - target.x = _MAX(target.x, draw_area_min.x); - target.y = _MIN(target.y, draw_area_max.y); - target.y = _MAX(target.y, draw_area_min.y); + 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); diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 6ef1ed6c2848..dee86cad90ee 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -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 @@ -854,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; } @@ -2541,7 +2541,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) / @@ -2557,7 +2557,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); @@ -2594,7 +2594,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 diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 2e7ed014f8eb..cfd7b455165f 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -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 /** diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 4ccaa805c553..ec1a03eb0528 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -118,8 +118,8 @@ #endif #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 @@ -442,7 +442,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 @@ -2334,7 +2334,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) @@ -3206,12 +3206,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 // diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 7954611bc4a9..349264606aec 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -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 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 9efafe9af566..c623b4844d20 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -709,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 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h new file mode 100644 index 000000000000..046fbb95bf29 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h @@ -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 . + * + */ +#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 diff --git a/buildroot/share/PlatformIO/boards/marlin_MKS_SKIPR_V1.json b/buildroot/share/PlatformIO/boards/marlin_MKS_SKIPR_V1.json new file mode 100644 index 000000000000..7ca62db00531 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/marlin_MKS_SKIPR_V1.json @@ -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" +} diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py b/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py index a69520f46d9c..4f2da9cdc0d0 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py +++ b/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py @@ -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)) diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py b/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py index 2cab2ce5c136..ecb0cc145c04 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py +++ b/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py @@ -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") + ) diff --git a/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py b/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py index 0eab7a8361a6..4189cb5899bc 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py +++ b/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py @@ -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) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/hal_conf_custom.h index 9fa98807d68e..bbce8a1c9a11 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/hal_conf_custom.h @@ -5,8 +5,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2017 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/ldscript.ld index 57c01c8df8fc..0f8a490044f7 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/ldscript.ld @@ -20,7 +20,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/startup.S b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/startup.S index 81999dda6a42..9348cd057ade 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/startup.S +++ b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/startup.S @@ -16,7 +16,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT 2015 STMicroelectronics

+ * Copyright (c) 2015 STMicroelectronics * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/ldscript.ld index 6af296a521ff..f7e09b8ef0e7 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/ldscript.ld index 6af296a521ff..f7e09b8ef0e7 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/ldscript.ld index 6af296a521ff..f7e09b8ef0e7 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/ldscript.ld index 4cac4ac6e2a7..063525c96400 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/ldscript.ld index ca21498cd2d9..ed6cae4379b9 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/ldscript.ld index 6af296a521ff..f7e09b8ef0e7 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h index 92730f594520..f355549a675e 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h @@ -5,8 +5,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2017 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/ldscript.ld index 006c87a17a18..931091bc3109 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/ldscript.ld @@ -26,7 +26,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2019 STMicroelectronics

+** Copyright (c) 2019 STMicroelectronics ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h index 1dd047bb9005..808b5588ed5c 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h @@ -5,8 +5,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2017 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld index 004714cd6dc0..d12edc719777 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: @@ -184,4 +184,4 @@ SECTIONS } .ARM.attributes 0 : { *(.ARM.attributes) } -} \ No newline at end of file +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/ldscript.ld index cd7503b3a51d..4eb277cb06f4 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/ldscript.ld @@ -23,7 +23,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2019 STMicroelectronics

+** Copyright (c) 2019 STMicroelectronics ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/ldscript.ld index 6bc577236a9c..a1042aa8d29a 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/ldscript.ld @@ -22,7 +22,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2019 STMicroelectronics

+** Copyright (c) 2019 STMicroelectronics ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/ldscript.ld index a65b07d61c5f..3013b096073c 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/ldscript.ld @@ -23,7 +23,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2019 STMicroelectronics

+** Copyright (c) 2019 STMicroelectronics ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h index 2443052621d7..a9475dbdd912 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h @@ -5,8 +5,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2017 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/ldscript.ld index cc4b323f763a..cac12da5c2a1 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/ldscript.ld @@ -23,7 +23,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2019 STMicroelectronics

+** Copyright (c) 2019 STMicroelectronics ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RC/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_F401RC/ldscript.ld index a0ab41f631c5..c7e67d311e89 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F401RC/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_F401RC/ldscript.ld @@ -13,8 +13,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2020 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h index 58e9646b57f5..ea5e2cc70934 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h @@ -5,8 +5,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2017 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/ldscript.ld index 68b65973226f..9357c4b52c17 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_F446VE/ldscript.ld index a375232d5981..7d5307717c1e 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F446VE/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_F446VE/ldscript.ld @@ -20,7 +20,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h index d246a1e7454e..f2f4ed3e96b5 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h @@ -8,8 +8,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2017 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/ldscript.ld index 8b38135a2a51..df1ed1581a39 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/ldscript.ld @@ -19,7 +19,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2019 STMicroelectronics

+** Copyright (c) 2019 STMicroelectronics ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h index ba145d058cb3..0b78be627fc5 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h @@ -27,98 +27,98 @@ extern "C" { * Pins *----------------------------------------------------------------------------*/ -// | DIGITAL | ANALOG IN | ANALOG OUT | UART/USART | TWI | SPI | SPECIAL | -// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| -#define PA0 PIN_A0 // | 0 | A0 (ADC1) | | UART4_TX | | | | -#define PA1 PIN_A1 // | 1 | A1 (ADC1) | | UART4_RX | | | | -#define PA2 PIN_A2 // | 2 | A2 (ADC1) | | USART2_TX | | | | -#define PA3 PIN_A3 // | 3 | A3 (ADC1) | | USART2_RX | | | | -#define PA4 PIN_A4 // | 4 | A4 (ADC1) | DAC_OUT1 | | | SPI1_SS, (SPI3_SS) | | -#define PA5 PIN_A5 // | 5 | A5 (ADC1) | DAC_OUT2 | | | SPI1_SCK | | -#define PA6 PIN_A6 // | 6 | A6 (ADC1) | | | | SPI1_MISO | | -#define PA7 PIN_A7 // | 7 | A7 (ADC1) | | | | SPI1_MOSI | | -#define PA8 8 // | 8 | | | | TWI3_SCL | | | -#define PA9 9 // | 9 | | | USART1_TX | | | | -#define PA10 10 // | 10 | | | USART1_RX | | | | -#define PA11 11 // | 11 | | | | | | | -#define PA12 12 // | 12 | | | | | | | -#define PA13 13 // | 13 | | | | | | SWD_SWDIO | -#define PA14 14 // | 14 | | | | | | SWD_SWCLK | -#define PA15 15 // | 15 | | | | | SPI3_SS, (SPI1_SS) | | -// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| -#define PB0 PIN_A8 // | 16 | A8 (ADC1) | | | | | | -#define PB1 PIN_A9 // | 17 | A9 (ADC1) | | | | | | -#define PB2 18 // | 18 | | | | | | BOOT1 | -#define PB3 19 // | 19 | | | | | SPI3_SCK, (SPI1_SCK) | | -#define PB4 20 // | 20 | | | | | SPI3_MISO, (SPI1_MISO) | | -#define PB5 21 // | 21 | | | | | SPI3_MOSI, (SPI1_MOSI) | | -#define PB6 22 // | 22 | | | USART1_TX | TWI1_SCL | | | -#define PB7 23 // | 23 | | | USART1_RX | TWI1_SDA | | | -#define PB8 24 // | 24 | | | | TWI1_SCL | | | -#define PB9 25 // | 25 | | | | TWI1_SDA | SPI2_SS | | -#define PB10 26 // | 26 | | | USART3_TX, (UART4_TX) | TWI2_SCL | SPI2_SCK | | -#define PB11 27 // | 27 | | | USART3_RX | TWI2_SDA | | | -#define PB12 28 // | 28 | | | | | SPI2_SS | | -#define PB13 29 // | 29 | | | | | SPI2_SCK | | -#define PB14 30 // | 30 | | | | | SPI2_MISO | | -#define PB15 31 // | 31 | | | | | SPI2_MOSI | | -// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| -#define PC0 PIN_A10 // | 32 | A10 (ADC1) | | | | | | -#define PC1 PIN_A11 // | 33 | A11 (ADC1) | | | | | | -#define PC2 PIN_A12 // | 34 | A12 (ADC1) | | | | SPI2_MISO | | -#define PC3 PIN_A13 // | 35 | A13 (ADC1) | | | | SPI2_MOSI | | -#define PC4 PIN_A14 // | 36 | A14 (ADC1) | | | | | | -#define PC5 PIN_A15 // | 37 | A15 (ADC1) | | USART3_RX | | | | -#define PC6 38 // | 38 | | | USART6_TX | | | | -#define PC7 39 // | 39 | | | USART6_RX | | | | -#define PC8 40 // | 40 | | | | | | | -#define PC9 41 // | 41 | | | USART3_TX | TWI3_SDA | | | -#define PC10 42 // | 42 | | | | | SPI3_SCK | | -#define PC11 43 // | 43 | | | USART3_RX, (UART4_RX) | | SPI3_MISO | | -#define PC12 44 // | 44 | | | UART5_TX | | SPI3_MOSI | | -#define PC13 45 // | 45 | | | | | | | -#define PC14 46 // | 46 | | | | | | OSC32_IN | -#define PC15 47 // | 47 | | | | | | OSC32_OUT | -// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| -#define PD0 48 // | 48 | | | | | | | -#define PD1 49 // | 49 | | | | | | | -#define PD2 50 // | 50 | | | UART5_RX | | | | -#define PD3 51 // | 51 | | | | | | | -#define PD4 52 // | 52 | | | | | | | -#define PD5 53 // | 53 | | | USART2_TX | | | | -#define PD6 54 // | 54 | | | USART2_RX | | | | -#define PD7 55 // | 55 | | | | | | | -#define PD8 56 // | 56 | | | USART3_TX | | | | -#define PD9 57 // | 57 | | | USART3_RX | | | | -#define PD10 58 // | 58 | | | | | | | -#define PD11 59 // | 59 | | | | | | | -#define PD12 60 // | 60 | | | | | | | -#define PD13 61 // | 61 | | | | | | | -#define PD14 62 // | 62 | | | | | | | -#define PD15 63 // | 63 | | | | | | | -// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| -#define PE0 64 // | 64 | | | | | | | -#define PE1 65 // | 65 | | | | | | | -#define PE2 66 // | 66 | | | | | | | -#define PE3 67 // | 67 | | | | | | | -#define PE4 68 // | 68 | | | | | | | -#define PE5 69 // | 69 | | | | | | | -#define PE6 70 // | 70 | | | | | | | -#define PE7 71 // | 71 | | | | | | | -#define PE8 72 // | 72 | | | | | | | -#define PE9 73 // | 73 | | | | | | | -#define PE10 74 // | 74 | | | | | | | -#define PE11 75 // | 75 | | | | | | | -#define PE12 76 // | 76 | | | | | | | -#define PE13 77 // | 77 | | | | | | | -#define PE14 78 // | 78 | | | | | | | -#define PE15 79 // | 79 | | | | | | | -// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| -#define PH0 80 // | 80 | | | | | | OSC_IN | -#define PH1 81 // | 81 | | | | | | OSC_OUT | -// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| - -/// This must be a literal + // | DIGITAL | ANALOG IN | ANALOG OUT | UART/USART | TWI | SPI | SPECIAL | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PA0 PIN_A0 // | 0 | A0 (ADC1) | | UART4_TX | | | | +#define PA1 PIN_A1 // | 1 | A1 (ADC1) | | UART4_RX | | | | +#define PA2 PIN_A2 // | 2 | A2 (ADC1) | | USART2_TX | | | | +#define PA3 PIN_A3 // | 3 | A3 (ADC1) | | USART2_RX | | | | +#define PA4 PIN_A4 // | 4 | A4 (ADC1) | DAC_OUT1 | | | SPI1_SS, (SPI3_SS) | | +#define PA5 PIN_A5 // | 5 | A5 (ADC1) | DAC_OUT2 | | | SPI1_SCK | | +#define PA6 PIN_A6 // | 6 | A6 (ADC1) | | | | SPI1_MISO | | +#define PA7 PIN_A7 // | 7 | A7 (ADC1) | | | | SPI1_MOSI | | +#define PA8 8 // | 8 | | | | TWI3_SCL | | | +#define PA9 9 // | 9 | | | USART1_TX | | | | +#define PA10 10 // | 10 | | | USART1_RX | | | | +#define PA11 11 // | 11 | | | | | | | +#define PA12 12 // | 12 | | | | | | | +#define PA13 13 // | 13 | | | | | | SWD_SWDIO | +#define PA14 14 // | 14 | | | | | | SWD_SWCLK | +#define PA15 15 // | 15 | | | | | SPI3_SS, (SPI1_SS) | | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PB0 PIN_A8 // | 16 | A8 (ADC1) | | | | | | +#define PB1 PIN_A9 // | 17 | A9 (ADC1) | | | | | | +#define PB2 18 // | 18 | | | | | | BOOT1 | +#define PB3 19 // | 19 | | | | | SPI3_SCK, (SPI1_SCK) | | +#define PB4 20 // | 20 | | | | | SPI3_MISO, (SPI1_MISO) | | +#define PB5 21 // | 21 | | | | | SPI3_MOSI, (SPI1_MOSI) | | +#define PB6 22 // | 22 | | | USART1_TX | TWI1_SCL | | | +#define PB7 23 // | 23 | | | USART1_RX | TWI1_SDA | | | +#define PB8 24 // | 24 | | | | TWI1_SCL | | | +#define PB9 25 // | 25 | | | | TWI1_SDA | SPI2_SS | | +#define PB10 26 // | 26 | | | USART3_TX, (UART4_TX) | TWI2_SCL | SPI2_SCK | | +#define PB11 27 // | 27 | | | USART3_RX | TWI2_SDA | | | +#define PB12 28 // | 28 | | | | | SPI2_SS | | +#define PB13 29 // | 29 | | | | | SPI2_SCK | | +#define PB14 30 // | 30 | | | | | SPI2_MISO | | +#define PB15 31 // | 31 | | | | | SPI2_MOSI | | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PC0 PIN_A10 // | 32 | A10 (ADC1) | | | | | | +#define PC1 PIN_A11 // | 33 | A11 (ADC1) | | | | | | +#define PC2 PIN_A12 // | 34 | A12 (ADC1) | | | | SPI2_MISO | | +#define PC3 PIN_A13 // | 35 | A13 (ADC1) | | | | SPI2_MOSI | | +#define PC4 PIN_A14 // | 36 | A14 (ADC1) | | | | | | +#define PC5 PIN_A15 // | 37 | A15 (ADC1) | | USART3_RX | | | | +#define PC6 38 // | 38 | | | USART6_TX | | | | +#define PC7 39 // | 39 | | | USART6_RX | | | | +#define PC8 40 // | 40 | | | | | | | +#define PC9 41 // | 41 | | | USART3_TX | TWI3_SDA | | | +#define PC10 42 // | 42 | | | | | SPI3_SCK | | +#define PC11 43 // | 43 | | | USART3_RX, (UART4_RX) | | SPI3_MISO | | +#define PC12 44 // | 44 | | | UART5_TX | | SPI3_MOSI | | +#define PC13 45 // | 45 | | | | | | | +#define PC14 46 // | 46 | | | | | | OSC32_IN | +#define PC15 47 // | 47 | | | | | | OSC32_OUT | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PD0 48 // | 48 | | | | | | | +#define PD1 49 // | 49 | | | | | | | +#define PD2 50 // | 50 | | | UART5_RX | | | | +#define PD3 51 // | 51 | | | | | | | +#define PD4 52 // | 52 | | | | | | | +#define PD5 53 // | 53 | | | USART2_TX | | | | +#define PD6 54 // | 54 | | | USART2_RX | | | | +#define PD7 55 // | 55 | | | | | | | +#define PD8 56 // | 56 | | | USART3_TX | | | | +#define PD9 57 // | 57 | | | USART3_RX | | | | +#define PD10 58 // | 58 | | | | | | | +#define PD11 59 // | 59 | | | | | | | +#define PD12 60 // | 60 | | | | | | | +#define PD13 61 // | 61 | | | | | | | +#define PD14 62 // | 62 | | | | | | | +#define PD15 63 // | 63 | | | | | | | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PE0 64 // | 64 | | | | | | | +#define PE1 65 // | 65 | | | | | | | +#define PE2 66 // | 66 | | | | | | | +#define PE3 67 // | 67 | | | | | | | +#define PE4 68 // | 68 | | | | | | | +#define PE5 69 // | 69 | | | | | | | +#define PE6 70 // | 70 | | | | | | | +#define PE7 71 // | 71 | | | | | | | +#define PE8 72 // | 72 | | | | | | | +#define PE9 73 // | 73 | | | | | | | +#define PE10 74 // | 74 | | | | | | | +#define PE11 75 // | 75 | | | | | | | +#define PE12 76 // | 76 | | | | | | | +#define PE13 77 // | 77 | | | | | | | +#define PE14 78 // | 78 | | | | | | | +#define PE15 79 // | 79 | | | | | | | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PH0 80 // | 80 | | | | | | OSC_IN | +#define PH1 81 // | 81 | | | | | | OSC_OUT | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| + +// This must be a literal #define NUM_DIGITAL_PINS 82 #define NUM_ANALOG_INPUTS 16 diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/ldscript.ld index d644d49beb1d..cd7ccef85ff3 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h index 2ff2fd686ea4..fb3d21c6acb3 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h @@ -5,8 +5,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2017 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld index eaaff196cd0d..1ded9f2a3e13 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: @@ -184,4 +184,4 @@ SECTIONS } .ARM.attributes 0 : { *(.ARM.attributes) } -} \ No newline at end of file +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/ldscript.ld index 900ef0639101..5db15287845f 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/ldscript.ld index 6af296a521ff..f7e09b8ef0e7 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/ldscript.ld @@ -21,7 +21,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+** Copyright (c) 2014 Ac6 ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/ldscript.ld index 3b619b6a97e8..4e0e997341c4 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/ldscript.ld @@ -13,8 +13,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2020 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld index 7d248a268283..5f439f3f8e1f 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld @@ -26,7 +26,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2019 STMicroelectronics

+** Copyright (c) 2019 STMicroelectronics ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/PeripheralPins.c new file mode 100644 index 000000000000..640fbdbe13c0 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/PeripheralPins.c @@ -0,0 +1,169 @@ +/* + ******************************************************************************* + * Copyright (c) 2016, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ +#include "Arduino.h" +#include "PeripheralPins.h" + +// ===== +// Note: Commented lines are alternative possibilities which are not used per default. +// If you change them, you will have to know what you do +// ===== + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +WEAK const PinMap PinMap_ADC[] = { + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 THBED + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 TH0 + {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 TH1 + {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 TH2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SDA[] = { + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_I2C_SCL[] = { + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +// Some pins can perform PWM from more than one timer. These were selected to utilize as many channels as +// possible from timers which were already dedicated to PWM output. + +// TIM1 = HEATER0, HEATER1, [SERVO] +// TIM2 = FAN1, FAN2, [BEEPER] +// TIM4 = HEATER_BED +// TIM5 = HEATER2, FAN0 + +WEAK const PinMap PinMap_PWM[] = { + {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 Fan2 + {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 Fan1 + {PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 Fan0 + {PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 HE2 + {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 Servo + {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N HE1 + {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N HE0 + {PB_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 BEEPER + {PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 HOTBED + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_TX[] = { + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_UART_RX[] = { + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_UART_RTS[] = { + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_UART_CTS[] = { + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +#ifdef HAL_CAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_RD[] = { + {PB_12, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {NC, NP, 0} +}; + +const PinMap PinMap_CAN_TD[] = { + {PB_13, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {NC, NP, 0} +}; +#endif + +//*** USB *** + +// If anyone for some unfathomable reason want to run gcode from Marlin's USB-C drive at 12Mbps - you can +#ifdef HAL_PCD_MODULE_ENABLED +WEAK const PinMap PinMap_USB_OTG_FS[] = { + {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM + {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_USB_OTG_HS[] = { + {NC, NP, 0} +}; +#endif + + diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/PinNamesVar.h new file mode 100644 index 000000000000..bff3f2134987 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/PinNamesVar.h @@ -0,0 +1,30 @@ +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, /* SYS_WKUP0 */ +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = NC, +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = NC, +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = NC, +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif +/* USB */ +#ifdef USBCON + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/hal_conf_extra.h new file mode 100644 index 000000000000..2ca9df2efcdf --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/hal_conf_extra.h @@ -0,0 +1,496 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + * Copyright (c) 2017 STMicroelectronics. + * All rights reserved. + * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_LEGACY_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +// #define HAL_UART_MODULE_ENABLED +// #define HAL_PCD_MODULE_ENABLED + +// #define HAL_CAN_MODULE_ENABLED +//#define HAL_CEC_MODULE_ENABLED +//#define HAL_CRYP_MODULE_ENABLED +//#define HAL_DCMI_MODULE_ENABLED +//#define HAL_DMA2D_MODULE_ENABLED +//#define HAL_ETH_MODULE_ENABLED +//#define HAL_FLASH_MODULE_ENABLED +//#define HAL_NAND_MODULE_ENABLED +//#define HAL_NOR_MODULE_ENABLED +//#define HAL_PCCARD_MODULE_ENABLED +//#define HAL_SRAM_MODULE_ENABLED +//#define HAL_SDRAM_MODULE_ENABLED +//#define HAL_HASH_MODULE_ENABLED +//#define HAL_SMBUS_MODULE_ENABLED +//#define HAL_I2S_MODULE_ENABLED +//#define HAL_IWDG_MODULE_ENABLED +//#define HAL_LTDC_MODULE_ENABLED +//#define HAL_DSI_MODULE_ENABLED +//#define HAL_QSPI_MODULE_ENABLED +//#define HAL_RNG_MODULE_ENABLED +//#define HAL_RTC_MODULE_ENABLED +//#define HAL_SAI_MODULE_ENABLED +//#define HAL_SD_MODULE_ENABLED +//#define HAL_IRDA_MODULE_ENABLED +//#define HAL_SMARTCARD_MODULE_ENABLED +//#define HAL_WWDG_MODULE_ENABLED +//#define HAL_HCD_MODULE_ENABLED +//#define HAL_FMPI2C_MODULE_ENABLED +//#define HAL_SPDIFRX_MODULE_ENABLED +//#define HAL_DFSDM_MODULE_ENABLED +//#define HAL_LPTIM_MODULE_ENABLED +//#define HAL_MMC_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#ifndef HSE_VALUE + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#ifndef HSE_STARTUP_TIMEOUT + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#ifndef HSI_VALUE + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#ifndef LSI_VALUE + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#ifndef LSE_VALUE + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#ifndef LSE_STARTUP_TIMEOUT + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#ifndef EXTERNAL_CLOCK_VALUE + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +// #define USE_FULL_ASSERT 1U + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t *file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/ldscript.ld new file mode 100644 index 000000000000..df1ed1581a39 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/ldscript.ld @@ -0,0 +1,203 @@ +/* +****************************************************************************** +** +** File : LinkerScript.ld +** +** Abstract : Linker script for STM32F4x7Vx Device with +** 512/1024KByte FLASH, 192KByte RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +** Copyright (c) 2019 STMicroelectronics +** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of STMicroelectronics nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE +CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K +FLASH (rx) : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + _siccmram = LOADADDR(.ccmram); + + /* CCM-RAM section + * + * IMPORTANT NOTE! + * If initialized variables will be placed in this section, + * the startup code needs to be modified to copy the init-values. + */ + .ccmram : + { + . = ALIGN(4); + _sccmram = .; /* create a global symbol at ccmram start */ + *(.ccmram) + *(.ccmram*) + + . = ALIGN(4); + _eccmram = .; /* create a global symbol at ccmram end */ + } >CCMRAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss section */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.cpp new file mode 100644 index 000000000000..00c7a90db313 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.cpp @@ -0,0 +1,288 @@ +/* + ******************************************************************************* + * Copyright (c) 2017, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ + +#include "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +// Digital PinName array +const PinName digitalPin[] = { + PA_0, // Digital pin 0 + PA_1, // Digital pin 1 + PA_2, // Digital pin 2 + PA_3, // Digital pin 3 + PA_4, // Digital pin 4 + PA_5, // Digital pin 5 + PA_6, // Digital pin 6 + PA_7, // Digital pin 7 + PA_8, // Digital pin 8 + PA_9, // Digital pin 9 + PA_10, // Digital pin 10 + PA_11, // Digital pin 11 + PA_12, // Digital pin 12 + PA_13, // Digital pin 13 + PA_14, // Digital pin 14 + PA_15, // Digital pin 15 + + PB_0, // Digital pin 16 + PB_1, // Digital pin 17 + PB_2, // Digital pin 18 + PB_3, // Digital pin 19 + PB_4, // Digital pin 20 + PB_5, // Digital pin 21 + PB_6, // Digital pin 22 + PB_7, // Digital pin 23 + PB_8, // Digital pin 24 + PB_9, // Digital pin 25 + PB_10, // Digital pin 26 + PB_11, // Digital pin 27 + PB_12, // Digital pin 28 + PB_13, // Digital pin 29 + PB_14, // Digital pin 30 + PB_15, // Digital pin 31 + + PC_0, // Digital pin 32 + PC_1, // Digital pin 33 + PC_2, // Digital pin 34 + PC_3, // Digital pin 35 + PC_4, // Digital pin 36 + PC_5, // Digital pin 37 + PC_6, // Digital pin 38 + PC_7, // Digital pin 39 + PC_8, // Digital pin 40 + PC_9, // Digital pin 41 + PC_10, // Digital pin 42 + PC_11, // Digital pin 43 + PC_12, // Digital pin 44 + PC_13, // Digital pin 45 + PC_14, // Digital pin 46 + PC_15, // Digital pin 47 + + PD_0, // Digital pin 48 + PD_1, // Digital pin 49 + PD_2, // Digital pin 50 + PD_3, // Digital pin 51 + PD_4, // Digital pin 52 + PD_5, // Digital pin 53 + PD_6, // Digital pin 54 + PD_7, // Digital pin 55 + PD_8, // Digital pin 56 + PD_9, // Digital pin 57 + PD_10, // Digital pin 58 + PD_11, // Digital pin 59 + PD_12, // Digital pin 60 + PD_13, // Digital pin 61 + PD_14, // Digital pin 62 + PD_15, // Digital pin 63 + + PE_0, // Digital pin 64 + PE_1, // Digital pin 65 + PE_2, // Digital pin 66 + PE_3, // Digital pin 67 + PE_4, // Digital pin 68 + PE_5, // Digital pin 69 + PE_6, // Digital pin 70 + PE_7, // Digital pin 71 + PE_8, // Digital pin 72 + PE_9, // Digital pin 73 + PE_10, // Digital pin 74 + PE_11, // Digital pin 75 + PE_12, // Digital pin 76 + PE_13, // Digital pin 77 + PE_14, // Digital pin 78 + PE_15, // Digital pin 79 + + PH_0, // Digital pin 80, used by the external oscillator + PH_1 // Digital pin 81, used by the external oscillator +}; + +// Analog (Ax) pin number array +const uint32_t analogInputPin[] = { + 0, // A0, PA0 + 1, // A1, PA1 + 2, // A2, PA2 + 3, // A3, PA3 + 4, // A4, PA4 + 5, // A5, PA5 + 6, // A6, PA6 + 7, // A7, PA7 + 16, // A8, PB0 + 17, // A9, PB1 + 32, // A10, PC0 + 33, // A11, PC1 + 34, // A12, PC2 + 35, // A13, PC3 + 36, // A14, PC4 + 37 // A15, PC5 +}; + +#ifdef __cplusplus +} +#endif + +// ---------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * @brief Configures the System clock source, PLL Multiplier and Divider factors, + * AHB/APBx prescalers and Flash settings + * @note This function should be called only once the RCC clock configuration + * is reset to the default reset state (done in SystemInit() function). + * @param None + * @retval None + */ + +/******************************************************************************/ +/* PLL (clocked by HSE) used as System clock source */ +/******************************************************************************/ +static uint8_t SetSysClock_PLL_HSE(uint8_t bypass) +{ + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + // Enable HSE oscillator and activate PLL with HSE as source + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + if (bypass == 0) { + RCC_OscInitStruct.HSEState = RCC_HSE_ON; // External 8 MHz xtal on OSC_IN/OSC_OUT + } else { + RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; // External 8 MHz clock on OSC_IN + } + + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE / 1000000L; // Expects an 8 MHz external clock by default. Redefine HSE_VALUE if not + RCC_OscInitStruct.PLL.PLLN = 336; // VCO output clock = 336 MHz (1 MHz * 336) + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; // PLLCLK = 168 MHz (336 MHz / 2) + RCC_OscInitStruct.PLL.PLLQ = 7; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + return 0; // FAIL + } + + // Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // 168 MHz + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; // 42 MHz + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; // 84 MHz + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { + return 0; // FAIL + } + + /* Output clock on MCO1 pin(PA8) for debugging purpose */ + /* + if (bypass == 0) + HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_2); // 4 MHz + else + HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1); // 8 MHz + */ + + return 1; // OK +} + +/******************************************************************************/ +/* PLL (clocked by HSI) used as System clock source */ +/******************************************************************************/ +uint8_t SetSysClock_PLL_HSI(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + // Enable HSI oscillator and activate PLL with HSI as source + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.HSEState = RCC_HSE_OFF; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; + RCC_OscInitStruct.PLL.PLLM = 16; // VCO input clock = 1 MHz (16 MHz / 16) + RCC_OscInitStruct.PLL.PLLN = 336; // VCO output clock = 336 MHz (1 MHz * 336) + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; // PLLCLK = 168 MHz (336 MHz / 2) + RCC_OscInitStruct.PLL.PLLQ = 7; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + return 0; // FAIL + } + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // 168 MHz + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; // 42 MHz + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; // 84 MHz + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { + return 0; // FAIL + } + + /* Output clock on MCO1 pin(PA8) for debugging purpose */ + //HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1); // 16 MHz + + return 1; // OK +} + +WEAK void SystemClock_Config(void) +{ + /* 1- If fail try to start with HSE and external xtal */ + if (SetSysClock_PLL_HSE(0) == 0) { + /* 2- Try to start with HSE and external clock */ + if (SetSysClock_PLL_HSE(1) == 0) { + /* 3- If fail start with HSI clock */ + if (SetSysClock_PLL_HSI() == 0) { + Error_Handler(); + } + } + } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + + /* Output clock on MCO2 pin(PC9) for debugging purpose */ + //HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_SYSCLK, RCC_MCODIV_4); +} + +#ifdef __cplusplus +} +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.h new file mode 100644 index 000000000000..dcc8c493956c --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.h @@ -0,0 +1,196 @@ +/* + ******************************************************************************* + * Copyright (c) 2017, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +// +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + // | DIGITAL | ANALOG IN | ANALOG OUT | UART/USART | TWI | SPI | SPECIAL | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PA0 PIN_A0 // | 0 | A0 (ADC1) | | UART4_TX | | | | +#define PA1 PIN_A1 // | 1 | A1 (ADC1) | | UART4_RX | | | | +#define PA2 PIN_A2 // | 2 | A2 (ADC1) | | USART2_TX | | | | +#define PA3 PIN_A3 // | 3 | A3 (ADC1) | | USART2_RX | | | | +#define PA4 PIN_A4 // | 4 | A4 (ADC1) | DAC_OUT1 | | | SPI1_SS, (SPI3_SS) | | +#define PA5 PIN_A5 // | 5 | A5 (ADC1) | DAC_OUT2 | | | SPI1_SCK | | +#define PA6 PIN_A6 // | 6 | A6 (ADC1) | | | | SPI1_MISO | | +#define PA7 PIN_A7 // | 7 | A7 (ADC1) | | | | SPI1_MOSI | | +#define PA8 8 // | 8 | | | | TWI3_SCL | | | +#define PA9 9 // | 9 | | | USART1_TX | | | | +#define PA10 10 // | 10 | | | USART1_RX | | | | +#define PA11 11 // | 11 | | | | | | | +#define PA12 12 // | 12 | | | | | | | +#define PA13 13 // | 13 | | | | | | SWD_SWDIO | +#define PA14 14 // | 14 | | | | | | SWD_SWCLK | +#define PA15 15 // | 15 | | | | | SPI3_SS, (SPI1_SS) | | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PB0 PIN_A8 // | 16 | A8 (ADC1) | | | | | | +#define PB1 PIN_A9 // | 17 | A9 (ADC1) | | | | | | +#define PB2 18 // | 18 | | | | | | BOOT1 | +#define PB3 19 // | 19 | | | | | SPI3_SCK, (SPI1_SCK) | | +#define PB4 20 // | 20 | | | | | SPI3_MISO, (SPI1_MISO) | | +#define PB5 21 // | 21 | | | | | SPI3_MOSI, (SPI1_MOSI) | | +#define PB6 22 // | 22 | | | USART1_TX | TWI1_SCL | | | +#define PB7 23 // | 23 | | | USART1_RX | TWI1_SDA | | | +#define PB8 24 // | 24 | | | | TWI1_SCL | | | +#define PB9 25 // | 25 | | | | TWI1_SDA | SPI2_SS | | +#define PB10 26 // | 26 | | | USART3_TX, (UART4_TX) | TWI2_SCL | SPI2_SCK | | +#define PB11 27 // | 27 | | | USART3_RX | TWI2_SDA | | | +#define PB12 28 // | 28 | | | | | SPI2_SS | | +#define PB13 29 // | 29 | | | | | SPI2_SCK | | +#define PB14 30 // | 30 | | | | | SPI2_MISO | | +#define PB15 31 // | 31 | | | | | SPI2_MOSI | | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PC0 PIN_A10 // | 32 | A10 (ADC1) | | | | | | +#define PC1 PIN_A11 // | 33 | A11 (ADC1) | | | | | | +#define PC2 PIN_A12 // | 34 | A12 (ADC1) | | | | SPI2_MISO | | +#define PC3 PIN_A13 // | 35 | A13 (ADC1) | | | | SPI2_MOSI | | +#define PC4 PIN_A14 // | 36 | A14 (ADC1) | | | | | | +#define PC5 PIN_A15 // | 37 | A15 (ADC1) | | USART3_RX | | | | +#define PC6 38 // | 38 | | | USART6_TX | | | | +#define PC7 39 // | 39 | | | USART6_RX | | | | +#define PC8 40 // | 40 | | | | | | | +#define PC9 41 // | 41 | | | USART3_TX | TWI3_SDA | | | +#define PC10 42 // | 42 | | | | | SPI3_SCK | | +#define PC11 43 // | 43 | | | USART3_RX, (UART4_RX) | | SPI3_MISO | | +#define PC12 44 // | 44 | | | UART5_TX | | SPI3_MOSI | | +#define PC13 45 // | 45 | | | | | | | +#define PC14 46 // | 46 | | | | | | OSC32_IN | +#define PC15 47 // | 47 | | | | | | OSC32_OUT | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PD0 48 // | 48 | | | | | | | +#define PD1 49 // | 49 | | | | | | | +#define PD2 50 // | 50 | | | UART5_RX | | | | +#define PD3 51 // | 51 | | | | | | | +#define PD4 52 // | 52 | | | | | | | +#define PD5 53 // | 53 | | | USART2_TX | | | | +#define PD6 54 // | 54 | | | USART2_RX | | | | +#define PD7 55 // | 55 | | | | | | | +#define PD8 56 // | 56 | | | USART3_TX | | | | +#define PD9 57 // | 57 | | | USART3_RX | | | | +#define PD10 58 // | 58 | | | | | | | +#define PD11 59 // | 59 | | | | | | | +#define PD12 60 // | 60 | | | | | | | +#define PD13 61 // | 61 | | | | | | | +#define PD14 62 // | 62 | | | | | | | +#define PD15 63 // | 63 | | | | | | | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PE0 64 // | 64 | | | | | | | +#define PE1 65 // | 65 | | | | | | | +#define PE2 66 // | 66 | | | | | | | +#define PE3 67 // | 67 | | | | | | | +#define PE4 68 // | 68 | | | | | | | +#define PE5 69 // | 69 | | | | | | | +#define PE6 70 // | 70 | | | | | | | +#define PE7 71 // | 71 | | | | | | | +#define PE8 72 // | 72 | | | | | | | +#define PE9 73 // | 73 | | | | | | | +#define PE10 74 // | 74 | | | | | | | +#define PE11 75 // | 75 | | | | | | | +#define PE12 76 // | 76 | | | | | | | +#define PE13 77 // | 77 | | | | | | | +#define PE14 78 // | 78 | | | | | | | +#define PE15 79 // | 79 | | | | | | | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PH0 80 // | 80 | | | | | | OSC_IN | +#define PH1 81 // | 81 | | | | | | OSC_OUT | + // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| + +// This must be a literal +#define NUM_DIGITAL_PINS 82 +#define NUM_ANALOG_INPUTS 16 + +// Below SPI and I2C definitions already done in the core +// Could be redefined here if differs from the default one +// SPI Definitions +#define PIN_SPI_SS PC9 +#define PIN_SPI_SCK PC10 +#define PIN_SPI_MISO PC11 +#define PIN_SPI_MOSI PC12 + +// I2C Definitions +#define PIN_WIRE_SCL PB8 +#define PIN_WIRE_SDA PB9 + +// Timer Definitions +// Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c +// TIM1 = HEATER0, HEATER1, [SERVO] +// TIM2 = FAN1, FAN2, [BEEPER] +// TIM4 = HEATER_BED +// TIM5 = HEATER2, FAN0 +// Uses default for STM32F4xx STEP_TIMER 6 and TEMP_TIMER 14 +#define TIMER_SERVO TIM1 // TIMER_SERVO must be defined in this file +#define TIMER_TONE TIM2 // TIMER_TONE must be defined in this file +#define TIMER_SERIAL TIM3 // TIMER_SERIAL must be defined in this file + +// USART1 (direct to RK3328 SoC) +#define ENABLE_HWSERIAL1 +#define PIN_SERIAL1_TX PA9 +#define PIN_SERIAL1_RX PA10 + +// USART3 connector +#define ENABLE_HWSERIAL3 +#define PIN_SERIAL3_TX PB10 +#define PIN_SERIAL3_RX PB11 + +#ifdef __cplusplus +} // extern "C" +#endif +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial1 +#define SERIAL_PORT_USBVIRTUAL SerialUSB +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE1 Serial3 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 +#define SERIAL_PORT_HARDWARE_OPEN1 Serial3 +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/hal_conf_extra.h index a5961a488bf7..8a04b8be103b 100755 --- a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/hal_conf_extra.h @@ -8,8 +8,8 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

+ * Copyright (c) 2017 STMicroelectronics. + * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the diff --git a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/ldscript.ld index e07c5e4acef9..55ae9227db3b 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/ldscript.ld @@ -20,7 +20,7 @@ ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2019 STMicroelectronics

+** Copyright (c) 2019 STMicroelectronics ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: diff --git a/buildroot/share/git/mfinfo b/buildroot/share/git/mfinfo index 3f183b8fd8f0..c74e48650cbc 100755 --- a/buildroot/share/git/mfinfo +++ b/buildroot/share/git/mfinfo @@ -56,7 +56,7 @@ done case "$REPO" in Marlin ) TARG=bugfix-2.1.x ; ((INDEX == 1)) && TARG=bugfix-1.1.x ; [[ $BRANCH =~ ^[12]$ ]] && USAGE=1 ;; - Configurations ) TARG=import-2.0.x ;; + Configurations ) TARG=import-2.1.x ;; MarlinDocumentation ) TARG=master ;; AutoBuildMarlin ) TARG=master ;; esac diff --git a/buildroot/share/scripts/config-labels.py b/buildroot/share/scripts/config-labels.py index b721baf441fb..b571a434b7e1 100755 --- a/buildroot/share/scripts/config-labels.py +++ b/buildroot/share/scripts/config-labels.py @@ -47,150 +47,150 @@ #---------------------------------------------- def process_file(subdir: str, filename: str): #---------------------------------------------- - global filenum - filenum += 1 - - print(str(filenum) + ' ' + filename + ': ' + subdir) - - def_line = (def_macro_name + ' "' + subdir.replace('\\', '/') + '"') - - #------------------------ - # Read file - #------------------------ - lines = [] - infilepath = Path(input_examples_dir, subdir, filename) - try: - # UTF-8 because some files contain unicode chars - with infilepath.open('rt', encoding="utf-8") as infile: - lines = infile.readlines() - - except Exception as e: - print('Failed to read file: ' + str(e) ) - raise Exception - - lines = [line.rstrip('\r\n') for line in lines] - - #------------------------ - # Process lines - #------------------------ - file_modified = False - - # region state machine - # -1 = before pragma once; - # 0 = region to place define; - # 1 = past region to place define - region = -1 - - outlines = [] - for line in lines: - outline = line - - if (region == -1) and (def_macro_name in line): - outline = None - file_modified = True - - elif (region == -1) and ('pragma once' in line): - region = 0 - - elif (region == 0): - if (line.strip() == ''): - pass - elif (def_macro_name in line): - region = 1 - if line == def_line: # leave it as is - pass - else: - outline = def_line - file_modified = True - else: # some other string - outlines.append(def_line) - outlines.append('') - region = 1 - file_modified = True - - elif (region == 1): - if (def_macro_name in line): - outline = None - file_modified = True - else: - pass - - # end if - if outline is not None: - outlines.append(outline) - # end for - - #------------------------- - # Output file - #------------------------- - outdir = Path(output_examples_dir, subdir) - outfilepath = outdir / filename - - if file_modified: - # Note: no need to create output dirs, as the initial copy_tree - # will do that. - - print(' writing ' + str(outfilepath)) - try: - # Preserve unicode chars; Avoid CR-LF on Windows. - with outfilepath.open("w", encoding="utf-8", newline='\n') as outfile: - outfile.write("\n".join(outlines) + "\n") - - except Exception as e: - print('Failed to write file: ' + str(e) ) - raise Exception - else: - print(' no change for ' + str(outfilepath)) + global filenum + filenum += 1 + + print(str(filenum) + ' ' + filename + ': ' + subdir) + + def_line = (def_macro_name + ' "' + subdir.replace('\\', '/') + '"') + + #------------------------ + # Read file + #------------------------ + lines = [] + infilepath = Path(input_examples_dir, subdir, filename) + try: + # UTF-8 because some files contain unicode chars + with infilepath.open('rt', encoding="utf-8") as infile: + lines = infile.readlines() + + except Exception as e: + print('Failed to read file: ' + str(e) ) + raise Exception + + lines = [line.rstrip('\r\n') for line in lines] + + #------------------------ + # Process lines + #------------------------ + file_modified = False + + # region state machine + # -1 = before pragma once; + # 0 = region to place define; + # 1 = past region to place define + region = -1 + + outlines = [] + for line in lines: + outline = line + + if (region == -1) and (def_macro_name in line): + outline = None + file_modified = True + + elif (region == -1) and ('pragma once' in line): + region = 0 + + elif (region == 0): + if (line.strip() == ''): + pass + elif (def_macro_name in line): + region = 1 + if line == def_line: # leave it as is + pass + else: + outline = def_line + file_modified = True + else: # some other string + outlines.append(def_line) + outlines.append('') + region = 1 + file_modified = True + + elif (region == 1): + if (def_macro_name in line): + outline = None + file_modified = True + else: + pass + + # end if + if outline is not None: + outlines.append(outline) + # end for + + #------------------------- + # Output file + #------------------------- + outdir = Path(output_examples_dir, subdir) + outfilepath = outdir / filename + + if file_modified: + # Note: no need to create output dirs, as the initial copy_tree + # will do that. + + print(' writing ' + str(outfilepath)) + try: + # Preserve unicode chars; Avoid CR-LF on Windows. + with outfilepath.open("w", encoding="utf-8", newline='\n') as outfile: + outfile.write("\n".join(outlines) + "\n") + + except Exception as e: + print('Failed to write file: ' + str(e) ) + raise Exception + else: + print(' no change for ' + str(outfilepath)) #---------- def main(): #---------- - global filenum - global input_examples_dir - global output_examples_dir - filenum = 0 - - #-------------------------------- - # Check for requirements - #-------------------------------- - input_examples_dir = input_examples_dir.strip() - input_examples_dir = input_examples_dir.rstrip('\\/') - output_examples_dir = output_examples_dir.strip() - output_examples_dir = output_examples_dir.rstrip('\\/') - - for dir in (input_examples_dir, output_examples_dir): - if not Path(dir).exists(): - print('Directory not found: ' + dir) - sys.exit(1) - - #-------------------------------- - # Copy tree if necessary. - #-------------------------------- - # This includes files that are not otherwise included in the - # insertion of the define statement. - # - if different_out_dir: - print('Copying files to new directory: ' + output_examples_dir) - try: - copy_tree(input_examples_dir, output_examples_dir) - except Exception as e: - print('Failed to copy directory: ' + str(e) ) - raise Exception - - #----------------------------- - # Find and process files - #----------------------------- - len_input_examples_dir = 1 + len(input_examples_dir) - - for filename in files_to_mod: - input_path = Path(input_examples_dir) - filepathlist = input_path.rglob(filename) - - for filepath in filepathlist: - fulldirpath = str(filepath.parent) - subdir = fulldirpath[len_input_examples_dir:] - - process_file(subdir, filename) + global filenum + global input_examples_dir + global output_examples_dir + filenum = 0 + + #-------------------------------- + # Check for requirements + #-------------------------------- + input_examples_dir = input_examples_dir.strip() + input_examples_dir = input_examples_dir.rstrip('\\/') + output_examples_dir = output_examples_dir.strip() + output_examples_dir = output_examples_dir.rstrip('\\/') + + for dir in (input_examples_dir, output_examples_dir): + if not Path(dir).exists(): + print('Directory not found: ' + dir) + sys.exit(1) + + #-------------------------------- + # Copy tree if necessary. + #-------------------------------- + # This includes files that are not otherwise included in the + # insertion of the define statement. + # + if different_out_dir: + print('Copying files to new directory: ' + output_examples_dir) + try: + copy_tree(input_examples_dir, output_examples_dir) + except Exception as e: + print('Failed to copy directory: ' + str(e) ) + raise Exception + + #----------------------------- + # Find and process files + #----------------------------- + len_input_examples_dir = 1 + len(input_examples_dir) + + for filename in files_to_mod: + input_path = Path(input_examples_dir) + filepathlist = input_path.rglob(filename) + + for filepath in filepathlist: + fulldirpath = str(filepath.parent) + subdir = fulldirpath[len_input_examples_dir:] + + process_file(subdir, filename) #============== print('--- Starting config-labels ---') diff --git a/buildroot/share/scripts/gen-tft-image.py b/buildroot/share/scripts/gen-tft-image.py index 9b7d19493eca..f3786aef706c 100644 --- a/buildroot/share/scripts/gen-tft-image.py +++ b/buildroot/share/scripts/gen-tft-image.py @@ -26,38 +26,38 @@ from PIL import Image def image2bin(image, output_file): - if output_file.endswith(('.c', '.cpp')): - f = open(output_file, 'wt') - is_cpp = True - f.write("const uint16_t image[%d] = {\n" % (image.size[1] * image.size[0])) - else: - f = open(output_file, 'wb') - is_cpp = False - pixs = image.load() - for y in range(image.size[1]): - for x in range(image.size[0]): - R = pixs[x, y][0] >> 3 - G = pixs[x, y][1] >> 2 - B = pixs[x, y][2] >> 3 - rgb = (R << 11) | (G << 5) | B - if is_cpp: - strHex = '0x{0:04X}, '.format(rgb) - f.write(strHex) - else: - f.write(struct.pack("B", (rgb & 0xFF))) - f.write(struct.pack("B", (rgb >> 8) & 0xFF)) - if is_cpp: - f.write("\n") - if is_cpp: - f.write("};\n") - f.close() + if output_file.endswith(('.c', '.cpp')): + f = open(output_file, 'wt') + is_cpp = True + f.write("const uint16_t image[%d] = {\n" % (image.size[1] * image.size[0])) + else: + f = open(output_file, 'wb') + is_cpp = False + pixs = image.load() + for y in range(image.size[1]): + for x in range(image.size[0]): + R = pixs[x, y][0] >> 3 + G = pixs[x, y][1] >> 2 + B = pixs[x, y][2] >> 3 + rgb = (R << 11) | (G << 5) | B + if is_cpp: + strHex = '0x{0:04X}, '.format(rgb) + f.write(strHex) + else: + f.write(struct.pack("B", (rgb & 0xFF))) + f.write(struct.pack("B", (rgb >> 8) & 0xFF)) + if is_cpp: + f.write("\n") + if is_cpp: + f.write("};\n") + f.close() if len(sys.argv) <= 2: - print("Utility to export a image in Marlin TFT friendly format.") - print("It will dump a raw bin RGB565 image or create a CPP file with an array of 16 bit image pixels.") - print("Usage: gen-tft-image.py INPUT_IMAGE.(png|bmp|jpg) OUTPUT_FILE.(cpp|bin)") - print("Author: rhapsodyv") - exit(1) + print("Utility to export a image in Marlin TFT friendly format.") + print("It will dump a raw bin RGB565 image or create a CPP file with an array of 16 bit image pixels.") + print("Usage: gen-tft-image.py INPUT_IMAGE.(png|bmp|jpg) OUTPUT_FILE.(cpp|bin)") + print("Author: rhapsodyv") + exit(1) output_img = sys.argv[2] img = Image.open(sys.argv[1]) diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index ef042fcdedba..caa1fbae2303 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -25,320 +25,320 @@ #-----------------# def Upload(source, target, env): - #-------# - # Debug # - #-------# - Debug = False # Set to True to enable script debug - def debugPrint(data): - if Debug: print(f"[Debug]: {data}") - - #------------------# - # Marlin functions # - #------------------# - def _GetMarlinEnv(marlinEnv, feature): - if not marlinEnv: return None - return marlinEnv[feature] if feature in marlinEnv else None - - #----------------# - # Port functions # - #----------------# - def _GetUploadPort(env): - debugPrint('Autodetecting upload port...') - env.AutodetectUploadPort(env) - portName = env.subst('$UPLOAD_PORT') - if not portName: - raise Exception('Error detecting the upload port.') - debugPrint('OK') - return portName - - #-------------------------# - # Simple serial functions # - #-------------------------# - def _OpenPort(): - # Open serial port - if port.is_open: return - debugPrint('Opening upload port...') - port.open() - port.reset_input_buffer() - debugPrint('OK') - - def _ClosePort(): - # Open serial port - if port is None: return - if not port.is_open: return - debugPrint('Closing upload port...') - port.close() - debugPrint('OK') - - def _Send(data): - debugPrint(f'>> {data}') - strdata = bytearray(data, 'utf8') + b'\n' - port.write(strdata) - time.sleep(0.010) - - def _Recv(): - clean_responses = [] - responses = port.readlines() - for Resp in responses: - # Suppress invalid chars (coming from debug info) - try: - clean_response = Resp.decode('utf8').rstrip().lstrip() - clean_responses.append(clean_response) - debugPrint(f'<< {clean_response}') - except: - pass - return clean_responses - - #------------------# - # SDCard functions # - #------------------# - def _CheckSDCard(): - debugPrint('Checking SD card...') - _Send('M21') - Responses = _Recv() - if len(Responses) < 1 or not any('SD card ok' in r for r in Responses): - raise Exception('Error accessing SD card') - debugPrint('SD Card OK') - return True - - #----------------# - # File functions # - #----------------# - def _GetFirmwareFiles(UseLongFilenames): - debugPrint('Get firmware files...') - _Send(f"M20 F{'L' if UseLongFilenames else ''}") - Responses = _Recv() - if len(Responses) < 3 or not any('file list' in r for r in Responses): - raise Exception('Error getting firmware files') - debugPrint('OK') - return Responses - - def _FilterFirmwareFiles(FirmwareList, UseLongFilenames): - Firmwares = [] - for FWFile in FirmwareList: - # For long filenames take the 3rd column of the firmwares list - if UseLongFilenames: - Space = 0 - Space = FWFile.find(' ') - if Space >= 0: Space = FWFile.find(' ', Space + 1) - if Space >= 0: FWFile = FWFile[Space + 1:] - if not '/' in FWFile and '.BIN' in FWFile.upper(): - Firmwares.append(FWFile[:FWFile.upper().index('.BIN') + 4]) - return Firmwares - - def _RemoveFirmwareFile(FirmwareFile): - _Send(f'M30 /{FirmwareFile}') - Responses = _Recv() - Removed = len(Responses) >= 1 and any('File deleted' in r for r in Responses) - if not Removed: - raise Exception(f"Firmware file '{FirmwareFile}' not removed") - return Removed - - def _RollbackUpload(FirmwareFile): - if not rollback: return - print(f"Rollback: trying to delete firmware '{FirmwareFile}'...") - _OpenPort() - # Wait for SD card release - time.sleep(1) - # Remount SD card - _CheckSDCard() - print(' OK' if _RemoveFirmwareFile(FirmwareFile) else ' Error!') - _ClosePort() - - - #---------------------# - # Callback Entrypoint # - #---------------------# - port = None - protocol = None - filetransfer = None - rollback = False - - # Get Marlin evironment vars - MarlinEnv = env['MARLIN_FEATURES'] - marlin_pioenv = _GetMarlinEnv(MarlinEnv, 'PIOENV') - marlin_motherboard = _GetMarlinEnv(MarlinEnv, 'MOTHERBOARD') - marlin_board_info_name = _GetMarlinEnv(MarlinEnv, 'BOARD_INFO_NAME') - marlin_board_custom_build_flags = _GetMarlinEnv(MarlinEnv, 'BOARD_CUSTOM_BUILD_FLAGS') - marlin_firmware_bin = _GetMarlinEnv(MarlinEnv, 'FIRMWARE_BIN') - marlin_long_filename_host_support = _GetMarlinEnv(MarlinEnv, 'LONG_FILENAME_HOST_SUPPORT') is not None - marlin_longname_write = _GetMarlinEnv(MarlinEnv, 'LONG_FILENAME_WRITE_SUPPORT') is not None - marlin_custom_firmware_upload = _GetMarlinEnv(MarlinEnv, 'CUSTOM_FIRMWARE_UPLOAD') is not None - marlin_short_build_version = _GetMarlinEnv(MarlinEnv, 'SHORT_BUILD_VERSION') - marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR') - - # Get firmware upload params - upload_firmware_source_name = str(source[0]) # Source firmware filename - upload_speed = env['UPLOAD_SPEED'] if 'UPLOAD_SPEED' in env else 115200 - # baud rate of serial connection - upload_port = _GetUploadPort(env) # Serial port to use - - # Set local upload params - upload_firmware_target_name = os.path.basename(upload_firmware_source_name) - # Target firmware filename - upload_timeout = 1000 # Communication timout, lossy/slow connections need higher values - upload_blocksize = 512 # Transfer block size. 512 = Autodetect - upload_compression = True # Enable compression - upload_error_ratio = 0 # Simulated corruption ratio - upload_test = False # Benchmark the serial link without storing the file - upload_reset = True # Trigger a soft reset for firmware update after the upload - - # Set local upload params based on board type to change script behavior - # "upload_delete_old_bins": delete all *.bin files in the root of SD Card - upload_delete_old_bins = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423', - 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', - 'BOARD_CREALITY_V24S1'] - # "upload_random_name": generate a random 8.3 firmware filename to upload - upload_random_filename = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423', - 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', - 'BOARD_CREALITY_V24S1'] and not marlin_long_filename_host_support - - try: - - # Start upload job - print(f"Uploading firmware '{os.path.basename(upload_firmware_target_name)}' to '{marlin_motherboard}' via '{upload_port}'") - - # Dump some debug info - if Debug: - print('Upload using:') - print('---- Marlin -----------------------------------') - print(f' PIOENV : {marlin_pioenv}') - print(f' SHORT_BUILD_VERSION : {marlin_short_build_version}') - print(f' STRING_CONFIG_H_AUTHOR : {marlin_string_config_h_author}') - print(f' MOTHERBOARD : {marlin_motherboard}') - print(f' BOARD_INFO_NAME : {marlin_board_info_name}') - print(f' CUSTOM_BUILD_FLAGS : {marlin_board_custom_build_flags}') - print(f' FIRMWARE_BIN : {marlin_firmware_bin}') - print(f' LONG_FILENAME_HOST_SUPPORT : {marlin_long_filename_host_support}') - print(f' LONG_FILENAME_WRITE_SUPPORT : {marlin_longname_write}') - print(f' CUSTOM_FIRMWARE_UPLOAD : {marlin_custom_firmware_upload}') - print('---- Upload parameters ------------------------') - print(f' Source : {upload_firmware_source_name}') - print(f' Target : {upload_firmware_target_name}') - print(f' Port : {upload_port} @ {upload_speed} baudrate') - print(f' Timeout : {upload_timeout}') - print(f' Block size : {upload_blocksize}') - print(f' Compression : {upload_compression}') - print(f' Error ratio : {upload_error_ratio}') - print(f' Test : {upload_test}') - print(f' Reset : {upload_reset}') - print('-----------------------------------------------') - - # Custom implementations based on board parameters - # Generate a new 8.3 random filename - if upload_random_filename: - upload_firmware_target_name = f"fw-{''.join(random.choices('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', k=5))}.BIN" - print(f"Board {marlin_motherboard}: Overriding firmware filename to '{upload_firmware_target_name}'") - - # Delete all *.bin files on the root of SD Card (if flagged) - if upload_delete_old_bins: - # CUSTOM_FIRMWARE_UPLOAD is needed for this feature - if not marlin_custom_firmware_upload: - raise Exception(f"CUSTOM_FIRMWARE_UPLOAD must be enabled in 'Configuration_adv.h' for '{marlin_motherboard}'") - - # Init & Open serial port - port = serial.Serial(upload_port, baudrate = upload_speed, write_timeout = 0, timeout = 0.1) - _OpenPort() - - # Check SD card status - _CheckSDCard() - - # Get firmware files - FirmwareFiles = _GetFirmwareFiles(marlin_long_filename_host_support) - if Debug: - for FirmwareFile in FirmwareFiles: - print(f'Found: {FirmwareFile}') - - # Get all 1st level firmware files (to remove) - OldFirmwareFiles = _FilterFirmwareFiles(FirmwareFiles[1:len(FirmwareFiles)-2], marlin_long_filename_host_support) # Skip header and footers of list - if len(OldFirmwareFiles) == 0: - print('No old firmware files to delete') - else: - print(f"Remove {len(OldFirmwareFiles)} old firmware file{'s' if len(OldFirmwareFiles) != 1 else ''}:") - for OldFirmwareFile in OldFirmwareFiles: - print(f" -Removing- '{OldFirmwareFile}'...") - print(' OK' if _RemoveFirmwareFile(OldFirmwareFile) else ' Error!') - - # Close serial - _ClosePort() - - # Cleanup completed - debugPrint('Cleanup completed') - - # WARNING! The serial port must be closed here because the serial transfer that follow needs it! - - # Upload firmware file - debugPrint(f"Copy '{upload_firmware_source_name}' --> '{upload_firmware_target_name}'") - protocol = MarlinBinaryProtocol.Protocol(upload_port, upload_speed, upload_blocksize, float(upload_error_ratio), int(upload_timeout)) - #echologger = MarlinBinaryProtocol.EchoProtocol(protocol) - protocol.connect() - # Mark the rollback (delete broken transfer) from this point on - rollback = True - filetransfer = MarlinBinaryProtocol.FileTransferProtocol(protocol) - transferOK = filetransfer.copy(upload_firmware_source_name, upload_firmware_target_name, upload_compression, upload_test) - protocol.disconnect() - - # Notify upload completed - protocol.send_ascii('M117 Firmware uploaded' if transferOK else 'M117 Firmware upload failed') - - # Remount SD card - print('Wait for SD card release...') - time.sleep(1) - print('Remount SD card') - protocol.send_ascii('M21') - - # Transfer failed? - if not transferOK: - protocol.shutdown() - _RollbackUpload(upload_firmware_target_name) - else: - # Trigger firmware update - if upload_reset: - print('Trigger firmware update...') - protocol.send_ascii('M997', True) - protocol.shutdown() - - print('Firmware update completed' if transferOK else 'Firmware update failed') - return 0 if transferOK else -1 - - except KeyboardInterrupt: - print('Aborted by user') - if filetransfer: filetransfer.abort() - if protocol: - protocol.disconnect() - protocol.shutdown() - _RollbackUpload(upload_firmware_target_name) - _ClosePort() - raise - - except serial.SerialException as se: - # This exception is raised only for send_ascii data (not for binary transfer) - print(f'Serial excepion: {se}, transfer aborted') - if protocol: - protocol.disconnect() - protocol.shutdown() - _RollbackUpload(upload_firmware_target_name) - _ClosePort() - raise Exception(se) - - except MarlinBinaryProtocol.FatalError: - print('Too many retries, transfer aborted') - if protocol: - protocol.disconnect() - protocol.shutdown() - _RollbackUpload(upload_firmware_target_name) - _ClosePort() - raise - - except Exception as ex: - print(f"\nException: {ex}, transfer aborted") - if protocol: - protocol.disconnect() - protocol.shutdown() - _RollbackUpload(upload_firmware_target_name) - _ClosePort() - print('Firmware not updated') - raise + #-------# + # Debug # + #-------# + Debug = False # Set to True to enable script debug + def debugPrint(data): + if Debug: print(f"[Debug]: {data}") + + #------------------# + # Marlin functions # + #------------------# + def _GetMarlinEnv(marlinEnv, feature): + if not marlinEnv: return None + return marlinEnv[feature] if feature in marlinEnv else None + + #----------------# + # Port functions # + #----------------# + def _GetUploadPort(env): + debugPrint('Autodetecting upload port...') + env.AutodetectUploadPort(env) + portName = env.subst('$UPLOAD_PORT') + if not portName: + raise Exception('Error detecting the upload port.') + debugPrint('OK') + return portName + + #-------------------------# + # Simple serial functions # + #-------------------------# + def _OpenPort(): + # Open serial port + if port.is_open: return + debugPrint('Opening upload port...') + port.open() + port.reset_input_buffer() + debugPrint('OK') + + def _ClosePort(): + # Open serial port + if port is None: return + if not port.is_open: return + debugPrint('Closing upload port...') + port.close() + debugPrint('OK') + + def _Send(data): + debugPrint(f'>> {data}') + strdata = bytearray(data, 'utf8') + b'\n' + port.write(strdata) + time.sleep(0.010) + + def _Recv(): + clean_responses = [] + responses = port.readlines() + for Resp in responses: + # Suppress invalid chars (coming from debug info) + try: + clean_response = Resp.decode('utf8').rstrip().lstrip() + clean_responses.append(clean_response) + debugPrint(f'<< {clean_response}') + except: + pass + return clean_responses + + #------------------# + # SDCard functions # + #------------------# + def _CheckSDCard(): + debugPrint('Checking SD card...') + _Send('M21') + Responses = _Recv() + if len(Responses) < 1 or not any('SD card ok' in r for r in Responses): + raise Exception('Error accessing SD card') + debugPrint('SD Card OK') + return True + + #----------------# + # File functions # + #----------------# + def _GetFirmwareFiles(UseLongFilenames): + debugPrint('Get firmware files...') + _Send(f"M20 F{'L' if UseLongFilenames else ''}") + Responses = _Recv() + if len(Responses) < 3 or not any('file list' in r for r in Responses): + raise Exception('Error getting firmware files') + debugPrint('OK') + return Responses + + def _FilterFirmwareFiles(FirmwareList, UseLongFilenames): + Firmwares = [] + for FWFile in FirmwareList: + # For long filenames take the 3rd column of the firmwares list + if UseLongFilenames: + Space = 0 + Space = FWFile.find(' ') + if Space >= 0: Space = FWFile.find(' ', Space + 1) + if Space >= 0: FWFile = FWFile[Space + 1:] + if not '/' in FWFile and '.BIN' in FWFile.upper(): + Firmwares.append(FWFile[:FWFile.upper().index('.BIN') + 4]) + return Firmwares + + def _RemoveFirmwareFile(FirmwareFile): + _Send(f'M30 /{FirmwareFile}') + Responses = _Recv() + Removed = len(Responses) >= 1 and any('File deleted' in r for r in Responses) + if not Removed: + raise Exception(f"Firmware file '{FirmwareFile}' not removed") + return Removed + + def _RollbackUpload(FirmwareFile): + if not rollback: return + print(f"Rollback: trying to delete firmware '{FirmwareFile}'...") + _OpenPort() + # Wait for SD card release + time.sleep(1) + # Remount SD card + _CheckSDCard() + print(' OK' if _RemoveFirmwareFile(FirmwareFile) else ' Error!') + _ClosePort() + + + #---------------------# + # Callback Entrypoint # + #---------------------# + port = None + protocol = None + filetransfer = None + rollback = False + + # Get Marlin evironment vars + MarlinEnv = env['MARLIN_FEATURES'] + marlin_pioenv = _GetMarlinEnv(MarlinEnv, 'PIOENV') + marlin_motherboard = _GetMarlinEnv(MarlinEnv, 'MOTHERBOARD') + marlin_board_info_name = _GetMarlinEnv(MarlinEnv, 'BOARD_INFO_NAME') + marlin_board_custom_build_flags = _GetMarlinEnv(MarlinEnv, 'BOARD_CUSTOM_BUILD_FLAGS') + marlin_firmware_bin = _GetMarlinEnv(MarlinEnv, 'FIRMWARE_BIN') + marlin_long_filename_host_support = _GetMarlinEnv(MarlinEnv, 'LONG_FILENAME_HOST_SUPPORT') is not None + marlin_longname_write = _GetMarlinEnv(MarlinEnv, 'LONG_FILENAME_WRITE_SUPPORT') is not None + marlin_custom_firmware_upload = _GetMarlinEnv(MarlinEnv, 'CUSTOM_FIRMWARE_UPLOAD') is not None + marlin_short_build_version = _GetMarlinEnv(MarlinEnv, 'SHORT_BUILD_VERSION') + marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR') + + # Get firmware upload params + upload_firmware_source_name = str(source[0]) # Source firmware filename + upload_speed = env['UPLOAD_SPEED'] if 'UPLOAD_SPEED' in env else 115200 + # baud rate of serial connection + upload_port = _GetUploadPort(env) # Serial port to use + + # Set local upload params + upload_firmware_target_name = os.path.basename(upload_firmware_source_name) + # Target firmware filename + upload_timeout = 1000 # Communication timout, lossy/slow connections need higher values + upload_blocksize = 512 # Transfer block size. 512 = Autodetect + upload_compression = True # Enable compression + upload_error_ratio = 0 # Simulated corruption ratio + upload_test = False # Benchmark the serial link without storing the file + upload_reset = True # Trigger a soft reset for firmware update after the upload + + # Set local upload params based on board type to change script behavior + # "upload_delete_old_bins": delete all *.bin files in the root of SD Card + upload_delete_old_bins = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423', + 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', + 'BOARD_CREALITY_V24S1'] + # "upload_random_name": generate a random 8.3 firmware filename to upload + upload_random_filename = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423', + 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', + 'BOARD_CREALITY_V24S1'] and not marlin_long_filename_host_support + + try: + + # Start upload job + print(f"Uploading firmware '{os.path.basename(upload_firmware_target_name)}' to '{marlin_motherboard}' via '{upload_port}'") + + # Dump some debug info + if Debug: + print('Upload using:') + print('---- Marlin -----------------------------------') + print(f' PIOENV : {marlin_pioenv}') + print(f' SHORT_BUILD_VERSION : {marlin_short_build_version}') + print(f' STRING_CONFIG_H_AUTHOR : {marlin_string_config_h_author}') + print(f' MOTHERBOARD : {marlin_motherboard}') + print(f' BOARD_INFO_NAME : {marlin_board_info_name}') + print(f' CUSTOM_BUILD_FLAGS : {marlin_board_custom_build_flags}') + print(f' FIRMWARE_BIN : {marlin_firmware_bin}') + print(f' LONG_FILENAME_HOST_SUPPORT : {marlin_long_filename_host_support}') + print(f' LONG_FILENAME_WRITE_SUPPORT : {marlin_longname_write}') + print(f' CUSTOM_FIRMWARE_UPLOAD : {marlin_custom_firmware_upload}') + print('---- Upload parameters ------------------------') + print(f' Source : {upload_firmware_source_name}') + print(f' Target : {upload_firmware_target_name}') + print(f' Port : {upload_port} @ {upload_speed} baudrate') + print(f' Timeout : {upload_timeout}') + print(f' Block size : {upload_blocksize}') + print(f' Compression : {upload_compression}') + print(f' Error ratio : {upload_error_ratio}') + print(f' Test : {upload_test}') + print(f' Reset : {upload_reset}') + print('-----------------------------------------------') + + # Custom implementations based on board parameters + # Generate a new 8.3 random filename + if upload_random_filename: + upload_firmware_target_name = f"fw-{''.join(random.choices('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', k=5))}.BIN" + print(f"Board {marlin_motherboard}: Overriding firmware filename to '{upload_firmware_target_name}'") + + # Delete all *.bin files on the root of SD Card (if flagged) + if upload_delete_old_bins: + # CUSTOM_FIRMWARE_UPLOAD is needed for this feature + if not marlin_custom_firmware_upload: + raise Exception(f"CUSTOM_FIRMWARE_UPLOAD must be enabled in 'Configuration_adv.h' for '{marlin_motherboard}'") + + # Init & Open serial port + port = serial.Serial(upload_port, baudrate = upload_speed, write_timeout = 0, timeout = 0.1) + _OpenPort() + + # Check SD card status + _CheckSDCard() + + # Get firmware files + FirmwareFiles = _GetFirmwareFiles(marlin_long_filename_host_support) + if Debug: + for FirmwareFile in FirmwareFiles: + print(f'Found: {FirmwareFile}') + + # Get all 1st level firmware files (to remove) + OldFirmwareFiles = _FilterFirmwareFiles(FirmwareFiles[1:len(FirmwareFiles)-2], marlin_long_filename_host_support) # Skip header and footers of list + if len(OldFirmwareFiles) == 0: + print('No old firmware files to delete') + else: + print(f"Remove {len(OldFirmwareFiles)} old firmware file{'s' if len(OldFirmwareFiles) != 1 else ''}:") + for OldFirmwareFile in OldFirmwareFiles: + print(f" -Removing- '{OldFirmwareFile}'...") + print(' OK' if _RemoveFirmwareFile(OldFirmwareFile) else ' Error!') + + # Close serial + _ClosePort() + + # Cleanup completed + debugPrint('Cleanup completed') + + # WARNING! The serial port must be closed here because the serial transfer that follow needs it! + + # Upload firmware file + debugPrint(f"Copy '{upload_firmware_source_name}' --> '{upload_firmware_target_name}'") + protocol = MarlinBinaryProtocol.Protocol(upload_port, upload_speed, upload_blocksize, float(upload_error_ratio), int(upload_timeout)) + #echologger = MarlinBinaryProtocol.EchoProtocol(protocol) + protocol.connect() + # Mark the rollback (delete broken transfer) from this point on + rollback = True + filetransfer = MarlinBinaryProtocol.FileTransferProtocol(protocol) + transferOK = filetransfer.copy(upload_firmware_source_name, upload_firmware_target_name, upload_compression, upload_test) + protocol.disconnect() + + # Notify upload completed + protocol.send_ascii('M117 Firmware uploaded' if transferOK else 'M117 Firmware upload failed') + + # Remount SD card + print('Wait for SD card release...') + time.sleep(1) + print('Remount SD card') + protocol.send_ascii('M21') + + # Transfer failed? + if not transferOK: + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + else: + # Trigger firmware update + if upload_reset: + print('Trigger firmware update...') + protocol.send_ascii('M997', True) + protocol.shutdown() + + print('Firmware update completed' if transferOK else 'Firmware update failed') + return 0 if transferOK else -1 + + except KeyboardInterrupt: + print('Aborted by user') + if filetransfer: filetransfer.abort() + if protocol: + protocol.disconnect() + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + _ClosePort() + raise + + except serial.SerialException as se: + # This exception is raised only for send_ascii data (not for binary transfer) + print(f'Serial excepion: {se}, transfer aborted') + if protocol: + protocol.disconnect() + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + _ClosePort() + raise Exception(se) + + except MarlinBinaryProtocol.FatalError: + print('Too many retries, transfer aborted') + if protocol: + protocol.disconnect() + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + _ClosePort() + raise + + except Exception as ex: + print(f"\nException: {ex}, transfer aborted") + if protocol: + protocol.disconnect() + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + _ClosePort() + print('Firmware not updated') + raise # Attach custom upload callback env.Replace(UPLOADCMD=Upload) diff --git a/buildroot/tests/SAMD51_grandcentral_m4 b/buildroot/tests/SAMD51_grandcentral_m4 index c8e08c19e6b8..f96e0b18cdf1 100755 --- a/buildroot/tests/SAMD51_grandcentral_m4 +++ b/buildroot/tests/SAMD51_grandcentral_m4 @@ -21,7 +21,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R FILAMENT_RUNOUT_SENSOR G26_MESH_VALIDATION MESH_EDIT_GFX_OVERLAY Z_SAFE_HOMING \ EEPROM_SETTINGS NOZZLE_PARK_FEATURE SDSUPPORT SD_CHECK_AND_RETRY \ REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER Z_STEPPER_AUTO_ALIGN ADAPTIVE_STEP_SMOOTHING \ - STATUS_MESSAGE_SCROLLING LCD_SET_PROGRESS_MANUALLY SHOW_REMAINING_TIME USE_M73_REMAINING_TIME \ + STATUS_MESSAGE_SCROLLING SET_PROGRESS_MANUALLY SHOW_REMAINING_TIME SET_REMAINING_TIME \ LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \ SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index f1478bc2c421..a3c52372ef37 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -20,7 +20,7 @@ exec_test $1 $2 "Ender 3 v2 with JyersUI" "$3" use_example_configs "Creality/Ender-3 S1/STM32F1" opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CONFIGURATION_EMBEDDING CANCEL_OBJECTS FWRETRACT -opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING \ +opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT STATUS_MESSAGE_SCROLLING \ SOUND_MENU_ITEM PRINTCOUNTER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_SENSOR \ BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU \ LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index 9cb50688cdea..86b27790324d 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -30,8 +30,8 @@ opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATU REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING SHOW_CUSTOM_BOOTSCREEN BOOT_MARLIN_LOGO_SMALL \ SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT AUTO_REPORT_SD_STATUS SCROLL_LONG_FILENAMES MEDIA_MENU_AT_TOP \ EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_MENU_MAIN FREEZE_FEATURE CANCEL_OBJECTS SOUND_MENU_ITEM \ - MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE EXTRA_LIN_ADVANCE_K QUICK_HOME \ - LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \ + MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE ADVANCE_K_EXTRA QUICK_HOME \ + SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \ ENCODER_NOISE_FILTER BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE ..." "$3" @@ -42,7 +42,7 @@ use_example_configs AnimationExample opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO LCD_LANGUAGE jp_kana DEFAULT_EJERK 10 \ EXTRUDERS 5 TEMP_SENSOR_1 1 TEMP_SENSOR_2 5 TEMP_SENSOR_3 20 TEMP_SENSOR_4 1000 TEMP_SENSOR_BED 1 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI SHOW_CUSTOM_BOOTSCREEN BOOT_MARLIN_LOGO_SMALL \ - LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES \ + SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES \ SDSUPPORT LONG_FILENAME_WRITE_SUPPORT SDCARD_SORT_ALPHA NO_SD_AUTOSTART USB_FLASH_DRIVE_SUPPORT CANCEL_OBJECTS \ Z_PROBE_SLED AUTO_BED_LEVELING_UBL UBL_HILBERT_CURVE RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT \ EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_MENU_MAIN \ @@ -177,52 +177,52 @@ exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Greek" "$3" #opt_enable LCM1602 #exec_test $1 $2 "Stuff" "$3" -# -# Test Laser features with 12864 LCD -# -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 TEMP_SENSOR_1 0 SERIAL_PORT_2 2 \ - DEFAULT_AXIS_STEPS_PER_UNIT '{ 80, 80, 400 }' \ - DEFAULT_MAX_FEEDRATE '{ 300, 300, 5 }' \ - DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ - MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ - AXIS_RELATIVE_MODES '{ false, false, false }' -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT MEATPACK_ON_SERIAL_PORT_1 \ - LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_SYNCHRONOUS_M106_M107 -exec_test $1 $2 "MEGA2560 RAMPS | Laser Options | 12864 | Meatpack | Fan Sync | SERIAL_PORT_2 " "$3" +# # +# # Test Laser features with 12864 LCD +# # +# restore_configs +# opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 TEMP_SENSOR_1 0 SERIAL_PORT_2 2 \ +# DEFAULT_AXIS_STEPS_PER_UNIT '{ 80, 80, 400 }' \ +# DEFAULT_MAX_FEEDRATE '{ 300, 300, 5 }' \ +# DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ +# MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ +# AXIS_RELATIVE_MODES '{ false, false, false }' +# opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT MEATPACK_ON_SERIAL_PORT_1 \ +# LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_SYNCHRONOUS_M106_M107 +# exec_test $1 $2 "MEGA2560 RAMPS | Laser Options | 12864 | Meatpack | Fan Sync | SERIAL_PORT_2 " "$3" -# -# Test Laser features with 44780 LCD -# -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 TEMP_SENSOR_1 0 \ - DEFAULT_AXIS_STEPS_PER_UNIT '{ 80, 80, 400 }' \ - DEFAULT_MAX_FEEDRATE '{ 300, 300, 5 }' \ - DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ - MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ - AXIS_RELATIVE_MODES '{ false, false, false }' -opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER I2C_AMMETER \ - LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN -exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Laser Safety Timeout | Flowmeter | 44780 LCD " "$3" +# # +# # Test Laser features with 44780 LCD +# # +# restore_configs +# opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 TEMP_SENSOR_1 0 \ +# DEFAULT_AXIS_STEPS_PER_UNIT '{ 80, 80, 400 }' \ +# DEFAULT_MAX_FEEDRATE '{ 300, 300, 5 }' \ +# DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ +# MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ +# AXIS_RELATIVE_MODES '{ false, false, false }' +# opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER I2C_AMMETER \ +# LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN +# exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Laser Safety Timeout | Flowmeter | 44780 LCD " "$3" -# -# Test redundant temperature sensors + MAX TC + Backlight Timeout -# -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \ - TEMP_SENSOR_0 -2 TEMP_SENSOR_REDUNDANT -2 \ - TEMP_SENSOR_REDUNDANT_SOURCE E1 TEMP_SENSOR_REDUNDANT_TARGET E0 \ - TEMP_0_CS_PIN 11 TEMP_1_CS_PIN 12 \ - LCD_BACKLIGHT_TIMEOUT_MINS 2 -opt_enable MPCTEMP MINIPANEL -opt_disable PIDTEMP -exec_test $1 $2 "MEGA2560 RAMPS | Redundant temperature sensor | 2x MAX6675 | BL Timeout" "$3" +# # +# # Test redundant temperature sensors + MAX TC + Backlight Timeout +# # +# restore_configs +# opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \ +# TEMP_SENSOR_0 -2 TEMP_SENSOR_REDUNDANT -2 \ +# TEMP_SENSOR_REDUNDANT_SOURCE E1 TEMP_SENSOR_REDUNDANT_TARGET E0 \ +# TEMP_0_CS_PIN 11 TEMP_1_CS_PIN 12 \ +# LCD_BACKLIGHT_TIMEOUT_MINS 2 +# opt_enable MPCTEMP MINIPANEL +# opt_disable PIDTEMP +# exec_test $1 $2 "MEGA2560 RAMPS | Redundant temperature sensor | 2x MAX6675 | BL Timeout" "$3" -# -# Polargraph Config -# -use_example_configs Polargraph -exec_test $1 $2 "RUMBA | POLARGRAPH | RRD LCD" "$3" +# # +# # Polargraph Config +# # +# use_example_configs Polargraph +# exec_test $1 $2 "RUMBA | POLARGRAPH | RRD LCD" "$3" # # Language files test with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER @@ -239,8 +239,8 @@ exec_test $1 $2 "RUMBA | POLARGRAPH | RRD LCD" "$3" # # Test a basic DUAL_X_CARRIAGE configuration # -use_example_configs Formbot/T_Rex_3 -exec_test $1 $2 "Formbot/T_Rex_3 example configuration." "$3" +# use_example_configs Formbot/T_Rex_3 +# exec_test $1 $2 "Formbot/T_Rex_3 example configuration." "$3" # # BQ Hephestos 2 @@ -260,5 +260,20 @@ exec_test $1 $2 "Formbot/T_Rex_3 example configuration." "$3" #use_example_configs tvrrug/Round2 #exec_test $1 $2 "Stuff" "$3" +# +# Test progress display rotation +# +restore_configs +opt_set MOTHERBOARD BOARD_RAMPS_14_EFB +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ + SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT SET_REMAINING_TIME SET_INTERACTION_TIME M73_REPORT \ + SHOW_PROGRESS_PERCENT SHOW_ELAPSED_TIME SHOW_REMAINING_TIME SHOW_INTERACTION_TIME PRINT_PROGRESS_SHOW_DECIMALS +exec_test $1 $2 "MEGA2560 RAMPS | 12864 | progress rotation" "$3" +opt_enable LIGHTWEIGHT_UI +exec_test $1 $2 "MEGA2560 RAMPS | 12864 LIGHTWEIGHT_UI | progress rotation" "$3" +opt_disable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER +exec_test $1 $2 "MEGA2560 RAMPS | 44780 | progress rotation" "$3" + # clean up restore_configs diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index b5d6491d2870..de6cdc71297b 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -34,7 +34,7 @@ opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_P FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ PSU_CONTROL PS_OFF_CONFIRM PS_OFF_SOUND POWER_OFF_WAIT_FOR_COOLDOWN \ POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE POWER_LOSS_RECOVER_ZHOME POWER_LOSS_ZHOME_POS \ - SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE EXTRA_LIN_ADVANCE_K \ + SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE ADVANCE_K_EXTRA \ HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL opt_add DEBUG_POWER_LOSS_RECOVERY exec_test $1 $2 "RAMBO | EXTRUDERS 2 | CHAR LCD + SD | FIX Probe | ABL-Linear | Advanced Pause | PLR | LEDs ..." "$3" @@ -93,7 +93,7 @@ opt_set MOTHERBOARD BOARD_MINIRAMBO \ opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ SDSUPPORT PCA9632 SOUND_MENU_ITEM GCODE_REPEAT_MARKERS \ AUTO_BED_LEVELING_LINEAR PROBE_MANUALLY LCD_BED_LEVELING \ - LIN_ADVANCE EXTRA_LIN_ADVANCE_K \ + LIN_ADVANCE ADVANCE_K_EXTRA \ INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT EXPERIMENTAL_I2CBUS M100_FREE_MEMORY_WATCHER \ NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE \ ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES \ diff --git a/ini/features.ini b/ini/features.ini index d3d863ccd406..7e4a3f97be6d 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -201,7 +201,7 @@ AUTO_REPORT_POSITION = src_filter=+ REPETIER_GCODE_M360 = src_filter=+ HAS_GCODE_M876 = src_filter=+ HAS_RESUME_CONTINUE = src_filter=+ -LCD_SET_PROGRESS_MANUALLY = src_filter=+ +SET_PROGRESS_MANUALLY = src_filter=+ HAS_STATUS_MESSAGE = src_filter=+ HAS_LCD_CONTRAST = src_filter=+ HAS_GCODE_M255 = src_filter=+ diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index b0d2a5600c3d..471e9e7fb496 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -47,7 +47,6 @@ board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_FLY_F407ZG board_build.offset = 0x8000 upload_protocol = dfu - # # FYSETC S6 (STM32F446RET6 ARM Cortex-M4) # @@ -684,3 +683,19 @@ build_flags = ${stm32_variant.build_flags} -DSTEP_TIMER_IRQ_PRIO=0 upload_protocol = stlink debug_tool = stlink + +# +# MKS SKIPR v1.0 all-in-one board (STM32F407VE) +# +[env:mks_skipr_v1] +extends = stm32_variant +board = marlin_MKS_SKIPR_V1 +board_build.rename = mks_skipr.bin + +[env:mks_skipr_v1_nobootloader] +extends = env:mks_skipr_v1 +board_build.rename = firmware.bin +board_build.offset = 0x0000 +board_upload.offset_address = 0x08000000 +upload_protocol = dfu +upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE"