Compare commits
12 Commits
TM3D_SX4_2.0.x_F
...
SX4I
| Author | SHA1 | Date | |
|---|---|---|---|
| f3f269fdf3 | |||
| 79bc5be06d | |||
| 2eb3ff66a9 | |||
| c7c87aacce | |||
| 1fa264a9d8 | |||
| 683ccc8faa | |||
| 352e41bad7 | |||
| c674286de2 | |||
| 37b1725a65 | |||
| 6052988f6f | |||
| 38581acb15 | |||
| 6dc6ff8e30 |
@@ -51,8 +51,8 @@ jobs:
|
||||
export PATH=`pwd`/buildroot/bin/:${PATH}
|
||||
|
||||
# Generate custom version include
|
||||
generate_version ./Marlin/src/inc
|
||||
cat ./Marlin/src/inc/_Version.h
|
||||
generate_version ./Marlin/
|
||||
cat ./Marlin/Version.h
|
||||
#
|
||||
# Back up pins_RAMPS.h
|
||||
#
|
||||
@@ -240,14 +240,14 @@ jobs:
|
||||
build_marlin_pio ./ ${TEST_PLATFORM}
|
||||
restore_configs
|
||||
echo testing STM32F1 targets...
|
||||
export TEST_PLATFORM="-e STM32F1"
|
||||
export TEST_PLATFORM="-e STM32F103RE"
|
||||
restore_configs
|
||||
echo use_example_configs STM32F10
|
||||
use_example_configs STM32F10
|
||||
echo use_example_configs STM32/STM32F103RE
|
||||
use_example_configs STM32/STM32F103RE
|
||||
build_marlin_pio ./ ${TEST_PLATFORM}
|
||||
restore_configs
|
||||
echo use_example_configs stm32f103ret6
|
||||
use_example_configs stm32f103ret6
|
||||
echo use_example_configs STM32/stm32f103ret6
|
||||
use_example_configs STM32/stm32f103ret6
|
||||
build_marlin_pio ./ ${TEST_PLATFORM}
|
||||
restore_configs
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
custom: http://www.thinkyhead.com/donate-to-marlin
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Have you read Marlin's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/.github/code_of_conduct.md
|
||||
|
||||
Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use the Marlin Firmware forum at http://forums.reprap.org/list.php?415 or the Marlin Facebook Group https://www.facebook.com/groups/1049718498464482/.
|
||||
Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use the Marlin Firmware forum at http://forums.reprap.org/list.php?415 or the Marlin Facebook Group https://www.facebook.com/groups/1049718498464482/ or the Marlin Discord Server https://discord.gg/n5NJ59y.
|
||||
|
||||
Before filing an issue be sure to test the 1.1 and/or 2.0 "bugfix" branches to see whether the issue is already addressed.
|
||||
|
||||
|
||||
+44
-24
@@ -1,39 +1,59 @@
|
||||
dist: xenial
|
||||
sudo: require
|
||||
dist: bionic
|
||||
sudo: false
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
- "3.7"
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
# Cache PlatformIO packages using Travis CI container-based infrastructure
|
||||
sudo: false
|
||||
cache:
|
||||
pip: true
|
||||
directories:
|
||||
- "~/.platformio"
|
||||
|
||||
env:
|
||||
- TEST_PLATFORM="megaatmega2560"
|
||||
# Base Environments
|
||||
- TEST_PLATFORM="DUE"
|
||||
- TEST_PLATFORM="esp32"
|
||||
- TEST_PLATFORM="linux_native"
|
||||
- TEST_PLATFORM="megaatmega2560"
|
||||
- TEST_PLATFORM="STM32F103RE"
|
||||
- TEST_PLATFORM="teensy31"
|
||||
- TEST_PLATFORM="teensy35"
|
||||
|
||||
# Extended AVR Environments
|
||||
- TEST_PLATFORM="fysetc_f6_13"
|
||||
- TEST_PLATFORM="megaatmega1280"
|
||||
- TEST_PLATFORM="rambo"
|
||||
- TEST_PLATFORM="sanguino_atmega1284p"
|
||||
- TEST_PLATFORM="sanguino_atmega644p"
|
||||
|
||||
# Extended STM32 Environments
|
||||
- TEST_PLATFORM="ARMED"
|
||||
- TEST_PLATFORM="BIGTREE_BTT002"
|
||||
- TEST_PLATFORM="BIGTREE_SKR_PRO"
|
||||
- TEST_PLATFORM="STM32F103RC_bigtree"
|
||||
- TEST_PLATFORM="jgaurora_a5s_a1"
|
||||
- TEST_PLATFORM="STM32F103VE_longer"
|
||||
- TEST_PLATFORM="STM32F407VE_black"
|
||||
- TEST_PLATFORM="mks_robin"
|
||||
|
||||
# Put lengthy tests last
|
||||
- TEST_PLATFORM="LPC1768"
|
||||
- TEST_PLATFORM="LPC1769"
|
||||
- TEST_PLATFORM="STM32F1"
|
||||
- TEST_PLATFORM="teensy35"
|
||||
- TEST_PLATFORM="linux_native"
|
||||
- TEST_PLATFORM="esp32"
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-7
|
||||
# Non-working environment tests
|
||||
#- TEST_PLATFORM="at90usb1286_cdc"
|
||||
#- TEST_PLATFORM="at90usb1286_dfu"
|
||||
#- TEST_PLATFORM="STM32F103CB_malyan"
|
||||
#- TEST_PLATFORM="mks_robin_lite"
|
||||
#- TEST_PLATFORM="mks_robin_mini"
|
||||
#- TEST_PLATFORM="mks_robin_nano"
|
||||
#- TEST_PLATFORM="SAMD51_grandcentral_m4"
|
||||
#- TEST_PLATFORM="STM32F103RC_bigtree"
|
||||
#- TEST_PLATFORM="STM32F103RC_bigtree_USB"
|
||||
#- TEST_PLATFORM="STM32F103RC_fysetc"
|
||||
#- TEST_PLATFORM="STM32F4"
|
||||
#- TEST_PLATFORM="STM32F7"
|
||||
|
||||
before_install:
|
||||
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
|
||||
#
|
||||
# Fetch the tag information for the current branch
|
||||
- git fetch origin --tags
|
||||
@@ -55,8 +75,8 @@ before_script:
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
#
|
||||
# Generate custom version include
|
||||
- generate_version ${TRAVIS_BUILD_DIR}/Marlin/src/inc
|
||||
- cat ${TRAVIS_BUILD_DIR}/Marlin/src/inc/_Version.h
|
||||
- generate_version ${TRAVIS_BUILD_DIR}/Marlin/
|
||||
- cat ${TRAVIS_BUILD_DIR}/Marlin/Version.h
|
||||
#
|
||||
script:
|
||||
- run_tests ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
|
||||
|
||||
+205
-143
@@ -1,13 +1,20 @@
|
||||
//#define PetsfangMicroswiss
|
||||
//#define BondtechBMG
|
||||
#define CR10SPro_GearedExtruder
|
||||
//#define E3DV6
|
||||
|
||||
//#define FilamentSensorStd
|
||||
//#define FilamentSensorLerdge
|
||||
|
||||
#define STOCK_2208 // V2 Stock Board with TMC2208 Drivers
|
||||
//#define SKR13 // 32 bit board - assumes 2208 drivers
|
||||
//#define SKR13_2209
|
||||
//#define SKR_E_8825
|
||||
//#define E_8825
|
||||
//#define SKR13_UART // Configure SKR board with drivers in UART mode
|
||||
//#define DUAL_Z
|
||||
|
||||
#define SX2 // Small formfactor 200mm machine
|
||||
|
||||
#define DUAL_Z
|
||||
//#define GRAPHICSLCD
|
||||
//#define UBL
|
||||
|
||||
@@ -86,13 +93,9 @@
|
||||
|
||||
// @section info
|
||||
|
||||
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
|
||||
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
|
||||
// build by the user have been successfully uploaded into firmware.
|
||||
#define STRING_CONFIG_H_AUTHOR "(Tinymachines3D)" // Who made the changes.
|
||||
#define SHOW_BOOTSCREEN
|
||||
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
|
||||
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2
|
||||
// Author info of this build printed to the host during boot and M115
|
||||
#define STRING_CONFIG_H_AUTHOR "Tinymachines3D" // Who made the changes.
|
||||
#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
|
||||
|
||||
/**
|
||||
* *** VENDORS PLEASE READ ***
|
||||
@@ -105,14 +108,16 @@
|
||||
* respectfully request that you retain the unmodified Marlin boot screen.
|
||||
*/
|
||||
|
||||
// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
|
||||
#define SHOW_BOOTSCREEN
|
||||
|
||||
#if ENABLED(GRAPHICSLCD)
|
||||
// Enable to show the bitmap in Marlin/_Bootscreen.h on startup.
|
||||
#define SHOW_CUSTOM_BOOTSCREEN
|
||||
// Show the bitmap in Marlin/_Bootscreen.h on startup.
|
||||
#define SHOW_CUSTOM_BOOTSCREEN
|
||||
|
||||
// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen.
|
||||
#define CUSTOM_STATUS_SCREEN_IMAGE
|
||||
// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
|
||||
#define CUSTOM_STATUS_SCREEN_IMAGE
|
||||
#endif
|
||||
|
||||
// @section machine
|
||||
|
||||
/**
|
||||
@@ -122,7 +127,6 @@
|
||||
*
|
||||
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
|
||||
*/
|
||||
|
||||
#define SERIAL_PORT 0
|
||||
|
||||
/**
|
||||
@@ -149,8 +153,7 @@
|
||||
// Enable the Bluetooth serial interface on AT90USB devices
|
||||
//#define BLUETOOTH
|
||||
|
||||
// The following define selects which electronics board you have.
|
||||
// Please choose the name from boards.h that matches your setup
|
||||
// Choose the name from boards.h that matches your setup
|
||||
#ifndef MOTHERBOARD
|
||||
#if ENABLED(SKR13)
|
||||
#define MOTHERBOARD BOARD_BIGTREE_SKR_V1_3
|
||||
@@ -159,12 +162,16 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Optional custom name for your RepStrap or other custom machine
|
||||
// Displayed in the LCD "Ready" message
|
||||
#define CUSTOM_MACHINE_NAME "TM3D SX4"
|
||||
// Name displayed in the LCD "Ready" message and Info menu
|
||||
#if ENABLED(SX2)
|
||||
#define CUSTOM_MACHINE_NAME "TM3D SX2"
|
||||
#else
|
||||
#define CUSTOM_MACHINE_NAME "TM3D SX4"
|
||||
#endif
|
||||
|
||||
// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
|
||||
// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
|
||||
|
||||
// Printer's unique ID, used by some programs to differentiate between machines.
|
||||
// Choose your own or use a service like http://www.uuidgenerator.net/version4
|
||||
//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
|
||||
|
||||
// @section extruder
|
||||
@@ -301,7 +308,14 @@
|
||||
#define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock
|
||||
#elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD)
|
||||
#define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis
|
||||
#define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis
|
||||
#define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1)
|
||||
//#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock
|
||||
#if ENABLED(PRIME_BEFORE_REMOVE)
|
||||
#define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length
|
||||
#define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length
|
||||
#define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate
|
||||
#define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate
|
||||
#endif
|
||||
#elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
|
||||
#define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching
|
||||
#endif
|
||||
@@ -378,6 +392,7 @@
|
||||
* -1 : thermocouple with AD595
|
||||
* 0 : not used
|
||||
* 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
|
||||
* 331 : (3.3V scaled thermistor 1 table)
|
||||
* 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
|
||||
* 3 : Mendel-parts thermistor (4.7k pullup)
|
||||
* 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
|
||||
@@ -395,13 +410,15 @@
|
||||
* 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
|
||||
* 15 : 100k thermistor calibration for JGAurora A5 hotend
|
||||
* 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
|
||||
* 20 : the PT100 circuit found in the Ultimainboard V2.x
|
||||
* 20 : Pt100 with circuit in the Ultimainboard V2.x
|
||||
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
|
||||
* 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
|
||||
* 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
|
||||
* 66 : 4.7M High Temperature thermistor from Dyze Design
|
||||
* 67 : 450C thermistor from SliceEngineering
|
||||
* 70 : the 100K thermistor found in the bq Hephestos 2
|
||||
* 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor
|
||||
* 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines)
|
||||
*
|
||||
* 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k.
|
||||
* (but gives greater accuracy and more stable PID)
|
||||
@@ -419,8 +436,6 @@
|
||||
* Use these for Testing or Development purposes. NEVER for production machine.
|
||||
* 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below.
|
||||
* 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below.
|
||||
*
|
||||
* :{ '0':"Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '512':"100k RPW-Ultra hotend thermistor", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595", '998':"Dummy 1", '999':"Dummy 2", '1000':"Custom thermistor params" }
|
||||
*/
|
||||
#if ENABLED(E3DV6)
|
||||
#define TEMP_SENSOR_0 5
|
||||
@@ -548,7 +563,7 @@
|
||||
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
|
||||
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
|
||||
//#define MIN_BED_POWER 0
|
||||
//#define PID_BED_DEBUG // Sends debug data to the serial port.
|
||||
|
||||
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
|
||||
@@ -688,18 +703,18 @@
|
||||
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
|
||||
*/
|
||||
|
||||
#if ENABLED(SKR13, SKR_E_8825)
|
||||
#if ENABLED(SKR13, E_8825)
|
||||
#define E0_DRIVER_TYPE DRV8825
|
||||
#define E1_DRIVER_TYPE DRV8825
|
||||
#endif
|
||||
|
||||
#if ENABLED(SKR13) && DISABLED(SKR13_UART)
|
||||
#if ANY(SKR13, STOCK_2208) && DISABLED(SKR13_UART)
|
||||
#if ENABLED(SKR13_2209)
|
||||
#define X_DRIVER_TYPE TMC2209_STANDALONE
|
||||
#define Y_DRIVER_TYPE TMC2209_STANDALONE
|
||||
#define Z_DRIVER_TYPE TMC2209_STANDALONE
|
||||
#define Z2_DRIVER_TYPE TMC2209_STANDALONE
|
||||
#if DISABLED(SKR_E_8825)
|
||||
#if DISABLED(E_8825)
|
||||
#define E0_DRIVER_TYPE TMC2209_STANDALONE
|
||||
#define E1_DRIVER_TYPE TMC2209_STANDALONE
|
||||
#endif
|
||||
@@ -708,7 +723,7 @@
|
||||
#define Y_DRIVER_TYPE TMC2208_STANDALONE
|
||||
#define Z_DRIVER_TYPE TMC2208_STANDALONE
|
||||
#define Z2_DRIVER_TYPE TMC2208_STANDALONE
|
||||
#if DISABLED(SKR_E_8825)
|
||||
#if DISABLED(E_8825)
|
||||
#define E0_DRIVER_TYPE TMC2208_STANDALONE
|
||||
#define E1_DRIVER_TYPE TMC2208_STANDALONE
|
||||
#endif
|
||||
@@ -719,7 +734,7 @@
|
||||
#define Y_DRIVER_TYPE TMC2209
|
||||
#define Z_DRIVER_TYPE TMC2209
|
||||
#define Z2_DRIVER_TYPE TMC2209
|
||||
#if DISABLED(SKR_E_8825)
|
||||
#if DISABLED(E_8825)
|
||||
#define E0_DRIVER_TYPE TMC2209
|
||||
#define E1_DRIVER_TYPE TMC2209
|
||||
#endif
|
||||
@@ -728,7 +743,7 @@
|
||||
#define Y_DRIVER_TYPE TMC2208
|
||||
#define Z_DRIVER_TYPE TMC2208
|
||||
#define Z2_DRIVER_TYPE TMC2208
|
||||
#if DISABLED(SKR_E_8825)
|
||||
#if DISABLED(E_8825)
|
||||
#define E0_DRIVER_TYPE TMC2208
|
||||
#define E1_DRIVER_TYPE TMC2208
|
||||
#endif
|
||||
@@ -793,16 +808,26 @@
|
||||
* X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]]
|
||||
*/
|
||||
#if ENABLED(BondtechBMG)
|
||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 415.0 }
|
||||
#define EStepsmm 415
|
||||
#elif ENABLED(CR10SPro_GearedExtruder)
|
||||
#define EStepsmm 140
|
||||
#else
|
||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 100.3 }
|
||||
#define EStepsmm 100.3
|
||||
#endif
|
||||
|
||||
|
||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, EStepsmm }
|
||||
/**
|
||||
* Default Max Feed Rate (mm/s)
|
||||
* Override with M203
|
||||
* X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]]
|
||||
*/
|
||||
#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 }
|
||||
#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 70 }
|
||||
|
||||
#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
|
||||
#if ENABLED(LIMITED_MAX_FR_EDITING)
|
||||
#define MAX_FEEDRATE_EDIT_VALUES { 1000, 1000, 10, 150 } // ...or, set your own edit limits
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Default Max Acceleration (change/s) change = mm/s
|
||||
@@ -810,7 +835,12 @@
|
||||
* Override with M201
|
||||
* X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]]
|
||||
*/
|
||||
#define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 2000 }
|
||||
#define DEFAULT_MAX_ACCELERATION { 1500, 1500, 50, 2000 }
|
||||
|
||||
#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
|
||||
#if ENABLED(LIMITED_MAX_ACCEL_EDITING)
|
||||
#define MAX_ACCEL_EDIT_VALUES { 2500, 2500, 125, 5000 } // ...or, set your own edit limits
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Default Acceleration (change/s) change = mm/s
|
||||
@@ -820,40 +850,43 @@
|
||||
* M204 R Retract Acceleration
|
||||
* M204 T Travel Acceleration
|
||||
*/
|
||||
#define DEFAULT_ACCELERATION 2000 // X, Y, Z and E acceleration for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 2000 // X, Y, Z acceleration for travel (non printing) moves
|
||||
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 1500 // E acceleration for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves
|
||||
|
||||
/**
|
||||
* Junction Deviation
|
||||
*
|
||||
* Use Junction Deviation instead of traditional Jerk Limiting
|
||||
*
|
||||
* See:
|
||||
* https://reprap.org/forum/read.php?1,739819
|
||||
* http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
|
||||
*/
|
||||
#define JUNCTION_DEVIATION
|
||||
#if ENABLED(JUNCTION_DEVIATION)
|
||||
#define JUNCTION_DEVIATION_MM 0.06 // (mm) Distance from real junction edge
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Default Jerk (mm/s)
|
||||
* Default Jerk limits (mm/s)
|
||||
* Override with M205 X Y Z E
|
||||
*
|
||||
* "Jerk" specifies the minimum speed change that requires acceleration.
|
||||
* When changing speed and direction, if the difference is less than the
|
||||
* value set here, it may happen instantaneously.
|
||||
*/
|
||||
#if DISABLED(JUNCTION_DEVIATION)
|
||||
//#define CLASSIC_JERK
|
||||
#if ENABLED(CLASSIC_JERK)
|
||||
#define DEFAULT_XJERK 10.0
|
||||
#define DEFAULT_YJERK 10.0
|
||||
#define DEFAULT_ZJERK 0.3
|
||||
|
||||
//#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2
|
||||
#if ENABLED(LIMITED_JERK_EDITING)
|
||||
#define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define DEFAULT_EJERK 5.0 // May be used by Linear Advance
|
||||
|
||||
/**
|
||||
* Junction Deviation Factor
|
||||
*
|
||||
* See:
|
||||
* https://reprap.org/forum/read.php?1,739819
|
||||
* http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
|
||||
*/
|
||||
#if DISABLED(CLASSIC_JERK)
|
||||
#define JUNCTION_DEVIATION_MM 0.06 // (mm) Distance from real junction edge
|
||||
#endif
|
||||
|
||||
/**
|
||||
* S-Curve Acceleration
|
||||
*
|
||||
@@ -862,7 +895,7 @@
|
||||
*
|
||||
* See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained
|
||||
*/
|
||||
//#define S_CURVE_ACCELERATION
|
||||
#define S_CURVE_ACCELERATION
|
||||
|
||||
//===========================================================================
|
||||
//============================= Z Probe Options =============================
|
||||
@@ -967,11 +1000,10 @@
|
||||
|
||||
/**
|
||||
* Z Probe to nozzle (X,Y) offset, relative to (0, 0).
|
||||
* X and Y offsets must be integers.
|
||||
*
|
||||
* In the following example the X and Y offsets are both positive:
|
||||
* #define X_PROBE_OFFSET_FROM_EXTRUDER 10
|
||||
* #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
|
||||
*
|
||||
* #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
|
||||
*
|
||||
* +-- BACK ---+
|
||||
* | |
|
||||
@@ -983,24 +1015,22 @@
|
||||
* | |
|
||||
* O-- FRONT --+
|
||||
* (0,0)
|
||||
*
|
||||
* Specify a Probe position as { X, Y, Z }
|
||||
*/
|
||||
#if ENABLED(PetsfangMicroswiss)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -48 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { -48, -10, 0 }
|
||||
#elif ENABLED(E3DV6)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER 36 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 36, 15, 0 }
|
||||
#else
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER 37 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 37, -10, 0 }
|
||||
#endif
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
|
||||
// Certain types of probes need to stay away from edges
|
||||
#define MIN_PROBE_EDGE 5
|
||||
|
||||
// X and Y axis travel speed (mm/m) between probes
|
||||
#define XY_PROBE_SPEED 3000
|
||||
#define XY_PROBE_SPEED 5000
|
||||
|
||||
// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2)
|
||||
#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
|
||||
@@ -1018,7 +1048,7 @@
|
||||
* A total of 3 or more adds more slow probes, taking the average.
|
||||
*/
|
||||
#define MULTIPLE_PROBING 2
|
||||
#define EXTRA_PROBING 1
|
||||
//#define EXTRA_PROBING 1
|
||||
|
||||
/**
|
||||
* Z probes require clearance when deploying, stowing, and moving between
|
||||
@@ -1028,7 +1058,7 @@
|
||||
*
|
||||
* Use these settings to specify the distance (mm) to raise the probe (or
|
||||
* lower the bed). The values set here apply over and above any (negative)
|
||||
* probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
|
||||
* probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD.
|
||||
* Only integer values >= 1 are valid here.
|
||||
*
|
||||
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
|
||||
@@ -1093,7 +1123,7 @@
|
||||
// @section machine
|
||||
|
||||
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
|
||||
#if ENABLED(SKR13)
|
||||
#if ANY(SKR13, STOCK_2208)
|
||||
#define INVERT_X_DIR true
|
||||
#define INVERT_Y_DIR true
|
||||
#define INVERT_Z_DIR true
|
||||
@@ -1106,10 +1136,10 @@
|
||||
// @section extruder
|
||||
|
||||
// For direct drive extruder v9 set to true, for geared extruder set to false.
|
||||
#if (ENABLED(BondtechBMG) && DISABLED(SKR13)) || (DISABLED(BondtechBMG) && ENABLED(SKR13))
|
||||
#if (ENABLED(BondtechBMG, CR10SPro_GearedExtruder) && DISABLED(SKR13)) || (DISABLED(BondtechBM, CR10SPro_GearedExtruderG) && ANY(SKR13, STOCK_2208))
|
||||
#define INVERT_E0_DIR true
|
||||
#else
|
||||
#define INVERT_E0_DIR true
|
||||
#define INVERT_E0_DIR false
|
||||
#endif
|
||||
#define INVERT_E1_DIR false
|
||||
#define INVERT_E2_DIR false
|
||||
@@ -1135,9 +1165,13 @@
|
||||
// @section machine
|
||||
|
||||
// The size of the print bed
|
||||
#define X_BED_SIZE 398
|
||||
#define Y_BED_SIZE 390
|
||||
|
||||
#if ENABLED(SX2)
|
||||
#define X_BED_SIZE 248
|
||||
#define Y_BED_SIZE 238
|
||||
#else
|
||||
#define X_BED_SIZE 398
|
||||
#define Y_BED_SIZE 390
|
||||
#endif
|
||||
|
||||
// Travel limits (mm) after homing, corresponding to endstop positions.
|
||||
#define X_MIN_POS 0
|
||||
@@ -1145,8 +1179,11 @@
|
||||
#define Z_MIN_POS 0
|
||||
#define X_MAX_POS X_BED_SIZE
|
||||
#define Y_MAX_POS Y_BED_SIZE
|
||||
#define Z_MAX_POS 500
|
||||
|
||||
#if ENABLED(SX2)
|
||||
#define Z_MAX_POS 500
|
||||
#else
|
||||
#define Z_MAX_POS 250
|
||||
#endif
|
||||
/**
|
||||
* Software Endstops
|
||||
*
|
||||
@@ -1305,15 +1342,13 @@
|
||||
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
|
||||
|
||||
// Set the number of grid points per dimension.
|
||||
#define GRID_MAX_POINTS_X 10
|
||||
#if ENABLED(SX2)
|
||||
#define GRID_MAX_POINTS_X 5
|
||||
#else
|
||||
#define GRID_MAX_POINTS_X 10
|
||||
#endif
|
||||
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
|
||||
|
||||
// Set the boundaries for probing (where the probe can reach).
|
||||
//#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE
|
||||
//#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE))
|
||||
//#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE
|
||||
//#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE))
|
||||
|
||||
// Probe along the Y axis, advancing X after each column
|
||||
//#define PROBE_Y_FIRST
|
||||
|
||||
@@ -1367,19 +1402,6 @@
|
||||
|
||||
#endif // BED_LEVELING
|
||||
|
||||
/**
|
||||
* Points to probe for all 3-point Leveling procedures.
|
||||
* Override if the automatically selected points are inadequate.
|
||||
*/
|
||||
#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL)
|
||||
#define PROBE_PT_1_X 50
|
||||
#define PROBE_PT_1_Y 350
|
||||
#define PROBE_PT_2_X 350
|
||||
#define PROBE_PT_2_Y 350
|
||||
#define PROBE_PT_3_X 350
|
||||
#define PROBE_PT_3_Y 50
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Add a bed leveling sub-menu for ABL or MBL.
|
||||
* Include a guided procedure if manual probing is enabled.
|
||||
@@ -1628,7 +1650,7 @@
|
||||
#define NOZZLE_CLEAN_TRIANGLES 3
|
||||
|
||||
// Specify positions as { X, Y, Z }
|
||||
#define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
|
||||
#define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) }
|
||||
#define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) }
|
||||
|
||||
// Circular pattern radius
|
||||
@@ -1638,8 +1660,11 @@
|
||||
// Middle point of circle
|
||||
#define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT
|
||||
|
||||
// Moves the nozzle to the initial position
|
||||
// Move the nozzle to the initial position after cleaning
|
||||
#define NOZZLE_CLEAN_GOBACK
|
||||
|
||||
// Enable for a purge/clean station that's always at the gantry height (thus no Z move)
|
||||
//#define NOZZLE_CLEAN_NO_Z
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1684,10 +1709,10 @@
|
||||
*
|
||||
* Select the language to display on the LCD. These languages are available:
|
||||
*
|
||||
* en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
|
||||
* jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test
|
||||
* en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana,
|
||||
* ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test
|
||||
*
|
||||
* :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' }
|
||||
* :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' }
|
||||
*/
|
||||
#define LCD_LANGUAGE en
|
||||
|
||||
@@ -1737,8 +1762,8 @@
|
||||
* Enable one of the following items for a slower SPI transfer speed.
|
||||
* This may be required to resolve "volume init" errors.
|
||||
*/
|
||||
#define SPI_SPEED SPI_HALF_SPEED
|
||||
//#define SPI_SPEED SPI_QUARTER_SPEED
|
||||
//#define SPI_SPEED SPI_HALF_SPEED
|
||||
#define SPI_SPEED SPI_QUARTER_SPEED
|
||||
//#define SPI_SPEED SPI_EIGHTH_SPEED
|
||||
|
||||
/**
|
||||
@@ -1796,6 +1821,14 @@
|
||||
//
|
||||
//#define REVERSE_MENU_DIRECTION
|
||||
|
||||
//
|
||||
// This option reverses the encoder direction for Select Screen.
|
||||
//
|
||||
// If CLOCKWISE normally moves LEFT this makes it go RIGHT.
|
||||
// If CLOCKWISE normally moves RIGHT this makes it go LEFT.
|
||||
//
|
||||
//#define REVERSE_SELECT_DIRECTION
|
||||
|
||||
//
|
||||
// Individual Axis Homing
|
||||
//
|
||||
@@ -2027,31 +2060,12 @@
|
||||
//
|
||||
//#define LCD_FOR_MELZI
|
||||
|
||||
//
|
||||
// SSD1306 OLED full graphics generic display
|
||||
//
|
||||
//#define U8GLIB_SSD1306
|
||||
|
||||
//
|
||||
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
|
||||
//
|
||||
//#define SAV_3DGLCD
|
||||
#if ENABLED(SAV_3DGLCD)
|
||||
//#define U8GLIB_SSD1306
|
||||
#define U8GLIB_SH1106
|
||||
#endif
|
||||
|
||||
//
|
||||
// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder
|
||||
// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1)
|
||||
//
|
||||
//#define ULTI_CONTROLLER
|
||||
|
||||
//
|
||||
// TinyBoy2 128x64 OLED / Encoder Panel
|
||||
//
|
||||
//#define OLED_PANEL_TINYBOY2
|
||||
|
||||
//
|
||||
// MKS MINI12864 with graphic controller and SD support
|
||||
// https://reprap.org/wiki/MKS_MINI_12864
|
||||
@@ -2085,15 +2099,6 @@
|
||||
//
|
||||
//#define ANET_FULL_GRAPHICS_LCD
|
||||
|
||||
//
|
||||
// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER
|
||||
// http://reprap.org/wiki/MKS_12864OLED
|
||||
//
|
||||
// Tiny, but very sharp OLED display
|
||||
//
|
||||
//#define MKS_12864OLED // Uses the SH1106 controller (default)
|
||||
//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller
|
||||
|
||||
//
|
||||
// AZSMZ 12864 LCD with SD
|
||||
// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html
|
||||
@@ -2106,6 +2111,48 @@
|
||||
//
|
||||
//#define SILVER_GATE_GLCD_CONTROLLER
|
||||
|
||||
//=============================================================================
|
||||
//============================== OLED Displays ==============================
|
||||
//=============================================================================
|
||||
|
||||
//
|
||||
// SSD1306 OLED full graphics generic display
|
||||
//
|
||||
//#define U8GLIB_SSD1306
|
||||
|
||||
//
|
||||
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
|
||||
//
|
||||
//#define SAV_3DGLCD
|
||||
#if ENABLED(SAV_3DGLCD)
|
||||
#define U8GLIB_SSD1306
|
||||
//#define U8GLIB_SH1106
|
||||
#endif
|
||||
|
||||
//
|
||||
// TinyBoy2 128x64 OLED / Encoder Panel
|
||||
//
|
||||
//#define OLED_PANEL_TINYBOY2
|
||||
|
||||
//
|
||||
// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER
|
||||
// http://reprap.org/wiki/MKS_12864OLED
|
||||
//
|
||||
// Tiny, but very sharp OLED display
|
||||
//
|
||||
//#define MKS_12864OLED // Uses the SH1106 controller (default)
|
||||
//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller
|
||||
|
||||
//
|
||||
// Einstart S OLED SSD1306
|
||||
//
|
||||
//#define U8GLIB_SH1106_EINSTART
|
||||
|
||||
//
|
||||
// Overlord OLED display/controller with i2c buzzer and LEDs
|
||||
//
|
||||
//#define OVERLORD_OLED
|
||||
|
||||
//=============================================================================
|
||||
//========================== Extensible UI Displays ===========================
|
||||
//=============================================================================
|
||||
@@ -2120,6 +2167,12 @@
|
||||
//
|
||||
//#define MALYAN_LCD
|
||||
|
||||
//
|
||||
// LulzBot Color Touch UI for FTDI EVE (FT800/FT810) displays
|
||||
// See Configuration_adv.h for all configuration options.
|
||||
//
|
||||
//#define LULZBOT_TOUCH_UI
|
||||
|
||||
//
|
||||
// Third-party or vendor-customized controller interfaces.
|
||||
// Sources should be installed in 'src/lcd/extensible_ui'.
|
||||
@@ -2131,27 +2184,34 @@
|
||||
//=============================================================================
|
||||
|
||||
//
|
||||
// MKS Robin 320x240 color display
|
||||
// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
|
||||
//
|
||||
//#define MKS_ROBIN_TFT
|
||||
//#define FSMC_GRAPHICAL_TFT
|
||||
|
||||
//=============================================================================
|
||||
//============================ Other Controllers ============================
|
||||
//=============================================================================
|
||||
|
||||
//
|
||||
// CONTROLLER TYPE: Keypad / Add-on
|
||||
// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
|
||||
//
|
||||
//#define TOUCH_BUTTONS
|
||||
#if ENABLED(TOUCH_BUTTONS)
|
||||
#define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens
|
||||
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus
|
||||
|
||||
#define XPT2046_X_CALIBRATION 12316
|
||||
#define XPT2046_Y_CALIBRATION -8981
|
||||
#define XPT2046_X_OFFSET -43
|
||||
#define XPT2046_Y_OFFSET 257
|
||||
#endif
|
||||
|
||||
//
|
||||
// RepRapWorld REPRAPWORLD_KEYPAD v1.1
|
||||
// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
|
||||
//
|
||||
// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key
|
||||
// is pressed, a value of 10.0 means 10mm per click.
|
||||
//
|
||||
//#define REPRAPWORLD_KEYPAD
|
||||
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
|
||||
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
|
||||
|
||||
//=============================================================================
|
||||
//=============================== Extra Features ==============================
|
||||
@@ -2237,8 +2297,10 @@
|
||||
//#define NEOPIXEL_LED
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
|
||||
#define NEOPIXEL_PIN 4 // LED driving pin
|
||||
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip
|
||||
#define NEOPIXEL_PIN 4 // LED driving pin
|
||||
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
|
||||
//#define NEOPIXEL2_PIN 5
|
||||
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used
|
||||
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
|
||||
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
|
||||
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
|
||||
@@ -2277,7 +2339,7 @@
|
||||
*/
|
||||
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
|
||||
|
||||
// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
|
||||
// (ms) Delay before the next move will start, to give the servo time to reach its target angle.
|
||||
// 300ms is a good value but you can try less delay.
|
||||
// If the servo can't reach the requested position, increase it.
|
||||
#define SERVO_DELAY { 300 }
|
||||
|
||||
+335
-98
@@ -214,7 +214,7 @@
|
||||
#define AUTOTEMP_OLDWEIGHT 0.98
|
||||
#endif
|
||||
|
||||
// Show extra position information in M114
|
||||
// Show extra position information with 'M114 D'
|
||||
//#define M114_DETAIL
|
||||
|
||||
// Show Temperature ADC value
|
||||
@@ -279,9 +279,10 @@
|
||||
*/
|
||||
//#define USE_CONTROLLER_FAN
|
||||
#if ENABLED(USE_CONTROLLER_FAN)
|
||||
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
|
||||
#define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled
|
||||
#define CONTROLLERFAN_SPEED 255 // 255 == full speed
|
||||
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
|
||||
#define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled
|
||||
#define CONTROLLERFAN_SPEED 255 // 255 == full speed
|
||||
//#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled
|
||||
#endif
|
||||
|
||||
// When first starting the main fan, run it at full speed for the
|
||||
@@ -378,6 +379,7 @@
|
||||
#define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW
|
||||
#define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on
|
||||
#define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin)
|
||||
//#define CASE_LIGHT_MAX_PWM 128 // Limit pwm
|
||||
//#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu
|
||||
//#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting.
|
||||
//#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED.
|
||||
@@ -589,7 +591,7 @@
|
||||
* This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function
|
||||
* If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state.
|
||||
*/
|
||||
//#define BLTOUCH_HS_MODE
|
||||
#define BLTOUCH_HS_MODE
|
||||
|
||||
// Safety: Enable voltage mode settings in the LCD menu.
|
||||
//#define BLTOUCH_LCD_VOLTAGE_MENU
|
||||
@@ -605,25 +607,40 @@
|
||||
#endif
|
||||
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
|
||||
// Define probe X and Y positions for Z1, Z2 [, Z3]
|
||||
#define Z_STEPPER_ALIGN_X { 50, 350 }
|
||||
#define Z_STEPPER_ALIGN_Y { 200, 200 }
|
||||
#if ENABLED(SX2)
|
||||
#define Z_STEPPER_ALIGN_XY { { 42, 100 }, { 225, 100 } }
|
||||
#else
|
||||
#define Z_STEPPER_ALIGN_XY { { 50, 200 }, { 350, 200 } }
|
||||
#endif
|
||||
|
||||
// Provide Z stepper positions for more rapid convergence in bed alignment.
|
||||
// Currently requires triple stepper drivers.
|
||||
//#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS
|
||||
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
// Define Stepper XY positions for Z1, Z2, Z3 corresponding to
|
||||
// the Z screw positions in the bed carriage.
|
||||
// Define one position per Z stepper in stepper driver order.
|
||||
#define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } }
|
||||
#else
|
||||
// Amplification factor. Used to scale the correction step up or down.
|
||||
// In case the stepper (spindle) position is further out than the test point.
|
||||
// Use a value > 1. NOTE: This may cause instability
|
||||
#define Z_STEPPER_ALIGN_AMP 1.0
|
||||
#endif
|
||||
|
||||
// Set number of iterations to align
|
||||
#define Z_STEPPER_ALIGN_ITERATIONS 3
|
||||
#define Z_STEPPER_ALIGN_ITERATIONS 6
|
||||
// Enable to restore leveling setup after operation
|
||||
#define RESTORE_LEVELING_AFTER_G34
|
||||
|
||||
// On a 300mm bed a 5% grade would give a misalignment of ~1.5cm
|
||||
#define G34_MAX_GRADE 15 // (%) Maximum incline G34 will handle
|
||||
|
||||
// Use the amplification factor to de-/increase correction step.
|
||||
// In case the stepper (spindle) position is further out than the test point
|
||||
// Use a value > 1. NOTE: This may cause instability
|
||||
#define Z_STEPPER_ALIGN_AMP 1.0
|
||||
// Stop criterion. If the accuracy is better than this stop iterating early
|
||||
#define Z_STEPPER_ALIGN_ACC 0.02
|
||||
#endif
|
||||
|
||||
// @section machine
|
||||
// @section motion
|
||||
|
||||
#define AXIS_RELATIVE_MODES { false, false, false, false }
|
||||
|
||||
@@ -650,20 +667,8 @@
|
||||
|
||||
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
|
||||
|
||||
// @section lcd
|
||||
|
||||
#if EITHER(ULTIPANEL, EXTENSIBLE_UI)
|
||||
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel
|
||||
#if ENABLED(ULTIPANEL)
|
||||
#define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position"
|
||||
#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// @section extras
|
||||
|
||||
// minimum time in microseconds that a movement needs to take if the buffer is emptied.
|
||||
#define DEFAULT_MINSEGMENTTIME 20000
|
||||
// Minimum time that a segment needs to take if the buffer is emptied
|
||||
#define DEFAULT_MINSEGMENTTIME 20000 // (ms)
|
||||
|
||||
// If defined the movements slow down when the look ahead buffer is only half full
|
||||
#define SLOWDOWN
|
||||
@@ -741,8 +746,8 @@
|
||||
//#define CALIBRATION_REPORTING
|
||||
|
||||
// The true location and dimension the cube/bolt/washer on the bed.
|
||||
#define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm
|
||||
#define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm
|
||||
#define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm
|
||||
#define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm
|
||||
|
||||
// Comment out any sides which are unreachable by the probe. For best
|
||||
// auto-calibration results, all sides must be reachable.
|
||||
@@ -840,6 +845,15 @@
|
||||
|
||||
// @section lcd
|
||||
|
||||
#if EITHER(ULTIPANEL, EXTENSIBLE_UI)
|
||||
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel
|
||||
#define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm)
|
||||
#if ENABLED(ULTIPANEL)
|
||||
#define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position"
|
||||
#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Change values more rapidly when the encoder is rotated faster
|
||||
#define ENCODER_RATE_MULTIPLIER
|
||||
#if ENABLED(ENCODER_RATE_MULTIPLIER)
|
||||
@@ -854,8 +868,35 @@
|
||||
#define FEEDRATE_CHANGE_BEEP_FREQUENCY 440
|
||||
#endif
|
||||
|
||||
// Include a page of printer information in the LCD Main Menu
|
||||
#define LCD_INFO_MENU
|
||||
#if HAS_LCD_MENU
|
||||
|
||||
// Include a page of printer information in the LCD Main Menu
|
||||
#define LCD_INFO_MENU
|
||||
#if ENABLED(LCD_INFO_MENU)
|
||||
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
|
||||
#endif
|
||||
|
||||
// BACK menu items keep the highlight at the top
|
||||
//#define TURBO_BACK_MENU_ITEM
|
||||
|
||||
/**
|
||||
* LED Control Menu
|
||||
* Add LED Control to the LCD menu
|
||||
*/
|
||||
//#define LED_CONTROL_MENU
|
||||
#if ENABLED(LED_CONTROL_MENU)
|
||||
#define LED_COLOR_PRESETS // Enable the Preset Color menu option
|
||||
#if ENABLED(LED_COLOR_PRESETS)
|
||||
#define LED_USER_PRESET_RED 255 // User defined RED value
|
||||
#define LED_USER_PRESET_GREEN 128 // User defined GREEN value
|
||||
#define LED_USER_PRESET_BLUE 0 // User defined BLUE value
|
||||
#define LED_USER_PRESET_WHITE 255 // User defined WHITE value
|
||||
#define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity
|
||||
//#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
|
||||
// Scroll a longer status message into view
|
||||
#define STATUS_MESSAGE_SCROLLING
|
||||
@@ -869,6 +910,11 @@
|
||||
// Add an 'M73' G-code to set the current percentage
|
||||
//#define LCD_SET_PROGRESS_MANUALLY
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits (Graphical LCD only)
|
||||
//#define SHOW_REMAINING_TIME // Display estimated time to completion (Graphical LCD only)
|
||||
#endif
|
||||
|
||||
#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS
|
||||
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
|
||||
#if ENABLED(LCD_PROGRESS_BAR)
|
||||
@@ -880,23 +926,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LED Control Menu
|
||||
* Enable this feature to add LED Control to the LCD menu
|
||||
*/
|
||||
//#define LED_CONTROL_MENU
|
||||
#if ENABLED(LED_CONTROL_MENU)
|
||||
#define LED_COLOR_PRESETS // Enable the Preset Color menu option
|
||||
#if ENABLED(LED_COLOR_PRESETS)
|
||||
#define LED_USER_PRESET_RED 255 // User defined RED value
|
||||
#define LED_USER_PRESET_GREEN 128 // User defined GREEN value
|
||||
#define LED_USER_PRESET_BLUE 0 // User defined BLUE value
|
||||
#define LED_USER_PRESET_WHITE 255 // User defined WHITE value
|
||||
#define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity
|
||||
//#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
|
||||
#endif
|
||||
#endif // LED_CONTROL_MENU
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
|
||||
@@ -933,6 +962,7 @@
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
//#define POWER_LOSS_PIN 44 // Pin to detect power loss
|
||||
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
|
||||
//#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate
|
||||
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
|
||||
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
|
||||
|
||||
@@ -1012,17 +1042,31 @@
|
||||
* equivalent MAX3421E breakout board. The USB thumb drive will appear
|
||||
* to Marlin as an SD card.
|
||||
*
|
||||
* The MAX3421E must be assigned the same pins as the SD card reader, with
|
||||
* The MAX3421E can be assigned the same pins as the SD card reader, with
|
||||
* the following pin mapping:
|
||||
*
|
||||
* SCLK, MOSI, MISO --> SCLK, MOSI, MISO
|
||||
* INT --> SD_DETECT_PIN
|
||||
* INT --> SD_DETECT_PIN [1]
|
||||
* SS --> SDSS
|
||||
*
|
||||
* [1] On AVR an interrupt-capable pin is best for UHS3 compatibility.
|
||||
*/
|
||||
//#define USB_FLASH_DRIVE_SUPPORT
|
||||
#if ENABLED(USB_FLASH_DRIVE_SUPPORT)
|
||||
#define USB_CS_PIN SDSS
|
||||
#define USB_INTR_PIN SD_DETECT_PIN
|
||||
#define USB_CS_PIN SDSS
|
||||
#define USB_INTR_PIN SD_DETECT_PIN
|
||||
|
||||
/**
|
||||
* USB Host Shield Library
|
||||
*
|
||||
* - UHS2 uses no interrupts and has been production-tested
|
||||
* on a LulzBot TAZ Pro with a 32-bit Archim board.
|
||||
*
|
||||
* - UHS3 is newer code with better USB compatibility. But it
|
||||
* is less tested and is known to interfere with Servos.
|
||||
* [1] This requires USB_INTR_PIN to be interrupt-capable.
|
||||
*/
|
||||
//#define USE_UHS3_USB
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1044,8 +1088,7 @@
|
||||
// Add an optimized binary file transfer mode, initiated with 'M28 B1'
|
||||
//#define BINARY_FILE_TRANSFER
|
||||
|
||||
|
||||
#ifdef TARGET_LPC1768
|
||||
#if HAS_SDCARD_CONNECTION
|
||||
/**
|
||||
* Set this option to one of the following (or the board's defaults apply):
|
||||
*
|
||||
@@ -1055,7 +1098,7 @@
|
||||
*
|
||||
* :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ]
|
||||
*/
|
||||
#define SDCARD_CONNECTION ONBOARD
|
||||
//#define SDCARD_CONNECTION LCD
|
||||
#endif
|
||||
|
||||
#endif // SDSUPPORT
|
||||
@@ -1080,7 +1123,7 @@
|
||||
*/
|
||||
#if HAS_GRAPHICAL_LCD
|
||||
// Show SD percentage next to the progress bar
|
||||
//#define DOGM_SD_PERCENT
|
||||
#define DOGM_SD_PERCENT
|
||||
|
||||
// Enable to save many cycles by drawing a hollow frame on the Info Screen
|
||||
#define XYZ_HOLLOW_FRAME
|
||||
@@ -1138,6 +1181,7 @@
|
||||
//#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames
|
||||
//#define STATUS_HEAT_PERCENT // Show heating in a progress bar
|
||||
#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash)
|
||||
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of PROGMEM.
|
||||
|
||||
// Frivolous Game Options
|
||||
#if ENABLED(SKR13)
|
||||
@@ -1148,6 +1192,101 @@
|
||||
|
||||
#endif // HAS_GRAPHICAL_LCD
|
||||
|
||||
//
|
||||
// Lulzbot Touch UI
|
||||
//
|
||||
#if ENABLED(LULZBOT_TOUCH_UI)
|
||||
// Display board used
|
||||
//#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240)
|
||||
//#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272)
|
||||
//#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272)
|
||||
//#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480)
|
||||
//#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI
|
||||
|
||||
// Correct the resolution if not using the stock TFT panel.
|
||||
//#define TOUCH_UI_320x240
|
||||
//#define TOUCH_UI_480x272
|
||||
//#define TOUCH_UI_800x480
|
||||
|
||||
// Mappings for boards with a standard RepRapDiscount Display connector
|
||||
//#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping
|
||||
//#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping
|
||||
//#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping
|
||||
//#define OTHER_PIN_LAYOUT // Define pins manually below
|
||||
#if ENABLED(OTHER_PIN_LAYOUT)
|
||||
// The pins for CS and MOD_RESET (PD) must be chosen.
|
||||
#define CLCD_MOD_RESET 9
|
||||
#define CLCD_SPI_CS 10
|
||||
|
||||
// If using software SPI, specify pins for SCLK, MOSI, MISO
|
||||
//#define CLCD_USE_SOFT_SPI
|
||||
#if ENABLED(CLCD_USE_SOFT_SPI)
|
||||
#define CLCD_SOFT_SPI_MOSI 11
|
||||
#define CLCD_SOFT_SPI_MISO 12
|
||||
#define CLCD_SOFT_SPI_SCLK 13
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Display Orientation. An inverted (i.e. upside-down) display
|
||||
// is supported on the FT800. The FT810 and beyond also support
|
||||
// portrait and mirrored orientations.
|
||||
//#define TOUCH_UI_INVERTED
|
||||
//#define TOUCH_UI_PORTRAIT
|
||||
//#define TOUCH_UI_MIRRORED
|
||||
|
||||
// UTF8 processing and rendering.
|
||||
// Unsupported characters are shown as '?'.
|
||||
//#define TOUCH_UI_USE_UTF8
|
||||
#if ENABLED(TOUCH_UI_USE_UTF8)
|
||||
// Western accents support. These accented characters use
|
||||
// combined bitmaps and require relatively little storage.
|
||||
#define TOUCH_UI_UTF8_WESTERN_CHARSET
|
||||
#if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET)
|
||||
// Additional character groups. These characters require
|
||||
// full bitmaps and take up considerable storage:
|
||||
//#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³
|
||||
//#define TOUCH_UI_UTF8_COPYRIGHT // © ®
|
||||
//#define TOUCH_UI_UTF8_GERMANIC // ß
|
||||
//#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ
|
||||
//#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡
|
||||
//#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥
|
||||
//#define TOUCH_UI_UTF8_ORDINALS // º ª
|
||||
//#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷
|
||||
//#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾
|
||||
//#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Use a smaller font when labels don't fit buttons
|
||||
#define TOUCH_UI_FIT_TEXT
|
||||
|
||||
// Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE)
|
||||
//#define LCD_LANGUAGE_1 en
|
||||
//#define LCD_LANGUAGE_2 fr
|
||||
//#define LCD_LANGUAGE_3 de
|
||||
//#define LCD_LANGUAGE_4 es
|
||||
//#define LCD_LANGUAGE_5 it
|
||||
|
||||
// Use a numeric passcode for "Screen lock" keypad.
|
||||
// (recommended for smaller displays)
|
||||
//#define TOUCH_UI_PASSCODE
|
||||
|
||||
// Output extra debug info for Touch UI events
|
||||
//#define TOUCH_UI_DEBUG
|
||||
#endif
|
||||
|
||||
//
|
||||
// FSMC Graphical TFT
|
||||
//
|
||||
#if ENABLED(FSMC_GRAPHICAL_TFT)
|
||||
//#define TFT_MARLINUI_COLOR 0xFFFF // White
|
||||
//#define TFT_MARLINBG_COLOR 0x0000 // Black
|
||||
//#define TFT_DISABLED_COLOR 0x0003 // Almost black
|
||||
//#define TFT_BTCANCEL_COLOR 0xF800 // Red
|
||||
//#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow
|
||||
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
|
||||
#endif
|
||||
|
||||
// @section safety
|
||||
|
||||
/**
|
||||
@@ -1196,7 +1335,9 @@
|
||||
#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
|
||||
//#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
|
||||
#if ENABLED(GRAPHICSLCD)
|
||||
#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1218,7 +1359,7 @@
|
||||
* See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
|
||||
* Mention @Sebastianv650 on GitHub to alert the author of any issues.
|
||||
*/
|
||||
#if DISABLED(SKR13)
|
||||
#if E0_DRIVER_TYPE != TMC2208_STANDALONE
|
||||
#define LIN_ADVANCE
|
||||
#endif
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
@@ -1229,6 +1370,42 @@
|
||||
|
||||
// @section leveling
|
||||
|
||||
/**
|
||||
* Points to probe for all 3-point Leveling procedures.
|
||||
* Override if the automatically selected points are inadequate.
|
||||
*/
|
||||
#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL)
|
||||
//#define PROBE_PT_1_X 15
|
||||
//#define PROBE_PT_1_Y 180
|
||||
//#define PROBE_PT_2_X 15
|
||||
//#define PROBE_PT_2_Y 20
|
||||
//#define PROBE_PT_3_X 170
|
||||
//#define PROBE_PT_3_Y 20
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* If you are replacing the prior *_PROBE_BED_POSITION options,
|
||||
* LEFT and FRONT values in most cases will map directly over
|
||||
* RIGHT and REAR would be the inverse such as
|
||||
* (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION)
|
||||
*
|
||||
* This will allow all positions to match at compilation, however
|
||||
* should the probe position be modified with M851XY then the
|
||||
* probe points will follow. This prevents any change from causing
|
||||
* the probe to be unable to reach any points.
|
||||
*/
|
||||
#if PROBE_SELECTED && !IS_KINEMATIC
|
||||
//#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE
|
||||
//#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE
|
||||
//#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE
|
||||
//#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE
|
||||
#endif
|
||||
|
||||
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
|
||||
// Override the mesh area if the automatic (max) area is too large
|
||||
//#define MESH_MIN_X MESH_INSET
|
||||
@@ -1291,7 +1468,7 @@
|
||||
#define MIN_STEPS_PER_SEGMENT 6
|
||||
|
||||
/**
|
||||
* Minimum delay after setting the stepper DIR (in ns)
|
||||
* Minimum delay before and after setting the stepper DIR (in ns)
|
||||
* 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire)
|
||||
* 20 : Minimum for TMC2xxx drivers
|
||||
* 200 : Minimum for A4988 drivers
|
||||
@@ -1303,7 +1480,8 @@
|
||||
*
|
||||
* Override the default value based on the driver type set in Configuration.h.
|
||||
*/
|
||||
//#define MINIMUM_STEPPER_DIR_DELAY 650
|
||||
//#define MINIMUM_STEPPER_POST_DIR_DELAY 650
|
||||
//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650
|
||||
|
||||
/**
|
||||
* Minimum stepper driver pulse width (in µs)
|
||||
@@ -1378,6 +1556,9 @@
|
||||
//#define SERIAL_XON_XOFF
|
||||
#endif
|
||||
|
||||
// Add M575 G-code to change the baud rate
|
||||
//#define BAUD_RATE_GCODE
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
// Enable this option to collect and display the maximum
|
||||
// RX queue usage after transferring a file to SD.
|
||||
@@ -1435,19 +1616,19 @@
|
||||
*/
|
||||
#define FWRETRACT
|
||||
#if ENABLED(FWRETRACT)
|
||||
#define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM
|
||||
#define FWRETRACT_AUTORETRACT // Override slicer retractions
|
||||
#if ENABLED(FWRETRACT_AUTORETRACT)
|
||||
#define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over
|
||||
#define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion
|
||||
#define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length
|
||||
#define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length
|
||||
#endif
|
||||
#define RETRACT_LENGTH 3 // Default retract length (positive mm)
|
||||
#define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change
|
||||
#define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s)
|
||||
#define RETRACT_ZRAISE 0 // Default retract Z-raise (mm)
|
||||
#define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering)
|
||||
#define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change)
|
||||
#define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s)
|
||||
#define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s)
|
||||
#define RETRACT_LENGTH 3 // (mm) Default retract length (positive value)
|
||||
#define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value)
|
||||
#define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting
|
||||
#define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise
|
||||
#define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover)
|
||||
#define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange)
|
||||
#define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction
|
||||
#define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction
|
||||
#if ENABLED(MIXING_EXTRUDER)
|
||||
//#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously
|
||||
#endif
|
||||
@@ -1653,78 +1834,91 @@
|
||||
#define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
|
||||
#define X_MICROSTEPS 16 // 0..256
|
||||
#define X_RSENSE 0.11
|
||||
#define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ...
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(X2)
|
||||
#define X2_CURRENT 800
|
||||
#define X2_MICROSTEPS 16
|
||||
#define X2_RSENSE 0.11
|
||||
#define X2_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Y)
|
||||
#define Y_CURRENT 800
|
||||
#define Y_MICROSTEPS 16
|
||||
#define Y_RSENSE 0.11
|
||||
#define Y_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Y2)
|
||||
#define Y2_CURRENT 800
|
||||
#define Y2_MICROSTEPS 16
|
||||
#define Y2_RSENSE 0.11
|
||||
#define Y2_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z)
|
||||
#define Z_CURRENT 800
|
||||
#define Z_MICROSTEPS 16
|
||||
#define Z_RSENSE 0.11
|
||||
#define Z_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z2)
|
||||
#define Z2_CURRENT 800
|
||||
#define Z2_MICROSTEPS 16
|
||||
#define Z2_RSENSE 0.11
|
||||
#define Z2_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z3)
|
||||
#define Z3_CURRENT 800
|
||||
#define Z3_MICROSTEPS 16
|
||||
#define Z3_RSENSE 0.11
|
||||
#define Z3_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0)
|
||||
#define E0_CURRENT 800
|
||||
#define E0_MICROSTEPS 16
|
||||
#define E0_RSENSE 0.11
|
||||
#define E0_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E1)
|
||||
#define E1_CURRENT 800
|
||||
#define E1_MICROSTEPS 16
|
||||
#define E1_RSENSE 0.11
|
||||
#define E1_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E2)
|
||||
#define E2_CURRENT 800
|
||||
#define E2_MICROSTEPS 16
|
||||
#define E2_RSENSE 0.11
|
||||
#define E2_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E3)
|
||||
#define E3_CURRENT 800
|
||||
#define E3_MICROSTEPS 16
|
||||
#define E3_RSENSE 0.11
|
||||
#define E3_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E4)
|
||||
#define E4_CURRENT 800
|
||||
#define E4_MICROSTEPS 16
|
||||
#define E4_RSENSE 0.11
|
||||
#define E4_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E5)
|
||||
#define E5_CURRENT 800
|
||||
#define E5_MICROSTEPS 16
|
||||
#define E5_RSENSE 0.11
|
||||
#define E5_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1763,6 +1957,9 @@
|
||||
* 1 | HIGH | LOW
|
||||
* 2 | LOW | HIGH
|
||||
* 3 | HIGH | HIGH
|
||||
*
|
||||
* Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers
|
||||
* on the same serial port, either here or in your board's pins file.
|
||||
*/
|
||||
#define X_SLAVE_ADDRESS 0
|
||||
#define Y_SLAVE_ADDRESS 0
|
||||
@@ -1854,17 +2051,27 @@
|
||||
#define E5_HYBRID_THRESHOLD 30
|
||||
|
||||
/**
|
||||
* Use StallGuard2 to home / probe X, Y, Z.
|
||||
*
|
||||
* TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only
|
||||
* Use StallGuard2 to sense an obstacle and trigger an endstop.
|
||||
* Connect the stepper driver's DIAG1 pin to the X/Y endstop pin.
|
||||
* X, Y, and Z homing will always be done in spreadCycle mode.
|
||||
*
|
||||
* X/Y/Z_STALL_SENSITIVITY is used for tuning the trigger sensitivity.
|
||||
* Higher values make the system LESS sensitive.
|
||||
* Lower value make the system MORE sensitive.
|
||||
* Too low values can lead to false positives, while too high values will collide the axis without triggering.
|
||||
* It is advised to set X/Y/Z_HOME_BUMP_MM to 0.
|
||||
* M914 X/Y/Z to live tune the setting
|
||||
* X/Y/Z_STALL_SENSITIVITY is the default stall threshold.
|
||||
* Use M914 X Y Z to set the stall threshold at runtime:
|
||||
*
|
||||
* Sensitivity TMC2209 Others
|
||||
* HIGHEST 255 -64 (Too sensitive => False positive)
|
||||
* LOWEST 0 63 (Too insensitive => No trigger)
|
||||
*
|
||||
* It is recommended to set [XYZ]_HOME_BUMP_MM to 0.
|
||||
*
|
||||
* SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only ***
|
||||
* Poll the driver through SPI to determine load when homing.
|
||||
* Removes the need for a wire from DIAG1 to an endstop pin.
|
||||
*
|
||||
* IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when
|
||||
* homing and adds a guard period for endstop triggering.
|
||||
*/
|
||||
//#define SENSORLESS_HOMING // StallGuard capable drivers only
|
||||
|
||||
@@ -1879,8 +2086,11 @@
|
||||
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
|
||||
// TMC2209: 0...255. TMC2130: -64...63
|
||||
#define X_STALL_SENSITIVITY 8
|
||||
#define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY
|
||||
#define Y_STALL_SENSITIVITY 8
|
||||
//#define Z_STALL_SENSITIVITY 8
|
||||
//#define SPI_ENDSTOPS // TMC2130 only
|
||||
//#define IMPROVE_HOMING_RELIABILITY
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1934,7 +2144,7 @@
|
||||
#define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
|
||||
#define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down)
|
||||
#define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper
|
||||
#define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
|
||||
#define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_X2(L6470)
|
||||
@@ -1942,7 +2152,7 @@
|
||||
#define X2_OVERCURRENT 2000
|
||||
#define X2_STALLCURRENT 1500
|
||||
#define X2_MAX_VOLTAGE 127
|
||||
#define X2_CHAIN_POS 0
|
||||
#define X2_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_Y(L6470)
|
||||
@@ -1950,7 +2160,7 @@
|
||||
#define Y_OVERCURRENT 2000
|
||||
#define Y_STALLCURRENT 1500
|
||||
#define Y_MAX_VOLTAGE 127
|
||||
#define Y_CHAIN_POS 0
|
||||
#define Y_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_Y2(L6470)
|
||||
@@ -1958,7 +2168,7 @@
|
||||
#define Y2_OVERCURRENT 2000
|
||||
#define Y2_STALLCURRENT 1500
|
||||
#define Y2_MAX_VOLTAGE 127
|
||||
#define Y2_CHAIN_POS 0
|
||||
#define Y2_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_Z(L6470)
|
||||
@@ -1966,7 +2176,7 @@
|
||||
#define Z_OVERCURRENT 2000
|
||||
#define Z_STALLCURRENT 1500
|
||||
#define Z_MAX_VOLTAGE 127
|
||||
#define Z_CHAIN_POS 0
|
||||
#define Z_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_Z2(L6470)
|
||||
@@ -1974,7 +2184,7 @@
|
||||
#define Z2_OVERCURRENT 2000
|
||||
#define Z2_STALLCURRENT 1500
|
||||
#define Z2_MAX_VOLTAGE 127
|
||||
#define Z2_CHAIN_POS 0
|
||||
#define Z2_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_Z3(L6470)
|
||||
@@ -1982,7 +2192,7 @@
|
||||
#define Z3_OVERCURRENT 2000
|
||||
#define Z3_STALLCURRENT 1500
|
||||
#define Z3_MAX_VOLTAGE 127
|
||||
#define Z3_CHAIN_POS 0
|
||||
#define Z3_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_E0(L6470)
|
||||
@@ -1990,7 +2200,7 @@
|
||||
#define E0_OVERCURRENT 2000
|
||||
#define E0_STALLCURRENT 1500
|
||||
#define E0_MAX_VOLTAGE 127
|
||||
#define E0_CHAIN_POS 0
|
||||
#define E0_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_E1(L6470)
|
||||
@@ -1998,7 +2208,7 @@
|
||||
#define E1_OVERCURRENT 2000
|
||||
#define E1_STALLCURRENT 1500
|
||||
#define E1_MAX_VOLTAGE 127
|
||||
#define E1_CHAIN_POS 0
|
||||
#define E1_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_E2(L6470)
|
||||
@@ -2006,7 +2216,7 @@
|
||||
#define E2_OVERCURRENT 2000
|
||||
#define E2_STALLCURRENT 1500
|
||||
#define E2_MAX_VOLTAGE 127
|
||||
#define E2_CHAIN_POS 0
|
||||
#define E2_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_E3(L6470)
|
||||
@@ -2014,7 +2224,7 @@
|
||||
#define E3_OVERCURRENT 2000
|
||||
#define E3_STALLCURRENT 1500
|
||||
#define E3_MAX_VOLTAGE 127
|
||||
#define E3_CHAIN_POS 0
|
||||
#define E3_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_E4(L6470)
|
||||
@@ -2022,7 +2232,7 @@
|
||||
#define E4_OVERCURRENT 2000
|
||||
#define E4_STALLCURRENT 1500
|
||||
#define E4_MAX_VOLTAGE 127
|
||||
#define E4_CHAIN_POS 0
|
||||
#define E4_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_E5(L6470)
|
||||
@@ -2030,7 +2240,7 @@
|
||||
#define E5_OVERCURRENT 2000
|
||||
#define E5_STALLCURRENT 1500
|
||||
#define E5_MAX_VOLTAGE 127
|
||||
#define E5_CHAIN_POS 0
|
||||
#define E5_CHAIN_POS -1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -2235,6 +2445,13 @@
|
||||
*/
|
||||
#define EXTENDED_CAPABILITIES_REPORT
|
||||
|
||||
/**
|
||||
* Expected Printer Check
|
||||
* Add the M16 G-code to compare a string to the MACHINE_NAME.
|
||||
* M16 with a non-matching string causes the printer to halt.
|
||||
*/
|
||||
//#define EXPECTED_PRINTER_CHECK
|
||||
|
||||
/**
|
||||
* Disable all Volumetric extrusion options
|
||||
*/
|
||||
@@ -2289,6 +2506,13 @@
|
||||
//#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Startup commands
|
||||
*
|
||||
* Execute certain G-code commands immediately after power-on.
|
||||
*/
|
||||
//#define STARTUP_COMMANDS "M17 Z"
|
||||
|
||||
/**
|
||||
* G-code Macros
|
||||
*
|
||||
@@ -2313,7 +2537,7 @@
|
||||
|
||||
#define CommBedTmp "65"
|
||||
#if ENABLED(DUAL_Z)
|
||||
#define ALIGN_CMD "G34I3\n"
|
||||
#define ALIGN_CMD "G34I20\n"
|
||||
#else
|
||||
#define ALIGN_CMD ""
|
||||
#endif
|
||||
@@ -2325,7 +2549,7 @@
|
||||
#endif
|
||||
|
||||
#define USER_DESC_2 "PID Tune"
|
||||
#define USER_GCODE_2 "M106 S128 \n M303 C8 S225 E1 U \n M500 \n M117 PID Tune Done"
|
||||
#define USER_GCODE_2 "M106 S128 \n M303 C8 S225 E0 U \n M500 \n M117 PID Tune Done"
|
||||
|
||||
#define USER_DESC_3 "Prep for Z Adjust"
|
||||
#define USER_GCODE_3 "M190 S" CommBedTmp" \n M104 S235 \n G28 \n G29 L1 \n G1 X100 Y 100 \n G1 Z0"
|
||||
@@ -2356,10 +2580,6 @@
|
||||
#define HOST_PROMPT_SUPPORT
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
//====================== I2C Position Encoder Settings ======================
|
||||
//===========================================================================
|
||||
|
||||
/**
|
||||
* I2C position encoders for closed loop control.
|
||||
* Developed by Chris Barr at Aus3D.
|
||||
@@ -2440,6 +2660,22 @@
|
||||
|
||||
#endif // I2C_POSITION_ENCODERS
|
||||
|
||||
/**
|
||||
* Analog Joystick(s)
|
||||
*/
|
||||
//#define JOYSTICK
|
||||
#if ENABLED(JOYSTICK)
|
||||
#define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2
|
||||
#define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2
|
||||
#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 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 }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MAX7219 Debug Matrix
|
||||
*
|
||||
@@ -2458,6 +2694,7 @@
|
||||
#define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°)
|
||||
// connector at: right=0 bottom=-90 top=90 left=180
|
||||
//#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order
|
||||
//#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side
|
||||
|
||||
/**
|
||||
* Sample debug features
|
||||
@@ -2568,7 +2805,7 @@
|
||||
/**
|
||||
* M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
|
||||
*/
|
||||
#define PINS_DEBUGGING
|
||||
//#define PINS_DEBUGGING
|
||||
|
||||
// Enable Marlin dev mode which adds some special commands
|
||||
//#define MARLIN_DEV_MODE
|
||||
|
||||
+33
-21
@@ -237,7 +237,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1134)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1135)
|
||||
# Dagoma F5
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1136)
|
||||
# Fysetc F6
|
||||
# FYSETC F6
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1137)
|
||||
# Duplicator i3 Plus
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1138)
|
||||
@@ -247,6 +247,14 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1139)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1140)
|
||||
# Z-Bolt X Series
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1141)
|
||||
# TT OSCAR
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1142)
|
||||
# Overlord/Overlord Pro
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1143)
|
||||
# ADIMLab Gantry v1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1144)
|
||||
# ADIMLab Gantry v2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1145)
|
||||
|
||||
#
|
||||
# RAMBo and derivatives
|
||||
@@ -273,50 +281,54 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1205)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1300)
|
||||
# Cartesio CN Controls V12
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1301)
|
||||
# Cheaptronic v1.0
|
||||
# Cartesio CN Controls V15
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1302)
|
||||
# Cheaptronic v2.0
|
||||
# Cheaptronic v1.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1303)
|
||||
# Makerbot Mightyboard Revision E
|
||||
# Cheaptronic v2.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1304)
|
||||
# Megatronics
|
||||
# Makerbot Mightyboard Revision E
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1305)
|
||||
# Megatronics v2.0
|
||||
# Megatronics
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1306)
|
||||
# Megatronics v3.0
|
||||
# Megatronics v2.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1307)
|
||||
# Megatronics v3.1
|
||||
# Megatronics v3.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1308)
|
||||
# Megatronics v3.2
|
||||
# Megatronics v3.1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1309)
|
||||
# Elefu Ra Board (v3)
|
||||
# Megatronics v3.2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1310)
|
||||
# Leapfrog
|
||||
# Elefu Ra Board (v3)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1311)
|
||||
# Mega controller
|
||||
# Leapfrog
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1312)
|
||||
# Geeetech GT2560 Rev B for Mecreator2
|
||||
# Mega controller
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1313)
|
||||
# Geeetech GT2560 Rev. A
|
||||
# Geeetech GT2560 Rev B for Mecreator2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1314)
|
||||
# Geeetech GT2560 Rev. A+ (with auto level probe)
|
||||
# Geeetech GT2560 Rev. A
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1315)
|
||||
# Geeetech GT2560 Rev B for A10(M/D)
|
||||
# Geeetech GT2560 Rev. A+ (with auto level probe)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1316)
|
||||
# Geeetech GT2560 Rev B for A20(M/D)
|
||||
# Geeetech GT2560 Rev B for A10(M/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1317)
|
||||
# Einstart retrofit
|
||||
# Geeetech GT2560 Rev B for A20(M/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1318)
|
||||
# Wanhao 0ne+ i3 Mini
|
||||
# Einstart retrofit
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1319)
|
||||
# Wanhao 0ne+ i3 Mini
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1320)
|
||||
|
||||
#
|
||||
# ATmega1281, ATmega2561
|
||||
#
|
||||
|
||||
# Minitronics v1.0/1.1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1400)
|
||||
MCU ?= atmega1281
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1410)
|
||||
# Silvergate v1.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1401)
|
||||
MCU ?= atmega1281
|
||||
|
||||
#
|
||||
@@ -681,7 +693,7 @@ CXXSTANDARD = -std=gnu++11
|
||||
CDEBUG = -g$(DEBUG)
|
||||
CWARN = -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
|
||||
CXXWARN = -Wall -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
|
||||
CTUNING = -fsigned-char -funsigned-bitfields -fpack-struct -fno-exceptions \
|
||||
CTUNING = -fsigned-char -funsigned-bitfields -fno-exceptions \
|
||||
-fshort-enums -ffunction-sections -fdata-sections
|
||||
ifneq ($(HARDWARE_MOTHERBOARD),)
|
||||
CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
Marlin Firmware
|
||||
|
||||
(c) 2011-2018 MarlinFirmware
|
||||
(c) 2011-2019 MarlinFirmware
|
||||
Portions of Marlin are (c) by their respective authors.
|
||||
All code complies with GPLv2 and/or GPLv3
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
////////////////////////////
|
||||
// VENDOR VERSION EXAMPLE //
|
||||
////////////////////////////
|
||||
|
||||
/**
|
||||
* Marlin release version identifier
|
||||
*/
|
||||
#define SHORT_BUILD_VERSION "2.0.x_SX4I"
|
||||
|
||||
/**
|
||||
* Verbose version identifier which should contain a reference to the location
|
||||
* from where the binary was downloaded or the source code was compiled.
|
||||
*/
|
||||
#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " TM3D"
|
||||
|
||||
/**
|
||||
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
#define STRING_DISTRIBUTION_DATE "2019-10-19"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
*/
|
||||
#define MACHINE_NAME "TM3D SX4"
|
||||
|
||||
/**
|
||||
* The SOURCE_CODE_URL is the location where users will find the Marlin Source
|
||||
* Code which is installed on the device. In most cases —unless the manufacturer
|
||||
* has a distinct Github fork— the Source Code URL should just be the main
|
||||
* Marlin repository.
|
||||
*/
|
||||
#define SOURCE_CODE_URL "https://github.com/InsanityAutomation/Marlin/tree/TM_SX4_2.0"
|
||||
|
||||
/**
|
||||
* Default generic printer UUID.
|
||||
*/
|
||||
//#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff"
|
||||
|
||||
/**
|
||||
* The WEBSITE_URL is the location where users can get more information such as
|
||||
* documentation about a specific Marlin release.
|
||||
*/
|
||||
#define WEBSITE_URL "tinymachines3d.com"
|
||||
|
||||
/**
|
||||
* Set the vendor info the serial USB interface, if changable
|
||||
* Currently only supported by DUE platform
|
||||
*/
|
||||
//#define USB_DEVICE_VENDOR_ID 0x0000
|
||||
//#define USB_DEVICE_PRODUCT_ID 0x0000
|
||||
//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
|
||||
@@ -24,3 +24,9 @@
|
||||
#include "platforms.h"
|
||||
|
||||
#include HAL_PATH(.,HAL.h)
|
||||
|
||||
inline void watchdog_refresh() {
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
HAL_watchdog_refresh();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
void HAL_init(void) {
|
||||
void HAL_init() {
|
||||
// Init Servo Pins
|
||||
#define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
|
||||
#if HAS_SERVO_0
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio_AVR.h"
|
||||
#include "watchdog_AVR.h"
|
||||
#include "math_AVR.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "math.h"
|
||||
|
||||
#ifdef USBCON
|
||||
#include "HardwareSerial.h"
|
||||
@@ -105,18 +105,21 @@ typedef int8_t pin_t;
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
void HAL_init(void);
|
||||
void HAL_init();
|
||||
|
||||
//void cli(void);
|
||||
//void cli();
|
||||
|
||||
//void _delay_ms(const int delay);
|
||||
|
||||
inline void HAL_clear_reset_source(void) { MCUSR = 0; }
|
||||
inline uint8_t HAL_get_reset_source(void) { return MCUSR; }
|
||||
inline void HAL_clear_reset_source() { MCUSR = 0; }
|
||||
inline uint8_t HAL_get_reset_source() { return MCUSR; }
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
extern "C" {
|
||||
int freeMemory(void);
|
||||
int freeMemory();
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// timers
|
||||
#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz
|
||||
@@ -143,8 +146,7 @@ extern "C" {
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B)
|
||||
#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B)
|
||||
|
||||
FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
||||
UNUSED(frequency);
|
||||
FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
|
||||
switch (timer_num) {
|
||||
case STEP_TIMER_NUM:
|
||||
// waveform generation = 0100 = CTC
|
||||
@@ -196,9 +198,9 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t freque
|
||||
|
||||
/* 18 cycles maximum latency */
|
||||
#define HAL_STEP_TIMER_ISR() \
|
||||
extern "C" void TIMER1_COMPA_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \
|
||||
extern "C" void TIMER1_COMPA_vect_bottom (void) asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
|
||||
void TIMER1_COMPA_vect (void) { \
|
||||
extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \
|
||||
extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
|
||||
void TIMER1_COMPA_vect() { \
|
||||
__asm__ __volatile__ ( \
|
||||
A("push r16") /* 2 Save R16 */ \
|
||||
A("in r16, __SREG__") /* 1 Get SREG */ \
|
||||
@@ -265,13 +267,13 @@ void TIMER1_COMPA_vect (void) { \
|
||||
: \
|
||||
); \
|
||||
} \
|
||||
void TIMER1_COMPA_vect_bottom(void)
|
||||
void TIMER1_COMPA_vect_bottom()
|
||||
|
||||
/* 14 cycles maximum latency */
|
||||
#define HAL_TEMP_TIMER_ISR() \
|
||||
extern "C" void TIMER0_COMPB_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \
|
||||
extern "C" void TIMER0_COMPB_vect_bottom(void) asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
|
||||
void TIMER0_COMPB_vect (void) { \
|
||||
extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \
|
||||
extern "C" void TIMER0_COMPB_vect_bottom() asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
|
||||
void TIMER0_COMPB_vect() { \
|
||||
__asm__ __volatile__ ( \
|
||||
A("push r16") /* 2 Save R16 */ \
|
||||
A("in r16, __SREG__") /* 1 Get SREG */ \
|
||||
@@ -331,7 +333,7 @@ void TIMER0_COMPB_vect (void) { \
|
||||
: \
|
||||
); \
|
||||
} \
|
||||
void TIMER0_COMPB_vect_bottom(void)
|
||||
void TIMER0_COMPB_vect_bottom()
|
||||
|
||||
// ADC
|
||||
#ifdef DIDR2
|
||||
@@ -340,7 +342,7 @@ void TIMER0_COMPB_vect_bottom(void)
|
||||
#define HAL_ANALOG_SELECT(pin) do{ SBI(DIDR0, pin); }while(0)
|
||||
#endif
|
||||
|
||||
inline void HAL_adc_init(void) {
|
||||
inline void HAL_adc_init() {
|
||||
ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07;
|
||||
DIDR0 = 0;
|
||||
#ifdef DIDR2
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
void spiBegin(void) {
|
||||
void spiBegin() {
|
||||
OUT_WRITE(SS_PIN, HIGH);
|
||||
SET_OUTPUT(SCK_PIN);
|
||||
SET_INPUT(MISO_PIN);
|
||||
@@ -81,7 +81,7 @@ void spiBegin(void) {
|
||||
}
|
||||
|
||||
/** SPI receive a byte */
|
||||
uint8_t spiRec(void) {
|
||||
uint8_t spiRec() {
|
||||
SPDR = 0xFF;
|
||||
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
|
||||
return SPDR;
|
||||
@@ -184,15 +184,10 @@ void spiBegin(void) {
|
||||
// nop to tune soft SPI timing
|
||||
#define nop asm volatile ("\tnop\n")
|
||||
|
||||
// Set SPI rate
|
||||
void spiInit(uint8_t spiRate) {
|
||||
UNUSED(spiRate); // nothing to do
|
||||
}
|
||||
void spiInit(uint8_t) { /* do nothing */ }
|
||||
|
||||
// Begin SPI transaction, set clock, bit order, data mode
|
||||
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) {
|
||||
UNUSED(spiBeginTransaction); // nothing to do
|
||||
}
|
||||
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { /* do nothing */ }
|
||||
|
||||
// Soft SPI receive byte
|
||||
uint8_t spiRec() {
|
||||
@@ -271,7 +271,7 @@
|
||||
|
||||
// (called with TX irqs disabled)
|
||||
template<typename Cfg>
|
||||
FORCE_INLINE void MarlinSerial<Cfg>::_tx_udr_empty_irq(void) {
|
||||
FORCE_INLINE void MarlinSerial<Cfg>::_tx_udr_empty_irq() {
|
||||
if (Cfg::TX_SIZE > 0) {
|
||||
// Read positions
|
||||
uint8_t t = tx_buffer.tail;
|
||||
@@ -363,13 +363,13 @@
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
int MarlinSerial<Cfg>::peek(void) {
|
||||
int MarlinSerial<Cfg>::peek() {
|
||||
const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail;
|
||||
return h == t ? -1 : rx_buffer.buffer[t];
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
int MarlinSerial<Cfg>::read(void) {
|
||||
int MarlinSerial<Cfg>::read() {
|
||||
const ring_buffer_pos_t h = atomic_read_rx_head();
|
||||
|
||||
// Read the tail. Main thread owns it, so it is safe to directly read it
|
||||
@@ -412,13 +412,13 @@
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available(void) {
|
||||
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available() {
|
||||
const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail;
|
||||
return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1);
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
void MarlinSerial<Cfg>::flush(void) {
|
||||
void MarlinSerial<Cfg>::flush() {
|
||||
|
||||
// Set the tail to the head:
|
||||
// - Read the RX head index in a safe way. (See atomic_read_rx_head.)
|
||||
@@ -505,7 +505,7 @@
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
void MarlinSerial<Cfg>::flushTX(void) {
|
||||
void MarlinSerial<Cfg>::flushTX() {
|
||||
|
||||
if (Cfg::TX_SIZE == 0) {
|
||||
// No bytes written, no need to flush. This special case is needed since there's
|
||||
@@ -595,7 +595,7 @@
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
void MarlinSerial<Cfg>::println(void) {
|
||||
void MarlinSerial<Cfg>::println() {
|
||||
print('\r');
|
||||
print('\n');
|
||||
}
|
||||
|
||||
@@ -205,18 +205,18 @@
|
||||
public:
|
||||
|
||||
FORCE_INLINE static void store_rxd_char();
|
||||
FORCE_INLINE static void _tx_udr_empty_irq(void);
|
||||
FORCE_INLINE static void _tx_udr_empty_irq();
|
||||
|
||||
public:
|
||||
MarlinSerial() {};
|
||||
static void begin(const long);
|
||||
static void end();
|
||||
static int peek(void);
|
||||
static int read(void);
|
||||
static void flush(void);
|
||||
static ring_buffer_pos_t available(void);
|
||||
static int peek();
|
||||
static int read();
|
||||
static void flush();
|
||||
static ring_buffer_pos_t available();
|
||||
static void write(const uint8_t c);
|
||||
static void flushTX(void);
|
||||
static void flushTX();
|
||||
|
||||
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; }
|
||||
@@ -245,7 +245,7 @@
|
||||
static void println(long, int = DEC);
|
||||
static void println(unsigned long, int = DEC);
|
||||
static void println(double, int = 2);
|
||||
static void println(void);
|
||||
static void println();
|
||||
operator bool() { return true; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -131,7 +131,7 @@ void initISR(timer16_Sequence_t timer) {
|
||||
TCCR1A = 0; // normal counting mode
|
||||
TCCR1B = _BV(CS11); // set prescaler of 8
|
||||
TCNT1 = 0; // clear the timer count
|
||||
#if defined(__AVR_ATmega8__)|| defined(__AVR_ATmega128__)
|
||||
#if defined(__AVR_ATmega8__) || defined(__AVR_ATmega128__)
|
||||
SBI(TIFR, OCF1A); // clear any pending interrupts;
|
||||
SBI(TIMSK, OCIE1A); // enable the output compare interrupt
|
||||
#else
|
||||
@@ -53,8 +53,8 @@
|
||||
* --------------------
|
||||
*/
|
||||
|
||||
#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays
|
||||
#define PRESCALER 8 // timer prescaler
|
||||
#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays
|
||||
#define SERVO_TIMER_PRESCALER 8 // timer prescaler
|
||||
|
||||
// Say which 16 bit timers can be used and in what order
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
// One ISR for all EXT-Interrupts
|
||||
void endstop_ISR(void) { endstops.update(); }
|
||||
void endstop_ISR() { endstops.update(); }
|
||||
|
||||
/**
|
||||
* Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h)
|
||||
@@ -102,153 +102,124 @@ void pciSetup(const int8_t pin) {
|
||||
ISR(PCINT3_vect, ISR_ALIASOF(PCINT0_vect));
|
||||
#endif
|
||||
|
||||
void setup_endstop_interrupts( void ) {
|
||||
|
||||
void setup_endstop_interrupts() {
|
||||
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
|
||||
#if HAS_X_MAX
|
||||
#if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT) // if pin has an external interrupt
|
||||
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it
|
||||
#if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(X_MAX_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable"); // if pin has no pin change interrupt - error
|
||||
pciSetup(X_MAX_PIN); // assign it
|
||||
static_assert(digitalPinToPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(X_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_X_MIN
|
||||
#if (digitalPinToInterrupt(X_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(X_MIN_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(X_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y_MAX
|
||||
#if (digitalPinToInterrupt(Y_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y_MAX_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Y_MAX_PIN), "Y_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(Y_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y_MIN
|
||||
#if (digitalPinToInterrupt(Y_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y_MIN_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Y_MIN_PIN), "Y_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(Y_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z_MAX
|
||||
#if (digitalPinToInterrupt(Z_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MAX_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Z_MAX_PIN), "Z_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(Z_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z_MIN
|
||||
#if (digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MIN_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Z_MIN_PIN), "Z_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(Z_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_X2_MAX
|
||||
#if (digitalPinToInterrupt(X2_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(X2_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(X2_MAX_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(X2_MAX_PIN), "X2_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(X2_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_X2_MIN
|
||||
#if (digitalPinToInterrupt(X2_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(X2_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(X2_MIN_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(X2_MIN_PIN), "X2_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(X2_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y2_MAX
|
||||
#if (digitalPinToInterrupt(Y2_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Y2_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y2_MAX_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Y2_MAX_PIN), "Y2_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(Y2_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y2_MIN
|
||||
#if (digitalPinToInterrupt(Y2_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Y2_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y2_MIN_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Y2_MIN_PIN), "Y2_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(Y2_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z2_MAX
|
||||
#if (digitalPinToInterrupt(Z2_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z2_MAX_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Z2_MAX_PIN), "Z2_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(Z2_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z2_MIN
|
||||
#if (digitalPinToInterrupt(Z2_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z2_MIN_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Z2_MIN_PIN), "Z2_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(Z2_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z3_MAX
|
||||
#if (digitalPinToInterrupt(Z3_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z3_MAX_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Z3_MAX_PIN), "Z3_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(Z3_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z3_MIN
|
||||
#if (digitalPinToInterrupt(Z3_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z3_MIN_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Z3_MIN_PIN), "Z3_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(Z3_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z_MIN_PROBE_PIN
|
||||
#if (digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MIN_PROBE_PIN);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Z_MIN_PROBE_PIN), "Z_MIN_PROBE_PIN is not interrupt-capable");
|
||||
pciSetup(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM
|
||||
|
||||
#include "HAL.h"
|
||||
|
||||
@@ -59,19 +59,19 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
#ifdef TCCR2
|
||||
case TIMER2: {
|
||||
Timer timer = {
|
||||
/*TCCRnQ*/ { &TCCR2, nullptr, nullptr},
|
||||
/*OCRnQ*/ { (uint16_t*)&OCR2, nullptr, nullptr},
|
||||
/*TCCRnQ*/ { &TCCR2, nullptr, nullptr },
|
||||
/*OCRnQ*/ { (uint16_t*)&OCR2, nullptr, nullptr },
|
||||
/*ICRn*/ nullptr,
|
||||
/*n, q*/ 2, 0
|
||||
};
|
||||
}
|
||||
#elif defined TCCR2A
|
||||
#elif defined(TCCR2A)
|
||||
#if ENABLED(USE_OCR2A_AS_TOP)
|
||||
case TIMER2A: break; // protect TIMER2A
|
||||
case TIMER2B: {
|
||||
Timer timer = {
|
||||
/*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr},
|
||||
/*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr},
|
||||
/*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr },
|
||||
/*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr },
|
||||
/*ICRn*/ nullptr,
|
||||
/*n, q*/ 2, 1
|
||||
};
|
||||
@@ -81,8 +81,8 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
case TIMER2B: ++q;
|
||||
case TIMER2A: {
|
||||
Timer timer = {
|
||||
/*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr},
|
||||
/*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr},
|
||||
/*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr },
|
||||
/*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr },
|
||||
/*ICRn*/ nullptr,
|
||||
2, q
|
||||
};
|
||||
@@ -91,13 +91,24 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifdef TCCR3A
|
||||
#ifdef OCR3C
|
||||
case TIMER3C: ++q;
|
||||
case TIMER3B: ++q;
|
||||
case TIMER3A: {
|
||||
Timer timer = {
|
||||
/*TCCRnQ*/ { &TCCR3A, &TCCR3B, &TCCR3C},
|
||||
/*OCRnQ*/ { &OCR3A, &OCR3B, &OCR3C},
|
||||
/*TCCRnQ*/ { &TCCR3A, &TCCR3B, &TCCR3C },
|
||||
/*OCRnQ*/ { &OCR3A, &OCR3B, &OCR3C },
|
||||
/*ICRn*/ &ICR3,
|
||||
/*n, q*/ 3, q
|
||||
};
|
||||
return timer;
|
||||
}
|
||||
#elif defined(OCR3B)
|
||||
case TIMER3B: ++q;
|
||||
case TIMER3A: {
|
||||
Timer timer = {
|
||||
/*TCCRnQ*/ { &TCCR3A, &TCCR3B, nullptr },
|
||||
/*OCRnQ*/ { &OCR3A, &OCR3B, nullptr },
|
||||
/*ICRn*/ &ICR3,
|
||||
/*n, q*/ 3, q
|
||||
};
|
||||
@@ -109,8 +120,8 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
case TIMER4B: ++q;
|
||||
case TIMER4A: {
|
||||
Timer timer = {
|
||||
/*TCCRnQ*/ { &TCCR4A, &TCCR4B, &TCCR4C},
|
||||
/*OCRnQ*/ { &OCR4A, &OCR4B, &OCR4C},
|
||||
/*TCCRnQ*/ { &TCCR4A, &TCCR4B, &TCCR4C },
|
||||
/*OCRnQ*/ { &OCR4A, &OCR4B, &OCR4C },
|
||||
/*ICRn*/ &ICR4,
|
||||
/*n, q*/ 4, q
|
||||
};
|
||||
@@ -122,7 +133,7 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
case TIMER5B: ++q;
|
||||
case TIMER5A: {
|
||||
Timer timer = {
|
||||
/*TCCRnQ*/ { &TCCR5A, &TCCR5B, &TCCR5C},
|
||||
/*TCCRnQ*/ { &TCCR5A, &TCCR5B, &TCCR5C },
|
||||
/*OCRnQ*/ { &OCR5A, &OCR5B, &OCR5C },
|
||||
/*ICRn*/ &ICR5,
|
||||
/*n, q*/ 5, q
|
||||
@@ -132,8 +143,8 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
#endif
|
||||
}
|
||||
Timer timer = {
|
||||
/*TCCRnQ*/ { nullptr, nullptr, nullptr},
|
||||
/*OCRnQ*/ { nullptr, nullptr, nullptr},
|
||||
/*TCCRnQ*/ { nullptr, nullptr, nullptr },
|
||||
/*OCRnQ*/ { nullptr, nullptr, nullptr },
|
||||
/*ICRn*/ nullptr,
|
||||
0, 0
|
||||
};
|
||||
@@ -267,5 +278,5 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255
|
||||
}
|
||||
}
|
||||
|
||||
#endif // FAST_PWM_FAN
|
||||
#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM
|
||||
#endif // __AVR__
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#ifdef __AVR__
|
||||
|
||||
#include "fastio_AVR.h"
|
||||
#include "fastio.h"
|
||||
|
||||
#ifdef FASTIO_EXT_START
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
* Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 72 75 76 77 74 xx xx xx xx xx
|
||||
*/
|
||||
|
||||
#include "../fastio_AVR.h"
|
||||
#include "../fastio.h"
|
||||
|
||||
// change for your board
|
||||
#define DEBUG_LED DIO21
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5
|
||||
*/
|
||||
|
||||
#include "../fastio_AVR.h"
|
||||
#include "../fastio.h"
|
||||
|
||||
// change for your board
|
||||
#define DEBUG_LED DIO46
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
|
||||
*/
|
||||
|
||||
#include "../fastio_AVR.h"
|
||||
#include "../fastio.h"
|
||||
|
||||
#define DEBUG_LED AIO5
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
* +--------+
|
||||
*/
|
||||
|
||||
#include "../fastio_AVR.h"
|
||||
#include "../fastio.h"
|
||||
|
||||
#define DEBUG_LED DIO0
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
* The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
|
||||
*/
|
||||
|
||||
#include "../fastio_AVR.h"
|
||||
#include "../fastio.h"
|
||||
|
||||
// change for your board
|
||||
#define DEBUG_LED DIO31 /* led D5 red */
|
||||
|
||||
@@ -227,18 +227,9 @@ static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin");
|
||||
void com_print(uint8_t N, uint8_t Z) {
|
||||
const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
|
||||
SERIAL_ECHOPGM(" COM");
|
||||
SERIAL_CHAR(N + '0');
|
||||
switch (Z) {
|
||||
case 'A':
|
||||
SERIAL_ECHOPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6));
|
||||
break;
|
||||
case 'B':
|
||||
SERIAL_ECHOPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4));
|
||||
break;
|
||||
case 'C':
|
||||
SERIAL_ECHOPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2));
|
||||
break;
|
||||
}
|
||||
SERIAL_CHAR('0' + N);
|
||||
SERIAL_CHAR('A' + Z);
|
||||
SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03));
|
||||
}
|
||||
|
||||
void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include "watchdog_AVR.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#include "../../Marlin.h"
|
||||
|
||||
@@ -28,4 +28,4 @@ void watchdog_init();
|
||||
|
||||
// Reset watchdog. MUST be called at least every 4 seconds after the
|
||||
// first watchdog_init or AVR will go into emergency procedures.
|
||||
inline void watchdog_reset() { wdt_reset(); }
|
||||
inline void HAL_watchdog_refresh() { wdt_reset(); }
|
||||
+9
-9
@@ -42,7 +42,7 @@
|
||||
#define sw_barrier() __asm__ volatile("": : :"memory");
|
||||
|
||||
// (re)initialize UART0 as a monitor output to 250000,n,8,1
|
||||
static void TXBegin(void) {
|
||||
static void TXBegin() {
|
||||
|
||||
// Disable UART interrupt in NVIC
|
||||
NVIC_DisableIRQ( UART_IRQn );
|
||||
@@ -235,7 +235,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause
|
||||
for (;;) WDT_Restart(WDT);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void NMI_Handler(void) {
|
||||
__attribute__((naked)) void NMI_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -248,7 +248,7 @@ __attribute__((naked)) void NMI_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void HardFault_Handler(void) {
|
||||
__attribute__((naked)) void HardFault_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -261,7 +261,7 @@ __attribute__((naked)) void HardFault_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void MemManage_Handler(void) {
|
||||
__attribute__((naked)) void MemManage_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -274,7 +274,7 @@ __attribute__((naked)) void MemManage_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void BusFault_Handler(void) {
|
||||
__attribute__((naked)) void BusFault_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -287,7 +287,7 @@ __attribute__((naked)) void BusFault_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void UsageFault_Handler(void) {
|
||||
__attribute__((naked)) void UsageFault_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -300,7 +300,7 @@ __attribute__((naked)) void UsageFault_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void DebugMon_Handler(void) {
|
||||
__attribute__((naked)) void DebugMon_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -314,7 +314,7 @@ __attribute__((naked)) void DebugMon_Handler(void) {
|
||||
}
|
||||
|
||||
/* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */
|
||||
__attribute__((naked)) void WDT_Handler(void) {
|
||||
__attribute__((naked)) void WDT_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -327,7 +327,7 @@ __attribute__((naked)) void WDT_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void RSTC_Handler(void) {
|
||||
__attribute__((naked)) void RSTC_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
+5
-7
@@ -31,12 +31,12 @@
|
||||
|
||||
#ifdef ARDUINO_ARCH_SAM
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM)
|
||||
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/persistent_store_api.h"
|
||||
|
||||
#define EEPROMSize 4096
|
||||
#define PagesPerGroup 128
|
||||
@@ -922,8 +922,7 @@ static void ee_Init() {
|
||||
if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
|
||||
#ifdef EE_EMU_DEBUG
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR("EEPROM Page ",page);
|
||||
SERIAL_ECHOLNPAIR(" not clean on group ",grp);
|
||||
SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
|
||||
SERIAL_FLUSH();
|
||||
#endif
|
||||
ee_PageErase(grp * PagesPerGroup + page);
|
||||
@@ -944,7 +943,7 @@ static void ee_Init() {
|
||||
|
||||
#ifdef EE_EMU_DEBUG
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR("EEPROM Active page: ",curPage);
|
||||
SERIAL_ECHOLNPAIR("EEPROM Active page: ", curPage);
|
||||
SERIAL_FLUSH();
|
||||
#endif
|
||||
|
||||
@@ -953,8 +952,7 @@ static void ee_Init() {
|
||||
if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
|
||||
#ifdef EE_EMU_DEBUG
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR("EEPROM Page ",page);
|
||||
SERIAL_ECHOLNPAIR(" not clean on active group ",curGroup);
|
||||
SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
|
||||
SERIAL_FLUSH();
|
||||
ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
|
||||
#endif
|
||||
@@ -993,7 +991,7 @@ void eeprom_read_block(void* __dst, const void* __src, size_t __n) {
|
||||
}
|
||||
}
|
||||
|
||||
void eeprom_flush(void) {
|
||||
void eeprom_flush() {
|
||||
ee_Flush();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ uint16_t HAL_adc_result;
|
||||
// ------------------------
|
||||
|
||||
// HAL initialization task
|
||||
void HAL_init(void) {
|
||||
void HAL_init() {
|
||||
// Initialize the USB stack
|
||||
#if ENABLED(SDSUPPORT)
|
||||
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
|
||||
@@ -51,20 +51,20 @@ void HAL_init(void) {
|
||||
}
|
||||
|
||||
// HAL idle task
|
||||
void HAL_idletask(void) {
|
||||
void HAL_idletask() {
|
||||
// Perform USB stack housekeeping
|
||||
usb_task_idle();
|
||||
}
|
||||
|
||||
// Disable interrupts
|
||||
void cli(void) { noInterrupts(); }
|
||||
void cli() { noInterrupts(); }
|
||||
|
||||
// Enable interrupts
|
||||
void sei(void) { interrupts(); }
|
||||
void sei() { interrupts(); }
|
||||
|
||||
void HAL_clear_reset_source(void) { }
|
||||
void HAL_clear_reset_source() { }
|
||||
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
uint8_t HAL_get_reset_source() {
|
||||
switch ((RSTC->RSTC_SR >> 8) & 0x07) {
|
||||
case 0: return RST_POWER_ON;
|
||||
case 1: return RST_BACKUP;
|
||||
@@ -87,7 +87,7 @@ extern "C" {
|
||||
// Return free memory between end of heap (or end bss) and whatever is current
|
||||
int freeMemory() {
|
||||
int free_memory, heap_end = (int)_sbrk(0);
|
||||
return (int)&free_memory - (heap_end ? heap_end : (int)&_ebss);
|
||||
return (int)&free_memory - (heap_end ?: (int)&_ebss);
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
@@ -98,7 +98,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
|
||||
HAL_adc_result = analogRead(adc_pin);
|
||||
}
|
||||
|
||||
uint16_t HAL_adc_get_result(void) {
|
||||
uint16_t HAL_adc_get_result() {
|
||||
// nop
|
||||
return HAL_adc_result;
|
||||
}
|
||||
|
||||
@@ -32,34 +32,51 @@
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio_Due.h"
|
||||
#include "watchdog_Due.h"
|
||||
#include "HAL_timers_Due.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "timers.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// Serial ports
|
||||
#if !WITHIN(SERIAL_PORT, -1, 3)
|
||||
#error "SERIAL_PORT must be from -1 to 3"
|
||||
// Define MYSERIAL0/1 before MarlinSerial includes!
|
||||
#if SERIAL_PORT == -1
|
||||
#define MYSERIAL0 Serial1
|
||||
#elif SERIAL_PORT == 0
|
||||
#define MYSERIAL0 Serial
|
||||
#elif SERIAL_PORT == 1
|
||||
#define MYSERIAL0 Serial1
|
||||
#elif SERIAL_PORT == 2
|
||||
#define MYSERIAL0 Serial2
|
||||
#elif SERIAL_PORT == 3
|
||||
#define MYSERIAL0 Serial3
|
||||
#else
|
||||
#error "The required SERIAL_PORT must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
|
||||
// MYSERIAL0 required before MarlinSerial includes!
|
||||
#define MYSERIAL0 customizedSerial1
|
||||
|
||||
#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"
|
||||
#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
|
||||
#define MYSERIAL1 Serial1
|
||||
#elif SERIAL_PORT_2 == 0
|
||||
#define MYSERIAL1 Serial
|
||||
#elif SERIAL_PORT_2 == 1
|
||||
#define MYSERIAL1 Serial1
|
||||
#elif SERIAL_PORT_2 == 2
|
||||
#define MYSERIAL1 Serial2
|
||||
#elif SERIAL_PORT_2 == 3
|
||||
#define MYSERIAL1 Serial3
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
#define NUM_SERIAL 2
|
||||
#define MYSERIAL1 customizedSerial2
|
||||
#else
|
||||
#define NUM_SERIAL 1
|
||||
#endif
|
||||
|
||||
#include "MarlinSerial_Due.h"
|
||||
#include "MarlinSerialUSB_Due.h"
|
||||
#include "MarlinSerial.h"
|
||||
#include "MarlinSerialUSB.h"
|
||||
|
||||
// On AVR this is in math.h?
|
||||
#define square(x) ((x)*(x))
|
||||
@@ -88,22 +105,11 @@ typedef int8_t pin_t;
|
||||
#define ENABLE_ISRS() __enable_irq()
|
||||
#define DISABLE_ISRS() __disable_irq()
|
||||
|
||||
void cli(void); // Disable interrupts
|
||||
void sei(void); // Enable interrupts
|
||||
void cli(); // Disable interrupts
|
||||
void sei(); // Enable interrupts
|
||||
|
||||
void HAL_clear_reset_source(void); // clear reset reason
|
||||
uint8_t HAL_get_reset_source(void); // get reset reason
|
||||
|
||||
//
|
||||
// SPI: Extended functions taking a channel number (Hardware SPI only)
|
||||
//
|
||||
|
||||
// Write single byte to specified SPI channel
|
||||
void spiSend(uint32_t chan, byte b);
|
||||
// Write buffer to specified SPI channel
|
||||
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
|
||||
// Read single byte from specified SPI channel
|
||||
uint8_t spiRec(uint32_t chan);
|
||||
void HAL_clear_reset_source(); // clear reset reason
|
||||
uint8_t HAL_get_reset_source(); // get reset reason
|
||||
|
||||
//
|
||||
// EEPROM
|
||||
@@ -124,14 +130,14 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion
|
||||
|
||||
#define HAL_ANALOG_SELECT(pin)
|
||||
|
||||
inline void HAL_adc_init(void) {}//todo
|
||||
inline void HAL_adc_init() {}//todo
|
||||
|
||||
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
||||
#define HAL_READ_ADC() HAL_adc_result
|
||||
#define HAL_ADC_READY() true
|
||||
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
||||
uint16_t HAL_adc_get_result(void);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
//
|
||||
// Pin Map
|
||||
@@ -149,19 +155,23 @@ void noTone(const pin_t _pin);
|
||||
|
||||
// Enable hooks into idle and setup for HAL
|
||||
#define HAL_IDLETASK 1
|
||||
void HAL_idletask(void);
|
||||
void HAL_init(void);
|
||||
void HAL_idletask();
|
||||
void HAL_init();
|
||||
|
||||
//
|
||||
// Utility functions
|
||||
//
|
||||
void _delay_ms(const int delay);
|
||||
int freeMemory(void);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
int freeMemory();
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s);
|
||||
char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -151,13 +151,12 @@
|
||||
(((uint32_t)(addr) & 0xF0000000) + 0x02000000 + ((uint32_t)(addr)&0xFFFFF)*32 + (bit)*4)
|
||||
|
||||
// run at ~8 .. ~10Mhz - Rx version (Tx line not altered)
|
||||
static uint8_t spiTransferRx0(uint8_t bout) { // using Mode 0
|
||||
static uint8_t spiTransferRx0(uint8_t) { // using Mode 0
|
||||
uint32_t bin = 0;
|
||||
uint32_t work = 0;
|
||||
uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN)); /* PDSR of port in bitband area */
|
||||
uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */
|
||||
uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
|
||||
UNUSED(bout);
|
||||
|
||||
/* The software SPI routine */
|
||||
__asm__ __volatile__(
|
||||
@@ -428,7 +427,7 @@
|
||||
|
||||
static void spiTxBlockX(const uint8_t* buf, uint32_t todo) {
|
||||
do {
|
||||
(void) spiTransferTx(*buf++);
|
||||
(void)spiTransferTx(*buf++);
|
||||
} while (--todo);
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "HAL.h"
|
||||
#include "InterruptVectors_Due.h"
|
||||
#include "InterruptVectors.h"
|
||||
|
||||
/* The relocated Exception/Interrupt Table - According to the ARM
|
||||
reference manual, alignment to 128 bytes should suffice, but in
|
||||
@@ -48,7 +48,7 @@ static DeviceVectors ram_tab = { nullptr };
|
||||
* If it is not, then it copies the ROM table to the SRAM and relocates the table
|
||||
* by reprogramming the NVIC registers
|
||||
*/
|
||||
static pfnISR_Handler* get_relocated_table_addr(void) {
|
||||
static pfnISR_Handler* get_relocated_table_addr() {
|
||||
// Get the address of the interrupt/exception table
|
||||
uint32_t isrtab = SCB->VTOR;
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@
|
||||
#ifdef ARDUINO_ARCH_SAM
|
||||
|
||||
// ISR handler type
|
||||
typedef void (*pfnISR_Handler)(void);
|
||||
typedef void (*pfnISR_Handler)();
|
||||
|
||||
// Install a new interrupt vector handler for the given irq, returning the old one
|
||||
pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler);
|
||||
+10
-10
@@ -29,8 +29,8 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include "MarlinSerial_Due.h"
|
||||
#include "InterruptVectors_Due.h"
|
||||
#include "MarlinSerial.h"
|
||||
#include "InterruptVectors.h"
|
||||
#include "../../Marlin.h"
|
||||
|
||||
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } };
|
||||
@@ -178,7 +178,7 @@ FORCE_INLINE void MarlinSerial<Cfg>::store_rxd_char() {
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
FORCE_INLINE void MarlinSerial<Cfg>::_tx_thr_empty_irq(void) {
|
||||
FORCE_INLINE void MarlinSerial<Cfg>::_tx_thr_empty_irq() {
|
||||
if (Cfg::TX_SIZE > 0) {
|
||||
// Read positions
|
||||
uint8_t t = tx_buffer.tail;
|
||||
@@ -221,7 +221,7 @@ FORCE_INLINE void MarlinSerial<Cfg>::_tx_thr_empty_irq(void) {
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
void MarlinSerial<Cfg>::UART_ISR(void) {
|
||||
void MarlinSerial<Cfg>::UART_ISR() {
|
||||
const uint32_t status = HWUART->UART_SR;
|
||||
|
||||
// Data received?
|
||||
@@ -308,13 +308,13 @@ void MarlinSerial<Cfg>::end() {
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
int MarlinSerial<Cfg>::peek(void) {
|
||||
int MarlinSerial<Cfg>::peek() {
|
||||
const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail];
|
||||
return v;
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
int MarlinSerial<Cfg>::read(void) {
|
||||
int MarlinSerial<Cfg>::read() {
|
||||
|
||||
const ring_buffer_pos_t h = rx_buffer.head;
|
||||
ring_buffer_pos_t t = rx_buffer.tail;
|
||||
@@ -354,13 +354,13 @@ int MarlinSerial<Cfg>::read(void) {
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available(void) {
|
||||
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available() {
|
||||
const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail;
|
||||
return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1);
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
void MarlinSerial<Cfg>::flush(void) {
|
||||
void MarlinSerial<Cfg>::flush() {
|
||||
rx_buffer.tail = rx_buffer.head;
|
||||
|
||||
if (Cfg::XONOFF) {
|
||||
@@ -431,7 +431,7 @@ void MarlinSerial<Cfg>::write(const uint8_t c) {
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
void MarlinSerial<Cfg>::flushTX(void) {
|
||||
void MarlinSerial<Cfg>::flushTX() {
|
||||
// TX
|
||||
|
||||
if (Cfg::TX_SIZE == 0) {
|
||||
@@ -520,7 +520,7 @@ void MarlinSerial<Cfg>::print(double n, int digits) {
|
||||
}
|
||||
|
||||
template<typename Cfg>
|
||||
void MarlinSerial<Cfg>::println(void) {
|
||||
void MarlinSerial<Cfg>::println() {
|
||||
print('\r');
|
||||
print('\n');
|
||||
}
|
||||
@@ -108,19 +108,19 @@ protected:
|
||||
static ring_buffer_pos_t rx_max_enqueued;
|
||||
|
||||
FORCE_INLINE static void store_rxd_char();
|
||||
FORCE_INLINE static void _tx_thr_empty_irq(void);
|
||||
static void UART_ISR(void);
|
||||
FORCE_INLINE static void _tx_thr_empty_irq();
|
||||
static void UART_ISR();
|
||||
|
||||
public:
|
||||
MarlinSerial() {};
|
||||
static void begin(const long);
|
||||
static void end();
|
||||
static int peek(void);
|
||||
static int read(void);
|
||||
static void flush(void);
|
||||
static ring_buffer_pos_t available(void);
|
||||
static int peek();
|
||||
static int read();
|
||||
static void flush();
|
||||
static ring_buffer_pos_t available();
|
||||
static void write(const uint8_t c);
|
||||
static void flushTX(void);
|
||||
static void flushTX();
|
||||
|
||||
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; }
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
static void println(long, int = DEC);
|
||||
static void println(unsigned long, int = DEC);
|
||||
static void println(double, int = 2);
|
||||
static void println(void);
|
||||
static void println();
|
||||
operator bool() { return true; }
|
||||
|
||||
private:
|
||||
+14
-17
@@ -31,7 +31,7 @@
|
||||
|
||||
#if SERIAL_PORT == -1
|
||||
|
||||
#include "MarlinSerialUSB_Due.h"
|
||||
#include "MarlinSerialUSB.h"
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
#include "../../feature/emergency_parser.h"
|
||||
@@ -39,11 +39,11 @@
|
||||
|
||||
// Imports from Atmel USB Stack/CDC implementation
|
||||
extern "C" {
|
||||
bool usb_task_cdc_isenabled(void);
|
||||
bool usb_task_cdc_dtr_active(void);
|
||||
bool udi_cdc_is_rx_ready(void);
|
||||
int udi_cdc_getc(void);
|
||||
bool udi_cdc_is_tx_ready(void);
|
||||
bool usb_task_cdc_isenabled();
|
||||
bool usb_task_cdc_dtr_active();
|
||||
bool udi_cdc_is_rx_ready();
|
||||
int udi_cdc_getc();
|
||||
bool udi_cdc_is_tx_ready();
|
||||
int udi_cdc_putc(int value);
|
||||
};
|
||||
|
||||
@@ -55,14 +55,11 @@ static int pending_char = -1;
|
||||
#endif
|
||||
|
||||
// Public Methods
|
||||
void MarlinSerialUSB::begin(const long baud_setting) {
|
||||
UNUSED(baud_setting);
|
||||
}
|
||||
void MarlinSerialUSB::begin(const long) {}
|
||||
|
||||
void MarlinSerialUSB::end() {
|
||||
}
|
||||
void MarlinSerialUSB::end() {}
|
||||
|
||||
int MarlinSerialUSB::peek(void) {
|
||||
int MarlinSerialUSB::peek() {
|
||||
if (pending_char >= 0)
|
||||
return pending_char;
|
||||
|
||||
@@ -83,7 +80,7 @@ int MarlinSerialUSB::peek(void) {
|
||||
return pending_char;
|
||||
}
|
||||
|
||||
int MarlinSerialUSB::read(void) {
|
||||
int MarlinSerialUSB::read() {
|
||||
if (pending_char >= 0) {
|
||||
int ret = pending_char;
|
||||
pending_char = -1;
|
||||
@@ -107,7 +104,7 @@ int MarlinSerialUSB::read(void) {
|
||||
return c;
|
||||
}
|
||||
|
||||
bool MarlinSerialUSB::available(void) {
|
||||
bool MarlinSerialUSB::available() {
|
||||
/* If Pending chars */
|
||||
return pending_char >= 0 ||
|
||||
/* or USB CDC enumerated and configured on the PC side and some
|
||||
@@ -115,8 +112,8 @@ bool MarlinSerialUSB::available(void) {
|
||||
(usb_task_cdc_isenabled() && udi_cdc_is_rx_ready());
|
||||
}
|
||||
|
||||
void MarlinSerialUSB::flush(void) { }
|
||||
void MarlinSerialUSB::flushTX(void) { }
|
||||
void MarlinSerialUSB::flush() { }
|
||||
void MarlinSerialUSB::flushTX() { }
|
||||
|
||||
void MarlinSerialUSB::write(const uint8_t c) {
|
||||
|
||||
@@ -186,7 +183,7 @@ void MarlinSerialUSB::print(double n, int digits) {
|
||||
printFloat(n, digits);
|
||||
}
|
||||
|
||||
void MarlinSerialUSB::println(void) {
|
||||
void MarlinSerialUSB::println() {
|
||||
print('\r');
|
||||
print('\n');
|
||||
}
|
||||
+6
-6
@@ -43,11 +43,11 @@ public:
|
||||
MarlinSerialUSB() {};
|
||||
static void begin(const long);
|
||||
static void end();
|
||||
static int peek(void);
|
||||
static int read(void);
|
||||
static void flush(void);
|
||||
static void flushTX(void);
|
||||
static bool available(void);
|
||||
static int peek();
|
||||
static int read();
|
||||
static void flush();
|
||||
static void flushTX();
|
||||
static bool available();
|
||||
static void write(const uint8_t c);
|
||||
|
||||
#if ENABLED(SERIAL_STATS_DROPPED_RX)
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
static void println(long, int = DEC);
|
||||
static void println(unsigned long, int = DEC);
|
||||
static void println(double, int = 2);
|
||||
static void println(void);
|
||||
static void println();
|
||||
operator bool() { return true; }
|
||||
|
||||
private:
|
||||
@@ -56,19 +56,19 @@ static volatile int8_t Channel[_Nbr_16timers]; // counter for the s
|
||||
void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel);
|
||||
|
||||
#ifdef _useTimer1
|
||||
void HANDLER_FOR_TIMER1(void) { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); }
|
||||
void HANDLER_FOR_TIMER1() { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); }
|
||||
#endif
|
||||
#ifdef _useTimer2
|
||||
void HANDLER_FOR_TIMER2(void) { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); }
|
||||
void HANDLER_FOR_TIMER2() { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); }
|
||||
#endif
|
||||
#ifdef _useTimer3
|
||||
void HANDLER_FOR_TIMER3(void) { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); }
|
||||
void HANDLER_FOR_TIMER3() { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); }
|
||||
#endif
|
||||
#ifdef _useTimer4
|
||||
void HANDLER_FOR_TIMER4(void) { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); }
|
||||
void HANDLER_FOR_TIMER4() { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); }
|
||||
#endif
|
||||
#ifdef _useTimer5
|
||||
void HANDLER_FOR_TIMER5(void) { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); }
|
||||
void HANDLER_FOR_TIMER5() { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); }
|
||||
#endif
|
||||
|
||||
void Servo_Handler(timer16_Sequence_t timer, Tc *tc, uint8_t channel) {
|
||||
@@ -36,8 +36,8 @@
|
||||
//!#define _useTimer4
|
||||
#define _useTimer5
|
||||
|
||||
#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays
|
||||
#define PRESCALER 32 // timer prescaler
|
||||
#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays
|
||||
#define SERVO_TIMER_PRESCALER 32 // timer prescaler
|
||||
|
||||
/*
|
||||
TC0, chan 0 => TC0_Handler
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
|
||||
*
|
||||
* 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
|
||||
@@ -29,7 +31,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "HAL.h"
|
||||
#include "HAL_timers_Due.h"
|
||||
#include "timers.h"
|
||||
|
||||
static pin_t tone_pin;
|
||||
volatile static int32_t toggles;
|
||||
|
||||
@@ -71,7 +71,7 @@ void spiSend(uint8_t b);
|
||||
void spiSend(const uint8_t* buf, size_t n);
|
||||
|
||||
#include "../../shared/Marduino.h"
|
||||
#include "../fastio_Due.h"
|
||||
#include "../fastio.h"
|
||||
|
||||
void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) {
|
||||
PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1,
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
#include "../../shared/Marduino.h"
|
||||
#include <U8glib.h>
|
||||
|
||||
void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index);
|
||||
void u8g_SetPILevel_DUE(u8g_t *u8g, uint8_t pin_index, uint8_t level);
|
||||
|
||||
@@ -38,45 +38,46 @@
|
||||
#include "../../module/endstops.h"
|
||||
|
||||
// One ISR for all EXT-Interrupts
|
||||
void endstop_ISR(void) { endstops.update(); }
|
||||
void endstop_ISR() { endstops.update(); }
|
||||
|
||||
/**
|
||||
* Endstop interrupts for Due based targets.
|
||||
* On Due, all pins support external interrupt capability.
|
||||
*/
|
||||
|
||||
void setup_endstop_interrupts(void) {
|
||||
void setup_endstop_interrupts() {
|
||||
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
|
||||
#if HAS_X_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it
|
||||
_ATTACH(X_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_X_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(X_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Y_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Y_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Z_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z2_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z2_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Z2_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z2_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z3_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z3_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Z3_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z3_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z_MIN_PROBE_PIN
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
const uint32_t mask = MASK(DIO ## IO ## _PIN); \
|
||||
if (V) port->PIO_SODR = mask; \
|
||||
else port->PIO_CODR = mask; \
|
||||
} while(0)
|
||||
}while(0)
|
||||
|
||||
// Toggle a pin
|
||||
#define _TOGGLE(IO) _WRITE(IO, !READ(IO))
|
||||
@@ -33,7 +33,7 @@
|
||||
#define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
|
||||
#endif
|
||||
|
||||
extern void eeprom_flush(void);
|
||||
extern void eeprom_flush();
|
||||
|
||||
bool PersistentStore::access_start() { return true; }
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "HAL.h"
|
||||
|
||||
#include "HAL_timers_Due.h"
|
||||
#include "timers.h"
|
||||
|
||||
// ------------------------
|
||||
// Local defines
|
||||
@@ -50,7 +50,7 @@ const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = {
|
||||
{ TC0, 0, TC0_IRQn, 3}, // 0 - [servo timer5]
|
||||
{ TC0, 1, TC1_IRQn, 0}, // 1
|
||||
{ TC0, 2, TC2_IRQn, 2}, // 2 - stepper
|
||||
{ TC1, 0, TC3_IRQn, 0}, // 3
|
||||
{ TC1, 0, TC3_IRQn, 0}, // 3 - stepper for BOARD_ARCHIM1
|
||||
{ TC1, 1, TC4_IRQn, 15}, // 4 - temperature
|
||||
{ TC1, 2, TC5_IRQn, 3}, // 5 - [servo timer3]
|
||||
{ TC2, 0, TC6_IRQn, 14}, // 6 - tone
|
||||
@@ -39,7 +39,9 @@ typedef uint32_t hal_timer_t;
|
||||
|
||||
#define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals
|
||||
|
||||
#ifndef STEP_TIMER_NUM
|
||||
#define STEP_TIMER_NUM 2 // index of timer to use for stepper
|
||||
#endif
|
||||
#define TEMP_TIMER_NUM 4 // index of timer to use for temperature
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#define TONE_TIMER_NUM 6 // index of timer to use for beeper tones
|
||||
@@ -61,7 +63,9 @@ typedef uint32_t hal_timer_t;
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||
|
||||
#define HAL_STEP_TIMER_ISR() void TC2_Handler()
|
||||
#ifndef HAL_STEP_TIMER_ISR
|
||||
#define HAL_STEP_TIMER_ISR() void TC2_Handler()
|
||||
#endif
|
||||
#define HAL_TEMP_TIMER_ISR() void TC4_Handler()
|
||||
#define HAL_TONE_TIMER_ISR() void TC6_Handler()
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
* \def unused
|
||||
* \brief Marking \a v as a unused parameter or value.
|
||||
*/
|
||||
#define unused(v) do { (void)(v); } while(0)
|
||||
#define unused(v) do { (void)(v); }while(0)
|
||||
|
||||
/**
|
||||
* \def barrier
|
||||
@@ -169,7 +169,7 @@
|
||||
* heuristics and inline the function no matter how big it thinks it
|
||||
* becomes.
|
||||
*/
|
||||
#if defined(__CC_ARM)
|
||||
#ifdef __CC_ARM
|
||||
# define __always_inline __forceinline
|
||||
#elif (defined __GNUC__)
|
||||
#ifdef __always_inline
|
||||
@@ -187,7 +187,7 @@
|
||||
* This annotation instructs the compiler to ignore its inlining
|
||||
* heuristics and not inline the function.
|
||||
*/
|
||||
#if defined(__CC_ARM)
|
||||
#ifdef __CC_ARM
|
||||
# define __no_inline __attribute__((noinline))
|
||||
#elif (defined __GNUC__)
|
||||
# define __no_inline __attribute__((__noinline__))
|
||||
@@ -204,7 +204,7 @@
|
||||
*
|
||||
* \param expr Expression to evaluate and supposed to be nonzero.
|
||||
*/
|
||||
#if defined(_ASSERT_ENABLE_)
|
||||
#ifdef _ASSERT_ENABLE_
|
||||
# if defined(TEST_SUITE_DEFINE_ASSERT_MACRO)
|
||||
// Assert() is defined in unit_test/suite.h
|
||||
# include "unit_test/suite.h"
|
||||
@@ -230,7 +230,7 @@
|
||||
|
||||
/* Define NO_INIT attribute */
|
||||
#if 0 //ndef NO_INIT
|
||||
#if defined ( __CC_ARM )
|
||||
#ifdef __CC_ARM
|
||||
# define NO_INIT __attribute__((zero_init))
|
||||
#elif defined ( __ICCARM__ )
|
||||
# define NO_INIT __no_init
|
||||
@@ -262,7 +262,7 @@
|
||||
//! @{
|
||||
typedef unsigned char Bool; //!< Boolean.
|
||||
#ifndef __cplusplus
|
||||
#if !defined(__bool_true_false_are_defined)
|
||||
#ifndef __bool_true_false_are_defined
|
||||
typedef unsigned char bool; //!< Boolean.
|
||||
#endif
|
||||
#endif
|
||||
@@ -443,7 +443,7 @@ typedef struct
|
||||
#define DISABLE 0
|
||||
#define ENABLE 1
|
||||
#ifndef __cplusplus
|
||||
#if !defined(__bool_true_false_are_defined)
|
||||
#ifndef __bool_true_false_are_defined
|
||||
#define false 0
|
||||
#define true 1
|
||||
#endif
|
||||
@@ -998,14 +998,14 @@ typedef U8 Byte; //!< 8-bit unsigned integer.
|
||||
#endif // #ifndef __ASSEMBLY__
|
||||
|
||||
|
||||
#if defined(__ICCARM__)
|
||||
#ifdef __ICCARM__
|
||||
#define SHORTENUM __packed
|
||||
#elif defined(__GNUC__)
|
||||
#define SHORTENUM __attribute__((packed))
|
||||
#endif
|
||||
|
||||
/* No operation */
|
||||
#if defined(__ICCARM__)
|
||||
#ifdef __ICCARM__
|
||||
#define nop() __no_operation()
|
||||
#elif defined(__GNUC__)
|
||||
#define nop() (__NOP())
|
||||
|
||||
@@ -48,9 +48,7 @@
|
||||
#define _CONF_USB_H_
|
||||
|
||||
#undef UNUSED /* To avoid a macro clash as macros.h already defines it */
|
||||
#include "../../../core/macros.h" /* For ENABLED()/DISABLED() */
|
||||
#include "../../../core/boards.h" /* For MB() */
|
||||
#include "../../../../Configuration.h" /* For CUSTOM_MACHINE_NAME definition - We just need the name, no C++ allowed! */
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
#include "compiler.h"
|
||||
|
||||
/**
|
||||
@@ -59,8 +57,6 @@
|
||||
*/
|
||||
|
||||
//! Device definition (mandatory)
|
||||
#define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */
|
||||
#define USB_DEVICE_PRODUCT_ID 0x2424 /* MSC / CDC */
|
||||
#define USB_DEVICE_MAJOR_VERSION 1
|
||||
#define USB_DEVICE_MINOR_VERSION 0
|
||||
#define USB_DEVICE_POWER 100 // Consumption on Vbus line (mA)
|
||||
@@ -70,15 +66,6 @@
|
||||
// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED)
|
||||
// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED)
|
||||
|
||||
//! USB Device string definitions (Optional)
|
||||
#define USB_DEVICE_MANUFACTURE_NAME "marlinfw.org"
|
||||
#ifdef CUSTOM_MACHINE_NAME
|
||||
#define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME
|
||||
#else
|
||||
#define USB_DEVICE_PRODUCT_NAME "3D Printer"
|
||||
#endif
|
||||
#define USB_DEVICE_SERIAL_NAME "123985739853"
|
||||
|
||||
/**
|
||||
* Device speeds support
|
||||
* Low speed not supported by CDC and MSC
|
||||
|
||||
@@ -61,27 +61,27 @@ extern "C" {
|
||||
* Below BOARD_XXX macros are related to the specific board, and
|
||||
* should be defined by the board code, otherwise default value are used.
|
||||
*/
|
||||
#if !defined(BOARD_FREQ_SLCK_XTAL)
|
||||
#ifndef BOARD_FREQ_SLCK_XTAL
|
||||
# warning The board slow clock xtal frequency has not been defined.
|
||||
# define BOARD_FREQ_SLCK_XTAL (32768UL)
|
||||
#endif
|
||||
|
||||
#if !defined(BOARD_FREQ_SLCK_BYPASS)
|
||||
#ifndef BOARD_FREQ_SLCK_BYPASS
|
||||
# warning The board slow clock bypass frequency has not been defined.
|
||||
# define BOARD_FREQ_SLCK_BYPASS (32768UL)
|
||||
#endif
|
||||
|
||||
#if !defined(BOARD_FREQ_MAINCK_XTAL)
|
||||
#ifndef BOARD_FREQ_MAINCK_XTAL
|
||||
# warning The board main clock xtal frequency has not been defined.
|
||||
# define BOARD_FREQ_MAINCK_XTAL (12000000UL)
|
||||
#endif
|
||||
|
||||
#if !defined(BOARD_FREQ_MAINCK_BYPASS)
|
||||
#ifndef BOARD_FREQ_MAINCK_BYPASS
|
||||
# warning The board main clock bypass frequency has not been defined.
|
||||
# define BOARD_FREQ_MAINCK_BYPASS (12000000UL)
|
||||
#endif
|
||||
|
||||
#if !defined(BOARD_OSC_STARTUP_US)
|
||||
#ifndef BOARD_OSC_STARTUP_US
|
||||
# warning The board main clock xtal startup time has not been defined.
|
||||
# define BOARD_OSC_STARTUP_US (15625UL)
|
||||
#endif
|
||||
|
||||
@@ -15,11 +15,11 @@ extern "C" {
|
||||
|
||||
#define SD_MMC_BLOCK_SIZE 512
|
||||
|
||||
void sd_mmc_spi_mem_init(void) {
|
||||
void sd_mmc_spi_mem_init() {
|
||||
}
|
||||
|
||||
Ctrl_status sd_mmc_spi_test_unit_ready(void) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
Ctrl_status sd_mmc_spi_test_unit_ready() {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
return CTRL_GOOD;
|
||||
}
|
||||
@@ -27,25 +27,18 @@ Ctrl_status sd_mmc_spi_test_unit_ready(void) {
|
||||
// NOTE: This function is defined as returning the address of the last block
|
||||
// in the card, which is cardSize() - 1
|
||||
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
*nb_sector = card.getSd2Card().cardSize() - 1;
|
||||
return CTRL_GOOD;
|
||||
}
|
||||
|
||||
bool sd_mmc_spi_unload(bool unload) {
|
||||
UNUSED(unload);
|
||||
return true;
|
||||
}
|
||||
bool sd_mmc_spi_unload(bool) { return true; }
|
||||
|
||||
bool sd_mmc_spi_wr_protect(void) {
|
||||
return false;
|
||||
}
|
||||
bool sd_mmc_spi_wr_protect() { return false; }
|
||||
|
||||
bool sd_mmc_spi_removal(void) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
return true;
|
||||
return false;
|
||||
bool sd_mmc_spi_removal() {
|
||||
return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted());
|
||||
}
|
||||
|
||||
#if ACCESS_USB == true
|
||||
@@ -62,7 +55,7 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE];
|
||||
// #define DEBUG_MMC
|
||||
|
||||
Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
|
||||
#ifdef DEBUG_MMC
|
||||
@@ -99,7 +92,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
|
||||
}
|
||||
|
||||
Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
|
||||
#ifdef DEBUG_MMC
|
||||
|
||||
@@ -43,12 +43,12 @@
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
|
||||
*/
|
||||
#ifndef _SPC_PROTOCOL_H_
|
||||
#define _SPC_PROTOCOL_H_
|
||||
|
||||
#ifndef _SPC_PROTOCOL_H_
|
||||
#define _SPC_PROTOCOL_H_
|
||||
|
||||
/**
|
||||
* \ingroup usb_msc_protocol
|
||||
|
||||
@@ -94,11 +94,11 @@ typedef struct {
|
||||
uint16_t payload_size;
|
||||
|
||||
//! Callback called after reception of ZLP from setup request
|
||||
void (*callback) (void);
|
||||
void (*callback)(void);
|
||||
|
||||
//! Callback called when the buffer given (.payload) is full or empty.
|
||||
//! This one return false to abort data transfer, or true with a new buffer in .payload.
|
||||
bool(*over_under_run) (void);
|
||||
bool (*over_under_run)(void);
|
||||
} udd_ctrl_request_t;
|
||||
extern udd_ctrl_request_t udd_g_ctrlreq;
|
||||
|
||||
@@ -123,7 +123,7 @@ extern udd_ctrl_request_t udd_g_ctrlreq;
|
||||
* Registered by routine udd_ep_wait_stall_clear()
|
||||
* Callback called when endpoint stall is cleared.
|
||||
*/
|
||||
typedef void (*udd_callback_halt_cleared_t) (void);
|
||||
typedef void (*udd_callback_halt_cleared_t)(void);
|
||||
|
||||
/**
|
||||
* \brief End of transfer callback function type.
|
||||
|
||||
@@ -82,7 +82,7 @@ typedef struct {
|
||||
*
|
||||
* \return \c 1 if function was successfully done, otherwise \c 0.
|
||||
*/
|
||||
bool(*enable) (void);
|
||||
bool (*enable)(void);
|
||||
|
||||
/**
|
||||
* \brief Disable the interface.
|
||||
@@ -95,7 +95,7 @@ typedef struct {
|
||||
* - the device is detached from the host (i.e. Vbus is no
|
||||
* longer present)
|
||||
*/
|
||||
void (*disable) (void);
|
||||
void (*disable)(void);
|
||||
|
||||
/**
|
||||
* \brief Handle a control request directed at an interface.
|
||||
@@ -108,7 +108,7 @@ typedef struct {
|
||||
*
|
||||
* \return \c 1 if this interface supports the SETUP request, otherwise \c 0.
|
||||
*/
|
||||
bool(*setup) (void);
|
||||
bool (*setup)(void);
|
||||
|
||||
/**
|
||||
* \brief Returns the current setting of the selected interface.
|
||||
@@ -117,12 +117,12 @@ typedef struct {
|
||||
*
|
||||
* \return alternate setting of selected interface
|
||||
*/
|
||||
uint8_t(*getsetting) (void);
|
||||
uint8_t (*getsetting)(void);
|
||||
|
||||
/**
|
||||
* \brief To signal that a SOF is occurred
|
||||
*/
|
||||
void(*sof_notify) (void);
|
||||
void (*sof_notify)(void);
|
||||
} udi_api_t;
|
||||
|
||||
//@}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#include "udi.h"
|
||||
|
||||
// Check the number of port
|
||||
#ifndef UDI_CDC_PORT_NB
|
||||
#ifndef UDI_CDC_PORT_NB
|
||||
# define UDI_CDC_PORT_NB 1
|
||||
#endif
|
||||
#if (UDI_CDC_PORT_NB < 1) || (UDI_CDC_PORT_NB > 7)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include "usb_protocol_cdc.h"
|
||||
#include "conf_usb.h"
|
||||
|
||||
#ifndef UDI_CDC_PORT_NB
|
||||
#ifndef UDI_CDC_PORT_NB
|
||||
# define UDI_CDC_PORT_NB 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../../Marlin.h"
|
||||
#include "watchdog_Due.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
// Override Arduino runtime to either config or disable the watchdog
|
||||
//
|
||||
@@ -32,7 +32,7 @@
|
||||
// process, because watchdog initialization at hardware reset on SAM3X8E
|
||||
// is unreliable, and there is risk of unintended resets if we delay
|
||||
// that initialization to a later time.
|
||||
void watchdogSetup(void) {
|
||||
void watchdogSetup() {
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
@@ -106,7 +106,7 @@ void watchdogSetup(void) {
|
||||
// Initialize watchdog - On SAM3X, Watchdog was already configured
|
||||
// and enabled or disabled at startup, so no need to reconfigure it
|
||||
// here.
|
||||
void watchdog_init(void) {
|
||||
void watchdog_init() {
|
||||
// Reset watchdog to start clean
|
||||
WDT_Restart(WDT);
|
||||
}
|
||||
@@ -30,4 +30,4 @@ void watchdog_init();
|
||||
|
||||
// Reset watchdog. MUST be called at least every 4 seconds after the
|
||||
// first watchdog_init or AVR will go into emergency procedures.
|
||||
inline void watchdog_reset() { watchdogReset(); }
|
||||
inline void HAL_watchdog_refresh() { watchdogReset(); }
|
||||
@@ -29,7 +29,7 @@ class FlushableHardwareSerial : public HardwareSerial {
|
||||
public:
|
||||
FlushableHardwareSerial(int uart_nr);
|
||||
|
||||
inline void flushTX(void) { /* No need to flush the hardware serial, but defined here for compatibility. */ }
|
||||
inline void flushTX() { /* No need to flush the hardware serial, but defined here for compatibility. */ }
|
||||
};
|
||||
|
||||
extern FlushableHardwareSerial flushableSerial;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
#include "HAL.h"
|
||||
#include "HAL_timers_ESP32.h"
|
||||
#include "timers.h"
|
||||
#include <rom/rtc.h>
|
||||
#include <driver/adc.h>
|
||||
#include <esp_adc_cal.h>
|
||||
@@ -78,11 +78,11 @@ volatile int numPWMUsed = 0,
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
void HAL_init(void) {
|
||||
void HAL_init() {
|
||||
i2s_init();
|
||||
}
|
||||
|
||||
void HAL_init_board(void) {
|
||||
void HAL_init_board() {
|
||||
#if EITHER(EEPROM_SETTINGS, WEBSUPPORT)
|
||||
spiffs_init();
|
||||
#endif
|
||||
@@ -99,15 +99,15 @@ void HAL_init_board(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void HAL_idletask(void) {
|
||||
void HAL_idletask() {
|
||||
#if ENABLED(OTASUPPORT)
|
||||
OTA_handle();
|
||||
#endif
|
||||
}
|
||||
|
||||
void HAL_clear_reset_source(void) { }
|
||||
void HAL_clear_reset_source() { }
|
||||
|
||||
uint8_t HAL_get_reset_source(void) { return rtc_get_reset_reason(1); }
|
||||
uint8_t HAL_get_reset_source() { return rtc_get_reset_reason(1); }
|
||||
|
||||
void _delay_ms(int delay_ms) { delay(delay_ms); }
|
||||
|
||||
@@ -187,19 +187,21 @@ void HAL_adc_start_conversion(uint8_t adc_pin) {
|
||||
const adc1_channel_t chan = get_channel(adc_pin);
|
||||
uint32_t mv;
|
||||
esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv);
|
||||
HAL_adc_result = mv * 1023.0 / 3300.0;
|
||||
|
||||
// Change the attenuation level based on the new reading
|
||||
adc_atten_t atten;
|
||||
if (mv < thresholds[ADC_ATTEN_DB_0] - 100)
|
||||
adc1_set_attenuation(chan, ADC_ATTEN_DB_0);
|
||||
atten = ADC_ATTEN_DB_0;
|
||||
else if (mv > thresholds[ADC_ATTEN_DB_0] - 50 && mv < thresholds[ADC_ATTEN_DB_2_5] - 100)
|
||||
adc1_set_attenuation(chan, ADC_ATTEN_DB_2_5);
|
||||
atten = ADC_ATTEN_DB_2_5;
|
||||
else if (mv > thresholds[ADC_ATTEN_DB_2_5] - 50 && mv < thresholds[ADC_ATTEN_DB_6] - 100)
|
||||
adc1_set_attenuation(chan, ADC_ATTEN_DB_6);
|
||||
atten = ADC_ATTEN_DB_6;
|
||||
else if (mv > thresholds[ADC_ATTEN_DB_6] - 50)
|
||||
adc1_set_attenuation(chan, ADC_ATTEN_DB_11);
|
||||
atten = ADC_ATTEN_DB_11;
|
||||
else return;
|
||||
|
||||
HAL_adc_result = mv * 1023.0 / 3300.0;
|
||||
adc1_set_attenuation(chan, atten);
|
||||
}
|
||||
|
||||
void analogWrite(pin_t pin, int value) {
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
|
||||
#include "fastio_ESP32.h"
|
||||
#include "watchdog_ESP32.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "i2s.h"
|
||||
|
||||
#include "HAL_timers_ESP32.h"
|
||||
#include "timers.h"
|
||||
|
||||
#include "WebSocketSerial.h"
|
||||
#include "FlushableHardwareSerial.h"
|
||||
@@ -85,14 +85,17 @@ extern uint16_t HAL_adc_result;
|
||||
// ------------------------
|
||||
|
||||
// clear reset reason
|
||||
void HAL_clear_reset_source (void);
|
||||
void HAL_clear_reset_source();
|
||||
|
||||
// reset reason
|
||||
uint8_t HAL_get_reset_source(void);
|
||||
uint8_t HAL_get_reset_source();
|
||||
|
||||
void _delay_ms(int delay);
|
||||
|
||||
int freeMemory(void);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
int freeMemory();
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
void analogWrite(pin_t pin, int value);
|
||||
|
||||
@@ -105,7 +108,7 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n);
|
||||
// ADC
|
||||
#define HAL_ANALOG_SELECT(pin)
|
||||
|
||||
void HAL_adc_init(void);
|
||||
void HAL_adc_init();
|
||||
|
||||
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
||||
#define HAL_READ_ADC() HAL_adc_result
|
||||
@@ -120,6 +123,6 @@ void HAL_adc_start_conversion(uint8_t adc_pin);
|
||||
// Enable hooks into idle and setup for HAL
|
||||
#define HAL_IDLETASK 1
|
||||
#define BOARD_INIT() HAL_init_board();
|
||||
void HAL_idletask(void);
|
||||
void HAL_init(void);
|
||||
void HAL_init_board(void);
|
||||
void HAL_idletask();
|
||||
void HAL_init();
|
||||
void HAL_init_board();
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include <pins_arduino.h>
|
||||
#include "spi_pins.h"
|
||||
#include "../../core/macros.h"
|
||||
#include <SPI.h>
|
||||
|
||||
#include "../../core/macros.h"
|
||||
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
@@ -79,7 +80,7 @@ void spiInit(uint8_t spiRate) {
|
||||
SPI.begin();
|
||||
}
|
||||
|
||||
uint8_t spiRec(void) {
|
||||
uint8_t spiRec() {
|
||||
SPI.beginTransaction(spiConfig);
|
||||
uint8_t returnByte = SPI.transfer(0xFF);
|
||||
SPI.endTransaction();
|
||||
@@ -25,32 +25,32 @@
|
||||
|
||||
#if HAS_SERVOS
|
||||
|
||||
#include "HAL_Servo_ESP32.h"
|
||||
#include "Servo.h"
|
||||
|
||||
// Adjacent channels (0/1, 2/3 etc.) share the same timer and therefore the same frequency and resolution settings on ESP32,
|
||||
// so we only allocate servo channels up high to avoid side effects with regards to analogWrite (fans, leds, laser pwm etc.)
|
||||
int Servo::channel_next_free = 12;
|
||||
|
||||
Servo::Servo() {
|
||||
this->channel = channel_next_free++;
|
||||
channel = channel_next_free++;
|
||||
}
|
||||
|
||||
int8_t Servo::attach(const int pin) {
|
||||
if (this->channel >= CHANNEL_MAX_NUM) return -1;
|
||||
if (pin > 0) this->pin = pin;
|
||||
int8_t Servo::attach(const int inPin) {
|
||||
if (channel >= CHANNEL_MAX_NUM) return -1;
|
||||
if (pin > 0) pin = inPin;
|
||||
|
||||
ledcSetup(this->channel, 50, 16); // channel X, 50 Hz, 16-bit depth
|
||||
ledcAttachPin(this->pin, this->channel);
|
||||
ledcSetup(channel, 50, 16); // channel X, 50 Hz, 16-bit depth
|
||||
ledcAttachPin(pin, channel);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Servo::detach() { ledcDetachPin(this->pin); }
|
||||
void Servo::detach() { ledcDetachPin(pin); }
|
||||
|
||||
int Servo::read() { return this->degrees; }
|
||||
int Servo::read() { return degrees; }
|
||||
|
||||
void Servo::write(int inDegrees) {
|
||||
this->degrees = constrain(inDegrees, MIN_ANGLE, MAX_ANGLE);
|
||||
int us = map(this->degrees, MIN_ANGLE, MAX_ANGLE, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH);
|
||||
degrees = constrain(inDegrees, MIN_ANGLE, MAX_ANGLE);
|
||||
int us = map(degrees, MIN_ANGLE, MAX_ANGLE, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH);
|
||||
int duty = map(us, 0, TAU_USEC, 0, MAX_COMPARE);
|
||||
ledcWrite(channel, duty);
|
||||
}
|
||||
@@ -58,11 +58,11 @@ void Servo::write(int inDegrees) {
|
||||
void Servo::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 (this->attach(0) >= 0) {
|
||||
this->write(value);
|
||||
safe_delay(servo_delay[this->channel]);
|
||||
if (attach(0) >= 0) {
|
||||
write(value);
|
||||
safe_delay(servo_delay[channel]);
|
||||
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
|
||||
this->detach();
|
||||
detach();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -66,15 +66,15 @@ ring_buffer_pos_t RingBuffer::write(const uint8_t *buffer, ring_buffer_pos_t siz
|
||||
return written;
|
||||
}
|
||||
|
||||
int RingBuffer::available(void) {
|
||||
int RingBuffer::available() {
|
||||
return (size - read_index + write_index) & (size - 1);
|
||||
}
|
||||
|
||||
int RingBuffer::peek(void) {
|
||||
int RingBuffer::peek() {
|
||||
return available() ? data[read_index] : -1;
|
||||
}
|
||||
|
||||
int RingBuffer::read(void) {
|
||||
int RingBuffer::read() {
|
||||
if (available()) {
|
||||
const int ret = data[read_index];
|
||||
read_index = NEXT_INDEX(read_index, size);
|
||||
@@ -94,7 +94,7 @@ ring_buffer_pos_t RingBuffer::read(uint8_t *buffer) {
|
||||
return len;
|
||||
}
|
||||
|
||||
void RingBuffer::flush(void) { read_index = write_index; }
|
||||
void RingBuffer::flush() { read_index = write_index; }
|
||||
|
||||
// WebSocketSerial impl
|
||||
WebSocketSerial::WebSocketSerial()
|
||||
@@ -120,10 +120,10 @@ void WebSocketSerial::begin(const long baud_setting) {
|
||||
}
|
||||
|
||||
void WebSocketSerial::end() { }
|
||||
int WebSocketSerial::peek(void) { return rx_buffer.peek(); }
|
||||
int WebSocketSerial::read(void) { return rx_buffer.read(); }
|
||||
int WebSocketSerial::available(void) { return rx_buffer.available(); }
|
||||
void WebSocketSerial::flush(void) { rx_buffer.flush(); }
|
||||
int WebSocketSerial::peek() { return rx_buffer.peek(); }
|
||||
int WebSocketSerial::read() { return rx_buffer.read(); }
|
||||
int WebSocketSerial::available() { return rx_buffer.available(); }
|
||||
void WebSocketSerial::flush() { rx_buffer.flush(); }
|
||||
|
||||
size_t WebSocketSerial::write(const uint8_t c) {
|
||||
size_t ret = tx_buffer.write(c);
|
||||
@@ -145,7 +145,7 @@ size_t WebSocketSerial::write(const uint8_t* buffer, size_t size) {
|
||||
return written;
|
||||
}
|
||||
|
||||
void WebSocketSerial::flushTX(void) {
|
||||
void WebSocketSerial::flushTX() {
|
||||
// No need to do anything as there's no benefit to sending partial lines over the websocket connection.
|
||||
}
|
||||
|
||||
|
||||
@@ -45,11 +45,11 @@ public:
|
||||
RingBuffer(ring_buffer_pos_t size);
|
||||
~RingBuffer();
|
||||
|
||||
int available(void);
|
||||
int peek(void);
|
||||
int read(void);
|
||||
int available();
|
||||
int peek();
|
||||
int read();
|
||||
ring_buffer_pos_t read(uint8_t *buffer);
|
||||
void flush(void);
|
||||
void flush();
|
||||
ring_buffer_pos_t write(const uint8_t c);
|
||||
ring_buffer_pos_t write(const uint8_t* buffer, ring_buffer_pos_t size);
|
||||
};
|
||||
@@ -62,11 +62,11 @@ public:
|
||||
WebSocketSerial();
|
||||
void begin(const long);
|
||||
void end();
|
||||
int available(void);
|
||||
int peek(void);
|
||||
int read(void);
|
||||
void flush(void);
|
||||
void flushTX(void);
|
||||
int available();
|
||||
int peek();
|
||||
int read();
|
||||
void flush();
|
||||
void flushTX();
|
||||
size_t write(const uint8_t c);
|
||||
size_t write(const uint8_t* buffer, size_t size);
|
||||
|
||||
|
||||
@@ -38,40 +38,41 @@
|
||||
#include "../../module/endstops.h"
|
||||
|
||||
// One ISR for all EXT-Interrupts
|
||||
void ICACHE_RAM_ATTR endstop_ISR(void) { endstops.update(); }
|
||||
void ICACHE_RAM_ATTR endstop_ISR() { endstops.update(); }
|
||||
|
||||
void setup_endstop_interrupts(void) {
|
||||
void setup_endstop_interrupts() {
|
||||
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
|
||||
#if HAS_X_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(X_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_X_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(X_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Y_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Y_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Z_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z2_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z2_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Z2_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z2_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z3_MAX
|
||||
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z3_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Z3_MIN
|
||||
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z3_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z_MIN_PROBE_PIN
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "HAL.h"
|
||||
|
||||
#include "HAL_timers_ESP32.h"
|
||||
#include "timers.h"
|
||||
|
||||
// ------------------------
|
||||
// Local defines
|
||||
@@ -79,13 +79,13 @@ typedef uint64_t hal_timer_t;
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||
|
||||
#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void)
|
||||
#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void)
|
||||
#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler(void)
|
||||
#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
|
||||
#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
|
||||
#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler()
|
||||
|
||||
extern "C" void tempTC_Handler(void);
|
||||
extern "C" void stepTC_Handler(void);
|
||||
extern "C" void pwmTC_Handler(void);
|
||||
extern "C" void tempTC_Handler();
|
||||
extern "C" void stepTC_Handler();
|
||||
extern "C" void pwmTC_Handler();
|
||||
|
||||
// ------------------------
|
||||
// Types
|
||||
@@ -95,7 +95,7 @@ typedef struct {
|
||||
timer_group_t group;
|
||||
timer_idx_t idx;
|
||||
uint32_t divider;
|
||||
void (*fn)(void);
|
||||
void (*fn)();
|
||||
} tTimerConfig;
|
||||
|
||||
// ------------------------
|
||||
@@ -26,13 +26,13 @@
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include "watchdog_ESP32.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
void watchdogSetup(void) {
|
||||
void watchdogSetup() {
|
||||
// do whatever. don't remove this function.
|
||||
}
|
||||
|
||||
void watchdog_init(void) {
|
||||
void watchdog_init() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -25,4 +25,4 @@
|
||||
void watchdog_init();
|
||||
|
||||
// Reset watchdog.
|
||||
inline void watchdog_reset() { }
|
||||
inline void HAL_watchdog_refresh() {}
|
||||
@@ -22,16 +22,18 @@
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
#include <SPIFFS.h>
|
||||
#undef DISABLED // esp32-hal-gpio.h
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(WEBSUPPORT)
|
||||
|
||||
#include <SPIFFS.h>
|
||||
#include "wifi.h"
|
||||
|
||||
AsyncEventSource events("/events"); // event source (Server-Sent events)
|
||||
|
||||
void onNotFound(AsyncWebServerRequest *request){
|
||||
void onNotFound(AsyncWebServerRequest *request) {
|
||||
request->send(404);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ HalSerial usb_serial;
|
||||
extern "C" void u8g_xMicroDelay(uint16_t val) {
|
||||
DELAY_US(val);
|
||||
}
|
||||
extern "C" void u8g_MicroDelay(void) {
|
||||
extern "C" void u8g_MicroDelay() {
|
||||
u8g_xMicroDelay(1);
|
||||
}
|
||||
extern "C" void u8g_10MicroDelay(void) {
|
||||
extern "C" void u8g_10MicroDelay() {
|
||||
u8g_xMicroDelay(10);
|
||||
}
|
||||
extern "C" void u8g_Delay(uint16_t val) {
|
||||
@@ -51,7 +51,7 @@ int freeMemory() {
|
||||
// ADC
|
||||
// ------------------------
|
||||
|
||||
void HAL_adc_init(void) {
|
||||
void HAL_adc_init() {
|
||||
|
||||
}
|
||||
|
||||
@@ -64,18 +64,18 @@ void HAL_adc_start_conversion(const uint8_t ch) {
|
||||
active_ch = ch;
|
||||
}
|
||||
|
||||
bool HAL_adc_finished(void) {
|
||||
bool HAL_adc_finished() {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint16_t HAL_adc_get_result(void) {
|
||||
uint16_t HAL_adc_get_result() {
|
||||
pin_t pin = analogInputToDigitalPin(active_ch);
|
||||
if (!VALID_PIN(pin)) return 0;
|
||||
uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF);
|
||||
return data; // return 10bit value as Marlin expects
|
||||
}
|
||||
|
||||
void HAL_pwm_init(void) {
|
||||
void HAL_pwm_init() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ uint8_t _getc();
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "HAL_timers.h"
|
||||
#include "timers.h"
|
||||
#include "serial.h"
|
||||
|
||||
#define SHARED_SERVOS HAS_SERVOS
|
||||
@@ -78,18 +78,13 @@ extern HalSerial usb_serial;
|
||||
#define ENABLE_ISRS()
|
||||
#define DISABLE_ISRS()
|
||||
|
||||
inline void HAL_init(void) { }
|
||||
inline void HAL_init() {}
|
||||
|
||||
// Utility functions
|
||||
int freeMemory(void);
|
||||
|
||||
// SPI: Extended functions which take a channel number (hardware SPI only)
|
||||
/** Write single byte to specified SPI channel */
|
||||
void spiSend(uint32_t chan, byte b);
|
||||
/** Write buffer to specified SPI channel */
|
||||
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
|
||||
/** Read single byte from specified SPI channel */
|
||||
uint8_t spiRec(uint32_t chan);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
int freeMemory();
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// ADC
|
||||
#define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin)
|
||||
@@ -97,10 +92,14 @@ uint8_t spiRec(uint32_t chan);
|
||||
#define HAL_READ_ADC() HAL_adc_get_result()
|
||||
#define HAL_ADC_READY() true
|
||||
|
||||
void HAL_adc_init(void);
|
||||
void HAL_adc_init();
|
||||
void HAL_adc_enable_channel(int pin);
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
||||
uint16_t HAL_adc_get_result(void);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
// Reset source
|
||||
inline void HAL_clear_reset_source(void) {}
|
||||
inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
|
||||
|
||||
/* ---------------- Delay in cycles */
|
||||
FORCE_INLINE static void DELAY_CYCLES(uint64_t x) {
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
#include "../shared/Delay.h"
|
||||
|
||||
// Interrupts
|
||||
void cli(void) { } // Disable
|
||||
void sei(void) { } // Enable
|
||||
void cli() { } // Disable
|
||||
void sei() { } // Enable
|
||||
|
||||
// Time functions
|
||||
void _delay_ms(const int delay_ms) {
|
||||
@@ -90,7 +90,7 @@ void eeprom_read_block(void *__dst, const void *__src, size_t __n) { }
|
||||
|
||||
void eeprom_update_block(const void *__src, void *__dst, size_t __n) { }
|
||||
|
||||
char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) {
|
||||
char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s) {
|
||||
char format_string[20];
|
||||
snprintf(format_string, 20, "%%%d.%df", __width, __prec);
|
||||
sprintf(__s, format_string, __val);
|
||||
|
||||
@@ -49,8 +49,6 @@ typedef uint8_t byte;
|
||||
#define PGM_P const char *
|
||||
|
||||
// Used for libraries, preprocessor, and constants
|
||||
#define min(a,b) ((a)<(b)?(a):(b))
|
||||
#define max(a,b) ((a)>(b)?(a):(b))
|
||||
#define abs(x) ((x)>0?(x):-(x))
|
||||
|
||||
#ifndef isnan
|
||||
@@ -65,9 +63,9 @@ typedef uint8_t byte;
|
||||
#define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value)))
|
||||
|
||||
//Interrupts
|
||||
void cli(void); // Disable
|
||||
void sei(void); // Enable
|
||||
void attachInterrupt(uint32_t pin, void (*callback)(void), uint32_t mode);
|
||||
void cli(); // Disable
|
||||
void sei(); // Enable
|
||||
void attachInterrupt(uint32_t pin, void (*callback)(), uint32_t mode);
|
||||
void detachInterrupt(uint32_t pin);
|
||||
extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode);
|
||||
extern "C" void GpioDisableInt(uint32_t port, uint32_t pin);
|
||||
@@ -111,13 +109,13 @@ uint16_t analogRead(pin_t);
|
||||
// EEPROM
|
||||
void eeprom_write_byte(unsigned char *pos, unsigned char value);
|
||||
unsigned char eeprom_read_byte(unsigned char *pos);
|
||||
void eeprom_read_block (void *__dst, const void *__src, size_t __n);
|
||||
void eeprom_update_block (const void *__src, void *__dst, size_t __n);
|
||||
void eeprom_read_block(void *__dst, const void *__src, size_t __n);
|
||||
void eeprom_update_block(const void *__src, void *__dst, size_t __n);
|
||||
|
||||
int32_t random(int32_t);
|
||||
int32_t random(int32_t, int32_t);
|
||||
void randomSeed(uint32_t);
|
||||
|
||||
char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s);
|
||||
char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s);
|
||||
|
||||
int map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max);
|
||||
|
||||
@@ -83,9 +83,9 @@ public:
|
||||
|
||||
HalSerial() { host_connected = true; }
|
||||
|
||||
void begin(int32_t baud) { }
|
||||
void begin(int32_t) {}
|
||||
|
||||
void end() { }
|
||||
void end() {}
|
||||
|
||||
int peek() {
|
||||
uint8_t value;
|
||||
@@ -108,11 +108,11 @@ public:
|
||||
|
||||
void flush() { receive_buffer.clear(); }
|
||||
|
||||
uint8_t availableForWrite(void){
|
||||
uint8_t availableForWrite() {
|
||||
return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free();
|
||||
}
|
||||
|
||||
void flushTX(void){
|
||||
void flushTX() {
|
||||
if (host_connected)
|
||||
while (transmit_buffer.available()) { /* nada */ }
|
||||
}
|
||||
@@ -142,10 +142,10 @@ public:
|
||||
void print_bin(uint32_t value, uint8_t num_digits) {
|
||||
uint32_t mask = 1 << (num_digits -1);
|
||||
for (uint8_t i = 0; i < num_digits; i++) {
|
||||
if (!(i % 4) && i) write(' ');
|
||||
if (!(i % 16) && i) write(' ');
|
||||
if (value & mask) write('1');
|
||||
else write('0');
|
||||
if (!(i % 4) && i) write(' ');
|
||||
if (!(i % 16) && i) write(' ');
|
||||
if (value & mask) write('1');
|
||||
else write('0');
|
||||
value <<= 1;
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public:
|
||||
void println(unsigned long value, int nbase = 0) { print(value, nbase); println(); }
|
||||
void println(float value, int round = 6) { printf("%f\n" , value); }
|
||||
void println(double value, int round = 6) { printf("%f\n" , value); }
|
||||
void println(void) { print('\n'); }
|
||||
void println() { print('\n'); }
|
||||
|
||||
volatile RingBuffer<uint8_t, 128> receive_buffer;
|
||||
volatile RingBuffer<uint8_t, 128> transmit_buffer;
|
||||
|
||||
@@ -104,7 +104,7 @@ void simulation_loop() {
|
||||
}
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
int main() {
|
||||
std::thread write_serial (write_serial_thread);
|
||||
std::thread read_serial (read_serial_thread);
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ bool PersistentStore::access_finish() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
std::size_t bytes_written = 0;
|
||||
|
||||
for (std::size_t i = 0; i < size; i++) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "hardware/Timer.h"
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "HAL_timers.h"
|
||||
#include "timers.h"
|
||||
|
||||
/**
|
||||
* Use POSIX signals to attempt to emulate Interrupts
|
||||
@@ -37,7 +37,7 @@ HAL_TEMP_TIMER_ISR();
|
||||
|
||||
Timer timers[2];
|
||||
|
||||
void HAL_timer_init(void) {
|
||||
void HAL_timer_init() {
|
||||
timers[0].init(0, STEPPER_TIMER_RATE, TIMER0_IRQHandler);
|
||||
timers[1].init(1, TEMP_TIMER_RATE, TIMER1_IRQHandler);
|
||||
}
|
||||
@@ -59,16 +59,16 @@ typedef uint32_t hal_timer_t;
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||
|
||||
#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler(void)
|
||||
#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler(void)
|
||||
#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler()
|
||||
#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler()
|
||||
|
||||
// PWM timer
|
||||
#define HAL_PWM_TIMER
|
||||
#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler(void)
|
||||
#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler()
|
||||
#define HAL_PWM_TIMER_IRQn
|
||||
|
||||
|
||||
void HAL_timer_init(void);
|
||||
void HAL_timer_init();
|
||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
||||
|
||||
void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare);
|
||||
@@ -28,19 +28,9 @@
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
void watchdog_init(void) {}
|
||||
void watchdog_init() {}
|
||||
void HAL_watchdog_refresh() {}
|
||||
|
||||
void HAL_clear_reset_source(void) {}
|
||||
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
return RST_POWER_ON;
|
||||
}
|
||||
|
||||
void watchdog_reset() {}
|
||||
|
||||
#else
|
||||
void HAL_clear_reset_source(void) {}
|
||||
uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
|
||||
#endif // USE_WATCHDOG
|
||||
#endif
|
||||
|
||||
#endif // __PLAT_LINUX__
|
||||
|
||||
@@ -23,7 +23,5 @@
|
||||
|
||||
#define WDT_TIMEOUT 4000000 // 4 second timeout
|
||||
|
||||
void watchdog_init(void);
|
||||
void watchdog_reset(void);
|
||||
void HAL_clear_reset_source(void);
|
||||
uint8_t HAL_get_reset_source(void);
|
||||
void watchdog_init();
|
||||
void HAL_watchdog_refresh();
|
||||
|
||||
+9
-9
@@ -44,7 +44,7 @@
|
||||
#define sw_barrier() __asm__ volatile("": : :"memory");
|
||||
|
||||
// (re)initialize UART0 as a monitor output to 250000,n,8,1
|
||||
static void TXBegin(void) {
|
||||
static void TXBegin() {
|
||||
}
|
||||
|
||||
// Send character through UART with no interrupts
|
||||
@@ -210,7 +210,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
__attribute__((naked)) void NMI_Handler(void) {
|
||||
__attribute__((naked)) void NMI_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -223,7 +223,7 @@ __attribute__((naked)) void NMI_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void HardFault_Handler(void) {
|
||||
__attribute__((naked)) void HardFault_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -236,7 +236,7 @@ __attribute__((naked)) void HardFault_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void MemManage_Handler(void) {
|
||||
__attribute__((naked)) void MemManage_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -249,7 +249,7 @@ __attribute__((naked)) void MemManage_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void BusFault_Handler(void) {
|
||||
__attribute__((naked)) void BusFault_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -262,7 +262,7 @@ __attribute__((naked)) void BusFault_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void UsageFault_Handler(void) {
|
||||
__attribute__((naked)) void UsageFault_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -275,7 +275,7 @@ __attribute__((naked)) void UsageFault_Handler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void DebugMon_Handler(void) {
|
||||
__attribute__((naked)) void DebugMon_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -289,7 +289,7 @@ __attribute__((naked)) void DebugMon_Handler(void) {
|
||||
}
|
||||
|
||||
/* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */
|
||||
__attribute__((naked)) void WDT_IRQHandler(void) {
|
||||
__attribute__((naked)) void WDT_IRQHandler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -302,7 +302,7 @@ __attribute__((naked)) void WDT_IRQHandler(void) {
|
||||
);
|
||||
}
|
||||
|
||||
__attribute__((naked)) void RSTC_Handler(void) {
|
||||
__attribute__((naked)) void RSTC_Handler() {
|
||||
__asm__ __volatile__ (
|
||||
".syntax unified" "\n\t"
|
||||
A("tst lr, #4")
|
||||
@@ -26,14 +26,18 @@
|
||||
#include "../shared/Delay.h"
|
||||
#include "../../../gcode/parser.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
#include "watchdog.h"
|
||||
#endif
|
||||
|
||||
// U8glib required functions
|
||||
extern "C" void u8g_xMicroDelay(uint16_t val) {
|
||||
DELAY_US(val);
|
||||
}
|
||||
extern "C" void u8g_MicroDelay(void) {
|
||||
extern "C" void u8g_MicroDelay() {
|
||||
u8g_xMicroDelay(1);
|
||||
}
|
||||
extern "C" void u8g_10MicroDelay(void) {
|
||||
extern "C" void u8g_10MicroDelay() {
|
||||
u8g_xMicroDelay(10);
|
||||
}
|
||||
extern "C" void u8g_Delay(uint16_t val) {
|
||||
@@ -65,4 +69,17 @@ void flashFirmware(int16_t value) {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
void HAL_clear_reset_source(void) {
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
watchdog_clear_timeout_flag();
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
if (watchdog_timed_out()) return RST_WATCHDOG;
|
||||
#endif
|
||||
return RST_POWER_ON;
|
||||
}
|
||||
|
||||
#endif // TARGET_LPC1768
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#define CPU_32_BIT
|
||||
|
||||
void HAL_init(void);
|
||||
void HAL_init();
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
@@ -41,7 +41,7 @@ extern "C" volatile uint32_t _millis;
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "HAL_timers.h"
|
||||
#include "timers.h"
|
||||
#include "MarlinSerial.h"
|
||||
|
||||
#include <adc.h>
|
||||
@@ -111,18 +111,10 @@ extern "C" volatile uint32_t _millis;
|
||||
//
|
||||
// Utility functions
|
||||
//
|
||||
int freeMemory(void);
|
||||
|
||||
//
|
||||
// SPI: Extended functions taking a channel number (Hardware SPI only)
|
||||
//
|
||||
|
||||
// Write single byte to specified SPI channel
|
||||
void spiSend(uint32_t chan, byte b);
|
||||
// Write buffer to specified SPI channel
|
||||
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
|
||||
// Read single byte from specified SPI channel
|
||||
uint8_t spiRec(uint32_t chan);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
int freeMemory();
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
//
|
||||
// ADC API
|
||||
@@ -146,18 +138,13 @@ using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
|
||||
#define HAL_READ_ADC() FilteredADC::get_result()
|
||||
#define HAL_ADC_READY() FilteredADC::finished_conversion()
|
||||
|
||||
// A grace period to allow ADC readings to stabilize, preventing false alarms
|
||||
#ifndef THERMAL_PROTECTION_GRACE_PERIOD
|
||||
#define THERMAL_PROTECTION_GRACE_PERIOD 1000
|
||||
#endif
|
||||
|
||||
// Parse a G-code word into a pin index
|
||||
int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
|
||||
// P0.6 thru P0.9 are for the onboard SD card
|
||||
#define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09
|
||||
|
||||
#define HAL_IDLETASK 1
|
||||
void HAL_idletask(void);
|
||||
void HAL_idletask();
|
||||
|
||||
#define PLATFORM_M997_SUPPORT
|
||||
void flashFirmware(int16_t value);
|
||||
@@ -177,3 +164,7 @@ void set_pwm_frequency(const pin_t pin, int f_desired);
|
||||
* Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255]
|
||||
*/
|
||||
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false);
|
||||
|
||||
// Reset source
|
||||
void HAL_clear_reset_source(void);
|
||||
uint8_t HAL_get_reset_source(void);
|
||||
|
||||
@@ -27,28 +27,28 @@
|
||||
|
||||
#if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0)
|
||||
MarlinSerial MSerial(LPC_UART0);
|
||||
extern "C" void UART0_IRQHandler(void) {
|
||||
extern "C" void UART0_IRQHandler() {
|
||||
MSerial.IRQHandler();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(SERIAL_PORT) && SERIAL_PORT == 1) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 1)
|
||||
MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1);
|
||||
extern "C" void UART1_IRQHandler(void) {
|
||||
extern "C" void UART1_IRQHandler() {
|
||||
MSerial1.IRQHandler();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(SERIAL_PORT) && SERIAL_PORT == 2) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 2)
|
||||
MarlinSerial MSerial2(LPC_UART2);
|
||||
extern "C" void UART2_IRQHandler(void) {
|
||||
extern "C" void UART2_IRQHandler() {
|
||||
MSerial2.IRQHandler();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(SERIAL_PORT) && SERIAL_PORT == 3) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 3)
|
||||
MarlinSerial MSerial3(LPC_UART3);
|
||||
extern "C" void UART3_IRQHandler(void) {
|
||||
extern "C" void UART3_IRQHandler() {
|
||||
MSerial3.IRQHandler();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void end() { }
|
||||
void end() {}
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
bool recv_callback(const char c) override {
|
||||
|
||||
@@ -57,11 +57,11 @@ class libServo: public Servo {
|
||||
constexpr uint16_t servo_delay[] = SERVO_DELAY;
|
||||
static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
|
||||
|
||||
if (this->attach(servo_info[this->servoIndex].Pin.nbr) >= 0) { // try to reattach
|
||||
this->write(value);
|
||||
safe_delay(servo_delay[this->servoIndex]); // delay to allow servo to reach position
|
||||
if (attach(servo_info[servoIndex].Pin.nbr) >= 0) { // try to reattach
|
||||
write(value);
|
||||
safe_delay(servo_delay[servoIndex]); // delay to allow servo to reach position
|
||||
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
|
||||
this->detach();
|
||||
detach();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -38,73 +38,74 @@
|
||||
#include "../../module/endstops.h"
|
||||
|
||||
// One ISR for all EXT-Interrupts
|
||||
void endstop_ISR(void) { endstops.update(); }
|
||||
void endstop_ISR() { endstops.update(); }
|
||||
|
||||
void setup_endstop_interrupts(void) {
|
||||
void setup_endstop_interrupts() {
|
||||
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
|
||||
#if HAS_X_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(X_MAX_PIN)
|
||||
#error "X_MAX_PIN is not an INTERRUPT capable pin."
|
||||
#error "X_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(X_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_X_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(X_MIN_PIN)
|
||||
#error "X_MIN_PIN is not an INTERRUPT capable pin."
|
||||
#error "X_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(X_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Y_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(Y_MAX_PIN)
|
||||
#error "Y_MAX_PIN is not an INTERRUPT capable pin."
|
||||
#error "Y_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Y_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(Y_MIN_PIN)
|
||||
#error "Y_MIN_PIN is not an INTERRUPT capable pin."
|
||||
#error "Y_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Y_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(Z_MAX_PIN)
|
||||
#error "Z_MAX_PIN is not an INTERRUPT capable pin."
|
||||
#error "Z_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Z_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PIN)
|
||||
#error "Z_MIN_PIN is not an INTERRUPT capable pin."
|
||||
#error "Z_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z2_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(Z2_MAX_PIN)
|
||||
#error "Z2_MAX_PIN is not an INTERRUPT capable pin."
|
||||
#error "Z2_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z2_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Z2_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(Z2_MIN_PIN)
|
||||
#error "Z2_MIN_PIN is not an INTERRUPT capable pin."
|
||||
#error "Z2_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z2_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z3_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN)
|
||||
#error "Z3_MIN_PIN is not an INTERRUPT capable pin."
|
||||
#error "Z3_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z3_MAX_PIN);
|
||||
#endif
|
||||
#if HAS_Z3_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN)
|
||||
#error "Z3_MIN_PIN is not an INTERRUPT capable pin."
|
||||
#error "Z3_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z3_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_Z_MIN_PROBE_PIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PROBE_PIN)
|
||||
#error "Z_MIN_PROBE_PIN is not an INTERRUPT capable pin."
|
||||
#error "Z_MIN_PROBE_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
|
||||
_ATTACH(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM
|
||||
|
||||
#include <pwm.h>
|
||||
|
||||
@@ -36,5 +36,5 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255
|
||||
pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size);
|
||||
}
|
||||
|
||||
#endif // FAST_PWM_FAN
|
||||
#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM
|
||||
#endif // TARGET_LPC1768
|
||||
|
||||
@@ -89,7 +89,7 @@ uint8_t digipot_mcp4451_start(uint8_t sla) { // send slave address and write bi
|
||||
return 1;
|
||||
}
|
||||
|
||||
void digipot_mcp4451_init(void) {
|
||||
void digipot_mcp4451_init() {
|
||||
/**
|
||||
* Init I2C pin connect
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include <lpc17xx_libcfg_default.h>
|
||||
|
||||
uint8_t digipot_mcp4451_start(uint8_t sla);
|
||||
void digipot_mcp4451_init(void);
|
||||
void digipot_mcp4451_init();
|
||||
uint8_t digipot_mcp4451_send_byte(uint8_t data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -38,15 +38,15 @@ extern "C" {
|
||||
#include "../../sd/cardreader.h"
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "HAL.h"
|
||||
#include "HAL_timers.h"
|
||||
#include "timers.h"
|
||||
|
||||
extern uint32_t MSC_SD_Init(uint8_t pdrv);
|
||||
extern "C" int isLPC1769();
|
||||
extern "C" void disk_timerproc(void);
|
||||
extern "C" void disk_timerproc();
|
||||
|
||||
void SysTick_Callback() { disk_timerproc(); }
|
||||
|
||||
void HAL_init(void) {
|
||||
void HAL_init() {
|
||||
|
||||
// Init LEDs
|
||||
#if PIN_EXISTS(LED)
|
||||
@@ -149,16 +149,16 @@ void HAL_init(void) {
|
||||
}
|
||||
|
||||
// HAL idle task
|
||||
void HAL_idletask(void) {
|
||||
void HAL_idletask() {
|
||||
#if ENABLED(SHARED_SD_CARD)
|
||||
// If Marlin is using the SD card we need to lock it to prevent access from
|
||||
// a PC via USB.
|
||||
// Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but
|
||||
// this will not reliably detect delete operations. To be safe we will lock
|
||||
// the disk if Marlin has it mounted. Unfortuately there is currently no way
|
||||
// the disk if Marlin has it mounted. Unfortunately there is currently no way
|
||||
// to unmount the disk from the LCD menu.
|
||||
// if (IS_SD_PRINTING() || IS_SD_FILE_OPEN())
|
||||
if (card.isDetected())
|
||||
if (card.isMounted())
|
||||
MSC_Aquire_Lock();
|
||||
else
|
||||
MSC_Release_Lock();
|
||||
|
||||
@@ -125,7 +125,7 @@ static void debug_rw(const bool write, int &pos, const uint8_t *value, const siz
|
||||
// FR_INVALID_PARAMETER /* (19) Given parameter is invalid */
|
||||
// } FRESULT;
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
if (!eeprom_file_open) return true;
|
||||
FRESULT s;
|
||||
UINT bytes_written = 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user