Compare commits

...

224 Commits

Author SHA1 Message Date
Scott Lahteine
8eb6603e2a Version 2.0.3 2020-01-30 19:08:05 -06:00
Scott Lahteine
caf9e93465 More files from errant merge 2020-01-30 19:08:01 -06:00
Scott Lahteine
d74f46243b Merge remote-tracking branch 'upstream/bugfix-2.0.x' into version_203 2020-01-30 19:07:46 -06:00
thinkyhead
dabf393920 [cron] Bump distribution date (2020-01-31) 2020-01-31 00:06:46 +00:00
Artur Petrzak
e4679c1b78 (21) PT100 for MCUs with 3.3v logic (#16731) 2020-01-30 18:00:37 -06:00
Scott Lahteine
62f52ebb3a Fix up, improve endstop pin auto-assignment
Followup for #16723
2020-01-30 14:09:33 -06:00
Scott Lahteine
e8e25b80d1 Extend RX/TX pins for up to 8 extruders 2020-01-30 13:29:19 -06:00
Robert Stein
2822c0890a Set up DIAG endstops for BTT SKR 1.4 / 1.4 Turbo (#16727) 2020-01-30 13:17:15 -06:00
Alexander Gavrilenko
c45d6b2017 Simultaneous use of rotary encoder and touch buttons (#16729) 2020-01-30 12:29:30 -06:00
felixstorm
8d4dd88bf9 Fix compile error in SdVolume on ESP32 (#16728) 2020-01-30 12:22:42 -06:00
Scott Lahteine
3c9464eea4 Tweak G60/G61 slots 2020-01-30 03:25:40 -06:00
Scott Lahteine
5b12627e14 Auto assign DIAG pins for multi-endstop (#16723) 2020-01-30 03:24:57 -06:00
Scott Lahteine
9caf5c05e7 Refactor heater watch, job timer auto-start (#16725) 2020-01-30 03:24:43 -06:00
Scott Lahteine
50889c0f94 Move L64XX index_to_axis to progmem (#16697) 2020-01-30 03:24:23 -06:00
chgi
99b6a132bc Fix G60/G61 slots > 8 and compile error (#16715) 2020-01-30 03:18:45 -06:00
Radek Pietruszewski
e6a675e6ec Fix missing string for M48 build (#16708) 2020-01-30 03:13:31 -06:00
Mauro
1bc6509d02 Support for E4d@BOX mainboard (#16716) 2020-01-30 03:06:17 -06:00
Neskik
1db9d9f76f Fix probe temp calibration (#16718) 2020-01-30 03:00:38 -06:00
Scott Lahteine
4d8dc093c9 Version 2.0.2 2020-01-29 23:19:24 -06:00
Roxy-3D
11d8c72ac5 Fix a merge error 2020-01-29 23:19:24 -06:00
0r31
8737c35ded Fix HAS_FAN macro (#16717) 2020-01-29 22:48:26 -06:00
Scott Lahteine
e8ed4329ea Cleanup of old includes, add comments 2020-01-29 22:41:18 -06:00
thinkyhead
a5f72330fb [cron] Bump distribution date (2020-01-30) 2020-01-30 00:06:48 +00:00
InsanityAutomation
9bb8176d34 Fix Toolchange (!no_move) return to status (#16699) 2020-01-29 00:06:06 -06:00
thinkyhead
9b45f342ee [cron] Bump distribution date (2020-01-29) 2020-01-29 00:07:02 +00:00
felixstorm
e4eaf32b4d Prevent SD access from resetting ESP32 (#16690) 2020-01-27 18:16:43 -06:00
thinkyhead
0c3cae59d9 [cron] Bump distribution date (2020-01-28) 2020-01-28 00:06:59 +00:00
Jason Smith
131acf304b Fix Manual Bed Leveling with multiple extruders (#16688) 2020-01-27 15:57:21 -06:00
Scott Lahteine
ec79034004 Remove extraneous G60/G61 lines 2020-01-27 15:41:50 -06:00
Scott Lahteine
8bd6b60a01 Remove extraneous G60/G61 lines 2020-01-27 15:40:25 -06:00
Scott Lahteine
ae2a0036eb Merge remote-tracking branch 'upstream/bugfix-2.0.x' into release_202 2020-01-27 05:32:36 -06:00
Hans007a
e2eef1256a G60/G61 Position Save/Restore (#16557) 2020-01-26 23:19:05 -06:00
Robby Candra
a0a93e35ae Fix serial port redirection (index ≠ port num) (#16687) 2020-01-26 22:46:26 -06:00
Scott Lahteine
2325bede8a Fix Trigorilla 1.4 limit switches
See #16612
2020-01-26 21:08:55 -06:00
Scott Lahteine
56cd747c8b Rename some temperature members 2020-01-26 21:08:55 -06:00
Robby Candra
48098b1675 Preserve CWD for write/remove file (#16667) 2020-01-26 18:34:17 -06:00
thinkyhead
f6a6704b66 [cron] Bump distribution date (2020-01-27) 2020-01-27 00:06:35 +00:00
Scott Lahteine
5e3e8fcdb9 Fix PID F menu label 2020-01-26 17:07:18 -06:00
ellensp
0949c0f326 SKR 1.3 sensorless endstops hack (#16659) 2020-01-26 03:49:11 -06:00
Giuliano Zaro
81f31efaee Fix Spanish (swapped BLTouch strings) (#16637) 2020-01-26 03:34:58 -06:00
ellensp
c49e987b1e Fix M43 timer report on AVR (#16645) 2020-01-26 03:33:35 -06:00
Roman Moravčík
3572fa22a0 Update Slovak language (#16646) 2020-01-26 03:27:08 -06:00
Scott Lahteine
1d1dc8e339 More 8 extruder defines 2020-01-26 03:24:54 -06:00
Scott Lahteine
bbfbcb8a5d Clean up PID language defines 2020-01-26 03:24:54 -06:00
Jason Smith
44d400db83 Fix HOMING_BACKOFF_MM for DELTA (#16657) 2020-01-26 03:16:03 -06:00
ellensp
4a71285c34 Fix Serial defines for M43 on AVR (#16649) 2020-01-26 03:05:34 -06:00
Luc
6357619ab2 Add ESP3DLib idletask entry point (#16658) 2020-01-26 01:11:30 -06:00
0r31
e3611ad209 Fix MKS Base + Digipot compile error (#16636) 2020-01-26 01:08:40 -06:00
Jason Smith
95d5a0c480 Fix DELTA_CALIBRATION_MENU recursive call (#16656) 2020-01-26 00:02:06 -06:00
thinkyhead
838a420e27 [cron] Bump distribution date (2020-01-26) 2020-01-26 00:06:19 +00:00
yangwenxiong
248b7dfa59 BigTreeTech GTR V1.0 / Support 8 extruders, heaters, temp sensors, fans (#16595) 2020-01-25 02:13:39 -06:00
Bob Kuhn
0d166f9c7d Duet Smart Effector support (#16641) 2020-01-25 02:00:51 -06:00
Scott Lahteine
86c18ea6e0 Bring configs and drivers.h up to date 2020-01-24 23:17:52 -06:00
Scott Lahteine
b7a67f6f74 Extra debugging for leveling on/off 2020-01-24 23:17:49 -06:00
Scott Lahteine
1c042bbaea Convert chars only for enabled languages 2020-01-24 15:12:04 -06:00
thinkyhead
899db41a5c [cron] Bump distribution date (2020-01-24) 2020-01-24 00:07:21 +00:00
Artur Petrzak
2ef6b86ccd Enable use of latest TMCStepper on MKS Robin Nano (#16652) 2020-01-22 21:52:16 -06:00
thinkyhead
342f65eb8e [cron] Bump distribution date (2020-01-23) 2020-01-23 00:07:18 +00:00
Scott Lahteine
0eae26a7be Tweak mfpub stashing 2020-01-22 01:54:31 -06:00
thinkyhead
fd346c6cd1 [cron] Bump distribution date (2020-01-22) 2020-01-22 00:07:17 +00:00
Scott Lahteine
d3a8a81756 Update mfdoc, mfpub 2020-01-21 05:21:49 -06:00
Ryan
b7f86bffd5 Arc segment radius scaling (#16551) 2020-01-21 02:53:26 -06:00
InsanityAutomation
79810b7fcb G12 defaults per tool. Event G-code for post-toolchange (#16554) 2020-01-21 02:51:23 -06:00
Scott Lahteine
84c874c53b Tweak some config spacing 2020-01-21 02:43:34 -06:00
MaukCC
04d64351a2 Add HMS434 V15 ATSAM board (#16620) 2020-01-21 01:10:31 -06:00
Tanguy Pruvot
c8ac908db2 Release UI on G26 priming timeout (#16449) 2020-01-21 01:05:55 -06:00
0r31
b57ef4b261 Override for LPC1768 u8g/digipot I2C master ID (#16622) 2020-01-20 20:09:16 -06:00
Bob Kuhn
1a5cbc9052 Fix STM401/4xx/STM32F7xx timers, STEVAL_3DP001V1 warning (#16621) 2020-01-20 18:33:36 -06:00
thinkyhead
f36225c3e0 [cron] Bump distribution date (2020-01-21) 2020-01-21 00:07:07 +00:00
InsanityAutomation
97b5a5f469 Provide methods for M420 + MBL (#16602) 2020-01-20 01:44:36 -06:00
Bob Kuhn
a1f5245e27 L64xx M906 Fix status variable, formatting (#16597) 2020-01-20 01:15:00 -06:00
Giuliano Zaro
ef8f829513 Fix CHAMBER_MAXTEMP security margin (#16600) 2020-01-20 00:44:51 -06:00
InsanityAutomation
d9cdb4ae19 Move steps/mm out of slim menus (#16603) 2020-01-20 00:43:19 -06:00
0r31
451062553e LPC1768: Allow I2C master channel override (#16584) 2020-01-19 23:59:06 -06:00
InsanityAutomation
0fcf2b1110 Quad Z stepper support (#16277) 2020-01-19 23:35:07 -06:00
0r31
f36f084465 Fix Greek language string (#16601) 2020-01-19 23:03:19 -06:00
Bob Kuhn
f6468f0af3 STEVAL_3DP001V1: Easier Serial2 (for WIFI interface) (#16599) 2020-01-19 22:27:20 -06:00
Jason Smith
439e73d79c AVR sanity check for MONITOR_DRIVER_STATUS with SW Serial (#16421) 2020-01-19 22:25:38 -06:00
ellensp
0547d9d651 Reset shutdown timer on M85 (#16587) 2020-01-19 22:24:12 -06:00
thisiskeithb
3b34fbd4c4 Update BTT002 pins (#16591) 2020-01-19 22:21:32 -06:00
George Fu
a05a65e7d2 Update FYSETC S6 Peripheral Pins (#16593) 2020-01-19 22:21:09 -06:00
Giuliano Zaro
aec211fc80 SAMD51: ADC for probe temperature compensation (#16596) 2020-01-19 22:17:08 -06:00
Bob Kuhn
1084068a3e Simplify a drivers.h macro (#16589) 2020-01-19 20:59:47 -06:00
Scott Lahteine
e9ae585647 Patch for _STEP_INIT 2020-01-19 20:50:33 -06:00
Scott Lahteine
dda76e50a9 Use bool in pin compare 2020-01-19 20:05:53 -06:00
Scott Lahteine
37849969ad Function-like macros 2020-01-19 20:01:22 -06:00
Scott Lahteine
707349d492 Updates for L64XX 2020-01-19 19:53:12 -06:00
Scott Lahteine
f6a6839a82 Simplify TMC monitor code 2020-01-19 19:29:30 -06:00
Scott Lahteine
79c2f05e7d Fix M112 with Emergency Parser 2020-01-19 19:00:24 -06:00
thinkyhead
4dca6d50c0 [cron] Bump distribution date (2020-01-20) 2020-01-20 00:06:48 +00:00
thinkyhead
23fc81f1af [cron] Bump distribution date (2020-01-19) 2020-01-19 00:07:06 +00:00
Scott Lahteine
d035bfb1a9 Allow RRW Keypad with any LCD 2020-01-18 14:48:24 -06:00
thinkyhead
80400ab3f8 [cron] Bump distribution date (2020-01-18) 2020-01-18 00:04:25 +00:00
tompe-proj
a338dce83f PINDA v2 temperature sensor / compensation (#16293) 2020-01-17 17:16:45 -06:00
George Fu
4108c5d01f Update FYSETC S6 pins (#16559) 2020-01-17 13:16:05 -06:00
Scott Lahteine
9520e5121c More CI test updates 2020-01-17 03:21:31 -06:00
vivian-ng
e94f782f51 Shared SPI sanity check (#16581) 2020-01-17 02:54:22 -06:00
Vertabreaker
6d1f6a9516 Adjust GTM32 build flags (#16582) 2020-01-17 02:46:50 -06:00
Scott Lahteine
a578749622 Clean up HAL ADC, old test scripts 2020-01-17 02:44:01 -06:00
Bob-the-Kuhn
0d0dfba203 STM32 soft SPI. STEVAL_3DP001V1 SD read. M906 tweaks. (#16579) 2020-01-17 02:44:01 -06:00
thinkyhead
91a399ae7f [cron] Bump distribution date (2020-01-17) 2020-01-17 00:06:39 +00:00
felixstorm
2b9eb4437b ESP32 HAL: Fix random pauses during prints (#16548) 2020-01-16 05:57:14 -06:00
ellensp
5bd66241df Fix TOUCH_UI_FTDI_EVE bugs (#16540) 2020-01-16 05:50:00 -06:00
Scott Lahteine
1bb1ce7475 Move macros to stepper/indirection 2020-01-16 05:25:16 -06:00
Jason Smith
c305c2cc6b Fix some warnings, Melzi pins 2020-01-15 19:57:16 -06:00
Vertabreaker
b310047ded Fix GTM32 environment (to prevent a crash) 2020-01-15 19:25:36 -06:00
dagorel
bda4957f9b Fix I2C address of MCP4728 on LPC176x (#16578) 2020-01-15 19:15:54 -06:00
Pascal de Bruijn
f10d3564e1 STM32 RODATA LENGTH (#16580) 2020-01-15 19:13:28 -06:00
thinkyhead
bc483b2354 [cron] Bump distribution date (2020-01-16) 2020-01-16 00:08:10 +00:00
Dennis
2d7f94cae1 Adjustable ADC debounce delay (#16264) 2020-01-15 18:06:03 -06:00
gjdodd
7481563bd9 Nikon IR support for time lapse photos (#16539) 2020-01-15 17:59:41 -06:00
Scott Lahteine
bd550bb45a Get test configs from GitHub 2020-01-15 01:27:32 -06:00
Scott Lahteine
b419ca254b Fix typo 2020-01-15 01:27:32 -06:00
thisiskeithb
7eed008e8e Use Flash EEPROM on BTT002 (#16558) 2020-01-15 01:27:32 -06:00
Bob Kuhn
53dfeed6c0 Steval_3DP001V1 timers, analog inputs, etc. (#16565) 2020-01-14 23:19:13 -06:00
Lino Barreca
ef513ef7fb Fix build error with unsupported reset flags (#16562) 2020-01-14 23:19:13 -06:00
Scott Lahteine
7b304cee16 Move configurations to a separate repo 2020-01-14 19:11:47 -06:00
Scott Lahteine
ea7363a8f4 Update more configs 2020-01-14 18:48:29 -06:00
thinkyhead
8e1a21cf53 [cron] Bump distribution date (2020-01-15) 2020-01-15 00:08:21 +00:00
Jason Smith
fc773c2784 Fix Fysetc S6 FLASH_PAGE_SIZE and test build (#16560) 2020-01-14 15:36:47 -06:00
Scott Lahteine
bfe4ceedd1 Bring MP_SCARA config up to date 2020-01-14 14:55:47 -06:00
InsanityAutomation
ffd8b595d1 Fix PLR cancel with ExtUI (#16556) 2020-01-13 20:52:24 -06:00
Scott Lahteine
1457e40208 Make lcd_power_loss_recovery_cancel exportable 2020-01-13 20:25:12 -06:00
Bob Kuhn
1ad53cee1f Improved STMicro L64XX stepper driver support (#16452) 2020-01-13 18:47:30 -06:00
thinkyhead
53f1e5ff5b [cron] Bump distribution date (2020-01-14) 2020-01-14 00:08:54 +00:00
Scott Lahteine
0e6ef65aec Clean up whitespace 2020-01-13 16:56:56 -06:00
Scott Lahteine
ccdeb3f2cd Updates for GitHub Actions 2020-01-13 16:49:49 -06:00
Bob Kuhn
c4ffe74d71 Add SERVO, TONE timers to variant for better STEVAL_3DP001V1 support (#16538) 2020-01-13 00:26:17 -06:00
David Klasinc
55b2af9464 Fix Linux upload path detection (#16514) 2020-01-13 00:23:55 -06:00
Vertabreaker
b4ee420a37 Geeetech G2Pro configuration (#16553) 2020-01-13 00:20:17 -06:00
Scott Lahteine
f926351fa8 Power options formatting 2020-01-13 00:15:24 -06:00
Vertabreaker
51f2733b7f Add GTM32 (STM32F103VET6) environment (#16454) 2020-01-12 22:27:58 -06:00
thinkyhead
fc4a42bbdc [cron] Bump distribution date (2020-01-13) 2020-01-13 00:08:17 +00:00
Scott Lahteine
89ccd463d7 Update auto_build.py paths for Atom/Sublime 2020-01-11 19:28:41 -06:00
Scott Lahteine
473d640e88 Restore test_builds action to bugfix 2020-01-11 18:38:47 -06:00
thinkyhead
57499291d3 [cron] Bump distribution date (2020-01-12) 2020-01-12 00:10:02 +00:00
Ryan V1
56e51efeea Use RECIPROCAL macro (not _RECIP) (#16530) 2020-01-11 17:16:16 -06:00
Jason Smith
d22eb261cf Fix probeless delta build (#16537) 2020-01-11 17:14:33 -06:00
FlyingSamson
fbf2f36cae Only constrain motion on homed axes (#16533)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2020-01-11 17:06:52 -06:00
Scott Lahteine
536778812f Migrate actions to default (2.0.x) branch 2020-01-10 18:16:52 -06:00
thinkyhead
e8941d2bd8 [cron] Bump distribution date (2020-01-11) 2020-01-11 00:08:42 +00:00
Luc
d854c8fa5f ESP3d integration for ESP32 (#16515) 2020-01-10 17:22:41 -06:00
Giuliano Zaro
e9a97127f7 Update Italian language (#16527) 2020-01-10 16:19:52 -06:00
Giuliano Zaro
0391e5bcc7 Prevent Z misaligment on tool change (#16518) 2020-01-10 16:12:21 -06:00
thinkyhead
d02a867424 [cron] Bump distribution date (2020-01-10) 2020-01-10 20:47:56 +00:00
Acenotass
2d820e6204 Update Russian language (#16522) 2020-01-10 13:06:02 -06:00
Tanguy Pruvot
f9f7697b96 Fix Probe Offset XY edit items (et Français) (#16523) 2020-01-10 13:04:59 -06:00
InsanityAutomation
409d7378d9 Add Probe Offsets menu (#16444) 2020-01-10 00:47:38 -06:00
ellensp
669fe74096 Fix compile error w/out LCD (#16502) 2020-01-09 04:51:41 -06:00
Jamie
36d08f8ad3 Add ARC_SEGMENTS_PER_SEC for finer G2/G3 arcs (#16510) 2020-01-09 04:48:00 -06:00
Mehdi Beyk Mohamadi
8a7661df89 Correct ESP32 CPU speed in README (#16472) 2020-01-09 04:16:51 -06:00
Scott Lahteine
6e658a7c04 Code style and comment tweaks 2020-01-08 20:00:26 -06:00
Scott Lahteine
95046c9047 Extend SERIAL_CHAR to take multiple arguments 2020-01-08 18:36:47 -06:00
thisiskeithb
5beca89412 Add menu item Tune > Advance K (#16488) 2020-01-08 17:43:36 -06:00
Scott Lahteine
5ac9d9754e Update workflow skip condition 2020-01-08 17:40:53 -06:00
meponderR
5e7943f19f Fix LCD for Tevo Tornado (#16474) 2020-01-08 16:32:08 -06:00
Alejandro Aguilera
5a5e1d0401 Fix Change Filament menu item with runout (#16485) 2020-01-08 16:03:23 -06:00
dagorel
a88b91b3ed Provide some missing Arduino macros (#16497) 2020-01-07 21:56:47 -06:00
Lino Barreca
5c4c052fd7 Fix SKR Pro BLTouch conflicting timers (#16499) 2020-01-07 21:54:26 -06:00
Vertabreaker
d26c32375e Fix EEPROM array size bug (#16475) 2020-01-07 21:49:27 -06:00
ellensp
994c695862 Fix MKS_SGEN sanity check (#16501) 2020-01-07 21:47:45 -06:00
Scott Lahteine
f154e94981 Move auto_build.py to 'vscode' folder 2020-01-07 19:38:15 -06:00
Tanguy Pruvot
b7f8163291 Update U20 config to help UBL toggle (#16471) 2020-01-05 02:54:15 -06:00
ManuelMcLure
675295692b Fix unused var warning (#16467) 2020-01-05 02:52:38 -06:00
Tanguy Pruvot
d1e55a2d1d Remove extra UBL map edit menu item (#16451) 2020-01-05 02:25:03 -06:00
Vertabreaker
5e1f0e5e90 Followup to EEPROM patch (#16470) 2020-01-05 02:19:50 -06:00
Tanguy Pruvot
bdcccee203 Improve French language (UBL) (#16453) 2020-01-05 02:09:27 -06:00
Justin
d70dad6807 Fix permyriad progress bar (#16460) 2020-01-05 02:08:24 -06:00
Acenotass
93e35880ce Update Russian language (#16461) 2020-01-05 02:04:28 -06:00
Jamie
9b970cf12f Add option to invert joystick axes (#16466) 2020-01-05 02:01:05 -06:00
Jamie
022b6b9067 Fix M115 cap with EXTRUDERS == 0 (#16459) 2020-01-05 01:54:30 -06:00
Jamie
fc07b0ea30 Fix EEPROM error with EXTRUDERS == 0 (#16464) 2020-01-05 01:54:30 -06:00
Scott Lahteine
a484adcb30 Update git helper usage 2020-01-05 01:54:30 -06:00
Scott Lahteine
31679640c0 Skip build tests on forks 2020-01-05 01:54:30 -06:00
Scott Lahteine
3469a0a1a0 Update maintainer funding links 2020-01-05 01:54:30 -06:00
Scott Lahteine
38c0f800d6 Action to check PRs 2020-01-05 01:54:30 -06:00
Scott Lahteine
57e37b6c24 Fix daily date bump action 2020-01-05 00:59:10 -06:00
Lino Barreca
07509febcd Fix serials available on SKR Pro 1.1 (#16439) 2020-01-03 21:01:42 -06:00
George Fu
e593da1c23 Update and fix DGUS (#16317) 2020-01-03 21:00:44 -06:00
greppp
7f87a044cd Fix Ender-2 display pins, add BTN_ENC (#16349) 2020-01-03 20:44:16 -06:00
Vertabreaker
b841b9bd01 Add example configs. Expand custom menu. (#16286)
- Anet E10
- Geeetech D200
- Geeetech M201
- JGAurora Magic
- MakerFarm Pegasus 12
2020-01-03 20:37:22 -06:00
George Fu
ceeba58dc9 FYSETC F6 v1.4 board support (#16321) 2020-01-03 20:29:25 -06:00
yedey
a49c6608c9 Fixed Creality CR-20 Pro configuration example (#16332) 2020-01-03 20:18:35 -06:00
thisiskeithb
9903bc8d36 Add EVNOVO (Artillery) Genius config (#16320) 2020-01-03 20:17:20 -06:00
Scott Lahteine
aa4db785f2 MSG_WATCH => MSG_INFO_SCREEN 2020-01-03 19:50:55 -06:00
Scott Lahteine
00e27503ce Use a default monitor_speed of 250000 2020-01-03 19:50:55 -06:00
Scott Lahteine
f7e3a5ad85 Temporary CI fix for STM32 2020-01-03 19:31:16 -06:00
Jason Smith
3cade6245e Fix MIN_PROBE_EDGE bug in default ABL G29 (#16367) 2020-01-03 17:46:26 -06:00
ellensp
d7aee3b7b6 Pins debugging AVR serial pins (#16437) 2020-01-03 17:40:56 -06:00
thisiskeithb
64fdc4f24b BTT002: Add runout, PLR, and RGB pins (#16442) 2020-01-03 17:38:15 -06:00
Acenotass
295aa3d60d Update Russian language (#16440) 2020-01-03 17:35:08 -06:00
Scott Lahteine
1d0452c41e Standardize drivers.h values, add class indirection (#16448) 2020-01-03 17:11:36 -06:00
Tanguy Pruvot
96a5e64bb8 Improve JGAurora A1/A5S touch buttons (#16394) 2020-01-02 22:04:46 -06:00
Jason Smith
595e684658 Add Leapfrog Xeed 2015 support (#16400) 2020-01-02 22:04:13 -06:00
thisiskeithb
21dc07c40a Sidewinder X1 Config Updates (#16315) 2020-01-02 21:28:54 -06:00
Tanguy Pruvot
cda363a15e Touch UI: Fix UBL mesh value editing (#16432) 2020-01-02 21:26:03 -06:00
Walt Sorensen
9f44452834 Enable MULTI_NOZZLE_DUPLICATION for BIBO (#16435) 2020-01-02 21:17:52 -06:00
ellensp
7a50dbc00d Add motherboard BIGTREE_SKR_V1.4_TURBO (#16374) 2020-01-02 21:15:34 -06:00
thisiskeithb
3162d378ff Add Ender-5 leadscrew README (#16424) 2020-01-02 20:41:50 -06:00
InsanityAutomation
d129ac1b37 Z-offset edit precision based on value limits (#16425) 2020-01-02 20:40:40 -06:00
Tanguy Pruvot
1ea529b9c1 STM32F1: Fix misleading indent / nullptr on FSMC (#16431) 2020-01-02 20:19:07 -06:00
Acenotass
5ffabd56eb Update Russian language (#16426) 2020-01-02 20:17:08 -06:00
Dirk O. Kaar
d0e1166cce Fix Visual Micro "Arduino IDE for Visual Studio" support (#16418) 2020-01-02 19:01:38 -06:00
Scott Lahteine
5b75a018b7 Misc patches preceding DGUS PR 2020-01-02 17:59:38 -06:00
randellhodges
c75b560604 PWM pin not needed for Neopixel brightness / submenu (#16345) 2020-01-02 17:50:19 -06:00
Scott Lahteine
a2cda631d9 Clean up trailing whitespace 2020-01-02 16:33:50 -06:00
Jason Smith
a7b0b390cd Fix PrintrBoard build (ignore TMC libraries) (#16346)
(In future try to get Teensy processors better supported by `TMCStepper`.)
2020-01-01 22:14:14 -06:00
Jason Smith
9ff2d34bf8 Fix warnings in stepper.cpp (#16364) 2020-01-01 22:06:50 -06:00
Jason Smith
92ad973729 Fix some DOGM warnings (#16363) 2020-01-01 21:58:16 -06:00
rado79
0be8b22d3c Add FILAMENT_UNLOAD_PURGE_FEEDRATE (#16372) 2020-01-01 21:56:58 -06:00
Jason Smith
4e1f2f89f6 Refactor TMC-related macros and sanity checks (#16384) 2020-01-01 21:51:15 -06:00
Lino Barreca
ac32ed74b4 Return from loop() on non-AVR boards (#16390) 2020-01-01 21:13:43 -06:00
swilkens
89f9902053 Disable PIDTEMPBED for SKR Mini E3 (#16396) 2020-01-01 20:59:14 -06:00
Alexander Gavrilenko
c6f7ea9f22 MKS Robin ILI9328 TFT support (#16401) 2020-01-01 20:55:37 -06:00
Bob Kuhn
747b2b9bf4 Improve STEVAL_3DP001V1 and future STEVAL_* support (#16404) 2020-01-01 20:52:56 -06:00
Pascal de Bruijn
23bdc1556d Permit ENDSTOP_INTERRUPTS_FEATURE on more STM32 (#16412) 2020-01-01 20:41:35 -06:00
Dirk O. Kaar
ec03e46ffa Improve Renkforce configs (#16417) 2020-01-01 20:40:01 -06:00
Giuliano Zaro
47edbd9220 Fix min limit for acc, feed, jerk (#16416) 2020-01-01 20:38:33 -06:00
Scott Lahteine
00c83e9ca6 Update comments re: NOZZLE_AS_PROBE 2020-01-01 19:41:23 -06:00
Scott Lahteine
832321f55d Fix games menu back item, titles 2019-12-31 16:06:16 -06:00
Scott Lahteine
941a09b6ac Fix Max7219 with 256 or more cels 2019-12-31 16:04:29 -06:00
Scott Lahteine
16787c94af Update mfpub for current MarlinDocumentation 2019-12-28 17:45:10 -06:00
Scott Lahteine
28d83b42e1 Split up HAL items 2019-12-25 19:25:05 -06:00
Scott Lahteine
23c5266076 Update README with status badge, etc. 2019-12-25 15:06:36 -06:00
764 changed files with 18006 additions and 696277 deletions

4
.github/FUNDING.yml vendored
View File

@@ -1 +1,3 @@
custom: http://www.thinkyhead.com/donate-to-marlin
github: [thinkyhead]
patreon: thinkyhead
custom: ["http://www.thinkyhead.com/donate-to-marlin"]

View File

@@ -1,16 +1,31 @@
# NO SUPPORT REQUESTS PLEASE
<!--
Support Requests posted here will be automatically closed!
Have you read Marlin's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/.github/code_of_conduct.md
This Issue Queue is for Marlin bug reports and development-related issues, and we prefer not to handle user-support questions here. See https://github.com/MarlinFirmware/Marlin/blob/1.1.x/.github/contributing.md#i-dont-want-to-read-this-whole-thing-i-just-have-a-question.
Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use the Marlin Firmware forum at http://forums.reprap.org/list.php?415 or the Marlin Facebook Group https://www.facebook.com/groups/1049718498464482/ or the Marlin Discord Server https://discord.gg/n5NJ59y.
For best results getting help with configuration and troubleshooting, please use the following resources:
Before filing an issue be sure to test the 1.1 and/or 2.0 "bugfix" branches to see whether the issue is already addressed.
- RepRap.org Marlin Forum http://forums.reprap.org/list.php?415
- Tom's 3D Forums https://discuss.toms3d.org/
- Facebook Group "Marlin Firmware" https://www.facebook.com/groups/1049718498464482/
- Facebook Group "Marlin Firmware for 3D Printers" https://www.facebook.com/groups/3Dtechtalk/
- Marlin Configuration https://www.youtube.com/results?search_query=marlin+configuration on YouTube
- Marlin Discord server. Join link: https://discord.gg/n5NJ59y
-->
After seeking help from the community, if the consensus points to to a bug in Marlin, then you should post a Bug Report at https://github.com/MarlinFirmware/Marlin/issues/new/choose).
### Description
<!-- Description of the bug or requested feature -->
### Steps to Reproduce
<!-- If this is a Bug Report, please describe the steps needed to reproduce the issue -->
1. [First Step]
2. [Second Step]
3. [and so on...]
**Expected behavior:** [What you expect to happen]
**Actual behavior:** [What actually happens]
#### Additional Information
* Include a ZIP file containing your `Configuration.h` and `Configuration_adv.h` files.
* Provide pictures or links to videos that clearly demonstrate the issue.
* See [How Can I Contribute](#how-can-i-contribute) for additional guidelines.

18
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
# Add '@domain/core' label to any change within the 'core' package
enhancement:
- .github
# Add 'test' label to any change to *.spec.js files within the source dir
"C: Motion":
- src/module/motion.*
- src/module/planner.*
- src/module/stepper.*
"C: G-code Parser":
- src/gcode/**
"PR: Configurations":
- config/examples/**
"T: 32-Bit & HAL":
- src/HAL/**

34
.github/workflows/bump-date.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
#
# bump-date.yml
# Bump the distribution date once per day
#
name: Bump Distribution Date
on:
schedule:
- cron: '0 0 * * *'
jobs:
bump_date:
runs-on: ubuntu-latest
steps:
- name: Check out bugfix-2.0.x
uses: actions/checkout@v2
with:
ref: bugfix-2.0.x
- name: Bump Distribution Date
run: |
# Inline Bump Script
[[ "$GITHUB_REPOSITORY" == "MarlinFirmware/Marlin" ]] || exit 0
DIST=$( date +"%Y-%m-%d" )
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
git config user.name "${GITHUB_ACTOR}" && \
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
git add . && \
git commit -m "[cron] Bump distribution date ($DIST)" && \
git push

31
.github/workflows/check-pr.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
#
# check-pr.yml
# Add a comment to the PR if it's directed to a release branch
#
name: Check PR
on:
pull_request:
branches:
- 1.0.x
- 1.1.x
- 2.0.x
jobs:
check_pr:
runs-on: ubuntu-latest
steps:
- name: Comment on PR
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: "<p>Thanks for your contribution! \
Unfortunately we can't accept PRs directed at release branches. \
We make patches to the bugfix branches and only later do we push them out as releases. \
Please redo this PR starting with the `bugfix-2.0.x` branch and be careful to target `bugfix-2.0.x` when resubmitting the PR.</p> \
<p>It may help to set your fork's default branch to `bugfix-2.0.x`.</p> \
<p>See <a href='http://marlinfw.org/docs/development/getting_started_pull_requests.html' target='_blank'>this page</a> for full instructions.</p>"

23
.github/workflows/label-pr.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
#
# label-pr.yml
# Automatically close the PR if it's directed to a release branch
#
name: Apply Labels
on:
pull_request:
branches:
- bugfix-1.1.x
- bugfix-2.0.x
- dev-2.1.x
jobs:
apply_labels:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

103
.github/workflows/test-builds.yml vendored Normal file
View File

@@ -0,0 +1,103 @@
#
# test-builds.yml
# Do test builds to catch compile errors
#
name: CI
on:
pull_request:
branches:
- bugfix-2.0.x
- dev-2.1.x
paths-ignore:
- config/**
- data/**
- docs/**
- '**/*.md'
jobs:
test_builds:
runs-on: ubuntu-latest
strategy:
matrix:
test-platform:
# Base Environments
- DUE
- esp32
- linux_native
- megaatmega2560
- teensy31
- teensy35
# Extended AVR Environments
- FYSETC_F6_13
- megaatmega1280
- rambo
- sanguino_atmega1284p
- sanguino_atmega644p
# Extended STM32 Environments
- STM32F103RC_bigtree
- STM32F103RC_bigtree_USB
- STM32F103RE_bigtree
- STM32F103RE_bigtree_USB
- STM32F103RC_fysetc
- jgaurora_a5s_a1
- STM32F103VE_longer
- STM32F407VE_black
- BIGTREE_SKR_PRO
- mks_robin
- ARMED
- FYSETC_S6
# Put lengthy tests last
- LPC1768
- LPC1769
# STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working.
#- STM32F4
#- STM32F7
# Non-working environment tests
#- BIGTREE_BTT002
#- at90usb1286_cdc
#- at90usb1286_dfu
#- STM32F103CB_malyan
#- mks_robin_lite
#- mks_robin_mini
#- mks_robin_nano
#- SAMD51_grandcentral_m4
steps:
- name: Select Python 3.7
uses: actions/setup-python@v1
with:
python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax.
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install PlatformIO
run: |
pip install -U https://github.com/platformio/platformio-core/archive/master.zip
platformio update
- name: Check out the PR
uses: actions/checkout@v2
- name: Run ${{ matrix.test-platform }} Tests
run: |
# Inline tests script
[[ "$GITHUB_REPOSITORY" == "MarlinFirmware/Marlin" ]] || exit 0
chmod +x buildroot/bin/*
chmod +x buildroot/share/tests/*
export PATH=./buildroot/bin/:./buildroot/share/tests/:${PATH}
run_tests . ${{ matrix.test-platform }}

View File

@@ -143,7 +143,7 @@
// @section extruder
// This defines the number of extruders
// :[1, 2, 3, 4, 5, 6]
// :[1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 1
// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc.
@@ -360,7 +360,8 @@
* -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)
* 331 : (3.3V scaled thermistor 1 table for MEGA)
* 332 : (3.3V scaled thermistor 1 table for DUE)
* 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. !!
@@ -378,7 +379,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 : Pt100 with circuit in the Ultimainboard V2.x
* 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
* 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
@@ -411,7 +413,10 @@
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_4 0
#define TEMP_SENSOR_5 0
#define TEMP_SENSOR_6 0
#define TEMP_SENSOR_7 0
#define TEMP_SENSOR_BED 0
#define TEMP_SENSOR_PROBE 0
#define TEMP_SENSOR_CHAMBER 0
// Dummy thermistor constant temperature readings, for use with 998 and 999
@@ -439,6 +444,8 @@
#define HEATER_3_MINTEMP 5
#define HEATER_4_MINTEMP 5
#define HEATER_5_MINTEMP 5
#define HEATER_6_MINTEMP 5
#define HEATER_7_MINTEMP 5
#define BED_MINTEMP 5
// Above this temperature the heater will be switched off.
@@ -450,6 +457,8 @@
#define HEATER_3_MAXTEMP 275
#define HEATER_4_MAXTEMP 275
#define HEATER_5_MAXTEMP 275
#define HEATER_6_MAXTEMP 275
#define HEATER_7_MAXTEMP 275
#define BED_MAXTEMP 150
//===========================================================================
@@ -654,12 +663,13 @@
*
* A4988 is assumed for unspecified drivers.
*
* Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
* Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
* TB6560, TB6600, TMC2100,
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
* TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE,
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
*/
//#define X_DRIVER_TYPE A4988
//#define Y_DRIVER_TYPE A4988
@@ -668,12 +678,15 @@
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
//#define Z4_DRIVER_TYPE A4988
//#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
//#define E4_DRIVER_TYPE A4988
//#define E5_DRIVER_TYPE A4988
//#define E6_DRIVER_TYPE A4988
//#define E7_DRIVER_TYPE A4988
// Enable this feature if all enabled endstop pins are interrupt-capable.
// This will remove the need to poll the interrupt pins, saving many CPU cycles.
@@ -903,6 +916,13 @@
#define Z_PROBE_RETRACT_X X_MAX_POS
#endif
// Duet Smart Effector (for delta printers) - https://bit.ly/2ul5U7J
// When the pin is defined you can use M672 to set/reset the probe sensivity.
//#define DUET_SMART_EFFECTOR
#if ENABLED(DUET_SMART_EFFECTOR)
#define SMART_EFFECTOR_MOD_PIN -1 // Connect a GPIO pin to the Smart Effector MOD pin
#endif
//
// For Z_PROBE_ALLEN_KEY see the Delta example configurations.
//
@@ -929,7 +949,8 @@
*/
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
// Certain types of probes need to stay away from edges
// Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
#define MIN_PROBE_EDGE 10
// X and Y axis travel speed (mm/m) between probes
@@ -1039,6 +1060,8 @@
#define INVERT_E3_DIR false
#define INVERT_E4_DIR false
#define INVERT_E5_DIR false
#define INVERT_E6_DIR false
#define INVERT_E7_DIR false
// @section homing
@@ -1424,11 +1447,6 @@
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating
//
// M100 Free Memory Watcher
//
//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage
//
// G20/G21 Inch mode support
//
@@ -1519,9 +1537,10 @@
// Default number of triangles
#define NOZZLE_CLEAN_TRIANGLES 3
// Specify positions as { X, Y, Z }
#define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) }
#define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) }
// Specify positions for each tool as { { X, Y, Z }, { X, Y, Z } }
// Dual hotend system may use { { -20, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }, { 420, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }}
#define NOZZLE_CLEAN_START_POINT { { 30, 30, (Z_MIN_POS + 1) } }
#define NOZZLE_CLEAN_END_POINT { { 100, 60, (Z_MIN_POS + 1) } }
// Circular pattern radius
#define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5
@@ -1942,10 +1961,11 @@
// FYSETC variant of the MINI12864 graphic controller with SD support
// https://wiki.fysetc.com/Mini12864_Panel/
//
//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default
//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on)
//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight
//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight
//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default
//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on)
//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight
//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight
//#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight.
//
// Factory display for Creality CR-10
@@ -1956,6 +1976,11 @@
//
//#define CR10_STOCKDISPLAY
//
// Ender-2 OEM display, a variant of the MKS_MINI_12864
//
//#define ENDER2_STOCKDISPLAY
//
// ANET and Tronxy Graphical Controller
//
@@ -2024,9 +2049,11 @@
//=============================================================================
//
// DGUS Touch Display with DWIN OS
// DGUS Touch Display with DWIN OS. (Choose one.)
//
//#define DGUS_LCD
//#define DGUS_LCD_UI_ORIGIN
//#define DGUS_LCD_UI_FYSETC
//#define DGUS_LCD_UI_HIPRECY
//
// Touch-screen LCD for Malyan M200 printers

View File

@@ -78,6 +78,18 @@
#define HOTEND5_BETA 3950 // Beta value
#endif
#if TEMP_SENSOR_6 == 1000
#define HOTEND6_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND6_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define HOTEND6_BETA 3950 // Beta value
#endif
#if TEMP_SENSOR_7 == 1000
#define HOTEND7_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND7_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define HOTEND7_BETA 3950 // Beta value
#endif
#if TEMP_SENSOR_BED == 1000
#define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
@@ -165,28 +177,28 @@
* Thermal Protection parameters for the bed are just as above for hotends.
*/
#if ENABLED(THERMAL_PROTECTION_BED)
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
/**
* As described above, except for the bed (M140/M190/M303).
*/
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
#endif
/**
* Thermal Protection parameters for the heated chamber.
*/
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius
/**
* Heated chamber watch settings (M141/M191).
*/
#define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds
#define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius
#define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds
#define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius
#endif
#if ENABLED(PIDTEMP)
@@ -368,7 +380,7 @@
* FAST_PWM_FAN_FREQUENCY [undefined by default]
* Set this to your desired frequency.
* If left undefined this defaults to F = F_CPU/(2*255*1)
* ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers
* i.e., F = 31.4kHz on 16MHz microcontrollers or F = 39.2kHz on 20MHz microcontrollers.
* These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required
* NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior.
*
@@ -479,7 +491,7 @@
//#define X_DUAL_ENDSTOPS
#if ENABLED(X_DUAL_ENDSTOPS)
#define X2_USE_ENDSTOP _XMAX_
#define X_DUAL_ENDSTOPS_ADJUSTMENT 0
#define X2_ENDSTOP_ADJUSTMENT 0
#endif
#endif
@@ -489,27 +501,28 @@
//#define Y_DUAL_ENDSTOPS
#if ENABLED(Y_DUAL_ENDSTOPS)
#define Y2_USE_ENDSTOP _YMAX_
#define Y_DUAL_ENDSTOPS_ADJUSTMENT 0
#define Y2_ENDSTOP_ADJUSTMENT 0
#endif
#endif
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
//#define Z_DUAL_ENDSTOPS
#if ENABLED(Z_DUAL_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_
#define Z_DUAL_ENDSTOPS_ADJUSTMENT 0
#endif
#endif
//
// For Z set the number of stepper drivers
//
#define NUM_Z_STEPPER_DRIVERS 1 // (1-4) Z options change based on how many
//#define Z_TRIPLE_STEPPER_DRIVERS
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
//#define Z_TRIPLE_ENDSTOPS
#if ENABLED(Z_TRIPLE_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_
#define Z3_USE_ENDSTOP _YMAX_
#define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0
#define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0
#if NUM_Z_STEPPER_DRIVERS > 1
//#define Z_MULTI_ENDSTOPS
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_
#define Z2_ENDSTOP_ADJUSTMENT 0
#if NUM_Z_STEPPER_DRIVERS >= 3
#define Z3_USE_ENDSTOP _YMAX_
#define Z3_ENDSTOP_ADJUSTMENT 0
#endif
#if NUM_Z_STEPPER_DRIVERS >= 4
#define Z4_USE_ENDSTOP _ZMAX_
#define Z4_ENDSTOP_ADJUSTMENT 0
#endif
#endif
#endif
@@ -806,7 +819,7 @@
// probing on a screwhead or hollow washer, probe near the edges.
//#define CALIBRATION_MEASURE_AT_TOP_EDGES
// Define pin which is read during calibration
// Define the pin to read during calibration
#ifndef CALIBRATION_PIN
#define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop
#define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin
@@ -1243,6 +1256,44 @@
#endif // HAS_GRAPHICAL_LCD
//
// Additional options for DGUS / DWIN displays
//
#if HAS_DGUS_LCD
#define DGUS_SERIAL_PORT 2
#define DGUS_BAUDRATE 115200
#define DGUS_RX_BUFFER_SIZE 128
#define DGUS_TX_BUFFER_SIZE 48
//#define DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS // Fix Rx overrun situation (Currently only for AVR)
#define DGUS_UPDATE_INTERVAL_MS 500 // (ms) Interval between automatic screen updates
#define BOOTSCREEN_TIMEOUT 3000 // (ms) Duration to display the boot screen
#if EITHER(DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY)
#define DGUS_PRINT_FILENAME // Display the filename during printing
#define DGUS_PREHEAT_UI // Display a preheat screen during heatup
#if ENABLED(DGUS_LCD_UI_FYSETC)
//#define DUGS_UI_MOVE_DIS_OPTION // Disabled by default for UI_FYSETC
#else
#define DUGS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
#endif
#define DGUS_FILAMENT_LOADUNLOAD
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
#define DGUS_FILAMENT_PURGE_LENGTH 10
#define DGUS_FILAMENT_LOAD_LENGTH_PER_TIME 0.5 // (mm) Adjust in proportion to DGUS_UPDATE_INTERVAL_MS
#endif
#define DGUS_UI_WAITING // Show a "waiting" screen between some screens
#if ENABLED(DGUS_UI_WAITING)
#define DGUS_UI_WAITING_STATUS 10
#define DGUS_UI_WAITING_STATUS_PERIOD 8 // Increase to slower waiting status looping
#endif
#endif
#endif // HAS_DGUS_LCD
//
// Touch UI for the FTDI Embedded Video Engine (EVE)
//
@@ -1341,6 +1392,13 @@
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
#endif
//
// ADC Button Debounce
//
#if HAS_ADC_BUTTONS
#define ADC_BUTTON_DEBOUNCE_DELAY 16 // (ms) Increase if buttons bounce or repeat too fast
#endif
// @section safety
/**
@@ -1438,7 +1496,8 @@
* Override MIN_PROBE_EDGE for each side of the build plate
* Useful to get probe points to exact positions on targets or
* to allow leveling to avoid plate clamps on only specific
* sides of the bed.
* sides of the bed. With NOZZLE_AS_PROBE negative values are
* allowed, to permit probing outside the bed.
*
* If you are replacing the prior *_PROBE_BED_POSITION options,
* LEFT and FRONT values in most cases will map directly over
@@ -1483,18 +1542,57 @@
#endif
/**
* Thermal Probe Compensation
* Probe measurements are adjusted to compensate for temperature distortion.
* Use G76 to calibrate this feature. Use M871 to set values manually.
* For a more detailed explanation of the process see G76_M871.cpp.
*/
#if HAS_BED_PROBE && TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
// Enable thermal first layer compensation using bed and probe temperatures
#define PROBE_TEMP_COMPENSATION
// Add additional compensation depending on hotend temperature
// Note: this values cannot be calibrated and have to be set manually
#ifdef PROBE_TEMP_COMPENSATION
// Max temperature that can be reached by heated bed.
// This is required only for the calibration process.
#define PTC_MAX_BED_TEMP 110
// Park position to wait for probe cooldown
#define PTC_PARK_POS_X 0.0F
#define PTC_PARK_POS_Y 0.0F
#define PTC_PARK_POS_Z 100.0F
// Probe position to probe and wait for probe to reach target temperature
#define PTC_PROBE_POS_X 90.0F
#define PTC_PROBE_POS_Y 100.0F
// Enable additional compensation using hotend temperature
// Note: this values cannot be calibrated automatically but have to be set manually
//#define USE_TEMP_EXT_COMPENSATION
#endif
#endif
// @section extras
//
// G60/G61 Position Save and Return
//
//#define SAVED_POSITIONS 1 // Each saved position slot costs 12 bytes
//
// G2/G3 Arc Support
//
#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
#if ENABLED(ARC_SUPPORT)
#define MM_PER_ARC_SEGMENT 1 // Length of each arc segment
#define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle
#define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections
//#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles
//#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes
#define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment
//#define ARC_SEGMENTS_PER_R 1 // Max segment length, MM_PER = Min
#define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle
//#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum)
#define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections
//#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles
//#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes
#endif
// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
@@ -1691,6 +1789,9 @@
// Z raise distance for tool-change, as needed for some extruders
#define TOOLCHANGE_ZRAISE 2 // (mm)
//#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change
#if ENABLED(TOOLCHANGE_NO_RETURN)
//#define EVENT_GCODE_AFTER_TOOLCHANGE "G12X" // G-code to run after tool-change is complete
#endif
// Retract and prime filament on tool-change
//#define TOOLCHANGE_FILAMENT_SWAP
@@ -1754,6 +1855,7 @@
#define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length.
#define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract.
#define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged.
#define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload
#define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety.
#define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed.
@@ -1818,6 +1920,12 @@
#define Z3_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_Z4(TMC26X)
#define Z4_MAX_CURRENT 1000
#define Z4_SENSE_RESISTOR 91
#define Z4_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_E0(TMC26X)
#define E0_MAX_CURRENT 1000
#define E0_SENSE_RESISTOR 91
@@ -1854,6 +1962,18 @@
#define E5_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_E6(TMC26X)
#define E6_MAX_CURRENT 1000
#define E6_SENSE_RESISTOR 91
#define E6_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_E7(TMC26X)
#define E7_MAX_CURRENT 1000
#define E7_SENSE_RESISTOR 91
#define E7_MICROSTEPS 16
#endif
#endif // TMC26X
// @section tmc_smart
@@ -1935,6 +2055,14 @@
#define Z3_CHAIN_POS -1
#endif
#if AXIS_IS_TMC(Z4)
#define Z4_CURRENT 800
#define Z4_CURRENT_HOME Z4_CURRENT
#define Z4_MICROSTEPS 16
#define Z4_RSENSE 0.11
#define Z4_CHAIN_POS -1
#endif
#if AXIS_IS_TMC(E0)
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
@@ -1977,6 +2105,20 @@
#define E5_CHAIN_POS -1
#endif
#if AXIS_IS_TMC(E6)
#define E6_CURRENT 800
#define E6_MICROSTEPS 16
#define E6_RSENSE 0.11
#define E6_CHAIN_POS -1
#endif
#if AXIS_IS_TMC(E7)
#define E7_CURRENT 800
#define E7_MICROSTEPS 16
#define E7_RSENSE 0.11
#define E7_CHAIN_POS -1
#endif
/**
* Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here.
* The default pins can be found in your board's pins file.
@@ -1994,6 +2136,8 @@
//#define E3_CS_PIN -1
//#define E4_CS_PIN -1
//#define E5_CS_PIN -1
//#define E6_CS_PIN -1
//#define E7_CS_PIN -1
/**
* Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160).
@@ -2024,12 +2168,15 @@
#define Y2_SLAVE_ADDRESS 0
#define Z2_SLAVE_ADDRESS 0
#define Z3_SLAVE_ADDRESS 0
#define Z4_SLAVE_ADDRESS 0
#define E0_SLAVE_ADDRESS 0
#define E1_SLAVE_ADDRESS 0
#define E2_SLAVE_ADDRESS 0
#define E3_SLAVE_ADDRESS 0
#define E4_SLAVE_ADDRESS 0
#define E5_SLAVE_ADDRESS 0
#define E6_SLAVE_ADDRESS 0
#define E7_SLAVE_ADDRESS 0
/**
* Software enable
@@ -2099,12 +2246,15 @@
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define Z3_HYBRID_THRESHOLD 3
#define Z4_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
#define E3_HYBRID_THRESHOLD 30
#define E4_HYBRID_THRESHOLD 30
#define E5_HYBRID_THRESHOLD 30
#define E6_HYBRID_THRESHOLD 30
#define E7_HYBRID_THRESHOLD 30
/**
* Use StallGuard2 to home / probe X, Y, Z.
@@ -2176,12 +2326,12 @@
#endif // HAS_TRINAMIC
// @section L6470
// @section L64XX
/**
* L6470 Stepper Driver options
* L64XX Stepper Driver options
*
* Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
* Arduino-L6470 library (0.8.0 or higher) is required.
* https://github.com/ameyer/Arduino-L6470
*
* Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2189,114 +2339,160 @@
* L6470_CHAIN_MISO_PIN
* L6470_CHAIN_MOSI_PIN
* L6470_CHAIN_SS_PIN
* L6470_RESET_CHAIN_PIN (optional)
* ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset
*/
#if HAS_DRIVER(L6470)
#if HAS_L64XX
//#define L6470_CHITCHAT // Display additional status info
#if AXIS_DRIVER_TYPE_X(L6470)
#define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
#define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
#define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down)
#define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper
#define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
#if AXIS_IS_L64XX(X)
#define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
#define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current
// L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
// POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
#define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down)
// L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down
// POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
// L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
#define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474
#define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
#define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest
#endif
#if AXIS_DRIVER_TYPE_X2(L6470)
#if AXIS_IS_L64XX(X2)
#define X2_MICROSTEPS 128
#define X2_OVERCURRENT 2000
#define X2_STALLCURRENT 1500
#define X2_MAX_VOLTAGE 127
#define X2_CHAIN_POS -1
#define X2_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_Y(L6470)
#if AXIS_IS_L64XX(Y)
#define Y_MICROSTEPS 128
#define Y_OVERCURRENT 2000
#define Y_STALLCURRENT 1500
#define Y_MAX_VOLTAGE 127
#define Y_CHAIN_POS -1
#define Y_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_Y2(L6470)
#if AXIS_IS_L64XX(Y2)
#define Y2_MICROSTEPS 128
#define Y2_OVERCURRENT 2000
#define Y2_STALLCURRENT 1500
#define Y2_MAX_VOLTAGE 127
#define Y2_CHAIN_POS -1
#define Y2_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_Z(L6470)
#if AXIS_IS_L64XX(Z)
#define Z_MICROSTEPS 128
#define Z_OVERCURRENT 2000
#define Z_STALLCURRENT 1500
#define Z_MAX_VOLTAGE 127
#define Z_CHAIN_POS -1
#define Z_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_Z2(L6470)
#if AXIS_IS_L64XX(Z2)
#define Z2_MICROSTEPS 128
#define Z2_OVERCURRENT 2000
#define Z2_STALLCURRENT 1500
#define Z2_MAX_VOLTAGE 127
#define Z2_CHAIN_POS -1
#define Z2_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_Z3(L6470)
#if AXIS_IS_L64XX(Z3)
#define Z3_MICROSTEPS 128
#define Z3_OVERCURRENT 2000
#define Z3_STALLCURRENT 1500
#define Z3_MAX_VOLTAGE 127
#define Z3_CHAIN_POS -1
#define Z3_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_E0(L6470)
#if AXIS_IS_L64XX(Z4)
#define Z4_MICROSTEPS 128
#define Z4_OVERCURRENT 2000
#define Z4_STALLCURRENT 1500
#define Z4_MAX_VOLTAGE 127
#define Z4_CHAIN_POS -1
#define Z4_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E0)
#define E0_MICROSTEPS 128
#define E0_OVERCURRENT 2000
#define E0_STALLCURRENT 1500
#define E0_MAX_VOLTAGE 127
#define E0_CHAIN_POS -1
#define E0_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_E1(L6470)
#if AXIS_IS_L64XX(E1)
#define E1_MICROSTEPS 128
#define E1_OVERCURRENT 2000
#define E1_STALLCURRENT 1500
#define E1_MAX_VOLTAGE 127
#define E1_CHAIN_POS -1
#define E1_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_E2(L6470)
#if AXIS_IS_L64XX(E2)
#define E2_MICROSTEPS 128
#define E2_OVERCURRENT 2000
#define E2_STALLCURRENT 1500
#define E2_MAX_VOLTAGE 127
#define E2_CHAIN_POS -1
#define E2_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_E3(L6470)
#if AXIS_IS_L64XX(E3)
#define E3_MICROSTEPS 128
#define E3_OVERCURRENT 2000
#define E3_STALLCURRENT 1500
#define E3_MAX_VOLTAGE 127
#define E3_CHAIN_POS -1
#define E3_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_E4(L6470)
#if AXIS_IS_L64XX(E4)
#define E4_MICROSTEPS 128
#define E4_OVERCURRENT 2000
#define E4_STALLCURRENT 1500
#define E4_MAX_VOLTAGE 127
#define E4_CHAIN_POS -1
#define E4_SLEW_RATE 1
#endif
#if AXIS_DRIVER_TYPE_E5(L6470)
#if AXIS_IS_L64XX(E5)
#define E5_MICROSTEPS 128
#define E5_OVERCURRENT 2000
#define E5_STALLCURRENT 1500
#define E5_MAX_VOLTAGE 127
#define E5_CHAIN_POS -1
#define E5_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E6)
#define E6_MICROSTEPS 128
#define E6_OVERCURRENT 2000
#define E6_STALLCURRENT 1500
#define E6_MAX_VOLTAGE 127
#define E6_CHAIN_POS -1
#define E6_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E7)
#define E7_MICROSTEPS 128
#define E7_OVERCURRENT 2000
#define E7_STALLCURRENT 1500
#define E7_MAX_VOLTAGE 127
#define E7_CHAIN_POS -1
#define E7_SLEW_RATE 1
#endif
/**
@@ -2308,7 +2504,7 @@
* I not present or I0 or I1 - X, Y, Z or E0
* I2 - X2, Y2, Z2 or E1
* I3 - Z3 or E3
* I4 - E4
* I4 - Z4 or E4
* I5 - E5
* M916 - Increase drive level until get thermal warning
* M917 - Find minimum current thresholds
@@ -2322,7 +2518,15 @@
//#define L6470_STOP_ON_ERROR
#endif
#endif // L6470
#endif // HAS_L64XX
// @section i2cbus
//
// I2C Master ID for LPC176x LCD and Digital Current control
// Does not apply to other peripherals based on the Wire library.
//
//#define I2C_MASTER_ID 1 // Set a value from 0 to 2
/**
* TWI/I2C BUS
@@ -2352,10 +2556,10 @@
* echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave
#if ENABLED(EXPERIMENTAL_I2CBUS)
#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave
#endif
// @section extras
@@ -2384,6 +2588,20 @@
// Duration to hold the switch or keep CHDK_PIN high
//#define PHOTO_SWITCH_MS 50 // (ms) (M240 D)
/**
* PHOTO_PULSES_US may need adjustment depending on board and camera model.
* Pin must be running at 48.4kHz.
* Be sure to use a PHOTOGRAPH_PIN which can rise and fall quick enough.
* (e.g., MKS SBase temp sensor pin was too slow, so used P1.23 on J8.)
*
* Example pulse data for Nikon: https://bit.ly/2FKD0Aq
* IR Wiring: https://git.io/JvJf7
*/
//#define PHOTO_PULSES_US { 2000, 27850, 400, 1580, 400, 3580, 400 } // (µs) Durations for each 48.4kHz oscillation
#ifdef PHOTO_PULSES_US
#define PHOTO_PULSE_DELAY_US 13 // (µs) Approximate duration of each HIGH and LOW pulse in the oscillation
#endif
#endif
/**
@@ -2723,7 +2941,11 @@
#define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2
#define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2
// Use M119 to find reasonable values after connecting your hardware:
//#define INVERT_JOY_X // Enable if X direction is reversed
//#define INVERT_JOY_Y // Enable if Y direction is reversed
//#define INVERT_JOY_Z // Enable if Z direction is reversed
// Use M119 with JOYSTICK_DEBUG to find reasonable values after connecting:
#define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max
#define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 }
#define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 }
@@ -2778,12 +3000,15 @@
/**
* WiFi Support (Espressif ESP32 WiFi)
*/
//#define WIFISUPPORT
#if ENABLED(WIFISUPPORT)
//#define WIFISUPPORT // Marlin embedded WiFi managenent
//#define ESP3D_WIFISUPPORT // ESP3D Library WiFi management (https://github.com/luc-github/ESP3DLib)
#if EITHER(WIFISUPPORT, ESP3D_WIFISUPPORT)
#define WIFI_SSID "Wifi SSID"
#define WIFI_PWD "Wifi Password"
//#define WEBSUPPORT // Start a webserver with auto-discovery
//#define OTASUPPORT // Support over-the-air firmware updates
//#define WEBSUPPORT // Start a webserver (which may include auto-discovery)
//#define OTASUPPORT // Support over-the-air firmware updates
//#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host
#endif
/**
@@ -2855,9 +3080,14 @@
// @section develop
/**
* M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
*/
//
// M100 Free Memory Watcher to debug memory usage
//
//#define M100_FREE_MEMORY_WATCHER
//
// M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe
//
//#define PINS_DEBUGGING
// Enable Marlin dev mode which adds some special commands

View File

@@ -28,7 +28,7 @@
/**
* Marlin release version identifier
*/
//#define SHORT_BUILD_VERSION "2.0.x"
//#define SHORT_BUILD_VERSION "2.0.3"
/**
* Verbose version identifier which should contain a reference to the location
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2019-07-10"
//#define STRING_DISTRIBUTION_DATE "2020-01-31"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.

View File

@@ -91,24 +91,37 @@ typedef int8_t pin_t;
#define NUM_SERIAL 1
#else
#if !WITHIN(SERIAL_PORT, -1, 3)
#error "SERIAL_PORT must be from -1 to 3"
#error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#define MYSERIAL0 customizedSerial1
#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 3)
#error "SERIAL_PORT_2 must be from -1 to 3"
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#endif
#define NUM_SERIAL 2
#define MYSERIAL1 customizedSerial2
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif
#endif
#ifdef DGUS_SERIAL_PORT
#if !WITHIN(DGUS_SERIAL_PORT, -1, 3)
#error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
#elif DGUS_SERIAL_PORT == SERIAL_PORT
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
#endif
#define DGUS_SERIAL internalDgusSerial
#define DGUS_SERIAL_GET_TX_BUFFER_FREE DGUS_SERIAL.get_tx_buffer_free
#endif
// ------------------------
// Public functions
// ------------------------
@@ -345,9 +358,9 @@ void TIMER0_COMPB_vect_bottom()
// ADC
#ifdef DIDR2
#define HAL_ANALOG_SELECT(pin) do{ if (pin < 8) SBI(DIDR0, pin); else SBI(DIDR2, pin & 0x07); }while(0)
#define HAL_ANALOG_SELECT(ind) do{ if (ind < 8) SBI(DIDR0, ind); else SBI(DIDR2, ind & 0x07); }while(0)
#else
#define HAL_ANALOG_SELECT(pin) do{ SBI(DIDR0, pin); }while(0)
#define HAL_ANALOG_SELECT(ind) SBI(DIDR0, ind);
#endif
inline void HAL_adc_init() {
@@ -358,11 +371,11 @@ inline void HAL_adc_init() {
#endif
}
#define SET_ADMUX_ADCSRA(pin) ADMUX = _BV(REFS0) | (pin & 0x07); SBI(ADCSRA, ADSC)
#define SET_ADMUX_ADCSRA(ch) ADMUX = _BV(REFS0) | (ch & 0x07); SBI(ADCSRA, ADSC)
#ifdef MUX5
#define HAL_START_ADC(pin) if (pin > 7) ADCSRB = _BV(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
#define HAL_START_ADC(ch) if (ch > 7) ADCSRB = _BV(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(ch)
#else
#define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
#define HAL_START_ADC(ch) ADCSRB = 0; SET_ADMUX_ADCSRA(ch)
#endif
#define HAL_ADC_RESOLUTION 10

View File

@@ -41,7 +41,7 @@
#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H))
#include "MarlinSerial.h"
#include "../../Marlin.h"
#include "../../MarlinCore.h"
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } };
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_t MarlinSerial<Cfg>::tx_buffer = { 0 };
@@ -757,6 +757,33 @@
#endif
#ifdef DGUS_SERIAL_PORT
template<typename Cfg>
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
h = tx_buffer.head; // next pos for queue.
int ret = t - h - 1;
if (ret < 0) ret += Cfg::TX_SIZE + 1;
return ret;
}
ISR(SERIAL_REGNAME(USART,DGUS_SERIAL_PORT,_RX_vect)) {
MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>>::store_rxd_char();
}
ISR(SERIAL_REGNAME(USART,DGUS_SERIAL_PORT,_UDRE_vect)) {
MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>>::_tx_udr_empty_irq();
}
// Preinstantiate
template class MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>>;
// Instantiate
MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>> internalDgusSerial;
#endif
// For AT90USB targets use the UART for BT interfacing
#if defined(USBCON) && ENABLED(BLUETOOTH)
HardwareSerial bluetoothSerial;

View File

@@ -217,6 +217,9 @@
static ring_buffer_pos_t available();
static void write(const uint8_t c);
static void flushTX();
#ifdef DGUS_SERIAL_PORT
static ring_buffer_pos_t get_tx_buffer_free();
#endif
FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }
FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }
@@ -292,6 +295,23 @@
extern MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>> internalSerial;
#endif
#ifdef DGUS_SERIAL_PORT
template <uint8_t serial>
struct MarlinInternalSerialCfg {
static constexpr int PORT = serial;
static constexpr unsigned int RX_SIZE = 128;
static constexpr unsigned int TX_SIZE = 48;
static constexpr bool XONOFF = false;
static constexpr bool EMERGENCYPARSER = false;
static constexpr bool DROPPED_RX = false;
static constexpr bool RX_OVERRUNS = bDGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS;
static constexpr bool RX_FRAMING_ERRORS = false;
static constexpr bool MAX_RX_QUEUED = false;
};
extern MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>> internalDgusSerial;
#endif
// Use the UART for Bluetooth in AT90USB configurations
#if defined(USBCON) && ENABLED(BLUETOOTH)
extern HardwareSerial bluetoothSerial;

View File

@@ -232,6 +232,22 @@ void setup_endstop_interrupts() {
pciSetup(Z3_MIN_PIN);
#endif
#endif
#if HAS_Z4_MAX
#if (digitalPinToInterrupt(Z4_MAX_PIN) != NOT_AN_INTERRUPT)
_ATTACH(Z4_MAX_PIN);
#else
static_assert(digitalPinHasPCICR(Z4_MAX_PIN), "Z4_MAX_PIN is not interrupt-capable");
pciSetup(Z4_MAX_PIN);
#endif
#endif
#if HAS_Z4_MIN
#if (digitalPinToInterrupt(Z4_MIN_PIN) != NOT_AN_INTERRUPT)
_ATTACH(Z4_MIN_PIN);
#else
static_assert(digitalPinHasPCICR(Z4_MIN_PIN), "Z4_MIN_PIN is not interrupt-capable");
pciSetup(Z4_MIN_PIN);
#endif
#endif
#if HAS_Z_MIN_PROBE_PIN
#if (digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT)
_ATTACH(Z_MIN_PROBE_PIN);

View File

@@ -279,14 +279,25 @@ enum ClockSource2 : char {
*/
// Determine which harware PWMs are already in use
#define _PWM_CHK_FAN_B(P) (P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == E6_AUTO_FAN_PIN || P == E7_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN)
#if PIN_EXISTS(CONTROLLER_FAN)
#define PWM_CHK_FAN_B(P) (P == CONTROLLER_FAN_PIN || P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN)
#define PWM_CHK_FAN_B(P) (_PWM_CHK_FAN_B(P) || P == CONTROLLER_FAN_PIN)
#else
#define PWM_CHK_FAN_B(P) (P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN)
#define PWM_CHK_FAN_B(P) _PWM_CHK_FAN_B(P)
#endif
#if ANY_PIN(FAN, FAN1, FAN2)
#if PIN_EXISTS(FAN2)
#if ANY_PIN(FAN, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7)
#if PIN_EXISTS(FAN7)
#define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN || P == FAN5_PIN || P == FAN6_PIN || P == FAN7_PIN)
#elif PIN_EXISTS(FAN6)
#define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN || P == FAN5_PIN || P == FAN6_PIN)
#elif PIN_EXISTS(FAN5)
#define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN || P == FAN5_PIN)
#elif PIN_EXISTS(FAN4)
#define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN)
#elif PIN_EXISTS(FAN3)
#define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN)
#elif PIN_EXISTS(FAN2)
#define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN)
#elif PIN_EXISTS(FAN1)
#define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN)

View File

@@ -59,3 +59,7 @@
#if HAS_TRINAMIC && ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
#error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
#endif
#if TMC_HAS_SW_SERIAL && ENABLED(MONITOR_DRIVER_STATUS)
#error "MONITOR_DRIVER_STATUS causes performance issues when used with SoftwareSerial-connected drivers. Disable MONITOR_DRIVER_STATUS or use hardware serial to continue."
#endif

View File

@@ -231,11 +231,10 @@ static void err_is_interrupt() { SERIAL_ECHOPGM(" compare interrupt enabled"
static void err_prob_interrupt() { SERIAL_ECHOPGM(" overflow interrupt enabled"); }
static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin"); SERIAL_ECHO_SP(14); }
void com_print(uint8_t N, uint8_t Z) {
inline void com_print(const uint8_t N, const uint8_t Z) {
const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
SERIAL_ECHOPGM(" COM");
SERIAL_CHAR('0' + N);
SERIAL_CHAR('A' + Z);
SERIAL_CHAR('0' + N, Z);
SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03));
}
@@ -247,8 +246,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
SERIAL_ECHOPGM(" TIMER");
SERIAL_CHAR(T + '0');
SERIAL_CHAR(L);
SERIAL_CHAR(T + '0', L);
SERIAL_ECHO_SP(3);
if (N == 3) {

View File

@@ -28,7 +28,7 @@
#include "watchdog.h"
#include "../../Marlin.h"
#include "../../MarlinCore.h"
// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s.
void watchdog_init() {

View File

@@ -94,8 +94,8 @@ int freeMemory() {
// ADC
// ------------------------
void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = analogRead(adc_pin);
void HAL_adc_start_conversion(const uint8_t ch) {
HAL_adc_result = analogRead(ch);
}
uint16_t HAL_adc_get_result() {

View File

@@ -56,8 +56,7 @@
#ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration."
#endif
#if SERIAL_PORT_2 == -1
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 customizedSerial2
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 Serial
@@ -75,6 +74,27 @@
#define NUM_SERIAL 1
#endif
#ifdef DGUS_SERIAL_PORT
#if DGUS_SERIAL_PORT == SERIAL_PORT
#error "DGUS_SERIAL_PORT must be different from SERIAL_PORT. Please update your configuration."
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
#elif DGUS_SERIAL_PORT == -1
#define DGUS_SERIAL internalDgusSerial
#elif DGUS_SERIAL_PORT == 0
#define DGUS_SERIAL Serial
#elif DGUS_SERIAL_PORT == 1
#define DGUS_SERIAL Serial1
#elif DGUS_SERIAL_PORT == 2
#define DGUS_SERIAL Serial2
#elif DGUS_SERIAL_PORT == 3
#define DGUS_SERIAL Serial3
#else
#error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#endif
#include "MarlinSerial.h"
#include "MarlinSerialUSB.h"
@@ -128,16 +148,16 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
#endif
#define HAL_ANALOG_SELECT(pin)
#define HAL_ANALOG_SELECT(ch)
inline void HAL_adc_init() {}//todo
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch)
#define HAL_ADC_RESOLUTION 10
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true
void HAL_adc_start_conversion(const uint8_t adc_pin);
void HAL_adc_start_conversion(const uint8_t ch);
uint16_t HAL_adc_get_result();
//

View File

@@ -240,7 +240,7 @@
}
// all the others
static uint32_t spiDelayCyclesX4 = (F_CPU) / 1000000; // 4uS => 125khz
static uint32_t spiDelayCyclesX4 = (F_CPU) / 1000000; // 4µs => 125khz
static uint8_t spiTransferX(uint8_t b) { // using Mode 0
int bits = 8;

View File

@@ -31,7 +31,7 @@
#include "MarlinSerial.h"
#include "InterruptVectors.h"
#include "../../Marlin.h"
#include "../../MarlinCore.h"
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } };
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_t MarlinSerial<Cfg>::tx_buffer = { 0 };

View File

@@ -63,7 +63,7 @@
#include <U8glib.h>
#include "../../../Marlin.h"
#include "../../../MarlinCore.h"
void spiBegin();
void spiInit(uint8_t spiRate);

View File

@@ -77,6 +77,12 @@ void setup_endstop_interrupts() {
#if HAS_Z3_MIN
_ATTACH(Z3_MIN_PIN);
#endif
#if HAS_Z4_MAX
_ATTACH(Z4_MAX_PIN);
#endif
#if HAS_Z4_MIN
_ATTACH(Z4_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
_ATTACH(Z_MIN_PROBE_PIN);
#endif

View File

@@ -55,3 +55,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
#if TMC_HAS_SW_SERIAL
#error "TMC220x Software Serial is not supported on this platform."
#endif

View File

@@ -1479,7 +1479,7 @@ static void udd_ctrl_in_sent(void)
// The IN data don't must be written in endpoint 0 DPRAM during
// a next setup reception in same endpoint 0 DPRAM.
// Thereby, an OUT ZLP reception must check before IN data write
// and if no OUT ZLP is recevied the data must be written quickly (800us)
// and if no OUT ZLP is received the data must be written quickly (800µs)
// before an eventually ZLP OUT and SETUP reception
flags = cpu_irq_save();
if (Is_udd_out_received(0)) {

View File

@@ -23,7 +23,7 @@
#ifdef ARDUINO_ARCH_SAM
#include "../../inc/MarlinConfig.h"
#include "../../Marlin.h"
#include "../../MarlinCore.h"
#include "watchdog.h"
// Override Arduino runtime to either config or disable the watchdog

View File

@@ -30,10 +30,6 @@
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(WEBSUPPORT)
#include "spiffs.h"
#endif
#if ENABLED(WIFISUPPORT)
#include <ESPAsyncWebServer.h>
#include "wifi.h"
@@ -41,6 +37,7 @@
#include "ota.h"
#endif
#if ENABLED(WEBSUPPORT)
#include "spiffs.h"
#include "web.h"
#endif
#endif
@@ -78,21 +75,32 @@ volatile int numPWMUsed = 0,
// Public functions
// ------------------------
void HAL_init() {
i2s_init();
}
#if ENABLED(WIFI_CUSTOM_COMMAND)
bool wifi_custom_command(char * const command_ptr) {
#if ENABLED(ESP3D_WIFISUPPORT)
return esp3dlib.parse(command_ptr);
#else
UNUSED(command_ptr);
return false;
#endif
}
#endif
void HAL_init() { i2s_init(); }
void HAL_init_board() {
#if ENABLED(WEBSUPPORT)
spiffs_init();
#endif
#if ENABLED(WIFISUPPORT)
#if ENABLED(ESP3D_WIFISUPPORT)
esp3dlib.init();
#elif ENABLED(WIFISUPPORT)
wifi_init();
#if ENABLED(OTASUPPORT)
OTA_init();
#endif
#if ENABLED(WEBSUPPORT)
spiffs_init();
web_init();
#endif
server.begin();
@@ -100,9 +108,12 @@ void HAL_init_board() {
}
void HAL_idletask() {
#if ENABLED(OTASUPPORT)
#if BOTH(WIFISUPPORT, OTASUPPORT)
OTA_handle();
#endif
#if ENABLED(ESP3D_WIFISUPPORT)
esp3dlib.idletask();
#endif
}
void HAL_clear_reset_source() { }
@@ -183,7 +194,7 @@ void HAL_adc_init() {
}
}
void HAL_adc_start_conversion(uint8_t adc_pin) {
void HAL_adc_start_conversion(const uint8_t adc_pin) {
const adc1_channel_t chan = get_channel(adc_pin);
uint32_t mv;
esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv);

View File

@@ -36,7 +36,14 @@
#include "timers.h"
#include "WebSocketSerial.h"
#if ENABLED(WIFISUPPORT)
#include "WebSocketSerial.h"
#endif
#if ENABLED(ESP3D_WIFISUPPORT)
#include "esp3dlib.h"
#endif
#include "FlushableHardwareSerial.h"
// ------------------------
@@ -47,9 +54,13 @@ extern portMUX_TYPE spinlock;
#define MYSERIAL0 flushableSerial
#if ENABLED(WIFISUPPORT)
#if EITHER(WIFISUPPORT, ESP3D_WIFISUPPORT)
#if ENABLED(ESP3D_WIFISUPPORT)
#define MYSERIAL1 Serial2Socket
#else
#define MYSERIAL1 webSocketSerial
#endif
#define NUM_SERIAL 2
#define MYSERIAL1 webSocketSerial
#else
#define NUM_SERIAL 1
#endif
@@ -60,7 +71,6 @@ extern portMUX_TYPE spinlock;
#define ENABLE_ISRS() if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock)
#define DISABLE_ISRS() portENTER_CRITICAL(&spinlock)
// Fix bug in pgm_read_ptr
#undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr))
@@ -115,7 +125,7 @@ void HAL_adc_init();
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true
void HAL_adc_start_conversion(uint8_t adc_pin);
void HAL_adc_start_conversion(const uint8_t adc_pin);
#define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin
@@ -127,3 +137,44 @@ void HAL_adc_start_conversion(uint8_t adc_pin);
void HAL_idletask();
void HAL_init();
void HAL_init_board();
//
// Delay in cycles (used by DELAY_NS / DELAY_US)
//
FORCE_INLINE static void DELAY_CYCLES(uint32_t x) {
unsigned long start, ccount, stop;
/**
* It's important to care for race conditions (and overflows) here.
* Race condition example: If `stop` calculates to being close to the upper boundary of
* `uint32_t` and if at the same time a longer loop interruption kicks in (e.g. due to other
* FreeRTOS tasks or interrupts), `ccount` might overflow (and therefore be below `stop` again)
* without the loop ever being able to notice that `ccount` had already been above `stop` once
* (and that therefore the number of cycles to delay has already passed).
* As DELAY_CYCLES (through DELAY_NS / DELAY_US) is used by software SPI bit banging to drive
* LCDs and therefore might be called very, very often, this seemingly improbable situation did
* actually happen in reality. It resulted in apparently random print pauses of ~17.9 seconds
* (0x100000000 / 240 MHz) or multiples thereof, essentially ruining the current print by causing
* large blobs of filament.
*/
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (start) );
stop = start + x;
ccount = start;
if (stop >= start) {
// no overflow, so only loop while in between start and stop:
// 0x00000000 -----------------start****stop-- 0xffffffff
while (ccount >= start && ccount < stop) {
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
}
}
else {
// stop did overflow, so only loop while outside of stop and start:
// 0x00000000 **stop-------------------start** 0xffffffff
while (ccount >= start || ccount < stop) {
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
}
}
}

View File

@@ -37,7 +37,7 @@ Servo::Servo() {
int8_t Servo::attach(const int inPin) {
if (channel >= CHANNEL_MAX_NUM) return -1;
if (pin > 0) pin = inPin;
if (inPin > 0) pin = inPin;
ledcSetup(channel, 50, 16); // channel X, 50 Hz, 16-bit depth
ledcAttachPin(pin, channel);

View File

@@ -72,6 +72,12 @@ void setup_endstop_interrupts() {
#if HAS_Z3_MIN
_ATTACH(Z3_MIN_PIN);
#endif
#if HAS_Z4_MAX
_ATTACH(Z4_MAX_PIN);
#endif
#if HAS_Z4_MIN
_ATTACH(Z4_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
_ATTACH(Z_MIN_PROBE_PIN);
#endif

View File

@@ -177,7 +177,7 @@ int i2s_init() {
*
* fwclk = fbclk / 32
*
* for fwclk = 250kHz (4uS pulse time)
* for fwclk = 250kHz (4µS pulse time)
* N = 10
* M = 20
*/

View File

@@ -28,3 +28,11 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
#if TMC_HAS_SW_SERIAL
#error "TMC220x Software Serial is not supported on this platform."
#endif
#if BOTH(WIFISUPPORT, ESP3D_WIFISUPPORT)
#error "Only enable one WiFi option, either WIFISUPPORT or ESP3D_WIFISUPPORT."
#endif

View File

@@ -21,7 +21,7 @@
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(OTASUPPORT)
#if BOTH(WIFISUPPORT, OTASUPPORT)
#include <WiFi.h>
#include <ESPmDNS.h>
@@ -67,6 +67,5 @@ void OTA_handle() {
ArduinoOTA.handle();
}
#endif // OTASUPPORT
#endif // WIFISUPPORT && OTASUPPORT
#endif // ARDUINO_ARCH_ESP32

View File

@@ -24,7 +24,7 @@
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(WEBSUPPORT)
#if BOTH(WIFISUPPORT, WEBSUPPORT)
#include "../../core/serial.h"
@@ -40,5 +40,5 @@ void spiffs_init() {
SERIAL_ERROR_MSG("SPIFFS mount failed");
}
#endif // WEBSUPPORT
#endif // WIFISUPPORT && WEBSUPPORT
#endif // ARDUINO_ARCH_ESP32

View File

@@ -47,7 +47,7 @@ typedef uint64_t hal_timer_t;
#if ENABLED(I2S_STEPPER_STREAM)
#define STEPPER_TIMER_PRESCALE 1
#define STEPPER_TIMER_RATE 250000 // 250khz, 4us pulses of i2s word clock
#define STEPPER_TIMER_RATE 250000 // 250khz, 4µs pulses of i2s word clock
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs // wrong would be 0.25
#else
#define STEPPER_TIMER_PRESCALE 40

View File

@@ -22,13 +22,12 @@
#ifdef ARDUINO_ARCH_ESP32
#include <SPIFFS.h>
#undef DISABLED // esp32-hal-gpio.h
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(WEBSUPPORT)
#if BOTH(WIFISUPPORT, WEBSUPPORT)
#undef DISABLED // esp32-hal-gpio.h
#include <SPIFFS.h>
#include "wifi.h"
AsyncEventSource events("/events"); // event source (Server-Sent events)
@@ -43,5 +42,5 @@ void web_init() {
server.onNotFound(onNotFound);
}
#endif // WEBSUPPORT
#endif // WIFISUPPORT && WEBSUPPORT
#endif // ARDUINO_ARCH_ESP32

View File

@@ -55,7 +55,7 @@ void HAL_adc_init() {
}
void HAL_adc_enable_channel(int ch) {
void HAL_adc_enable_channel(const uint8_t ch) {
}

View File

@@ -87,15 +87,15 @@ int freeMemory();
#pragma GCC diagnostic pop
// ADC
#define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin)
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_ADC_RESOLUTION 10
#define HAL_READ_ADC() HAL_adc_get_result()
#define HAL_ADC_READY() true
#define HAL_ANALOG_SELECT(ch) HAL_adc_enable_channel(ch)
#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch)
#define HAL_ADC_RESOLUTION 10
#define HAL_READ_ADC() HAL_adc_get_result()
#define HAL_ADC_READY() true
void HAL_adc_init();
void HAL_adc_enable_channel(int pin);
void HAL_adc_start_conversion(const uint8_t adc_pin);
void HAL_adc_enable_channel(const uint8_t ch);
void HAL_adc_start_conversion(const uint8_t ch);
uint16_t HAL_adc_get_result();
// Reset source

View File

@@ -33,3 +33,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
#if TMC_HAS_SW_SERIAL
#error "TMC220x Software Serial is not supported on this platform."
#endif

View File

@@ -61,10 +61,6 @@ extern "C" volatile uint32_t _millis;
#define ST7920_DELAY_3 DELAY_NS(750)
#endif
#if !WITHIN(SERIAL_PORT, -1, 3)
#error "SERIAL_PORT must be from -1 to 3"
#endif
#if SERIAL_PORT == -1
#define MYSERIAL0 UsbSerial
#elif SERIAL_PORT == 0
@@ -75,16 +71,14 @@ extern "C" volatile uint32_t _millis;
#define MYSERIAL0 MSerial2
#elif SERIAL_PORT == 3
#define MYSERIAL0 MSerial3
#else
#error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 3)
#error "SERIAL_PORT_2 must be from -1 to 3"
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#if SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 UsbSerial
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 MSerial
@@ -94,11 +88,34 @@ extern "C" volatile uint32_t _millis;
#define MYSERIAL1 MSerial2
#elif SERIAL_PORT_2 == 3
#define MYSERIAL1 MSerial3
#else
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
#endif
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif
#ifdef DGUS_SERIAL_PORT
#if DGUS_SERIAL_PORT == SERIAL_PORT
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
#elif DGUS_SERIAL_PORT == -1
#define DGUS_SERIAL UsbSerial
#elif DGUS_SERIAL_PORT == 0
#define DGUS_SERIAL MSerial
#elif DGUS_SERIAL_PORT == 1
#define DGUS_SERIAL MSerial1
#elif DGUS_SERIAL_PORT == 2
#define DGUS_SERIAL MSerial2
#elif DGUS_SERIAL_PORT == 3
#define DGUS_SERIAL MSerial3
#else
#error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#endif
//
// Interrupts
//

View File

@@ -93,7 +93,7 @@ void setup_endstop_interrupts() {
_ATTACH(Z2_MIN_PIN);
#endif
#if HAS_Z3_MAX
#if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN)
#if !LPC1768_PIN_INTERRUPT_M(Z3_MAX_PIN)
#error "Z3_MIN_PIN is not INTERRUPT-capable."
#endif
_ATTACH(Z3_MAX_PIN);
@@ -104,6 +104,18 @@ void setup_endstop_interrupts() {
#endif
_ATTACH(Z3_MIN_PIN);
#endif
#if HAS_Z4_MAX
#if !LPC1768_PIN_INTERRUPT_M(Z4_MAX_PIN)
#error "Z4_MIN_PIN is not INTERRUPT-capable."
#endif
_ATTACH(Z4_MAX_PIN);
#endif
#if HAS_Z4_MIN
#if !LPC1768_PIN_INTERRUPT_M(Z4_MIN_PIN)
#error "Z4_MIN_PIN is not INTERRUPT-capable."
#endif
_ATTACH(Z4_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 INTERRUPT-capable."

View File

@@ -46,6 +46,10 @@
#error "TEMP_4_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
#elif _OLD_TEMP_PIN(TEMP_5)
#error "TEMP_5_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
#elif _OLD_TEMP_PIN(TEMP_6)
#error "TEMP_6_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
#elif _OLD_TEMP_PIN(TEMP_7)
#error "TEMP_7_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
#endif
#undef _OLD_TEMP_PIN

View File

@@ -20,8 +20,10 @@
*
*/
// adapted from I2C/master/master.c example
// https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html
/**
* digipot_mcp4451_I2C_routines.c
* Adapted from https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html
*/
#ifdef TARGET_LPC1768
@@ -29,12 +31,12 @@
#if MB(MKS_SBASE)
#include "digipot_mcp4451_I2C_routines.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "digipot_mcp4451_I2C_routines.h"
// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to
// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them.
@@ -60,7 +62,6 @@ static void _I2C_Stop(LPC_I2C_TypeDef *I2Cx) {
I2Cx->I2CONCLR = I2C_I2CONCLR_SIC;
}
PINSEL_CFG_Type PinCfg;
I2C_M_SETUP_Type transferMCfg;
#define I2C_status (LPC_I2C1->I2STAT & I2C_STAT_CODE_BITMASK)
@@ -89,41 +90,6 @@ uint8_t digipot_mcp4451_start(uint8_t sla) { // send slave address and write bi
return 1;
}
void digipot_mcp4451_init() {
/**
* Init I2C pin connect
*/
PinCfg.OpenDrain = 0;
PinCfg.Pinmode = 0;
#if USEDI2CDEV_M == 0
PinCfg.Funcnum = 1;
PinCfg.Pinnum = 27;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg); // SDA0 / D57 AUX-1
PinCfg.Pinnum = 28;
PINSEL_ConfigPin(&PinCfg); // SCL0 / D58 AUX-1
#elif USEDI2CDEV_M == 1
PinCfg.Funcnum = 3;
PinCfg.Pinnum = 0;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg); // SDA1 / D20 SCA
PinCfg.Pinnum = 1;
PINSEL_ConfigPin(&PinCfg); // SCL1 / D21 SCL
#elif USEDI2CDEV_M == 2
PinCfg.Funcnum = 2;
PinCfg.Pinnum = 10;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg); // SDA2 / D38 X_ENABLE_PIN
PinCfg.Pinnum = 11;
PINSEL_ConfigPin(&PinCfg); // SCL2 / D55 X_DIR_PIN
#endif
// Initialize I2C peripheral
I2C_Init(I2CDEV_M, 400000); // hardwired to 400KHz bit rate, 100KHz is the other option
// Enable Master I2C operation
I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE);
}
uint8_t digipot_mcp4451_send_byte(uint8_t data) {
LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data
LPC_I2C1->I2CONSET = I2C_I2CONSET_AA;

View File

@@ -21,20 +21,10 @@
*/
#pragma once
// adapted from I2C/master/master.c example
// https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html
#define USEDI2CDEV_M 1 // use I2C1 controller
#if USEDI2CDEV_M == 0
#define I2CDEV_M LPC_I2C0
#elif USEDI2CDEV_M == 1
#define I2CDEV_M LPC_I2C1
#elif USEDI2CDEV_M == 2
#define I2CDEV_M LPC_I2C2
#else
#error "Master I2C device not defined!"
#endif
/**
* digipot_mcp4451_I2C_routines.h
* Adapted from https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html
*/
#ifdef __cplusplus
extern "C" {
@@ -43,9 +33,9 @@
#include <lpc17xx_i2c.h>
#include <lpc17xx_pinsel.h>
#include <lpc17xx_libcfg_default.h>
#include "i2c_util.h"
uint8_t digipot_mcp4451_start(uint8_t sla);
void digipot_mcp4451_init();
uint8_t digipot_mcp4451_send_byte(uint8_t data);
#ifdef __cplusplus

View File

@@ -0,0 +1,70 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* HAL_LPC1768/include/i2c_util.c
*/
#ifdef TARGET_LPC1768
#include "i2c_util.h"
#define U8G_I2C_OPT_FAST 16 // from u8g.h
#ifdef __cplusplus
extern "C" {
#endif
void configure_i2c(const uint8_t clock_option) {
/**
* Init I2C pin connect
*/
PINSEL_CFG_Type PinCfg;
PinCfg.OpenDrain = 0;
PinCfg.Pinmode = 0;
PinCfg.Portnum = 0;
#if I2C_MASTER_ID == 0
PinCfg.Funcnum = 1;
PinCfg.Pinnum = 27; // SDA0 / D57 AUX-1 ... SCL0 / D58 AUX-1
#elif I2C_MASTER_ID == 1
PinCfg.Funcnum = 3;
PinCfg.Pinnum = 0; // SDA1 / D20 SCA ... SCL1 / D21 SCL
#elif I2C_MASTER_ID == 2
PinCfg.Funcnum = 2;
PinCfg.Pinnum = 10; // SDA2 / D38 X_ENABLE_PIN ... SCL2 / D55 X_DIR_PIN
#endif
PINSEL_ConfigPin(&PinCfg);
PinCfg.Pinnum += 1;
PINSEL_ConfigPin(&PinCfg);
// Initialize I2C peripheral
I2C_Init(I2CDEV_M, (clock_option & U8G_I2C_OPT_FAST) ? 400000: 100000); // LCD data rates
// Enable Master I2C operation
I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE);
}
#ifdef __cplusplus
}
#endif
#endif // TARGET_LPC1768

View File

@@ -0,0 +1,56 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* HAL_LPC1768/include/i2c_util.h
*/
#include "../../../inc/MarlinConfigPre.h"
#ifndef I2C_MASTER_ID
#define I2C_MASTER_ID 1
#endif
#if I2C_MASTER_ID == 0
#define I2CDEV_M LPC_I2C0
#elif I2C_MASTER_ID == 1
#define I2CDEV_M LPC_I2C1
#elif I2C_MASTER_ID == 2
#define I2CDEV_M LPC_I2C2
#else
#error "Master I2C device not defined!"
#endif
#include <lpc17xx_i2c.h>
#include <lpc17xx_pinsel.h>
#include <lpc17xx_libcfg_default.h>
#ifdef __cplusplus
extern "C" {
#endif
void configure_i2c(const uint8_t clock_option);
#ifdef __cplusplus
}
#endif

View File

@@ -25,25 +25,21 @@
#ifdef TARGET_LPC1768
#include "../include/i2c_util.h"
#include "../../../core/millis_t.h"
extern int millis();
#ifdef __cplusplus
extern "C" {
#endif
#include <lpc17xx_i2c.h>
#include <lpc17xx_pinsel.h>
#include <lpc17xx_libcfg_default.h>
#include "../../../core/millis_t.h"
//////////////////////////////////////////////////////////////////////////////////////
// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to
// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them.
static uint32_t _I2C_Start (LPC_I2C_TypeDef *I2Cx) {
static uint32_t _I2C_Start(LPC_I2C_TypeDef *I2Cx) {
// Reset STA, STO, SI
I2Cx->I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC;
@@ -67,30 +63,16 @@ static void _I2C_Stop (LPC_I2C_TypeDef *I2Cx) {
//////////////////////////////////////////////////////////////////////////////////////
#define U8G_I2C_OPT_FAST 16 // from u8g.h
#define USEDI2CDEV_M 1
#define I2CDEV_S_ADDR 0x78 // from SSD1306 //actual address is 0x3C - shift left 1 with LSB set to 0 to indicate write
#define BUFFER_SIZE 0x1 // only do single byte transfers with LCDs
#if (USEDI2CDEV_M == 0)
#define I2CDEV_M LPC_I2C0
#elif (USEDI2CDEV_M == 1)
#define I2CDEV_M LPC_I2C1
#elif (USEDI2CDEV_M == 2)
#define I2CDEV_M LPC_I2C2
#else
#error "Master I2C device not defined!"
#endif
PINSEL_CFG_Type PinCfg;
I2C_M_SETUP_Type transferMCfg;
#define I2C_status (LPC_I2C1->I2STAT & I2C_STAT_CODE_BITMASK)
uint8_t u8g_i2c_start(uint8_t sla) { // send slave address and write bit
// Send slave address and write bit
uint8_t u8g_i2c_start(const uint8_t sla) {
// Sometimes TX data ACK or NAK status is returned. That mean the start state didn't
// happen which means only the value of the slave address was send. Keep looping until
// the slave address and write bit are actually sent.
@@ -114,44 +96,9 @@ uint8_t u8g_i2c_start(uint8_t sla) { // send slave address and write bit
return 1;
}
void u8g_i2c_init(uint8_t clock_option) {
/**
* Init I2C pin connect
*/
PinCfg.OpenDrain = 0;
PinCfg.Pinmode = 0;
#if ((USEDI2CDEV_M == 0))
PinCfg.Funcnum = 1;
PinCfg.Pinnum = 27;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg); // SDA0 / D57 AUX-1
PinCfg.Pinnum = 28;
PINSEL_ConfigPin(&PinCfg); // SCL0 / D58 AUX-1
#endif
#if ((USEDI2CDEV_M == 1))
PinCfg.Funcnum = 3;
PinCfg.Pinnum = 0;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg); // SDA1 / D20 SCA
PinCfg.Pinnum = 1;
PINSEL_ConfigPin(&PinCfg); // SCL1 / D21 SCL
#endif
#if ((USEDI2CDEV_M == 2))
PinCfg.Funcnum = 2;
PinCfg.Pinnum = 10;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg); // SDA2 / D38 X_ENABLE_PIN
PinCfg.Pinnum = 11;
PINSEL_ConfigPin(&PinCfg); // SCL2 / D55 X_DIR_PIN
#endif
// Initialize I2C peripheral
I2C_Init(I2CDEV_M, (clock_option & U8G_I2C_OPT_FAST) ? 400000: 100000); // LCD data rates
// Enable Master I2C operation
I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE);
u8g_i2c_start(0); // send slave address and write bit
void u8g_i2c_init(const uint8_t clock_option) {
configure_i2c(clock_option);
u8g_i2c_start(0); // Send slave address and write bit
}
uint8_t u8g_i2c_send_byte(uint8_t data) {

View File

@@ -21,8 +21,8 @@
*/
#pragma once
void u8g_i2c_init(uint8_t options);
uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos);
void u8g_i2c_init(const uint8_t clock_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();

View File

@@ -26,8 +26,8 @@
*
* These are based on the LPC1768 routines.
*
* Couldn't just call exact copies because the overhead resulted in the
* one microsecond delay being about 4uS.
* Couldn't just call exact copies because the overhead
* results in a one microsecond delay taking about 4µS.
*/
#ifdef __cplusplus

View File

@@ -86,8 +86,6 @@
#define I2C_CMD_MODE 0x000
#define I2C_DATA_MODE 0x040
//#define U8G_I2C_OPT_FAST 16
uint8_t u8g_com_ssd_I2C_start_sequence(u8g_t *u8g) {
/* are we requested to set the a0 state? */
if (u8g->pin_list[U8G_PI_SET_A0] == 0) return 1;

View File

@@ -1,254 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Based on U8G2 code - u8x8_byte.c
*
* Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
*
* Copyright (c) 2016, olikraus@gmail.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Software i2c,
* ignores ACK response (which is anyway not provided by some displays)
* also does not allow reading from the device
*/
#ifdef TARGET_LPC1768
#include "../../inc/MarlinConfigPre.h"
#if HAS_GRAPHICAL_LCD
#include <U8glib.h>
//void pinMode(int16_t pin, uint8_t mode);
//void digitalWrite(int16_t pin, uint8_t pin_status);
#define I2C_SLA (0x3C*2)
//#define I2C_CMD_MODE 0x080
#define I2C_CMD_MODE 0x000
#define I2C_DATA_MODE 0x040
//static uint8_t I2C_speed; // 3 - 400KHz, 13 - 100KHz
//#define SPEED_400KHz 3
//#define SPEED_100KHz 13
// #define U8G_I2C_OPT_FAST 16
uint8_t SCL_pin_HAL_LPC1768_sw_I2C, SCL_port_HAL_LPC1768_sw_I2C, SDA_pin_HAL_LPC1768_sw_I2C, SDA_port_HAL_LPC1768_sw_I2C;
#define SPI_SPEED 2 //20: 200KHz 5:750KHz 2:3-4MHz
uint8_t u8g_i2c_send_byte_sw(uint8_t data) {
for (uint8_t i = 0; i < 9; i++) { // 1 extra bit for the ack/nak
if (val & 0x80)
for (uint8_t j = 0; j < SPI_SPEED; j++) {
LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
}
else
for (uint8_t j = 0; j < SPI_SPEED; j++) {
LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
}
for (uint8_t j = 0; j < SPI_SPEED; j++) {
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
}
for (uint8_t j = 0; j < SPI_SPEED; j++) {
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
}
val <<= 1;
}
return 1;
}
uint8_t u8g_i2c_start_sw(uint8_t sla) { // assert start condition and then send slave address with write bit
/* send the start condition, both lines go from 1 to 0 */
LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
DELAY_US(2);
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
DELAY_US(2);
LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
DELAY_US(2);
LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
DELAY_US(2);
LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
u8g_i2c_send_byte_sw(I2C_SLA); // send slave address with write bit
}
void u8g_i2c_stop_sw() { }
void u8g_i2c_init_sw(uint8_t clock_option) { u8g_i2c_start(0); } // send slave address and write bit
uint8_t u8g_com_ssd_I2C_start_sequence_sw(u8g_t *u8g) {
/* are we requested to set the a0 state? */
if (u8g->pin_list[U8G_PI_SET_A0] == 0) return 1;
/* setup bus, might be a repeated start */
if (u8g_i2c_start(I2C_SLA) == 0) return 0;
if (u8g->pin_list[U8G_PI_A0_STATE] == 0) {
if (u8g_i2c_send_byte(I2C_CMD_MODE) == 0) return 0;
}
else if (u8g_i2c_send_byte(I2C_DATA_MODE) == 0) return 0;
u8g->pin_list[U8G_PI_SET_A0] = 0;
return 1;
}
uint8_t u8g_com_HAL_LPC1768_ssd_sw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
switch (msg) {
case U8G_COM_MSG_INIT:
#define LPC1768_PIN_PORT(pin) ((uint8_t)((pin >> 5) & 0b111))
#define LPC1768_PIN_PIN(pin) ((uint8_t)(pin & 0b11111))
SCL_pin_HAL_LPC1768_sw_I2C = LPC1768_PIN_PIN(u8g->pin_list[U8G_PI_SCL]);
SCL_port_HAL_LPC1768_sw_I2C = LPC1768_PIN_PORT(u8g->pin_list[U8G_PI_SCL]);
SDA_pin_HAL_LPC1768_sw_I2C = LPC1768_PIN_PIN(u8g->pin_list[U8G_PI_SDA]);
SDA_port_HAL_LPC1768_sw_I2C = LPC1768_PIN_PORT(u8g->pin_list[U8G_PI_SDA]);
// As defined by Arduino INPUT(0x0), OUTPUT(0x1), INPUT_PULLUP(0x2)
#define OUTPUT 0x1
u8g_SetPIOutput(u8g, U8G_PI_SCL);
u8g_SetPIOutput(u8g, U8G_PI_SDA);
if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_CS]) u8g_SetPIOutput(u8g, U8G_PI_CS);
if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_A0]) u8g_SetPIOutput(u8g, U8G_PI_A0);
if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPIOutput(u8g, U8G_PI_RESET);
//u8g_com_arduino_digital_write(u8g, U8G_PI_SCL, HIGH);
//u8g_com_arduino_digital_write(u8g, U8G_PI_SDA, HIGH);
//u8g->pin_list[U8G_PI_A0_STATE] = 0; /* initial RS state: unknown mode */
u8g_i2c_init_sw(u8g->pin_list[U8G_PI_I2C_OPTION]);
u8g_com_ssd_I2C_start_sequence_sw(u8g);
break;
case U8G_COM_MSG_STOP: break;
case U8G_COM_MSG_RESET: break;
case U8G_COM_MSG_CHIP_SELECT:
u8g->pin_list[U8G_PI_A0_STATE] = 0;
u8g->pin_list[U8G_PI_SET_A0] = 1; /* force a0 to set again, also forces start condition */
if (arg_val == 0) {
/* disable chip, send stop condition */
u8g_i2c_stop_sw();
}
else {
/* enable, do nothing: any byte writing will trigger the i2c start */
}
break;
case U8G_COM_MSG_WRITE_BYTE:
//u8g->pin_list[U8G_PI_SET_A0] = 1;
//if (u8g_com_arduino_ssd_start_sequence(u8g) == 0)
// return u8g_i2c_stop(), 0;
if (u8g_i2c_send_byte_sw(arg_val) == 0)
return u8g_i2c_stop_sw(), 0;
// u8g_i2c_stop();
break;
case U8G_COM_MSG_WRITE_SEQ: {
//u8g->pin_list[U8G_PI_SET_A0] = 1;
if (u8g_com_ssd_I2C_start_sequence_sw(u8g) == 0)
return u8g_i2c_stop_sw(), 0;
uint8_t *ptr = (uint8_t *)arg_ptr;
while (arg_val > 0) {
if (u8g_i2c_send_byte_sw(*ptr++) == 0)
return u8g_i2c_stop_sw(), 0;
arg_val--;
}
}
// u8g_i2c_stop();
break;
case U8G_COM_MSG_WRITE_SEQ_P: {
//u8g->pin_list[U8G_PI_SET_A0] = 1;
if (u8g_com_ssd_I2C_start_sequence_sw(u8g) == 0)
return u8g_i2c_stop_sw(), 0;
uint8_t *ptr = (uint8_t *)arg_ptr;
while (arg_val > 0) {
if (u8g_i2c_send_byte_sw(u8g_pgm_read(ptr)) == 0) return 0;
ptr++;
arg_val--;
}
}
// u8g_i2c_stop();
break;
case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */
u8g->pin_list[U8G_PI_A0_STATE] = arg_val;
u8g->pin_list[U8G_PI_SET_A0] = 1; /* force a0 to set again */
u8g_i2c_start_sw(0); // send slave address and write bit
u8g_i2c_send_byte_sw(arg_val ? 0x40 : 0x80); // Write to ? Graphics DRAM mode : Command mode
break;
}
return 1;
}
#endif // HAS_GRAPHICAL_LCD
#endif // TARGET_LPC1768

View File

@@ -9,7 +9,9 @@ target_filename = "FIRMWARE.CUR"
target_drive = "REARM"
import os
import getpass
import platform
current_OS = platform.system()
Import("env")
@@ -77,28 +79,26 @@ try:
upload_disk = 'Disk not found'
target_file_found = False
target_drive_found = False
medias = os.listdir('/media') #
for media in medias:
drives = os.listdir('/media/' + media) #
if target_drive in drives and target_file_found == False: # set upload if not found target file yet
target_drive_found = True
upload_disk = '/media/' + media + '/' + target_drive + '/'
drives = os.listdir(os.path.join(os.sep, 'media', getpass.getuser()))
if target_drive in drives: # If target drive is found, use it.
target_drive_found = True
upload_disk = os.path.join(os.sep, 'media', getpass.getuser(), target_drive) + os.sep
else:
for drive in drives:
try:
files = os.listdir('/media/' + media + '/' + drive)
files = os.listdir(os.path.join(os.sep, 'media', getpass.getuser(), drive))
except:
continue
else:
if target_filename in files:
if target_file_found == False:
upload_disk = '/media/' + media + '/' + drive + '/'
target_file_found = True
upload_disk = os.path.join(os.sep, 'media', getpass.getuser(), drive) + os.sep
target_file_found = True
break
#
# set upload_port to drive if found
#
if target_file_found == True or target_drive_found == True:
if target_file_found or target_drive_found:
env.Replace(
UPLOAD_FLAGS="-P$UPLOAD_PORT",
UPLOAD_PORT=upload_disk

View File

@@ -68,5 +68,4 @@ bool watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); }
void watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); }
#endif // USE_WATCHDOG
#endif // TARGET_LPC1768

View File

@@ -59,6 +59,21 @@
#else
#define GET_TEMP_5_ADC() -1
#endif
#if HAS_TEMP_ADC_6
#define GET_TEMP_6_ADC() PIN_TO_ADC(TEMP_6_PIN)
#else
#define GET_TEMP_6_ADC() -1
#endif
#if HAS_TEMP_ADC_7
#define GET_TEMP_7_ADC() PIN_TO_ADC(TEMP_7_PIN)
#else
#define GET_TEMP_7_ADC() -1
#endif
#if HAS_TEMP_PROBE
#define GET_PROBE_ADC() PIN_TO_ADC(TEMP_PROBE_PIN)
#else
#define GET_PROBE_ADC() -1
#endif
#if HAS_TEMP_ADC_BED
#define GET_BED_ADC() PIN_TO_ADC(TEMP_BED_PIN)
#else
@@ -80,12 +95,15 @@
#define GET_BUTTONS_ADC() -1
#endif
#define IS_ADC_REQUIRED(n) (GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n \
|| GET_TEMP_3_ADC() == n || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n \
|| GET_BED_ADC() == n \
|| GET_CHAMBER_ADC() == n \
|| GET_FILAMENT_WIDTH_ADC() == n \
|| GET_BUTTONS_ADC() == n)
#define IS_ADC_REQUIRED(n) ( \
GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n || GET_TEMP_3_ADC() == n \
|| GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n || GET_TEMP_6_ADC() == n || GET_TEMP_7_ADC() == n \
|| GET_PROBE_ADC() == n \
|| GET_BED_ADC() == n \
|| GET_CHAMBER_ADC() == n \
|| GET_FILAMENT_WIDTH_ADC() == n \
|| GET_BUTTONS_ADC() == n \
)
#define ADC0_IS_REQUIRED IS_ADC_REQUIRED(0)
#define ADC1_IS_REQUIRED IS_ADC_REQUIRED(1)
@@ -145,6 +163,15 @@ uint16_t HAL_adc_result;
#if GET_TEMP_5_ADC() == 0
TEMP_5_PIN,
#endif
#if GET_TEMP_6_ADC() == 0
TEMP_6_PIN,
#endif
#if GET_TEMP_7_ADC() == 0
TEMP_7_PIN,
#endif
#if GET_PROBE_ADC() == 0
TEMP_PROBE_PIN,
#endif
#if GET_BED_ADC() == 0
TEMP_BED_PIN,
#endif
@@ -176,6 +203,15 @@ uint16_t HAL_adc_result;
#if GET_TEMP_5_ADC() == 1
TEMP_5_PIN,
#endif
#if GET_TEMP_6_ADC() == 1
TEMP_6_PIN,
#endif
#if GET_TEMP_7_ADC() == 1
TEMP_7_PIN,
#endif
#if GET_PROBE_ADC() == 1
TEMP_PROBE_PIN,
#endif
#if GET_BED_ADC() == 1
TEMP_BED_PIN,
#endif
@@ -215,6 +251,15 @@ uint16_t HAL_adc_result;
#if GET_TEMP_5_ADC() == 0
{ PIN_TO_INPUTCTRL(TEMP_5_PIN) },
#endif
#if GET_TEMP_6_ADC() == 0
{ PIN_TO_INPUTCTRL(TEMP_6_PIN) },
#endif
#if GET_TEMP_7_ADC() == 0
{ PIN_TO_INPUTCTRL(TEMP_7_PIN) },
#endif
#if GET_PROBE_ADC() == 0
{ PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) },
#endif
#if GET_BED_ADC() == 0
{ PIN_TO_INPUTCTRL(TEMP_BED_PIN) },
#endif
@@ -255,6 +300,15 @@ uint16_t HAL_adc_result;
#if GET_TEMP_5_ADC() == 1
{ PIN_TO_INPUTCTRL(TEMP_5_PIN) },
#endif
#if GET_TEMP_6_ADC() == 1
{ PIN_TO_INPUTCTRL(TEMP_6_PIN) },
#endif
#if GET_TEMP_7_ADC() == 1
{ PIN_TO_INPUTCTRL(TEMP_7_PIN) },
#endif
#if GET_PROBE_ADC() == 1
{ PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) },
#endif
#if GET_BED_ADC() == 1
{ PIN_TO_INPUTCTRL(TEMP_BED_PIN) },
#endif
@@ -426,7 +480,7 @@ void HAL_adc_init() {
memset(HAL_adc_results, 0xFF, sizeof(HAL_adc_results)); // Fill result with invalid values
for (uint8_t pi = 0; pi < COUNT(adc_pins); ++pi)
pinPeripheral(adc_pins[pi], PIO_ANALOG);
pinPeripheral(adc_pins[pi], PIO_ANALOG);
for (uint8_t ai = FIRST_ADC; ai <= LAST_ADC; ++ai) {
Adc* adc = ((Adc*[])ADC_INSTS)[ai];
@@ -471,8 +525,4 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = 0xFFFF;
}
uint16_t HAL_adc_get_result() {
return HAL_adc_result;
}
#endif // __SAMD51__

View File

@@ -33,11 +33,9 @@
#include "MarlinSerial_AGCM4.h"
// Serial ports
#if !WITHIN(SERIAL_PORT, -1, 3)
#error "SERIAL_PORT must be from -1 to 3"
#endif
// MYSERIAL0 required before MarlinSerial includes!
#if SERIAL_PORT == -1
#define MYSERIAL0 Serial
#elif SERIAL_PORT == 0
@@ -46,18 +44,16 @@
#define MYSERIAL0 Serial2
#elif SERIAL_PORT == 2
#define MYSERIAL0 Serial3
#else
#elif SERIAL_PORT == 3
#define MYSERIAL0 Serial4
#else
#error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 3)
#error "SERIAL_PORT_2 must be from -1 to 3"
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#if SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 Serial
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 Serial1
@@ -65,13 +61,36 @@
#define MYSERIAL1 Serial2
#elif SERIAL_PORT_2 == 2
#define MYSERIAL1 Serial3
#else
#elif SERIAL_PORT_2 == 3
#define MYSERIAL1 Serial4
#else
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
#endif
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif
#ifdef DGUS_SERIAL_PORT
#if DGUS_SERIAL_PORT == SERIAL_PORT
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
#elif DGUS_SERIAL_PORT == -1
#define DGUS_SERIAL Serial
#elif DGUS_SERIAL_PORT == 0
#define DGUS_SERIAL Serial1
#elif DGUS_SERIAL_PORT == 1
#define DGUS_SERIAL Serial2
#elif DGUS_SERIAL_PORT == 2
#define DGUS_SERIAL Serial3
#elif DGUS_SERIAL_PORT == 2
#define DGUS_SERIAL Serial4
#else
#error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#endif
#endif // ADAFRUIT_GRAND_CENTRAL_M4
typedef int8_t pin_t;
@@ -116,7 +135,7 @@ void HAL_adc_init();
#define HAL_ADC_READY() true
void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result();
inline uint16_t HAL_adc_get_result() { return HAL_adc_result; }
//
// Pin Map

View File

@@ -98,6 +98,16 @@
#else
#define MATCH_Z3_MIN_EILINE(P) false
#endif
#if HAS_Z4_MAX
#define MATCH_Z4_MAX_EILINE(P) MATCH_EILINE(P, Z4_MAX_PIN)
#else
#define MATCH_Z4_MAX_EILINE(P) false
#endif
#if HAS_Z4_MIN
#define MATCH_Z4_MIN_EILINE(P) MATCH_EILINE(P, Z4_MIN_PIN)
#else
#define MATCH_Z4_MIN_EILINE(P) false
#endif
#if HAS_Z_MIN_PROBE_PIN
#define MATCH_Z_MIN_PROBE_EILINE(P) MATCH_EILINE(P, Z_MIN_PROBE_PIN)
#else
@@ -109,6 +119,7 @@
&& !MATCH_Z_MAX_EILINE(P) && !MATCH_Z_MIN_EILINE(P) \
&& !MATCH_Z2_MAX_EILINE(P) && !MATCH_Z2_MIN_EILINE(P) \
&& !MATCH_Z3_MAX_EILINE(P) && !MATCH_Z3_MIN_EILINE(P) \
&& !MATCH_Z4_MAX_EILINE(P) && !MATCH_Z4_MIN_EILINE(P) \
&& !MATCH_Z_MIN_PROBE_EILINE(P))
// One ISR for all EXT-Interrupts
@@ -117,67 +128,79 @@ void endstop_ISR() { endstops.update(); }
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.");
#error "X_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_X_MIN
#if !AVAILABLE_EILINE(X_MIN_PIN)
static_assert(false, "X_MIN_PIN has no EXTINT line available.");
#error "X_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Y_MAX
#if !AVAILABLE_EILINE(Y_MAX_PIN)
static_assert(false, "Y_MAX_PIN has no EXTINT line available.");
#error "Y_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Y_MIN
#if !AVAILABLE_EILINE(Y_MIN_PIN)
static_assert(false, "Y_MIN_PIN has no EXTINT line available.");
#error "Y_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MAX
#if !AVAILABLE_EILINE(Z_MAX_PIN)
static_assert(false, "Z_MAX_PIN has no EXTINT line available.");
#error "Z_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN
#if !AVAILABLE_EILINE(Z_MIN_PIN)
static_assert(false, "Z_MIN_PIN has no EXTINT line available.");
#error "Z_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z2_MAX
#if !AVAILABLE_EILINE(Z2_MAX_PIN)
static_assert(false, "Z2_MAX_PIN has no EXTINT line available.");
#error "Z2_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z2_MIN
#if !AVAILABLE_EILINE(Z2_MIN_PIN)
static_assert(false, "Z2_MIN_PIN has no EXTINT line available.");
#error "Z2_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MAX
#if !AVAILABLE_EILINE(Z3_MAX_PIN)
static_assert(false, "Z3_MAX_PIN has no EXTINT line available.");
#error "Z3_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MIN
#if !AVAILABLE_EILINE(Z3_MIN_PIN)
static_assert(false, "Z3_MIN_PIN has no EXTINT line available.");
#error "Z3_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z4_MAX
#if !AVAILABLE_EILINE(Z4_MAX_PIN)
#error "Z4_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(Z4_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z4_MIN
#if !AVAILABLE_EILINE(Z4_MIN_PIN)
#error "Z4_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(Z4_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
#if !AVAILABLE_EILINE(Z_MIN_PROBE_PIN)
static_assert(false, "Z_MIN_PROBE_PIN has no EXTINT line available.");
#error "Z_MIN_PROBE_PIN has no EXTINT line available."
#endif
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
#endif

View File

@@ -46,3 +46,7 @@
#if ENABLED(EEPROM_SETTINGS) && NONE(SPI_EEPROM, I2C_EEPROM)
#warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Activator"
#endif
#if TMC_HAS_SW_SERIAL
#error "TMC220x Software Serial is not supported on this platform."
#endif

View File

@@ -28,13 +28,7 @@
#include "../../inc/MarlinConfig.h"
#include "../shared/Delay.h"
#if (__cplusplus == 201703L) && defined(__has_include)
#define HAS_SWSERIAL __has_include(<SoftwareSerial.h>)
#else
#define HAS_SWSERIAL HAS_TMC220x
#endif
#if HAS_SWSERIAL
#if TMC_HAS_SW_SERIAL
#include "SoftwareSerial.h"
#endif
@@ -93,7 +87,7 @@ void HAL_init() {
while (!LL_PWR_IsActiveFlag_BRR());
#endif // EEPROM_EMULATED_SRAM
#if HAS_SWSERIAL
#if TMC_HAS_SW_SERIAL
SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0);
#endif
}
@@ -101,11 +95,27 @@ void HAL_init() {
void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
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;
if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) return RST_POWER_ON;
return 0;
return
#ifdef RCC_FLAG_IWDGRST // Some sources may not exist...
RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) ? RST_WATCHDOG :
#endif
#ifdef RCC_FLAG_IWDG1RST
RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_IWDG1RST) ? RST_WATCHDOG :
#endif
#ifdef RCC_FLAG_IWDG2RST
RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_IWDG2RST) ? RST_WATCHDOG :
#endif
#ifdef RCC_FLAG_SFTRST
RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) ? RST_SOFTWARE :
#endif
#ifdef RCC_FLAG_PINRST
RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) ? RST_EXTERNAL :
#endif
#ifdef RCC_FLAG_PORRST
RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) ? RST_POWER_ON :
#endif
0
;
}
void _delay_ms(const int delay_ms) { delay(delay_ms); }

View File

@@ -44,13 +44,8 @@
// ------------------------
#if SERIAL_PORT == 0
#error "Serial port 0 does not exist"
#endif
#if !WITHIN(SERIAL_PORT, -1, 6)
#error "SERIAL_PORT must be from -1 to 6"
#endif
#if SERIAL_PORT == -1
#error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT == -1
#define MYSERIAL0 SerialUSB
#elif SERIAL_PORT == 1
#define MYSERIAL0 Serial1
@@ -64,20 +59,17 @@
#define MYSERIAL0 Serial5
#elif SERIAL_PORT == 6
#define MYSERIAL0 Serial6
#else
#error "SERIAL_PORT must be from -1 to 6. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == 0
#error "Serial port 0 does not exist"
#endif
#if !WITHIN(SERIAL_PORT_2, -1, 6)
#error "SERIAL_PORT_2 must be from -1 to 6"
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#if SERIAL_PORT_2 == 0
#error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 SerialUSB
#elif SERIAL_PORT_2 == 1
#define MYSERIAL1 Serial1
@@ -91,11 +83,41 @@
#define MYSERIAL1 Serial5
#elif SERIAL_PORT_2 == 6
#define MYSERIAL1 Serial6
#else
#error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration."
#endif
#else
#define NUM_SERIAL 1
#endif
#if HAS_DGUS_LCD
#if DGUS_SERIAL_PORT == 0
#error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif DGUS_SERIAL_PORT == SERIAL_PORT
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
#elif DGUS_SERIAL_PORT == -1
#define DGUS_SERIAL SerialUSB
#elif DGUS_SERIAL_PORT == 1
#define DGUS_SERIAL Serial1
#elif DGUS_SERIAL_PORT == 2
#define DGUS_SERIAL Serial2
#elif DGUS_SERIAL_PORT == 3
#define DGUS_SERIAL Serial3
#elif DGUS_SERIAL_PORT == 4
#define DGUS_SERIAL Serial4
#elif DGUS_SERIAL_PORT == 5
#define DGUS_SERIAL Serial5
#elif DGUS_SERIAL_PORT == 6
#define DGUS_SERIAL Serial6
#else
#error "DGUS_SERIAL_PORT must be from -1 to 6. Please update your configuration."
#endif
#define DGUS_SERIAL_GET_TX_BUFFER_FREE DGUS_SERIAL.availableForWrite
#endif
#include "timers.h"
/**

View File

@@ -37,121 +37,193 @@ static SPISettings spiConfig;
// ------------------------
#if ENABLED(SOFTWARE_SPI)
// ------------------------
// Software SPI
// ------------------------
#error "Software SPI not supported for STM32. Use Hardware SPI."
#include "../shared/Delay.h"
void spiBegin(void) {
OUT_WRITE(SS_PIN, HIGH);
OUT_WRITE(SCK_PIN, HIGH);
SET_INPUT(MISO_PIN);
OUT_WRITE(MOSI_PIN, HIGH);
}
static uint16_t delay_STM32_soft_spi;
void spiInit(uint8_t spiRate) {
// Use datarates Marlin uses
switch (spiRate) {
case SPI_FULL_SPEED: delay_STM32_soft_spi = 125; break; // desired: 8,000,000 actual: ~1.1M
case SPI_HALF_SPEED: delay_STM32_soft_spi = 125; break; // desired: 4,000,000 actual: ~1.1M
case SPI_QUARTER_SPEED:delay_STM32_soft_spi = 250; break; // desired: 2,000,000 actual: ~890K
case SPI_EIGHTH_SPEED: delay_STM32_soft_spi = 500; break; // desired: 1,000,000 actual: ~590K
case SPI_SPEED_5: delay_STM32_soft_spi = 1000; break; // desired: 500,000 actual: ~360K
case SPI_SPEED_6: delay_STM32_soft_spi = 2000; break; // desired: 250,000 actual: ~210K
default: delay_STM32_soft_spi = 4000; break; // desired: 125,000 actual: ~123K
}
SPI.begin();
}
// Begin SPI transaction, set clock, bit order, data mode
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { /* do nothing */ }
uint8_t HAL_SPI_STM32_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
for (uint8_t bits = 8; bits--;) {
WRITE(SCK_PIN, LOW);
WRITE(MOSI_PIN, b & 0x80);
DELAY_NS(delay_STM32_soft_spi);
WRITE(SCK_PIN, HIGH);
DELAY_NS(delay_STM32_soft_spi);
b <<= 1; // little setup time
b |= (READ(MISO_PIN) != 0);
}
DELAY_NS(125);
return b;
}
// Soft SPI receive byte
uint8_t spiRec() {
DISABLE_ISRS(); // No interrupts during byte receive
const uint8_t data = HAL_SPI_STM32_SpiTransfer_Mode_3(0xFF);
ENABLE_ISRS(); // Enable interrupts
return data;
}
// Soft SPI read data
void spiRead(uint8_t *buf, uint16_t nbyte) {
for (uint16_t i = 0; i < nbyte; i++)
buf[i] = spiRec();
}
// Soft SPI send byte
void spiSend(uint8_t data) {
DISABLE_ISRS(); // No interrupts during byte send
HAL_SPI_STM32_SpiTransfer_Mode_3(data); // Don't care what is received
ENABLE_ISRS(); // Enable interrupts
}
// Soft SPI send block
void spiSendBlock(uint8_t token, const uint8_t *buf) {
spiSend(token);
for (uint16_t i = 0; i < 512; i++)
spiSend(buf[i]);
}
#else
// ------------------------
// Hardware SPI
// ------------------------
// ------------------------
// Hardware SPI
// ------------------------
/**
* VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz
*/
/**
* VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz
*/
/**
* @brief Begin SPI port setup
*
* @return Nothing
*
* @details Only configures SS pin since stm32duino creates and initialize the SPI object
*/
void spiBegin() {
#if !PIN_EXISTS(SS)
#error "SS_PIN not defined!"
#endif
/**
* @brief Begin SPI port setup
*
* @return Nothing
*
* @details Only configures SS pin since stm32duino creates and initialize the SPI object
*/
void spiBegin() {
#if !PIN_EXISTS(SS)
#error "SS_PIN not defined!"
#endif
OUT_WRITE(SS_PIN, HIGH);
}
/** Configure SPI for specified SPI speed */
void spiInit(uint8_t spiRate) {
// Use datarates Marlin uses
uint32_t clock;
switch (spiRate) {
case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000
case SPI_HALF_SPEED: clock = 5000000; break;
case SPI_QUARTER_SPEED: clock = 2500000; break;
case SPI_EIGHTH_SPEED: clock = 1250000; break;
case SPI_SPEED_5: clock = 625000; break;
case SPI_SPEED_6: clock = 300000; break;
default:
clock = 4000000; // Default from the SPI library
OUT_WRITE(SS_PIN, HIGH);
}
spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0);
#if ENABLED(CUSTOM_SPI_PINS)
SPI.setMISO(MISO_PIN);
SPI.setMOSI(MOSI_PIN);
SPI.setSCLK(SCK_PIN);
SPI.setSSEL(SS_PIN);
#endif
// Configure SPI for specified SPI speed
void spiInit(uint8_t spiRate) {
// Use datarates Marlin uses
uint32_t clock;
switch (spiRate) {
case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000
case SPI_HALF_SPEED: clock = 5000000; break;
case SPI_QUARTER_SPEED: clock = 2500000; break;
case SPI_EIGHTH_SPEED: clock = 1250000; break;
case SPI_SPEED_5: clock = 625000; break;
case SPI_SPEED_6: clock = 300000; break;
default:
clock = 4000000; // Default from the SPI library
}
spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0);
SPI.begin();
}
#if ENABLED(CUSTOM_SPI_PINS)
SPI.setMISO(MISO_PIN);
SPI.setMOSI(MOSI_PIN);
SPI.setSCLK(SCK_PIN);
SPI.setSSEL(SS_PIN);
#endif
/**
* @brief Receives a single byte from the SPI port.
*
* @return Byte received
*
* @details
*/
uint8_t spiRec() {
SPI.beginTransaction(spiConfig);
uint8_t returnByte = SPI.transfer(0xFF);
SPI.endTransaction();
return returnByte;
}
SPI.begin();
}
/**
* @brief Receives a number of bytes from the SPI port to a buffer
*
* @param buf Pointer to starting address of buffer to write to.
* @param nbyte Number of bytes to receive.
* @return Nothing
*
* @details Uses DMA
*/
void spiRead(uint8_t* buf, uint16_t nbyte) {
if (nbyte == 0) return;
memset(buf, 0xFF, nbyte);
SPI.beginTransaction(spiConfig);
SPI.transfer(buf, nbyte);
SPI.endTransaction();
}
/**
* @brief Receives a single byte from the SPI port.
*
* @return Byte received
*
* @details
*/
uint8_t spiRec() {
SPI.beginTransaction(spiConfig);
uint8_t returnByte = SPI.transfer(0xFF);
SPI.endTransaction();
return returnByte;
}
/**
* @brief Sends a single byte on SPI port
*
* @param b Byte to send
*
* @details
*/
void spiSend(uint8_t b) {
SPI.beginTransaction(spiConfig);
SPI.transfer(b);
SPI.endTransaction();
}
/**
* @brief Receive a number of bytes from the SPI port to a buffer
*
* @param buf Pointer to starting address of buffer to write to.
* @param nbyte Number of bytes to receive.
* @return Nothing
*
* @details Uses DMA
*/
void spiRead(uint8_t* buf, uint16_t nbyte) {
if (nbyte == 0) return;
memset(buf, 0xFF, nbyte);
SPI.beginTransaction(spiConfig);
SPI.transfer(buf, nbyte);
SPI.endTransaction();
}
/**
* @brief Write token and then write from 512 byte buffer to SPI (for SD card)
*
* @param buf Pointer with buffer start address
* @return Nothing
*
* @details Use DMA
*/
void spiSendBlock(uint8_t token, const uint8_t* buf) {
uint8_t rxBuf[512];
SPI.beginTransaction(spiConfig);
SPI.transfer(token);
SPI.transfer((uint8_t*)buf, &rxBuf, 512);
SPI.endTransaction();
}
/**
* @brief Send a single byte on SPI port
*
* @param b Byte to send
*
* @details
*/
void spiSend(uint8_t b) {
SPI.beginTransaction(spiConfig);
SPI.transfer(b);
SPI.endTransaction();
}
/**
* @brief Write token and then write from 512 byte buffer to SPI (for SD card)
*
* @param buf Pointer with buffer start address
* @return Nothing
*
* @details Use DMA
*/
void spiSendBlock(uint8_t token, const uint8_t* buf) {
uint8_t rxBuf[512];
SPI.beginTransaction(spiConfig);
SPI.transfer(token);
SPI.transfer((uint8_t*)buf, &rxBuf, 512);
SPI.endTransaction();
}
#endif // SOFTWARE_SPI

View File

@@ -58,6 +58,12 @@ void setup_endstop_interrupts() {
#if HAS_Z3_MIN
attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z4_MAX
attachInterrupt(Z4_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z4_MIN
attachInterrupt(Z4_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
#endif

View File

@@ -33,7 +33,6 @@
#define hal_timer_t uint32_t
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF // Timers can be 16 or 32 bit
#ifdef STM32F0xx
#define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals
@@ -58,18 +57,42 @@
#define TEMP_TIMER 2
#endif
#elif defined(STM32F4xx) || defined(STM32F7xx)
#elif defined(STM32F401xC) || defined(STM32F401xE)
#define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals
#define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals
#ifndef STEP_TIMER
#define STEP_TIMER 5
#define STEP_TIMER 9
#endif
#ifndef TEMP_TIMER
#define TEMP_TIMER 10
#endif
#elif defined(STM32F4xx)
#define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals
#ifndef STEP_TIMER
#define STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8
#endif
#ifndef TEMP_TIMER
#define TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used.
#endif
#elif defined(STM32F7xx)
#define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals
#ifndef STEP_TIMER
#define STEP_TIMER 6 // the RIGHT timer!
#endif
#ifndef TEMP_TIMER
#define TEMP_TIMER 14
#endif
#endif
#ifndef SWSERIAL_TIMER_IRQ_PRIO
@@ -81,16 +104,16 @@
#endif
#ifndef TEMP_TIMER_IRQ_PRIO
#define TEMP_TIMER_IRQ_PRIO 14 //14 = after hardware ISRs
#define TEMP_TIMER_IRQ_PRIO 14 // 14 = after hardware ISRs
#endif
#define STEP_TIMER_NUM 0 // index of timer to use for stepper
#define TEMP_TIMER_NUM 1 // index of timer to use for temperature
#define PULSE_TIMER_NUM STEP_TIMER_NUM
#define TEMP_TIMER_FREQUENCY 1000 //Temperature::isr() is expected to be called at around 1kHz
#define TEMP_TIMER_FREQUENCY 1000 // Temperature::isr() is expected to be called at around 1kHz
//TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
// TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
#define STEPPER_TIMER_RATE 2000000 // 2 Mhz
#define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE))
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs

View File

@@ -118,6 +118,12 @@ const uint8_t adc_pins[] = {
#if HAS_TEMP_ADC_5
TEMP_5_PIN,
#endif
#if HAS_TEMP_ADC_6
TEMP_6_PIN,
#endif
#if HAS_TEMP_ADC_7
TEMP_7_PIN,
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
FILWIDTH_PIN,
#endif
@@ -160,6 +166,12 @@ enum TEMP_PINS : char {
#if HAS_TEMP_ADC_5
TEMP_5,
#endif
#if HAS_TEMP_ADC_6
TEMP_6,
#endif
#if HAS_TEMP_ADC_7
TEMP_7,
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
FILWIDTH,
#endif
@@ -346,6 +358,12 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
#if HAS_TEMP_ADC_5
case TEMP_5_PIN: pin_index = TEMP_5; break;
#endif
#if HAS_TEMP_ADC_6
case TEMP_6_PIN: pin_index = TEMP_6; break;
#endif
#if HAS_TEMP_ADC_7
case TEMP_7_PIN: pin_index = TEMP_7; break;
#endif
#if HAS_JOY_ADC_X
case JOY_X_PIN: pin_index = JOY_X; break;
#endif

View File

@@ -78,13 +78,10 @@
#define MSerial5 Serial4
#endif
#if !WITHIN(SERIAL_PORT, -1, 5)
#error "SERIAL_PORT must be from -1 to 5"
#endif
#if SERIAL_PORT == -1
#if SERIAL_PORT == 0
#error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT == -1
#define MYSERIAL0 UsbSerial
#elif SERIAL_PORT == 0
#error "Serial port 0 does not exist"
#elif SERIAL_PORT == 1
#define MYSERIAL0 MSerial1
#elif SERIAL_PORT == 2
@@ -95,19 +92,17 @@
#define MYSERIAL0 MSerial4
#elif SERIAL_PORT == 5
#define MYSERIAL0 MSerial5
#else
#error "SERIAL_PORT must be from -1 to 5. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 5)
#error "SERIAL_PORT_2 must be from -1 to 5"
#if SERIAL_PORT_2 == 0
#error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 UsbSerial
#elif SERIAL_PORT_2 == 0
#error "Serial port 0 does not exist"
#elif SERIAL_PORT_2 == 1
#define MYSERIAL1 MSerial1
#elif SERIAL_PORT_2 == 2
@@ -118,11 +113,39 @@
#define MYSERIAL1 MSerial4
#elif SERIAL_PORT_2 == 5
#define MYSERIAL1 MSerial5
#else
#error "SERIAL_PORT_2 must be from -1 to 5. Please update your configuration."
#endif
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif
#ifdef DGUS_SERIAL
#if DGUS_SERIAL_PORT == 0
#error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif DGUS_SERIAL_PORT == SERIAL_PORT
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
#elif DGUS_SERIAL_PORT == -1
#define DGUS_SERIAL UsbSerial
#elif DGUS_SERIAL_PORT == 1
#define DGUS_SERIAL MSerial1
#elif DGUS_SERIAL_PORT == 2
#define DGUS_SERIAL MSerial2
#elif DGUS_SERIAL_PORT == 3
#define DGUS_SERIAL MSerial3
#elif DGUS_SERIAL_PORT == 4
#define DGUS_SERIAL MSerial4
#elif DGUS_SERIAL_PORT == 5
#define DGUS_SERIAL MSerial5
#else
#error "DGUS_SERIAL_PORT must be from -1 to 5. Please update your configuration."
#endif
#endif
// Set interrupt grouping for this MCU
void HAL_init();
#define HAL_IDLETASK 1

View File

@@ -49,6 +49,7 @@
void LCD_IO_Init(uint8_t cs, uint8_t rs);
void LCD_IO_WriteData(uint16_t RegValue);
void LCD_IO_WriteReg(uint16_t Reg);
uint16_t LCD_IO_ReadData(uint16_t RegValue);
uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize);
#ifdef LCD_USE_DMA_FSMC
void LCD_IO_WriteMultiple(uint16_t data, uint32_t count);
@@ -79,8 +80,11 @@ uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi
LCD_IO_Init(u8g->pin_list[U8G_PI_CS], u8g->pin_list[U8G_PI_A0]);
u8g_Delay(50);
if (arg_ptr)
*((uint32_t *)arg_ptr) = LCD_IO_ReadData(LCD_READ_ID, 3);
if (arg_ptr) {
*((uint32_t *)arg_ptr) = LCD_IO_ReadData(0x0000);
if (*((uint32_t *)arg_ptr) == 0)
*((uint32_t *)arg_ptr) = (LCD_READ_ID << 24) | LCD_IO_ReadData(LCD_READ_ID, 3);
}
isCommand = 0;
break;
@@ -265,6 +269,13 @@ void LCD_IO_WriteReg(uint16_t Reg) {
__DSB();
}
uint16_t LCD_IO_ReadData(uint16_t RegValue) {
LCD->REG = RegValue;
__DSB();
return LCD->RAM;
}
uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) {
volatile uint32_t data;
LCD->REG = RegValue;

View File

@@ -82,6 +82,12 @@ void setup_endstop_interrupts() {
#endif
#if HAS_Z3_MIN
attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z4_MAX
attachInterrupt(Z4_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z4_MIN
attachInterrupt(Z4_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);

View File

@@ -37,7 +37,7 @@
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
#if !defined(HAVE_SW_SERIAL) && HAS_TMC220x
#if !defined(HAVE_SW_SERIAL) && TMC_HAS_SW_SERIAL
#warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
#error "Missing SoftwareSerial implementation."
#endif

View File

@@ -44,17 +44,12 @@
// Defines
// ------------------------
//Serial override
// Serial override
//extern HalSerial usb_serial;
#if defined(STM32F4) && SERIAL_PORT == 0
#error "Serial port 0 does not exist"
#endif
#if !WITHIN(SERIAL_PORT, -1, 6)
#error "SERIAL_PORT must be from -1 to 6"
#endif
#if SERIAL_PORT == -1
#error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT == -1
#define MYSERIAL0 SerialUSB
#elif SERIAL_PORT == 1
#define MYSERIAL0 SerialUART1
@@ -68,19 +63,16 @@
#define MYSERIAL0 SerialUART5
#elif SERIAL_PORT == 6
#define MYSERIAL0 SerialUART6
#else
#error "SERIAL_PORT must be from -1 to 6. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if defined(STM32F4) && SERIAL_PORT_2 == 0
#error "Serial port 0 does not exist"
#endif
#if !WITHIN(SERIAL_PORT_2, -1, 6)
#error "SERIAL_PORT_2 must be from -1 to 6"
#error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 SerialUSB
#elif SERIAL_PORT_2 == 1
#define MYSERIAL1 SerialUART1
@@ -94,11 +86,40 @@
#define MYSERIAL1 SerialUART5
#elif SERIAL_PORT_2 == 6
#define MYSERIAL1 SerialUART6
#else
#error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration."
#endif
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif
#ifdef DGUS_SERIAL_PORT
#if defined(STM32F4) && DGUS_SERIAL_PORT == 0
#error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif DGUS_SERIAL_PORT == SERIAL_PORT
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
#elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
#error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
#elif DGUS_SERIAL_PORT == -1
#define DGUS_SERIAL SerialUSB
#elif DGUS_SERIAL_PORT == 1
#define DGUS_SERIAL SerialUART1
#elif DGUS_SERIAL_PORT == 2
#define DGUS_SERIAL SerialUART2
#elif DGUS_SERIAL_PORT == 3
#define DGUS_SERIAL SerialUART3
#elif DGUS_SERIAL_PORT == 4
#define DGUS_SERIAL SerialUART4
#elif DGUS_SERIAL_PORT == 5
#define DGUS_SERIAL SerialUART5
#elif DGUS_SERIAL_PORT == 6
#define DGUS_SERIAL SerialUART6
#else
#error "DGUS_SERIAL_PORT must be from -1 to 6. Please update your configuration."
#endif
#endif
/**
* TODO: review this to return 1 for pins that are not analog input
*/

View File

@@ -36,7 +36,7 @@
#include "TMC2660.h"
#include "../../../inc/MarlinConfig.h"
#include "../../../Marlin.h"
#include "../../../MarlinCore.h"
#include "../../../module/stepper/indirection.h"
#include "../../../module/printcounter.h"
#include "../../../libs/duration_t.h"

View File

@@ -58,6 +58,12 @@ void setup_endstop_interrupts() {
#if HAS_Z3_MIN
attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z4_MAX
attachInterrupt(Z4_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z4_MIN
attachInterrupt(Z4_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
#endif

View File

@@ -35,3 +35,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
#if TMC_HAS_SW_SERIAL
#error "TMC220x Software Serial is not supported on this platform."
#endif

View File

@@ -32,3 +32,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
#if TMC_HAS_SW_SERIAL
#error "TMC220x Software Serial is not supported on this platform."
#endif

View File

@@ -94,7 +94,7 @@ extern "C" {
}
void HAL_adc_start_conversion(const uint8_t adc_pin) {
uint16_t pin = pin2sc1a[adc_pin];
const uint16_t pin = pin2sc1a[adc_pin];
if (pin == 0xFF) {
// Digital only
HAL_adc_select = -1;

View File

@@ -76,6 +76,12 @@ void setup_endstop_interrupts() {
#if HAS_Z3_MIN
_ATTACH(Z3_MIN_PIN);
#endif
#if HAS_Z4_MAX
_ATTACH(Z4_MAX_PIN);
#endif
#if HAS_Z4_MIN
_ATTACH(Z4_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
_ATTACH(Z_MIN_PROBE_PIN);
#endif

View File

@@ -32,3 +32,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
#if TMC_HAS_SW_SERIAL
#error "TMC220x Software Serial is not supported on this platform."
#endif

View File

@@ -145,21 +145,7 @@
}
#undef nop
#elif defined(ESP32)
FORCE_INLINE static void DELAY_CYCLES(uint32_t x) {
unsigned long ccount, stop;
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
stop = ccount + x; // This can overflow
while (ccount < stop) { // This doesn't deal with overflows
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
}
}
#elif defined(__PLAT_LINUX__)
#elif defined(__PLAT_LINUX__) || defined(ESP32)
// specified inside platform

View File

@@ -27,12 +27,12 @@
#include "../../inc/MarlinConfig.h"
#if HAS_DRIVER(L6470)
#if HAS_L64XX
#include "Delay.h"
#include "../../core/serial.h"
#include "../../libs/L6470/L6470_Marlin.h"
#include "../../libs/L64XX/L64XX_Marlin.h"
// Make sure GCC optimizes this file.
// Note that this line triggers a bug in GCC which is fixed by casting.
@@ -40,7 +40,7 @@
#pragma GCC optimize (3)
// run at ~4Mhz
uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0
inline uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0
for (uint8_t bits = 8; bits--;) {
WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80);
b <<= 1; // little setup time
@@ -56,61 +56,26 @@ uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0
return b;
}
uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
inline uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
for (uint8_t bits = 8; bits--;) {
WRITE(L6470_CHAIN_SCK_PIN, LOW);
WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80);
DELAY_NS(125); // 10 cycles @ 84mhz
WRITE(L6470_CHAIN_SCK_PIN, HIGH);
DELAY_NS(125); // Need more delay for fast CPUs
b <<= 1; // little setup time
b |= (READ(L6470_CHAIN_MISO_PIN) != 0);
}
DELAY_NS(125); // 10 cycles @ 84mhz
DELAY_NS(125); // 10 cycles @ 84mhz
return b;
}
/**
* The following are weak-linked and defined as do-nothing
* functions by the L6470-Arduino library. They must be
* defined by the client (Marlin) to provide an SPI interface.
* L64XX methods for SPI init and transfer
*/
uint8_t L6470_transfer(uint8_t data, int16_t ss_pin, const uint8_t chain_position) {
uint8_t data_out = 0;
// first device in chain has data sent last
extDigitalWrite(ss_pin, LOW);
for (uint8_t i = L6470::chain[0]; (i >= 1) && !spi_abort; i--) { // stop sending data if spi_abort is active
DISABLE_ISRS(); // disable interrupts during SPI transfer (can't allow partial command to chips)
uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP));
ENABLE_ISRS(); // enable interrupts
if (i == chain_position) data_out = temp;
}
extDigitalWrite(ss_pin, HIGH);
return data_out;
}
void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) {
// first device in chain has data sent last
if (spi_active) { // interrupted SPI transfer so need to
WRITE(L6470_CHAIN_SS_PIN, HIGH); // guarantee min high of 650nS
DELAY_US(1);
}
WRITE(L6470_CHAIN_SS_PIN, LOW);
for (uint8_t i = length; i >= 1; i--)
L6470_SpiTransfer_Mode_3(uint8_t(L6470_buf[i]));
WRITE(L6470_CHAIN_SS_PIN, HIGH);
}
void L6470_spi_init() {
void L64XX_Marlin::spi_init() {
OUT_WRITE(L6470_CHAIN_SS_PIN, HIGH);
OUT_WRITE(L6470_CHAIN_SCK_PIN, HIGH);
OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
@@ -123,6 +88,52 @@ void L6470_spi_init() {
OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
}
uint8_t L64XX_Marlin::transfer_single(uint8_t data, int16_t ss_pin) {
// First device in chain has data sent last
extDigitalWrite(ss_pin, LOW);
DISABLE_ISRS(); // Disable interrupts during SPI transfer (can't allow partial command to chips)
const uint8_t data_out = L6470_SpiTransfer_Mode_3(data);
ENABLE_ISRS(); // Enable interrupts
extDigitalWrite(ss_pin, HIGH);
return data_out;
}
uint8_t L64XX_Marlin::transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain_position) {
uint8_t data_out = 0;
// first device in chain has data sent last
extDigitalWrite(ss_pin, LOW);
for (uint8_t i = L64XX::chain[0]; !L64xxManager.spi_abort && i >= 1; i--) { // Send data unless aborted
DISABLE_ISRS(); // Disable interrupts during SPI transfer (can't allow partial command to chips)
const uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP));
ENABLE_ISRS(); // Enable interrupts
if (i == chain_position) data_out = temp;
}
extDigitalWrite(ss_pin, HIGH);
return data_out;
}
/**
* Platform-supplied L6470 buffer transfer method
*/
void L64XX_Marlin::transfer(uint8_t L6470_buf[], const uint8_t length) {
// First device in chain has its data sent last
if (spi_active) { // Interrupted SPI transfer so need to
WRITE(L6470_CHAIN_SS_PIN, HIGH); // guarantee min high of 650ns
DELAY_US(1);
}
WRITE(L6470_CHAIN_SS_PIN, LOW);
for (uint8_t i = length; i >= 1; i--)
L6470_SpiTransfer_Mode_3(uint8_t(L6470_buf[i]));
WRITE(L6470_CHAIN_SS_PIN, HIGH);
}
#pragma GCC reset_options
#endif // HAS_DRIVER(L6470)
#endif // HAS_L64XX

View File

@@ -28,6 +28,13 @@
#include "../../inc/MarlinConfigPre.h"
constexpr bool
#if HAS_DGUS_LCD
bDGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS = (false
#if ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS)
|| true
#endif
),
#endif
bSERIAL_XON_XOFF = (false
#if ENABLED(SERIAL_XON_XOFF)
|| true

View File

@@ -35,7 +35,7 @@ static bool UnwReportOut(void* ctx, const UnwReport* bte) {
(*p)++;
SERIAL_CHAR('#'); SERIAL_PRINT(*p,DEC); SERIAL_ECHOPGM(" : ");
SERIAL_CHAR('#'); SERIAL_PRINT(*p, DEC); SERIAL_ECHOPGM(" : ");
SERIAL_ECHOPGM(bte->name ? bte->name : "unknown"); SERIAL_ECHOPGM("@0x"); SERIAL_PRINT(bte->function, HEX);
SERIAL_CHAR('+'); SERIAL_PRINT(bte->address - bte->function,DEC);
SERIAL_ECHOPGM(" PC:"); SERIAL_PRINT(bte->address,HEX); SERIAL_CHAR('\n');

View File

@@ -164,7 +164,7 @@ typedef struct {
* link register (i.e. not a normal register) and the stack pointer value
* supplied.
*
* -If the program was compiled with -funwind-tables , it will use them to
* -If the program was compiled with -funwind-tables it will use them to
* perform the traceback. Otherwise, brute force will be employed
* -If the program was compiled with -mpoke-function-name, then you will
* get function names in the traceback. Otherwise, you will not.

View File

@@ -1,381 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "inc/MarlinConfig.h"
#ifdef DEBUG_GCODE_PARSER
#include "gcode/parser.h"
#endif
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#if HAS_DRIVER(L6470)
#include "libs/L6470/L6470_Marlin.h"
extern uint8_t axis_known_position;
#endif
void stop();
void idle(
#if ENABLED(ADVANCED_PAUSE_FEATURE)
bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout
#endif
);
void manage_inactivity(const bool ignore_stepper_queue=false);
//
// X, Y, Z Stepper enable / disable
//
#if AXIS_DRIVER_TYPE_X(L6470)
extern L6470 stepperX;
#define X_enable() NOOP
#define X_disable() stepperX.free()
#elif HAS_X_ENABLE
#define X_enable() X_ENABLE_WRITE( X_ENABLE_ON)
#define X_disable() X_ENABLE_WRITE(!X_ENABLE_ON)
#else
#define X_enable() NOOP
#define X_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_X2(L6470)
extern L6470 stepperX2;
#define X2_enable() NOOP
#define X2_disable() stepperX2.free()
#elif HAS_X2_ENABLE
#define X2_enable() X2_ENABLE_WRITE( X_ENABLE_ON)
#define X2_disable() X2_ENABLE_WRITE(!X_ENABLE_ON)
#else
#define X2_enable() NOOP
#define X2_disable() NOOP
#endif
#define enable_X() do{ X_enable(); X2_enable(); }while(0)
#define disable_X() do{ X_disable(); X2_disable(); CBI(axis_known_position, X_AXIS); }while(0)
#if AXIS_DRIVER_TYPE_Y(L6470)
extern L6470 stepperY;
#define Y_enable() NOOP
#define Y_disable() stepperY.free()
#elif HAS_Y_ENABLE
#define Y_enable() Y_ENABLE_WRITE( Y_ENABLE_ON)
#define Y_disable() Y_ENABLE_WRITE(!Y_ENABLE_ON)
#else
#define Y_enable() NOOP
#define Y_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_Y2(L6470)
extern L6470 stepperY2;
#define Y2_enable() NOOP
#define Y2_disable() stepperY2.free()
#elif HAS_Y2_ENABLE
#define Y2_enable() Y2_ENABLE_WRITE( Y_ENABLE_ON)
#define Y2_disable() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
#else
#define Y2_enable() NOOP
#define Y2_disable() NOOP
#endif
#define enable_Y() do{ Y_enable(); Y2_enable(); }while(0)
#define disable_Y() do{ Y_disable(); Y2_disable(); CBI(axis_known_position, Y_AXIS); }while(0)
#if AXIS_DRIVER_TYPE_Z(L6470)
extern L6470 stepperZ;
#define Z_enable() NOOP
#define Z_disable() stepperZ.free()
#elif HAS_Z_ENABLE
#define Z_enable() Z_ENABLE_WRITE( Z_ENABLE_ON)
#define Z_disable() Z_ENABLE_WRITE(!Z_ENABLE_ON)
#else
#define Z_enable() NOOP
#define Z_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_Z2(L6470)
extern L6470 stepperZ2;
#define Z2_enable() NOOP
#define Z2_disable() stepperZ2.free()
#elif HAS_Z2_ENABLE
#define Z2_enable() Z2_ENABLE_WRITE( Z_ENABLE_ON)
#define Z2_disable() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
#else
#define Z2_enable() NOOP
#define Z2_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_Z3(L6470)
extern L6470 stepperZ3;
#define Z3_enable() NOOP
#define Z3_disable() stepperZ3.free()
#elif HAS_Z3_ENABLE
#define Z3_enable() Z3_ENABLE_WRITE( Z_ENABLE_ON)
#define Z3_disable() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
#else
#define Z3_enable() NOOP
#define Z3_disable() NOOP
#endif
#define enable_Z() do{ Z_enable(); Z2_enable(); Z3_enable(); }while(0)
#define disable_Z() do{ Z_disable(); Z2_disable(); Z3_disable(); CBI(axis_known_position, Z_AXIS); }while(0)
//
// Extruder Stepper enable / disable
//
// define the individual enables/disables
#if AXIS_DRIVER_TYPE_E0(L6470)
extern L6470 stepperE0;
#define E0_enable() NOOP
#define E0_disable() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0)
#elif HAS_E0_ENABLE
#define E0_enable() E0_ENABLE_WRITE( E_ENABLE_ON)
#define E0_disable() E0_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define E0_enable() NOOP
#define E0_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_E1(L6470)
extern L6470 stepperE1;
#define E1_enable() NOOP
#define E1_disable() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0)
#elif E_STEPPERS > 1 && HAS_E1_ENABLE
#define E1_enable() E1_ENABLE_WRITE( E_ENABLE_ON)
#define E1_disable() E1_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define E1_enable() NOOP
#define E1_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_E2(L6470)
extern L6470 stepperE2;
#define E2_enable() NOOP
#define E2_disable() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0)
#elif E_STEPPERS > 2 && HAS_E2_ENABLE
#define E2_enable() E2_ENABLE_WRITE( E_ENABLE_ON)
#define E2_disable() E2_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define E2_enable() NOOP
#define E2_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_E3(L6470)
extern L6470 stepperE3;
#define E3_enable() NOOP
#define E3_disable() do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0)
#elif E_STEPPERS > 3 && HAS_E3_ENABLE
#define E3_enable() E3_ENABLE_WRITE( E_ENABLE_ON)
#define E3_disable() E3_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define E3_enable() NOOP
#define E3_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_E4(L6470)
extern L6470 stepperE4;
#define E4_enable() NOOP
#define E4_disable() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0)
#elif E_STEPPERS > 4 && HAS_E4_ENABLE
#define E4_enable() E4_ENABLE_WRITE( E_ENABLE_ON)
#define E4_disable() E4_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define E4_enable() NOOP
#define E4_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_E5(L6470)
extern L6470 stepperE5;
#define E5_enable() NOOP
#define E5_disable() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0)
#elif E_STEPPERS > 5 && HAS_E5_ENABLE
#define E5_enable() E5_ENABLE_WRITE( E_ENABLE_ON)
#define E5_disable() E5_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define E5_enable() NOOP
#define E5_disable() NOOP
#endif
#if ENABLED(MIXING_EXTRUDER)
/**
* Mixing steppers synchronize their enable (and direction) together
*/
#if MIXING_STEPPERS > 5
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); }
#elif MIXING_STEPPERS > 4
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); }
#elif MIXING_STEPPERS > 3
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); }
#elif MIXING_STEPPERS > 2
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); }
#else
#define enable_E0() { E0_enable(); E1_enable(); }
#define disable_E0() { E0_disable(); E1_disable(); }
#endif
#define enable_E1() NOOP
#define disable_E1() NOOP
#define enable_E2() NOOP
#define disable_E2() NOOP
#define enable_E3() NOOP
#define disable_E3() NOOP
#define enable_E4() NOOP
#define disable_E4() NOOP
#define enable_E5() NOOP
#define disable_E5() NOOP
#else // !MIXING_EXTRUDER
#if HAS_E0_ENABLE
#define enable_E0() E0_enable()
#define disable_E0() E0_disable()
#else
#define enable_E0() NOOP
#define disable_E0() NOOP
#endif
#if E_STEPPERS > 1 && HAS_E1_ENABLE
#define enable_E1() E1_enable()
#define disable_E1() E1_disable()
#else
#define enable_E1() NOOP
#define disable_E1() NOOP
#endif
#if E_STEPPERS > 2 && HAS_E2_ENABLE
#define enable_E2() E2_enable()
#define disable_E2() E2_disable()
#else
#define enable_E2() NOOP
#define disable_E2() NOOP
#endif
#if E_STEPPERS > 3 && HAS_E3_ENABLE
#define enable_E3() E3_enable()
#define disable_E3() E3_disable()
#else
#define enable_E3() NOOP
#define disable_E3() NOOP
#endif
#if E_STEPPERS > 4 && HAS_E4_ENABLE
#define enable_E4() E4_enable()
#define disable_E4() E4_disable()
#else
#define enable_E4() NOOP
#define disable_E4() NOOP
#endif
#if E_STEPPERS > 5 && HAS_E5_ENABLE
#define enable_E5() E5_enable()
#define disable_E5() E5_disable()
#else
#define enable_E5() NOOP
#define disable_E5() NOOP
#endif
#endif // !MIXING_EXTRUDER
#if ENABLED(EXPERIMENTAL_I2CBUS)
#include "feature/twibus.h"
extern TWIBus i2c;
#endif
#if ENABLED(G38_PROBE_TARGET)
extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type
extern bool G38_did_trigger; // Flag from the ISR to indicate the endstop changed
#endif
/**
* The axis order in all axis related arrays is X, Y, Z, E
*/
void enable_e_steppers();
void enable_all_steppers();
void disable_e_stepper(const uint8_t e);
void disable_e_steppers();
void disable_all_steppers();
void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false);
void minkill(const bool steppers_off=false);
void quickstop_stepper();
extern bool Running;
inline bool IsRunning() { return Running; }
inline bool IsStopped() { return !Running; }
bool printingIsActive();
bool printingIsPaused();
void startOrResumeJob();
extern bool wait_for_heatup;
#if HAS_RESUME_CONTINUE
extern bool wait_for_user;
#endif
#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE)
extern bool suspend_auto_report;
#endif
// Inactivity shutdown timer
extern millis_t max_inactive_time, stepper_inactive_time;
#if ENABLED(USE_CONTROLLER_FAN)
extern uint8_t controllerfan_speed;
#endif
#if ENABLED(PSU_CONTROL)
extern bool powersupply_on;
#define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_HIGH); powersupply_on = true; }while(0)
#define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_HIGH); powersupply_on = false; }while(0)
#if ENABLED(AUTO_POWER_CONTROL)
#define PSU_ON() powerManager.power_on()
#define PSU_OFF() powerManager.power_off()
#else
#define PSU_ON() PSU_PIN_ON()
#define PSU_OFF() PSU_PIN_OFF()
#endif
#endif
bool pin_is_protected(const pin_t pin);
void protected_pin_err();
#if HAS_SUICIDE
inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
#endif
#if ENABLED(G29_RETRY_AND_RECOVER)
void event_probe_recover();
void event_probe_failure();
#endif
extern const char NUL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[];

View File

@@ -28,7 +28,7 @@
* - https://github.com/grbl/grbl
*/
#include "Marlin.h"
#include "MarlinCore.h"
#include "core/utility.h"
#include "lcd/ultralcd.h"
@@ -177,11 +177,12 @@
#include "feature/prusa_MMU2/mmu2.h"
#endif
#if HAS_DRIVER(L6470)
#include "libs/L6470/L6470_Marlin.h"
#if HAS_L64XX
#include "libs/L64XX/L64XX_Marlin.h"
#endif
const char NUL_STR[] PROGMEM = "",
M112_KILL_STR[] PROGMEM = "M112 Shutdown",
G28_STR[] PROGMEM = "G28",
M21_STR[] PROGMEM = "M21",
M23_STR[] PROGMEM = "M23 %s",
@@ -290,7 +291,7 @@ void quickstop_stepper() {
}
void enable_e_steppers() {
#define _ENA_E(N) enable_E##N();
#define _ENA_E(N) ENABLE_AXIS_E##N();
REPEAT(E_STEPPERS, _ENA_E)
}
@@ -298,28 +299,28 @@ void enable_all_steppers() {
#if ENABLED(AUTO_POWER_CONTROL)
powerManager.power_on();
#endif
enable_X();
enable_Y();
enable_Z();
ENABLE_AXIS_X();
ENABLE_AXIS_Y();
ENABLE_AXIS_Z();
enable_e_steppers();
}
void disable_e_steppers() {
#define _DIS_E(N) disable_E##N();
#define _DIS_E(N) DISABLE_AXIS_E##N();
REPEAT(E_STEPPERS, _DIS_E)
}
void disable_e_stepper(const uint8_t e) {
#define _CASE_DIS_E(N) case N: disable_E##N(); break;
#define _CASE_DIS_E(N) case N: DISABLE_AXIS_E##N(); break;
switch (e) {
REPEAT(EXTRUDERS, _CASE_DIS_E)
}
}
void disable_all_steppers() {
disable_X();
disable_Y();
disable_Z();
DISABLE_AXIS_X();
DISABLE_AXIS_Y();
DISABLE_AXIS_Z();
disable_e_steppers();
}
@@ -406,7 +407,7 @@ void startOrResumeJob() {
thermalManager.zero_fan_speeds();
wait_for_heatup = false;
#if ENABLED(POWER_LOSS_RECOVERY)
card.removeJobRecoveryFile();
recovery.purge();
#endif
#ifdef EVENT_GCODE_SD_STOP
queue.inject_P(PSTR(EVENT_GCODE_SD_STOP));
@@ -460,13 +461,13 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
if (!already_shutdown_steppers) {
already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this
#if ENABLED(DISABLE_INACTIVE_X)
disable_X();
DISABLE_AXIS_X();
#endif
#if ENABLED(DISABLE_INACTIVE_Y)
disable_Y();
DISABLE_AXIS_Y();
#endif
#if ENABLED(DISABLE_INACTIVE_Z)
disable_Z();
DISABLE_AXIS_Z();
#endif
#if ENABLED(DISABLE_INACTIVE_E)
disable_e_steppers();
@@ -541,11 +542,11 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#if ENABLED(SWITCHING_EXTRUDER)
bool oldstatus;
switch (active_extruder) {
default: oldstatus = E0_ENABLE_READ(); enable_E0(); break;
default: oldstatus = E0_ENABLE_READ(); ENABLE_AXIS_E0(); break;
#if E_STEPPERS > 1
case 2: case 3: oldstatus = E1_ENABLE_READ(); enable_E1(); break;
case 2: case 3: oldstatus = E1_ENABLE_READ(); ENABLE_AXIS_E1(); break;
#if E_STEPPERS > 2
case 4: case 5: oldstatus = E2_ENABLE_READ(); enable_E2(); break;
case 4: case 5: oldstatus = E2_ENABLE_READ(); ENABLE_AXIS_E2(); break;
#endif // E_STEPPERS > 2
#endif // E_STEPPERS > 1
}
@@ -553,7 +554,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
bool oldstatus;
switch (active_extruder) {
default:
#define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); enable_E##N(); break;
#define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); ENABLE_AXIS_E##N(); break;
REPEAT(E_STEPPERS, _CASE_EN);
}
#endif
@@ -605,7 +606,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#endif
#if ENABLED(MONITOR_L6470_DRIVER_STATUS)
L6470.monitor_driver();
L64xxManager.monitor_driver();
#endif
// Limit check_axes_activity frequency to 10Hz
@@ -618,7 +619,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#if PIN_EXISTS(FET_SAFETY)
static millis_t FET_next;
if (ELAPSED(ms, FET_next)) {
FET_next = ms + FET_SAFETY_DELAY; // 2uS pulse every FET_SAFETY_DELAY mS
FET_next = ms + FET_SAFETY_DELAY; // 2µs pulse every FET_SAFETY_DELAY mS
OUT_WRITE(FET_SAFETY_PIN, !FET_SAFETY_INVERTED);
DELAY_US(2);
WRITE(FET_SAFETY_PIN, FET_SAFETY_INVERTED);
@@ -822,8 +823,12 @@ void setup() {
HAL_init();
#if HAS_DRIVER(L6470)
L6470.init(); // setup SPI and then init chips
#if HAS_L64XX
L64xxManager.init(); // Set up SPI, init drivers
#endif
#if ENABLED(SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD)
OUT_WRITE(SMART_EFFECTOR_MOD_PIN, LOW); // Put Smart Effector into NORMAL mode
#endif
#if ENABLED(MAX7219_DEBUG)
@@ -1128,10 +1133,9 @@ void setup() {
* - Call inactivity manager
*/
void loop() {
do {
for (;;) {
idle(); // Do an idle first so boot is slightly faster
idle();
#if ENABLED(SDSUPPORT)
card.checkautostart();
@@ -1141,5 +1145,10 @@ void loop() {
queue.advance();
endstops.event_handler();
}
} while (false // Return to caller for best compatibility
#ifdef __AVR__
|| true // Loop forever on slower (AVR) boards
#endif
);
}

124
Marlin/src/MarlinCore.h Normal file
View File

@@ -0,0 +1,124 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "inc/MarlinConfig.h"
#ifdef DEBUG_GCODE_PARSER
#include "gcode/parser.h"
#endif
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#if HAS_L64XX
#include "libs/L64XX/L64XX_Marlin.h"
extern uint8_t axis_known_position;
#endif
void stop();
void idle(
#if ENABLED(ADVANCED_PAUSE_FEATURE)
bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout
#endif
);
void manage_inactivity(const bool ignore_stepper_queue=false);
#if ENABLED(EXPERIMENTAL_I2CBUS)
#include "feature/twibus.h"
extern TWIBus i2c;
#endif
#if ENABLED(G38_PROBE_TARGET)
extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type
extern bool G38_did_trigger; // Flag from the ISR to indicate the endstop changed
#endif
/**
* The axis order in all axis related arrays is X, Y, Z, E
*/
void enable_e_steppers();
void enable_all_steppers();
void disable_e_stepper(const uint8_t e);
void disable_e_steppers();
void disable_all_steppers();
void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false);
void minkill(const bool steppers_off=false);
void quickstop_stepper();
extern bool Running;
inline bool IsRunning() { return Running; }
inline bool IsStopped() { return !Running; }
bool printingIsActive();
bool printingIsPaused();
void startOrResumeJob();
extern bool wait_for_heatup;
#if HAS_RESUME_CONTINUE
extern bool wait_for_user;
#endif
#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE)
extern bool suspend_auto_report;
#endif
// Inactivity shutdown timer
extern millis_t max_inactive_time, stepper_inactive_time;
#if ENABLED(USE_CONTROLLER_FAN)
extern uint8_t controllerfan_speed;
#endif
#if ENABLED(PSU_CONTROL)
extern bool powersupply_on;
#define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_HIGH); powersupply_on = true; }while(0)
#define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_HIGH); powersupply_on = false; }while(0)
#if ENABLED(AUTO_POWER_CONTROL)
#define PSU_ON() powerManager.power_on()
#define PSU_OFF() powerManager.power_off()
#else
#define PSU_ON() PSU_PIN_ON()
#define PSU_OFF() PSU_PIN_OFF()
#endif
#endif
bool pin_is_protected(const pin_t pin);
void protected_pin_err();
#if HAS_SUICIDE
inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
#endif
#if ENABLED(G29_RETRY_AND_RECOVER)
void event_probe_recover();
void event_probe_failure();
#endif
extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[];

View File

@@ -90,17 +90,18 @@
#define BOARD_RAMPS_ENDER_4 1134 // Creality: Ender-4, CR-8
#define BOARD_RAMPS_CREALITY 1135 // Creality: CR10S, CR20, CR-X
#define BOARD_RAMPS_DAGOMA 1136 // Dagoma F5
#define BOARD_FYSETC_F6_13 1137 // FYSETC F6
#define BOARD_DUPLICATOR_I3_PLUS 1138 // Wanhao Duplicator i3 Plus
#define BOARD_VORON 1139 // VORON Design
#define BOARD_TRONXY_V3_1_0 1140 // Tronxy TRONXY-V3-1.0
#define BOARD_Z_BOLT_X_SERIES 1141 // Z-Bolt X Series
#define BOARD_TT_OSCAR 1142 // TT OSCAR
#define BOARD_OVERLORD 1143 // Overlord/Overlord Pro
#define BOARD_HJC2560C_REV1 1144 // ADIMLab Gantry v1
#define BOARD_HJC2560C_REV2 1145 // ADIMLab Gantry v2
#define BOARD_TANGO 1146 // BIQU Tango V1
#define BOARD_MKS_GEN_L_V2 1147 // MKS GEN L V2
#define BOARD_FYSETC_F6_13 1137 // FYSETC F6 1.3
#define BOARD_FYSETC_F6_14 1138 // FYSETC F6 1.4
#define BOARD_DUPLICATOR_I3_PLUS 1139 // Wanhao Duplicator i3 Plus
#define BOARD_VORON 1140 // VORON Design
#define BOARD_TRONXY_V3_1_0 1141 // Tronxy TRONXY-V3-1.0
#define BOARD_Z_BOLT_X_SERIES 1142 // Z-Bolt X Series
#define BOARD_TT_OSCAR 1143 // TT OSCAR
#define BOARD_OVERLORD 1144 // Overlord/Overlord Pro
#define BOARD_HJC2560C_REV1 1145 // ADIMLab Gantry v1
#define BOARD_HJC2560C_REV2 1146 // ADIMLab Gantry v2
#define BOARD_TANGO 1147 // BIQU Tango V1
#define BOARD_MKS_GEN_L_V2 1148 // MKS GEN L V2
//
// RAMBo and derivatives
@@ -138,6 +139,7 @@
#define BOARD_GT2560_V3_A20 1318 // Geeetech GT2560 Rev B for A20(M/D)
#define BOARD_EINSTART_S 1319 // Einstart retrofit
#define BOARD_WANHAO_ONEPLUS 1320 // Wanhao 0ne+ i3 Mini
#define BOARD_LEAPFROG_XEED2015 1321 // Leapfrog Xeed 2015
//
// ATmega1281, ATmega2561
@@ -201,22 +203,28 @@
#define BOARD_RAMPS_14_RE_ARM_SF 2004 // Re-ARM with RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
#define BOARD_MKS_SBASE 2005 // MKS-Sbase (Power outputs: Hotend0, Hotend1, Bed, Fan)
#define BOARD_AZSMZ_MINI 2006 // AZSMZ Mini
#define BOARD_AZTEEG_X5_GT 2007 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan)
#define BOARD_BIQU_BQ111_A4 2008 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed)
#define BOARD_SELENA_COMPACT 2009 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1)
#define BOARD_COHESION3D_REMIX 2010 // Cohesion3D ReMix
#define BOARD_COHESION3D_MINI 2011 // Cohesion3D Mini
#define BOARD_SMOOTHIEBOARD 2012 // Smoothieboard
#define BOARD_AZTEEG_X5_MINI_WIFI 2013 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan)
#define BOARD_BIQU_B300_V1_0 2014 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver)
#define BOARD_AZTEEG_X5_MINI 2015 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan)
#define BOARD_MKS_SGEN 2016 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan)
#define BOARD_MKS_SGEN_L 2017 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan)
#define BOARD_TH3D_EZBOARD 2018 // TH3D EZBoard v1.0
#define BOARD_GMARSH_X6_REV1 2019 // GMARSH X6 board, revision 1 prototype
#define BOARD_BIGTREE_SKR_V1_1 2020 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed)
#define BOARD_BIGTREE_SKR_V1_3 2021 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed)
#define BOARD_BIGTREE_SKR_V1_4 2022 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed)
#define BOARD_BIQU_BQ111_A4 2007 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed)
#define BOARD_SELENA_COMPACT 2008 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1)
#define BOARD_BIQU_B300_V1_0 2009 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver)
#define BOARD_MKS_SGEN_L 2010 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan)
#define BOARD_GMARSH_X6_REV1 2011 // GMARSH X6 board, revision 1 prototype
#define BOARD_BIGTREE_SKR_V1_1 2012 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed)
#define BOARD_BIGTREE_SKR_V1_3 2013 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed)
#define BOARD_BIGTREE_SKR_V1_4 2014 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed)
//
// LPC1769 ARM Cortex M3
//
#define BOARD_MKS_SGEN 2500 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan)
#define BOARD_AZTEEG_X5_GT 2501 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan)
#define BOARD_AZTEEG_X5_MINI 2502 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan)
#define BOARD_AZTEEG_X5_MINI_WIFI 2503 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan)
#define BOARD_COHESION3D_REMIX 2504 // Cohesion3D ReMix
#define BOARD_COHESION3D_MINI 2505 // Cohesion3D Mini
#define BOARD_SMOOTHIEBOARD 2506 // Smoothieboard
#define BOARD_TH3D_EZBOARD 2507 // TH3D EZBoard v1.0
#define BOARD_BIGTREE_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO (Power outputs: Hotend0, Hotend1, Fan, Bed)
//
// SAM3X8E ARM Cortex M3
@@ -248,6 +256,7 @@
#define BOARD_ARCHIM1 3023 // UltiMachine Archim1 (with DRV8825 drivers)
#define BOARD_ARCHIM2 3024 // UltiMachine Archim2 (with TMC2130 drivers)
#define BOARD_ALLIGATOR 3025 // Alligator Board R2
#define BOARD_CNCONTROLS_15D 3026 // Cartesio CN Controls V15 on DUE
//
// SAM3X8C ARM Cortex M3
@@ -303,7 +312,7 @@
#define BOARD_RUMBA32 4203 // RUMBA32 STM32F4-based controller
#define BOARD_BLACK_STM32F407VE 4204 // BLACK_STM32F407VE
#define BOARD_BLACK_STM32F407ZE 4205 // BLACK_STM32F407ZE
#define BOARD_STEVAL 4206 // STEVAL-3DP001V1 3D PRINTER BOARD
#define BOARD_STEVAL_3DP001V1 4206 // STEVAL-3DP001V1 3D PRINTER BOARD
#define BOARD_BIGTREE_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
#define BOARD_BIGTREE_BTT002_V1_0 4208 // BigTreeTech BTT002 v1.0 (STM32F407VE)
#define BOARD_LERDGE_K 4209 // Lerdge K (STM32F407ZG)
@@ -323,9 +332,10 @@
//
// Espressif ESP32 WiFi
//
#define BOARD_ESPRESSIF_ESP32 6000
#define BOARD_ESPRESSIF_ESP32 6000 // Generic ESP32
#define BOARD_MRR_ESPA 6001
#define BOARD_MRR_ESPE 6002
#define BOARD_E4D_BOX 6003 // E4d@BOX
//
// Simulations

View File

@@ -23,30 +23,33 @@
#include "../inc/MarlinConfigPre.h"
#define _A4988 0x001
#define _A5984 0x002
#define _DRV8825 0x003
#define _LV8729 0x004
#define _L6470 0x105
#define _TB6560 0x006
#define _TB6600 0x007
#define _TMC2100 0x008
#define _TMC2130 2130
#define _TMC2130_STANDALONE 0x009
#define _TMC2160 2160
#define _TMC2160_STANDALONE 2161
#define _TMC2208 2208
#define _TMC2208_STANDALONE 0x00A
#define _TMC2209 2209
#define _TMC2209_STANDALONE 0x00D
#define _TMC26X 0x10B
#define _TMC26X_STANDALONE 0x00B
#define _TMC2660 2660
#define _TMC2660_STANDALONE 0x00C
#define _TMC5130 5130
#define _TMC5130_STANDALONE 5131
#define _TMC5160 5160
#define _TMC5160_STANDALONE 5161
#define _A4988 0x4988
#define _A5984 0x5984
#define _DRV8825 0x8825
#define _LV8729 0x8729
#define _L6470 0x6470
#define _L6474 0x6474
#define _L6480 0x6480
#define _POWERSTEP01 0xF00D
#define _TB6560 0x6560
#define _TB6600 0x6600
#define _TMC2100 0x2100
#define _TMC2130 0x2130A
#define _TMC2130_STANDALONE 0x2130B
#define _TMC2160 0x2160A
#define _TMC2160_STANDALONE 0x2160B
#define _TMC2208 0x2208A
#define _TMC2208_STANDALONE 0x2208B
#define _TMC2209 0x2209A
#define _TMC2209_STANDALONE 0x2209B
#define _TMC26X 0x2600A
#define _TMC26X_STANDALONE 0x2600B
#define _TMC2660 0x2660A
#define _TMC2660_STANDALONE 0x2660B
#define _TMC5130 0x5130A
#define _TMC5130_STANDALONE 0x5130B
#define _TMC5160 0x5160A
#define _TMC5160_STANDALONE 0x5160B
#define _DRIVER_ID(V) _CAT(_, V)
#define _AXIS_DRIVER_TYPE(A,T) (_DRIVER_ID(A##_DRIVER_TYPE) == _CAT(_, T))
@@ -54,26 +57,35 @@
#define AXIS_DRIVER_TYPE_X(T) _AXIS_DRIVER_TYPE(X,T)
#define AXIS_DRIVER_TYPE_Y(T) _AXIS_DRIVER_TYPE(Y,T)
#define AXIS_DRIVER_TYPE_Z(T) _AXIS_DRIVER_TYPE(Z,T)
#define AXIS_DRIVER_TYPE_X2(T) (EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) && _AXIS_DRIVER_TYPE(X2,T))
#if EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE)
#define AXIS_DRIVER_TYPE_X2(T) _AXIS_DRIVER_TYPE(X2,T)
#else
#define AXIS_DRIVER_TYPE_X2(T) false
#endif
#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T))
#define AXIS_DRIVER_TYPE_Z2(T) (Z_MULTI_STEPPER_DRIVERS && _AXIS_DRIVER_TYPE(Z2,T))
#define AXIS_DRIVER_TYPE_Z3(T) (ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Z3,T))
#define AXIS_DRIVER_TYPE_Z2(T) (NUM_Z_STEPPER_DRIVERS >= 2 && _AXIS_DRIVER_TYPE(Z2,T))
#define AXIS_DRIVER_TYPE_Z3(T) (NUM_Z_STEPPER_DRIVERS >= 3 && _AXIS_DRIVER_TYPE(Z3,T))
#define AXIS_DRIVER_TYPE_Z4(T) (NUM_Z_STEPPER_DRIVERS >= 4 && _AXIS_DRIVER_TYPE(Z4,T))
#define AXIS_DRIVER_TYPE_E0(T) (E_STEPPERS > 0 && _AXIS_DRIVER_TYPE(E0,T))
#define AXIS_DRIVER_TYPE_E1(T) (E_STEPPERS > 1 && _AXIS_DRIVER_TYPE(E1,T))
#define AXIS_DRIVER_TYPE_E2(T) (E_STEPPERS > 2 && _AXIS_DRIVER_TYPE(E2,T))
#define AXIS_DRIVER_TYPE_E3(T) (E_STEPPERS > 3 && _AXIS_DRIVER_TYPE(E3,T))
#define AXIS_DRIVER_TYPE_E4(T) (E_STEPPERS > 4 && _AXIS_DRIVER_TYPE(E4,T))
#define AXIS_DRIVER_TYPE_E5(T) (E_STEPPERS > 5 && _AXIS_DRIVER_TYPE(E5,T))
#define AXIS_DRIVER_TYPE_E6(T) (E_STEPPERS > 6 && _AXIS_DRIVER_TYPE(E6,T))
#define AXIS_DRIVER_TYPE_E7(T) (E_STEPPERS > 7 && _AXIS_DRIVER_TYPE(E7,T))
#define AXIS_DRIVER_TYPE(A,T) AXIS_DRIVER_TYPE_##A(T)
#define HAS_E_DRIVER(T) ( AXIS_DRIVER_TYPE_E0(T) || AXIS_DRIVER_TYPE_E1(T) \
|| AXIS_DRIVER_TYPE_E2(T) || AXIS_DRIVER_TYPE_E3(T) \
|| AXIS_DRIVER_TYPE_E4(T) || AXIS_DRIVER_TYPE_E5(T) )
|| AXIS_DRIVER_TYPE_E4(T) || AXIS_DRIVER_TYPE_E5(T) \
|| AXIS_DRIVER_TYPE_E6(T) || AXIS_DRIVER_TYPE_E7(T) )
#define HAS_DRIVER(T) ( AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) \
|| AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) \
|| AXIS_DRIVER_TYPE_Z(T) || AXIS_DRIVER_TYPE_Z2(T) || AXIS_DRIVER_TYPE_Z3(T) \
|| AXIS_DRIVER_TYPE_Z(T) || AXIS_DRIVER_TYPE_Z2(T) \
|| AXIS_DRIVER_TYPE_Z3(T) || AXIS_DRIVER_TYPE_Z4(T) \
|| HAS_E_DRIVER(T) )
// Test for supported TMC drivers that require advanced configuration
@@ -86,6 +98,18 @@
|| HAS_DRIVER(TMC5130) \
|| HAS_DRIVER(TMC5160) )
#define HAS_TRINAMIC_STANDALONE ( HAS_DRIVER(TMC2130_STANDALONE) \
|| HAS_DRIVER(TMC2208_STANDALONE) \
|| HAS_DRIVER(TMC2209_STANDALONE) \
|| HAS_DRIVER(TMC26X_STANDALONE) \
|| HAS_DRIVER(TMC2660_STANDALONE) \
|| HAS_DRIVER(TMC5130_STANDALONE) \
|| HAS_DRIVER(TMC5160_STANDALONE) \
|| HAS_DRIVER(TMC2160_STANDALONE) )
#define HAS_TMCX1X0 ( HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2160) \
|| HAS_DRIVER(TMC5130) || HAS_DRIVER(TMC5160))
#define HAS_TMC220x (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209))
#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \
@@ -107,6 +131,8 @@
#define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) \
|| AXIS_DRIVER_TYPE(A,TMC2209) )
#define AXIS_HAS_SW_SERIAL(A) ((AXIS_HAS_UART(A) && !defined(A##_HARDWARE_SERIAL)))
#define AXIS_HAS_STALLGUARD(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \
|| AXIS_DRIVER_TYPE(A,TMC2160) \
|| AXIS_DRIVER_TYPE(A,TMC2209) \
@@ -121,19 +147,20 @@
|| AXIS_DRIVER_TYPE(A,TMC5130) \
|| AXIS_DRIVER_TYPE(A,TMC5160) )
#define HAS_TMC_E_DRIVER ( HAS_E_DRIVER(TMC2130) \
|| HAS_E_DRIVER(TMC2160) \
|| HAS_E_DRIVER(TMC2660) \
|| HAS_E_DRIVER(TMC2209) \
|| HAS_E_DRIVER(TMC5130) \
|| HAS_E_DRIVER(TMC5160) )
#define ANY_AXIS_HAS(T) ( AXIS_HAS_##T(X) || AXIS_HAS_##T(X2) \
|| AXIS_HAS_##T(Y) || AXIS_HAS_##T(Y2) \
|| AXIS_HAS_##T(Z) || AXIS_HAS_##T(Z2) \
|| AXIS_HAS_##T(Z3) \
|| AXIS_HAS_##T(E0) || AXIS_HAS_##T(E1) \
|| AXIS_HAS_##T(E2) || AXIS_HAS_##T(E3) \
|| AXIS_HAS_##T(E4) || AXIS_HAS_##T(E5) \
|| AXIS_HAS_##T(E6) || AXIS_HAS_##T(E7) )
#define HAS_STEALTHCHOP ANY_AXIS_HAS(STEALTHCHOP)
#define HAS_STALLGUARD ANY_AXIS_HAS(STALLGUARD)
#define TMC_HAS_SPI ANY_AXIS_HAS(SPI)
#define TMC_HAS_SW_SERIAL ANY_AXIS_HAS(SW_SERIAL)
#define HAS_TMC_STANDALONE_E_DRIVER ( HAS_E_DRIVER(TMC2130_STANDALONE) \
|| HAS_E_DRIVER(TMC2160_STANDALONE) \
|| HAS_E_DRIVER(TMC2660_STANDALONE) \
|| HAS_E_DRIVER(TMC2209_STANDALONE) \
|| HAS_E_DRIVER(TMC5130_STANDALONE) \
|| HAS_E_DRIVER(TMC5160_STANDALONE) )
//
// Stretching 'drivers.h' to include LPC/SAMD51 SD options
//
@@ -142,3 +169,8 @@
#define _SDCARD_CUSTOM_CABLE 3
#define _SDCARD_ID(V) _CAT(_SDCARD_, V)
#define SD_CONNECTION_IS(V) (_SDCARD_ID(SDCARD_CONNECTION) == _SDCARD_ID(V))
#define HAS_L64XX (HAS_DRIVER(L6470) || HAS_DRIVER(L6474) || HAS_DRIVER(L6480) || HAS_DRIVER(POWERSTEP01))
#define HAS_L64XX_NOT_L6474 (HAS_L64XX && !HAS_DRIVER(L6474))
#define AXIS_IS_L64XX(A) (AXIS_DRIVER_TYPE_##A(L6470) || AXIS_DRIVER_TYPE_##A(L6474) || AXIS_DRIVER_TYPE_##A(L6480) || AXIS_DRIVER_TYPE_##A(POWERSTEP01))

View File

@@ -195,6 +195,8 @@
#define MSG_Z2_MAX "z2_max"
#define MSG_Z3_MIN "z3_min"
#define MSG_Z3_MAX "z3_max"
#define MSG_Z4_MIN "z4_min"
#define MSG_Z4_MAX "z4_max"
#define MSG_Z_PROBE "z_probe"
#define MSG_FILAMENT_RUNOUT_SENSOR "filament"
#define MSG_PROBE_OFFSET "Probe Offset"
@@ -220,6 +222,10 @@
#define MSG_SOFT_MIN " Min: "
#define MSG_SOFT_MAX " Max: "
#define MSG_SAVED_POS "Position saved"
#define MSG_RESTORING_POS "Restoring position"
#define MSG_INVALID_POS_SLOT "Invalid slot. Total: "
#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir "
#define MSG_SD_INIT_FAIL "SD init fail"
#define MSG_SD_VOL_INIT_FAIL "volume.init failed"
@@ -333,6 +339,7 @@
#define MSG_Y2 "Y2"
#define MSG_Z2 "Z2"
#define MSG_Z3 "Z3"
#define MSG_Z4 "Z4"
#define LCD_STR_A MSG_A
#define LCD_STR_B MSG_B
@@ -356,6 +363,8 @@
#define LCD_STR_N3 "3"
#define LCD_STR_N4 "4"
#define LCD_STR_N5 "5"
#define LCD_STR_N6 "6"
#define LCD_STR_N7 "7"
#else
#define LCD_FIRST_TOOL '1'
#define LCD_STR_N0 "1"
@@ -364,6 +373,8 @@
#define LCD_STR_N3 "4"
#define LCD_STR_N4 "5"
#define LCD_STR_N5 "6"
#define LCD_STR_N6 "7"
#define LCD_STR_N7 "8"
#endif
#define LCD_STR_E0 "E" LCD_STR_N0
@@ -372,6 +383,8 @@
#define LCD_STR_E3 "E" LCD_STR_N3
#define LCD_STR_E4 "E" LCD_STR_N4
#define LCD_STR_E5 "E" LCD_STR_N5
#define LCD_STR_E6 "E" LCD_STR_N6
#define LCD_STR_E7 "E" LCD_STR_N7
#include "multi_language.h" // Allow multiple languages

View File

@@ -29,12 +29,23 @@
#define _AXIS(A) (A##_AXIS)
#define _XMIN_ 100
#define _YMIN_ 200
#define _ZMIN_ 300
#define _XMAX_ 101
#define _YMAX_ 201
#define _ZMAX_ 301
#define _XMIN_ 100
#define _YMIN_ 200
#define _ZMIN_ 300
#define _XMAX_ 101
#define _YMAX_ 201
#define _ZMAX_ 301
#define _XDIAG_ 102
#define _YDIAG_ 202
#define _ZDIAG_ 302
#define _E0DIAG_ 400
#define _E1DIAG_ 401
#define _E2DIAG_ 402
#define _E3DIAG_ 403
#define _E4DIAG_ 404
#define _E5DIAG_ 405
#define _E6DIAG_ 406
#define _E7DIAG_ 407
#define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
#define FORCE_INLINE __attribute__((always_inline)) inline

View File

@@ -29,7 +29,7 @@ static const char errormagic[] PROGMEM = "Error:";
static const char echomagic[] PROGMEM = "echo:";
#if NUM_SERIAL > 1
int8_t serial_port_index = SERIAL_PORT;
int8_t serial_port_index = 0;
#endif
void serialprintPGM(PGM_P str) {
@@ -58,12 +58,10 @@ void serialprint_onoff(const bool onoff) { serialprintPGM(onoff ? PSTR(MSG_ON) :
void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EOL(); }
void serialprint_truefalse(const bool tf) { serialprintPGM(tf ? PSTR("true") : PSTR("false")); }
void print_bin(const uint16_t val) {
uint16_t mask = 0x8000;
void print_bin(uint16_t val) {
for (uint8_t i = 16; i--;) {
if (i && !(i % 4)) SERIAL_CHAR(' ');
SERIAL_CHAR((val & mask) ? '1' : '0');
mask >>= 1;
SERIAL_CHAR('0' + TEST(val, i));
if (!(i & 0x3) && i) SERIAL_CHAR(' ');
}
}

View File

@@ -66,7 +66,6 @@ extern uint8_t marlin_debug_flags;
#define PORT_REDIRECT(p) _PORT_REDIRECT(1,p)
#define PORT_RESTORE() _PORT_RESTORE(1)
#define SERIAL_CHAR(x) SERIAL_OUT(write, x)
#define SERIAL_ECHO(x) SERIAL_OUT(print, x)
#define SERIAL_ECHO_F(V...) SERIAL_OUT(print, V)
#define SERIAL_ECHOLN(x) SERIAL_OUT(println, x)
@@ -83,6 +82,22 @@ extern uint8_t marlin_debug_flags;
#define SERIAL_FLUSHTX()
#endif
// Print up to 10 chars from a list
#define __CHAR_N(N,V...) _CHAR_##N(V)
#define _CHAR_N(N,V...) __CHAR_N(N,V)
#define _CHAR_1(c) SERIAL_OUT(write, c)
#define _CHAR_2(a,b) do{ _CHAR_1(a); _CHAR_1(b); }while(0)
#define _CHAR_3(a,V...) do{ _CHAR_1(a); _CHAR_2(V); }while(0)
#define _CHAR_4(a,V...) do{ _CHAR_1(a); _CHAR_3(V); }while(0)
#define _CHAR_5(a,V...) do{ _CHAR_1(a); _CHAR_4(V); }while(0)
#define _CHAR_6(a,V...) do{ _CHAR_1(a); _CHAR_5(V); }while(0)
#define _CHAR_7(a,V...) do{ _CHAR_1(a); _CHAR_6(V); }while(0)
#define _CHAR_8(a,V...) do{ _CHAR_1(a); _CHAR_7(V); }while(0)
#define _CHAR_9(a,V...) do{ _CHAR_1(a); _CHAR_8(V); }while(0)
#define _CHAR_10(a,V...) do{ _CHAR_1(a); _CHAR_9(V); }while(0)
#define SERIAL_CHAR(V...) _CHAR_N(NUM_ARGS(V),V)
// Print up to 12 pairs of values. Odd elements auto-wrapped in PSTR().
#define __SEP_N(N,V...) _SEP_##N(V)
#define _SEP_N(N,V...) __SEP_N(N,V)

View File

@@ -43,11 +43,7 @@ enum AxisEnum : uint8_t {
E_AXIS = 3,
X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 6,
E0_AXIS = 3,
E1_AXIS = 4,
E2_AXIS = 5,
E3_AXIS = 6,
E4_AXIS = 7,
E5_AXIS = 8,
E1_AXIS, E2_AXIS, E3_AXIS, E4_AXIS, E5_AXIS, E6_AXIS, E7_AXIS,
ALL_AXES = 0xFE, NO_AXIS = 0xFF
};

View File

@@ -22,7 +22,7 @@
#include "utility.h"
#include "../Marlin.h"
#include "../MarlinCore.h"
#include "../module/temperature.h"
void safe_delay(millis_t ms) {
@@ -81,40 +81,49 @@ void safe_delay(millis_t ms) {
);
#if HAS_BED_PROBE
SERIAL_ECHOPAIR_P(PSTR("Probe Offset X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z);
if (probe_offset.x > 0)
SERIAL_ECHOPGM(" (Right");
else if (probe_offset.x < 0)
SERIAL_ECHOPGM(" (Left");
else if (probe_offset.y != 0)
SERIAL_ECHOPGM(" (Middle");
else
SERIAL_ECHOPGM(" (Aligned With");
if (probe_offset.y > 0) {
#if IS_SCARA
SERIAL_ECHOPGM("-Distal");
#else
SERIAL_ECHOPGM("-Back");
#endif
}
else if (probe_offset.y < 0) {
#if IS_SCARA
SERIAL_ECHOPGM("-Proximal");
#else
SERIAL_ECHOPGM("-Front");
#endif
}
else if (probe_offset.x != 0)
SERIAL_ECHOPGM("-Center");
#if !HAS_PROBE_XY_OFFSET
SERIAL_ECHOPAIR("Probe Offset X0 Y0 Z", probe_offset.z, " (");
#else
SERIAL_ECHOPAIR_P(PSTR("Probe Offset X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z);
if (probe_offset.x > 0)
SERIAL_ECHOPGM(" (Right");
else if (probe_offset.x < 0)
SERIAL_ECHOPGM(" (Left");
else if (probe_offset.y != 0)
SERIAL_ECHOPGM(" (Middle");
else
SERIAL_ECHOPGM(" (Aligned With");
if (probe_offset.y > 0) {
#if IS_SCARA
SERIAL_ECHOPGM("-Distal");
#else
SERIAL_ECHOPGM("-Back");
#endif
}
else if (probe_offset.y < 0) {
#if IS_SCARA
SERIAL_ECHOPGM("-Proximal");
#else
SERIAL_ECHOPGM("-Front");
#endif
}
else if (probe_offset.x != 0)
SERIAL_ECHOPGM("-Center");
SERIAL_ECHOPGM(" & ");
#endif
if (probe_offset.z < 0)
SERIAL_ECHOPGM(" & Below");
SERIAL_ECHOPGM("Below");
else if (probe_offset.z > 0)
SERIAL_ECHOPGM(" & Above");
SERIAL_ECHOPGM("Above");
else
SERIAL_ECHOPGM(" & Same Z as");
SERIAL_ECHOPGM("Same Z as");
SERIAL_ECHOLNPGM(" Nozzle)");
#endif
#if HAS_ABL_OR_UBL
@@ -139,8 +148,7 @@ void safe_delay(millis_t ms) {
SERIAL_ECHOPGM("ABL Adjustment X");
LOOP_XYZ(a) {
float v = planner.get_axis_position_mm(AxisEnum(a)) - current_position[a];
SERIAL_CHAR(' ');
SERIAL_CHAR('X' + char(a));
SERIAL_CHAR(' ', 'X' + char(a));
if (v > 0) SERIAL_CHAR('+');
SERIAL_ECHO(v);
}

View File

@@ -45,7 +45,7 @@
#include "../module/planner.h"
#include "../module/stepper.h"
#include "../Marlin.h"
#include "../MarlinCore.h"
#include "../HAL/shared/Delay.h"
#define HAS_SIDE_BY_SIDE (ENABLED(MAX7219_SIDE_BY_SIDE) && MAX7219_NUMBER_UNITS > 1)
@@ -455,15 +455,19 @@ void Max7219::register_setup() {
#ifdef MAX7219_INIT_TEST
#if MAX7219_INIT_TEST == 2
#define MAX7219_LEDS (MAX7219_X_LEDS * MAX7219_Y_LEDS)
void Max7219::spiral(const bool on, const uint16_t del) {
constexpr int8_t way[] = { 1, 0, 0, 1, -1, 0, 0, -1 };
constexpr int8_t way[][2] = { { 1, 0 }, { 0, 1 }, { -1, 0 }, { 0, -1 } };
int8_t px = 0, py = 0, dir = 0;
for (uint8_t i = MAX7219_X_LEDS * MAX7219_Y_LEDS; i--;) {
for (IF<(MAX7219_LEDS > 255), uint16_t, uint8_t>::type i = MAX7219_LEDS; i--;) {
led_set(px, py, on);
delay(del);
const int8_t x = px + way[dir], y = py + way[dir + 1];
if (!WITHIN(x, 0, MAX7219_X_LEDS - 1) || !WITHIN(y, 0, MAX7219_Y_LEDS - 1) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7;
px += way[dir]; py += way[dir + 1];
const int8_t x = px + way[dir][0], y = py + way[dir][1];
if (!WITHIN(x, 0, MAX7219_X_LEDS - 1) || !WITHIN(y, 0, MAX7219_Y_LEDS - 1) || BIT_7219(x, y) == on)
dir = (dir + 1) & 0x3;
px += way[dir][0];
py += way[dir][1];
}
}

View File

@@ -25,7 +25,7 @@
#if ENABLED(BABYSTEPPING)
#include "babystep.h"
#include "../Marlin.h"
#include "../MarlinCore.h"
#include "../module/planner.h"
#include "../module/stepper.h"
@@ -78,7 +78,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
#endif
#if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
#define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: enable_X(); break; case Y_AXIS: enable_Y(); break; case Z_AXIS: enable_Z(); break; default: break; } }while(0)
#define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: ENABLE_AXIS_X(); break; case Y_AXIS: ENABLE_AXIS_Y(); break; case Z_AXIS: ENABLE_AXIS_Z(); break; default: break; } }while(0)
#else
#define BSA_ENABLE(AXIS) NOOP
#endif

View File

@@ -86,14 +86,18 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) {
#endif
if (planner.leveling_active) { // leveling from on to off
if (DEBUGGING(LEVELING)) DEBUG_POS("Leveling ON", current_position);
// change unleveled current_position to physical current_position without moving steppers.
planner.apply_leveling(current_position);
planner.leveling_active = false; // disable only AFTER calling apply_leveling
if (DEBUGGING(LEVELING)) DEBUG_POS("...Now OFF", current_position);
}
else { // leveling from off to on
if (DEBUGGING(LEVELING)) DEBUG_POS("Leveling OFF", current_position);
planner.leveling_active = true; // enable BEFORE calling unapply_leveling, otherwise ignored
// change physical current_position to unleveled current_position without moving steppers.
planner.unapply_leveling(current_position);
if (DEBUGGING(LEVELING)) DEBUG_POS("...Now ON", current_position);
}
sync_plan_position();
@@ -180,7 +184,7 @@ void reset_bed_level() {
#endif
for (uint8_t y = 0; y < sy; y++) {
#ifdef SCAD_MESH_OUTPUT
SERIAL_ECHOPGM(" ["); // open sub-array
SERIAL_ECHOPGM(" ["); // open sub-array
#else
if (y < 10) SERIAL_CHAR(' ');
SERIAL_ECHO(int(y));
@@ -207,14 +211,13 @@ void reset_bed_level() {
#endif
}
#ifdef SCAD_MESH_OUTPUT
SERIAL_CHAR(' ');
SERIAL_CHAR(']'); // close sub-array
SERIAL_CHAR(' ', ']'); // close sub-array
if (y < sy - 1) SERIAL_CHAR(',');
#endif
SERIAL_EOL();
}
#ifdef SCAD_MESH_OUTPUT
SERIAL_ECHOPGM("];"); // close 2D array
SERIAL_ECHOPGM("];"); // close 2D array
#endif
SERIAL_EOL();
}
@@ -244,7 +247,7 @@ void reset_bed_level() {
current_position = pos;
#if ENABLED(LCD_BED_LEVELING)
ui.wait_for_bl_move = false;
ui.wait_for_move = false;
#endif
}

View File

@@ -176,7 +176,7 @@
// Add XY probe offset from extruder because probe_at_point() subtracts them when
// moving to the XY position to be measured. This ensures better agreement between
// the current Z position after G28 and the mesh values.
const xy_int8_t curr = closest_indexes(xy_pos_t(current_position) + xy_pos_t(probe_offset));
const xy_int8_t curr = closest_indexes(xy_pos_t(current_position) + probe_offset_xy);
if (!lcd) SERIAL_EOL();
for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {

View File

@@ -26,7 +26,7 @@
#include "../bedlevel.h"
#include "../../../Marlin.h"
#include "../../../MarlinCore.h"
#include "../../../HAL/shared/persistent_store_api.h"
#include "../../../libs/hex_print_routines.h"
#include "../../../module/configuration_store.h"
@@ -450,7 +450,7 @@
SERIAL_ECHO(g29_pos.y);
SERIAL_ECHOLNPGM(").\n");
}
const xy_pos_t near = g29_pos + probe_offset;
const xy_pos_t near = g29_pos + probe_offset_xy;
probe_entire_mesh(near, parser.seen('T'), parser.seen('E'), parser.seen('U'));
report_current_position();
@@ -468,6 +468,7 @@
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
if (parser.seen('C') && !xy_seen) {
/**
* Use a good default location for the path.
* The flipped > and < operators in these comparisons is intentional.
@@ -479,8 +480,8 @@
#if IS_KINEMATIC
X_HOME_POS, Y_HOME_POS
#else
probe_offset.x > 0 ? X_BED_SIZE : 0,
probe_offset.y < 0 ? Y_BED_SIZE : 0
probe_offset_xy.x > 0 ? X_BED_SIZE : 0,
probe_offset_xy.y < 0 ? Y_BED_SIZE : 0
#endif
);
}
@@ -805,8 +806,8 @@
restore_ubl_active_state_and_leave();
do_blocking_move_to_xy(
constrain(near.x - probe_offset.x, MESH_MIN_X, MESH_MAX_X),
constrain(near.y - probe_offset.y, MESH_MIN_Y, MESH_MAX_Y)
constrain(near.x - probe_offset_xy.x, MESH_MIN_X, MESH_MAX_X),
constrain(near.y - probe_offset_xy.y, MESH_MIN_Y, MESH_MAX_Y)
);
}
@@ -1293,7 +1294,7 @@
closest.distance = -99999.9f;
// Get the reference position, either nozzle or probe
const xy_pos_t ref = probe_relative ? pos + probe_offset : pos;
const xy_pos_t ref = probe_relative ? pos + probe_offset_xy : pos;
float best_so_far = 99999.99f;

View File

@@ -32,7 +32,7 @@
#include "../../../module/delta.h"
#endif
#include "../../../Marlin.h"
#include "../../../MarlinCore.h"
#include <math.h>
#if !UBL_SEGMENTED

View File

@@ -242,7 +242,7 @@ public:
uint8_t protocol() { return (meta >> 4) & 0xF; }
uint8_t type() { return meta & 0xF; }
void reset() { token = 0; sync = 0; meta = 0; size = 0; checksum = 0; }
uint8_t data[1];
uint8_t data[2];
};
union Footer {

View File

@@ -58,7 +58,9 @@ void update_case_light() {
if (case_light_arg_flag && case_light_on)
case_light_brightness = case_light_brightness_sav; // restore last brightens if this is an S1 argument
const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i;
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) || NONE(CASE_LIGHT_USE_NEOPIXEL, CASE_LIGHT_NO_BRIGHTNESS)
const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i;
#endif
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
@@ -71,13 +73,13 @@ void update_case_light() {
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
if (PWM_PIN(CASE_LIGHT_PIN))
analogWrite(pin_t(CASE_LIGHT_PIN),
analogWrite(pin_t(CASE_LIGHT_PIN), (
#if CASE_LIGHT_MAX_PWM == 255
n10ct
#else
map(n10ct, 0, 255, 0, CASE_LIGHT_MAX_PWM)
#endif
);
));
else
#endif
{

Some files were not shown because too many files have changed in this diff Show More