Bump to head
This commit is contained in:
@@ -240,10 +240,10 @@ jobs:
|
||||
build_marlin_pio ./ ${TEST_PLATFORM}
|
||||
restore_configs
|
||||
echo testing STM32F1 targets...
|
||||
export TEST_PLATFORM="-e STM32F1"
|
||||
export TEST_PLATFORM="-e STM32F103R"
|
||||
restore_configs
|
||||
echo use_example_configs STM32/STM32F10
|
||||
use_example_configs STM32/STM32F10
|
||||
echo use_example_configs STM32/STM32F103R
|
||||
use_example_configs STM32/STM32F103R
|
||||
build_marlin_pio ./ ${TEST_PLATFORM}
|
||||
restore_configs
|
||||
echo use_example_configs STM32/stm32f103ret6
|
||||
|
||||
+35
-7
@@ -9,18 +9,46 @@ notifications:
|
||||
email: false
|
||||
|
||||
env:
|
||||
- TEST_PLATFORM="megaatmega2560"
|
||||
# Base Environments
|
||||
- TEST_PLATFORM="DUE"
|
||||
- TEST_PLATFORM="esp32"
|
||||
- TEST_PLATFORM="linux_native"
|
||||
- TEST_PLATFORM="LPC1768"
|
||||
- TEST_PLATFORM="LPC1769"
|
||||
- TEST_PLATFORM="STM32F1"
|
||||
- TEST_PLATFORM="megaatmega2560"
|
||||
- TEST_PLATFORM="STM32F103R"
|
||||
- TEST_PLATFORM="teensy31"
|
||||
- TEST_PLATFORM="teensy35"
|
||||
- TEST_PLATFORM="linux_native"
|
||||
- TEST_PLATFORM="esp32"
|
||||
- TEST_PLATFORM="alfawise_U20"
|
||||
- TEST_PLATFORM="black_stm32f407ve"
|
||||
- TEST_PLATFORM="adafruit_grandcentral_m4"
|
||||
|
||||
# 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="STM32F103R_bigtree"
|
||||
- TEST_PLATFORM="jgaurora_a5s_a1"
|
||||
- TEST_PLATFORM="STM32F103V_longer"
|
||||
- TEST_PLATFORM="STM32F407VE_black"
|
||||
|
||||
# Non-working environment tests
|
||||
#- TEST_PLATFORM="at90usb1286_cdc"
|
||||
#- TEST_PLATFORM="at90usb1286_dfu"
|
||||
#- TEST_PLATFORM="malyanm200"
|
||||
#- TEST_PLATFORM="mks_robin"
|
||||
#- TEST_PLATFORM="mks_robin_lite"
|
||||
#- TEST_PLATFORM="mks_robin_mini"
|
||||
#- TEST_PLATFORM="mks_robin_nano"
|
||||
#- TEST_PLATFORM="SAMD51_grandcentral_m4"
|
||||
#- TEST_PLATFORM="STM32F103R_bigtree"
|
||||
#- TEST_PLATFORM="STM32F103R_fysetc"
|
||||
#- TEST_PLATFORM="STM32F4"
|
||||
#- TEST_PLATFORM="STM32F7"
|
||||
|
||||
before_install:
|
||||
#
|
||||
|
||||
Binary file not shown.
-9606
File diff suppressed because it is too large
Load Diff
-11403
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
-11598
File diff suppressed because it is too large
Load Diff
+60
-160
@@ -15,8 +15,8 @@
|
||||
//#define MachineCR20Pro
|
||||
//#define MachineCR10
|
||||
//#define MachineCR10S
|
||||
#define MachineCR10SV2
|
||||
//#define MachineCR10SPro // Graphics LCD Requires soldering R64 and R66
|
||||
//#define MachineCR10SV2
|
||||
#define MachineCR10SPro // Graphics LCD Requires soldering R64 and R66
|
||||
//#define MachineCRX
|
||||
//#define MachineCR10Max
|
||||
//#define MachineS4
|
||||
@@ -691,6 +691,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. !!
|
||||
@@ -708,7 +709,8 @@
|
||||
* 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
|
||||
@@ -733,7 +735,7 @@
|
||||
* 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" }
|
||||
* :{ '0':"Not used", '1':"100k / 4.7k - EPCOS", '331':"(3.3V thermistor 1)", '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)", '201':"Pt100 (Overlord)", '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(HotendStock) || ENABLED(CrealityThermistor)
|
||||
#define TEMP_SENSOR_0 1
|
||||
@@ -1221,10 +1223,6 @@
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 300 // X, Y, Z acceleration for travel (non printing) moves
|
||||
#endif
|
||||
|
||||
#define DEFAULT_XJERK 10.0
|
||||
#define DEFAULT_YJERK 5.0
|
||||
#define DEFAULT_ZJERK 0.4
|
||||
#define DEFAULT_EJERK 5.0
|
||||
/**
|
||||
* Default Max Acceleration (change/s) change = mm/s
|
||||
* (Maximum start speed for accelerated moves)
|
||||
@@ -1263,6 +1261,13 @@
|
||||
* When changing speed and direction, if the difference is less than the
|
||||
* value set here, it may happen instantaneously.
|
||||
*/
|
||||
#if DISABLED(JUNCTION_DEVIATION)
|
||||
#define DEFAULT_XJERK 10.0
|
||||
#define DEFAULT_YJERK 10.0
|
||||
#define DEFAULT_ZJERK 0.3
|
||||
#endif
|
||||
|
||||
#define DEFAULT_EJERK 5.0 // May be used by Linear Advance
|
||||
|
||||
/**
|
||||
* S-Curve Acceleration
|
||||
@@ -1389,11 +1394,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 ---+
|
||||
* | |
|
||||
@@ -1405,92 +1409,54 @@
|
||||
* | |
|
||||
* O-- FRONT --+
|
||||
* (0,0)
|
||||
*
|
||||
* Specify a Probe position as { X, Y, Z }
|
||||
*/
|
||||
#if ENABLED(MachineCRX) && ENABLED(HotendStock)
|
||||
#if ENABLED(ABL_BLTOUCH)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -22 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER -45 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { -22, -45, 0 }
|
||||
#elif ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -44 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { -44, -10, 0 }
|
||||
#endif
|
||||
#elif ANY(MachineCR10SPro, MachineCR10Max) && ENABLED(HotendStock)
|
||||
#if ENABLED(ABL_BLTOUCH)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -27 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER -0 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#elif ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -27 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#endif
|
||||
#define NOZZLE_TO_PROBE_OFFSET { -27, 0, 0 }
|
||||
#elif ENABLED(MachineCR10SV2)
|
||||
#if ENABLED(ABL_BLTOUCH)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER 45 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER 7 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 45, 7, 0 }
|
||||
#elif ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER 45 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER 6.5 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 45, 7, 0 }
|
||||
#endif
|
||||
#else
|
||||
#if (ENABLED(ABL_BLTOUCH) && ENABLED(HotendStock))
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -41 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER -8 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { -41, -8, 0 }
|
||||
#endif
|
||||
|
||||
#if ((ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW)) && ENABLED(HotendStock))
|
||||
#if ENABLED(CREALITY_ABL_MOUNT)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -55 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER -15 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { -55, -15, 0 }
|
||||
#else
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -44 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { -44, -10, 0 }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if (ENABLED(ABL_BLTOUCH) && ENABLED(HotendE3D))
|
||||
#if (ANY(ABL_BLTOUCH, ABL_EZABL,ABL_NCSW) && ENABLED(HotendE3D))
|
||||
#if ENABLED(E3D_DUALFAN_MOUNT)
|
||||
#if ENABLED(E3D_PROBEMOUNT_LEFT)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -63 // X offset: -left +right [of the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { -63, 5, 0 }
|
||||
#else
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER 63 // X offset: -left +right [of the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 63, 5, 0 }
|
||||
#endif
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#else
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER 32 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ((ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW)) && ENABLED(HotendE3D))
|
||||
#if ENABLED(E3D_DUALFAN_MOUNT)
|
||||
#if ENABLED(E3D_PROBEMOUNT_LEFT)
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER -63 // X offset: -left +right [of the nozzle]
|
||||
#else
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER 63 // X offset: -left +right [of the nozzle]
|
||||
#endif
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#else
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER 33 // X offset: -left +right [of the nozzle]
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle]
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 32, 5, 0 }
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Certain types of probes need to stay away from edges
|
||||
#if ENABLED(ABL_BLTOUCH)
|
||||
#if ENABLED(MachineCR10Max, MachineCR10SV2)
|
||||
#define MIN_PROBE_EDGE 15
|
||||
#elif ENABLED(ABL_BLTOUCH)
|
||||
#define MIN_PROBE_EDGE 3
|
||||
#else
|
||||
#define MIN_PROBE_EDGE 5
|
||||
@@ -1525,7 +1491,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.
|
||||
@@ -1543,10 +1509,14 @@
|
||||
#define Z_PROBE_OFFSET_RANGE_MAX 20
|
||||
|
||||
// Enable the M48 repeatability test to test probe accuracy
|
||||
#if (ENABLED(ABL_EZABL)|| ENABLED(ABL_BLTOUCH) || ENABLED(ABL_NCSW))
|
||||
#if(DISABLED(MachineCR10Orig))
|
||||
#define Z_MIN_PROBE_REPEATABILITY_TEST
|
||||
#endif
|
||||
#if (ANY(ABL_EZABL, ABL_BLTOUCH, ABL_NCSW) && DISABLED(MachineCR10Orig))
|
||||
#define Z_MIN_PROBE_REPEATABILITY_TEST
|
||||
#endif
|
||||
|
||||
// Before deploy/stow pause for user confirmation
|
||||
//#define PAUSE_BEFORE_DEPLOY_STOW
|
||||
#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW)
|
||||
//#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1827,7 +1797,7 @@
|
||||
|
||||
// Set one or more commands to execute on filament runout.
|
||||
// (After 'M412 H' Marlin will ask the host to handle the process.)
|
||||
#define FILAMENT_RUNOUT_SCRIPT "M600 \n M117 \n"
|
||||
#define FILAMENT_RUNOUT_SCRIPT "M600"
|
||||
|
||||
// After a runout is detected, continue printing this length of filament
|
||||
// before executing the runout script. Useful for a sensor at the end of
|
||||
@@ -1952,22 +1922,10 @@
|
||||
#endif
|
||||
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
|
||||
|
||||
// Set the number of grid points per dimension.
|
||||
|
||||
#if ENABLED(MachineCR10Max, MachineCR10SV2)
|
||||
#define MESH_INSET 15
|
||||
#else
|
||||
#define MESH_INSET 5
|
||||
#endif
|
||||
|
||||
// Set the boundaries for probing (where the probe can reach).
|
||||
#define LEFT_PROBE_BED_POSITION (_MAX(X_MIN_BED + MIN_PROBE_EDGE, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) + MESH_INSET
|
||||
#define FRONT_PROBE_BED_POSITION (_MAX(Y_MIN_BED + MIN_PROBE_EDGE, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + MESH_INSET
|
||||
#define RIGHT_PROBE_BED_POSITION (_MIN(X_MAX_BED - (MIN_PROBE_EDGE), X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - MESH_INSET
|
||||
#define BACK_PROBE_BED_POSITION (_MIN(Y_MAX_BED - (MIN_PROBE_EDGE), Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - MESH_INSET
|
||||
|
||||
// Probe along the Y axis, advancing X after each column
|
||||
//#define PROBE_Y_FIRST
|
||||
|
||||
@@ -2024,67 +1982,6 @@
|
||||
|
||||
#endif // BED_LEVELING
|
||||
|
||||
/**
|
||||
* Points to probe for all 3-point Leveling procedures.
|
||||
* Override if the automatically selected points are inadequate.
|
||||
*/
|
||||
#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
|
||||
#if NONE(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max, MachineEnder4) || ENABLED(GraphicLCD)
|
||||
#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh
|
||||
#endif
|
||||
|
||||
#if ENABLED(MachineEnder2)
|
||||
#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh
|
||||
#define PROBE_PT_1_Y 130
|
||||
#define PROBE_PT_2_X 100
|
||||
#define PROBE_PT_2_Y 130
|
||||
#define PROBE_PT_3_X 100
|
||||
#define PROBE_PT_3_Y 50
|
||||
#elif ANY(MachineEnder3, MachineEnder4, MachineEnder5, MachineCR20, MachineMini)
|
||||
#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh
|
||||
#define PROBE_PT_1_Y 180
|
||||
#define PROBE_PT_2_X 150
|
||||
#define PROBE_PT_2_Y 180
|
||||
#define PROBE_PT_3_X 150
|
||||
#define PROBE_PT_3_Y 50
|
||||
#elif (ENABLED(MachineCRX))
|
||||
#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh
|
||||
#define PROBE_PT_1_Y 250
|
||||
#define PROBE_PT_2_X 250
|
||||
#define PROBE_PT_2_Y 250
|
||||
#define PROBE_PT_3_X 250
|
||||
#define PROBE_PT_3_Y 50
|
||||
#elif (ENABLED(MachineCR10Std))
|
||||
#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh
|
||||
#define PROBE_PT_1_Y 270
|
||||
#define PROBE_PT_2_X 250
|
||||
#define PROBE_PT_2_Y 270
|
||||
#define PROBE_PT_3_X 250
|
||||
#define PROBE_PT_3_Y 50
|
||||
#elif (ENABLED(MachineEnder5Plus))
|
||||
#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh
|
||||
#define PROBE_PT_1_Y 320
|
||||
#define PROBE_PT_2_X 300
|
||||
#define PROBE_PT_2_Y 320
|
||||
#define PROBE_PT_3_X 300
|
||||
#define PROBE_PT_3_Y 50
|
||||
#elif ENABLED( MachineS4)
|
||||
#define PROBE_PT_1_X 60 // Probing points for 3-Point leveling of the mesh
|
||||
#define PROBE_PT_1_Y 340
|
||||
#define PROBE_PT_2_X 340
|
||||
#define PROBE_PT_2_Y 340
|
||||
#define PROBE_PT_3_X 340
|
||||
#define PROBE_PT_3_Y 60
|
||||
#elif ANY(MachineS5, MachineCR10Max)
|
||||
#define PROBE_PT_1_X 80 // Probing points for 3-Point leveling of the mesh
|
||||
#define PROBE_PT_1_Y 420
|
||||
#define PROBE_PT_2_X 420
|
||||
#define PROBE_PT_2_Y 420
|
||||
#define PROBE_PT_3_X 420
|
||||
#define PROBE_PT_3_Y 80
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Add a bed leveling sub-menu for ABL or MBL.
|
||||
@@ -2114,11 +2011,8 @@
|
||||
* Commands to execute at the end of G29 probing.
|
||||
* Useful to retract or move the Z probe out of the way.
|
||||
*/
|
||||
#if ENABLED(ABL_BLTOUCH)
|
||||
#define Z_PROBE_END_SCRIPT "M280 P0 S90"
|
||||
#else
|
||||
#define Z_PROBE_END_SCRIPT ""
|
||||
#endif
|
||||
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
|
||||
|
||||
|
||||
// @section homing
|
||||
|
||||
@@ -2424,10 +2318,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
|
||||
|
||||
@@ -2891,6 +2785,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'.
|
||||
@@ -2904,7 +2804,7 @@
|
||||
//=============================================================================
|
||||
|
||||
//
|
||||
// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.)
|
||||
// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
|
||||
//
|
||||
//#define FSMC_GRAPHICAL_TFT
|
||||
|
||||
@@ -2917,6 +2817,9 @@
|
||||
//
|
||||
//#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
|
||||
@@ -2927,11 +2830,8 @@
|
||||
// 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 ==============================
|
||||
@@ -3059,7 +2959,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 }
|
||||
|
||||
+281
-114
@@ -610,7 +610,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
|
||||
@@ -669,21 +669,8 @@
|
||||
|
||||
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
|
||||
|
||||
// @section lcd
|
||||
|
||||
#if EITHER(ULTIPANEL, EXTENSIBLE_UI)
|
||||
#define MANUAL_FEEDRATE { 5000, 4000, 250, 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
|
||||
|
||||
// @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
|
||||
#if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard))
|
||||
@@ -762,8 +749,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.
|
||||
@@ -791,9 +778,8 @@
|
||||
* vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
|
||||
* lowest stepping frequencies.
|
||||
*/
|
||||
#if ENABLED(SKR13)
|
||||
//#define ADAPTIVE_STEP_SMOOTHING
|
||||
#endif
|
||||
//#define ADAPTIVE_STEP_SMOOTHING
|
||||
|
||||
/**
|
||||
* Custom Microstepping
|
||||
* Override as-needed for your setup. Up to 3 MS pins are supported.
|
||||
@@ -861,6 +847,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)
|
||||
@@ -875,17 +870,37 @@
|
||||
#define FEEDRATE_CHANGE_BEEP_FREQUENCY 440
|
||||
#endif
|
||||
|
||||
// Include a page of printer information in the LCD Main Menu
|
||||
#if(DISABLED(MachineCR10Orig))
|
||||
#define LCD_INFO_MENU
|
||||
#endif
|
||||
#if ENABLED(LCD_INFO_MENU)
|
||||
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
|
||||
#endif
|
||||
// Leave out seldom-used LCD menu items to recover some Program Memory
|
||||
#if(ENABLED(MachineCR10Orig) || ENABLED(LowMemoryBoard))
|
||||
#define SLIM_LCD_MENUS
|
||||
#endif
|
||||
#if HAS_LCD_MENU
|
||||
|
||||
// Include a page of printer information in the LCD Main Menu
|
||||
#if(DISABLED(MachineCR10Orig))
|
||||
#define LCD_INFO_MENU
|
||||
#endif
|
||||
#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
|
||||
#if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard))
|
||||
@@ -901,10 +916,8 @@
|
||||
#if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard))
|
||||
#define LCD_SET_PROGRESS_MANUALLY
|
||||
#endif
|
||||
#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#if((ENABLED(MachineEnder4) && DISABLED(GraphicLCD)))
|
||||
#define LCD_PROGRESS_BAR
|
||||
#endif// Show a progress bar on HD44780 LCDs for SD printing
|
||||
#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)
|
||||
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
|
||||
#define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message
|
||||
@@ -912,24 +925,7 @@
|
||||
//#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it
|
||||
//#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar
|
||||
#endif
|
||||
#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY
|
||||
|
||||
/**
|
||||
* 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
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
@@ -969,6 +965,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.
|
||||
|
||||
@@ -1050,17 +1047,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
|
||||
|
||||
/**
|
||||
@@ -1092,7 +1103,7 @@
|
||||
*
|
||||
* :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ]
|
||||
*/
|
||||
#define SDCARD_CONNECTION ONBOARD
|
||||
//#define SDCARD_CONNECTION LCD
|
||||
#endif
|
||||
|
||||
#endif // SDSUPPORT
|
||||
@@ -1174,6 +1185,7 @@
|
||||
#define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating
|
||||
#define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating
|
||||
#endif
|
||||
#define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating
|
||||
//#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap
|
||||
//#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap
|
||||
//#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames
|
||||
@@ -1190,6 +1202,101 @@
|
||||
#endif
|
||||
#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
|
||||
|
||||
/**
|
||||
@@ -1277,37 +1384,44 @@
|
||||
|
||||
// @section leveling
|
||||
|
||||
#if ENABLED(MESH_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 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
|
||||
|
||||
#if( (X_PROBE_OFFSET_FROM_EXTRUDER + 15) > 0 )
|
||||
#define MESH_MIN_X (X_PROBE_OFFSET_FROM_EXTRUDER + 5)
|
||||
#else
|
||||
#define MESH_MIN_X 10
|
||||
#endif
|
||||
|
||||
#if( (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - 10) < X_BED_SIZE)
|
||||
#define MESH_MAX_X (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - 5)
|
||||
#else
|
||||
#if(ENABLED(MachineEnder3))
|
||||
#define MESH_MAX_X (X_BED_SIZE - 40)
|
||||
#else
|
||||
#define MESH_MAX_X (X_BED_SIZE - 10)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ( (Y_PROBE_OFFSET_FROM_EXTRUDER + 25) > 10 )
|
||||
#define MESH_MIN_Y (Y_PROBE_OFFSET_FROM_EXTRUDER + 25)
|
||||
#else
|
||||
#define MESH_MIN_Y 25
|
||||
#endif
|
||||
|
||||
#if( (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 25) < Y_BED_SIZE)
|
||||
#define MESH_MAX_Y (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 25)
|
||||
#else
|
||||
#define MESH_MAX_Y (Y_BED_SIZE - 25)
|
||||
#endif
|
||||
|
||||
//#define MESH_MIN_X MESH_INSET
|
||||
//#define MESH_MIN_Y MESH_INSET
|
||||
//#define MESH_MAX_X X_BED_SIZE - (MESH_INSET)
|
||||
@@ -1370,7 +1484,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
|
||||
@@ -1382,7 +1496,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)
|
||||
@@ -1527,19 +1642,19 @@
|
||||
#define FWRETRACT
|
||||
#endif
|
||||
#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
|
||||
@@ -1749,78 +1864,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 0 // 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 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Y)
|
||||
#define Y_CURRENT 800
|
||||
#define Y_MICROSTEPS 16
|
||||
#define Y_RSENSE 0.11
|
||||
#define Y_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Y2)
|
||||
#define Y2_CURRENT 800
|
||||
#define Y2_MICROSTEPS 16
|
||||
#define Y2_RSENSE 0.11
|
||||
#define Y2_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z)
|
||||
#define Z_CURRENT 800
|
||||
#define Z_MICROSTEPS 16
|
||||
#define Z_RSENSE 0.11
|
||||
#define Z_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z2)
|
||||
#define Z2_CURRENT 800
|
||||
#define Z2_MICROSTEPS 16
|
||||
#define Z2_RSENSE 0.11
|
||||
#define Z2_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z3)
|
||||
#define Z3_CURRENT 800
|
||||
#define Z3_MICROSTEPS 16
|
||||
#define Z3_RSENSE 0.11
|
||||
#define Z3_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0)
|
||||
#define E0_CURRENT 800
|
||||
#define E0_MICROSTEPS 16
|
||||
#define E0_RSENSE 0.11
|
||||
#define E0_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E1)
|
||||
#define E1_CURRENT 800
|
||||
#define E1_MICROSTEPS 16
|
||||
#define E1_RSENSE 0.11
|
||||
#define E1_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E2)
|
||||
#define E2_CURRENT 800
|
||||
#define E2_MICROSTEPS 16
|
||||
#define E2_RSENSE 0.11
|
||||
#define E2_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E3)
|
||||
#define E3_CURRENT 800
|
||||
#define E3_MICROSTEPS 16
|
||||
#define E3_RSENSE 0.11
|
||||
#define E3_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E4)
|
||||
#define E4_CURRENT 800
|
||||
#define E4_MICROSTEPS 16
|
||||
#define E4_RSENSE 0.11
|
||||
#define E4_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E5)
|
||||
#define E5_CURRENT 800
|
||||
#define E5_MICROSTEPS 16
|
||||
#define E5_RSENSE 0.11
|
||||
#define E5_CHAIN_POS 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1953,17 +2081,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
|
||||
|
||||
@@ -1978,8 +2116,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
|
||||
|
||||
/**
|
||||
@@ -2336,6 +2477,13 @@
|
||||
#if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard))
|
||||
#define EXTENDED_CAPABILITIES_REPORT
|
||||
#endif
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@@ -2392,6 +2540,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
|
||||
*
|
||||
@@ -2430,7 +2585,7 @@
|
||||
#endif
|
||||
|
||||
#define USER_DESC_2 "PID Tune"
|
||||
#define USER_GCODE_2 "M106 S128 \n M303 C8 S215 E1 U \n M500 \n M117 PID Tune Done"
|
||||
#define USER_GCODE_2 "M106 S128 \n M303 C8 S215 E0 U \n M500 \n M117 PID Tune Done"
|
||||
|
||||
#define USER_DESC_3 "Prep for Z Adjust"
|
||||
#define USER_GCODE_3 "M190S" CommBedTmp "\nM104S215\nG28\nG29L1\nG1 X100Y100F5000\nG1Z0"
|
||||
@@ -2461,10 +2616,6 @@
|
||||
#define HOST_PROMPT_SUPPORT
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
//====================== I2C Position Encoder Settings ======================
|
||||
//===========================================================================
|
||||
|
||||
/**
|
||||
* I2C position encoders for closed loop control.
|
||||
* Developed by Chris Barr at Aus3D.
|
||||
@@ -2545,6 +2696,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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -105,19 +105,19 @@ 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
|
||||
|
||||
@@ -199,9 +199,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 */ \
|
||||
@@ -268,13 +268,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 */ \
|
||||
@@ -334,7 +334,7 @@ void TIMER0_COMPB_vect (void) { \
|
||||
: \
|
||||
); \
|
||||
} \
|
||||
void TIMER0_COMPB_vect_bottom(void)
|
||||
void TIMER0_COMPB_vect_bottom()
|
||||
|
||||
// ADC
|
||||
#ifdef DIDR2
|
||||
@@ -343,7 +343,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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -59,8 +59,8 @@ 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
|
||||
};
|
||||
@@ -70,8 +70,8 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
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
|
||||
};
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -88,11 +88,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
|
||||
void HAL_clear_reset_source(); // clear reset reason
|
||||
uint8_t HAL_get_reset_source(); // get reset reason
|
||||
|
||||
//
|
||||
// EEPROM
|
||||
@@ -113,14 +113,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
|
||||
@@ -138,8 +138,8 @@ 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
|
||||
@@ -148,7 +148,7 @@ void _delay_ms(const int delay);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
int freeMemory(void);
|
||||
int freeMemory();
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -428,7 +428,7 @@
|
||||
|
||||
static void spiTxBlockX(const uint8_t* buf, uint32_t todo) {
|
||||
do {
|
||||
(void) spiTransferTx(*buf++);
|
||||
(void)spiTransferTx(*buf++);
|
||||
} while (--todo);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -62,7 +62,7 @@ void MarlinSerialUSB::begin(const long baud_setting) {
|
||||
void MarlinSerialUSB::end() {
|
||||
}
|
||||
|
||||
int MarlinSerialUSB::peek(void) {
|
||||
int MarlinSerialUSB::peek() {
|
||||
if (pending_char >= 0)
|
||||
return pending_char;
|
||||
|
||||
@@ -83,7 +83,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 +107,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 +115,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 +186,7 @@ void MarlinSerialUSB::print(double n, int digits) {
|
||||
printFloat(n, digits);
|
||||
}
|
||||
|
||||
void MarlinSerialUSB::println(void) {
|
||||
void MarlinSerialUSB::println() {
|
||||
print('\r');
|
||||
print('\n');
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -44,7 +44,7 @@ bool PersistentStore::access_finish() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||
while (size--) {
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
uint8_t v = *value;
|
||||
|
||||
@@ -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,7 +27,7 @@ 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;
|
||||
@@ -38,12 +38,12 @@ bool sd_mmc_spi_unload(bool unload) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool sd_mmc_spi_wr_protect(void) {
|
||||
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())
|
||||
bool sd_mmc_spi_removal() {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -62,7 +62,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 +99,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
//@}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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); }
|
||||
|
||||
|
||||
@@ -85,16 +85,16 @@ 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);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
int freeMemory(void);
|
||||
int freeMemory();
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
void analogWrite(pin_t pin, int value);
|
||||
@@ -108,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
|
||||
@@ -123,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();
|
||||
|
||||
@@ -80,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();
|
||||
|
||||
@@ -32,25 +32,25 @@
|
||||
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
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ bool PersistentStore::access_finish() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||
if (!eeprom_file.seek(pos)) return true; // return true for any error
|
||||
if (eeprom_file.write(value, size) != size) return true;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
// ------------------------
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
void watchdogSetup(void) {
|
||||
void watchdogSetup() {
|
||||
// do whatever. don't remove this function.
|
||||
}
|
||||
|
||||
void watchdog_init(void) {
|
||||
void watchdog_init() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -78,12 +78,12 @@ extern HalSerial usb_serial;
|
||||
#define ENABLE_ISRS()
|
||||
#define DISABLE_ISRS()
|
||||
|
||||
inline void HAL_init(void) { }
|
||||
inline void HAL_init() { }
|
||||
|
||||
// Utility functions
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
int freeMemory(void);
|
||||
int freeMemory();
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// ADC
|
||||
@@ -92,10 +92,10 @@ int freeMemory(void);
|
||||
#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();
|
||||
|
||||
/* ---------------- 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) {
|
||||
|
||||
@@ -63,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);
|
||||
|
||||
@@ -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 */ }
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,19 @@
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
void watchdog_init(void) {}
|
||||
void watchdog_init() {}
|
||||
|
||||
void HAL_clear_reset_source(void) {}
|
||||
void HAL_clear_reset_source() {}
|
||||
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
uint8_t HAL_get_reset_source() {
|
||||
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; }
|
||||
void HAL_clear_reset_source() {}
|
||||
uint8_t HAL_get_reset_source() { return RST_POWER_ON; }
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
#endif // __PLAT_LINUX__
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#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 watchdog_reset();
|
||||
void HAL_clear_reset_source();
|
||||
uint8_t HAL_get_reset_source();
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
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) {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#define CPU_32_BIT
|
||||
|
||||
void HAL_init(void);
|
||||
void HAL_init();
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
@@ -113,7 +113,7 @@ extern "C" volatile uint32_t _millis;
|
||||
//
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
int freeMemory(void);
|
||||
int freeMemory();
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
//
|
||||
@@ -144,7 +144,7 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
|
||||
#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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -42,11 +42,11 @@ extern "C" {
|
||||
|
||||
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,7 +149,7 @@ 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.
|
||||
@@ -158,7 +158,7 @@ void HAL_idletask(void) {
|
||||
// the disk if Marlin has it mounted. Unfortuately 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();
|
||||
|
||||
@@ -109,7 +109,7 @@ bool PersistentStore::access_finish() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||
for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i];
|
||||
eeprom_dirty = true;
|
||||
crc16(crc, value, size);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "timers.h"
|
||||
|
||||
void HAL_timer_init(void) {
|
||||
void HAL_timer_init() {
|
||||
SBI(LPC_SC->PCONP, SBIT_TIMER0); // Power ON Timer 0
|
||||
LPC_TIM0->PR = (HAL_TIMER_RATE) / (STEPPER_TIMER_RATE) - 1; // Use prescaler to set frequency if needed
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
#define _HAL_TIMER(T) _CAT(LPC_TIM, T)
|
||||
#define _HAL_TIMER_IRQ(T) TIMER##T##_IRQn
|
||||
#define __HAL_TIMER_ISR(T) extern "C" void TIMER##T##_IRQHandler(void)
|
||||
#define __HAL_TIMER_ISR(T) extern "C" void TIMER##T##_IRQHandler()
|
||||
#define _HAL_TIMER_ISR(T) __HAL_TIMER_ISR(T)
|
||||
|
||||
typedef uint32_t hal_timer_t;
|
||||
@@ -94,7 +94,7 @@ typedef uint32_t hal_timer_t;
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// ------------------------
|
||||
void HAL_timer_init(void);
|
||||
void HAL_timer_init();
|
||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
||||
|
||||
FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
|
||||
|
||||
@@ -163,7 +163,7 @@ uint8_t u8g_i2c_send_byte(uint8_t data) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void u8g_i2c_stop(void) {
|
||||
void u8g_i2c_stop() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,4 +25,4 @@ void u8g_i2c_init(uint8_t options);
|
||||
uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos);
|
||||
uint8_t u8g_i2c_start(uint8_t sla);
|
||||
uint8_t u8g_i2c_send_byte(uint8_t data);
|
||||
void u8g_i2c_stop(void);
|
||||
void u8g_i2c_stop();
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
#endif
|
||||
|
||||
void U8g_delay(int msec);
|
||||
void u8g_MicroDelay(void);
|
||||
void u8g_10MicroDelay(void);
|
||||
void u8g_MicroDelay();
|
||||
void u8g_10MicroDelay();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ uint8_t u8g_i2c_start_sw(uint8_t sla) { // assert start condition and then send
|
||||
}
|
||||
|
||||
|
||||
void u8g_i2c_stop_sw(void) { }
|
||||
void u8g_i2c_stop_sw() { }
|
||||
|
||||
void u8g_i2c_init_sw(uint8_t clock_option) { u8g_i2c_start(0); } // send slave address and write bit
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "lpc17xx_wdt.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
void watchdog_init(void) {
|
||||
void watchdog_init() {
|
||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||
// We enable the watchdog timer, but only for the interrupt.
|
||||
|
||||
@@ -56,11 +56,11 @@ void watchdog_init(void) {
|
||||
WDT_Start(WDT_TIMEOUT);
|
||||
}
|
||||
|
||||
void HAL_clear_reset_source(void) {
|
||||
void HAL_clear_reset_source() {
|
||||
WDT_ClrTimeOutFlag();
|
||||
}
|
||||
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
uint8_t HAL_get_reset_source() {
|
||||
if (TEST(WDT_ReadTimeOutFlag(), 0)) return RST_WATCHDOG;
|
||||
return RST_POWER_ON;
|
||||
}
|
||||
@@ -74,10 +74,10 @@ void watchdog_reset() {
|
||||
|
||||
#else
|
||||
|
||||
void watchdog_init(void) {}
|
||||
void watchdog_reset(void) {}
|
||||
void HAL_clear_reset_source(void) {}
|
||||
uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
|
||||
void watchdog_init() {}
|
||||
void watchdog_reset() {}
|
||||
void HAL_clear_reset_source() {}
|
||||
uint8_t HAL_get_reset_source() { return RST_POWER_ON; }
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#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 watchdog_reset();
|
||||
void HAL_clear_reset_source();
|
||||
uint8_t HAL_get_reset_source();
|
||||
|
||||
@@ -368,12 +368,13 @@ uint16_t HAL_adc_result;
|
||||
// ------------------------
|
||||
|
||||
// HAL initialization task
|
||||
void HAL_init(void) {
|
||||
void HAL_init() {
|
||||
#if DMA_IS_REQUIRED
|
||||
dma_init();
|
||||
#endif
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT) // SD_DETECT_PIN may be remove when NO_SD_HOST_DRIVE is not defined in configuration_adv
|
||||
// SD_DETECT_PIN may be removed if NO_SD_HOST_DRIVE is not defined in Configuration_adv.h
|
||||
#if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT)
|
||||
SET_INPUT_PULLUP(SD_DETECT_PIN);
|
||||
#endif
|
||||
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
|
||||
@@ -382,15 +383,15 @@ void HAL_init(void) {
|
||||
|
||||
// HAL idle task
|
||||
/*
|
||||
void HAL_idletask(void) {
|
||||
void HAL_idletask() {
|
||||
}
|
||||
*/
|
||||
|
||||
void HAL_clear_reset_source(void) { }
|
||||
void HAL_clear_reset_source() { }
|
||||
|
||||
#pragma push_macro("WDT")
|
||||
#undef WDT // Required to be able to use '.bit.WDT'. Compiler wrongly replace struct field with WDT define
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
uint8_t HAL_get_reset_source() {
|
||||
RSTC_RCAUSE_Type resetCause;
|
||||
|
||||
resetCause.reg = REG_RSTC_RCAUSE;
|
||||
@@ -420,7 +421,7 @@ int freeMemory() {
|
||||
// ADC
|
||||
// ------------------------
|
||||
|
||||
void HAL_adc_init(void) {
|
||||
void HAL_adc_init() {
|
||||
#if ADC_IS_REQUIRED
|
||||
memset(HAL_adc_results, 0xFF, sizeof(HAL_adc_results)); // Fill result with invalid values
|
||||
|
||||
@@ -468,7 +469,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
|
||||
HAL_adc_result = 0xFFFF;
|
||||
}
|
||||
|
||||
uint16_t HAL_adc_get_result(void) {
|
||||
uint16_t HAL_adc_get_result() {
|
||||
return HAL_adc_result;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,8 +91,8 @@ typedef int8_t pin_t;
|
||||
#define cli() __disable_irq() // Disable interrupts
|
||||
#define sei() __enable_irq() // Enable interrupts
|
||||
|
||||
void HAL_clear_reset_source(void); // clear reset reason
|
||||
uint8_t HAL_get_reset_source(void); // get reset reason
|
||||
void HAL_clear_reset_source(); // clear reset reason
|
||||
uint8_t HAL_get_reset_source(); // get reset reason
|
||||
|
||||
//
|
||||
// EEPROM
|
||||
@@ -107,14 +107,14 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion
|
||||
|
||||
#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
|
||||
#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
|
||||
@@ -131,10 +131,10 @@ void tone(const pin_t _pin, const unsigned int frequency, const unsigned long du
|
||||
void noTone(const pin_t _pin);
|
||||
|
||||
// Enable hooks into idle and setup for HAL
|
||||
void HAL_init(void);
|
||||
void HAL_init();
|
||||
/*
|
||||
#define HAL_IDLETASK 1
|
||||
void HAL_idletask(void);
|
||||
void HAL_idletask();
|
||||
*/
|
||||
|
||||
//
|
||||
@@ -144,7 +144,7 @@ FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
int freeMemory(void);
|
||||
int freeMemory();
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
// ------------------------
|
||||
// Hardware SPI
|
||||
// ------------------------
|
||||
void spiBegin(void) {
|
||||
void spiBegin() {
|
||||
spiInit(SPI_HALF_SPEED);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
*
|
||||
* @details
|
||||
*/
|
||||
uint8_t spiRec(void) {
|
||||
uint8_t spiRec() {
|
||||
sdSPI.beginTransaction(spiConfig);
|
||||
uint8_t returnByte = sdSPI.transfer(0xFF);
|
||||
sdSPI.endTransaction();
|
||||
|
||||
@@ -112,9 +112,9 @@
|
||||
&& !MATCH_Z_MIN_PROBE_EILINE(P))
|
||||
|
||||
// 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() {
|
||||
#if HAS_X_MAX
|
||||
#if !AVAILABLE_EILINE(X_MAX_PIN)
|
||||
static_assert(false, "X_MAX_PIN has no EXTINT line available.");
|
||||
|
||||
@@ -58,7 +58,7 @@ bool PersistentStore::access_finish() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||
#if NONE(SPI_EEPROM, I2C_EEPROM)
|
||||
if (NVMCTRL->SEESTAT.bit.RLOCK)
|
||||
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
void watchdog_init(void) {
|
||||
void watchdog_init() {
|
||||
// The low-power oscillator used by the WDT runs at 32,768 Hz with
|
||||
// a 1:32 prescale, thus 1024 Hz, though probably not super precise.
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ uint16_t HAL_adc_result;
|
||||
#endif
|
||||
|
||||
// HAL initialization task
|
||||
void HAL_init(void) {
|
||||
void HAL_init() {
|
||||
FastIO_init();
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
@@ -84,9 +84,9 @@ void HAL_init(void) {
|
||||
#endif // EEPROM_EMULATED_SRAM
|
||||
}
|
||||
|
||||
void HAL_clear_reset_source(void) { __HAL_RCC_CLEAR_RESET_FLAGS(); }
|
||||
void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
|
||||
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
uint8_t HAL_get_reset_source() {
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG;
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) return RST_SOFTWARE;
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) return RST_EXTERNAL;
|
||||
@@ -108,8 +108,13 @@ 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() {
|
||||
return HAL_adc_result;
|
||||
}
|
||||
|
||||
void flashFirmware(int16_t value) {
|
||||
UNUSED(value);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
||||
|
||||
@@ -147,13 +147,13 @@ extern uint16_t HAL_adc_result;
|
||||
#define __bss_end __bss_end__
|
||||
|
||||
// Enable hooks into setup for HAL
|
||||
void HAL_init(void);
|
||||
void HAL_init();
|
||||
|
||||
// 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(const int delay);
|
||||
|
||||
@@ -185,7 +185,7 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n);
|
||||
|
||||
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
|
||||
|
||||
inline void HAL_adc_init(void) {}
|
||||
inline void HAL_adc_init() {}
|
||||
|
||||
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
||||
#define HAL_READ_ADC() HAL_adc_result
|
||||
@@ -193,8 +193,11 @@ inline void HAL_adc_init(void) {}
|
||||
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
||||
|
||||
uint16_t HAL_adc_get_result(void);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
#define GET_PIN_MAP_PIN(index) index
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
#define PLATFORM_M997_SUPPORT
|
||||
void flashFirmware(int16_t value);
|
||||
|
||||
@@ -59,7 +59,7 @@ static SPISettings spiConfig;
|
||||
*
|
||||
* @details Only configures SS pin since stm32duino creates and initialize the SPI object
|
||||
*/
|
||||
void spiBegin(void) {
|
||||
void spiBegin() {
|
||||
#if !PIN_EXISTS(SS)
|
||||
#error "SS_PIN not defined!"
|
||||
#endif
|
||||
@@ -93,7 +93,7 @@ void spiInit(uint8_t spiRate) {
|
||||
*
|
||||
* @details
|
||||
*/
|
||||
uint8_t spiRec(void) {
|
||||
uint8_t spiRec() {
|
||||
SPI.beginTransaction(spiConfig);
|
||||
uint8_t returnByte = SPI.transfer(0xFF);
|
||||
SPI.endTransaction();
|
||||
|
||||
@@ -31,24 +31,24 @@
|
||||
uint8_t servoPin[MAX_SERVOS] = { 0 };
|
||||
|
||||
int8_t libServo::attach(const int pin) {
|
||||
if (this->servoIndex >= MAX_SERVOS) return -1;
|
||||
if (pin > 0) servoPin[this->servoIndex] = pin;
|
||||
return Servo::attach(servoPin[this->servoIndex]);
|
||||
if (servoIndex >= MAX_SERVOS) return -1;
|
||||
if (pin > 0) servoPin[servoIndex] = pin;
|
||||
return super::attach(servoPin[servoIndex]);
|
||||
}
|
||||
|
||||
int8_t libServo::attach(const int pin, const int min, const int max) {
|
||||
if (pin > 0) servoPin[this->servoIndex] = pin;
|
||||
return Servo::attach(servoPin[this->servoIndex], min, max);
|
||||
if (pin > 0) servoPin[servoIndex] = pin;
|
||||
return super::attach(servoPin[servoIndex], min, max);
|
||||
}
|
||||
|
||||
void libServo::move(const int value) {
|
||||
constexpr uint16_t servo_delay[] = SERVO_DELAY;
|
||||
static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
|
||||
if (this->attach(0) >= 0) {
|
||||
this->write(value);
|
||||
safe_delay(servo_delay[this->servoIndex]);
|
||||
if (attach(0) >= 0) {
|
||||
write(value);
|
||||
safe_delay(servo_delay[servoIndex]);
|
||||
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
|
||||
this->detach();
|
||||
detach();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ class libServo : public Servo {
|
||||
int8_t attach(const int pin, const int min, const int max);
|
||||
void move(const int value);
|
||||
private:
|
||||
typedef Servo super;
|
||||
uint16_t min_ticks, max_ticks;
|
||||
uint8_t servoIndex; // index into the channel data for this servo
|
||||
};
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
#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() {
|
||||
#if HAS_X_MAX
|
||||
attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE);
|
||||
#endif
|
||||
|
||||
@@ -50,7 +50,7 @@ bool PersistentStore::access_finish() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||
while (size--) {
|
||||
uint8_t v = *value;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
|
||||
#define EEPROM_FILENAME "eeprom.dat"
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
if (!card.isDetected()) return false;
|
||||
if (!card.isMounted()) return false;
|
||||
|
||||
SdFile file, root = card.getroot();
|
||||
if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
|
||||
@@ -62,7 +62,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
if (!card.isDetected()) return false;
|
||||
if (!card.isMounted()) return false;
|
||||
|
||||
SdFile file, root = card.getroot();
|
||||
int bytes_written = 0;
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
|
||||
#if (!defined(SERIAL_USB) && !defined(USE_USB_COMPOSITE))
|
||||
#if (defined(SERIAL_USB) && !defined(USE_USB_COMPOSITE))
|
||||
USBSerial SerialUSB;
|
||||
#endif
|
||||
|
||||
@@ -201,16 +201,16 @@ static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) {
|
||||
#if SERIAL_PORT > 0
|
||||
#if SERIAL_PORT2
|
||||
#if SERIAL_PORT2 > 0
|
||||
void board_setup_usb(void) {}
|
||||
void board_setup_usb() {}
|
||||
#endif
|
||||
#else
|
||||
void board_setup_usb(void) {}
|
||||
void board_setup_usb() {}
|
||||
#endif
|
||||
#endif
|
||||
} }
|
||||
#endif
|
||||
|
||||
void HAL_init(void) {
|
||||
void HAL_init() {
|
||||
NVIC_SetPriorityGrouping(0x3);
|
||||
#if PIN_EXISTS(LED)
|
||||
OUT_WRITE(LED_PIN, LOW);
|
||||
@@ -226,7 +226,7 @@ void HAL_init(void) {
|
||||
}
|
||||
|
||||
// HAL idle task
|
||||
void HAL_idletask(void) {
|
||||
void HAL_idletask() {
|
||||
#ifdef USE_USB_COMPOSITE
|
||||
#if ENABLED(SHARED_SD_CARD)
|
||||
// If Marlin is using the SD card we need to lock it to prevent access from
|
||||
@@ -245,19 +245,19 @@ void HAL_idletask(void) {
|
||||
|
||||
/* VGPV Done with defines
|
||||
// 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() { }
|
||||
|
||||
/**
|
||||
* TODO: Check this and change or remove.
|
||||
* currently returns 1 that's equal to poweron reset.
|
||||
*/
|
||||
uint8_t HAL_get_reset_source(void) { return 1; }
|
||||
uint8_t HAL_get_reset_source() { return 1; }
|
||||
|
||||
void _delay_ms(const int delay_ms) { delay(delay_ms); }
|
||||
|
||||
@@ -297,7 +297,7 @@ extern "C" {
|
||||
// ADC
|
||||
// ------------------------
|
||||
// Init the AD in continuous capture mode
|
||||
void HAL_adc_init(void) {
|
||||
void HAL_adc_init() {
|
||||
// configure the ADC
|
||||
adc.calibrate();
|
||||
#if F_CPU > 72000000
|
||||
@@ -356,7 +356,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
|
||||
HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only.
|
||||
}
|
||||
|
||||
uint16_t HAL_adc_get_result(void) { return HAL_adc_result; }
|
||||
uint16_t HAL_adc_get_result() { return HAL_adc_result; }
|
||||
|
||||
uint16_t analogRead(pin_t pin) {
|
||||
const bool is_analog = _GET_MODE(pin) == GPIO_INPUT_ANALOG;
|
||||
@@ -369,4 +369,6 @@ void analogWrite(pin_t pin, int pwm_val8) {
|
||||
analogWrite(uint8_t(pin), pwm_val8);
|
||||
}
|
||||
|
||||
void flashFirmware(int16_t value) { nvic_sys_reset(); }
|
||||
|
||||
#endif // __STM32F1__
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user