Bump to head plus G34 auto assignment
This commit is contained in:
+3
-1
@@ -1 +1,3 @@
|
||||
custom: http://www.thinkyhead.com/donate-to-marlin
|
||||
github: [thinkyhead]
|
||||
patreon: thinkyhead
|
||||
custom: ["http://www.thinkyhead.com/donate-to-marlin"]
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#
|
||||
# bump-date.yml
|
||||
# Bump the distribution date once per day
|
||||
#
|
||||
|
||||
name: Bump Distribution Date
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
bump_date:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Check out bugfix-2.0.x
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: bugfix-2.0.x
|
||||
|
||||
- name: Bump Distribution Date
|
||||
run: |
|
||||
# Inline Bump Script
|
||||
[[ "$GITHUB_ACTOR" == 'MarlinFirmware' ]] || exit 0
|
||||
DIST=$( date +"%Y-%m-%d" )
|
||||
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
|
||||
git config user.name "${GITHUB_ACTOR}" && \
|
||||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
|
||||
git add . && \
|
||||
git commit -m "[cron] Bump distribution date ($DIST)" && \
|
||||
git push
|
||||
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# check-pr.yml
|
||||
# Automatically close the PR if it's directed to a release branch
|
||||
#
|
||||
|
||||
name: Check PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 1.0.x
|
||||
- 1.1.x
|
||||
- 2.0.x
|
||||
|
||||
jobs:
|
||||
check_pr:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Comment on PR
|
||||
uses: unsplash/comment-on-pr@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
msg: "<p>Thanks for your contribution! \
|
||||
Unfortunately we can't accept PRs directed at release branches. \
|
||||
We make patches to the bugfix branches and only later do we push them out as releases. \
|
||||
Please redo this PR starting with the `bugfix-2.0.x` branch and be careful to target `bugfix-2.0.x` when resubmitting the PR.</p> \
|
||||
<p>It may help to set your fork's default branch to `bugfix-2.0.x`.</p> \
|
||||
<p>See <a href='http://marlinfw.org/docs/development/getting_started_pull_requests.html' target='_blank'>this page</a> for full instructions.</p>"
|
||||
@@ -0,0 +1,102 @@
|
||||
#
|
||||
# test-builds.yml
|
||||
# Do test builds to catch compile errors
|
||||
#
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- bugfix-2.0.x
|
||||
- dev-2.1.x
|
||||
paths-ignore:
|
||||
- config/**
|
||||
- data/**
|
||||
- docs/**
|
||||
- '**/*.md'
|
||||
|
||||
jobs:
|
||||
test_builds:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
test-platform:
|
||||
# Base Environments
|
||||
|
||||
- DUE
|
||||
- esp32
|
||||
- linux_native
|
||||
- megaatmega2560
|
||||
- teensy31
|
||||
- teensy35
|
||||
|
||||
# Extended AVR Environments
|
||||
|
||||
- FYSETC_F6_13
|
||||
- megaatmega1280
|
||||
- rambo
|
||||
- sanguino_atmega1284p
|
||||
- sanguino_atmega644p
|
||||
|
||||
# Extended STM32 Environments
|
||||
|
||||
- STM32F103RC_bigtree
|
||||
- STM32F103RC_bigtree_USB
|
||||
- STM32F103RE_bigtree
|
||||
- STM32F103RE_bigtree_USB
|
||||
- STM32F103RC_fysetc
|
||||
- jgaurora_a5s_a1
|
||||
- STM32F103VE_longer
|
||||
- STM32F407VE_black
|
||||
- BIGTREE_SKR_PRO
|
||||
- mks_robin
|
||||
- ARMED
|
||||
|
||||
# Put lengthy tests last
|
||||
|
||||
- LPC1768
|
||||
- LPC1769
|
||||
|
||||
# STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working.
|
||||
|
||||
#- STM32F4
|
||||
#- STM32F7
|
||||
|
||||
# Non-working environment tests
|
||||
|
||||
#- BIGTREE_BTT002
|
||||
#- at90usb1286_cdc
|
||||
#- at90usb1286_dfu
|
||||
#- STM32F103CB_malyan
|
||||
#- mks_robin_lite
|
||||
#- mks_robin_mini
|
||||
#- mks_robin_nano
|
||||
#- SAMD51_grandcentral_m4
|
||||
|
||||
steps:
|
||||
|
||||
- name: Select Python 3.7
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax.
|
||||
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
pip install -U https://github.com/platformio/platformio-core/archive/master.zip
|
||||
platformio update
|
||||
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run ${{ matrix.test-platform }} Tests
|
||||
run: |
|
||||
# Inline tests script
|
||||
[[ "$GITHUB_ACTOR" == 'MarlinFirmware' ]] || exit 0
|
||||
chmod +x buildroot/bin/*
|
||||
chmod +x buildroot/share/tests/*
|
||||
export PATH=./buildroot/bin/:./buildroot/share/tests/:${PATH}
|
||||
run_tests . ${{ matrix.test-platform }}
|
||||
+22
-8
@@ -339,9 +339,9 @@
|
||||
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
|
||||
//#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power
|
||||
|
||||
//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
|
||||
//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
|
||||
#if ENABLED(AUTO_POWER_CONTROL)
|
||||
#define AUTO_POWER_FANS // Turn on PSU if fans need power
|
||||
#define AUTO_POWER_FANS // Turn on PSU if fans need power
|
||||
#define AUTO_POWER_E_FANS
|
||||
#define AUTO_POWER_CONTROLLERFAN
|
||||
#define AUTO_POWER_CHAMBER_FAN
|
||||
@@ -895,6 +895,12 @@
|
||||
*/
|
||||
//#define FIX_MOUNTED_PROBE
|
||||
|
||||
/**
|
||||
* Use the nozzle as the probe, as with a conductive
|
||||
* nozzle system or a piezo-electric smart effector.
|
||||
*/
|
||||
//#define NOZZLE_AS_PROBE
|
||||
|
||||
/**
|
||||
* Z Servo Probe, such as an endstop switch on a rotating arm.
|
||||
*/
|
||||
@@ -964,8 +970,9 @@
|
||||
*/
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 28, -33, 0 }
|
||||
|
||||
// Certain types of probes need to stay away from edges
|
||||
#define MIN_PROBE_EDGE 10
|
||||
// Most probes should stay away from the edges of the bed, but
|
||||
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
|
||||
#define MIN_PROBE_EDGE 5
|
||||
|
||||
// X and Y axis travel speed (mm/m) between probes
|
||||
#define XY_PROBE_SPEED 5000
|
||||
@@ -1844,7 +1851,7 @@
|
||||
|
||||
//
|
||||
// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller
|
||||
// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html
|
||||
// https://www.aliexpress.com/item/32765887917.html
|
||||
//
|
||||
//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602
|
||||
|
||||
@@ -2020,13 +2027,18 @@
|
||||
|
||||
//
|
||||
// Factory display for Creality CR-10
|
||||
// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html
|
||||
// https://www.aliexpress.com/item/32833148327.html
|
||||
//
|
||||
// This is RAMPS-compatible using a single 10-pin connector.
|
||||
// (For CR-10 owners who want to replace the Melzi Creality board but retain the display)
|
||||
//
|
||||
//#define CR10_STOCKDISPLAY
|
||||
|
||||
//
|
||||
// Ender-2 OEM display, a variant of the MKS_MINI_12864
|
||||
//
|
||||
//#define ENDER2_STOCKDISPLAY
|
||||
|
||||
//
|
||||
// ANET and Tronxy Graphical Controller
|
||||
//
|
||||
@@ -2095,9 +2107,11 @@
|
||||
//=============================================================================
|
||||
|
||||
//
|
||||
// DGUS Touch Display with DWIN OS
|
||||
// DGUS Touch Display with DWIN OS. (Choose one.)
|
||||
//
|
||||
//#define DGUS_LCD
|
||||
//#define DGUS_LCD_UI_ORIGIN
|
||||
//#define DGUS_LCD_UI_FYSETC
|
||||
//#define DGUS_LCD_UI_HIPRECY
|
||||
|
||||
//
|
||||
// Touch-screen LCD for Malyan M200 printers
|
||||
|
||||
+71
-16
@@ -658,7 +658,21 @@
|
||||
#endif
|
||||
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
|
||||
// Define probe X and Y positions for Z1, Z2 [, Z3]
|
||||
#define Z_STEPPER_ALIGN_XY { { 270, 150 }, { 30, 150 } }
|
||||
// If not defined, probe limits will be used.
|
||||
//#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
|
||||
|
||||
/**
|
||||
* Rotrate automatically calulated positions clockwise
|
||||
* For 2 point
|
||||
* Enabled and not 0 rotates to X center and Y edges
|
||||
*
|
||||
* For 3 point
|
||||
* 0 or Undefined sets Point 1 Front Left
|
||||
* 1 sets Point 1 Rear left
|
||||
* 2 sets Point 1 Rear Right
|
||||
* 3 sets Point 1 Front Right
|
||||
*/
|
||||
//#define Z_STEPPER_ALIGN_ROTATE 0
|
||||
|
||||
// Provide Z stepper positions for more rapid convergence in bed alignment.
|
||||
// Currently requires triple stepper drivers.
|
||||
@@ -676,7 +690,7 @@
|
||||
#endif
|
||||
|
||||
// Set number of iterations to align
|
||||
#define Z_STEPPER_ALIGN_ITERATIONS 3
|
||||
#define Z_STEPPER_ALIGN_ITERATIONS 5
|
||||
|
||||
// Enable to restore leveling setup after operation
|
||||
#define RESTORE_LEVELING_AFTER_G34
|
||||
@@ -991,7 +1005,7 @@
|
||||
#define SD_DETECT_INVERTED
|
||||
|
||||
#define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished
|
||||
#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the Z enabled so your bed stays in place.
|
||||
#define SD_FINISHED_RELEASECOMMAND "G1 X0 Y250\nM84" // You might want to keep the Z enabled so your bed stays in place.
|
||||
|
||||
// Reverse SD sort to show "more recent" files first, according to the card's FAT.
|
||||
// Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended.
|
||||
@@ -1246,6 +1260,44 @@
|
||||
|
||||
#endif // HAS_GRAPHICAL_LCD
|
||||
|
||||
//
|
||||
// Additional options for DGUS / DWIN displays
|
||||
//
|
||||
#if HAS_DGUS_LCD
|
||||
#define DGUS_SERIAL_PORT 2
|
||||
#define DGUS_BAUDRATE 115200
|
||||
|
||||
#define DGUS_RX_BUFFER_SIZE 128
|
||||
#define DGUS_TX_BUFFER_SIZE 48
|
||||
//#define DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS // Fix Rx overrun situation (Currently only for AVR)
|
||||
|
||||
#define DGUS_UPDATE_INTERVAL_MS 500 // (ms) Interval between automatic screen updates
|
||||
#define BOOTSCREEN_TIMEOUT 3000 // (ms) Duration to display the boot screen
|
||||
|
||||
#if EITHER(DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY)
|
||||
#define DGUS_PRINT_FILENAME // Display the filename during printing
|
||||
#define DGUS_PREHEAT_UI // Display a preheat screen during heatup
|
||||
|
||||
#if ENABLED(DGUS_LCD_UI_FYSETC)
|
||||
//#define DUGS_UI_MOVE_DIS_OPTION // Disabled by default for UI_FYSETC
|
||||
#else
|
||||
#define DUGS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
|
||||
#endif
|
||||
|
||||
#define DGUS_FILAMENT_LOADUNLOAD
|
||||
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
|
||||
#define DGUS_FILAMENT_PURGE_LENGTH 10
|
||||
#define DGUS_FILAMENT_LOAD_LENGTH_PER_TIME 0.5 // (mm) Adjust in proportion to DGUS_UPDATE_INTERVAL_MS
|
||||
#endif
|
||||
|
||||
#define DGUS_UI_WAITING // Show a "waiting" screen between some screens
|
||||
#if ENABLED(DGUS_UI_WAITING)
|
||||
#define DGUS_UI_WAITING_STATUS 10
|
||||
#define DGUS_UI_WAITING_STATUS_PERIOD 8 // Increase to slower waiting status looping
|
||||
#endif
|
||||
#endif
|
||||
#endif // HAS_DGUS_LCD
|
||||
|
||||
//
|
||||
// Touch UI for the FTDI Embedded Video Engine (EVE)
|
||||
//
|
||||
@@ -1449,7 +1501,8 @@
|
||||
* Override MIN_PROBE_EDGE for each side of the build plate
|
||||
* Useful to get probe points to exact positions on targets or
|
||||
* to allow leveling to avoid plate clamps on only specific
|
||||
* sides of the bed.
|
||||
* sides of the bed. With NOZZLE_AS_PROBE negative values are
|
||||
* allowed, to permit probing outside the bed.
|
||||
*
|
||||
* If you are replacing the prior *_PROBE_BED_POSITION options,
|
||||
* LEFT and FRONT values in most cases will map directly over
|
||||
@@ -1559,12 +1612,12 @@
|
||||
/**
|
||||
* Maximum stepping rate (in Hz) the stepper driver allows
|
||||
* If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE)
|
||||
* 500000 : Maximum for A4988 stepper driver
|
||||
* 400000 : Maximum for TMC2xxx stepper drivers
|
||||
* 250000 : Maximum for DRV8825 stepper driver
|
||||
* 200000 : Maximum for LV8729 stepper driver
|
||||
* 150000 : Maximum for TB6600 stepper driver
|
||||
* 15000 : Maximum for TB6560 stepper driver
|
||||
* 5000000 : Maximum for TMC2xxx stepper drivers
|
||||
* 1000000 : Maximum for LV8729 stepper driver
|
||||
* 500000 : Maximum for A4988 stepper driver
|
||||
* 250000 : Maximum for DRV8825 stepper driver
|
||||
* 150000 : Maximum for TB6600 stepper driver
|
||||
* 15000 : Maximum for TB6560 stepper driver
|
||||
*
|
||||
* Override the default value based on the driver type set in Configuration.h.
|
||||
*/
|
||||
@@ -1764,9 +1817,10 @@
|
||||
#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused.
|
||||
|
||||
// Filament Unload does a Retract, Delay, and Purge first:
|
||||
#define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length.
|
||||
#define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract.
|
||||
#define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length.
|
||||
#define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract.
|
||||
#define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged.
|
||||
#define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload
|
||||
|
||||
#define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety.
|
||||
#define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed.
|
||||
@@ -2157,8 +2211,6 @@
|
||||
*
|
||||
* IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when
|
||||
* homing and adds a guard period for endstop triggering.
|
||||
*
|
||||
* TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING
|
||||
*/
|
||||
//#define SENSORLESS_HOMING // StallGuard capable drivers only
|
||||
|
||||
@@ -2177,7 +2229,6 @@
|
||||
#define Y_STALL_SENSITIVITY 8
|
||||
//#define Z_STALL_SENSITIVITY 8
|
||||
//#define SPI_ENDSTOPS // TMC2130 only
|
||||
//#define HOME_USING_SPREADCYCLE
|
||||
//#define IMPROVE_HOMING_RELIABILITY
|
||||
#endif
|
||||
|
||||
@@ -2762,7 +2813,11 @@
|
||||
#define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2
|
||||
#define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2
|
||||
|
||||
// Use M119 to find reasonable values after connecting your hardware:
|
||||
//#define INVERT_JOY_X // Enable if X direction is reversed
|
||||
//#define INVERT_JOY_Y // Enable if Y direction is reversed
|
||||
//#define INVERT_JOY_Z // Enable if Z direction is reversed
|
||||
|
||||
// Use M119 with JOYSTICK_DEBUG to find reasonable values after connecting:
|
||||
#define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max
|
||||
#define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 }
|
||||
#define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 }
|
||||
|
||||
@@ -91,24 +91,37 @@ typedef int8_t pin_t;
|
||||
#define NUM_SERIAL 1
|
||||
#else
|
||||
#if !WITHIN(SERIAL_PORT, -1, 3)
|
||||
#error "SERIAL_PORT must be from -1 to 3"
|
||||
#error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
|
||||
#define MYSERIAL0 customizedSerial1
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if !WITHIN(SERIAL_PORT_2, -1, 3)
|
||||
#error "SERIAL_PORT_2 must be from -1 to 3"
|
||||
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
|
||||
#elif SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#define MYSERIAL1 customizedSerial2
|
||||
#define NUM_SERIAL 2
|
||||
#else
|
||||
#define NUM_SERIAL 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DGUS_SERIAL_PORT
|
||||
#if !WITHIN(DGUS_SERIAL_PORT, -1, 3)
|
||||
#error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == SERIAL_PORT
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
|
||||
#endif
|
||||
#define DGUS_SERIAL internalDgusSerial
|
||||
|
||||
#define DGUS_SERIAL_GET_TX_BUFFER_FREE DGUS_SERIAL.get_tx_buffer_free
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H))
|
||||
|
||||
#include "MarlinSerial.h"
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } };
|
||||
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_t MarlinSerial<Cfg>::tx_buffer = { 0 };
|
||||
@@ -757,6 +757,33 @@
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DGUS_SERIAL_PORT
|
||||
|
||||
template<typename Cfg>
|
||||
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
|
||||
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
|
||||
h = tx_buffer.head; // next pos for queue.
|
||||
int ret = t - h - 1;
|
||||
if (ret < 0) ret += Cfg::TX_SIZE + 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ISR(SERIAL_REGNAME(USART,DGUS_SERIAL_PORT,_RX_vect)) {
|
||||
MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>>::store_rxd_char();
|
||||
}
|
||||
|
||||
ISR(SERIAL_REGNAME(USART,DGUS_SERIAL_PORT,_UDRE_vect)) {
|
||||
MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>>::_tx_udr_empty_irq();
|
||||
}
|
||||
|
||||
// Preinstantiate
|
||||
template class MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>>;
|
||||
|
||||
// Instantiate
|
||||
MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>> internalDgusSerial;
|
||||
|
||||
#endif
|
||||
|
||||
// For AT90USB targets use the UART for BT interfacing
|
||||
#if defined(USBCON) && ENABLED(BLUETOOTH)
|
||||
HardwareSerial bluetoothSerial;
|
||||
|
||||
@@ -217,6 +217,9 @@
|
||||
static ring_buffer_pos_t available();
|
||||
static void write(const uint8_t c);
|
||||
static void flushTX();
|
||||
#ifdef DGUS_SERIAL_PORT
|
||||
static ring_buffer_pos_t get_tx_buffer_free();
|
||||
#endif
|
||||
|
||||
FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }
|
||||
FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }
|
||||
@@ -292,6 +295,23 @@
|
||||
extern MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>> internalSerial;
|
||||
#endif
|
||||
|
||||
#ifdef DGUS_SERIAL_PORT
|
||||
template <uint8_t serial>
|
||||
struct MarlinInternalSerialCfg {
|
||||
static constexpr int PORT = serial;
|
||||
static constexpr unsigned int RX_SIZE = 128;
|
||||
static constexpr unsigned int TX_SIZE = 48;
|
||||
static constexpr bool XONOFF = false;
|
||||
static constexpr bool EMERGENCYPARSER = false;
|
||||
static constexpr bool DROPPED_RX = false;
|
||||
static constexpr bool RX_OVERRUNS = bDGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS;
|
||||
static constexpr bool RX_FRAMING_ERRORS = false;
|
||||
static constexpr bool MAX_RX_QUEUED = false;
|
||||
};
|
||||
|
||||
extern MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>> internalDgusSerial;
|
||||
#endif
|
||||
|
||||
// Use the UART for Bluetooth in AT90USB configurations
|
||||
#if defined(USBCON) && ENABLED(BLUETOOTH)
|
||||
extern HardwareSerial bluetoothSerial;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
* Checks for FAST PWM
|
||||
*/
|
||||
#if ENABLED(FAST_PWM_FAN) && (ENABLED(USE_OCR2A_AS_TOP) && defined(TCCR2))
|
||||
#error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2"
|
||||
#error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,10 @@
|
||||
|
||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
|
||||
|
||||
#define AVR_ATmega2560_FAMILY_PLUS_70 MB(BQ_ZUM_MEGA_3D, MIGHTYBOARD_REVE, MINIRAMBO, SCOOVO_X9H)
|
||||
|
||||
#if AVR_AT90USB1286_FAMILY
|
||||
|
||||
// Working with Teensyduino extension so need to re-define some things
|
||||
#include "pinsDebug_Teensyduino.h"
|
||||
// Can't use the "digitalPinToPort" function from the Teensyduino type IDEs
|
||||
@@ -35,7 +38,9 @@
|
||||
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
|
||||
#define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p)
|
||||
#define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin))
|
||||
|
||||
#elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70
|
||||
|
||||
#include "pinsDebug_plus_70.h"
|
||||
#define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p)
|
||||
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p)
|
||||
@@ -43,11 +48,13 @@
|
||||
bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
|
||||
|
||||
#else
|
||||
|
||||
#define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
|
||||
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
|
||||
#define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
|
||||
bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
|
||||
#define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
|
||||
|
||||
#endif
|
||||
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s.
|
||||
void watchdog_init() {
|
||||
|
||||
@@ -56,8 +56,7 @@
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration."
|
||||
#endif
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#elif SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL1 customizedSerial2
|
||||
#elif SERIAL_PORT_2 == 0
|
||||
#define MYSERIAL1 Serial
|
||||
@@ -75,6 +74,27 @@
|
||||
#define NUM_SERIAL 1
|
||||
#endif
|
||||
|
||||
#ifdef DGUS_SERIAL_PORT
|
||||
#if DGUS_SERIAL_PORT == SERIAL_PORT
|
||||
#error "DGUS_SERIAL_PORT must be different from SERIAL_PORT. Please update your configuration."
|
||||
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == -1
|
||||
#define DGUS_SERIAL internalDgusSerial
|
||||
#elif DGUS_SERIAL_PORT == 0
|
||||
#define DGUS_SERIAL Serial
|
||||
#elif DGUS_SERIAL_PORT == 1
|
||||
#define DGUS_SERIAL Serial1
|
||||
#elif DGUS_SERIAL_PORT == 2
|
||||
#define DGUS_SERIAL Serial2
|
||||
#elif DGUS_SERIAL_PORT == 3
|
||||
#define DGUS_SERIAL Serial3
|
||||
#else
|
||||
#error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include "MarlinSerial.h"
|
||||
#include "MarlinSerialUSB.h"
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "MarlinSerial.h"
|
||||
#include "InterruptVectors.h"
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } };
|
||||
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_t MarlinSerial<Cfg>::tx_buffer = { 0 };
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
#include <U8glib.h>
|
||||
|
||||
#include "../../../Marlin.h"
|
||||
#include "../../../MarlinCore.h"
|
||||
|
||||
void spiBegin();
|
||||
void spiInit(uint8_t spiRate);
|
||||
|
||||
@@ -55,3 +55,7 @@
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
#error "FAST_PWM_FAN is not yet implemented for this platform."
|
||||
#endif
|
||||
|
||||
#if TMC_HAS_SW_SERIAL
|
||||
#error "TMC220x Software Serial is not supported on this platform."
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#ifdef ARDUINO_ARCH_SAM
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
// Override Arduino runtime to either config or disable the watchdog
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if EITHER(EEPROM_SETTINGS, WEBSUPPORT)
|
||||
#if ENABLED(WEBSUPPORT)
|
||||
#include "spiffs.h"
|
||||
#endif
|
||||
|
||||
@@ -83,7 +83,7 @@ void HAL_init() {
|
||||
}
|
||||
|
||||
void HAL_init_board() {
|
||||
#if EITHER(EEPROM_SETTINGS, WEBSUPPORT)
|
||||
#if ENABLED(WEBSUPPORT)
|
||||
spiffs_init();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ extern portMUX_TYPE spinlock;
|
||||
#define MYSERIAL0 flushableSerial
|
||||
|
||||
#if ENABLED(WIFISUPPORT)
|
||||
#define NUM_SERIAL 2
|
||||
#define MYSERIAL1 webSocketSerial
|
||||
#define NUM_SERIAL 2
|
||||
#else
|
||||
#define NUM_SERIAL 1
|
||||
#endif
|
||||
|
||||
@@ -25,14 +25,16 @@
|
||||
|
||||
#include <Stream.h>
|
||||
|
||||
#ifndef RX_BUFFER_SIZE
|
||||
#define RX_BUFFER_SIZE 128
|
||||
#endif
|
||||
#ifndef TX_BUFFER_SIZE
|
||||
#define TX_BUFFER_SIZE 32
|
||||
#endif
|
||||
#if TX_BUFFER_SIZE <= 0
|
||||
#error "TX_BUFFER_SIZE is required for the WebSocket."
|
||||
#if ENABLED(WIFISUPPORT)
|
||||
#ifndef RX_BUFFER_SIZE
|
||||
#define RX_BUFFER_SIZE 128
|
||||
#endif
|
||||
#if TX_BUFFER_SIZE <= 0
|
||||
#error "TX_BUFFER_SIZE is required for the WebSocket."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef uint16_t ring_buffer_pos_t;
|
||||
|
||||
@@ -28,3 +28,7 @@
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
#error "FAST_PWM_FAN is not yet implemented for this platform."
|
||||
#endif
|
||||
|
||||
#if TMC_HAS_SW_SERIAL
|
||||
#error "TMC220x Software Serial is not supported on this platform."
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "EEPROM.h"
|
||||
|
||||
#define EEPROM_SIZE 4096
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
return EEPROM.begin(EEPROM_SIZE);
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
EEPROM.end();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
EEPROM.write(pos++, value[i]);
|
||||
crc16(crc, &value[i], 1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
uint8_t c = EEPROM.read(pos++);
|
||||
if (writing) value[i] = c;
|
||||
crc16(crc, &c, 1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t PersistentStore::capacity() { return EEPROM_SIZE; }
|
||||
|
||||
#endif // EEPROM_SETTINGS
|
||||
#endif // ARDUINO_ARCH_ESP32
|
||||
@@ -1,106 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
|
||||
#include <SPIFFS.h>
|
||||
#include <FS.h>
|
||||
#include "spiffs.h"
|
||||
|
||||
#define HAL_ESP32_EEPROM_SIZE 4096
|
||||
#define HAL_ESP32_EEPROM_FILE_PATH "/eeprom.dat"
|
||||
|
||||
File eeprom_file;
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
if (spiffs_initialized) {
|
||||
eeprom_file = SPIFFS.open(HAL_ESP32_EEPROM_FILE_PATH, "r+");
|
||||
|
||||
size_t file_size = eeprom_file.size();
|
||||
if (file_size < HAL_ESP32_EEPROM_SIZE) {
|
||||
SERIAL_ECHO_MSG("SPIFFS EEPROM settings file " HAL_ESP32_EEPROM_FILE_PATH " is too small or did not exist, expanding.");
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" file size: ", file_size, ", required size: ", HAL_ESP32_EEPROM_SIZE);
|
||||
|
||||
// mode r+ does not allow to expand the file (at least on ESP32 SPIFFS9, so we close, reopen "a", append, close, reopen "r+"
|
||||
eeprom_file.close();
|
||||
|
||||
eeprom_file = SPIFFS.open(HAL_ESP32_EEPROM_FILE_PATH, "a");
|
||||
for (size_t i = eeprom_file.size(); i < HAL_ESP32_EEPROM_SIZE; i++)
|
||||
eeprom_file.write(0xFF);
|
||||
eeprom_file.close();
|
||||
|
||||
eeprom_file = SPIFFS.open(HAL_ESP32_EEPROM_FILE_PATH, "r+");
|
||||
file_size = eeprom_file.size();
|
||||
if (file_size < HAL_ESP32_EEPROM_SIZE) {
|
||||
SERIAL_ERROR_MSG("Failed to expand " HAL_ESP32_EEPROM_FILE_PATH " to required size. SPIFFS partition full?");
|
||||
SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(" file size: ", file_size, ", required size: ", HAL_ESP32_EEPROM_SIZE);
|
||||
SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(" SPIFFS used bytes: ", SPIFFS.usedBytes(), ", total bytes: ", SPIFFS.totalBytes());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
eeprom_file.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
if (!eeprom_file.seek(pos)) return true; // return true for any error
|
||||
if (eeprom_file.write(value, size) != size) return true;
|
||||
|
||||
crc16(crc, value, size);
|
||||
pos += size;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
if (!eeprom_file.seek(pos)) return true; // return true for any error
|
||||
|
||||
if (writing) {
|
||||
if (eeprom_file.read(value, size) != size) return true;
|
||||
crc16(crc, value, size);
|
||||
}
|
||||
else {
|
||||
uint8_t tmp[size];
|
||||
if (eeprom_file.read(tmp, size) != size) return true;
|
||||
crc16(crc, tmp, size);
|
||||
}
|
||||
|
||||
pos += size;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t PersistentStore::capacity() { return HAL_ESP32_EEPROM_SIZE; }
|
||||
|
||||
#endif // EEPROM_SETTINGS
|
||||
#endif // ARDUINO_ARCH_ESP32
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if EITHER(WEBSUPPORT, EEPROM_SETTINGS)
|
||||
#if ENABLED(WEBSUPPORT)
|
||||
|
||||
#include "../../core/serial.h"
|
||||
|
||||
|
||||
@@ -21,8 +21,18 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
esp_err_t esp_task_wdt_reset();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// Initialize watchdog with a 4 second interrupt time
|
||||
void watchdog_init();
|
||||
|
||||
// Reset watchdog.
|
||||
inline void HAL_watchdog_refresh() {}
|
||||
inline void HAL_watchdog_refresh() { esp_task_wdt_reset(); }
|
||||
|
||||
@@ -33,3 +33,7 @@
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
#error "FAST_PWM_FAN is not yet implemented for this platform."
|
||||
#endif
|
||||
|
||||
#if TMC_HAS_SW_SERIAL
|
||||
#error "TMC220x Software Serial is not supported on this platform."
|
||||
#endif
|
||||
|
||||
@@ -61,10 +61,6 @@ extern "C" volatile uint32_t _millis;
|
||||
#define ST7920_DELAY_3 DELAY_NS(750)
|
||||
#endif
|
||||
|
||||
#if !WITHIN(SERIAL_PORT, -1, 3)
|
||||
#error "SERIAL_PORT must be from -1 to 3"
|
||||
#endif
|
||||
|
||||
#if SERIAL_PORT == -1
|
||||
#define MYSERIAL0 UsbSerial
|
||||
#elif SERIAL_PORT == 0
|
||||
@@ -75,16 +71,14 @@ extern "C" volatile uint32_t _millis;
|
||||
#define MYSERIAL0 MSerial2
|
||||
#elif SERIAL_PORT == 3
|
||||
#define MYSERIAL0 MSerial3
|
||||
#else
|
||||
#error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if !WITHIN(SERIAL_PORT_2, -1, 3)
|
||||
#error "SERIAL_PORT_2 must be from -1 to 3"
|
||||
#elif SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#if SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL1 UsbSerial
|
||||
#elif SERIAL_PORT_2 == 0
|
||||
#define MYSERIAL1 MSerial
|
||||
@@ -94,11 +88,34 @@ extern "C" volatile uint32_t _millis;
|
||||
#define MYSERIAL1 MSerial2
|
||||
#elif SERIAL_PORT_2 == 3
|
||||
#define MYSERIAL1 MSerial3
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#else
|
||||
#define NUM_SERIAL 1
|
||||
#endif
|
||||
|
||||
#ifdef DGUS_SERIAL_PORT
|
||||
#if DGUS_SERIAL_PORT == SERIAL_PORT
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == -1
|
||||
#define DGUS_SERIAL UsbSerial
|
||||
#elif DGUS_SERIAL_PORT == 0
|
||||
#define DGUS_SERIAL MSerial
|
||||
#elif DGUS_SERIAL_PORT == 1
|
||||
#define DGUS_SERIAL MSerial1
|
||||
#elif DGUS_SERIAL_PORT == 2
|
||||
#define DGUS_SERIAL MSerial2
|
||||
#elif DGUS_SERIAL_PORT == 3
|
||||
#define DGUS_SERIAL MSerial3
|
||||
#else
|
||||
#error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Interrupts
|
||||
//
|
||||
|
||||
@@ -68,3 +68,7 @@
|
||||
#if IS_RE_ARM_BOARD && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI)
|
||||
#error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI"
|
||||
#endif
|
||||
|
||||
#if ENABLED(BAUD_RATE_GCODE)
|
||||
#error "BAUD_RATE_GCODE is not yet supported on LPC176x."
|
||||
#endif
|
||||
|
||||
@@ -33,11 +33,9 @@
|
||||
#include "MarlinSerial_AGCM4.h"
|
||||
|
||||
// Serial ports
|
||||
#if !WITHIN(SERIAL_PORT, -1, 3)
|
||||
#error "SERIAL_PORT must be from -1 to 3"
|
||||
#endif
|
||||
|
||||
// MYSERIAL0 required before MarlinSerial includes!
|
||||
|
||||
#if SERIAL_PORT == -1
|
||||
#define MYSERIAL0 Serial
|
||||
#elif SERIAL_PORT == 0
|
||||
@@ -46,18 +44,16 @@
|
||||
#define MYSERIAL0 Serial2
|
||||
#elif SERIAL_PORT == 2
|
||||
#define MYSERIAL0 Serial3
|
||||
#else
|
||||
#elif SERIAL_PORT == 3
|
||||
#define MYSERIAL0 Serial4
|
||||
#else
|
||||
#error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if !WITHIN(SERIAL_PORT_2, -1, 3)
|
||||
#error "SERIAL_PORT_2 must be from -1 to 3"
|
||||
#elif SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#if SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL1 Serial
|
||||
#elif SERIAL_PORT_2 == 0
|
||||
#define MYSERIAL1 Serial1
|
||||
@@ -65,13 +61,36 @@
|
||||
#define MYSERIAL1 Serial2
|
||||
#elif SERIAL_PORT_2 == 2
|
||||
#define MYSERIAL1 Serial3
|
||||
#else
|
||||
#elif SERIAL_PORT_2 == 3
|
||||
#define MYSERIAL1 Serial4
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#else
|
||||
#define NUM_SERIAL 1
|
||||
#endif
|
||||
|
||||
#ifdef DGUS_SERIAL_PORT
|
||||
#if DGUS_SERIAL_PORT == SERIAL_PORT
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == -1
|
||||
#define DGUS_SERIAL Serial
|
||||
#elif DGUS_SERIAL_PORT == 0
|
||||
#define DGUS_SERIAL Serial1
|
||||
#elif DGUS_SERIAL_PORT == 1
|
||||
#define DGUS_SERIAL Serial2
|
||||
#elif DGUS_SERIAL_PORT == 2
|
||||
#define DGUS_SERIAL Serial3
|
||||
#elif DGUS_SERIAL_PORT == 2
|
||||
#define DGUS_SERIAL Serial4
|
||||
#else
|
||||
#error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // ADAFRUIT_GRAND_CENTRAL_M4
|
||||
|
||||
typedef int8_t pin_t;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDIO_SUPPORT)
|
||||
#error "SDIO_SUPPORT is not supported."
|
||||
#error "SDIO_SUPPORT is not supported on SAMD51."
|
||||
#endif
|
||||
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
@@ -46,3 +46,7 @@
|
||||
#if ENABLED(EEPROM_SETTINGS) && NONE(SPI_EEPROM, I2C_EEPROM)
|
||||
#warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Activator"
|
||||
#endif
|
||||
|
||||
#if TMC_HAS_SW_SERIAL
|
||||
#error "TMC220x Software Serial is not supported on this platform."
|
||||
#endif
|
||||
|
||||
@@ -28,13 +28,7 @@
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../shared/Delay.h"
|
||||
|
||||
#if (__cplusplus == 201703L) && defined(__has_include)
|
||||
#define HAS_SWSERIAL __has_include(<SoftwareSerial.h>)
|
||||
#else
|
||||
#define HAS_SWSERIAL HAS_TMC220x
|
||||
#endif
|
||||
|
||||
#if HAS_SWSERIAL
|
||||
#if TMC_HAS_SW_SERIAL
|
||||
#include "SoftwareSerial.h"
|
||||
#endif
|
||||
|
||||
@@ -93,7 +87,7 @@ void HAL_init() {
|
||||
while (!LL_PWR_IsActiveFlag_BRR());
|
||||
#endif // EEPROM_EMULATED_SRAM
|
||||
|
||||
#if HAS_SWSERIAL
|
||||
#if TMC_HAS_SW_SERIAL
|
||||
SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -44,13 +44,8 @@
|
||||
// ------------------------
|
||||
|
||||
#if SERIAL_PORT == 0
|
||||
#error "Serial port 0 does not exist"
|
||||
#endif
|
||||
|
||||
#if !WITHIN(SERIAL_PORT, -1, 6)
|
||||
#error "SERIAL_PORT must be from -1 to 6"
|
||||
#endif
|
||||
#if SERIAL_PORT == -1
|
||||
#error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
|
||||
#elif SERIAL_PORT == -1
|
||||
#define MYSERIAL0 SerialUSB
|
||||
#elif SERIAL_PORT == 1
|
||||
#define MYSERIAL0 Serial1
|
||||
@@ -64,20 +59,17 @@
|
||||
#define MYSERIAL0 Serial5
|
||||
#elif SERIAL_PORT == 6
|
||||
#define MYSERIAL0 Serial6
|
||||
#else
|
||||
#error "SERIAL_PORT must be from -1 to 6. Please update your configuration."
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if SERIAL_PORT_2 == 0
|
||||
#error "Serial port 0 does not exist"
|
||||
#endif
|
||||
|
||||
#if !WITHIN(SERIAL_PORT_2, -1, 6)
|
||||
#error "SERIAL_PORT_2 must be from -1 to 6"
|
||||
#elif SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#if SERIAL_PORT_2 == 0
|
||||
#error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
|
||||
#elif SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL1 SerialUSB
|
||||
#elif SERIAL_PORT_2 == 1
|
||||
#define MYSERIAL1 Serial1
|
||||
@@ -91,11 +83,41 @@
|
||||
#define MYSERIAL1 Serial5
|
||||
#elif SERIAL_PORT_2 == 6
|
||||
#define MYSERIAL1 Serial6
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration."
|
||||
#endif
|
||||
#else
|
||||
#define NUM_SERIAL 1
|
||||
#endif
|
||||
|
||||
#if HAS_DGUS_LCD
|
||||
#if DGUS_SERIAL_PORT == 0
|
||||
#error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == SERIAL_PORT
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == -1
|
||||
#define DGUS_SERIAL SerialUSB
|
||||
#elif DGUS_SERIAL_PORT == 1
|
||||
#define DGUS_SERIAL Serial1
|
||||
#elif DGUS_SERIAL_PORT == 2
|
||||
#define DGUS_SERIAL Serial2
|
||||
#elif DGUS_SERIAL_PORT == 3
|
||||
#define DGUS_SERIAL Serial3
|
||||
#elif DGUS_SERIAL_PORT == 4
|
||||
#define DGUS_SERIAL Serial4
|
||||
#elif DGUS_SERIAL_PORT == 5
|
||||
#define DGUS_SERIAL Serial5
|
||||
#elif DGUS_SERIAL_PORT == 6
|
||||
#define DGUS_SERIAL Serial6
|
||||
#else
|
||||
#error "DGUS_SERIAL_PORT must be from -1 to 6. Please update your configuration."
|
||||
#endif
|
||||
|
||||
#define DGUS_SERIAL_GET_TX_BUFFER_FREE DGUS_SERIAL.availableForWrite
|
||||
#endif
|
||||
|
||||
#include "timers.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,6 +83,13 @@ void spiInit(uint8_t spiRate) {
|
||||
}
|
||||
spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0);
|
||||
|
||||
#if ENABLED(CUSTOM_SPI_PINS)
|
||||
SPI.setMISO(MISO_PIN);
|
||||
SPI.setMOSI(MOSI_PIN);
|
||||
SPI.setSCLK(SCK_PIN);
|
||||
SPI.setSSEL(SS_PIN);
|
||||
#endif
|
||||
|
||||
SPI.begin();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,25 +28,30 @@
|
||||
|
||||
#include "Servo.h"
|
||||
|
||||
uint8_t servoPin[MAX_SERVOS] = { 0 };
|
||||
static uint_fast8_t servoCount = 0;
|
||||
constexpr millis_t servoDelay[] = SERVO_DELAY;
|
||||
static_assert(COUNT(servoDelay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
|
||||
|
||||
libServo::libServo()
|
||||
: delay(servoDelay[servoCount++])
|
||||
{}
|
||||
|
||||
int8_t libServo::attach(const int pin) {
|
||||
if (servoIndex >= MAX_SERVOS) return -1;
|
||||
if (pin > 0) servoPin[servoIndex] = pin;
|
||||
return super::attach(servoPin[servoIndex]);
|
||||
if (servoCount >= MAX_SERVOS) return -1;
|
||||
if (pin > 0) servo_pin = pin;
|
||||
return super::attach(servo_pin);
|
||||
}
|
||||
|
||||
int8_t libServo::attach(const int pin, const int min, const int max) {
|
||||
if (pin > 0) servoPin[servoIndex] = pin;
|
||||
return super::attach(servoPin[servoIndex], min, max);
|
||||
if (servoCount >= MAX_SERVOS) return -1;
|
||||
if (pin > 0) servo_pin = pin;
|
||||
return super::attach(servo_pin, min, max);
|
||||
}
|
||||
|
||||
void libServo::move(const int value) {
|
||||
constexpr uint16_t servo_delay[] = SERVO_DELAY;
|
||||
static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
|
||||
if (attach(0) >= 0) {
|
||||
write(value);
|
||||
safe_delay(servo_delay[servoIndex]);
|
||||
safe_delay(delay);
|
||||
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
|
||||
detach();
|
||||
#endif
|
||||
|
||||
@@ -27,11 +27,13 @@
|
||||
// Inherit and expand on the official library
|
||||
class libServo : public Servo {
|
||||
public:
|
||||
libServo();
|
||||
int8_t attach(const int pin);
|
||||
int8_t attach(const int pin, const int min, const int max);
|
||||
void move(const int value);
|
||||
private:
|
||||
typedef Servo super;
|
||||
uint16_t min_ticks, max_ticks;
|
||||
uint8_t servoIndex; // index into the channel data for this servo
|
||||
|
||||
int servo_pin = 0;
|
||||
millis_t delay = 0;
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
//
|
||||
// Includes
|
||||
//
|
||||
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
|
||||
#if defined(PLATFORMIO) && defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
|
||||
|
||||
#include "SoftwareSerial.h"
|
||||
#include "timers.h"
|
||||
|
||||
@@ -0,0 +1,265 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
|
||||
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
|
||||
|
||||
// Only STM32F4 can support wear leveling at this time
|
||||
#ifndef STM32F4xx
|
||||
#undef FLASH_EEPROM_LEVELING
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The STM32 HAL supports chips that deal with "pages" and some with "sectors" and some that
|
||||
* even have multiple "banks" of flash.
|
||||
*
|
||||
* This code is a bit of a mashup of
|
||||
* framework-arduinoststm32/cores/arduino/stm32/stm32_eeprom.c
|
||||
* hal/hal_lpc1768/persistent_store_flash.cpp
|
||||
*
|
||||
* This has only be written against those that use a single "sector" design.
|
||||
*
|
||||
* Those that deal with "pages" could be made to work. Looking at the STM32F07 for example, there are
|
||||
* 128 "pages", each 2kB in size. If we continued with our EEPROM being 4Kb, we'd always need to operate
|
||||
* on 2 of these pages. Each write, we'd use 2 different pages from a pool of pages until we are done.
|
||||
*/
|
||||
|
||||
#if ENABLED(FLASH_EEPROM_LEVELING)
|
||||
|
||||
#include "stm32_def.h"
|
||||
|
||||
#define DEBUG_OUT ENABLED(EEPROM_CHITCHAT)
|
||||
#include "src/core/debug_out.h"
|
||||
|
||||
#ifndef EEPROM_SIZE
|
||||
#define EEPROM_SIZE 0x1000 // 4kB
|
||||
#endif
|
||||
|
||||
#ifndef FLASH_SECTOR
|
||||
#define FLASH_SECTOR (FLASH_SECTOR_TOTAL - 1)
|
||||
#endif
|
||||
#ifndef FLASH_UNIT_SIZE
|
||||
#define FLASH_UNIT_SIZE 0x20000 // 128kB
|
||||
#endif
|
||||
|
||||
#define FLASH_ADDRESS_START (FLASH_END - ((FLASH_SECTOR_TOTAL - FLASH_SECTOR) * FLASH_UNIT_SIZE) + 1)
|
||||
#define FLASH_ADDRESS_END (FLASH_ADDRESS_START + FLASH_UNIT_SIZE - 1)
|
||||
|
||||
#define EEPROM_SLOTS (FLASH_UNIT_SIZE/EEPROM_SIZE)
|
||||
#define SLOT_ADDRESS(slot) (FLASH_ADDRESS_START + (slot * EEPROM_SIZE))
|
||||
|
||||
#define UNLOCK_FLASH() if (!flash_unlocked) { \
|
||||
HAL_FLASH_Unlock(); \
|
||||
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | \
|
||||
FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); \
|
||||
flash_unlocked = true; \
|
||||
}
|
||||
#define LOCK_FLASH() if (flash_unlocked) { HAL_FLASH_Lock(); flash_unlocked = false; }
|
||||
|
||||
#define EMPTY_UINT32 ((uint32_t)-1)
|
||||
#define EMPTY_UINT8 ((uint8_t)-1)
|
||||
|
||||
static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0};
|
||||
static int current_slot = -1;
|
||||
|
||||
static_assert(0 == EEPROM_SIZE % 4, "EEPROM_SIZE must be a multiple of 4"); // Ensure copying as uint32_t is safe
|
||||
static_assert(0 == FLASH_UNIT_SIZE % EEPROM_SIZE, "EEPROM_SIZE must divide evenly into your FLASH_UNIT_SIZE");
|
||||
static_assert(FLASH_UNIT_SIZE >= EEPROM_SIZE, "FLASH_UNIT_SIZE must be greater than or equal to your EEPROM_SIZE");
|
||||
static_assert(IS_FLASH_SECTOR(FLASH_SECTOR), "FLASH_SECTOR is invalid");
|
||||
static_assert(IS_POWER_OF_2(FLASH_UNIT_SIZE), "FLASH_UNIT_SIZE should be a power of 2, please check your chip's spec sheet");
|
||||
|
||||
#endif
|
||||
|
||||
static bool eeprom_data_written = false;
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
|
||||
#if ENABLED(FLASH_EEPROM_LEVELING)
|
||||
|
||||
if (current_slot == -1 || eeprom_data_written) {
|
||||
// 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.
|
||||
// Lets go looking for the slot that holds our configuration.
|
||||
if (eeprom_data_written) DEBUG_ECHOLN("Dangling EEPROM write_data");
|
||||
uint32_t address = FLASH_ADDRESS_START;
|
||||
while (address <= FLASH_ADDRESS_END) {
|
||||
uint32_t address_value = (*(__IO uint32_t*)address);
|
||||
if (address_value != EMPTY_UINT32) {
|
||||
current_slot = (address - FLASH_ADDRESS_START) / EEPROM_SIZE;
|
||||
break;
|
||||
}
|
||||
address += sizeof(uint32_t);
|
||||
}
|
||||
if (current_slot == -1) {
|
||||
// We didn't find anything, so we'll just intialize to empty
|
||||
for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = EMPTY_UINT8;
|
||||
current_slot = EEPROM_SLOTS;
|
||||
}
|
||||
else {
|
||||
// load current settings
|
||||
uint8_t *eeprom_data = (uint8_t *)SLOT_ADDRESS(current_slot);
|
||||
for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i];
|
||||
DEBUG_ECHOLNPAIR("EEPROM loaded from slot ", current_slot, ".");
|
||||
}
|
||||
eeprom_data_written = false;
|
||||
}
|
||||
|
||||
#else
|
||||
eeprom_buffer_fill();
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
|
||||
if (eeprom_data_written) {
|
||||
|
||||
#if ENABLED(FLASH_EEPROM_LEVELING)
|
||||
|
||||
HAL_StatusTypeDef status = HAL_ERROR;
|
||||
bool flash_unlocked = false;
|
||||
|
||||
if (--current_slot < 0) {
|
||||
// all slots have been used, erase everything and start again
|
||||
|
||||
FLASH_EraseInitTypeDef EraseInitStruct;
|
||||
uint32_t SectorError = 0;
|
||||
|
||||
EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;
|
||||
EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
|
||||
EraseInitStruct.Sector = FLASH_SECTOR;
|
||||
EraseInitStruct.NbSectors = 1;
|
||||
|
||||
current_slot = EEPROM_SLOTS - 1;
|
||||
UNLOCK_FLASH();
|
||||
|
||||
status = HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError);
|
||||
if (status != HAL_OK) {
|
||||
DEBUG_ECHOLNPAIR("HAL_FLASHEx_Erase=", status);
|
||||
DEBUG_ECHOLNPAIR("GetError=", HAL_FLASH_GetError());
|
||||
DEBUG_ECHOLNPAIR("SectorError=", SectorError);
|
||||
LOCK_FLASH();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
UNLOCK_FLASH();
|
||||
|
||||
uint32_t offset = 0;
|
||||
uint32_t address = SLOT_ADDRESS(current_slot);
|
||||
uint32_t address_end = address + EEPROM_SIZE;
|
||||
uint32_t data = 0;
|
||||
|
||||
bool success = true;
|
||||
|
||||
while (address < address_end) {
|
||||
memcpy(&data, ram_eeprom + offset, sizeof(uint32_t));
|
||||
status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, address, data);
|
||||
if (status == HAL_OK) {
|
||||
address += sizeof(uint32_t);
|
||||
offset += sizeof(uint32_t);
|
||||
}
|
||||
else {
|
||||
DEBUG_ECHOLNPAIR("HAL_FLASH_Program=", status);
|
||||
DEBUG_ECHOLNPAIR("GetError=", HAL_FLASH_GetError());
|
||||
DEBUG_ECHOLNPAIR("address=", address);
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LOCK_FLASH();
|
||||
|
||||
if (success) {
|
||||
eeprom_data_written = false;
|
||||
DEBUG_ECHOLNPAIR("EEPROM saved to slot ", current_slot, ".");
|
||||
}
|
||||
|
||||
return success;
|
||||
|
||||
#else
|
||||
eeprom_buffer_flush();
|
||||
eeprom_data_written = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
while (size--) {
|
||||
uint8_t v = *value;
|
||||
#if ENABLED(FLASH_EEPROM_LEVELING)
|
||||
if (v != ram_eeprom[pos]) {
|
||||
ram_eeprom[pos] = v;
|
||||
eeprom_data_written = true;
|
||||
}
|
||||
#else
|
||||
if (v != eeprom_buffered_read_byte(pos)) {
|
||||
eeprom_buffered_write_byte(pos, v);
|
||||
eeprom_data_written = true;
|
||||
}
|
||||
#endif
|
||||
crc16(crc, &v, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
do {
|
||||
const uint8_t c = (
|
||||
#if ENABLED(FLASH_EEPROM_LEVELING)
|
||||
ram_eeprom[pos]
|
||||
#else
|
||||
eeprom_buffered_read_byte(pos)
|
||||
#endif
|
||||
);
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
value++;
|
||||
} while (--size);
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t PersistentStore::capacity() {
|
||||
return (
|
||||
#if ENABLED(FLASH_EEPROM_LEVELING)
|
||||
EEPROM_SIZE
|
||||
#else
|
||||
E2END + 1
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
#endif // EEPROM_SETTINGS && FLASH_EEPROM_EMULATION
|
||||
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
||||
@@ -24,29 +24,15 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS) && ANY(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
|
||||
#if ENABLED(EEPROM_SETTINGS) && ANY(SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
#include <EEPROM.h>
|
||||
static bool eeprom_data_written = false;
|
||||
#endif
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
eeprom_buffer_fill();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
if (eeprom_data_written) {
|
||||
eeprom_buffer_flush();
|
||||
eeprom_data_written = false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -66,8 +52,6 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#elif ENABLED(FLASH_EEPROM_EMULATION)
|
||||
eeprom_buffered_write_byte(pos, v);
|
||||
#else
|
||||
*(__IO uint8_t *)(BKPSRAM_BASE + (uint8_t * const)pos) = v;
|
||||
#endif
|
||||
@@ -76,9 +60,6 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
pos++;
|
||||
value++;
|
||||
};
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
eeprom_data_written = true;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -89,8 +70,6 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
|
||||
const uint8_t c = (
|
||||
#if EITHER(SPI_EEPROM, I2C_EEPROM)
|
||||
eeprom_read_byte((uint8_t*)pos)
|
||||
#elif ENABLED(FLASH_EEPROM_EMULATION)
|
||||
eeprom_buffered_read_byte(pos)
|
||||
#else
|
||||
(*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)))
|
||||
#endif
|
||||
@@ -114,5 +93,5 @@ size_t PersistentStore::capacity() {
|
||||
);
|
||||
}
|
||||
|
||||
#endif // EEPROM_SETTINGS && (FLASH_EEPROM_EMULATION || SRAM_EEPROM_EMULATION || SPI_EEPROM || I2C_EEPROM)
|
||||
#endif // EEPROM_SETTINGS && (SRAM_EEPROM_EMULATION || SPI_EEPROM || I2C_EEPROM)
|
||||
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
||||
|
||||
@@ -78,13 +78,10 @@
|
||||
#define MSerial5 Serial4
|
||||
#endif
|
||||
|
||||
#if !WITHIN(SERIAL_PORT, -1, 5)
|
||||
#error "SERIAL_PORT must be from -1 to 5"
|
||||
#endif
|
||||
#if SERIAL_PORT == -1
|
||||
#if SERIAL_PORT == 0
|
||||
#error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
|
||||
#elif SERIAL_PORT == -1
|
||||
#define MYSERIAL0 UsbSerial
|
||||
#elif SERIAL_PORT == 0
|
||||
#error "Serial port 0 does not exist"
|
||||
#elif SERIAL_PORT == 1
|
||||
#define MYSERIAL0 MSerial1
|
||||
#elif SERIAL_PORT == 2
|
||||
@@ -95,19 +92,17 @@
|
||||
#define MYSERIAL0 MSerial4
|
||||
#elif SERIAL_PORT == 5
|
||||
#define MYSERIAL0 MSerial5
|
||||
#else
|
||||
#error "SERIAL_PORT must be from -1 to 5. Please update your configuration."
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if !WITHIN(SERIAL_PORT_2, -1, 5)
|
||||
#error "SERIAL_PORT_2 must be from -1 to 5"
|
||||
#if SERIAL_PORT_2 == 0
|
||||
#error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
|
||||
#elif SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL1 UsbSerial
|
||||
#elif SERIAL_PORT_2 == 0
|
||||
#error "Serial port 0 does not exist"
|
||||
#elif SERIAL_PORT_2 == 1
|
||||
#define MYSERIAL1 MSerial1
|
||||
#elif SERIAL_PORT_2 == 2
|
||||
@@ -118,11 +113,39 @@
|
||||
#define MYSERIAL1 MSerial4
|
||||
#elif SERIAL_PORT_2 == 5
|
||||
#define MYSERIAL1 MSerial5
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from -1 to 5. Please update your configuration."
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#else
|
||||
#define NUM_SERIAL 1
|
||||
#endif
|
||||
|
||||
#ifdef DGUS_SERIAL
|
||||
#if DGUS_SERIAL_PORT == 0
|
||||
#error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == SERIAL_PORT
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == -1
|
||||
#define DGUS_SERIAL UsbSerial
|
||||
#elif DGUS_SERIAL_PORT == 1
|
||||
#define DGUS_SERIAL MSerial1
|
||||
#elif DGUS_SERIAL_PORT == 2
|
||||
#define DGUS_SERIAL MSerial2
|
||||
#elif DGUS_SERIAL_PORT == 3
|
||||
#define DGUS_SERIAL MSerial3
|
||||
#elif DGUS_SERIAL_PORT == 4
|
||||
#define DGUS_SERIAL MSerial4
|
||||
#elif DGUS_SERIAL_PORT == 5
|
||||
#define DGUS_SERIAL MSerial5
|
||||
#else
|
||||
#error "DGUS_SERIAL_PORT must be from -1 to 5. Please update your configuration."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// Set interrupt grouping for this MCU
|
||||
void HAL_init();
|
||||
#define HAL_IDLETASK 1
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
void LCD_IO_Init(uint8_t cs, uint8_t rs);
|
||||
void LCD_IO_WriteData(uint16_t RegValue);
|
||||
void LCD_IO_WriteReg(uint16_t Reg);
|
||||
uint16_t LCD_IO_ReadData(uint16_t RegValue);
|
||||
uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize);
|
||||
#ifdef LCD_USE_DMA_FSMC
|
||||
void LCD_IO_WriteMultiple(uint16_t data, uint32_t count);
|
||||
@@ -79,8 +80,11 @@ uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi
|
||||
LCD_IO_Init(u8g->pin_list[U8G_PI_CS], u8g->pin_list[U8G_PI_A0]);
|
||||
u8g_Delay(50);
|
||||
|
||||
if (arg_ptr)
|
||||
*((uint32_t *)arg_ptr) = LCD_IO_ReadData(LCD_READ_ID, 3);
|
||||
if (arg_ptr) {
|
||||
*((uint32_t *)arg_ptr) = LCD_IO_ReadData(0x0000);
|
||||
if (*((uint32_t *)arg_ptr) == 0)
|
||||
*((uint32_t *)arg_ptr) = (LCD_READ_ID << 24) | LCD_IO_ReadData(LCD_READ_ID, 3);
|
||||
}
|
||||
isCommand = 0;
|
||||
break;
|
||||
|
||||
@@ -265,6 +269,13 @@ void LCD_IO_WriteReg(uint16_t Reg) {
|
||||
__DSB();
|
||||
}
|
||||
|
||||
uint16_t LCD_IO_ReadData(uint16_t RegValue) {
|
||||
LCD->REG = RegValue;
|
||||
__DSB();
|
||||
|
||||
return LCD->RAM;
|
||||
}
|
||||
|
||||
uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) {
|
||||
volatile uint32_t data;
|
||||
LCD->REG = RegValue;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#error "FAST_PWM_FAN is not yet implemented for this platform."
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SW_SERIAL) && HAS_TMC220x
|
||||
#if !defined(HAVE_SW_SERIAL) && TMC_HAS_SW_SERIAL
|
||||
#warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
|
||||
#error "Missing SoftwareSerial implementation."
|
||||
#endif
|
||||
|
||||
@@ -44,17 +44,12 @@
|
||||
// Defines
|
||||
// ------------------------
|
||||
|
||||
//Serial override
|
||||
// Serial override
|
||||
//extern HalSerial usb_serial;
|
||||
|
||||
#if defined(STM32F4) && SERIAL_PORT == 0
|
||||
#error "Serial port 0 does not exist"
|
||||
#endif
|
||||
|
||||
#if !WITHIN(SERIAL_PORT, -1, 6)
|
||||
#error "SERIAL_PORT must be from -1 to 6"
|
||||
#endif
|
||||
#if SERIAL_PORT == -1
|
||||
#error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
|
||||
#elif SERIAL_PORT == -1
|
||||
#define MYSERIAL0 SerialUSB
|
||||
#elif SERIAL_PORT == 1
|
||||
#define MYSERIAL0 SerialUART1
|
||||
@@ -68,19 +63,16 @@
|
||||
#define MYSERIAL0 SerialUART5
|
||||
#elif SERIAL_PORT == 6
|
||||
#define MYSERIAL0 SerialUART6
|
||||
#else
|
||||
#error "SERIAL_PORT must be from -1 to 6. Please update your configuration."
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if defined(STM32F4) && SERIAL_PORT_2 == 0
|
||||
#error "Serial port 0 does not exist"
|
||||
#endif
|
||||
#if !WITHIN(SERIAL_PORT_2, -1, 6)
|
||||
#error "SERIAL_PORT_2 must be from -1 to 6"
|
||||
#error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
|
||||
#elif SERIAL_PORT_2 == SERIAL_PORT
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL1 SerialUSB
|
||||
#elif SERIAL_PORT_2 == 1
|
||||
#define MYSERIAL1 SerialUART1
|
||||
@@ -94,11 +86,40 @@
|
||||
#define MYSERIAL1 SerialUART5
|
||||
#elif SERIAL_PORT_2 == 6
|
||||
#define MYSERIAL1 SerialUART6
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration."
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#else
|
||||
#define NUM_SERIAL 1
|
||||
#endif
|
||||
|
||||
#ifdef DGUS_SERIAL_PORT
|
||||
#if defined(STM32F4) && DGUS_SERIAL_PORT == 0
|
||||
#error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == SERIAL_PORT
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
|
||||
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
|
||||
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
|
||||
#elif DGUS_SERIAL_PORT == -1
|
||||
#define DGUS_SERIAL SerialUSB
|
||||
#elif DGUS_SERIAL_PORT == 1
|
||||
#define DGUS_SERIAL SerialUART1
|
||||
#elif DGUS_SERIAL_PORT == 2
|
||||
#define DGUS_SERIAL SerialUART2
|
||||
#elif DGUS_SERIAL_PORT == 3
|
||||
#define DGUS_SERIAL SerialUART3
|
||||
#elif DGUS_SERIAL_PORT == 4
|
||||
#define DGUS_SERIAL SerialUART4
|
||||
#elif DGUS_SERIAL_PORT == 5
|
||||
#define DGUS_SERIAL SerialUART5
|
||||
#elif DGUS_SERIAL_PORT == 6
|
||||
#define DGUS_SERIAL SerialUART6
|
||||
#else
|
||||
#error "DGUS_SERIAL_PORT must be from -1 to 6. Please update your configuration."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* TODO: review this to return 1 for pins that are not analog input
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "TMC2660.h"
|
||||
|
||||
#include "../../../inc/MarlinConfig.h"
|
||||
#include "../../../Marlin.h"
|
||||
#include "../../../MarlinCore.h"
|
||||
#include "../../../module/stepper/indirection.h"
|
||||
#include "../../../module/printcounter.h"
|
||||
#include "../../../libs/duration_t.h"
|
||||
|
||||
@@ -35,3 +35,7 @@
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
#error "FAST_PWM_FAN is not yet implemented for this platform."
|
||||
#endif
|
||||
|
||||
#if TMC_HAS_SW_SERIAL
|
||||
#error "TMC220x Software Serial is not supported on this platform."
|
||||
#endif
|
||||
|
||||
@@ -32,3 +32,7 @@
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
#error "FAST_PWM_FAN is not yet implemented for this platform."
|
||||
#endif
|
||||
|
||||
#if TMC_HAS_SW_SERIAL
|
||||
#error "TMC220x Software Serial is not supported on this platform."
|
||||
#endif
|
||||
|
||||
@@ -32,3 +32,7 @@
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
#error "FAST_PWM_FAN is not yet implemented for this platform."
|
||||
#endif
|
||||
|
||||
#if TMC_HAS_SW_SERIAL
|
||||
#error "TMC220x Software Serial is not supported on this platform."
|
||||
#endif
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
constexpr bool
|
||||
#if HAS_DGUS_LCD
|
||||
bDGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS = (false
|
||||
#if ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS)
|
||||
|| true
|
||||
#endif
|
||||
),
|
||||
#endif
|
||||
bSERIAL_XON_XOFF = (false
|
||||
#if ENABLED(SERIAL_XON_XOFF)
|
||||
|| true
|
||||
|
||||
@@ -164,7 +164,7 @@ typedef struct {
|
||||
* link register (i.e. not a normal register) and the stack pointer value
|
||||
* supplied.
|
||||
*
|
||||
* -If the program was compiled with -funwind-tables , it will use them to
|
||||
* -If the program was compiled with -funwind-tables it will use them to
|
||||
* perform the traceback. Otherwise, brute force will be employed
|
||||
* -If the program was compiled with -mpoke-function-name, then you will
|
||||
* get function names in the traceback. Otherwise, you will not.
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* - https://github.com/grbl/grbl
|
||||
*/
|
||||
|
||||
#include "Marlin.h"
|
||||
#include "MarlinCore.h"
|
||||
|
||||
#include "core/utility.h"
|
||||
#include "lcd/ultralcd.h"
|
||||
@@ -553,7 +553,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
|
||||
bool oldstatus;
|
||||
switch (active_extruder) {
|
||||
default:
|
||||
#define _CASE_EN(N) case N: oldstatus = E##N_ENABLE_READ(); enable_E##N(); break;
|
||||
#define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); enable_E##N(); break;
|
||||
REPEAT(E_STEPPERS, _CASE_EN);
|
||||
}
|
||||
#endif
|
||||
@@ -1128,10 +1128,9 @@ void setup() {
|
||||
* - Call inactivity manager
|
||||
*/
|
||||
void loop() {
|
||||
do {
|
||||
|
||||
for (;;) {
|
||||
|
||||
idle(); // Do an idle first so boot is slightly faster
|
||||
idle();
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
card.checkautostart();
|
||||
@@ -1141,5 +1140,10 @@ void loop() {
|
||||
queue.advance();
|
||||
|
||||
endstops.event_handler();
|
||||
}
|
||||
|
||||
} while (false // Return to caller for best compatibility
|
||||
#ifdef __AVR__
|
||||
|| true // Loop forever on slower (AVR) boards
|
||||
#endif
|
||||
);
|
||||
}
|
||||
+56
-40
@@ -64,7 +64,7 @@
|
||||
#define BOARD_MKS_BASE_HEROIC 1108 // MKS BASE 1.0 with Heroic HR4982 stepper drivers
|
||||
#define BOARD_MKS_GEN_13 1109 // MKS GEN v1.3 or 1.4
|
||||
#define BOARD_MKS_GEN_L 1110 // MKS GEN L
|
||||
#define BOARD_KFB_2 1111 // Bigtreetech or BIQU KFB2.0
|
||||
#define BOARD_KFB_2 1111 // BigTreeTech or BIQU KFB2.0
|
||||
#define BOARD_ZRIB_V20 1112 // zrib V2.0 control board (Chinese knock off RAMPS replica)
|
||||
#define BOARD_FELIX2 1113 // Felix 2.0+ Electronics Board (RAMPS like)
|
||||
#define BOARD_RIGIDBOARD 1114 // Invent-A-Part RigidBoard
|
||||
@@ -90,17 +90,18 @@
|
||||
#define BOARD_RAMPS_ENDER_4 1134 // Creality: Ender-4, CR-8
|
||||
#define BOARD_RAMPS_CREALITY 1135 // Creality: CR10S, CR20, CR-X
|
||||
#define BOARD_RAMPS_DAGOMA 1136 // Dagoma F5
|
||||
#define BOARD_FYSETC_F6_13 1137 // FYSETC F6
|
||||
#define BOARD_DUPLICATOR_I3_PLUS 1138 // Wanhao Duplicator i3 Plus
|
||||
#define BOARD_VORON 1139 // VORON Design
|
||||
#define BOARD_TRONXY_V3_1_0 1140 // Tronxy TRONXY-V3-1.0
|
||||
#define BOARD_Z_BOLT_X_SERIES 1141 // Z-Bolt X Series
|
||||
#define BOARD_TT_OSCAR 1142 // TT OSCAR
|
||||
#define BOARD_OVERLORD 1143 // Overlord/Overlord Pro
|
||||
#define BOARD_HJC2560C_REV1 1144 // ADIMLab Gantry v1
|
||||
#define BOARD_HJC2560C_REV2 1145 // ADIMLab Gantry v2
|
||||
#define BOARD_TANGO 1146 // BIQU Tango V1
|
||||
#define BOARD_MKS_GEN_L_V2 1147 // MKS GEN L V2
|
||||
#define BOARD_FYSETC_F6_13 1137 // FYSETC F6 1.3
|
||||
#define BOARD_FYSETC_F6_14 1138 // FYSETC F6 1.4
|
||||
#define BOARD_DUPLICATOR_I3_PLUS 1139 // Wanhao Duplicator i3 Plus
|
||||
#define BOARD_VORON 1140 // VORON Design
|
||||
#define BOARD_TRONXY_V3_1_0 1141 // Tronxy TRONXY-V3-1.0
|
||||
#define BOARD_Z_BOLT_X_SERIES 1142 // Z-Bolt X Series
|
||||
#define BOARD_TT_OSCAR 1143 // TT OSCAR
|
||||
#define BOARD_OVERLORD 1144 // Overlord/Overlord Pro
|
||||
#define BOARD_HJC2560C_REV1 1145 // ADIMLab Gantry v1
|
||||
#define BOARD_HJC2560C_REV2 1146 // ADIMLab Gantry v2
|
||||
#define BOARD_TANGO 1147 // BIQU Tango V1
|
||||
#define BOARD_MKS_GEN_L_V2 1148 // MKS GEN L V2
|
||||
|
||||
//
|
||||
// RAMBo and derivatives
|
||||
@@ -138,6 +139,7 @@
|
||||
#define BOARD_GT2560_V3_A20 1318 // Geeetech GT2560 Rev B for A20(M/D)
|
||||
#define BOARD_EINSTART_S 1319 // Einstart retrofit
|
||||
#define BOARD_WANHAO_ONEPLUS 1320 // Wanhao 0ne+ i3 Mini
|
||||
#define BOARD_LEAPFROG_XEED2015 1321 // Leapfrog Xeed 2015
|
||||
|
||||
//
|
||||
// ATmega1281, ATmega2561
|
||||
@@ -201,21 +203,28 @@
|
||||
#define BOARD_RAMPS_14_RE_ARM_SF 2004 // Re-ARM with RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
|
||||
#define BOARD_MKS_SBASE 2005 // MKS-Sbase (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_AZSMZ_MINI 2006 // AZSMZ Mini
|
||||
#define BOARD_AZTEEG_X5_GT 2007 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_BIQU_BQ111_A4 2008 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed)
|
||||
#define BOARD_SELENA_COMPACT 2009 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1)
|
||||
#define BOARD_COHESION3D_REMIX 2010 // Cohesion3D ReMix
|
||||
#define BOARD_COHESION3D_MINI 2011 // Cohesion3D Mini
|
||||
#define BOARD_SMOOTHIEBOARD 2012 // Smoothieboard
|
||||
#define BOARD_AZTEEG_X5_MINI_WIFI 2013 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan)
|
||||
#define BOARD_BIGTREE_SKR_V1_1 2014 // BIGTREE SKR_V1.1 (Power outputs: Hotend0,Hotend1, Fan, Bed)
|
||||
#define BOARD_BIQU_B300_V1_0 2015 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver)
|
||||
#define BOARD_BIGTREE_SKR_V1_3 2016 // BIGTREE SKR_V1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_AZTEEG_X5_MINI 2017 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan)
|
||||
#define BOARD_MKS_SGEN 2018 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_MKS_SGEN_L 2019 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_TH3D_EZBOARD 2020 // TH3D EZBoard v1.0
|
||||
#define BOARD_GMARSH_X6_REV1 2021 // GMARSH X6 board, revision 1 prototype
|
||||
#define BOARD_BIQU_BQ111_A4 2007 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed)
|
||||
#define BOARD_SELENA_COMPACT 2008 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1)
|
||||
#define BOARD_BIQU_B300_V1_0 2009 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver)
|
||||
#define BOARD_MKS_SGEN_L 2010 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_GMARSH_X6_REV1 2011 // GMARSH X6 board, revision 1 prototype
|
||||
#define BOARD_BIGTREE_SKR_V1_1 2012 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_BIGTREE_SKR_V1_3 2013 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_BIGTREE_SKR_V1_4 2014 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
|
||||
//
|
||||
// LPC1769 ARM Cortex M3
|
||||
//
|
||||
|
||||
#define BOARD_MKS_SGEN 2500 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_AZTEEG_X5_GT 2501 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_AZTEEG_X5_MINI 2502 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan)
|
||||
#define BOARD_AZTEEG_X5_MINI_WIFI 2503 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan)
|
||||
#define BOARD_COHESION3D_REMIX 2504 // Cohesion3D ReMix
|
||||
#define BOARD_COHESION3D_MINI 2505 // Cohesion3D Mini
|
||||
#define BOARD_SMOOTHIEBOARD 2506 // Smoothieboard
|
||||
#define BOARD_TH3D_EZBOARD 2507 // TH3D EZBoard v1.0
|
||||
#define BOARD_BIGTREE_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
|
||||
//
|
||||
// SAM3X8E ARM Cortex M3
|
||||
@@ -269,18 +278,21 @@
|
||||
#define BOARD_MKS_ROBIN_MINI 4007 // MKS Robin Mini (STM32F103VET6)
|
||||
#define BOARD_MKS_ROBIN_NANO 4008 // MKS Robin Nano (STM32F103VET6)
|
||||
#define BOARD_MKS_ROBIN_LITE 4009 // MKS Robin Lite/Lite2 (STM32F103RCT6)
|
||||
#define BOARD_BIGTREE_SKR_MINI_V1_1 4010 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
|
||||
#define BOARD_BTT_SKR_MINI_E3_V1_0 4011 // BigTreeTech SKR Mini E3 (STM32F103RC)
|
||||
#define BOARD_BTT_SKR_MINI_E3_V1_2 4012 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
|
||||
#define BOARD_BIGTREE_SKR_E3_DIP 4013 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_JGAURORA_A5S_A1 4014 // JGAurora A5S A1 (STM32F103ZET6)
|
||||
#define BOARD_FYSETC_AIO_II 4015 // FYSETC AIO_II
|
||||
#define BOARD_FYSETC_CHEETAH 4016 // FYSETC Cheetah
|
||||
#define BOARD_FYSETC_CHEETAH_V12 4017 // FYSETC Cheetah V1.2
|
||||
#define BOARD_LONGER3D_LK 4018 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
|
||||
#define BOARD_GTM32_MINI 4019 // STM32F103VET6 controller
|
||||
#define BOARD_GTM32_MINI_A30 4020 // STM32F103VET6 controller
|
||||
#define BOARD_GTM32_REV_B 4021 // STM32F103VET6 controller
|
||||
#define BOARD_MKS_ROBIN_LITE3 4010 // MKS Robin Lite3 (STM32F103RCT6)
|
||||
#define BOARD_MKS_ROBIN_PRO 4011 // MKS Robin Pro (STM32F103ZET6)
|
||||
#define BOARD_BIGTREE_SKR_MINI_V1_1 4012 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
|
||||
#define BOARD_BTT_SKR_MINI_E3_V1_0 4013 // BigTreeTech SKR Mini E3 (STM32F103RC)
|
||||
#define BOARD_BTT_SKR_MINI_E3_V1_2 4014 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
|
||||
#define BOARD_BIGTREE_SKR_E3_DIP 4015 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_JGAURORA_A5S_A1 4016 // JGAurora A5S A1 (STM32F103ZET6)
|
||||
#define BOARD_FYSETC_AIO_II 4017 // FYSETC AIO_II
|
||||
#define BOARD_FYSETC_CHEETAH 4018 // FYSETC Cheetah
|
||||
#define BOARD_FYSETC_CHEETAH_V12 4019 // FYSETC Cheetah V1.2
|
||||
#define BOARD_LONGER3D_LK 4020 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
|
||||
#define BOARD_GTM32_MINI 4021 // STM32F103VET6 controller
|
||||
#define BOARD_GTM32_MINI_A30 4022 // STM32F103VET6 controller
|
||||
#define BOARD_GTM32_REV_B 4023 // STM32F103VET6 controller
|
||||
|
||||
|
||||
//
|
||||
// ARM Cortex-M4F
|
||||
@@ -299,13 +311,15 @@
|
||||
#define BOARD_RUMBA32 4203 // RUMBA32 STM32F4-based controller
|
||||
#define BOARD_BLACK_STM32F407VE 4204 // BLACK_STM32F407VE
|
||||
#define BOARD_BLACK_STM32F407ZE 4205 // BLACK_STM32F407ZE
|
||||
#define BOARD_STEVAL 4206 // STEVAL-3DP001V1 3D PRINTER BOARD
|
||||
#define BOARD_STEVAL_3DP001V1 4206 // STEVAL-3DP001V1 3D PRINTER BOARD
|
||||
#define BOARD_BIGTREE_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
|
||||
#define BOARD_BIGTREE_BTT002_V1_0 4208 // BigTreeTech BTT002 v1.0 (STM32F407VE)
|
||||
#define BOARD_LERDGE_K 4209 // Lerdge K (STM32F407ZG)
|
||||
#define BOARD_LERDGE_X 4210 // Lerdge X (STM32F407VE)
|
||||
#define BOARD_VAKE403D 4211 // VAkE 403D (STM32F446VET6)
|
||||
#define BOARD_FYSETC_S6 4212 // FYSETC S6 board
|
||||
#define BOARD_FLYF407ZG 4213 // FLYF407ZG board (STM32F407ZG)
|
||||
#define BOARD_MKS_ROBIN2 4214 // MKS_ROBIN2 (STM32F407ZE)
|
||||
|
||||
//
|
||||
// ARM Cortex M7
|
||||
@@ -318,6 +332,8 @@
|
||||
// Espressif ESP32 WiFi
|
||||
//
|
||||
#define BOARD_ESPRESSIF_ESP32 6000
|
||||
#define BOARD_MRR_ESPA 6001
|
||||
#define BOARD_MRR_ESPE 6002
|
||||
|
||||
//
|
||||
// Simulations
|
||||
|
||||
+50
-36
@@ -23,30 +23,30 @@
|
||||
|
||||
#include "../inc/MarlinConfigPre.h"
|
||||
|
||||
#define _A4988 0x001
|
||||
#define _A5984 0x002
|
||||
#define _DRV8825 0x003
|
||||
#define _LV8729 0x004
|
||||
#define _L6470 0x105
|
||||
#define _TB6560 0x006
|
||||
#define _TB6600 0x007
|
||||
#define _TMC2100 0x008
|
||||
#define _TMC2130 2130
|
||||
#define _TMC2130_STANDALONE 0x009
|
||||
#define _TMC2160 2160
|
||||
#define _TMC2160_STANDALONE 2161
|
||||
#define _TMC2208 2208
|
||||
#define _TMC2208_STANDALONE 0x00A
|
||||
#define _TMC2209 2209
|
||||
#define _TMC2209_STANDALONE 0x00D
|
||||
#define _TMC26X 0x10B
|
||||
#define _TMC26X_STANDALONE 0x00B
|
||||
#define _TMC2660 2660
|
||||
#define _TMC2660_STANDALONE 0x00C
|
||||
#define _TMC5130 5130
|
||||
#define _TMC5130_STANDALONE 5131
|
||||
#define _TMC5160 5160
|
||||
#define _TMC5160_STANDALONE 5161
|
||||
#define _A4988 0x4988
|
||||
#define _A5984 0x5984
|
||||
#define _DRV8825 0x8825
|
||||
#define _LV8729 0x8729
|
||||
#define _L6470 0x6470
|
||||
#define _TB6560 0x6560
|
||||
#define _TB6600 0x6600
|
||||
#define _TMC2100 0x2100
|
||||
#define _TMC2130 0x2130A
|
||||
#define _TMC2130_STANDALONE 0x2130B
|
||||
#define _TMC2160 0x2160A
|
||||
#define _TMC2160_STANDALONE 0x2160B
|
||||
#define _TMC2208 0x2208A
|
||||
#define _TMC2208_STANDALONE 0x2208B
|
||||
#define _TMC2209 0x2209A
|
||||
#define _TMC2209_STANDALONE 0x2209B
|
||||
#define _TMC26X 0x2600A
|
||||
#define _TMC26X_STANDALONE 0x2600B
|
||||
#define _TMC2660 0x2660A
|
||||
#define _TMC2660_STANDALONE 0x2660B
|
||||
#define _TMC5130 0x5130A
|
||||
#define _TMC5130_STANDALONE 0x5130B
|
||||
#define _TMC5160 0x5160A
|
||||
#define _TMC5160_STANDALONE 0x5160B
|
||||
|
||||
#define _DRIVER_ID(V) _CAT(_, V)
|
||||
#define _AXIS_DRIVER_TYPE(A,T) (_DRIVER_ID(A##_DRIVER_TYPE) == _CAT(_, T))
|
||||
@@ -86,6 +86,18 @@
|
||||
|| HAS_DRIVER(TMC5130) \
|
||||
|| HAS_DRIVER(TMC5160) )
|
||||
|
||||
#define HAS_TRINAMIC_STANDALONE ( HAS_DRIVER(TMC2130_STANDALONE) \
|
||||
|| HAS_DRIVER(TMC2208_STANDALONE) \
|
||||
|| HAS_DRIVER(TMC2209_STANDALONE) \
|
||||
|| HAS_DRIVER(TMC26X_STANDALONE) \
|
||||
|| HAS_DRIVER(TMC2660_STANDALONE) \
|
||||
|| HAS_DRIVER(TMC5130_STANDALONE) \
|
||||
|| HAS_DRIVER(TMC5160_STANDALONE) \
|
||||
|| HAS_DRIVER(TMC2160_STANDALONE) )
|
||||
|
||||
#define HAS_TMCX1X0 ( HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2160) \
|
||||
|| HAS_DRIVER(TMC5130) || HAS_DRIVER(TMC5160))
|
||||
|
||||
#define HAS_TMC220x (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209))
|
||||
|
||||
#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \
|
||||
@@ -107,6 +119,8 @@
|
||||
#define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) \
|
||||
|| AXIS_DRIVER_TYPE(A,TMC2209) )
|
||||
|
||||
#define AXIS_HAS_SW_SERIAL(A) ((AXIS_HAS_UART(A) && !defined(A##_HARDWARE_SERIAL)))
|
||||
|
||||
#define AXIS_HAS_STALLGUARD(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \
|
||||
|| AXIS_DRIVER_TYPE(A,TMC2160) \
|
||||
|| AXIS_DRIVER_TYPE(A,TMC2209) \
|
||||
@@ -121,19 +135,19 @@
|
||||
|| AXIS_DRIVER_TYPE(A,TMC5130) \
|
||||
|| AXIS_DRIVER_TYPE(A,TMC5160) )
|
||||
|
||||
#define HAS_TMC_E_DRIVER ( HAS_E_DRIVER(TMC2130) \
|
||||
|| HAS_E_DRIVER(TMC2160) \
|
||||
|| HAS_E_DRIVER(TMC2660) \
|
||||
|| HAS_E_DRIVER(TMC2209) \
|
||||
|| HAS_E_DRIVER(TMC5130) \
|
||||
|| HAS_E_DRIVER(TMC5160) )
|
||||
#define ANY_AXIS_HAS(T) ( AXIS_HAS_##T(X) || AXIS_HAS_##T(X2) \
|
||||
|| AXIS_HAS_##T(Y) || AXIS_HAS_##T(Y2) \
|
||||
|| AXIS_HAS_##T(Z) || AXIS_HAS_##T(Z2) \
|
||||
|| AXIS_HAS_##T(Z3) \
|
||||
|| AXIS_HAS_##T(E0) || AXIS_HAS_##T(E1) \
|
||||
|| AXIS_HAS_##T(E2) || AXIS_HAS_##T(E3) \
|
||||
|| AXIS_HAS_##T(E4) || AXIS_HAS_##T(E5) )
|
||||
|
||||
#define HAS_STEALTHCHOP ANY_AXIS_HAS(STEALTHCHOP)
|
||||
#define HAS_STALLGUARD ANY_AXIS_HAS(STALLGUARD)
|
||||
#define TMC_HAS_SPI ANY_AXIS_HAS(SPI)
|
||||
#define TMC_HAS_SW_SERIAL ANY_AXIS_HAS(SW_SERIAL)
|
||||
|
||||
#define HAS_TMC_STANDALONE_E_DRIVER ( HAS_E_DRIVER(TMC2130_STANDALONE) \
|
||||
|| HAS_E_DRIVER(TMC2160_STANDALONE) \
|
||||
|| HAS_E_DRIVER(TMC2660_STANDALONE) \
|
||||
|| HAS_E_DRIVER(TMC2209_STANDALONE) \
|
||||
|| HAS_E_DRIVER(TMC5130_STANDALONE) \
|
||||
|| HAS_E_DRIVER(TMC5160_STANDALONE) )
|
||||
//
|
||||
// Stretching 'drivers.h' to include LPC/SAMD51 SD options
|
||||
//
|
||||
|
||||
@@ -252,10 +252,10 @@
|
||||
#define MSG_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108"
|
||||
#define MSG_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume"
|
||||
|
||||
#define MSG_STOP_BLTOUCH "STOP called because of BLTouch error - restart with M999"
|
||||
#define MSG_STOP_UNHOMED "STOP called because of unhomed error - restart with M999"
|
||||
#define MSG_KILL_INACTIVE_TIME "KILL caused by too much inactive time - current command: "
|
||||
#define MSG_KILL_BUTTON "KILL caused by KILL button/pin"
|
||||
#define MSG_STOP_BLTOUCH "!! STOP called because of BLTouch error - restart with M999"
|
||||
#define MSG_STOP_UNHOMED "!! STOP called because of unhomed error - restart with M999"
|
||||
#define MSG_KILL_INACTIVE_TIME "!! KILL caused by too much inactive time - current command: "
|
||||
#define MSG_KILL_BUTTON "!! KILL caused by KILL button/pin"
|
||||
|
||||
// temperature.cpp strings
|
||||
#define MSG_PID_AUTOTUNE_PREFIX "PID Autotune"
|
||||
|
||||
@@ -75,7 +75,7 @@ extern uint8_t marlin_debug_flags;
|
||||
#define SERIAL_PRINTF(V...) SERIAL_OUT(printf, V)
|
||||
#define SERIAL_FLUSH() SERIAL_OUT(flush)
|
||||
|
||||
#ifdef __STM32F1__
|
||||
#ifdef ARDUINO_ARCH_STM32
|
||||
#define SERIAL_FLUSHTX() SERIAL_OUT(flush)
|
||||
#elif TX_BUFFER_SIZE > 0
|
||||
#define SERIAL_FLUSHTX() SERIAL_OUT(flushTX)
|
||||
|
||||
@@ -97,6 +97,7 @@ typedef float feedRate_t;
|
||||
#define _LS(N) (N = (T)(uint32_t(N) << v))
|
||||
#define _RS(N) (N = (T)(uint32_t(N) >> v))
|
||||
#define FI FORCE_INLINE
|
||||
#define SWAP(x, y) do { typeof(x) SWAP = x; x = y; y = SWAP; } while (0)
|
||||
|
||||
// Forward declarations
|
||||
template<typename T> struct XYval;
|
||||
|
||||
+40
-29
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "utility.h"
|
||||
|
||||
#include "../Marlin.h"
|
||||
#include "../MarlinCore.h"
|
||||
#include "../module/temperature.h"
|
||||
|
||||
void safe_delay(millis_t ms) {
|
||||
@@ -59,6 +59,8 @@ void safe_delay(millis_t ms) {
|
||||
SERIAL_ECHOLNPGM("Probe: "
|
||||
#if ENABLED(PROBE_MANUALLY)
|
||||
"PROBE_MANUALLY"
|
||||
#elif ENABLED(NOZZLE_AS_PROBE)
|
||||
"NOZZLE_AS_PROBE"
|
||||
#elif ENABLED(FIX_MOUNTED_PROBE)
|
||||
"FIX_MOUNTED_PROBE"
|
||||
#elif ENABLED(BLTOUCH)
|
||||
@@ -79,40 +81,49 @@ void safe_delay(millis_t ms) {
|
||||
);
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
SERIAL_ECHOPAIR_P(PSTR("Probe Offset X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z);
|
||||
if (probe_offset.x > 0)
|
||||
SERIAL_ECHOPGM(" (Right");
|
||||
else if (probe_offset.x < 0)
|
||||
SERIAL_ECHOPGM(" (Left");
|
||||
else if (probe_offset.y != 0)
|
||||
SERIAL_ECHOPGM(" (Middle");
|
||||
else
|
||||
SERIAL_ECHOPGM(" (Aligned With");
|
||||
|
||||
if (probe_offset.y > 0) {
|
||||
#if IS_SCARA
|
||||
SERIAL_ECHOPGM("-Distal");
|
||||
#else
|
||||
SERIAL_ECHOPGM("-Back");
|
||||
#endif
|
||||
}
|
||||
else if (probe_offset.y < 0) {
|
||||
#if IS_SCARA
|
||||
SERIAL_ECHOPGM("-Proximal");
|
||||
#else
|
||||
SERIAL_ECHOPGM("-Front");
|
||||
#endif
|
||||
}
|
||||
else if (probe_offset.x != 0)
|
||||
SERIAL_ECHOPGM("-Center");
|
||||
#if !HAS_PROBE_XY_OFFSET
|
||||
SERIAL_ECHOPAIR("Probe Offset X0 Y0 Z", probe_offset.z, " (");
|
||||
#else
|
||||
SERIAL_ECHOPAIR_P(PSTR("Probe Offset X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z);
|
||||
if (probe_offset.x > 0)
|
||||
SERIAL_ECHOPGM(" (Right");
|
||||
else if (probe_offset.x < 0)
|
||||
SERIAL_ECHOPGM(" (Left");
|
||||
else if (probe_offset.y != 0)
|
||||
SERIAL_ECHOPGM(" (Middle");
|
||||
else
|
||||
SERIAL_ECHOPGM(" (Aligned With");
|
||||
|
||||
if (probe_offset.y > 0) {
|
||||
#if IS_SCARA
|
||||
SERIAL_ECHOPGM("-Distal");
|
||||
#else
|
||||
SERIAL_ECHOPGM("-Back");
|
||||
#endif
|
||||
}
|
||||
else if (probe_offset.y < 0) {
|
||||
#if IS_SCARA
|
||||
SERIAL_ECHOPGM("-Proximal");
|
||||
#else
|
||||
SERIAL_ECHOPGM("-Front");
|
||||
#endif
|
||||
}
|
||||
else if (probe_offset.x != 0)
|
||||
SERIAL_ECHOPGM("-Center");
|
||||
|
||||
SERIAL_ECHOPGM(" & ");
|
||||
|
||||
#endif
|
||||
|
||||
if (probe_offset.z < 0)
|
||||
SERIAL_ECHOPGM(" & Below");
|
||||
SERIAL_ECHOPGM("Below");
|
||||
else if (probe_offset.z > 0)
|
||||
SERIAL_ECHOPGM(" & Above");
|
||||
SERIAL_ECHOPGM("Above");
|
||||
else
|
||||
SERIAL_ECHOPGM(" & Same Z as");
|
||||
SERIAL_ECHOPGM("Same Z as");
|
||||
SERIAL_ECHOLNPGM(" Nozzle)");
|
||||
|
||||
#endif
|
||||
|
||||
#if HAS_ABL_OR_UBL
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
#include "../module/planner.h"
|
||||
#include "../module/stepper.h"
|
||||
#include "../Marlin.h"
|
||||
#include "../MarlinCore.h"
|
||||
#include "../HAL/shared/Delay.h"
|
||||
|
||||
#define HAS_SIDE_BY_SIDE (ENABLED(MAX7219_SIDE_BY_SIDE) && MAX7219_NUMBER_UNITS > 1)
|
||||
@@ -455,15 +455,19 @@ void Max7219::register_setup() {
|
||||
#ifdef MAX7219_INIT_TEST
|
||||
#if MAX7219_INIT_TEST == 2
|
||||
|
||||
#define MAX7219_LEDS (MAX7219_X_LEDS * MAX7219_Y_LEDS)
|
||||
|
||||
void Max7219::spiral(const bool on, const uint16_t del) {
|
||||
constexpr int8_t way[] = { 1, 0, 0, 1, -1, 0, 0, -1 };
|
||||
constexpr int8_t way[][2] = { { 1, 0 }, { 0, 1 }, { -1, 0 }, { 0, -1 } };
|
||||
int8_t px = 0, py = 0, dir = 0;
|
||||
for (uint8_t i = MAX7219_X_LEDS * MAX7219_Y_LEDS; i--;) {
|
||||
for (IF<(MAX7219_LEDS > 255), uint16_t, uint8_t>::type i = MAX7219_LEDS; i--;) {
|
||||
led_set(px, py, on);
|
||||
delay(del);
|
||||
const int8_t x = px + way[dir], y = py + way[dir + 1];
|
||||
if (!WITHIN(x, 0, MAX7219_X_LEDS - 1) || !WITHIN(y, 0, MAX7219_Y_LEDS - 1) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7;
|
||||
px += way[dir]; py += way[dir + 1];
|
||||
const int8_t x = px + way[dir][0], y = py + way[dir][1];
|
||||
if (!WITHIN(x, 0, MAX7219_X_LEDS - 1) || !WITHIN(y, 0, MAX7219_Y_LEDS - 1) || BIT_7219(x, y) == on)
|
||||
dir = (dir + 1) & 0x3;
|
||||
px += way[dir][0];
|
||||
py += way[dir][1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
|
||||
#include "babystep.h"
|
||||
#include "../Marlin.h"
|
||||
#include "../MarlinCore.h"
|
||||
#include "../module/planner.h"
|
||||
#include "../module/stepper.h"
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
// Add XY probe offset from extruder because probe_at_point() subtracts them when
|
||||
// moving to the XY position to be measured. This ensures better agreement between
|
||||
// the current Z position after G28 and the mesh values.
|
||||
const xy_int8_t curr = closest_indexes(xy_pos_t(current_position) + xy_pos_t(probe_offset));
|
||||
const xy_int8_t curr = closest_indexes(xy_pos_t(current_position) + probe_offset_xy);
|
||||
|
||||
if (!lcd) SERIAL_EOL();
|
||||
for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../bedlevel.h"
|
||||
|
||||
#include "../../../Marlin.h"
|
||||
#include "../../../MarlinCore.h"
|
||||
#include "../../../HAL/shared/persistent_store_api.h"
|
||||
#include "../../../libs/hex_print_routines.h"
|
||||
#include "../../../module/configuration_store.h"
|
||||
@@ -450,7 +450,7 @@
|
||||
SERIAL_ECHO(g29_pos.y);
|
||||
SERIAL_ECHOLNPGM(").\n");
|
||||
}
|
||||
const xy_pos_t near = g29_pos + probe_offset;
|
||||
const xy_pos_t near = g29_pos + probe_offset_xy;
|
||||
probe_entire_mesh(near, parser.seen('T'), parser.seen('E'), parser.seen('U'));
|
||||
|
||||
report_current_position();
|
||||
@@ -468,6 +468,7 @@
|
||||
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
|
||||
|
||||
if (parser.seen('C') && !xy_seen) {
|
||||
|
||||
/**
|
||||
* Use a good default location for the path.
|
||||
* The flipped > and < operators in these comparisons is intentional.
|
||||
@@ -479,8 +480,8 @@
|
||||
#if IS_KINEMATIC
|
||||
X_HOME_POS, Y_HOME_POS
|
||||
#else
|
||||
probe_offset.x > 0 ? X_BED_SIZE : 0,
|
||||
probe_offset.y < 0 ? Y_BED_SIZE : 0
|
||||
probe_offset_xy.x > 0 ? X_BED_SIZE : 0,
|
||||
probe_offset_xy.y < 0 ? Y_BED_SIZE : 0
|
||||
#endif
|
||||
);
|
||||
}
|
||||
@@ -805,8 +806,8 @@
|
||||
restore_ubl_active_state_and_leave();
|
||||
|
||||
do_blocking_move_to_xy(
|
||||
constrain(near.x - probe_offset.x, MESH_MIN_X, MESH_MAX_X),
|
||||
constrain(near.y - probe_offset.y, MESH_MIN_Y, MESH_MAX_Y)
|
||||
constrain(near.x - probe_offset_xy.x, MESH_MIN_X, MESH_MAX_X),
|
||||
constrain(near.y - probe_offset_xy.y, MESH_MIN_Y, MESH_MAX_Y)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1293,7 +1294,7 @@
|
||||
closest.distance = -99999.9f;
|
||||
|
||||
// Get the reference position, either nozzle or probe
|
||||
const xy_pos_t ref = probe_relative ? pos + probe_offset : pos;
|
||||
const xy_pos_t ref = probe_relative ? pos + probe_offset_xy : pos;
|
||||
|
||||
float best_so_far = 99999.99f;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "../../../module/delta.h"
|
||||
#endif
|
||||
|
||||
#include "../../../Marlin.h"
|
||||
#include "../../../MarlinCore.h"
|
||||
#include <math.h>
|
||||
|
||||
#if !UBL_SEGMENTED
|
||||
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
static bool file_open(char* filename) {
|
||||
if (!dummy_transfer) {
|
||||
card.mount();
|
||||
card.openFile(filename, false);
|
||||
card.openFileWrite(filename);
|
||||
if (!card.isFileOpen()) return false;
|
||||
}
|
||||
transfer_active = true;
|
||||
|
||||
@@ -58,7 +58,9 @@ void update_case_light() {
|
||||
if (case_light_arg_flag && case_light_on)
|
||||
case_light_brightness = case_light_brightness_sav; // restore last brightens if this is an S1 argument
|
||||
|
||||
const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i;
|
||||
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) || NONE(CASE_LIGHT_USE_NEOPIXEL, CASE_LIGHT_NO_BRIGHTNESS)
|
||||
const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i;
|
||||
#endif
|
||||
|
||||
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
|
||||
|
||||
@@ -71,13 +73,13 @@ void update_case_light() {
|
||||
|
||||
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
|
||||
if (PWM_PIN(CASE_LIGHT_PIN))
|
||||
analogWrite(pin_t(CASE_LIGHT_PIN),
|
||||
analogWrite(pin_t(CASE_LIGHT_PIN), (
|
||||
#if CASE_LIGHT_MAX_PWM == 255
|
||||
n10ct
|
||||
#else
|
||||
map(n10ct, 0, 255, 0, CASE_LIGHT_MAX_PWM)
|
||||
#endif
|
||||
);
|
||||
));
|
||||
else
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "dac_dac084s085.h"
|
||||
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
#include "../../module/stepper.h"
|
||||
#include "../../HAL/shared/Delay.h"
|
||||
|
||||
|
||||
@@ -42,25 +42,40 @@ Joystick joystick;
|
||||
|
||||
#if HAS_JOY_ADC_X
|
||||
temp_info_t Joystick::x; // = { 0 }
|
||||
#if ENABLED(INVERT_JOY_X)
|
||||
#define JOY_X(N) (16383 - (N))
|
||||
#else
|
||||
#define JOY_X(N) (N)
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_JOY_ADC_Y
|
||||
temp_info_t Joystick::y; // = { 0 }
|
||||
#if ENABLED(INVERT_JOY_Y)
|
||||
#define JOY_Y(N) (16383 - (N))
|
||||
#else
|
||||
#define JOY_Y(N) (N)
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_JOY_ADC_Z
|
||||
temp_info_t Joystick::z; // = { 0 }
|
||||
#if ENABLED(INVERT_JOY_Z)
|
||||
#define JOY_Z(N) (16383 - (N))
|
||||
#else
|
||||
#define JOY_Z(N) (N)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(JOYSTICK_DEBUG)
|
||||
void Joystick::report() {
|
||||
SERIAL_ECHOPGM("Joystick");
|
||||
#if HAS_JOY_ADC_X
|
||||
SERIAL_ECHOPAIR_P(SP_X_STR, x.raw);
|
||||
SERIAL_ECHOPAIR_P(SP_X_STR, JOY_X(x.raw));
|
||||
#endif
|
||||
#if HAS_JOY_ADC_Y
|
||||
SERIAL_ECHOPAIR_P(SP_Y_STR, y.raw);
|
||||
SERIAL_ECHOPAIR_P(SP_Y_STR, JOY_Y(y.raw));
|
||||
#endif
|
||||
#if HAS_JOY_ADC_Z
|
||||
SERIAL_ECHOPAIR_P(SP_Z_STR, z.raw);
|
||||
SERIAL_ECHOPAIR_P(SP_Z_STR, JOY_Z(z.raw));
|
||||
#endif
|
||||
#if HAS_JOY_ADC_EN
|
||||
SERIAL_ECHO_TERNARY(READ(JOY_EN_PIN), " EN=", "HIGH (dis", "LOW (en", "abled)");
|
||||
@@ -91,15 +106,15 @@ Joystick joystick;
|
||||
|
||||
#if HAS_JOY_ADC_X
|
||||
static constexpr int16_t joy_x_limits[4] = JOY_X_LIMITS;
|
||||
_normalize_joy(norm_jog.x, x.raw, joy_x_limits);
|
||||
_normalize_joy(norm_jog.x, JOY_X(x.raw), joy_x_limits);
|
||||
#endif
|
||||
#if HAS_JOY_ADC_Y
|
||||
static constexpr int16_t joy_y_limits[4] = JOY_Y_LIMITS;
|
||||
_normalize_joy(norm_jog.y, y.raw, joy_y_limits);
|
||||
_normalize_joy(norm_jog.y, JOY_Y(y.raw), joy_y_limits);
|
||||
#endif
|
||||
#if HAS_JOY_ADC_Z
|
||||
static constexpr int16_t joy_z_limits[4] = JOY_Z_LIMITS;
|
||||
_normalize_joy(norm_jog.z, z.raw, joy_z_limits);
|
||||
_normalize_joy(norm_jog.z, JOY_Z(z.raw), joy_z_limits);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
|
||||
#include "../Marlin.h"
|
||||
#include "../MarlinCore.h"
|
||||
#include "../gcode/gcode.h"
|
||||
#include "../module/motion.h"
|
||||
#include "../module/planner.h"
|
||||
@@ -345,14 +345,14 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
|
||||
#endif
|
||||
|
||||
// Retract filament
|
||||
do_pause_e_move(-(FILAMENT_UNLOAD_RETRACT_LENGTH) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
|
||||
do_pause_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
|
||||
|
||||
// Wait for filament to cool
|
||||
safe_delay(FILAMENT_UNLOAD_DELAY);
|
||||
safe_delay(FILAMENT_UNLOAD_PURGE_DELAY);
|
||||
|
||||
// Quickly purge
|
||||
do_pause_e_move((FILAMENT_UNLOAD_RETRACT_LENGTH + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier,
|
||||
planner.settings.max_feedrate_mm_s[E_AXIS] * mix_multiplier);
|
||||
do_pause_e_move((FILAMENT_UNLOAD_PURGE_RETRACT + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier,
|
||||
(FILAMENT_UNLOAD_PURGE_FEEDRATE) * mix_multiplier);
|
||||
|
||||
// Unload filament
|
||||
#if FILAMENT_CHANGE_UNLOAD_ACCEL > 0
|
||||
@@ -694,6 +694,10 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
|
||||
thermalManager.set_fans_paused(false);
|
||||
#endif
|
||||
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
runout.reset();
|
||||
#endif
|
||||
|
||||
// Resume the print job timer if it was running
|
||||
if (print_job_timer.isPaused()) print_job_timer.start();
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "power.h"
|
||||
#include "../module/temperature.h"
|
||||
#include "../module/stepper/indirection.h"
|
||||
#include "../Marlin.h"
|
||||
#include "../MarlinCore.h"
|
||||
|
||||
Power powerManager;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ MMU2 mmu2;
|
||||
#include "../../module/temperature.h"
|
||||
#include "../../module/planner.h"
|
||||
#include "../../module/stepper/indirection.h"
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
#include "../../feature/host_actions.h"
|
||||
|
||||
@@ -61,7 +61,7 @@ void FilamentSensorBase::filament_present(const uint8_t extruder) {
|
||||
//
|
||||
// Filament Runout event handler
|
||||
//
|
||||
#include "../Marlin.h"
|
||||
#include "../MarlinCore.h"
|
||||
#include "../gcode/queue.h"
|
||||
|
||||
#if ENABLED(HOST_ACTION_COMMANDS)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if HAS_TRINAMIC
|
||||
|
||||
#include "tmc_util.h"
|
||||
#include "../Marlin.h"
|
||||
#include "../MarlinCore.h"
|
||||
|
||||
#include "../module/stepper/indirection.h"
|
||||
#include "../module/printcounter.h"
|
||||
@@ -1022,7 +1022,7 @@
|
||||
#if USE_SENSORLESS
|
||||
|
||||
bool tmc_enable_stallguard(TMC2130Stepper &st) {
|
||||
bool stealthchop_was_enabled = st.en_pwm_mode();
|
||||
const bool stealthchop_was_enabled = st.en_pwm_mode();
|
||||
|
||||
st.TCOOLTHRS(0xFFFFF);
|
||||
st.en_pwm_mode(false);
|
||||
@@ -1038,9 +1038,10 @@
|
||||
|
||||
bool tmc_enable_stallguard(TMC2209Stepper &st) {
|
||||
st.TCOOLTHRS(0xFFFFF);
|
||||
return true;
|
||||
return !st.en_spreadCycle();
|
||||
}
|
||||
void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth _UNUSED) {
|
||||
void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth) {
|
||||
st.en_spreadCycle(!restore_stealth);
|
||||
st.TCOOLTHRS(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,22 +29,6 @@
|
||||
#include <TMCStepper.h>
|
||||
#include "../module/planner.h"
|
||||
|
||||
#define TMC_X_LABEL 'X', '0'
|
||||
#define TMC_Y_LABEL 'Y', '0'
|
||||
#define TMC_Z_LABEL 'Z', '0'
|
||||
|
||||
#define TMC_X2_LABEL 'X', '2'
|
||||
#define TMC_Y2_LABEL 'Y', '2'
|
||||
#define TMC_Z2_LABEL 'Z', '2'
|
||||
#define TMC_Z3_LABEL 'Z', '3'
|
||||
|
||||
#define TMC_E0_LABEL 'E', '0'
|
||||
#define TMC_E1_LABEL 'E', '1'
|
||||
#define TMC_E2_LABEL 'E', '2'
|
||||
#define TMC_E3_LABEL 'E', '3'
|
||||
#define TMC_E4_LABEL 'E', '4'
|
||||
#define TMC_E5_LABEL 'E', '5'
|
||||
|
||||
#define CHOPPER_DEFAULT_12V { 3, -1, 1 }
|
||||
#define CHOPPER_DEFAULT_19V { 4, 1, 1 }
|
||||
#define CHOPPER_DEFAULT_24V { 4, 2, 1 }
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "../../gcode/gcode.h"
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
#include "../../module/planner.h"
|
||||
#include "../../module/stepper.h"
|
||||
#include "../../module/motion.h"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if HAS_MESH
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h" // for IsRunning()
|
||||
#include "../../MarlinCore.h" // for IsRunning()
|
||||
#include "../../module/motion.h"
|
||||
#include "../../module/probe.h" // for probe_offset
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
@@ -45,20 +45,21 @@ void GcodeSuite::G42() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Move to current_position, as modified by I, J, P parameters
|
||||
destination = current_position;
|
||||
|
||||
if (hasI) destination.x = _GET_MESH_X(ix);
|
||||
if (hasJ) destination.y = _GET_MESH_Y(iy);
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
#if HAS_PROBE_XY_OFFSET
|
||||
if (parser.boolval('P')) {
|
||||
if (hasI) destination.x -= probe_offset.x;
|
||||
if (hasJ) destination.y -= probe_offset.y;
|
||||
if (hasI) destination.x -= probe_offset_xy.x;
|
||||
if (hasJ) destination.y -= probe_offset_xy.y;
|
||||
}
|
||||
#endif
|
||||
|
||||
const feedRate_t fval = parser.linearval('F'),
|
||||
fr_mm_s = fval > 0 ? MMM_TO_MMS(fval) : 0.0f;
|
||||
fr_mm_s = MMM_TO_MMS(fval > 0 ? fval : 0.0f);
|
||||
|
||||
// SCARA kinematic has "safe" XY raw moves
|
||||
#if IS_SCARA
|
||||
|
||||
@@ -228,7 +228,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
ABL_VAR xy_int8_t meshCount;
|
||||
#endif
|
||||
|
||||
ABL_VAR xy_float_t probe_position_lf, probe_position_rb;
|
||||
ABL_VAR xy_pos_t probe_position_lf, probe_position_rb;
|
||||
ABL_VAR xy_float_t gridSpacing = { 0, 0 };
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
||||
@@ -403,12 +403,12 @@ G29_TYPE GcodeSuite::G29() {
|
||||
}
|
||||
else {
|
||||
probe_position_lf.set(
|
||||
parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MAX(X_CENTER - (X_BED_SIZE) / 2, x_min),
|
||||
parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MAX(Y_CENTER - (Y_BED_SIZE) / 2, y_min)
|
||||
parser.seenval('L') ? RAW_X_POSITION(parser.value_linear_units()) : x_min,
|
||||
parser.seenval('F') ? RAW_Y_POSITION(parser.value_linear_units()) : y_min
|
||||
);
|
||||
probe_position_rb.set(
|
||||
parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MIN(probe_position_lf.x + X_BED_SIZE, x_max),
|
||||
parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MIN(probe_position_lf.y + Y_BED_SIZE, y_max)
|
||||
parser.seenval('R') ? RAW_X_POSITION(parser.value_linear_units()) : x_max,
|
||||
parser.seenval('B') ? RAW_Y_POSITION(parser.value_linear_units()) : y_max
|
||||
);
|
||||
}
|
||||
|
||||
@@ -910,8 +910,8 @@ G29_TYPE GcodeSuite::G29() {
|
||||
planner.force_unapply_leveling(converted); // use conversion machinery
|
||||
|
||||
// Use the last measured distance to the bed, if possible
|
||||
if ( NEAR(current_position.x, probePos.x - probe_offset.x)
|
||||
&& NEAR(current_position.y, probePos.y - probe_offset.y)
|
||||
if ( NEAR(current_position.x, probePos.x - probe_offset_xy.x)
|
||||
&& NEAR(current_position.y, probePos.y - probe_offset_xy.y)
|
||||
) {
|
||||
const float simple_z = current_position.z - measured_z;
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probed Z", simple_z, " Matrix Z", converted.z, " Discrepancy ", simple_z - converted.z);
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
destination.set(safe_homing_xy, current_position.z);
|
||||
|
||||
#if HOMING_Z_WITH_PROBE
|
||||
destination -= probe_offset;
|
||||
destination -= probe_offset_xy;
|
||||
#endif
|
||||
|
||||
if (position_is_reachable(destination)) {
|
||||
@@ -262,7 +262,7 @@ void GcodeSuite::G28(const bool always_home_all) {
|
||||
|
||||
#if HAS_HOMING_CURRENT
|
||||
auto debug_current = [](const char * const s, const int16_t a, const int16_t b){
|
||||
DEBUG_ECHO(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b);
|
||||
DEBUG_ECHO(s); DEBUG_ECHOLNPAIR(" current: ", a, " -> ", b);
|
||||
};
|
||||
#if HAS_CURRENT_HOME(X)
|
||||
const int16_t tmc_save_current_X = stepperX.getMilliamps();
|
||||
@@ -286,11 +286,6 @@ void GcodeSuite::G28(const bool always_home_all) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOTH(STEALTHCHOP_XY, HOME_USING_SPREADCYCLE)
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set XY to spreadCycle...");
|
||||
process_subcommands_now_P(PSTR("M569S0XY"));
|
||||
#endif
|
||||
|
||||
#if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
||||
slow_homing_t slow_homing = begin_slow_homing();
|
||||
#endif
|
||||
@@ -515,11 +510,6 @@ void GcodeSuite::G28(const bool always_home_all) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOTH(STEALTHCHOP_XY, HOME_USING_SPREADCYCLE)
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set XY to StealthChop...");
|
||||
process_subcommands_now_P(PSTR("M569S1XY"));
|
||||
#endif
|
||||
|
||||
ui.refresh();
|
||||
|
||||
report_current_position();
|
||||
|
||||
@@ -45,29 +45,59 @@
|
||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
#include "../../core/debug_out.h"
|
||||
|
||||
// Sanity-check the count of Z_STEPPER_ALIGN_XY points
|
||||
constexpr xy_pos_t sanity_arr_z_align[] = Z_STEPPER_ALIGN_XY;
|
||||
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
static_assert(COUNT(sanity_arr_z_align) >= Z_STEPPER_COUNT,
|
||||
"Z_STEPPER_ALIGN_XY requires at least three {X,Y} entries (Z, Z2, Z3, ...)."
|
||||
);
|
||||
#else
|
||||
static_assert(COUNT(sanity_arr_z_align) == Z_STEPPER_COUNT,
|
||||
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
|
||||
"Z_STEPPER_ALIGN_XY requires three {X,Y} entries (Z, Z2, and Z3)."
|
||||
#else
|
||||
"Z_STEPPER_ALIGN_XY requires two {X,Y} entries (Z and Z2)."
|
||||
#endif
|
||||
);
|
||||
|
||||
#ifdef Z_STEPPER_ALIGN_XY
|
||||
//
|
||||
// Sanity check G34 / M422 settings
|
||||
//
|
||||
constexpr xy_pos_t test_z_stepper_align_xy[] = Z_STEPPER_ALIGN_XY;
|
||||
|
||||
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
|
||||
static_assert(COUNT(test_z_stepper_align_xy) >= Z_STEPPER_COUNT,
|
||||
"Z_STEPPER_ALIGN_XY requires at least three {X,Y} entries (Z, Z2, Z3, ...)."
|
||||
);
|
||||
|
||||
#else
|
||||
|
||||
static_assert(COUNT(test_z_stepper_align_xy) == Z_STEPPER_COUNT,
|
||||
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
|
||||
"Z_STEPPER_ALIGN_XY requires three {X,Y} entries (Z, Z2, and Z3)."
|
||||
#else
|
||||
"Z_STEPPER_ALIGN_XY requires two {X,Y} entries (Z and Z2)."
|
||||
#endif
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
constexpr xyz_pos_t dpo = NOZZLE_TO_PROBE_OFFSET;
|
||||
|
||||
#define LTEST(N) (test_z_stepper_align_xy[N].x >= _MAX(X_MIN_BED + MIN_PROBE_EDGE_LEFT, X_MIN_POS + dpo.x) - 0.00001f)
|
||||
#define RTEST(N) (test_z_stepper_align_xy[N].x <= _MIN(X_MAX_BED - MIN_PROBE_EDGE_RIGHT, X_MAX_POS + dpo.x) + 0.00001f)
|
||||
#define FTEST(N) (test_z_stepper_align_xy[N].y >= _MAX(Y_MIN_BED + MIN_PROBE_EDGE_FRONT, Y_MIN_POS + dpo.y) - 0.00001f)
|
||||
#define BTEST(N) (test_z_stepper_align_xy[N].y <= _MIN(Y_MAX_BED - MIN_PROBE_EDGE_BACK, Y_MAX_POS + dpo.y) + 0.00001f)
|
||||
|
||||
static_assert(LTEST(0) && RTEST(0), "The 1st Z_STEPPER_ALIGN_XY X is unreachable with the default probe X offset.");
|
||||
static_assert(FTEST(0) && BTEST(0), "The 1st Z_STEPPER_ALIGN_XY Y is unreachable with the default probe Y offset.");
|
||||
static_assert(LTEST(1) && RTEST(1), "The 2nd Z_STEPPER_ALIGN_XY X is unreachable with the default probe X offset.");
|
||||
static_assert(FTEST(1) && BTEST(1), "The 2nd Z_STEPPER_ALIGN_XY Y is unreachable with the default probe Y offset.");
|
||||
|
||||
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
|
||||
static_assert(LTEST(2) && RTEST(2), "The 3rd Z_STEPPER_ALIGN_XY X is unreachable with the default probe X offset.");
|
||||
static_assert(FTEST(2) && BTEST(2), "The 3rd Z_STEPPER_ALIGN_XY Y is unreachable with the default probe Y offset.");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static xy_pos_t z_auto_align_pos[Z_STEPPER_COUNT] = Z_STEPPER_ALIGN_XY;
|
||||
|
||||
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
static xy_pos_t z_stepper_pos[] = Z_STEPPER_ALIGN_STEPPER_XY;
|
||||
constexpr xy_pos_t test_z_stepper_align_stepper_xy[] = Z_STEPPER_ALIGN_STEPPER_XY;
|
||||
static_assert(
|
||||
COUNT(test_z_stepper_align_stepper_xy) == Z_STEPPER_COUNT,
|
||||
"Z_STEPPER_ALIGN_STEPPER_XY requires three {X,Y} entries (one per Z stepper)."
|
||||
);
|
||||
static xy_pos_t z_stepper_align_stepper_xy[] = Z_STEPPER_ALIGN_STEPPER_XY;
|
||||
#endif
|
||||
|
||||
#define G34_PROBE_COUNT COUNT(z_auto_align_pos)
|
||||
#define G34_PROBE_COUNT COUNT(z_stepper_align_xy)
|
||||
|
||||
inline void set_all_z_lock(const bool lock) {
|
||||
stepper.set_z_lock(lock);
|
||||
@@ -90,6 +120,32 @@ void GcodeSuite::G34() {
|
||||
log_machine_info();
|
||||
}
|
||||
|
||||
xy_pos_t z_stepper_align_xy[] =
|
||||
#ifdef Z_STEPPER_ALIGN_XY
|
||||
Z_STEPPER_ALIGN_XY
|
||||
#else
|
||||
{
|
||||
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
|
||||
#if defined(Z_STEPPER_ALIGN_ROTATE) && Z_STEPPER_ALIGN_ROTATE != 0
|
||||
#if Z_STEPPER_ALIGN_ROTATE == 1
|
||||
{ probe_min_x(), probe_min_y() }, { probe_min_x(), probe_max_y() }, { probe_max_x(), Y_CENTER }
|
||||
#elif Z_STEPPER_ALIGN_ROTATE == 2
|
||||
{ probe_min_x(), probe_max_y() }, { probe_max_x(), probe_max_y() }, { X_CENTER, probe_min_y() }
|
||||
#elif Z_STEPPER_ALIGN_ROTATE == 3
|
||||
{ probe_max_x(), probe_min_y() }, { probe_max_x(), probe_max_y() }, { probe_min_x(), Y_CENTER }
|
||||
#endif
|
||||
#else
|
||||
{ probe_min_x(), probe_min_y() }, { probe_max_x(), probe_min_y() }, { X_CENTER, probe_max_y() }
|
||||
#endif
|
||||
#elif defined(Z_STEPPER_ALIGN_ROTATE)
|
||||
{ X_CENTER, probe_min_y() }, { Y_CENTER, probe_max_y() }
|
||||
#else
|
||||
{ probe_min_x(), Y_CENTER }, { probe_max_x(), Y_CENTER }
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
;
|
||||
|
||||
do { // break out on error
|
||||
|
||||
const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS);
|
||||
@@ -155,11 +211,11 @@ void GcodeSuite::G34() {
|
||||
// iteration this will be re-calculated based on the actual bed position
|
||||
float z_probe = Z_BASIC_CLEARANCE + (G34_MAX_GRADE) * 0.01f * (
|
||||
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
|
||||
SQRT(_MAX(HYPOT2(z_auto_align_pos[0].x - z_auto_align_pos[0].y, z_auto_align_pos[1].x - z_auto_align_pos[1].y),
|
||||
HYPOT2(z_auto_align_pos[1].x - z_auto_align_pos[1].y, z_auto_align_pos[2].x - z_auto_align_pos[2].y),
|
||||
HYPOT2(z_auto_align_pos[2].x - z_auto_align_pos[2].y, z_auto_align_pos[0].x - z_auto_align_pos[0].y)))
|
||||
SQRT(_MAX(HYPOT2(z_stepper_align_xy[0].x - z_stepper_align_xy[0].y, z_stepper_align_xy[1].x - z_stepper_align_xy[1].y),
|
||||
HYPOT2(z_stepper_align_xy[1].x - z_stepper_align_xy[1].y, z_stepper_align_xy[2].x - z_stepper_align_xy[2].y),
|
||||
HYPOT2(z_stepper_align_xy[2].x - z_stepper_align_xy[2].y, z_stepper_align_xy[0].x - z_stepper_align_xy[0].y)))
|
||||
#else
|
||||
HYPOT(z_auto_align_pos[0].x - z_auto_align_pos[0].y, z_auto_align_pos[1].x - z_auto_align_pos[1].y)
|
||||
HYPOT(z_stepper_align_xy[0].x - z_stepper_align_xy[0].y, z_stepper_align_xy[1].x - z_stepper_align_xy[1].y)
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -169,13 +225,18 @@ void GcodeSuite::G34() {
|
||||
// Move the Z coordinate realm towards the positive - dirty trick
|
||||
current_position.z -= z_probe * 0.5f;
|
||||
|
||||
float last_z_align_move[Z_STEPPER_COUNT] = ARRAY_N(Z_STEPPER_COUNT, 10000.0f, 10000.0f, 10000.0f),
|
||||
z_measured[G34_PROBE_COUNT] = { 0 },
|
||||
float z_measured[G34_PROBE_COUNT] = { 0 },
|
||||
z_maxdiff = 0.0f,
|
||||
amplification = z_auto_align_amplification;
|
||||
|
||||
uint8_t iteration;
|
||||
bool err_break = false;
|
||||
|
||||
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
|
||||
bool adjustment_reversed = false;
|
||||
#endif
|
||||
float last_iteration_error = 0.0f;
|
||||
|
||||
for (iteration = 0; iteration < z_auto_align_iterations; ++iteration) {
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> probing all positions.");
|
||||
|
||||
@@ -193,8 +254,11 @@ void GcodeSuite::G34() {
|
||||
// Safe clearance even on an incline
|
||||
if (iteration == 0 || i > 0) do_blocking_move_to_z(z_probe);
|
||||
|
||||
if (DEBUGGING(LEVELING))
|
||||
DEBUG_ECHOLNPAIR_P(PSTR("Probing X"), z_stepper_align_xy[iprobe].x, SP_Y_STR, z_stepper_align_xy[iprobe].y);
|
||||
|
||||
// Probe a Z height for each stepper.
|
||||
const float z_probed_height = probe_at_point(z_auto_align_pos[iprobe], raise_after, 0, true);
|
||||
const float z_probed_height = probe_at_point(z_stepper_align_xy[iprobe], raise_after, 0, true);
|
||||
if (isnan(z_probed_height)) {
|
||||
SERIAL_ECHOLNPGM("Probing failed.");
|
||||
err_break = true;
|
||||
@@ -235,56 +299,69 @@ void GcodeSuite::G34() {
|
||||
incremental_LSF_reset(&lfd);
|
||||
for (uint8_t i = 0; i < G34_PROBE_COUNT; ++i) {
|
||||
SERIAL_ECHOLNPAIR("PROBEPT_", int(i + 1), ": ", z_measured[i]);
|
||||
incremental_LSF(&lfd, z_auto_align_pos[i], z_measured[i]);
|
||||
incremental_LSF(&lfd, z_stepper_align_xy[i], z_measured[i]);
|
||||
}
|
||||
finish_incremental_LSF(&lfd);
|
||||
|
||||
z_measured_min = 100000.0f;
|
||||
for (uint8_t i = 0; i < Z_STEPPER_COUNT; ++i) {
|
||||
z_measured[i] = -(lfd.A * z_stepper_pos[i].x + lfd.B * z_stepper_pos[i].y);
|
||||
z_measured[i] = -(lfd.A * z_stepper_align_stepper_xy[i].x + lfd.B * z_stepper_align_stepper_xy[i].y);
|
||||
z_measured_min = _MIN(z_measured_min, z_measured[i]);
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPAIR("CALCULATED STEPPER POSITIONS: Z1=", z_measured[0], " Z2=", z_measured[1], " Z3=", z_measured[2]);
|
||||
#endif
|
||||
|
||||
// The following correction actions are to be enabled for select Z-steppers only
|
||||
stepper.set_separate_multi_axis(true);
|
||||
|
||||
float calculated_align_move[Z_STEPPER_COUNT];
|
||||
float current_iteration_error = 0.0;
|
||||
|
||||
bool success_break = true;
|
||||
for (uint8_t zstepper = 0; zstepper < Z_STEPPER_COUNT; ++zstepper) {
|
||||
// Calculate current stepper move
|
||||
calculated_align_move[zstepper] = z_measured[zstepper] - z_measured_min;
|
||||
current_iteration_error += calculated_align_move[zstepper];
|
||||
// Stop early if all measured points achieve accuracy target
|
||||
if (calculated_align_move[zstepper] > z_auto_align_accuracy) success_break = false;
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPAIR("\n"
|
||||
"DIFFERENCE Z1-Z2=", ABS(z_measured[0] - z_measured[1])
|
||||
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
|
||||
, " Z2-Z3=", ABS(z_measured[1] - z_measured[2])
|
||||
, " Z3-Z1=", ABS(z_measured[2] - z_measured[0])
|
||||
#endif
|
||||
, " SUM=", current_iteration_error
|
||||
);
|
||||
|
||||
// The following correction actions are to be enabled for select Z-steppers only
|
||||
stepper.set_separate_multi_axis(true);
|
||||
if (iteration > 0 && current_iteration_error > last_iteration_error) {
|
||||
SERIAL_ECHOLNPGM("Decreasing accuracy detected.");
|
||||
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
|
||||
if (adjustment_reversed) {
|
||||
SERIAL_ECHOLNPGM("Decreasing accuracy detected. Reversal already attempted. Aborting.");
|
||||
err_break = true;
|
||||
break;
|
||||
}
|
||||
// Reverse direction by reversing the order of alignment points.
|
||||
// For this iteration switch the calculated moves. Do not reverse the
|
||||
// direction of the moves to avoid possibly crashing the nozzle into the bed.
|
||||
SERIAL_ECHOLNPGM("Decreasing accuracy detected. Reversing correction direction.");
|
||||
SWAP(z_stepper_align_xy[0].x, z_stepper_align_xy[1].x);
|
||||
SWAP(z_stepper_align_xy[0].y, z_stepper_align_xy[1].y);
|
||||
SWAP(calculated_align_move[0], calculated_align_move[1]);
|
||||
adjustment_reversed = true;
|
||||
#else
|
||||
err_break = true;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
last_iteration_error = current_iteration_error;
|
||||
|
||||
bool success_break = true;
|
||||
// Correct the individual stepper offsets
|
||||
for (uint8_t zstepper = 0; zstepper < Z_STEPPER_COUNT; ++zstepper) {
|
||||
// Calculate current stepper move
|
||||
const float z_align_move = z_measured[zstepper] - z_measured_min,
|
||||
z_align_abs = ABS(z_align_move);
|
||||
|
||||
#if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
// Optimize one iteration's correction based on the first measurements
|
||||
if (z_align_abs > 0.0f) amplification = iteration == 1 ? _MIN(last_z_align_move[zstepper] / z_align_abs, 2.0f) : z_auto_align_amplification;
|
||||
#endif
|
||||
|
||||
// Check for less accuracy compared to last move
|
||||
if (last_z_align_move[zstepper] < z_align_abs - 1.0) {
|
||||
SERIAL_ECHOLNPGM("Decreasing accuracy detected.");
|
||||
err_break = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// Remember the alignment for the next iteration
|
||||
last_z_align_move[zstepper] = z_align_abs;
|
||||
|
||||
// Stop early if all measured points achieve accuracy target
|
||||
if (z_align_abs > z_auto_align_accuracy) success_break = false;
|
||||
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " corrected by ", z_align_move);
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " corrected by ", calculated_align_move[zstepper]);
|
||||
|
||||
// Lock all steppers except one
|
||||
set_all_z_lock(true);
|
||||
@@ -297,7 +374,7 @@ void GcodeSuite::G34() {
|
||||
}
|
||||
|
||||
// Do a move to correct part of the misalignment for the current stepper
|
||||
do_blocking_move_to_z(amplification * z_align_move + current_position.z);
|
||||
do_blocking_move_to_z(amplification * calculated_align_move[zstepper] + current_position.z);
|
||||
} // for (zstepper)
|
||||
|
||||
// Back to normal stepper operations
|
||||
@@ -360,12 +437,38 @@ void GcodeSuite::G34() {
|
||||
* Y<pos> : Y position to set (Unchanged if omitted)
|
||||
*/
|
||||
void GcodeSuite::M422() {
|
||||
xy_pos_t z_stepper_align_xy[] =
|
||||
#ifdef Z_STEPPER_ALIGN_XY
|
||||
Z_STEPPER_ALIGN_XY
|
||||
#else
|
||||
{
|
||||
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
|
||||
#if defined(Z_STEPPER_ALIGN_ROTATE) && Z_STEPPER_ALIGN_ROTATE != 0
|
||||
#if Z_STEPPER_ALIGN_ROTATE == 1
|
||||
{ probe_min_x(), probe_min_y() }, { probe_min_x(), probe_max_y() }, { probe_max_x(), Y_CENTER }
|
||||
#elif Z_STEPPER_ALIGN_ROTATE == 2
|
||||
{ probe_min_x(), probe_max_y() }, { probe_max_x(), probe_max_y() }, { X_CENTER, probe_min_y() }
|
||||
#elif Z_STEPPER_ALIGN_ROTATE == 3
|
||||
{ probe_max_x(), probe_min_y() }, { probe_max_x(), probe_max_y() }, { probe_min_x(), Y_CENTER }
|
||||
#endif
|
||||
#else
|
||||
{ probe_min_x(), probe_min_y() }, { probe_max_x(), probe_min_y() }, { X_CENTER, probe_max_y() }
|
||||
#endif
|
||||
#elif defined(Z_STEPPER_ALIGN_ROTATE)
|
||||
{ X_CENTER, probe_min_y() }, { Y_CENTER, probe_max_y() }
|
||||
#else
|
||||
{ probe_min_x(), Y_CENTER }, { probe_max_x(), Y_CENTER }
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
;
|
||||
|
||||
if (!parser.seen_any()) {
|
||||
for (uint8_t i = 0; i < G34_PROBE_COUNT; ++i)
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("M422 S"), i + 1, SP_X_STR, z_auto_align_pos[i].x, SP_Y_STR, z_auto_align_pos[i].y);
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("M422 S"), i + 1, SP_X_STR, z_stepper_align_xy[i].x, SP_Y_STR, z_stepper_align_xy[i].y);
|
||||
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
for (uint8_t i = 0; i < Z_STEPPER_COUNT; ++i)
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("M422 W"), i + 1, SP_X_STR, z_stepper_pos[i].x, SP_Y_STR, z_stepper_pos[i].y);
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("M422 W"), i + 1, SP_X_STR, z_stepper_align_stepper_xy[i].x, SP_Y_STR, z_stepper_align_stepper_xy[i].y);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -381,9 +484,9 @@ void GcodeSuite::M422() {
|
||||
|
||||
xy_pos_t *pos_dest = (
|
||||
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
!is_probe_point ? z_stepper_pos :
|
||||
!is_probe_point ? z_stepper_align_stepper_xy :
|
||||
#endif
|
||||
z_auto_align_pos
|
||||
z_stepper_align_xy
|
||||
);
|
||||
|
||||
if (!is_probe_point
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
#if ENABLED(CALIBRATION_GCODE)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "../queue.h"
|
||||
#include "../../libs/hex_print_routines.h"
|
||||
|
||||
#include "../../Marlin.h" // for idle()
|
||||
#include "../../MarlinCore.h" // for idle()
|
||||
|
||||
/**
|
||||
* M100 Free Memory Watcher
|
||||
@@ -51,7 +51,7 @@
|
||||
* Also, there are two support functions that can be called from a developer's C code.
|
||||
*
|
||||
* uint16_t check_for_free_memory_corruption(PGM_P const free_memory_start);
|
||||
* void M100_dump_routine(PGM_P const title, char *start, char *end);
|
||||
* void M100_dump_routine(PGM_P const title, const char * const start, const char * const end);
|
||||
*
|
||||
* Initial version by Roxy-3D
|
||||
*/
|
||||
@@ -151,8 +151,8 @@ inline int32_t count_test_bytes(const char * const start_free_memory) {
|
||||
// Start and end the dump on a nice 16 byte boundary
|
||||
// (even though the values are not 16-byte aligned).
|
||||
//
|
||||
start_free_memory = (char*)((ptr_int_t)((uint32_t)start_free_memory & 0xFFFFFFF0)); // Align to 16-byte boundary
|
||||
end_free_memory = (char*)((ptr_int_t)((uint32_t)end_free_memory | 0x0000000F)); // Align end_free_memory to the 15th byte (at or above end_free_memory)
|
||||
start_free_memory = (char*)(ptr_int_t(uint32_t(start_free_memory) & ~0xFUL)); // Align to 16-byte boundary
|
||||
end_free_memory = (char*)(ptr_int_t(uint32_t(end_free_memory) | 0xFUL)); // Align end_free_memory to the 15th byte (at or above end_free_memory)
|
||||
|
||||
// Dump command main loop
|
||||
while (start_free_memory < end_free_memory) {
|
||||
@@ -177,15 +177,16 @@ inline int32_t count_test_bytes(const char * const start_free_memory) {
|
||||
}
|
||||
}
|
||||
|
||||
void M100_dump_routine(PGM_P const title, char *start, char *end) {
|
||||
void M100_dump_routine(PGM_P const title, const char * const start, const char * const end) {
|
||||
serialprintPGM(title);
|
||||
SERIAL_EOL();
|
||||
//
|
||||
// Round the start and end locations to produce full lines of output
|
||||
//
|
||||
start = (char*)((ptr_int_t)((uint32_t)start & 0xFFFFFFF0)); // Align to 16-byte boundary
|
||||
end = (char*)((ptr_int_t)((uint32_t)end | 0x0000000F)); // Align end_free_memory to the 15th byte (at or above end_free_memory)
|
||||
dump_free_memory(start, end);
|
||||
dump_free_memory(
|
||||
(char*)(ptr_int_t(uint32_t(start) & ~0xFUL)), // Align to 16-byte boundary
|
||||
(char*)(ptr_int_t(uint32_t(end) | 0xFUL)) // Align end_free_memory to the 15th byte (at or above end_free_memory)
|
||||
);
|
||||
}
|
||||
|
||||
#endif // M100_FREE_MEMORY_DUMPER
|
||||
@@ -211,7 +212,7 @@ inline int check_for_free_memory_corruption(PGM_P const title) {
|
||||
// idle();
|
||||
serial_delay(20);
|
||||
#if ENABLED(M100_FREE_MEMORY_DUMPER)
|
||||
M100_dump_routine(PSTR(" Memory corruption detected with end_free_memory<Heap\n"), (char*)0x1B80, (char*)0x21FF);
|
||||
M100_dump_routine(PSTR(" Memory corruption detected with end_free_memory<Heap\n"), (const char*)0x1B80, (const char*)0x21FF);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ void GcodeSuite::M48() {
|
||||
xy_float_t next_pos = current_position;
|
||||
|
||||
const xy_pos_t probe_pos = {
|
||||
parser.linearval('X', next_pos.x + probe_offset.x),
|
||||
parser.linearval('Y', next_pos.y + probe_offset.y)
|
||||
parser.linearval('X', next_pos.x + probe_offset_xy.x),
|
||||
parser.linearval('Y', next_pos.y + probe_offset_xy.y)
|
||||
};
|
||||
|
||||
if (!position_is_reachable_by_probe(probe_pos)) {
|
||||
@@ -166,8 +166,9 @@ void GcodeSuite::M48() {
|
||||
while (angle < 0.0) angle += 360.0; // outside of this range. It looks like they behave correctly with
|
||||
// numbers outside of the range, but just to be safe we clamp them.
|
||||
|
||||
next_pos.set(probe_pos.x - probe_offset.x + cos(RADIANS(angle)) * radius,
|
||||
probe_pos.y - probe_offset.y + sin(RADIANS(angle)) * radius);
|
||||
const xy_pos_t noz_pos = probe_pos - probe_offset_xy;
|
||||
next_pos.set(noz_pos.x + cos(RADIANS(angle)) * radius,
|
||||
noz_pos.y + sin(RADIANS(angle)) * radius);
|
||||
|
||||
#if DISABLED(DELTA)
|
||||
LIMIT(next_pos.x, X_MIN_POS, X_MAX_POS);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
#include "../../module/planner.h"
|
||||
|
||||
#if DISABLED(NO_VOLUMETRICS)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "../gcode.h"
|
||||
#include "../../module/tool_change.h"
|
||||
|
||||
#include "../../Marlin.h" // for SP_X_STR, etc.
|
||||
#include "../../MarlinCore.h" // for SP_X_STR, etc.
|
||||
|
||||
extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[];
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if ENABLED(PINS_DEBUGGING)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h" // for pin_is_protected
|
||||
#include "../../MarlinCore.h" // for pin_is_protected
|
||||
#include "../../pins/pinsDebug.h"
|
||||
#include "../../module/endstops.h"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if DISABLED(EMERGENCY_PARSER)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h" // for wait_for_heatup, kill, quickstop_stepper
|
||||
#include "../../MarlinCore.h" // for wait_for_heatup, kill, quickstop_stepper
|
||||
|
||||
/**
|
||||
* M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h" // for stepper_inactive_time, disable_e_steppers
|
||||
#include "../../MarlinCore.h" // for stepper_inactive_time, disable_e_steppers
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#include "../../module/stepper.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h" // for pin_is_protected and idle()
|
||||
#include "../../MarlinCore.h" // for pin_is_protected and idle()
|
||||
#include "../../module/stepper.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h" // for pin_is_protected
|
||||
#include "../../MarlinCore.h" // for pin_is_protected
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if FAN_COUNT > 0
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#endif
|
||||
|
||||
#if HAS_SUICIDE
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(PSU_CONTROL)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h" // for max_inactive_time
|
||||
#include "../../MarlinCore.h" // for max_inactive_time
|
||||
|
||||
/**
|
||||
* M85: Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "../gcode.h"
|
||||
|
||||
#include "../../lcd/ultralcd.h" // for lcd_reset_alert_level
|
||||
#include "../../Marlin.h" // for Running
|
||||
#include "../../MarlinCore.h" // for Running
|
||||
#include "../queue.h" // for flush_and_request_resend
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
millis_t chdk_timeout; // = 0
|
||||
#endif
|
||||
|
||||
#ifdef PHOTO_POSITION && PHOTO_DELAY_MS > 0
|
||||
#include "../../../Marlin.h" // for idle()
|
||||
#if defined(PHOTO_POSITION) && PHOTO_DELAY_MS > 0
|
||||
#include "../../../MarlinCore.h" // for idle()
|
||||
#endif
|
||||
|
||||
#ifdef PHOTO_RETRACT_MM
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "../../../feature/filwidth.h"
|
||||
#include "../../../module/planner.h"
|
||||
#include "../../../module/temperature.h"
|
||||
#include "../../../Marlin.h"
|
||||
#include "../../../MarlinCore.h"
|
||||
#include "../../gcode.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../gcode.h"
|
||||
|
||||
#include "../../../Marlin.h" // for i2c
|
||||
#include "../../../MarlinCore.h" // for i2c
|
||||
|
||||
/**
|
||||
* M260: Send data to a I2C slave device
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
||||
|
||||
#include "../../gcode.h"
|
||||
#include "../../../Marlin.h"
|
||||
#include "../../../MarlinCore.h"
|
||||
#include "../../../module/motion.h"
|
||||
#include "../../../module/temperature.h"
|
||||
#include "../../../feature/pause.h"
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
#include "../../../feature/power_loss_recovery.h"
|
||||
#include "../../../module/motion.h"
|
||||
#include "../../../lcd/ultralcd.h"
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
#include "../../../lcd/extensible_ui/ui_api.h"
|
||||
#endif
|
||||
|
||||
#define DEBUG_OUT ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
||||
#include "../../../core/debug_out.h"
|
||||
@@ -55,6 +58,8 @@ void GcodeSuite::M1000() {
|
||||
if (parser.seen('S')) {
|
||||
#if HAS_LCD_MENU
|
||||
ui.goto_screen(menu_job_recovery);
|
||||
#elif ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::OnPowerLossResume();
|
||||
#else
|
||||
SERIAL_ECHO_MSG("Resume requires LCD.");
|
||||
#endif
|
||||
|
||||
@@ -44,7 +44,9 @@ void tmc_set_stealthChop(TMC &st, const bool enable) {
|
||||
static void set_stealth_status(const bool enable, const int8_t target_extruder) {
|
||||
#define TMC_SET_STEALTH(Q) tmc_set_stealthChop(stepper##Q, enable)
|
||||
|
||||
#if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(X2) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Y2) || AXIS_HAS_STEALTHCHOP(Z) || AXIS_HAS_STEALTHCHOP(Z2) || AXIS_HAS_STEALTHCHOP(Z3)
|
||||
#if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(X2) \
|
||||
|| AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Y2) \
|
||||
|| AXIS_HAS_STEALTHCHOP(Z) || AXIS_HAS_STEALTHCHOP(Z2) || AXIS_HAS_STEALTHCHOP(Z3)
|
||||
const uint8_t index = parser.byteval('I');
|
||||
#endif
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ GcodeSuite gcode;
|
||||
#include "../feature/cancel_object.h"
|
||||
#endif
|
||||
|
||||
#include "../Marlin.h" // for idle() and suspend_auto_report
|
||||
#include "../MarlinCore.h" // for idle() and suspend_auto_report
|
||||
|
||||
millis_t GcodeSuite::previous_move_ms;
|
||||
|
||||
@@ -209,7 +209,7 @@ void GcodeSuite::dwell(millis_t time) {
|
||||
// Placeholders for non-migrated codes
|
||||
//
|
||||
#if ENABLED(M100_FREE_MEMORY_WATCHER)
|
||||
extern void M100_dump_routine(PGM_P const title, char *start, char *end);
|
||||
extern void M100_dump_routine(PGM_P const title, const char * const start, const char * const end);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -865,7 +865,7 @@ void GcodeSuite::process_next_command() {
|
||||
SERIAL_ECHOLN(current_command);
|
||||
#if ENABLED(M100_FREE_MEMORY_DUMPER)
|
||||
SERIAL_ECHOPAIR("slot:", queue.index_r);
|
||||
M100_dump_routine(PSTR(" Command Queue:"), queue.command_buffer, queue.command_buffer + sizeof(queue.command_buffer));
|
||||
M100_dump_routine(PSTR(" Command Queue:"), &queue.command_buffer[0][0], &queue.command_buffer[BUFSIZE - 1][MAX_CMD_SIZE - 1]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ void GcodeSuite::M115() {
|
||||
|
||||
// THERMAL_PROTECTION
|
||||
cap_line(PSTR("THERMAL_PROTECTION")
|
||||
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && (ENABLED(THERMAL_PROTECTION_BED) || !HAS_HEATED_BED) && (ENABLED(THERMAL_PROTECTION_CHAMBER) || !HAS_HEATED_CHAMBER)
|
||||
#if (ENABLED(THERMAL_PROTECTION_HOTENDS) || !EXTRUDERS) && (ENABLED(THERMAL_PROTECTION_BED) || !HAS_HEATED_BED) && (ENABLED(THERMAL_PROTECTION_CHAMBER) || !HAS_HEATED_CHAMBER)
|
||||
, true
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if ENABLED(EXPECTED_PRINTER_CHECK)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
/**
|
||||
* M16: Expected Printer Check
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "../../feature/host_actions.h"
|
||||
#include "../gcode.h"
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
/**
|
||||
* M876: Handle Prompt Response
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "../gcode.h"
|
||||
#include "../../module/motion.h"
|
||||
|
||||
#include "../../Marlin.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
#if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT)
|
||||
#include "../../feature/fwretract.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user