Merge branch 'bugfix-2.0.x' into bugfix-2.0.x
This commit is contained in:
commit
bbac8a2f16
463 changed files with 5814 additions and 3557 deletions
2
.gitattributes
vendored
2
.gitattributes
vendored
|
|
@ -17,3 +17,5 @@
|
||||||
*.png binary
|
*.png binary
|
||||||
*.jpg binary
|
*.jpg binary
|
||||||
*.fon binary
|
*.fon binary
|
||||||
|
*.bin binary
|
||||||
|
*.woff binary
|
||||||
|
|
|
||||||
2
.github/workflows/test-builds.yml
vendored
2
.github/workflows/test-builds.yml
vendored
|
|
@ -36,6 +36,7 @@ jobs:
|
||||||
# Base Environments
|
# Base Environments
|
||||||
|
|
||||||
- DUE
|
- DUE
|
||||||
|
- DUE_archim
|
||||||
- esp32
|
- esp32
|
||||||
- linux_native
|
- linux_native
|
||||||
- mega2560
|
- mega2560
|
||||||
|
|
@ -82,6 +83,7 @@ jobs:
|
||||||
- STM32F103RET6_creality
|
- STM32F103RET6_creality
|
||||||
- LERDGEX
|
- LERDGEX
|
||||||
- mks_robin_nano35
|
- mks_robin_nano35
|
||||||
|
- mks_robin_nano35_stm32
|
||||||
- NUCLEO_F767ZI
|
- NUCLEO_F767ZI
|
||||||
|
|
||||||
# Put lengthy tests last
|
# Put lengthy tests last
|
||||||
|
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -183,3 +183,6 @@ cmake-build-*
|
||||||
|
|
||||||
#Python
|
#Python
|
||||||
__pycache__
|
__pycache__
|
||||||
|
|
||||||
|
#IOLogger logs
|
||||||
|
*_log.csv
|
||||||
|
|
|
||||||
|
|
@ -344,9 +344,10 @@
|
||||||
#define AUTO_POWER_E_FANS
|
#define AUTO_POWER_E_FANS
|
||||||
#define AUTO_POWER_CONTROLLERFAN
|
#define AUTO_POWER_CONTROLLERFAN
|
||||||
#define AUTO_POWER_CHAMBER_FAN
|
#define AUTO_POWER_CHAMBER_FAN
|
||||||
//#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature
|
//#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU if any extruder is over this temperature
|
||||||
//#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature
|
//#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU if the chamber is over this temperature
|
||||||
#define POWER_TIMEOUT 30
|
#define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration
|
||||||
|
//#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time.
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -435,11 +436,11 @@
|
||||||
#define DUMMY_THERMISTOR_998_VALUE 25
|
#define DUMMY_THERMISTOR_998_VALUE 25
|
||||||
#define DUMMY_THERMISTOR_999_VALUE 100
|
#define DUMMY_THERMISTOR_999_VALUE 100
|
||||||
|
|
||||||
// Resistor values when using a MAX31865 (sensor -5)
|
// Resistor values when using MAX31865 sensors (-5) on TEMP_SENSOR_0 / 1
|
||||||
// Sensor value is typically 100 (PT100) or 1000 (PT1000)
|
//#define MAX31865_SENSOR_OHMS_0 100 // (Ω) Typically 100 or 1000 (PT100 or PT1000)
|
||||||
// Calibration value is typically 430 ohm for AdaFruit PT100 modules and 4300 ohm for AdaFruit PT1000 modules.
|
//#define MAX31865_CALIBRATION_OHMS_0 430 // (Ω) Typically 430 for AdaFruit PT100; 4300 for AdaFruit PT1000
|
||||||
//#define MAX31865_SENSOR_OHMS 100
|
//#define MAX31865_SENSOR_OHMS_1 100
|
||||||
//#define MAX31865_CALIBRATION_OHMS 430
|
//#define MAX31865_CALIBRATION_OHMS_1 430
|
||||||
|
|
||||||
// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings
|
// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings
|
||||||
// from the two sensors differ too much the print will be aborted.
|
// from the two sensors differ too much the print will be aborted.
|
||||||
|
|
@ -674,6 +675,8 @@
|
||||||
*
|
*
|
||||||
* A4988 is assumed for unspecified drivers.
|
* A4988 is assumed for unspecified drivers.
|
||||||
*
|
*
|
||||||
|
* Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers.
|
||||||
|
*
|
||||||
* Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
|
* Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
|
||||||
* TB6560, TB6600, TMC2100,
|
* TB6560, TB6600, TMC2100,
|
||||||
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
|
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
|
||||||
|
|
@ -745,7 +748,7 @@
|
||||||
* Override with M92
|
* Override with M92
|
||||||
* X, Y, Z, E0 [, E1[, E2...]]
|
* X, Y, Z, E0 [, E1[, E2...]]
|
||||||
*/
|
*/
|
||||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 }
|
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Max Feed Rate (mm/s)
|
* Default Max Feed Rate (mm/s)
|
||||||
|
|
@ -1170,6 +1173,12 @@
|
||||||
* Filament Runout Sensors
|
* Filament Runout Sensors
|
||||||
* Mechanical or opto endstops are used to check for the presence of filament.
|
* Mechanical or opto endstops are used to check for the presence of filament.
|
||||||
*
|
*
|
||||||
|
* IMPORTANT: Runout will only trigger if Marlin is aware that a print job is running.
|
||||||
|
* Marlin knows a print job is running when:
|
||||||
|
* 1. Running a print job from media started with M24.
|
||||||
|
* 2. The Print Job Timer has been started with M75.
|
||||||
|
* 3. The heaters were turned on and PRINTJOB_TIMER_AUTOSTART is enabled.
|
||||||
|
*
|
||||||
* RAMPS-based boards use SERVO3_PIN for the first runout sensor.
|
* RAMPS-based boards use SERVO3_PIN for the first runout sensor.
|
||||||
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
|
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1177,9 +1186,27 @@
|
||||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||||
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
|
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
|
||||||
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
|
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
|
||||||
|
|
||||||
#define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
|
#define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
|
||||||
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
|
#define FIL_RUNOUT_PULL // Use internal pullup / pulldown for filament runout pins.
|
||||||
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
|
|
||||||
|
// Override individually if the runout sensors vary
|
||||||
|
//#define FIL_RUNOUT1_STATE LOW
|
||||||
|
//#define FIL_RUNOUT1_PULL
|
||||||
|
//#define FIL_RUNOUT2_STATE LOW
|
||||||
|
//#define FIL_RUNOUT2_PULL
|
||||||
|
//#define FIL_RUNOUT3_STATE LOW
|
||||||
|
//#define FIL_RUNOUT3_PULL
|
||||||
|
//#define FIL_RUNOUT4_STATE LOW
|
||||||
|
//#define FIL_RUNOUT4_PULL
|
||||||
|
//#define FIL_RUNOUT5_STATE LOW
|
||||||
|
//#define FIL_RUNOUT5_PULL
|
||||||
|
//#define FIL_RUNOUT6_STATE LOW
|
||||||
|
//#define FIL_RUNOUT6_PULL
|
||||||
|
//#define FIL_RUNOUT7_STATE LOW
|
||||||
|
//#define FIL_RUNOUT7_PULL
|
||||||
|
//#define FIL_RUNOUT8_STATE LOW
|
||||||
|
//#define FIL_RUNOUT8_PULL
|
||||||
|
|
||||||
// Set one or more commands to execute on filament runout.
|
// Set one or more commands to execute on filament runout.
|
||||||
// (After 'M412 H' Marlin will ask the host to handle the process.)
|
// (After 'M412 H' Marlin will ask the host to handle the process.)
|
||||||
|
|
@ -2087,9 +2114,10 @@
|
||||||
//
|
//
|
||||||
// Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
|
// Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
|
||||||
// A clone of the RepRapDiscount full graphics display but with
|
// A clone of the RepRapDiscount full graphics display but with
|
||||||
// different pins/wiring (see pins_ANET_10.h).
|
// different pins/wiring (see pins_ANET_10.h). Enable one of these.
|
||||||
//
|
//
|
||||||
//#define ANET_FULL_GRAPHICS_LCD
|
//#define ANET_FULL_GRAPHICS_LCD
|
||||||
|
//#define ANET_FULL_GRAPHICS_LCD_ALT_WIRING
|
||||||
|
|
||||||
//
|
//
|
||||||
// AZSMZ 12864 LCD with SD
|
// AZSMZ 12864 LCD with SD
|
||||||
|
|
@ -2196,7 +2224,7 @@
|
||||||
|
|
||||||
//
|
//
|
||||||
// Third-party or vendor-customized controller interfaces.
|
// Third-party or vendor-customized controller interfaces.
|
||||||
// Sources should be installed in 'src/lcd/extensible_ui'.
|
// Sources should be installed in 'src/lcd/extui'.
|
||||||
//
|
//
|
||||||
//#define EXTENSIBLE_UI
|
//#define EXTENSIBLE_UI
|
||||||
|
|
||||||
|
|
@ -2334,6 +2362,10 @@
|
||||||
//#define XPT2046_Y_CALIBRATION -8981
|
//#define XPT2046_Y_CALIBRATION -8981
|
||||||
//#define XPT2046_X_OFFSET -43
|
//#define XPT2046_X_OFFSET -43
|
||||||
//#define XPT2046_Y_OFFSET 257
|
//#define XPT2046_Y_OFFSET 257
|
||||||
|
|
||||||
|
#if ENABLED(TFT_COLOR_UI)
|
||||||
|
//#define SINGLE_TOUCH_NAVIGATION
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -660,6 +660,7 @@
|
||||||
|
|
||||||
//#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_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
|
//#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first
|
||||||
|
|
||||||
// @section bltouch
|
// @section bltouch
|
||||||
|
|
@ -808,7 +809,10 @@
|
||||||
|
|
||||||
#define RESTORE_LEVELING_AFTER_G35 // Enable to restore leveling setup after operation
|
#define RESTORE_LEVELING_AFTER_G35 // Enable to restore leveling setup after operation
|
||||||
//#define REPORT_TRAMMING_MM // Report Z deviation (mm) for each point relative to the first
|
//#define REPORT_TRAMMING_MM // Report Z deviation (mm) for each point relative to the first
|
||||||
//#define ASSISTED_TRAMMING_MENU_ITEM // Add a menu item for Assisted Tramming
|
|
||||||
|
//#define ASSISTED_TRAMMING_MENU_ITEM // Add a menu item to run G35 Assisted Tramming (MarlinUI)
|
||||||
|
//#define ASSISTED_TRAMMING_WIZARD // Make the menu item open a Tramming Wizard sub-menu
|
||||||
|
//#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Screw thread:
|
* Screw thread:
|
||||||
|
|
@ -1090,6 +1094,9 @@
|
||||||
// BACK menu items keep the highlight at the top
|
// BACK menu items keep the highlight at the top
|
||||||
//#define TURBO_BACK_MENU_ITEM
|
//#define TURBO_BACK_MENU_ITEM
|
||||||
|
|
||||||
|
// Add a mute option to the LCD menu
|
||||||
|
//#define SOUND_MENU_ITEM
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LED Control Menu
|
* LED Control Menu
|
||||||
* Add LED Control to the LCD menu
|
* Add LED Control to the LCD menu
|
||||||
|
|
@ -1166,6 +1173,7 @@
|
||||||
// Enable this option and set to HIGH if your SD cards are incorrectly detected.
|
// Enable this option and set to HIGH if your SD cards are incorrectly detected.
|
||||||
//#define SD_DETECT_STATE HIGH
|
//#define SD_DETECT_STATE HIGH
|
||||||
|
|
||||||
|
//#define SD_IGNORE_AT_STARTUP // Don't mount the SD card when starting up
|
||||||
//#define SDCARD_READONLY // Read-only SD card (to save over 2K of flash)
|
//#define SDCARD_READONLY // Read-only SD card (to save over 2K of flash)
|
||||||
|
|
||||||
#define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls
|
#define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls
|
||||||
|
|
@ -1250,6 +1258,10 @@
|
||||||
// Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
|
// Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Allow international symbols in long filenames. To display correctly, the
|
||||||
|
// LCD's font must contain the characters. Check your selected LCD language.
|
||||||
|
#define UTF_FILENAME_SUPPORT
|
||||||
|
|
||||||
// This allows hosts to request long names for files and folders with M33
|
// This allows hosts to request long names for files and folders with M33
|
||||||
//#define LONG_FILENAME_HOST_SUPPORT
|
//#define LONG_FILENAME_HOST_SUPPORT
|
||||||
|
|
||||||
|
|
@ -2940,11 +2952,18 @@
|
||||||
|
|
||||||
#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC)
|
#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC)
|
||||||
|
|
||||||
|
//#define SPINDLE_SERVO // A servo converting an angle to spindle power
|
||||||
|
#ifdef SPINDLE_SERVO
|
||||||
|
#define SPINDLE_SERVO_NR 0 // Index of servo used for spindle control
|
||||||
|
#define SPINDLE_SERVO_MIN 10 // Minimum angle for servo spindle
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Speed / Power can be set ('M3 S') and displayed in terms of:
|
* Speed / Power can be set ('M3 S') and displayed in terms of:
|
||||||
* - PWM255 (S0 - S255)
|
* - PWM255 (S0 - S255)
|
||||||
* - PERCENT (S0 - S100)
|
* - PERCENT (S0 - S100)
|
||||||
* - RPM (S0 - S50000) Best for use with a spindle
|
* - RPM (S0 - S50000) Best for use with a spindle
|
||||||
|
* - SERVO (S0 - S180)
|
||||||
*/
|
*/
|
||||||
#define CUTTER_POWER_UNIT PWM255
|
#define CUTTER_POWER_UNIT PWM255
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,9 @@
|
||||||
#define SET_INPUT(IO) _SET_INPUT(IO)
|
#define SET_INPUT(IO) _SET_INPUT(IO)
|
||||||
// Set pin as input with pullup (wrapper)
|
// Set pin as input with pullup (wrapper)
|
||||||
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0)
|
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0)
|
||||||
|
// Set pin as input with pulldown (substitution)
|
||||||
|
#define SET_INPUT_PULLDOWN SET_INPUT
|
||||||
|
|
||||||
// Set pin as output (wrapper) - reads the pin and sets the output to that value
|
// Set pin as output (wrapper) - reads the pin and sets the output to that value
|
||||||
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
|
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
|
||||||
// Set pin as PWM
|
// Set pin as PWM
|
||||||
|
|
@ -477,7 +480,7 @@
|
||||||
#define DIO91_PIN 15
|
#define DIO91_PIN 15
|
||||||
#define DIO91_WPORT PIOB
|
#define DIO91_WPORT PIOB
|
||||||
|
|
||||||
#if ARDUINO_SAM_ARCHIM
|
#ifdef ARDUINO_SAM_ARCHIM
|
||||||
|
|
||||||
#define DIO92_PIN 11
|
#define DIO92_PIN 11
|
||||||
#define DIO92_WPORT PIOC
|
#define DIO92_WPORT PIOC
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ void watchdogSetup() {
|
||||||
#if ENABLED(USE_WATCHDOG)
|
#if ENABLED(USE_WATCHDOG)
|
||||||
|
|
||||||
// 4 seconds timeout
|
// 4 seconds timeout
|
||||||
uint32_t timeout = 4000;
|
uint32_t timeout = TERN(WATCHDOG_DURATION_8S, 8000, 4000);
|
||||||
|
|
||||||
// Calculate timeout value in WDT counter ticks: This assumes
|
// Calculate timeout value in WDT counter ticks: This assumes
|
||||||
// the slow clock is running at 32.768 kHz watchdog
|
// the slow clock is running at 32.768 kHz watchdog
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,9 @@
|
||||||
// Set pin as input with pullup wrapper
|
// Set pin as input with pullup wrapper
|
||||||
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0)
|
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0)
|
||||||
|
|
||||||
|
// Set pin as input with pulldown (substitution)
|
||||||
|
#define SET_INPUT_PULLDOWN SET_INPUT
|
||||||
|
|
||||||
// Set pin as output wrapper
|
// Set pin as output wrapper
|
||||||
#define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); }while(0)
|
#define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); }while(0)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
#if ENABLED(USE_WATCHDOG)
|
#if ENABLED(USE_WATCHDOG)
|
||||||
|
|
||||||
|
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
void watchdogSetup() {
|
void watchdogSetup() {
|
||||||
|
|
|
||||||
|
|
@ -19,22 +19,23 @@
|
||||||
*/
|
*/
|
||||||
#ifdef __PLAT_LINUX__
|
#ifdef __PLAT_LINUX__
|
||||||
|
|
||||||
extern void setup();
|
//#define GPIO_LOGGING // Full GPIO and Positional Logging
|
||||||
extern void loop();
|
|
||||||
|
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include "../shared/Delay.h"
|
#include "../shared/Delay.h"
|
||||||
#include "hardware/IOLoggerCSV.h"
|
#include "hardware/IOLoggerCSV.h"
|
||||||
#include "hardware/Heater.h"
|
#include "hardware/Heater.h"
|
||||||
#include "hardware/LinearAxis.h"
|
#include "hardware/LinearAxis.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <thread>
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
extern void setup();
|
||||||
|
extern void loop();
|
||||||
|
|
||||||
// simple stdout / stdin implementation for fake serial port
|
// simple stdout / stdin implementation for fake serial port
|
||||||
void write_serial_thread() {
|
void write_serial_thread() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
@ -64,8 +65,6 @@ void simulation_loop() {
|
||||||
LinearAxis z_axis(Z_ENABLE_PIN, Z_DIR_PIN, Z_STEP_PIN, Z_MIN_PIN, Z_MAX_PIN);
|
LinearAxis z_axis(Z_ENABLE_PIN, Z_DIR_PIN, Z_STEP_PIN, Z_MIN_PIN, Z_MAX_PIN);
|
||||||
LinearAxis extruder0(E0_ENABLE_PIN, E0_DIR_PIN, E0_STEP_PIN, P_NC, P_NC);
|
LinearAxis extruder0(E0_ENABLE_PIN, E0_DIR_PIN, E0_STEP_PIN, P_NC, P_NC);
|
||||||
|
|
||||||
//#define GPIO_LOGGING // Full GPIO and Positional Logging
|
|
||||||
|
|
||||||
#ifdef GPIO_LOGGING
|
#ifdef GPIO_LOGGING
|
||||||
IOLoggerCSV logger("all_gpio_log.csv");
|
IOLoggerCSV logger("all_gpio_log.csv");
|
||||||
Gpio::attachLogger(&logger);
|
Gpio::attachLogger(&logger);
|
||||||
|
|
@ -88,7 +87,7 @@ void simulation_loop() {
|
||||||
|
|
||||||
#ifdef GPIO_LOGGING
|
#ifdef GPIO_LOGGING
|
||||||
if (x_axis.position != x || y_axis.position != y || z_axis.position != z) {
|
if (x_axis.position != x || y_axis.position != y || z_axis.position != z) {
|
||||||
uint64_t update = MAX3(x_axis.last_update, y_axis.last_update, z_axis.last_update);
|
uint64_t update = _MAX(x_axis.last_update, y_axis.last_update, z_axis.last_update);
|
||||||
position_log << update << ", " << x_axis.position << ", " << y_axis.position << ", " << z_axis.position << std::endl;
|
position_log << update << ", " << x_axis.position << ", " << y_axis.position << ", " << z_axis.position << std::endl;
|
||||||
position_log.flush();
|
position_log.flush();
|
||||||
x = x_axis.position;
|
x = x_axis.position;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
|
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
|
||||||
#define pwm_details(pin) pin = pin // do nothing // print PWM details
|
#define pwm_details(pin) NOOP // (do nothing)
|
||||||
#define pwm_status(pin) false // Print a pin's PWM status. Return true if it's currently a PWM pin.
|
#define pwm_status(pin) false // Print a pin's PWM status. Return true if it's currently a PWM pin.
|
||||||
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
|
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
|
||||||
#define digitalRead_mod(p) digitalRead(p)
|
#define digitalRead_mod(p) digitalRead(p)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
|
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||||
|
|
||||||
void watchdog_init() {}
|
void watchdog_init() {}
|
||||||
void HAL_watchdog_refresh() {}
|
void HAL_watchdog_refresh() {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,5 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define WDT_TIMEOUT 4000000 // 4 second timeout
|
|
||||||
|
|
||||||
void watchdog_init();
|
void watchdog_init();
|
||||||
void HAL_watchdog_refresh();
|
void HAL_watchdog_refresh();
|
||||||
|
|
|
||||||
|
|
@ -127,11 +127,9 @@
|
||||||
for (uint16_t i = 0; i < nbyte; i++) doio(buf[i]);
|
for (uint16_t i = 0; i < nbyte; i++) doio(buf[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void spiSend(uint32_t chan, byte b) {
|
void spiSend(uint32_t chan, byte b) {}
|
||||||
}
|
|
||||||
|
|
||||||
void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) {
|
void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) {}
|
||||||
}
|
|
||||||
|
|
||||||
// Read single byte from SPI
|
// Read single byte from SPI
|
||||||
uint8_t spiRec() { return doio(0xFF); }
|
uint8_t spiRec() { return doio(0xFF); }
|
||||||
|
|
@ -143,9 +141,7 @@
|
||||||
for (uint16_t i = 0; i < nbyte; i++) buf[i] = doio(0xFF);
|
for (uint16_t i = 0; i < nbyte; i++) buf[i] = doio(0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t spiTransfer(uint8_t b) {
|
uint8_t spiTransfer(uint8_t b) { return doio(b); }
|
||||||
return doio(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write from buffer to SPI
|
// Write from buffer to SPI
|
||||||
void spiSendBlock(uint8_t token, const uint8_t* buf) {
|
void spiSendBlock(uint8_t token, const uint8_t* buf) {
|
||||||
|
|
@ -201,6 +197,15 @@ SPIClass::SPIClass(uint8_t device) {
|
||||||
GPDMA_Init();
|
GPDMA_Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SPIClass::SPIClass(pin_t mosi, pin_t miso, pin_t sclk, pin_t ssel) {
|
||||||
|
#if BOARD_NR_SPI >= 1
|
||||||
|
if (mosi == BOARD_SPI1_MOSI_PIN) SPIClass(1);
|
||||||
|
#endif
|
||||||
|
#if BOARD_NR_SPI >= 2
|
||||||
|
if (mosi == BOARD_SPI2_MOSI_PIN) SPIClass(2);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void SPIClass::begin() {
|
void SPIClass::begin() {
|
||||||
// Init the SPI pins in the first begin call
|
// Init the SPI pins in the first begin call
|
||||||
if ((_currentSetting->spi_d == LPC_SSP0 && spiInitialised[0] == false) ||
|
if ((_currentSetting->spi_d == LPC_SSP0 && spiInitialised[0] == false) ||
|
||||||
|
|
@ -263,8 +268,9 @@ uint16_t SPIClass::transfer16(const uint16_t data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SPIClass::end() {
|
void SPIClass::end() {
|
||||||
// SSP_Cmd(_currentSetting->spi_d, DISABLE); // stop device or SSP_DeInit?
|
// Neither is needed for Marlin
|
||||||
SSP_DeInit(_currentSetting->spi_d);
|
//SSP_Cmd(_currentSetting->spi_d, DISABLE);
|
||||||
|
//SSP_DeInit(_currentSetting->spi_d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SPIClass::send(uint8_t data) {
|
void SPIClass::send(uint8_t data) {
|
||||||
|
|
@ -330,25 +336,15 @@ void SPIClass::read(uint8_t *buf, uint32_t len) {
|
||||||
for (uint16_t i = 0; i < len; i++) buf[i] = transfer(0xFF);
|
for (uint16_t i = 0; i < len; i++) buf[i] = transfer(0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SPIClass::setClock(uint32_t clock) {
|
void SPIClass::setClock(uint32_t clock) { _currentSetting->clock = clock; }
|
||||||
_currentSetting->clock = clock;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SPIClass::setModule(uint8_t device) {
|
void SPIClass::setModule(uint8_t device) { _currentSetting = &_settings[device - 1]; } // SPI channels are called 1, 2, and 3 but the array is zero-indexed
|
||||||
_currentSetting = &_settings[device - 1];// SPI channels are called 1 2 and 3 but the array is zero indexed
|
|
||||||
}
|
|
||||||
|
|
||||||
void SPIClass::setBitOrder(uint8_t bitOrder) {
|
void SPIClass::setBitOrder(uint8_t bitOrder) { _currentSetting->bitOrder = bitOrder; }
|
||||||
_currentSetting->bitOrder = bitOrder;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SPIClass::setDataMode(uint8_t dataMode) {
|
void SPIClass::setDataMode(uint8_t dataMode) { _currentSetting->dataMode = dataMode; }
|
||||||
_currentSetting->dataMode = dataMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SPIClass::setDataSize(uint32_t ds) {
|
void SPIClass::setDataSize(uint32_t dataSize) { _currentSetting->dataSize = dataSize; }
|
||||||
_currentSetting->dataSize = ds;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up/tear down
|
* Set up/tear down
|
||||||
|
|
@ -356,8 +352,8 @@ void SPIClass::setDataSize(uint32_t ds) {
|
||||||
void SPIClass::updateSettings() {
|
void SPIClass::updateSettings() {
|
||||||
//SSP_DeInit(_currentSetting->spi_d); //todo: need force de init?!
|
//SSP_DeInit(_currentSetting->spi_d); //todo: need force de init?!
|
||||||
|
|
||||||
// divide PCLK by 2 for SSP0
|
// Divide PCLK by 2 for SSP0
|
||||||
CLKPWR_SetPCLKDiv(_currentSetting->spi_d == LPC_SSP0 ? CLKPWR_PCLKSEL_SSP0 : CLKPWR_PCLKSEL_SSP1, CLKPWR_PCLKSEL_CCLK_DIV_2);
|
//CLKPWR_SetPCLKDiv(_currentSetting->spi_d == LPC_SSP0 ? CLKPWR_PCLKSEL_SSP0 : CLKPWR_PCLKSEL_SSP1, CLKPWR_PCLKSEL_CCLK_DIV_2);
|
||||||
|
|
||||||
SSP_CFG_Type HW_SPI_init; // data structure to hold init values
|
SSP_CFG_Type HW_SPI_init; // data structure to hold init values
|
||||||
SSP_ConfigStructInit(&HW_SPI_init); // set values for SPI mode
|
SSP_ConfigStructInit(&HW_SPI_init); // set values for SPI mode
|
||||||
|
|
|
||||||
|
|
@ -21,22 +21,25 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if HOTENDS > 2 || E_STEPPERS > 2
|
#include <SPI.h>
|
||||||
#error "Dagoma3D F5 RAMPS supports only 2 hotends / E-steppers. Comment out this line to continue."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define BOARD_INFO_NAME "Dagoma3D F5 RAMPS"
|
/**
|
||||||
|
* Marlin currently requires 3 SPI classes:
|
||||||
|
*
|
||||||
|
* SPIClass:
|
||||||
|
* This class is normally provided by frameworks and has a semi-default interface.
|
||||||
|
* This is needed because some libraries reference it globally.
|
||||||
|
*
|
||||||
|
* SPISettings:
|
||||||
|
* Container for SPI configs for SPIClass. As above, libraries may reference it globally.
|
||||||
|
*
|
||||||
|
* These two classes are often provided by frameworks so we cannot extend them to add
|
||||||
|
* useful methods for Marlin.
|
||||||
|
*
|
||||||
|
* MarlinSPI:
|
||||||
|
* Provides the default SPIClass interface plus some Marlin goodies such as a simplified
|
||||||
|
* interface for SPI DMA transfer.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#define X_STOP_PIN 2
|
using MarlinSPI = SPIClass;
|
||||||
#define Y_STOP_PIN 3
|
|
||||||
#define Z_STOP_PIN 15
|
|
||||||
#define FIL_RUNOUT_PIN 39
|
|
||||||
|
|
||||||
#ifndef E0_AUTO_FAN_PIN
|
|
||||||
#define E0_AUTO_FAN_PIN 7
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// Import RAMPS 1.4 pins
|
|
||||||
//
|
|
||||||
#include "pins_RAMPS.h"
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
#define DATA_SIZE_8BIT SSP_DATABIT_8
|
#define DATA_SIZE_8BIT SSP_DATABIT_8
|
||||||
#define DATA_SIZE_16BIT SSP_DATABIT_16
|
#define DATA_SIZE_16BIT SSP_DATABIT_16
|
||||||
|
|
||||||
|
#define SPI_CLOCK_MAX_TFT 30000000UL
|
||||||
#define SPI_CLOCK_DIV2 8333333 //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED
|
#define SPI_CLOCK_DIV2 8333333 //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED
|
||||||
#define SPI_CLOCK_DIV4 4166667 //(SCR: 5) desired: 4,000,000 actual: 4,166,667 +4.2% SPI_HALF_SPEED
|
#define SPI_CLOCK_DIV4 4166667 //(SCR: 5) desired: 4,000,000 actual: 4,166,667 +4.2% SPI_HALF_SPEED
|
||||||
#define SPI_CLOCK_DIV8 2083333 //(SCR: 11) desired: 2,000,000 actual: 2,083,333 +4.2% SPI_QUARTER_SPEED
|
#define SPI_CLOCK_DIV8 2083333 //(SCR: 11) desired: 2,000,000 actual: 2,083,333 +4.2% SPI_QUARTER_SPEED
|
||||||
|
|
@ -125,6 +126,11 @@ public:
|
||||||
*/
|
*/
|
||||||
SPIClass(uint8_t spiPortNumber);
|
SPIClass(uint8_t spiPortNumber);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init using pins
|
||||||
|
*/
|
||||||
|
SPIClass(pin_t mosi, pin_t miso, pin_t sclk, pin_t ssel = (pin_t)-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select and configure the current selected SPI device to use
|
* Select and configure the current selected SPI device to use
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ void TFT_SPI::Init() {
|
||||||
#elif TFT_MISO_PIN == BOARD_SPI2_MISO_PIN
|
#elif TFT_MISO_PIN == BOARD_SPI2_MISO_PIN
|
||||||
SPIx.setModule(2);
|
SPIx.setModule(2);
|
||||||
#endif
|
#endif
|
||||||
SPIx.setClock(SPI_CLOCK_MAX);
|
SPIx.setClock(SPI_CLOCK_MAX_TFT);
|
||||||
SPIx.setBitOrder(MSBFIRST);
|
SPIx.setBitOrder(MSBFIRST);
|
||||||
SPIx.setDataMode(SPI_MODE0);
|
SPIx.setDataMode(SPI_MODE0);
|
||||||
}
|
}
|
||||||
|
|
@ -125,7 +125,7 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DataTransferEnd();
|
DataTransferEnd();
|
||||||
SPIx.setClock(SPI_CLOCK_MAX);
|
SPIx.setClock(SPI_CLOCK_MAX_TFT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return data >> 7;
|
return data >> 7;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
#include <lpc17xx_wdt.h>
|
#include <lpc17xx_wdt.h>
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
|
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||||
|
|
||||||
void watchdog_init() {
|
void watchdog_init() {
|
||||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||||
// We enable the watchdog timer, but only for the interrupt.
|
// We enable the watchdog timer, but only for the interrupt.
|
||||||
|
|
@ -52,7 +54,7 @@ void watchdog_init() {
|
||||||
#else
|
#else
|
||||||
WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET);
|
WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET);
|
||||||
#endif
|
#endif
|
||||||
WDT_Start(WDT_TIMEOUT);
|
WDT_Start(WDT_TIMEOUT_US);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HAL_watchdog_refresh() {
|
void HAL_watchdog_refresh() {
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,6 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define WDT_TIMEOUT 4000000 // 4 second timeout
|
|
||||||
|
|
||||||
void watchdog_init();
|
void watchdog_init();
|
||||||
void HAL_watchdog_refresh();
|
void HAL_watchdog_refresh();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
|
#define WDT_TIMEOUT_REG TERN(WATCHDOG_DURATION_8S, WDT_CONFIG_PER_CYC8192, WDT_CONFIG_PER_CYC4096) // 4 or 8 second timeout
|
||||||
|
|
||||||
void watchdog_init() {
|
void watchdog_init() {
|
||||||
// The low-power oscillator used by the WDT runs at 32,768 Hz with
|
// The low-power oscillator used by the WDT runs at 32,768 Hz with
|
||||||
// a 1:32 prescale, thus 1024 Hz, though probably not super precise.
|
// a 1:32 prescale, thus 1024 Hz, though probably not super precise.
|
||||||
|
|
@ -39,7 +41,7 @@
|
||||||
SYNC(WDT->SYNCBUSY.bit.ENABLE);
|
SYNC(WDT->SYNCBUSY.bit.ENABLE);
|
||||||
|
|
||||||
WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt
|
WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt
|
||||||
WDT->CONFIG.reg = WDT_CONFIG_PER_CYC4096; // Set at least 4s period for chip reset
|
WDT->CONFIG.reg = WDT_TIMEOUT_REG; // Set a 4s or 8s period for chip reset
|
||||||
|
|
||||||
HAL_watchdog_refresh();
|
HAL_watchdog_refresh();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,9 @@ void HAL_init() {
|
||||||
|
|
||||||
SetTimerInterruptPriorities();
|
SetTimerInterruptPriorities();
|
||||||
|
|
||||||
TERN_(EMERGENCY_PARSER, USB_Hook_init());
|
#if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC
|
||||||
|
USB_Hook_init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
|
void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
|
||||||
|
|
@ -128,8 +130,12 @@ uint16_t HAL_adc_get_result() { return HAL_adc_result; }
|
||||||
void flashFirmware(const int16_t) { NVIC_SystemReset(); }
|
void flashFirmware(const int16_t) { NVIC_SystemReset(); }
|
||||||
|
|
||||||
// Maple Compatibility
|
// Maple Compatibility
|
||||||
|
volatile uint32_t systick_uptime_millis = 0;
|
||||||
systickCallback_t systick_user_callback;
|
systickCallback_t systick_user_callback;
|
||||||
void systick_attach_callback(systickCallback_t cb) { systick_user_callback = cb; }
|
void systick_attach_callback(systickCallback_t cb) { systick_user_callback = cb; }
|
||||||
void HAL_SYSTICK_Callback() { if (systick_user_callback) systick_user_callback(); }
|
void HAL_SYSTICK_Callback() {
|
||||||
|
systick_uptime_millis++;
|
||||||
|
if (systick_user_callback) systick_user_callback();
|
||||||
|
}
|
||||||
|
|
||||||
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
||||||
|
|
|
||||||
|
|
@ -184,3 +184,21 @@ void flashFirmware(const int16_t);
|
||||||
typedef void (*systickCallback_t)(void);
|
typedef void (*systickCallback_t)(void);
|
||||||
void systick_attach_callback(systickCallback_t cb);
|
void systick_attach_callback(systickCallback_t cb);
|
||||||
void HAL_SYSTICK_Callback();
|
void HAL_SYSTICK_Callback();
|
||||||
|
extern volatile uint32_t systick_uptime_millis;
|
||||||
|
|
||||||
|
#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set_pwm_frequency
|
||||||
|
* Set the frequency of the timer corresponding to the provided pin
|
||||||
|
* All Timer PWM pins run at the same frequency
|
||||||
|
*/
|
||||||
|
void set_pwm_frequency(const pin_t pin, int f_desired);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set_pwm_duty
|
||||||
|
* Set the PWM duty cycle of the provided pin to the provided value
|
||||||
|
* Optionally allows inverting the duty cycle [default = false]
|
||||||
|
* Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255]
|
||||||
|
*/
|
||||||
|
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false);
|
||||||
|
|
|
||||||
165
Marlin/src/HAL/STM32/MarlinSPI.cpp
Normal file
165
Marlin/src/HAL/STM32/MarlinSPI.cpp
Normal file
|
|
@ -0,0 +1,165 @@
|
||||||
|
/**
|
||||||
|
* Marlin 3D Printer Firmware
|
||||||
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
|
||||||
|
|
||||||
|
#include "MarlinSPI.h"
|
||||||
|
|
||||||
|
static void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb, uint32_t dataSize) {
|
||||||
|
spi_init(obj, speed, mode, msb);
|
||||||
|
// spi_init set 8bit always
|
||||||
|
// TODO: copy the code from spi_init and handle data size, to avoid double init always!!
|
||||||
|
if (dataSize != SPI_DATASIZE_8BIT) {
|
||||||
|
obj->handle.Init.DataSize = dataSize;
|
||||||
|
HAL_SPI_Init(&obj->handle);
|
||||||
|
__HAL_SPI_ENABLE(&obj->handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MarlinSPI::setClockDivider(uint8_t _div) {
|
||||||
|
_speed = spi_getClkFreq(&_spi);// / _div;
|
||||||
|
_clockDivider = _div;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MarlinSPI::begin(void) {
|
||||||
|
//TODO: only call spi_init if any parameter changed!!
|
||||||
|
spi_init(&_spi, _speed, _dataMode, _bitOrder, _dataSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MarlinSPI::setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaHandle, uint32_t direction, bool minc) {
|
||||||
|
_dmaHandle.Init.Direction = direction;
|
||||||
|
_dmaHandle.Init.PeriphInc = DMA_PINC_DISABLE;
|
||||||
|
_dmaHandle.Init.Mode = DMA_NORMAL;
|
||||||
|
_dmaHandle.Init.Priority = DMA_PRIORITY_LOW;
|
||||||
|
_dmaHandle.Init.MemInc = minc ? DMA_MINC_ENABLE : DMA_MINC_DISABLE;
|
||||||
|
|
||||||
|
if (_dataSize == DATA_SIZE_8BIT) {
|
||||||
|
_dmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
|
||||||
|
_dmaHandle.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_dmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
|
||||||
|
_dmaHandle.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
|
||||||
|
}
|
||||||
|
#ifdef STM32F4xx
|
||||||
|
_dmaHandle.Init.Channel = DMA_CHANNEL_3;
|
||||||
|
_dmaHandle.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// start DMA hardware
|
||||||
|
// TODO: check if hardware is already enabled
|
||||||
|
#ifdef SPI1_BASE
|
||||||
|
if (_spiHandle.Instance == SPI1) {
|
||||||
|
#ifdef STM32F1xx
|
||||||
|
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||||
|
_dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Channel3 : DMA1_Channel2;
|
||||||
|
#elif defined(STM32F4xx)
|
||||||
|
__HAL_RCC_DMA2_CLK_ENABLE();
|
||||||
|
_dmaHandle.Instance = DMA2_Stream3;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef SPI2_BASE
|
||||||
|
if (_spiHandle.Instance == SPI2) {
|
||||||
|
#ifdef STM32F1xx
|
||||||
|
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||||
|
_dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Channel5 : DMA1_Channel4;
|
||||||
|
#elif defined(STM32F4xx)
|
||||||
|
//TODO: f4 dma config
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef SPI3_BASE
|
||||||
|
if (_spiHandle.Instance == SPI3) {
|
||||||
|
#ifdef STM32F1xx
|
||||||
|
__HAL_RCC_DMA2_CLK_ENABLE();
|
||||||
|
_dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA2_Channel2 : DMA2_Channel1;
|
||||||
|
#elif defined(STM32F4xx)
|
||||||
|
//TODO: f4 dma config
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
HAL_DMA_Init(&_dmaHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
byte MarlinSPI::transfer(uint8_t _data) {
|
||||||
|
uint8_t rxData = 0xFF;
|
||||||
|
HAL_SPI_TransmitReceive(&_spi.handle, &_data, &rxData, 1, HAL_MAX_DELAY);
|
||||||
|
return rxData;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t MarlinSPI::dmaTransfer(const void *transmitBuf, void *receiveBuf, uint16_t length) {
|
||||||
|
const uint8_t ff = 0xFF;
|
||||||
|
|
||||||
|
//if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) //only enable if disabled
|
||||||
|
__HAL_SPI_ENABLE(&_spi.handle);
|
||||||
|
|
||||||
|
if (receiveBuf) {
|
||||||
|
setupDma(_spi.handle, _dmaRx, DMA_PERIPH_TO_MEMORY, true);
|
||||||
|
HAL_DMA_Start(&_dmaRx, (uint32_t)&(_spi.handle.Instance->DR), (uint32_t)receiveBuf, length);
|
||||||
|
SET_BIT(_spi.handle.Instance->CR2, SPI_CR2_RXDMAEN); /* Enable Rx DMA Request */
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for 2 lines transfer
|
||||||
|
bool mincTransmit = true;
|
||||||
|
if (transmitBuf == nullptr && _spi.handle.Init.Direction == SPI_DIRECTION_2LINES && _spi.handle.Init.Mode == SPI_MODE_MASTER) {
|
||||||
|
transmitBuf = &ff;
|
||||||
|
mincTransmit = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transmitBuf) {
|
||||||
|
setupDma(_spi.handle, _dmaTx, DMA_MEMORY_TO_PERIPH, mincTransmit);
|
||||||
|
HAL_DMA_Start(&_dmaTx, (uint32_t)transmitBuf, (uint32_t)&(_spi.handle.Instance->DR), length);
|
||||||
|
SET_BIT(_spi.handle.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transmitBuf) {
|
||||||
|
HAL_DMA_PollForTransfer(&_dmaTx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY);
|
||||||
|
HAL_DMA_Abort(&_dmaTx);
|
||||||
|
HAL_DMA_DeInit(&_dmaTx);
|
||||||
|
}
|
||||||
|
|
||||||
|
// while ((_spi.handle.Instance->SR & SPI_FLAG_RXNE) != SPI_FLAG_RXNE) {}
|
||||||
|
|
||||||
|
if (receiveBuf) {
|
||||||
|
HAL_DMA_PollForTransfer(&_dmaRx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY);
|
||||||
|
HAL_DMA_Abort(&_dmaRx);
|
||||||
|
HAL_DMA_DeInit(&_dmaRx);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t MarlinSPI::dmaSend(const void * transmitBuf, uint16_t length, bool minc) {
|
||||||
|
setupDma(_spi.handle, _dmaTx, DMA_MEMORY_TO_PERIPH, minc);
|
||||||
|
HAL_DMA_Start(&_dmaTx, (uint32_t)transmitBuf, (uint32_t)&(_spi.handle.Instance->DR), length);
|
||||||
|
__HAL_SPI_ENABLE(&_spi.handle);
|
||||||
|
SET_BIT(_spi.handle.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */
|
||||||
|
HAL_DMA_PollForTransfer(&_dmaTx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY);
|
||||||
|
HAL_DMA_Abort(&_dmaTx);
|
||||||
|
// DeInit objects
|
||||||
|
HAL_DMA_DeInit(&_dmaTx);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
||||||
107
Marlin/src/HAL/STM32/MarlinSPI.h
Normal file
107
Marlin/src/HAL/STM32/MarlinSPI.h
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
/**
|
||||||
|
* Marlin 3D Printer Firmware
|
||||||
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "HAL.h"
|
||||||
|
#include <SPI.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include <utility/spi_com.h>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marlin currently requires 3 SPI classes:
|
||||||
|
*
|
||||||
|
* SPIClass:
|
||||||
|
* This class is normally provided by frameworks and has a semi-default interface.
|
||||||
|
* This is needed because some libraries reference it globally.
|
||||||
|
*
|
||||||
|
* SPISettings:
|
||||||
|
* Container for SPI configs for SPIClass. As above, libraries may reference it globally.
|
||||||
|
*
|
||||||
|
* These two classes are often provided by frameworks so we cannot extend them to add
|
||||||
|
* useful methods for Marlin.
|
||||||
|
*
|
||||||
|
* MarlinSPI:
|
||||||
|
* Provides the default SPIClass interface plus some Marlin goodies such as a simplified
|
||||||
|
* interface for SPI DMA transfer.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DATA_SIZE_8BIT SPI_DATASIZE_8BIT
|
||||||
|
#define DATA_SIZE_16BIT SPI_DATASIZE_16BIT
|
||||||
|
|
||||||
|
class MarlinSPI {
|
||||||
|
public:
|
||||||
|
MarlinSPI() : MarlinSPI(NC, NC, NC, NC) {}
|
||||||
|
|
||||||
|
MarlinSPI(pin_t mosi, pin_t miso, pin_t sclk, pin_t ssel = (pin_t)NC) : _mosiPin(mosi), _misoPin(miso), _sckPin(sclk), _ssPin(ssel) {
|
||||||
|
_spi.pin_miso = digitalPinToPinName(_misoPin);
|
||||||
|
_spi.pin_mosi = digitalPinToPinName(_mosiPin);
|
||||||
|
_spi.pin_sclk = digitalPinToPinName(_sckPin);
|
||||||
|
_spi.pin_ssel = digitalPinToPinName(_ssPin);
|
||||||
|
_dataSize = DATA_SIZE_8BIT;
|
||||||
|
_bitOrder = MSBFIRST;
|
||||||
|
_dataMode = SPI_MODE_0;
|
||||||
|
_spi.handle.State = HAL_SPI_STATE_RESET;
|
||||||
|
setClockDivider(SPI_SPEED_CLOCK_DIV2_MHZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
void begin(void);
|
||||||
|
void end(void) {}
|
||||||
|
|
||||||
|
byte transfer(uint8_t _data);
|
||||||
|
uint8_t dmaTransfer(const void *transmitBuf, void *receiveBuf, uint16_t length);
|
||||||
|
uint8_t dmaSend(const void * transmitBuf, uint16_t length, bool minc = true);
|
||||||
|
|
||||||
|
/* These methods are deprecated and kept for compatibility.
|
||||||
|
* Use SPISettings with SPI.beginTransaction() to configure SPI parameters.
|
||||||
|
*/
|
||||||
|
void setBitOrder(BitOrder _order) { _bitOrder = _order; }
|
||||||
|
|
||||||
|
void setDataMode(uint8_t _mode) {
|
||||||
|
switch (_mode) {
|
||||||
|
case SPI_MODE0: _dataMode = SPI_MODE_0; break;
|
||||||
|
case SPI_MODE1: _dataMode = SPI_MODE_1; break;
|
||||||
|
case SPI_MODE2: _dataMode = SPI_MODE_2; break;
|
||||||
|
case SPI_MODE3: _dataMode = SPI_MODE_3; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setClockDivider(uint8_t _div);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaHandle, uint32_t direction, bool minc = false);
|
||||||
|
|
||||||
|
spi_t _spi;
|
||||||
|
DMA_HandleTypeDef _dmaTx;
|
||||||
|
DMA_HandleTypeDef _dmaRx;
|
||||||
|
BitOrder _bitOrder;
|
||||||
|
spi_mode_e _dataMode;
|
||||||
|
uint8_t _clockDivider;
|
||||||
|
uint32_t _speed;
|
||||||
|
uint32_t _dataSize;
|
||||||
|
pin_t _mosiPin;
|
||||||
|
pin_t _misoPin;
|
||||||
|
pin_t _sckPin;
|
||||||
|
pin_t _ssPin;
|
||||||
|
};
|
||||||
|
|
@ -113,7 +113,7 @@ bool PersistentStore::access_start() {
|
||||||
// This must be the first time since power on that we have accessed the storage, or someone
|
// This must be the first time since power on that we have accessed the storage, or someone
|
||||||
// loaded and called write_data and never called access_finish.
|
// loaded and called write_data and never called access_finish.
|
||||||
// Lets go looking for the slot that holds our configuration.
|
// Lets go looking for the slot that holds our configuration.
|
||||||
if (eeprom_data_written) DEBUG_ECHOLN("Dangling EEPROM write_data");
|
if (eeprom_data_written) DEBUG_ECHOLNPGM("Dangling EEPROM write_data");
|
||||||
uint32_t address = FLASH_ADDRESS_START;
|
uint32_t address = FLASH_ADDRESS_START;
|
||||||
while (address <= FLASH_ADDRESS_END) {
|
while (address <= FLASH_ADDRESS_END) {
|
||||||
uint32_t address_value = (*(__IO uint32_t*)address);
|
uint32_t address_value = (*(__IO uint32_t*)address);
|
||||||
|
|
|
||||||
57
Marlin/src/HAL/STM32/fast_pwm.cpp
Normal file
57
Marlin/src/HAL/STM32/fast_pwm.cpp
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
/**
|
||||||
|
* Marlin 3D Printer Firmware
|
||||||
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
|
#if NEEDS_HARDWARE_PWM
|
||||||
|
|
||||||
|
#include "HAL.h"
|
||||||
|
#include "timers.h"
|
||||||
|
|
||||||
|
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||||
|
if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer
|
||||||
|
|
||||||
|
PinName pin_name = digitalPinToPinName(pin);
|
||||||
|
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance
|
||||||
|
|
||||||
|
LOOP_S_L_N(i, 0, NUM_HARDWARE_TIMERS) // Protect used timers
|
||||||
|
if (timer_instance[i] && timer_instance[i]->getHandle()->Instance == Instance)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pwm_start(pin_name, f_desired, 0, RESOLUTION_8B_COMPARE_FORMAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||||
|
PinName pin_name = digitalPinToPinName(pin);
|
||||||
|
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM);
|
||||||
|
uint16_t adj_val = Instance->ARR * v / v_size;
|
||||||
|
if (invert) adj_val = Instance->ARR - adj_val;
|
||||||
|
|
||||||
|
switch (get_pwm_channel(pin_name)) {
|
||||||
|
case TIM_CHANNEL_1: LL_TIM_OC_SetCompareCH1(Instance, adj_val); break;
|
||||||
|
case TIM_CHANNEL_2: LL_TIM_OC_SetCompareCH2(Instance, adj_val); break;
|
||||||
|
case TIM_CHANNEL_3: LL_TIM_OC_SetCompareCH3(Instance, adj_val); break;
|
||||||
|
case TIM_CHANNEL_4: LL_TIM_OC_SetCompareCH4(Instance, adj_val); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // NEEDS_HARDWARE_PWM
|
||||||
|
|
@ -28,9 +28,6 @@
|
||||||
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
|
|
||||||
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
|
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
|
||||||
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
|
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,16 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#ifdef STM32F1xx
|
#ifdef STM32F1xx
|
||||||
#include "stm32f1xx_hal.h"
|
#include "stm32f1xx_hal.h"
|
||||||
|
#define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN)
|
||||||
#elif defined(STM32F4xx)
|
#elif defined(STM32F4xx)
|
||||||
#include "stm32f4xx_hal.h"
|
#include "stm32f4xx_hal.h"
|
||||||
|
#define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN)
|
||||||
#else
|
#else
|
||||||
#error FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware.
|
#error "FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LCD_READ_ID
|
#ifndef LCD_READ_ID
|
||||||
|
|
@ -40,12 +44,6 @@
|
||||||
#define DATASIZE_16BIT SPI_DATASIZE_16BIT
|
#define DATASIZE_16BIT SPI_DATASIZE_16BIT
|
||||||
#define TFT_IO_DRIVER TFT_FSMC
|
#define TFT_IO_DRIVER TFT_FSMC
|
||||||
|
|
||||||
#ifdef STM32F1xx
|
|
||||||
#define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN)
|
|
||||||
#elif defined(STM32F4xx)
|
|
||||||
#define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
__IO uint16_t REG;
|
__IO uint16_t REG;
|
||||||
__IO uint16_t RAM;
|
__IO uint16_t RAM;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
// Local defines
|
// Local defines
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
#define NUM_HARDWARE_TIMERS 2
|
|
||||||
|
|
||||||
// Default timer priorities. Override by specifying alternate priorities in the board pins file.
|
// Default timer priorities. Override by specifying alternate priorities in the board pins file.
|
||||||
// The TONE timer is not present here, as it currently cannot be set programmatically. It is set
|
// The TONE timer is not present here, as it currently cannot be set programmatically. It is set
|
||||||
|
|
@ -68,26 +67,23 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STM32F0xx
|
#ifdef STM32F0xx
|
||||||
#define MCU_TIMER_RATE (F_CPU) // Frequency of timer peripherals
|
|
||||||
#define MCU_STEP_TIMER 16
|
#define MCU_STEP_TIMER 16
|
||||||
#define MCU_TEMP_TIMER 17
|
#define MCU_TEMP_TIMER 17
|
||||||
#elif defined(STM32F1xx)
|
#elif defined(STM32F1xx)
|
||||||
#define MCU_TIMER_RATE (F_CPU)
|
|
||||||
#define MCU_STEP_TIMER 4
|
#define MCU_STEP_TIMER 4
|
||||||
#define MCU_TEMP_TIMER 2
|
#define MCU_TEMP_TIMER 2
|
||||||
#elif defined(STM32F401xC) || defined(STM32F401xE)
|
#elif defined(STM32F401xC) || defined(STM32F401xE)
|
||||||
#define MCU_TIMER_RATE (F_CPU / 2)
|
|
||||||
#define MCU_STEP_TIMER 9
|
#define MCU_STEP_TIMER 9
|
||||||
#define MCU_TEMP_TIMER 10
|
#define MCU_TEMP_TIMER 10
|
||||||
#elif defined(STM32F4xx) || defined(STM32F7xx)
|
#elif defined(STM32F4xx) || defined(STM32F7xx)
|
||||||
#define MCU_TIMER_RATE (F_CPU / 2)
|
|
||||||
#define MCU_STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8
|
#define MCU_STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8
|
||||||
#define MCU_TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used.
|
#define MCU_TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAL_TIMER_RATE
|
#ifndef HAL_TIMER_RATE
|
||||||
#define HAL_TIMER_RATE MCU_TIMER_RATE
|
#define HAL_TIMER_RATE GetStepperTimerClkFreq()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef STEP_TIMER
|
#ifndef STEP_TIMER
|
||||||
#define STEP_TIMER MCU_STEP_TIMER
|
#define STEP_TIMER MCU_STEP_TIMER
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -115,6 +111,13 @@ HardwareTimer *timer_instance[NUM_HARDWARE_TIMERS] = { nullptr };
|
||||||
// Public functions
|
// Public functions
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
|
uint32_t GetStepperTimerClkFreq() {
|
||||||
|
// Timer input clocks vary between devices, and in some cases between timers on the same device.
|
||||||
|
// Retrieve at runtime to ensure device compatibility. Cache result to avoid repeated overhead.
|
||||||
|
static uint32_t clkfreq = timer_instance[STEP_TIMER_NUM]->getTimerClkFreq();
|
||||||
|
return clkfreq;
|
||||||
|
}
|
||||||
|
|
||||||
// frequency is in Hertz
|
// frequency is in Hertz
|
||||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
||||||
if (!HAL_timer_initialized(timer_num)) {
|
if (!HAL_timer_initialized(timer_num)) {
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@
|
||||||
#define hal_timer_t uint32_t
|
#define hal_timer_t uint32_t
|
||||||
#define HAL_TIMER_TYPE_MAX UINT16_MAX
|
#define HAL_TIMER_TYPE_MAX UINT16_MAX
|
||||||
|
|
||||||
|
#define NUM_HARDWARE_TIMERS 2
|
||||||
|
|
||||||
#ifndef STEP_TIMER_NUM
|
#ifndef STEP_TIMER_NUM
|
||||||
#define STEP_TIMER_NUM 0 // Timer Index for Stepper
|
#define STEP_TIMER_NUM 0 // Timer Index for Stepper
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -57,7 +59,8 @@
|
||||||
|
|
||||||
// TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
|
// TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
|
||||||
#define STEPPER_TIMER_RATE 2000000 // 2 Mhz
|
#define STEPPER_TIMER_RATE 2000000 // 2 Mhz
|
||||||
#define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE))
|
extern uint32_t GetStepperTimerClkFreq();
|
||||||
|
#define STEPPER_TIMER_PRESCALE (GetStepperTimerClkFreq() / (STEPPER_TIMER_RATE))
|
||||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
|
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
|
||||||
|
|
||||||
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE
|
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE
|
||||||
|
|
@ -102,7 +105,7 @@ void SetTimerInterruptPriorities();
|
||||||
|
|
||||||
// FORCE_INLINE because these are used in performance-critical situations
|
// FORCE_INLINE because these are used in performance-critical situations
|
||||||
FORCE_INLINE bool HAL_timer_initialized(const uint8_t timer_num) {
|
FORCE_INLINE bool HAL_timer_initialized(const uint8_t timer_num) {
|
||||||
return timer_instance[timer_num] != NULL;
|
return timer_instance[timer_num] != nullptr;
|
||||||
}
|
}
|
||||||
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
||||||
return HAL_timer_initialized(timer_num) ? timer_instance[timer_num]->getCount() : 0;
|
return HAL_timer_initialized(timer_num) ? timer_instance[timer_num]->getCount() : 0;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if ENABLED(EMERGENCY_PARSER)
|
#if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC
|
||||||
|
|
||||||
#include "usb_serial.h"
|
#include "usb_serial.h"
|
||||||
#include "../../feature/e_parser.h"
|
#include "../../feature/e_parser.h"
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
#if ENABLED(USE_WATCHDOG)
|
#if ENABLED(USE_WATCHDOG)
|
||||||
|
|
||||||
|
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
@ -32,7 +34,7 @@
|
||||||
|
|
||||||
void watchdog_init() {
|
void watchdog_init() {
|
||||||
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
||||||
IWatchdog.begin(4000000); // 4 sec timeout
|
IWatchdog.begin(WDT_TIMEOUT_US);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,4 +46,5 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_WATCHDOG
|
#endif // USE_WATCHDOG
|
||||||
|
|
||||||
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
||||||
|
|
|
||||||
|
|
@ -244,3 +244,20 @@ void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!?
|
||||||
|
|
||||||
#define PLATFORM_M997_SUPPORT
|
#define PLATFORM_M997_SUPPORT
|
||||||
void flashFirmware(const int16_t);
|
void flashFirmware(const int16_t);
|
||||||
|
|
||||||
|
#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set_pwm_frequency
|
||||||
|
* Set the frequency of the timer corresponding to the provided pin
|
||||||
|
* All Timer PWM pins run at the same frequency
|
||||||
|
*/
|
||||||
|
void set_pwm_frequency(const pin_t pin, int f_desired);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set_pwm_duty
|
||||||
|
* Set the PWM duty cycle of the provided pin to the provided value
|
||||||
|
* Optionally allows inverting the duty cycle [default = false]
|
||||||
|
* Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255]
|
||||||
|
*/
|
||||||
|
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|
@ -18,27 +21,25 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <SPI.h>
|
||||||
|
|
||||||
#ifndef HAVE_SW_SERIAL
|
/**
|
||||||
#define SW_SERIAL_PLACEHOLDER 1
|
* Marlin currently requires 3 SPI classes:
|
||||||
#endif
|
*
|
||||||
|
* SPIClass:
|
||||||
|
* This class is normally provided by frameworks and has a semi-default interface.
|
||||||
|
* This is needed because some libraries reference it globally.
|
||||||
|
*
|
||||||
|
* SPISettings:
|
||||||
|
* Container for SPI configs for SPIClass. As above, libraries may reference it globally.
|
||||||
|
*
|
||||||
|
* These two classes are often provided by frameworks so we cannot extend them to add
|
||||||
|
* useful methods for Marlin.
|
||||||
|
*
|
||||||
|
* MarlinSPI:
|
||||||
|
* Provides the default SPIClass interface plus some Marlin goodies such as a simplified
|
||||||
|
* interface for SPI DMA transfer.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
class SoftwareSerial {
|
using MarlinSPI = SPIClass;
|
||||||
public:
|
|
||||||
SoftwareSerial(int8_t RX_pin, int8_t TX_pin);
|
|
||||||
|
|
||||||
void begin(const uint32_t baudrate);
|
|
||||||
|
|
||||||
bool available();
|
|
||||||
|
|
||||||
uint8_t read();
|
|
||||||
uint16_t write(uint8_t byte);
|
|
||||||
void flush();
|
|
||||||
|
|
||||||
void listen();
|
|
||||||
void stopListening();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool listening;
|
|
||||||
};
|
|
||||||
|
|
@ -147,6 +147,18 @@ SPIClass::SPIClass(uint32_t spi_num) {
|
||||||
_currentSetting->state = SPI_STATE_IDLE;
|
_currentSetting->state = SPI_STATE_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SPIClass::SPIClass(int8_t mosi, int8_t miso, int8_t sclk, int8_t ssel) {
|
||||||
|
#if BOARD_NR_SPI >= 1
|
||||||
|
if (mosi == BOARD_SPI1_MOSI_PIN) SPIClass(1);
|
||||||
|
#endif
|
||||||
|
#if BOARD_NR_SPI >= 2
|
||||||
|
if (mosi == BOARD_SPI2_MOSI_PIN) SPIClass(2);
|
||||||
|
#endif
|
||||||
|
#if BOARD_NR_SPI >= 3
|
||||||
|
if (mosi == BOARD_SPI3_MOSI_PIN) SPIClass(3);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up/tear down
|
* Set up/tear down
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,11 @@ public:
|
||||||
*/
|
*/
|
||||||
SPIClass(uint32_t spiPortNumber);
|
SPIClass(uint32_t spiPortNumber);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init using pins
|
||||||
|
*/
|
||||||
|
SPIClass(int8_t mosi, int8_t miso, int8_t sclk, int8_t ssel=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Equivalent to begin(SPI_1_125MHZ, MSBFIRST, 0).
|
* @brief Equivalent to begin(SPI_1_125MHZ, MSBFIRST, 0).
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
/**
|
|
||||||
* Marlin 3D Printer Firmware
|
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#if defined(__STM32F1__) && !defined(HAVE_SW_SERIAL)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Empty class for Software Serial implementation (Custom RX/TX pins)
|
|
||||||
*
|
|
||||||
* TODO: Optionally use https://github.com/FYSETC/SoftwareSerialM if TMC UART is wanted
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "SoftwareSerial.h"
|
|
||||||
|
|
||||||
// Constructor
|
|
||||||
|
|
||||||
SoftwareSerial::SoftwareSerial(int8_t RX_pin, int8_t TX_pin) {}
|
|
||||||
|
|
||||||
// Public
|
|
||||||
|
|
||||||
void SoftwareSerial::begin(const uint32_t baudrate) {
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SoftwareSerial::available() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t SoftwareSerial::read() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t SoftwareSerial::write(uint8_t byte) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SoftwareSerial::flush() {}
|
|
||||||
|
|
||||||
void SoftwareSerial::listen() {
|
|
||||||
listening = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SoftwareSerial::stopListening() {
|
|
||||||
listening = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __STM32F1__
|
|
||||||
|
|
@ -3,7 +3,7 @@ import sys
|
||||||
|
|
||||||
#dynamic build flags for generic compile options
|
#dynamic build flags for generic compile options
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
args = " ".join([ "-std=gnu11",
|
args = " ".join([ "-std=gnu++14",
|
||||||
"-Os",
|
"-Os",
|
||||||
"-mcpu=cortex-m3",
|
"-mcpu=cortex-m3",
|
||||||
"-mthumb",
|
"-mthumb",
|
||||||
|
|
|
||||||
68
Marlin/src/HAL/STM32F1/fast_pwm.cpp
Normal file
68
Marlin/src/HAL/STM32F1/fast_pwm.cpp
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
/**
|
||||||
|
* Marlin 3D Printer Firmware
|
||||||
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifdef __STM32F1__
|
||||||
|
|
||||||
|
#include "../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
|
#if NEEDS_HARDWARE_PWM
|
||||||
|
|
||||||
|
#include <pwm.h>
|
||||||
|
#include "HAL.h"
|
||||||
|
#include "timers.h"
|
||||||
|
|
||||||
|
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||||
|
if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer
|
||||||
|
|
||||||
|
timer_dev *timer = PIN_MAP[pin].timer_device;
|
||||||
|
uint8_t channel = PIN_MAP[pin].timer_channel;
|
||||||
|
|
||||||
|
// Protect used timers
|
||||||
|
if (timer == get_timer_dev(TEMP_TIMER_NUM)) return;
|
||||||
|
if (timer == get_timer_dev(STEP_TIMER_NUM)) return;
|
||||||
|
#if PULSE_TIMER_NUM != STEP_TIMER_NUM
|
||||||
|
if (timer == get_timer_dev(PULSE_TIMER_NUM)) return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!(timer->regs.bas->SR & TIMER_CR1_CEN)) // Ensure the timer is enabled
|
||||||
|
timer_init(timer);
|
||||||
|
|
||||||
|
timer_set_mode(timer, channel, TIMER_PWM);
|
||||||
|
uint16_t preload = 255; // Lock 255 PWM resolution for high frequencies
|
||||||
|
int32_t prescaler = (HAL_TIMER_RATE) / (preload + 1) / f_desired - 1;
|
||||||
|
if (prescaler > 65535) { // For low frequencies increase prescaler
|
||||||
|
prescaler = 65535;
|
||||||
|
preload = (HAL_TIMER_RATE) / (prescaler + 1) / f_desired - 1;
|
||||||
|
}
|
||||||
|
if (prescaler < 0) return; // Too high frequency
|
||||||
|
timer_set_reload(timer, preload);
|
||||||
|
timer_set_prescaler(timer, prescaler);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||||
|
timer_dev *timer = PIN_MAP[pin].timer_device;
|
||||||
|
uint16_t max_val = timer->regs.bas->ARR * v / v_size;
|
||||||
|
if (invert) max_val = v_size - max_val;
|
||||||
|
pwmWrite(pin, max_val);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // NEEDS_HARDWARE_PWM
|
||||||
|
#endif // __STM32F1__
|
||||||
|
|
@ -25,15 +25,6 @@
|
||||||
* Test STM32F1-specific configuration values for errors at compile-time.
|
* Test STM32F1-specific configuration values for errors at compile-time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
|
|
||||||
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32F1."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(HAVE_SW_SERIAL) && HAS_TMC_SW_SERIAL
|
|
||||||
#warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
|
|
||||||
#error "Missing SoftwareSerial implementation."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
|
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
|
||||||
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
|
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
|
||||||
#if USE_FALLBACK_EEPROM
|
#if USE_FALLBACK_EEPROM
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,6 @@
|
||||||
#undef SDSS
|
#undef SDSS
|
||||||
#define SDSS SS_PIN
|
#define SDSS SS_PIN
|
||||||
|
|
||||||
#if ENABLED(ENABLE_SPI3)
|
#ifndef SPI_DEVICE
|
||||||
#define SPI_DEVICE 3
|
|
||||||
#elif ENABLED(ENABLE_SPI2)
|
|
||||||
#define SPI_DEVICE 2
|
|
||||||
#else
|
|
||||||
#define SPI_DEVICE 1
|
#define SPI_DEVICE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,11 @@
|
||||||
#include <libmaple/iwdg.h>
|
#include <libmaple/iwdg.h>
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0).
|
||||||
|
*/
|
||||||
|
#define STM32F1_WD_RELOAD TERN(WATCHDOG_DURATION_8S, 1250, 625) // 4 or 8 second timeout
|
||||||
|
|
||||||
void HAL_watchdog_refresh() {
|
void HAL_watchdog_refresh() {
|
||||||
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
|
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
|
||||||
TOGGLE(LED_PIN); // heartbeat indicator
|
TOGGLE(LED_PIN); // heartbeat indicator
|
||||||
|
|
@ -49,7 +54,7 @@ void watchdogSetup() {
|
||||||
*
|
*
|
||||||
* @return No return
|
* @return No return
|
||||||
*
|
*
|
||||||
* @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0)
|
* @details The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0).
|
||||||
*/
|
*/
|
||||||
void watchdog_init() {
|
void watchdog_init() {
|
||||||
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
||||||
|
|
|
||||||
|
|
@ -27,18 +27,9 @@
|
||||||
|
|
||||||
#include <libmaple/iwdg.h>
|
#include <libmaple/iwdg.h>
|
||||||
|
|
||||||
/**
|
// Initialize watchdog with a 4 or 8 second countdown time
|
||||||
* The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and
|
|
||||||
* 625 reload value (counts down to 0)
|
|
||||||
* use 1250 for 8 seconds
|
|
||||||
*/
|
|
||||||
#define STM32F1_WD_RELOAD 625
|
|
||||||
|
|
||||||
// Arduino STM32F1 core now has watchdog support
|
|
||||||
|
|
||||||
// Initialize watchdog with a 4 second countdown time
|
|
||||||
void watchdog_init();
|
void watchdog_init();
|
||||||
|
|
||||||
// Reset watchdog. MUST be called at least every 4 seconds after the
|
// Reset watchdog. MUST be called every 4 or 8 seconds after the
|
||||||
// first watchdog_init or STM32F1 will reset.
|
// first watchdog_init or the STM32F1 will reset.
|
||||||
void HAL_watchdog_refresh();
|
void HAL_watchdog_refresh();
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,14 @@
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
|
#define WDT_TIMEOUT_COUNT TERN(WATCHDOG_DURATION_8S, 8192, 4096) // 4 or 8 second timeout
|
||||||
|
|
||||||
IWDG_HandleTypeDef hiwdg;
|
IWDG_HandleTypeDef hiwdg;
|
||||||
|
|
||||||
void watchdog_init() {
|
void watchdog_init() {
|
||||||
hiwdg.Instance = IWDG;
|
hiwdg.Instance = IWDG;
|
||||||
hiwdg.Init.Prescaler = IWDG_PRESCALER_32; // 32kHz LSI clock and 32x prescalar = 1024Hz IWDG clock
|
hiwdg.Init.Prescaler = IWDG_PRESCALER_32; // 32kHz LSI clock and 32x prescalar = 1024Hz IWDG clock
|
||||||
hiwdg.Init.Reload = 4095; //4095 counts = 4 seconds at 1024Hz
|
hiwdg.Init.Reload = WDT_TIMEOUT_COUNT - 1;
|
||||||
if (HAL_IWDG_Init(&hiwdg) != HAL_OK) {
|
if (HAL_IWDG_Init(&hiwdg) != HAL_OK) {
|
||||||
//Error_Handler();
|
//Error_Handler();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,11 @@
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
|
#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout
|
||||||
|
|
||||||
void watchdog_init() {
|
void watchdog_init() {
|
||||||
WDOG_TOVALH = 0;
|
WDOG_TOVALH = 0;
|
||||||
WDOG_TOVALL = 4000;
|
WDOG_TOVALL = WDT_TIMEOUT_MS;
|
||||||
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
|
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,11 @@
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
|
#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout
|
||||||
|
|
||||||
void watchdog_init() {
|
void watchdog_init() {
|
||||||
WDOG_TOVALH = 0;
|
WDOG_TOVALH = 0;
|
||||||
WDOG_TOVALL = 4000;
|
WDOG_TOVALL = WDT_TIMEOUT_MS;
|
||||||
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
|
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,31 +19,27 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#ifdef __IMXRT1062__
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A)
|
* HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __IMXRT1062__
|
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(USE_WATCHDOG)
|
#if ENABLED(USE_WATCHDOG)
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
// 4 seconds timeout
|
#define WDT_TIMEOUT TERN(WATCHDOG_DURATION_8S, 8, 4) // 4 or 8 second timeout
|
||||||
#define WDTO 4 //seconds
|
|
||||||
|
|
||||||
uint8_t timeoutval = (WDTO - 0.5f) / 0.5f;
|
constexpr uint8_t timeoutval = (WDT_TIMEOUT - 0.5f) / 0.5f;
|
||||||
|
|
||||||
void watchdog_init() {
|
void watchdog_init() {
|
||||||
|
|
||||||
CCM_CCGR3 |= CCM_CCGR3_WDOG1(3); // enable WDOG1 clocks
|
CCM_CCGR3 |= CCM_CCGR3_WDOG1(3); // enable WDOG1 clocks
|
||||||
WDOG1_WMCR = 0; // disable power down PDE
|
WDOG1_WMCR = 0; // disable power down PDE
|
||||||
WDOG1_WCR |= WDOG_WCR_SRS | WDOG_WCR_WT(timeoutval);
|
WDOG1_WCR |= WDOG_WCR_SRS | WDOG_WCR_WT(timeoutval);
|
||||||
WDOG1_WCR |= WDOG_WCR_WDE | WDOG_WCR_WDT | WDOG_WCR_SRE;
|
WDOG1_WCR |= WDOG_WCR_WDE | WDOG_WCR_WDT | WDOG_WCR_SRE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HAL_watchdog_refresh() {
|
void HAL_watchdog_refresh() {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commercially or otherwise. The only limitation is that I
|
* any context, commercially or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liability for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Utility functions and glue for ARM unwinding sub-modules.
|
* File Description: Utility functions and glue for ARM unwinding sub-modules.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commerically or otherwise. The only limitation is that I
|
* any context, commerically or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liablity for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Internal interface between the ARM unwinding sub-modules.
|
* File Description: Internal interface between the ARM unwinding sub-modules.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commercially or otherwise. The only limitation is that I
|
* any context, commercially or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liability for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Abstract interpreter for ARM mode.
|
* File Description: Abstract interpreter for ARM mode.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commercially or otherwise. The only limitation is that I
|
* any context, commercially or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liability for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Abstract interpretation for Thumb mode.
|
* File Description: Abstract interpretation for Thumb mode.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commerically or otherwise. The only limitation is that I
|
* any context, commerically or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liablity for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Interface to the memory tracking sub-system.
|
* File Description: Interface to the memory tracking sub-system.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commerically or otherwise. The only limitation is that I
|
* any context, commerically or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liablity for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Implementation of the memory tracking sub-system.
|
* File Description: Implementation of the memory tracking sub-system.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commerically or otherwise. The only limitation is that I
|
* any context, commerically or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liablity for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Interface to the memory tracking sub-system.
|
* File Description: Interface to the memory tracking sub-system.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commercially or otherwise. The only limitation is that I
|
* any context, commercially or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liability for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Implementation of the interface into the ARM unwinder.
|
* File Description: Implementation of the interface into the ARM unwinder.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commerically or otherwise. The only limitation is that I
|
* any context, commerically or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liablity for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
/** \file
|
/** \file
|
||||||
* Interface to the ARM stack unwinding module.
|
* Interface to the ARM stack unwinding module.
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commercially or otherwise. The only limitation is that I
|
* any context, commercially or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liability for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Utility functions to access memory
|
* File Description: Utility functions to access memory
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* for free and use it as they wish, with or without modifications, and in
|
* for free and use it as they wish, with or without modifications, and in
|
||||||
* any context, commerically or otherwise. The only limitation is that I
|
* any context, commerically or otherwise. The only limitation is that I
|
||||||
* don't guarantee that the software is fit for any purpose or accept any
|
* don't guarantee that the software is fit for any purpose or accept any
|
||||||
* liablity for it's use or misuse - this software is without warranty.
|
* liability for its use or misuse - this software is without warranty.
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* File Description: Utility functions to access memory
|
* File Description: Utility functions to access memory
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,7 @@ bool wait_for_heatup = true;
|
||||||
bool wait_for_user; // = false;
|
bool wait_for_user; // = false;
|
||||||
|
|
||||||
void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) {
|
void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) {
|
||||||
TERN(ADVANCED_PAUSE_FEATURE,,UNUSED(no_sleep));
|
UNUSED(no_sleep);
|
||||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
wait_for_user = true;
|
wait_for_user = true;
|
||||||
if (ms) ms += millis(); // expire time
|
if (ms) ms += millis(); // expire time
|
||||||
|
|
@ -509,7 +509,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
|
||||||
kill();
|
kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
// M18 / M94 : Handle steppers inactive time timeout
|
// M18 / M84 : Handle steppers inactive time timeout
|
||||||
if (gcode.stepper_inactive_time) {
|
if (gcode.stepper_inactive_time) {
|
||||||
|
|
||||||
static bool already_shutdown_steppers; // = false
|
static bool already_shutdown_steppers; // = false
|
||||||
|
|
@ -991,6 +991,14 @@ void setup() {
|
||||||
|
|
||||||
SETUP_RUN(HAL_init());
|
SETUP_RUN(HAL_init());
|
||||||
|
|
||||||
|
// Init and disable SPI thermocouples
|
||||||
|
#if HEATER_0_USES_MAX6675
|
||||||
|
OUT_WRITE(MAX6675_SS_PIN, HIGH); // Disable
|
||||||
|
#endif
|
||||||
|
#if HEATER_1_USES_MAX6675
|
||||||
|
OUT_WRITE(MAX6675_SS2_PIN, HIGH); // Disable
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_L64XX
|
#if HAS_L64XX
|
||||||
SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers
|
SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -94,9 +94,11 @@ extern bool wait_for_heatup;
|
||||||
#if ENABLED(AUTO_POWER_CONTROL)
|
#if ENABLED(AUTO_POWER_CONTROL)
|
||||||
#define PSU_ON() powerManager.power_on()
|
#define PSU_ON() powerManager.power_on()
|
||||||
#define PSU_OFF() powerManager.power_off()
|
#define PSU_OFF() powerManager.power_off()
|
||||||
|
#define PSU_OFF_SOON() powerManager.power_off_soon()
|
||||||
#else
|
#else
|
||||||
#define PSU_ON() PSU_PIN_ON()
|
#define PSU_ON() PSU_PIN_ON()
|
||||||
#define PSU_OFF() PSU_PIN_OFF()
|
#define PSU_OFF() PSU_PIN_OFF()
|
||||||
|
#define PSU_OFF_SOON PSU_OFF
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,49 +69,50 @@
|
||||||
#define BOARD_MKS_GEN_L 1113 // MKS GEN L
|
#define BOARD_MKS_GEN_L 1113 // MKS GEN L
|
||||||
#define BOARD_KFB_2 1114 // BigTreeTech or BIQU KFB2.0
|
#define BOARD_KFB_2 1114 // BigTreeTech or BIQU KFB2.0
|
||||||
#define BOARD_ZRIB_V20 1115 // zrib V2.0 control board (Chinese knock off RAMPS replica)
|
#define BOARD_ZRIB_V20 1115 // zrib V2.0 control board (Chinese knock off RAMPS replica)
|
||||||
#define BOARD_FELIX2 1116 // Felix 2.0+ Electronics Board (RAMPS like)
|
#define BOARD_ZRIB_V52 1116 // zrib V5.2 control board (Chinese knock off RAMPS replica)
|
||||||
#define BOARD_RIGIDBOARD 1117 // Invent-A-Part RigidBoard
|
#define BOARD_FELIX2 1117 // Felix 2.0+ Electronics Board (RAMPS like)
|
||||||
#define BOARD_RIGIDBOARD_V2 1118 // Invent-A-Part RigidBoard V2
|
#define BOARD_RIGIDBOARD 1118 // Invent-A-Part RigidBoard
|
||||||
#define BOARD_SAINSMART_2IN1 1119 // Sainsmart 2-in-1 board
|
#define BOARD_RIGIDBOARD_V2 1119 // Invent-A-Part RigidBoard V2
|
||||||
#define BOARD_ULTIMAKER 1120 // Ultimaker
|
#define BOARD_SAINSMART_2IN1 1120 // Sainsmart 2-in-1 board
|
||||||
#define BOARD_ULTIMAKER_OLD 1121 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
|
#define BOARD_ULTIMAKER 1121 // Ultimaker
|
||||||
#define BOARD_AZTEEG_X3 1122 // Azteeg X3
|
#define BOARD_ULTIMAKER_OLD 1122 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
|
||||||
#define BOARD_AZTEEG_X3_PRO 1123 // Azteeg X3 Pro
|
#define BOARD_AZTEEG_X3 1123 // Azteeg X3
|
||||||
#define BOARD_ULTIMAIN_2 1124 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
|
#define BOARD_AZTEEG_X3_PRO 1124 // Azteeg X3 Pro
|
||||||
#define BOARD_RUMBA 1125 // Rumba
|
#define BOARD_ULTIMAIN_2 1125 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
|
||||||
#define BOARD_RUMBA_RAISE3D 1126 // Raise3D N series Rumba derivative
|
#define BOARD_RUMBA 1126 // Rumba
|
||||||
#define BOARD_RL200 1127 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
|
#define BOARD_RUMBA_RAISE3D 1127 // Raise3D N series Rumba derivative
|
||||||
#define BOARD_FORMBOT_TREX2PLUS 1128 // Formbot T-Rex 2 Plus
|
#define BOARD_RL200 1128 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
|
||||||
#define BOARD_FORMBOT_TREX3 1129 // Formbot T-Rex 3
|
#define BOARD_FORMBOT_TREX2PLUS 1129 // Formbot T-Rex 2 Plus
|
||||||
#define BOARD_FORMBOT_RAPTOR 1130 // Formbot Raptor
|
#define BOARD_FORMBOT_TREX3 1130 // Formbot T-Rex 3
|
||||||
#define BOARD_FORMBOT_RAPTOR2 1131 // Formbot Raptor 2
|
#define BOARD_FORMBOT_RAPTOR 1131 // Formbot Raptor
|
||||||
#define BOARD_BQ_ZUM_MEGA_3D 1132 // bq ZUM Mega 3D
|
#define BOARD_FORMBOT_RAPTOR2 1132 // Formbot Raptor 2
|
||||||
#define BOARD_MAKEBOARD_MINI 1133 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake
|
#define BOARD_BQ_ZUM_MEGA_3D 1133 // bq ZUM Mega 3D
|
||||||
#define BOARD_TRIGORILLA_13 1134 // TriGorilla Anycubic version 1.3-based on RAMPS EFB
|
#define BOARD_MAKEBOARD_MINI 1134 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake
|
||||||
#define BOARD_TRIGORILLA_14 1135 // ... Ver 1.4
|
#define BOARD_TRIGORILLA_13 1135 // TriGorilla Anycubic version 1.3-based on RAMPS EFB
|
||||||
#define BOARD_TRIGORILLA_14_11 1136 // ... Rev 1.1 (new servo pin order)
|
#define BOARD_TRIGORILLA_14 1136 // ... Ver 1.4
|
||||||
#define BOARD_RAMPS_ENDER_4 1137 // Creality: Ender-4, CR-8
|
#define BOARD_TRIGORILLA_14_11 1137 // ... Rev 1.1 (new servo pin order)
|
||||||
#define BOARD_RAMPS_CREALITY 1138 // Creality: CR10S, CR20, CR-X
|
#define BOARD_RAMPS_ENDER_4 1138 // Creality: Ender-4, CR-8
|
||||||
#define BOARD_RAMPS_DAGOMA 1139 // Dagoma F5
|
#define BOARD_RAMPS_CREALITY 1139 // Creality: CR10S, CR20, CR-X
|
||||||
#define BOARD_FYSETC_F6_13 1140 // FYSETC F6 1.3
|
#define BOARD_DAGOMA_F5 1140 // Dagoma F5
|
||||||
#define BOARD_FYSETC_F6_14 1141 // FYSETC F6 1.4
|
#define BOARD_FYSETC_F6_13 1141 // FYSETC F6 1.3
|
||||||
#define BOARD_DUPLICATOR_I3_PLUS 1142 // Wanhao Duplicator i3 Plus
|
#define BOARD_FYSETC_F6_14 1142 // FYSETC F6 1.4
|
||||||
#define BOARD_VORON 1143 // VORON Design
|
#define BOARD_DUPLICATOR_I3_PLUS 1143 // Wanhao Duplicator i3 Plus
|
||||||
#define BOARD_TRONXY_V3_1_0 1144 // Tronxy TRONXY-V3-1.0
|
#define BOARD_VORON 1144 // VORON Design
|
||||||
#define BOARD_Z_BOLT_X_SERIES 1145 // Z-Bolt X Series
|
#define BOARD_TRONXY_V3_1_0 1145 // Tronxy TRONXY-V3-1.0
|
||||||
#define BOARD_TT_OSCAR 1146 // TT OSCAR
|
#define BOARD_Z_BOLT_X_SERIES 1146 // Z-Bolt X Series
|
||||||
#define BOARD_OVERLORD 1147 // Overlord/Overlord Pro
|
#define BOARD_TT_OSCAR 1147 // TT OSCAR
|
||||||
#define BOARD_HJC2560C_REV1 1148 // ADIMLab Gantry v1
|
#define BOARD_OVERLORD 1148 // Overlord/Overlord Pro
|
||||||
#define BOARD_HJC2560C_REV2 1149 // ADIMLab Gantry v2
|
#define BOARD_HJC2560C_REV1 1149 // ADIMLab Gantry v1
|
||||||
#define BOARD_TANGO 1150 // BIQU Tango V1
|
#define BOARD_HJC2560C_REV2 1150 // ADIMLab Gantry v2
|
||||||
#define BOARD_MKS_GEN_L_V2 1151 // MKS GEN L V2
|
#define BOARD_TANGO 1151 // BIQU Tango V1
|
||||||
#define BOARD_MKS_GEN_L_V21 1152 // MKS GEN L V2.1
|
#define BOARD_MKS_GEN_L_V2 1152 // MKS GEN L V2
|
||||||
#define BOARD_COPYMASTER_3D 1153 // Copymaster 3D
|
#define BOARD_MKS_GEN_L_V21 1153 // MKS GEN L V2.1
|
||||||
#define BOARD_ORTUR_4 1154 // Ortur 4
|
#define BOARD_COPYMASTER_3D 1154 // Copymaster 3D
|
||||||
#define BOARD_TENLOG_D3_HERO 1155 // Tenlog D3 Hero IDEX printer
|
#define BOARD_ORTUR_4 1155 // Ortur 4
|
||||||
#define BOARD_RAMPS_S_12_EEFB 1156 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
#define BOARD_TENLOG_D3_HERO 1156 // Tenlog D3 Hero IDEX printer
|
||||||
#define BOARD_RAMPS_S_12_EEEB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
|
#define BOARD_RAMPS_S_12_EEFB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||||
#define BOARD_RAMPS_S_12_EFFB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
|
#define BOARD_RAMPS_S_12_EEEB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
|
||||||
|
#define BOARD_RAMPS_S_12_EFFB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
|
||||||
|
|
||||||
//
|
//
|
||||||
// RAMBo and derivatives
|
// RAMBo and derivatives
|
||||||
|
|
@ -378,6 +379,7 @@
|
||||||
#define BOARD_MRR_ESPA 6001 // MRR ESPA board based on ESP32 (native pins only)
|
#define BOARD_MRR_ESPA 6001 // MRR ESPA board based on ESP32 (native pins only)
|
||||||
#define BOARD_MRR_ESPE 6002 // MRR ESPE board based on ESP32 (with I2S stepper stream)
|
#define BOARD_MRR_ESPE 6002 // MRR ESPE board based on ESP32 (with I2S stepper stream)
|
||||||
#define BOARD_E4D_BOX 6003 // E4d@BOX
|
#define BOARD_E4D_BOX 6003 // E4d@BOX
|
||||||
|
#define BOARD_FYSETC_E4 6004 // FYSETC E4
|
||||||
|
|
||||||
//
|
//
|
||||||
// SAMD51 ARM Cortex M4
|
// SAMD51 ARM Cortex M4
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,9 @@
|
||||||
#define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
|
#define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
|
||||||
#define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B.
|
#define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B.
|
||||||
|
|
||||||
|
#define IF_ENABLED TERN_
|
||||||
|
#define IF_DISABLED(O,A) TERN(O,,A)
|
||||||
|
|
||||||
#define ANY(V...) !DISABLED(V)
|
#define ANY(V...) !DISABLED(V)
|
||||||
#define NONE(V...) DISABLED(V)
|
#define NONE(V...) DISABLED(V)
|
||||||
#define ALL(V...) ENABLED(V)
|
#define ALL(V...) ENABLED(V)
|
||||||
|
|
|
||||||
|
|
@ -54,17 +54,17 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline float get_measurement(const AxisEnum a) {
|
static inline float get_measurement(const AxisEnum a) {
|
||||||
|
UNUSED(a);
|
||||||
// Return the measurement averaged over all readings
|
// Return the measurement averaged over all readings
|
||||||
return TERN(MEASURE_BACKLASH_WHEN_PROBING
|
return TERN(MEASURE_BACKLASH_WHEN_PROBING
|
||||||
, measured_count[a] > 0 ? measured_mm[a] / measured_count[a] : 0
|
, measured_count[a] > 0 ? measured_mm[a] / measured_count[a] : 0
|
||||||
, 0
|
, 0
|
||||||
);
|
);
|
||||||
TERN(MEASURE_BACKLASH_WHEN_PROBING,,UNUSED(a));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool has_measurement(const AxisEnum a) {
|
static inline bool has_measurement(const AxisEnum a) {
|
||||||
|
UNUSED(a);
|
||||||
return TERN0(MEASURE_BACKLASH_WHEN_PROBING, measured_count[a] > 0);
|
return TERN0(MEASURE_BACKLASH_WHEN_PROBING, measured_count[a] > 0);
|
||||||
TERN(MEASURE_BACKLASH_WHEN_PROBING,,UNUSED(a));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool has_any_measurement() {
|
static inline bool has_any_measurement() {
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ float bilinear_z_offset(const xy_pos_t &raw) {
|
||||||
* Prepare a bilinear-leveled linear move on Cartesian,
|
* Prepare a bilinear-leveled linear move on Cartesian,
|
||||||
* splitting the move where it crosses grid borders.
|
* splitting the move where it crosses grid borders.
|
||||||
*/
|
*/
|
||||||
void bilinear_line_to_destination(const feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) {
|
void bilinear_line_to_destination(const feedRate_t &scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) {
|
||||||
// Get current and destination cells for this line
|
// Get current and destination cells for this line
|
||||||
xy_int_t c1 { CELL_INDEX(x, current_position.x), CELL_INDEX(y, current_position.y) },
|
xy_int_t c1 { CELL_INDEX(x, current_position.x), CELL_INDEX(y, current_position.y) },
|
||||||
c2 { CELL_INDEX(x, destination.x), CELL_INDEX(y, destination.y) };
|
c2 { CELL_INDEX(x, destination.x), CELL_INDEX(y, destination.y) };
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ uint8_t ControllerFan::speed;
|
||||||
|
|
||||||
#if ENABLED(CONTROLLER_FAN_EDITABLE)
|
#if ENABLED(CONTROLLER_FAN_EDITABLE)
|
||||||
controllerFan_settings_t ControllerFan::settings; // {0}
|
controllerFan_settings_t ControllerFan::settings; // {0}
|
||||||
|
#else
|
||||||
|
const controllerFan_settings_t &ControllerFan::settings = controllerFan_defaults;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ControllerFan::setup() {
|
void ControllerFan::setup() {
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ class ControllerFan {
|
||||||
#if ENABLED(CONTROLLER_FAN_EDITABLE)
|
#if ENABLED(CONTROLLER_FAN_EDITABLE)
|
||||||
static controllerFan_settings_t settings;
|
static controllerFan_settings_t settings;
|
||||||
#else
|
#else
|
||||||
static const controllerFan_settings_t constexpr &settings = controllerFan_defaults;
|
static const controllerFan_settings_t &settings;
|
||||||
#endif
|
#endif
|
||||||
static inline bool state() { return speed > 0; }
|
static inline bool state() { return speed > 0; }
|
||||||
static inline void init() { reset(); }
|
static inline void init() { reset(); }
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ uint8_t MCP4728::getDrvPct(const uint8_t channel) { return uint8_t(100.0 * dac_v
|
||||||
* DAC Values array and calls fastwrite to update the DAC.
|
* DAC Values array and calls fastwrite to update the DAC.
|
||||||
*/
|
*/
|
||||||
void MCP4728::setDrvPct(xyze_uint8_t &pct) {
|
void MCP4728::setDrvPct(xyze_uint8_t &pct) {
|
||||||
dac_values *= 0.01 * pct * (DAC_STEPPER_MAX);
|
dac_values *= pct.asFloat() * 0.01f * (DAC_STEPPER_MAX);
|
||||||
fastWrite();
|
fastWrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ public:
|
||||||
#if CONJOINED_NEOPIXEL
|
#if CONJOINED_NEOPIXEL
|
||||||
adaneo2.show();
|
adaneo2.show();
|
||||||
#else
|
#else
|
||||||
TERN(NEOPIXEL2_SEPARATE,,adaneo1.setPin(NEOPIXEL2_PIN));
|
IF_DISABLED(NEOPIXEL2_SEPARATE, adaneo1.setPin(NEOPIXEL2_PIN));
|
||||||
adaneo1.show();
|
adaneo1.show();
|
||||||
adaneo1.setPin(NEOPIXEL_PIN);
|
adaneo1.setPin(NEOPIXEL_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ uint8_t MMU2::get_current_tool() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR)
|
#if EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR)
|
||||||
#define FILAMENT_PRESENT() (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE)
|
#define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void MMU2::mmu_loop() {
|
void MMU2::mmu_loop() {
|
||||||
|
|
|
||||||
|
|
@ -126,4 +126,12 @@ void Power::power_off() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Power::power_off_soon() {
|
||||||
|
#if POWER_OFF_DELAY
|
||||||
|
lastPowerOn = millis() - SEC_TO_MS(POWER_TIMEOUT) + SEC_TO_MS(POWER_OFF_DELAY);
|
||||||
|
#else
|
||||||
|
power_off();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#endif // AUTO_POWER_CONTROL
|
#endif // AUTO_POWER_CONTROL
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ class Power {
|
||||||
static void check();
|
static void check();
|
||||||
static void power_on();
|
static void power_on();
|
||||||
static void power_off();
|
static void power_off();
|
||||||
|
static void power_off_soon();
|
||||||
private:
|
private:
|
||||||
static millis_t lastPowerOn;
|
static millis_t lastPowerOn;
|
||||||
static bool is_power_needed();
|
static bool is_power_needed();
|
||||||
|
|
|
||||||
|
|
@ -433,13 +433,15 @@ void PrintJobRecovery::resume() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Restore print cooling fan speeds
|
// Restore print cooling fan speeds
|
||||||
|
#if HAS_FAN
|
||||||
FANS_LOOP(i) {
|
FANS_LOOP(i) {
|
||||||
uint8_t f = info.fan_speed[i];
|
const int f = info.fan_speed[i];
|
||||||
if (f) {
|
if (f) {
|
||||||
sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f);
|
sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f);
|
||||||
gcode.process_subcommands_now(cmd);
|
gcode.process_subcommands_now(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Restore retract and hop state
|
// Restore retract and hop state
|
||||||
#if ENABLED(FWRETRACT)
|
#if ENABLED(FWRETRACT)
|
||||||
|
|
|
||||||
|
|
@ -149,17 +149,33 @@ class FilamentSensorBase {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline void setup() {
|
static inline void setup() {
|
||||||
#if ENABLED(FIL_RUNOUT_PULLUP)
|
#define _INIT_RUNOUT_PIN(P,S,U) do{ if (DISABLED(U)) SET_INPUT(P); else if (S) SET_INPUT_PULLDOWN(P); else SET_INPUT_PULLUP(P); }while(0)
|
||||||
#define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P)
|
#define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULL)
|
||||||
#elif ENABLED(FIL_RUNOUT_PULLDOWN)
|
#if NUM_RUNOUT_SENSORS >= 1
|
||||||
#define INIT_RUNOUT_PIN(P) SET_INPUT_PULLDOWN(P)
|
INIT_RUNOUT_PIN(1);
|
||||||
#else
|
|
||||||
#define INIT_RUNOUT_PIN(P) SET_INPUT(P)
|
|
||||||
#endif
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 2
|
||||||
#define _INIT_RUNOUT(N) INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN);
|
INIT_RUNOUT_PIN(2);
|
||||||
REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _INIT_RUNOUT)
|
#endif
|
||||||
#undef _INIT_RUNOUT
|
#if NUM_RUNOUT_SENSORS >= 3
|
||||||
|
INIT_RUNOUT_PIN(3);
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 4
|
||||||
|
INIT_RUNOUT_PIN(4);
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 5
|
||||||
|
INIT_RUNOUT_PIN(5);
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 6
|
||||||
|
INIT_RUNOUT_PIN(6);
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 7
|
||||||
|
INIT_RUNOUT_PIN(7);
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 8
|
||||||
|
INIT_RUNOUT_PIN(8);
|
||||||
|
#endif
|
||||||
|
#undef _INIT_RUNOUT_PIN
|
||||||
#undef INIT_RUNOUT_PIN
|
#undef INIT_RUNOUT_PIN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,11 +188,32 @@ class FilamentSensorBase {
|
||||||
|
|
||||||
// Return a bitmask of runout flag states (1 bits always indicates runout)
|
// Return a bitmask of runout flag states (1 bits always indicates runout)
|
||||||
static inline uint8_t poll_runout_states() {
|
static inline uint8_t poll_runout_states() {
|
||||||
return poll_runout_pins()
|
return poll_runout_pins() ^ uint8_t(0
|
||||||
#if FIL_RUNOUT_STATE == LOW
|
#if NUM_RUNOUT_SENSORS >= 1
|
||||||
^ uint8_t(_BV(NUM_RUNOUT_SENSORS) - 1)
|
| (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1))
|
||||||
#endif
|
#endif
|
||||||
;
|
#if NUM_RUNOUT_SENSORS >= 2
|
||||||
|
| (FIL_RUNOUT2_STATE ? 0 : _BV(2 - 1))
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 3
|
||||||
|
| (FIL_RUNOUT3_STATE ? 0 : _BV(3 - 1))
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 4
|
||||||
|
| (FIL_RUNOUT4_STATE ? 0 : _BV(4 - 1))
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 5
|
||||||
|
| (FIL_RUNOUT5_STATE ? 0 : _BV(5 - 1))
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 6
|
||||||
|
| (FIL_RUNOUT6_STATE ? 0 : _BV(6 - 1))
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 7
|
||||||
|
| (FIL_RUNOUT7_STATE ? 0 : _BV(7 - 1))
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 8
|
||||||
|
| (FIL_RUNOUT8_STATE ? 0 : _BV(8 - 1))
|
||||||
|
#endif
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@
|
||||||
|
|
||||||
#include "spindle_laser.h"
|
#include "spindle_laser.h"
|
||||||
|
|
||||||
|
#if ENABLED(SPINDLE_SERVO)
|
||||||
|
#include "../module/servo.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
SpindleLaser cutter;
|
SpindleLaser cutter;
|
||||||
uint8_t SpindleLaser::power;
|
uint8_t SpindleLaser::power;
|
||||||
bool SpindleLaser::isReady; // Ready to apply power setting from the UI to OCR
|
bool SpindleLaser::isReady; // Ready to apply power setting from the UI to OCR
|
||||||
|
|
@ -45,7 +49,11 @@ cutter_power_t SpindleLaser::menuPower, // Power s
|
||||||
// Init the cutter to a safe OFF state
|
// Init the cutter to a safe OFF state
|
||||||
//
|
//
|
||||||
void SpindleLaser::init() {
|
void SpindleLaser::init() {
|
||||||
|
#if ENABLED(SPINDLE_SERVO)
|
||||||
|
MOVE_SERVO(SPINDLE_SERVO_NR, SPINDLE_SERVO_MIN);
|
||||||
|
#else
|
||||||
OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Init spindle to off
|
OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Init spindle to off
|
||||||
|
#endif
|
||||||
#if ENABLED(SPINDLE_CHANGE_DIR)
|
#if ENABLED(SPINDLE_CHANGE_DIR)
|
||||||
OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // Init rotation to clockwise (M3)
|
OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // Init rotation to clockwise (M3)
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -97,6 +105,8 @@ void SpindleLaser::apply_power(const uint8_t opwr) {
|
||||||
ocr_off();
|
ocr_off();
|
||||||
isReady = false;
|
isReady = false;
|
||||||
}
|
}
|
||||||
|
#elif ENABLED(SPINDLE_SERVO)
|
||||||
|
MOVE_SERVO(SPINDLE_SERVO_NR, power);
|
||||||
#else
|
#else
|
||||||
WRITE(SPINDLE_LASER_ENA_PIN, enabled() ? SPINDLE_LASER_ACTIVE_STATE : !SPINDLE_LASER_ACTIVE_STATE);
|
WRITE(SPINDLE_LASER_ENA_PIN, enabled() ? SPINDLE_LASER_ACTIVE_STATE : !SPINDLE_LASER_ACTIVE_STATE);
|
||||||
isReady = true;
|
isReady = true;
|
||||||
|
|
|
||||||
|
|
@ -35,29 +35,33 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PCT_TO_PWM(X) ((X) * 255 / 100)
|
#define PCT_TO_PWM(X) ((X) * 255 / 100)
|
||||||
|
#define PCT_TO_SERVO(X) ((X) * 180 / 100)
|
||||||
|
|
||||||
#ifndef SPEED_POWER_INTERCEPT
|
#ifndef SPEED_POWER_INTERCEPT
|
||||||
#define SPEED_POWER_INTERCEPT 0
|
#define SPEED_POWER_INTERCEPT 0
|
||||||
#endif
|
#endif
|
||||||
#define SPEED_POWER_FLOOR TERN(CUTTER_POWER_RELATIVE, SPEED_POWER_MIN, 0)
|
|
||||||
|
|
||||||
// #define _MAP(N,S1,S2,D1,D2) ((N)*_MAX((D2)-(D1),0)/_MAX((S2)-(S1),1)+(D1))
|
// #define _MAP(N,S1,S2,D1,D2) ((N)*_MAX((D2)-(D1),0)/_MAX((S2)-(S1),1)+(D1))
|
||||||
|
|
||||||
class SpindleLaser {
|
class SpindleLaser {
|
||||||
public:
|
public:
|
||||||
static constexpr float
|
static constexpr float
|
||||||
min_pct = round(TERN(CUTTER_POWER_RELATIVE, 0, (100 * float(SPEED_POWER_MIN) / TERN(SPINDLE_FEATURE, float(SPEED_POWER_MAX), 100)))),
|
min_pct = TERN(CUTTER_POWER_RELATIVE, 0, TERN(SPINDLE_FEATURE, round(100.0f * (SPEED_POWER_MIN) / (SPEED_POWER_MAX)), SPEED_POWER_MIN)),
|
||||||
max_pct = round(TERN(SPINDLE_FEATURE, 100, float(SPEED_POWER_MAX)));
|
max_pct = TERN(SPINDLE_FEATURE, 100, SPEED_POWER_MAX);
|
||||||
|
|
||||||
static const inline uint8_t pct_to_ocr(const float pct) { return uint8_t(PCT_TO_PWM(pct)); }
|
static const inline uint8_t pct_to_ocr(const float pct) { return uint8_t(PCT_TO_PWM(pct)); }
|
||||||
|
|
||||||
// cpower = configured values (ie SPEED_POWER_MAX)
|
// cpower = configured values (e.g., SPEED_POWER_MAX)
|
||||||
static const inline uint8_t cpwr_to_pct(const cutter_cpower_t cpwr) { // configured value to pct
|
|
||||||
return unitPower ? round(100 * (cpwr - SPEED_POWER_FLOOR) / (SPEED_POWER_MAX - SPEED_POWER_FLOOR)) : 0;
|
// Convert configured power range to a percentage
|
||||||
|
static const inline uint8_t cpwr_to_pct(const cutter_cpower_t cpwr) {
|
||||||
|
constexpr cutter_cpower_t power_floor = TERN(CUTTER_POWER_RELATIVE, SPEED_POWER_MIN, 0),
|
||||||
|
power_range = SPEED_POWER_MAX - power_floor;
|
||||||
|
return unitPower ? round(100.0f * (cpwr - power_floor) / power_range) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert a configured value (cpower)(ie SPEED_POWER_STARTUP) to unit power (upwr, upower),
|
// Convert a cpower (e.g., SPEED_POWER_STARTUP) to unit power (upwr, upower),
|
||||||
// which can be PWM, Percent, or RPM (rel/abs).
|
// which can be PWM, Percent, Servo angle, or RPM (rel/abs).
|
||||||
static const inline cutter_power_t cpwr_to_upwr(const cutter_cpower_t cpwr) { // STARTUP power to Unit power
|
static const inline cutter_power_t cpwr_to_upwr(const cutter_cpower_t cpwr) { // STARTUP power to Unit power
|
||||||
const cutter_power_t upwr = (
|
const cutter_power_t upwr = (
|
||||||
#if ENABLED(SPINDLE_FEATURE)
|
#if ENABLED(SPINDLE_FEATURE)
|
||||||
|
|
@ -66,6 +70,8 @@ public:
|
||||||
cpwr // to RPM
|
cpwr // to RPM
|
||||||
#elif CUTTER_UNIT_IS(PERCENT) // to PCT
|
#elif CUTTER_UNIT_IS(PERCENT) // to PCT
|
||||||
cpwr_to_pct(cpwr)
|
cpwr_to_pct(cpwr)
|
||||||
|
#elif CUTTER_UNIT_IS(SERVO) // to SERVO angle
|
||||||
|
PCT_TO_SERVO(cpwr_to_pct(cpwr))
|
||||||
#else // to PWM
|
#else // to PWM
|
||||||
PCT_TO_PWM(cpwr_to_pct(cpwr))
|
PCT_TO_PWM(cpwr_to_pct(cpwr))
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -235,7 +241,7 @@ public:
|
||||||
// Inline modes of all other functions; all enable planner inline power control
|
// Inline modes of all other functions; all enable planner inline power control
|
||||||
static inline void set_inline_enabled(const bool enable) {
|
static inline void set_inline_enabled(const bool enable) {
|
||||||
if (enable)
|
if (enable)
|
||||||
inline_power(cpwr_to_upwr(SPEED_POWER_STARTUP));
|
inline_power(255);
|
||||||
else {
|
else {
|
||||||
isReady = false;
|
isReady = false;
|
||||||
unitPower = menuPower = 0;
|
unitPower = menuPower = 0;
|
||||||
|
|
|
||||||
59
Marlin/src/feature/tramming.h
Normal file
59
Marlin/src/feature/tramming.h
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
/**
|
||||||
|
* Marlin 3D Printer Firmware
|
||||||
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
|
*
|
||||||
|
* Based on Sprinter and grbl.
|
||||||
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
|
#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1
|
||||||
|
#error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY;
|
||||||
|
|
||||||
|
#define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos)
|
||||||
|
static_assert(G35_PROBE_COUNT >= 3, "TRAMMING_POINT_XY requires at least 3 XY positions.");
|
||||||
|
|
||||||
|
extern const char point_name_1[], point_name_2[], point_name_3[]
|
||||||
|
#ifdef TRAMMING_POINT_NAME_4
|
||||||
|
, point_name_4[]
|
||||||
|
#ifdef TRAMMING_POINT_NAME_5
|
||||||
|
, point_name_5[]
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
|
#define _NR_TRAM_NAMES 2
|
||||||
|
#ifdef TRAMMING_POINT_NAME_3
|
||||||
|
#undef _NR_TRAM_NAMES
|
||||||
|
#define _NR_TRAM_NAMES 3
|
||||||
|
#ifdef TRAMMING_POINT_NAME_4
|
||||||
|
#undef _NR_TRAM_NAMES
|
||||||
|
#define _NR_TRAM_NAMES 4
|
||||||
|
#ifdef TRAMMING_POINT_NAME_5
|
||||||
|
#undef _NR_TRAM_NAMES
|
||||||
|
#define _NR_TRAM_NAMES 5
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
static_assert(_NR_TRAM_NAMES >= G35_PROBE_COUNT, "Define enough TRAMMING_POINT_NAME_s for all TRAMMING_POINT_XY entries.");
|
||||||
|
#undef _NR_TRAM_NAMES
|
||||||
|
|
||||||
|
extern PGM_P const tramming_point_name[];
|
||||||
|
|
@ -36,19 +36,23 @@
|
||||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
#include "../../core/debug_out.h"
|
#include "../../core/debug_out.h"
|
||||||
|
|
||||||
constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY;
|
//
|
||||||
|
// Define tramming point names.
|
||||||
|
//
|
||||||
|
|
||||||
static PGMSTR(point_name_1, TRAMMING_POINT_NAME_1);
|
#include "../../feature/tramming.h" // Validate
|
||||||
static PGMSTR(point_name_2, TRAMMING_POINT_NAME_2);
|
|
||||||
static PGMSTR(point_name_3, TRAMMING_POINT_NAME_3);
|
PGMSTR(point_name_1, TRAMMING_POINT_NAME_1);
|
||||||
|
PGMSTR(point_name_2, TRAMMING_POINT_NAME_2);
|
||||||
|
PGMSTR(point_name_3, TRAMMING_POINT_NAME_3);
|
||||||
#ifdef TRAMMING_POINT_NAME_4
|
#ifdef TRAMMING_POINT_NAME_4
|
||||||
static PGMSTR(point_name_4, TRAMMING_POINT_NAME_4);
|
PGMSTR(point_name_4, TRAMMING_POINT_NAME_4);
|
||||||
#ifdef TRAMMING_POINT_NAME_5
|
#ifdef TRAMMING_POINT_NAME_5
|
||||||
static PGMSTR(point_name_5, TRAMMING_POINT_NAME_5);
|
PGMSTR(point_name_5, TRAMMING_POINT_NAME_5);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static PGM_P const tramming_point_name[] PROGMEM = {
|
PGM_P const tramming_point_name[] PROGMEM = {
|
||||||
point_name_1, point_name_2, point_name_3
|
point_name_1, point_name_2, point_name_3
|
||||||
#ifdef TRAMMING_POINT_NAME_4
|
#ifdef TRAMMING_POINT_NAME_4
|
||||||
, point_name_4
|
, point_name_4
|
||||||
|
|
@ -58,14 +62,6 @@ static PGM_P const tramming_point_name[] PROGMEM = {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos)
|
|
||||||
|
|
||||||
#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1
|
|
||||||
#error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static_assert(G35_PROBE_COUNT > 2, "TRAMMING_POINT_XY requires at least 3 XY positions.");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* G35: Read bed corners to help adjust bed screws
|
* G35: Read bed corners to help adjust bed screws
|
||||||
*
|
*
|
||||||
|
|
@ -124,20 +120,23 @@ void GcodeSuite::G35() {
|
||||||
// In BLTOUCH HS mode, the probe travels in a deployed state.
|
// In BLTOUCH HS mode, the probe travels in a deployed state.
|
||||||
// Users of G35 might have a badly misaligned bed, so raise Z by the
|
// Users of G35 might have a badly misaligned bed, so raise Z by the
|
||||||
// length of the deployed pin (BLTOUCH stroke < 7mm)
|
// length of the deployed pin (BLTOUCH stroke < 7mm)
|
||||||
current_position.z = (Z_CLEARANCE_BETWEEN_PROBES) + (7 * ENABLED(BLTOUCH_HS_MODE));
|
do_blocking_move_to_z((Z_CLEARANCE_BETWEEN_PROBES) + TERN0(BLTOUCH_HS_MODE, 7));
|
||||||
|
|
||||||
const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true);
|
const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true);
|
||||||
|
|
||||||
if (isnan(z_probed_height)) {
|
if (isnan(z_probed_height)) {
|
||||||
SERIAL_ECHOPAIR("G35 failed at point ", int(i), " (", tramming_point_name[i], ")");
|
SERIAL_ECHOPAIR("G35 failed at point ", int(i), " (");
|
||||||
|
SERIAL_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i]));
|
||||||
|
SERIAL_CHAR(')');
|
||||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y);
|
SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y);
|
||||||
err_break = true;
|
err_break = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DEBUGGING(LEVELING)) {
|
if (DEBUGGING(LEVELING)) {
|
||||||
DEBUG_ECHOPAIR("Probing point ", int(i), " (", tramming_point_name[i], ")");
|
DEBUG_ECHOPAIR("Probing point ", int(i), " (");
|
||||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y, SP_Z_STR, z_probed_height);
|
DEBUG_PRINT_P((char *)pgm_read_ptr(&tramming_point_name[i]));
|
||||||
|
DEBUG_CHAR(')');
|
||||||
|
DEBUG_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y, SP_Z_STR, z_probed_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
z_measured[i] = z_probed_height;
|
z_measured[i] = z_probed_height;
|
||||||
|
|
@ -155,9 +154,9 @@ void GcodeSuite::G35() {
|
||||||
const float decimal_part = adjust - float(full_turns);
|
const float decimal_part = adjust - float(full_turns);
|
||||||
const int minutes = trunc(decimal_part * 60.0f);
|
const int minutes = trunc(decimal_part * 60.0f);
|
||||||
|
|
||||||
SERIAL_ECHOPAIR("Turn ", tramming_point_name[i],
|
SERIAL_ECHOPGM("Turn ");
|
||||||
" ", (screw_thread & 1) == (adjust > 0) ? "CCW" : "CW",
|
SERIAL_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i]));
|
||||||
" by ", abs(full_turns), " turns");
|
SERIAL_ECHOPAIR(" ", (screw_thread & 1) == (adjust > 0) ? "CCW" : "CW", " by ", abs(full_turns), " turns");
|
||||||
if (minutes) SERIAL_ECHOPAIR(" and ", abs(minutes), " minutes");
|
if (minutes) SERIAL_ECHOPAIR(" and ", abs(minutes), " minutes");
|
||||||
if (ENABLED(REPORT_TRAMMING_MM)) SERIAL_ECHOPAIR(" (", -diff, "mm)");
|
if (ENABLED(REPORT_TRAMMING_MM)) SERIAL_ECHOPAIR(" (", -diff, "mm)");
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
|
|
|
||||||
|
|
@ -313,7 +313,7 @@ void GcodeSuite::G28() {
|
||||||
home_all = homeX == homeY && homeX == homeZ, // All or None
|
home_all = homeX == homeY && homeX == homeZ, // All or None
|
||||||
doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ;
|
doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ;
|
||||||
|
|
||||||
#if Z_HOME_DIR > 0 // If homing away from BED do Z first
|
#if ENABLED(HOME_Z_FIRST)
|
||||||
|
|
||||||
if (doZ) homeaxis(Z_AXIS);
|
if (doZ) homeaxis(Z_AXIS);
|
||||||
|
|
||||||
|
|
@ -373,18 +373,13 @@ void GcodeSuite::G28() {
|
||||||
TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing));
|
TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing));
|
||||||
|
|
||||||
// Home Z last if homing towards the bed
|
// Home Z last if homing towards the bed
|
||||||
#if Z_HOME_DIR < 0
|
#if DISABLED(HOME_Z_FIRST)
|
||||||
|
|
||||||
if (doZ) {
|
if (doZ) {
|
||||||
TERN_(BLTOUCH, bltouch.init());
|
TERN_(BLTOUCH, bltouch.init());
|
||||||
|
|
||||||
TERN(Z_SAFE_HOMING, home_z_safely(), homeaxis(Z_AXIS));
|
TERN(Z_SAFE_HOMING, home_z_safely(), homeaxis(Z_AXIS));
|
||||||
|
|
||||||
probe.move_z_after_homing();
|
probe.move_z_after_homing();
|
||||||
|
}
|
||||||
} // doZ
|
#endif
|
||||||
|
|
||||||
#endif // Z_HOME_DIR < 0
|
|
||||||
|
|
||||||
sync_plan_position();
|
sync_plan_position();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ void GcodeSuite::G34() {
|
||||||
const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT);
|
const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT);
|
||||||
const uint32_t previous_current = stepper.motor_current_setting[Z_AXIS];
|
const uint32_t previous_current = stepper.motor_current_setting[Z_AXIS];
|
||||||
stepper.set_digipot_current(1, target_current);
|
stepper.set_digipot_current(1, target_current);
|
||||||
#elif HAS_MOTOR_CURRENT_DAC
|
#elif ENABLED(HAS_MOTOR_CURRENT_DAC)
|
||||||
const float target_current = parser.floatval('S', GANTRY_CALIBRATION_CURRENT);
|
const float target_current = parser.floatval('S', GANTRY_CALIBRATION_CURRENT);
|
||||||
const float previous_current = dac_amps(Z_AXIS, target_current);
|
const float previous_current = dac_amps(Z_AXIS, target_current);
|
||||||
stepper_dac.set_current_value(Z_AXIS, target_current);
|
stepper_dac.set_current_value(Z_AXIS, target_current);
|
||||||
|
|
@ -126,7 +126,7 @@ void GcodeSuite::G34() {
|
||||||
stepper.set_digipot_current(Z_AXIS, previous_current);
|
stepper.set_digipot_current(Z_AXIS, previous_current);
|
||||||
#elif HAS_MOTOR_CURRENT_PWM
|
#elif HAS_MOTOR_CURRENT_PWM
|
||||||
stepper.set_digipot_current(1, previous_current);
|
stepper.set_digipot_current(1, previous_current);
|
||||||
#elif HAS_MOTOR_CURRENT_DAC
|
#elif ENABLED(HAS_MOTOR_CURRENT_DAC)
|
||||||
stepper_dac.set_current_value(Z_AXIS, previous_current);
|
stepper_dac.set_current_value(Z_AXIS, previous_current);
|
||||||
#elif ENABLED(HAS_MOTOR_CURRENT_I2C)
|
#elif ENABLED(HAS_MOTOR_CURRENT_I2C)
|
||||||
digipot_i2c.set_current(Z_AXIS, previous_current)
|
digipot_i2c.set_current(Z_AXIS, previous_current)
|
||||||
|
|
|
||||||
|
|
@ -69,9 +69,13 @@ void GcodeSuite::M3_M4(const bool is_M4) {
|
||||||
auto get_s_power = [] {
|
auto get_s_power = [] {
|
||||||
if (parser.seenval('S')) {
|
if (parser.seenval('S')) {
|
||||||
const float spwr = parser.value_float();
|
const float spwr = parser.value_float();
|
||||||
|
#if ENABLED(SPINDLE_SERVO)
|
||||||
|
cutter.unitPower = spwr;
|
||||||
|
#else
|
||||||
cutter.unitPower = TERN(SPINDLE_LASER_PWM,
|
cutter.unitPower = TERN(SPINDLE_LASER_PWM,
|
||||||
cutter.power_to_range(cutter_power_t(round(spwr))),
|
cutter.power_to_range(cutter_power_t(round(spwr))),
|
||||||
spwr > 0 ? 255 : 0);
|
spwr > 0 ? 255 : 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cutter.unitPower = cutter.cpwr_to_upwr(SPEED_POWER_STARTUP);
|
cutter.unitPower = cutter.cpwr_to_upwr(SPEED_POWER_STARTUP);
|
||||||
|
|
@ -108,6 +112,8 @@ void GcodeSuite::M3_M4(const bool is_M4) {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cutter.set_power(cutter.upower_to_ocr(get_s_power()));
|
cutter.set_power(cutter.upower_to_ocr(get_s_power()));
|
||||||
|
#elif ENABLED(SPINDLE_SERVO)
|
||||||
|
cutter.set_power(get_s_power());
|
||||||
#else
|
#else
|
||||||
cutter.set_enabled(true);
|
cutter.set_enabled(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ void GcodeSuite::M81() {
|
||||||
#if HAS_SUICIDE
|
#if HAS_SUICIDE
|
||||||
suicide();
|
suicide();
|
||||||
#elif ENABLED(PSU_CONTROL)
|
#elif ENABLED(PSU_CONTROL)
|
||||||
PSU_OFF();
|
PSU_OFF_SOON();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " STR_OFF "."));
|
LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " STR_OFF "."));
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ void GcodeSuite::M600() {
|
||||||
// In this case, for duplicating modes set DXC_ext to the extruder that ran out.
|
// In this case, for duplicating modes set DXC_ext to the extruder that ran out.
|
||||||
#if HAS_FILAMENT_SENSOR && NUM_RUNOUT_SENSORS > 1
|
#if HAS_FILAMENT_SENSOR && NUM_RUNOUT_SENSORS > 1
|
||||||
if (idex_is_duplicating())
|
if (idex_is_duplicating())
|
||||||
DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_STATE) ? 1 : 0;
|
DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT2_STATE) ? 1 : 0;
|
||||||
#else
|
#else
|
||||||
DXC_ext = active_extruder;
|
DXC_ext = active_extruder;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -431,7 +431,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||||
case 28: M28(); break; // M28: Start SD write
|
case 28: M28(); break; // M28: Start SD write
|
||||||
case 29: M29(); break; // M29: Stop SD write
|
case 29: M29(); break; // M29: Stop SD write
|
||||||
case 30: M30(); break; // M30 <filename> Delete File
|
case 30: M30(); break; // M30 <filename> Delete File
|
||||||
|
|
||||||
|
#if HAS_MEDIA_SUBCALLS
|
||||||
case 32: M32(); break; // M32: Select file and start SD print
|
case 32: M32(); break; // M32: Select file and start SD print
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
|
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
|
||||||
case 33: M33(); break; // M33: Get the long full path to a file or folder
|
case 33: M33(); break; // M33: Get the long full path to a file or folder
|
||||||
|
|
|
||||||
|
|
@ -541,7 +541,7 @@ private:
|
||||||
static void M31();
|
static void M31();
|
||||||
|
|
||||||
#if ENABLED(SDSUPPORT)
|
#if ENABLED(SDSUPPORT)
|
||||||
static void M32();
|
TERN_(HAS_MEDIA_SUBCALLS, static void M32());
|
||||||
TERN_(LONG_FILENAME_HOST_SUPPORT, static void M33());
|
TERN_(LONG_FILENAME_HOST_SUPPORT, static void M33());
|
||||||
#if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
|
#if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
|
||||||
static void M34();
|
static void M34();
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,7 @@
|
||||||
size_t total = persistentStore.capacity();
|
size_t total = persistentStore.capacity();
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
const uint8_t value = 0x0;
|
const uint8_t value = 0x0;
|
||||||
while(total--) {
|
while (total--) persistentStore.write_data(pos, &value, 1);
|
||||||
persistentStore.write_data(pos, &value, 1);
|
|
||||||
}
|
|
||||||
persistentStore.access_finish();
|
persistentStore.access_finish();
|
||||||
#else
|
#else
|
||||||
settings.reset();
|
settings.reset();
|
||||||
|
|
@ -70,7 +68,7 @@
|
||||||
uint8_t *pointer = parser.hex_adr_val('A');
|
uint8_t *pointer = parser.hex_adr_val('A');
|
||||||
uint16_t len = parser.ushortval('C', 1);
|
uint16_t len = parser.ushortval('C', 1);
|
||||||
uintptr_t addr = (uintptr_t)pointer;
|
uintptr_t addr = (uintptr_t)pointer;
|
||||||
NOMORE(addr, (size_t)(SRAM_SIZE - 1));
|
NOMORE(addr, size_t(SRAM_SIZE - 1));
|
||||||
NOMORE(len, SRAM_SIZE - addr);
|
NOMORE(len, SRAM_SIZE - addr);
|
||||||
if (parser.seenval('X')) {
|
if (parser.seenval('X')) {
|
||||||
// Write the hex bytes after the X
|
// Write the hex bytes after the X
|
||||||
|
|
@ -91,11 +89,8 @@
|
||||||
uint8_t *pointer = parser.hex_adr_val('A');
|
uint8_t *pointer = parser.hex_adr_val('A');
|
||||||
uint16_t len = parser.ushortval('C', 1);
|
uint16_t len = parser.ushortval('C', 1);
|
||||||
uintptr_t addr = (uintptr_t)pointer;
|
uintptr_t addr = (uintptr_t)pointer;
|
||||||
#ifndef MARLIN_EEPROM_SIZE
|
NOMORE(addr, size_t(persistentStore.capacity() - 1));
|
||||||
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
|
NOMORE(len, persistentStore.capacity() - addr);
|
||||||
#endif
|
|
||||||
NOMORE(addr, (size_t)(MARLIN_EEPROM_SIZE - 1));
|
|
||||||
NOMORE(len, MARLIN_EEPROM_SIZE - addr);
|
|
||||||
if (parser.seenval('X')) {
|
if (parser.seenval('X')) {
|
||||||
uint16_t val = parser.hex_val('X');
|
uint16_t val = parser.hex_val('X');
|
||||||
#if ENABLED(EEPROM_SETTINGS)
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
|
|
@ -111,23 +106,18 @@
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
while (len--) {
|
|
||||||
// Read bytes from EEPROM
|
// Read bytes from EEPROM
|
||||||
#if ENABLED(EEPROM_SETTINGS)
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
persistentStore.access_start();
|
persistentStore.access_start();
|
||||||
uint8_t val;
|
|
||||||
while(len--) {
|
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
if (!persistentStore.read_data(pos, (uint8_t *)&val, sizeof(val))) {
|
uint8_t val;
|
||||||
print_hex_byte(val);
|
while (len--) if (!persistentStore.read_data(pos, &val, 1)) print_hex_byte(val);
|
||||||
}
|
|
||||||
}
|
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
persistentStore.access_finish();
|
persistentStore.access_finish();
|
||||||
#else
|
#else
|
||||||
SERIAL_ECHOLNPGM("NO EEPROM");
|
SERIAL_ECHOLNPGM("NO EEPROM");
|
||||||
|
len = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
@ -156,7 +146,7 @@
|
||||||
uint8_t *pointer = parser.hex_adr_val('A');
|
uint8_t *pointer = parser.hex_adr_val('A');
|
||||||
uint16_t len = parser.ushortval('C', 1);
|
uint16_t len = parser.ushortval('C', 1);
|
||||||
uintptr_t addr = (uintptr_t)pointer;
|
uintptr_t addr = (uintptr_t)pointer;
|
||||||
NOMORE(addr, (size_t)(FLASH_SIZE - 1));
|
NOMORE(addr, size_t(FLASH_SIZE - 1));
|
||||||
NOMORE(len, FLASH_SIZE - addr);
|
NOMORE(len, FLASH_SIZE - addr);
|
||||||
if (parser.seenval('X')) {
|
if (parser.seenval('X')) {
|
||||||
// TODO: Write the hex bytes after the X
|
// TODO: Write the hex bytes after the X
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(SDSUPPORT)
|
#if HAS_MEDIA_SUBCALLS
|
||||||
|
|
||||||
#include "../gcode.h"
|
#include "../gcode.h"
|
||||||
#include "../../sd/cardreader.h"
|
#include "../../sd/cardreader.h"
|
||||||
|
|
@ -56,4 +56,4 @@ void GcodeSuite::M32() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SDSUPPORT
|
#endif // HAS_MEDIA_SUBCALLS
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ void GcodeSuite::M104() {
|
||||||
* mode, for instance in a dual extruder setup, without affecting the running
|
* mode, for instance in a dual extruder setup, without affecting the running
|
||||||
* print timer.
|
* print timer.
|
||||||
*/
|
*/
|
||||||
thermalManager.check_timer_autostart(false, true);
|
thermalManager.auto_job_check_timer(false, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -182,7 +182,7 @@ void GcodeSuite::M109() {
|
||||||
* standby mode, (e.g., in a dual extruder setup) without affecting
|
* standby mode, (e.g., in a dual extruder setup) without affecting
|
||||||
* the running print timer.
|
* the running print timer.
|
||||||
*/
|
*/
|
||||||
thermalManager.check_timer_autostart(true, true);
|
thermalManager.auto_job_check_timer(true, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_DISPLAY
|
#if HAS_DISPLAY
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ void GcodeSuite::M140() {
|
||||||
* temperatures need to be set below mintemp. Order of M140, M104, and M141
|
* temperatures need to be set below mintemp. Order of M140, M104, and M141
|
||||||
* at the end of the print does not matter.
|
* at the end of the print does not matter.
|
||||||
*/
|
*/
|
||||||
thermalManager.check_timer_autostart(false, true);
|
thermalManager.auto_job_check_timer(false, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +128,7 @@ void GcodeSuite::M190() {
|
||||||
|
|
||||||
thermalManager.setTargetBed(temp);
|
thermalManager.setTargetBed(temp);
|
||||||
|
|
||||||
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false));
|
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(true, false));
|
||||||
|
|
||||||
ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING));
|
ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ void GcodeSuite::M141() {
|
||||||
* temperatures need to be set below mintemp. Order of M140, M104, and M141
|
* temperatures need to be set below mintemp. Order of M140, M104, and M141
|
||||||
* at the end of the print does not matter.
|
* at the end of the print does not matter.
|
||||||
*/
|
*/
|
||||||
thermalManager.check_timer_autostart(false, true);
|
thermalManager.auto_job_check_timer(false, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +75,7 @@ void GcodeSuite::M191() {
|
||||||
const bool no_wait_for_cooling = parser.seenval('S');
|
const bool no_wait_for_cooling = parser.seenval('S');
|
||||||
if (no_wait_for_cooling || parser.seenval('R')) {
|
if (no_wait_for_cooling || parser.seenval('R')) {
|
||||||
thermalManager.setTargetChamber(parser.value_celsius());
|
thermalManager.setTargetChamber(parser.value_celsius());
|
||||||
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false));
|
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(true, false));
|
||||||
}
|
}
|
||||||
else return;
|
else return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@
|
||||||
#define BOARD_ST7920_DELAY_2 DELAY_NS(125)
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125)
|
||||||
#define BOARD_ST7920_DELAY_3 DELAY_NS(125)
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(125)
|
||||||
|
|
||||||
#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD, BQ_LCD_SMART_CONTROLLER)
|
#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING, BQ_LCD_SMART_CONTROLLER)
|
||||||
|
|
||||||
#define IS_RRD_FG_SC 1
|
#define IS_RRD_FG_SC 1
|
||||||
|
|
||||||
|
|
@ -675,6 +675,77 @@
|
||||||
#define HAS_BED_PROBE 1
|
#define HAS_BED_PROBE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 1
|
||||||
|
#ifndef FIL_RUNOUT1_STATE
|
||||||
|
#define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE
|
||||||
|
#endif
|
||||||
|
#ifndef FIL_RUNOUT1_PULL
|
||||||
|
#define FIL_RUNOUT1_PULL FIL_RUNOUT_PULL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 2
|
||||||
|
#ifndef FIL_RUNOUT2_STATE
|
||||||
|
#define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE
|
||||||
|
#endif
|
||||||
|
#ifndef FIL_RUNOUT2_PULL
|
||||||
|
#define FIL_RUNOUT2_PULL FIL_RUNOUT_PULL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 3
|
||||||
|
#ifndef FIL_RUNOUT3_STATE
|
||||||
|
#define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE
|
||||||
|
#endif
|
||||||
|
#ifndef FIL_RUNOUT3_PULL
|
||||||
|
#define FIL_RUNOUT3_PULL FIL_RUNOUT_PULL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 4
|
||||||
|
#ifndef FIL_RUNOUT4_STATE
|
||||||
|
#define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE
|
||||||
|
#endif
|
||||||
|
#ifndef FIL_RUNOUT4_PULL
|
||||||
|
#define FIL_RUNOUT4_PULL FIL_RUNOUT_PULL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 5
|
||||||
|
#ifndef FIL_RUNOUT5_STATE
|
||||||
|
#define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE
|
||||||
|
#endif
|
||||||
|
#ifndef FIL_RUNOUT5_PULL
|
||||||
|
#define FIL_RUNOUT5_PULL FIL_RUNOUT_PULL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 6
|
||||||
|
#ifndef FIL_RUNOUT6_STATE
|
||||||
|
#define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE
|
||||||
|
#endif
|
||||||
|
#ifndef FIL_RUNOUT6_PULL
|
||||||
|
#define FIL_RUNOUT6_PULL FIL_RUNOUT_PULL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 7
|
||||||
|
#ifndef FIL_RUNOUT7_STATE
|
||||||
|
#define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE
|
||||||
|
#endif
|
||||||
|
#ifndef FIL_RUNOUT7_PULL
|
||||||
|
#define FIL_RUNOUT7_PULL FIL_RUNOUT_PULL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if NUM_RUNOUT_SENSORS >= 8
|
||||||
|
#ifndef FIL_RUNOUT8_STATE
|
||||||
|
#define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE
|
||||||
|
#endif
|
||||||
|
#ifndef FIL_RUNOUT8_PULL
|
||||||
|
#define FIL_RUNOUT8_PULL FIL_RUNOUT_PULL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif // FILAMENT_RUNOUT_SENSOR
|
||||||
|
|
||||||
|
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
|
||||||
|
#undef PROBE_MANUALLY
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ANY(HAS_BED_PROBE, PROBE_MANUALLY, MESH_BED_LEVELING)
|
#if ANY(HAS_BED_PROBE, PROBE_MANUALLY, MESH_BED_LEVELING)
|
||||||
#define PROBE_SELECTED 1
|
#define PROBE_SELECTED 1
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -707,6 +778,10 @@
|
||||||
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if Z_HOME_DIR > 0
|
||||||
|
#define HOME_Z_FIRST // If homing away from BED do Z first
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set granular options based on the specific type of leveling
|
* Set granular options based on the specific type of leveling
|
||||||
*/
|
*/
|
||||||
|
|
@ -747,6 +822,7 @@
|
||||||
#define HAS_PROBING_PROCEDURE 1
|
#define HAS_PROBING_PROCEDURE 1
|
||||||
#endif
|
#endif
|
||||||
#if !HAS_LEVELING
|
#if !HAS_LEVELING
|
||||||
|
#undef PROBE_MANUALLY
|
||||||
#undef RESTORE_LEVELING_AFTER_G28
|
#undef RESTORE_LEVELING_AFTER_G28
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
// Determine NUM_SERVOS if none was supplied
|
// Determine NUM_SERVOS if none was supplied
|
||||||
#ifndef NUM_SERVOS
|
#ifndef NUM_SERVOS
|
||||||
#define NUM_SERVOS 0
|
#define NUM_SERVOS 0
|
||||||
#if ANY(CHAMBER_VENT, HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
|
#if ANY(HAS_Z_SERVO_PROBE, CHAMBER_VENT, SWITCHING_TOOLHEAD, SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SPINDLE_SERVO)
|
||||||
#if NUM_SERVOS <= Z_PROBE_SERVO_NR
|
#if NUM_SERVOS <= Z_PROBE_SERVO_NR
|
||||||
#undef NUM_SERVOS
|
#undef NUM_SERVOS
|
||||||
#define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
|
#define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
|
||||||
|
|
@ -62,6 +62,10 @@
|
||||||
#undef NUM_SERVOS
|
#undef NUM_SERVOS
|
||||||
#define NUM_SERVOS (SWITCHING_EXTRUDER_E23_SERVO_NR + 1)
|
#define NUM_SERVOS (SWITCHING_EXTRUDER_E23_SERVO_NR + 1)
|
||||||
#endif
|
#endif
|
||||||
|
#if NUM_SERVOS <= SPINDLE_SERVO_NR
|
||||||
|
#undef NUM_SERVOS
|
||||||
|
#define NUM_SERVOS (SPINDLE_SERVO_NR + 1)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -142,6 +146,10 @@
|
||||||
#define HAS_PRINT_PROGRESS 1
|
#define HAS_PRINT_PROGRESS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(SDSUPPORT) && SD_PROCEDURE_DEPTH
|
||||||
|
#define HAS_MEDIA_SUBCALLS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)
|
#if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)
|
||||||
#define HAS_PRINT_PROGRESS_PERMYRIAD 1
|
#define HAS_PRINT_PROGRESS_PERMYRIAD 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -416,9 +416,14 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(PSU_POWERUP_DELAY) && ENABLED(PSU_CONTROL)
|
#if ENABLED(PSU_CONTROL)
|
||||||
|
#ifndef PSU_POWERUP_DELAY
|
||||||
#define PSU_POWERUP_DELAY 250
|
#define PSU_POWERUP_DELAY 250
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef POWER_OFF_DELAY
|
||||||
|
#define POWER_OFF_DELAY 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Temp Sensor defines
|
* Temp Sensor defines
|
||||||
|
|
@ -431,7 +436,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2
|
#if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2
|
||||||
#define HEATER_0_USES_MAX6675
|
#define HEATER_0_USES_MAX6675 1
|
||||||
#if TEMP_SENSOR_0 == -3
|
#if TEMP_SENSOR_0 == -3
|
||||||
#define HEATER_0_MAX6675_TMIN -270
|
#define HEATER_0_MAX6675_TMIN -270
|
||||||
#define HEATER_0_MAX6675_TMAX 1800
|
#define HEATER_0_MAX6675_TMAX 1800
|
||||||
|
|
@ -440,19 +445,19 @@
|
||||||
#define HEATER_0_MAX6675_TMAX 1024
|
#define HEATER_0_MAX6675_TMAX 1024
|
||||||
#endif
|
#endif
|
||||||
#if TEMP_SENSOR_0 == -5
|
#if TEMP_SENSOR_0 == -5
|
||||||
#define MAX6675_IS_MAX31865
|
#define MAX6675_0_IS_MAX31865 1
|
||||||
#elif TEMP_SENSOR_0 == -3
|
#elif TEMP_SENSOR_0 == -3
|
||||||
#define MAX6675_IS_MAX31855
|
#define MAX6675_0_IS_MAX31855 1
|
||||||
#endif
|
#endif
|
||||||
#elif TEMP_SENSOR_0 == -4
|
#elif TEMP_SENSOR_0 == -4
|
||||||
#define HEATER_0_USES_AD8495
|
#define HEATER_0_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_0 == -1
|
#elif TEMP_SENSOR_0 == -1
|
||||||
#define HEATER_0_USES_AD595
|
#define HEATER_0_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_0 > 0
|
#elif TEMP_SENSOR_0 > 0
|
||||||
#define THERMISTOR_HEATER_0 TEMP_SENSOR_0
|
#define THERMISTOR_HEATER_0 TEMP_SENSOR_0
|
||||||
#define HEATER_0_USES_THERMISTOR
|
#define HEATER_0_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_0 == 1000
|
#if TEMP_SENSOR_0 == 1000
|
||||||
#define HEATER_0_USER_THERMISTOR
|
#define HEATER_0_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef HEATER_0_MINTEMP
|
#undef HEATER_0_MINTEMP
|
||||||
|
|
@ -460,7 +465,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_1 == -5 || TEMP_SENSOR_1 == -3 || TEMP_SENSOR_1 == -2
|
#if TEMP_SENSOR_1 == -5 || TEMP_SENSOR_1 == -3 || TEMP_SENSOR_1 == -2
|
||||||
#define HEATER_1_USES_MAX6675
|
#define HEATER_1_USES_MAX6675 1
|
||||||
#if TEMP_SENSOR_1 == -3
|
#if TEMP_SENSOR_1 == -3
|
||||||
#define HEATER_1_MAX6675_TMIN -270
|
#define HEATER_1_MAX6675_TMIN -270
|
||||||
#define HEATER_1_MAX6675_TMAX 1800
|
#define HEATER_1_MAX6675_TMAX 1800
|
||||||
|
|
@ -468,6 +473,11 @@
|
||||||
#define HEATER_1_MAX6675_TMIN 0
|
#define HEATER_1_MAX6675_TMIN 0
|
||||||
#define HEATER_1_MAX6675_TMAX 1024
|
#define HEATER_1_MAX6675_TMAX 1024
|
||||||
#endif
|
#endif
|
||||||
|
#if TEMP_SENSOR_1 == -5
|
||||||
|
#define MAX6675_1_IS_MAX31865 1
|
||||||
|
#elif TEMP_SENSOR_1 == -3
|
||||||
|
#define MAX6675_1_IS_MAX31855 1
|
||||||
|
#endif
|
||||||
#if TEMP_SENSOR_1 != TEMP_SENSOR_0
|
#if TEMP_SENSOR_1 != TEMP_SENSOR_0
|
||||||
#if TEMP_SENSOR_1 == -5
|
#if TEMP_SENSOR_1 == -5
|
||||||
#error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match."
|
#error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match."
|
||||||
|
|
@ -478,14 +488,14 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#elif TEMP_SENSOR_1 == -4
|
#elif TEMP_SENSOR_1 == -4
|
||||||
#define HEATER_1_USES_AD8495
|
#define HEATER_1_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_1 == -1
|
#elif TEMP_SENSOR_1 == -1
|
||||||
#define HEATER_1_USES_AD595
|
#define HEATER_1_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_1 > 0
|
#elif TEMP_SENSOR_1 > 0
|
||||||
#define THERMISTOR_HEATER_1 TEMP_SENSOR_1
|
#define THERMISTOR_HEATER_1 TEMP_SENSOR_1
|
||||||
#define HEATER_1_USES_THERMISTOR
|
#define HEATER_1_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_1 == 1000
|
#if TEMP_SENSOR_1 == 1000
|
||||||
#define HEATER_1_USER_THERMISTOR
|
#define HEATER_1_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef HEATER_1_MINTEMP
|
#undef HEATER_1_MINTEMP
|
||||||
|
|
@ -493,18 +503,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_2 == -4
|
#if TEMP_SENSOR_2 == -4
|
||||||
#define HEATER_2_USES_AD8495
|
#define HEATER_2_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_2 == -3
|
#elif TEMP_SENSOR_2 == -3
|
||||||
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2."
|
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2."
|
||||||
#elif TEMP_SENSOR_2 == -2
|
#elif TEMP_SENSOR_2 == -2
|
||||||
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2."
|
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2."
|
||||||
#elif TEMP_SENSOR_2 == -1
|
#elif TEMP_SENSOR_2 == -1
|
||||||
#define HEATER_2_USES_AD595
|
#define HEATER_2_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_2 > 0
|
#elif TEMP_SENSOR_2 > 0
|
||||||
#define THERMISTOR_HEATER_2 TEMP_SENSOR_2
|
#define THERMISTOR_HEATER_2 TEMP_SENSOR_2
|
||||||
#define HEATER_2_USES_THERMISTOR
|
#define HEATER_2_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_2 == 1000
|
#if TEMP_SENSOR_2 == 1000
|
||||||
#define HEATER_2_USER_THERMISTOR
|
#define HEATER_2_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef HEATER_2_MINTEMP
|
#undef HEATER_2_MINTEMP
|
||||||
|
|
@ -512,18 +522,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_3 == -4
|
#if TEMP_SENSOR_3 == -4
|
||||||
#define HEATER_3_USES_AD8495
|
#define HEATER_3_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_3 == -3
|
#elif TEMP_SENSOR_3 == -3
|
||||||
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3."
|
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3."
|
||||||
#elif TEMP_SENSOR_3 == -2
|
#elif TEMP_SENSOR_3 == -2
|
||||||
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3."
|
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3."
|
||||||
#elif TEMP_SENSOR_3 == -1
|
#elif TEMP_SENSOR_3 == -1
|
||||||
#define HEATER_3_USES_AD595
|
#define HEATER_3_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_3 > 0
|
#elif TEMP_SENSOR_3 > 0
|
||||||
#define THERMISTOR_HEATER_3 TEMP_SENSOR_3
|
#define THERMISTOR_HEATER_3 TEMP_SENSOR_3
|
||||||
#define HEATER_3_USES_THERMISTOR
|
#define HEATER_3_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_3 == 1000
|
#if TEMP_SENSOR_3 == 1000
|
||||||
#define HEATER_3_USER_THERMISTOR
|
#define HEATER_3_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef HEATER_3_MINTEMP
|
#undef HEATER_3_MINTEMP
|
||||||
|
|
@ -531,18 +541,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_4 == -4
|
#if TEMP_SENSOR_4 == -4
|
||||||
#define HEATER_4_USES_AD8495
|
#define HEATER_4_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_4 == -3
|
#elif TEMP_SENSOR_4 == -3
|
||||||
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4."
|
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4."
|
||||||
#elif TEMP_SENSOR_4 == -2
|
#elif TEMP_SENSOR_4 == -2
|
||||||
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4."
|
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4."
|
||||||
#elif TEMP_SENSOR_4 == -1
|
#elif TEMP_SENSOR_4 == -1
|
||||||
#define HEATER_4_USES_AD595
|
#define HEATER_4_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_4 > 0
|
#elif TEMP_SENSOR_4 > 0
|
||||||
#define THERMISTOR_HEATER_4 TEMP_SENSOR_4
|
#define THERMISTOR_HEATER_4 TEMP_SENSOR_4
|
||||||
#define HEATER_4_USES_THERMISTOR
|
#define HEATER_4_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_4 == 1000
|
#if TEMP_SENSOR_4 == 1000
|
||||||
#define HEATER_4_USER_THERMISTOR
|
#define HEATER_4_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef HEATER_4_MINTEMP
|
#undef HEATER_4_MINTEMP
|
||||||
|
|
@ -550,18 +560,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_5 == -4
|
#if TEMP_SENSOR_5 == -4
|
||||||
#define HEATER_5_USES_AD8495
|
#define HEATER_5_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_5 == -3
|
#elif TEMP_SENSOR_5 == -3
|
||||||
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5."
|
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5."
|
||||||
#elif TEMP_SENSOR_5 == -2
|
#elif TEMP_SENSOR_5 == -2
|
||||||
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5."
|
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5."
|
||||||
#elif TEMP_SENSOR_5 == -1
|
#elif TEMP_SENSOR_5 == -1
|
||||||
#define HEATER_5_USES_AD595
|
#define HEATER_5_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_5 > 0
|
#elif TEMP_SENSOR_5 > 0
|
||||||
#define THERMISTOR_HEATER_5 TEMP_SENSOR_5
|
#define THERMISTOR_HEATER_5 TEMP_SENSOR_5
|
||||||
#define HEATER_5_USES_THERMISTOR
|
#define HEATER_5_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_5 == 1000
|
#if TEMP_SENSOR_5 == 1000
|
||||||
#define HEATER_5_USER_THERMISTOR
|
#define HEATER_5_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef HEATER_5_MINTEMP
|
#undef HEATER_5_MINTEMP
|
||||||
|
|
@ -569,18 +579,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_6 == -4
|
#if TEMP_SENSOR_6 == -4
|
||||||
#define HEATER_6_USES_AD8495
|
#define HEATER_6_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_6 == -3
|
#elif TEMP_SENSOR_6 == -3
|
||||||
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6."
|
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6."
|
||||||
#elif TEMP_SENSOR_6 == -2
|
#elif TEMP_SENSOR_6 == -2
|
||||||
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6."
|
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6."
|
||||||
#elif TEMP_SENSOR_6 == -1
|
#elif TEMP_SENSOR_6 == -1
|
||||||
#define HEATER_6_USES_AD595
|
#define HEATER_6_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_6 > 0
|
#elif TEMP_SENSOR_6 > 0
|
||||||
#define THERMISTOR_HEATER_6 TEMP_SENSOR_6
|
#define THERMISTOR_HEATER_6 TEMP_SENSOR_6
|
||||||
#define HEATER_6_USES_THERMISTOR
|
#define HEATER_6_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_6 == 1000
|
#if TEMP_SENSOR_6 == 1000
|
||||||
#define HEATER_6_USER_THERMISTOR
|
#define HEATER_6_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef HEATER_6_MINTEMP
|
#undef HEATER_6_MINTEMP
|
||||||
|
|
@ -588,18 +598,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_7 == -4
|
#if TEMP_SENSOR_7 == -4
|
||||||
#define HEATER_7_USES_AD8495
|
#define HEATER_7_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_7 == -3
|
#elif TEMP_SENSOR_7 == -3
|
||||||
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7."
|
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7."
|
||||||
#elif TEMP_SENSOR_7 == -2
|
#elif TEMP_SENSOR_7 == -2
|
||||||
#error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7."
|
#error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7."
|
||||||
#elif TEMP_SENSOR_7 == -1
|
#elif TEMP_SENSOR_7 == -1
|
||||||
#define HEATER_7_USES_AD595
|
#define HEATER_7_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_7 > 0
|
#elif TEMP_SENSOR_7 > 0
|
||||||
#define THERMISTOR_HEATER_7 TEMP_SENSOR_7
|
#define THERMISTOR_HEATER_7 TEMP_SENSOR_7
|
||||||
#define HEATER_7_USES_THERMISTOR
|
#define HEATER_7_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_7 == 1000
|
#if TEMP_SENSOR_7 == 1000
|
||||||
#define HEATER_7_USER_THERMISTOR
|
#define HEATER_7_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef HEATER_7_MINTEMP
|
#undef HEATER_7_MINTEMP
|
||||||
|
|
@ -607,18 +617,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_BED == -4
|
#if TEMP_SENSOR_BED == -4
|
||||||
#define HEATER_BED_USES_AD8495
|
#define HEATER_BED_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_BED == -3
|
#elif TEMP_SENSOR_BED == -3
|
||||||
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED."
|
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED."
|
||||||
#elif TEMP_SENSOR_BED == -2
|
#elif TEMP_SENSOR_BED == -2
|
||||||
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED."
|
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED."
|
||||||
#elif TEMP_SENSOR_BED == -1
|
#elif TEMP_SENSOR_BED == -1
|
||||||
#define HEATER_BED_USES_AD595
|
#define HEATER_BED_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_BED > 0
|
#elif TEMP_SENSOR_BED > 0
|
||||||
#define THERMISTORBED TEMP_SENSOR_BED
|
#define THERMISTORBED TEMP_SENSOR_BED
|
||||||
#define HEATER_BED_USES_THERMISTOR
|
#define HEATER_BED_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_BED == 1000
|
#if TEMP_SENSOR_BED == 1000
|
||||||
#define HEATER_BED_USER_THERMISTOR
|
#define HEATER_BED_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef BED_MINTEMP
|
#undef BED_MINTEMP
|
||||||
|
|
@ -626,18 +636,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_CHAMBER == -4
|
#if TEMP_SENSOR_CHAMBER == -4
|
||||||
#define HEATER_CHAMBER_USES_AD8495
|
#define HEATER_CHAMBER_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_CHAMBER == -3
|
#elif TEMP_SENSOR_CHAMBER == -3
|
||||||
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER."
|
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER."
|
||||||
#elif TEMP_SENSOR_CHAMBER == -2
|
#elif TEMP_SENSOR_CHAMBER == -2
|
||||||
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER."
|
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER."
|
||||||
#elif TEMP_SENSOR_CHAMBER == -1
|
#elif TEMP_SENSOR_CHAMBER == -1
|
||||||
#define HEATER_CHAMBER_USES_AD595
|
#define HEATER_CHAMBER_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_CHAMBER > 0
|
#elif TEMP_SENSOR_CHAMBER > 0
|
||||||
#define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER
|
#define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER
|
||||||
#define HEATER_CHAMBER_USES_THERMISTOR
|
#define HEATER_CHAMBER_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_CHAMBER == 1000
|
#if TEMP_SENSOR_CHAMBER == 1000
|
||||||
#define HEATER_CHAMBER_USER_THERMISTOR
|
#define HEATER_CHAMBER_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#undef CHAMBER_MINTEMP
|
#undef CHAMBER_MINTEMP
|
||||||
|
|
@ -645,25 +655,21 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEMP_SENSOR_PROBE == -4
|
#if TEMP_SENSOR_PROBE == -4
|
||||||
#define HEATER_PROBE_USES_AD8495
|
#define HEATER_PROBE_USES_AD8495 1
|
||||||
#elif TEMP_SENSOR_PROBE == -3
|
#elif TEMP_SENSOR_PROBE == -3
|
||||||
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_PROBE."
|
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_PROBE."
|
||||||
#elif TEMP_SENSOR_PROBE == -2
|
#elif TEMP_SENSOR_PROBE == -2
|
||||||
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE."
|
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE."
|
||||||
#elif TEMP_SENSOR_PROBE == -1
|
#elif TEMP_SENSOR_PROBE == -1
|
||||||
#define HEATER_PROBE_USES_AD595
|
#define HEATER_PROBE_USES_AD595 1
|
||||||
#elif TEMP_SENSOR_PROBE > 0
|
#elif TEMP_SENSOR_PROBE > 0
|
||||||
#define THERMISTORPROBE TEMP_SENSOR_PROBE
|
#define THERMISTORPROBE TEMP_SENSOR_PROBE
|
||||||
#define PROBE_USES_THERMISTOR
|
#define HEATER_PROBE_USES_THERMISTOR 1
|
||||||
#if TEMP_SENSOR_PROBE == 1000
|
#if TEMP_SENSOR_PROBE == 1000
|
||||||
#define PROBE_USER_THERMISTOR
|
#define HEATER_PROBE_USER_THERMISTOR 1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HOTEND_USES_THERMISTOR ANY( \
|
|
||||||
HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, \
|
|
||||||
HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR, HEATER_6_USES_THERMISTOR, HEATER_7_USES_THERMISTOR )
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* X_DUAL_ENDSTOPS endstop reassignment
|
* X_DUAL_ENDSTOPS endstop reassignment
|
||||||
*/
|
*/
|
||||||
|
|
@ -2505,11 +2511,11 @@
|
||||||
/**
|
/**
|
||||||
* Buzzer/Speaker
|
* Buzzer/Speaker
|
||||||
*/
|
*/
|
||||||
#if PIN_EXISTS(BEEPER) || ANY(LCD_USE_I2C_BUZZER, PCA9632_BUZZER)
|
|
||||||
#define HAS_BUZZER 1
|
|
||||||
#if PIN_EXISTS(BEEPER)
|
#if PIN_EXISTS(BEEPER)
|
||||||
#define USE_BEEPER 1
|
#define USE_BEEPER 1
|
||||||
#endif
|
#endif
|
||||||
|
#if USE_BEEPER || ANY(LCD_USE_I2C_BUZZER, PCA9632_BUZZER)
|
||||||
|
#define HAS_BUZZER 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(LCD_USE_I2C_BUZZER)
|
#if ENABLED(LCD_USE_I2C_BUZZER)
|
||||||
|
|
@ -2528,9 +2534,13 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_BUZZER && LCD_FEEDBACK_FREQUENCY_DURATION_MS && LCD_FEEDBACK_FREQUENCY_HZ
|
#if HAS_BUZZER
|
||||||
|
#if LCD_FEEDBACK_FREQUENCY_DURATION_MS && LCD_FEEDBACK_FREQUENCY_HZ
|
||||||
#define HAS_CHIRP 1
|
#define HAS_CHIRP 1
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
#undef SOUND_MENU_ITEM // No buzzer menu item without a buzzer
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make sure DOGLCD_SCK and DOGLCD_MOSI are defined.
|
* Make sure DOGLCD_SCK and DOGLCD_MOSI are defined.
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -42,7 +42,7 @@
|
||||||
* version was tagged.
|
* version was tagged.
|
||||||
*/
|
*/
|
||||||
#ifndef STRING_DISTRIBUTION_DATE
|
#ifndef STRING_DISTRIBUTION_DATE
|
||||||
#define STRING_DISTRIBUTION_DATE "2020-10-25"
|
#define STRING_DISTRIBUTION_DATE "2020-11-12"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue