152 Commits

Author SHA1 Message Date
Knutwurst
defcde923f Bump Builddate. 2024-03-22 08:23:01 +01:00
Knutwurst
e466309bfb Increase python version to 3.10 which hopefully does not break the build process 2024-01-12 10:54:49 +01:00
Knutwurst
c697bb5d31 Revert to something that works 2024-01-12 10:44:37 +01:00
Knutwurst
bef8b81f06 Revert to Pythin 3,7 v1 2024-01-12 10:41:15 +01:00
Knutwurst
9cc14f19af Try something else 2024-01-12 10:35:49 +01:00
Knutwurst
7454073163 Upse Python 3.10 2024-01-12 10:29:23 +01:00
Knutwurst
4227c9f662 Hopefully fix the python install in build script. 2024-01-12 10:27:54 +01:00
Knutwurst
e160b50639 Fix Typo in yaml. 2024-01-12 10:24:38 +01:00
Knutwurst
d9fbb65fad Fix Python action 2024-01-12 10:22:42 +01:00
Knutwurst
f77932398c Remove blank. 2024-01-12 10:19:11 +01:00
Knutwurst
05b6a78eef Fix build yml. 2024-01-12 10:16:58 +01:00
Knutwurst
8c03cd38bf Update Python and use actions/upload-artifact@v4 2024-01-12 10:14:58 +01:00
Knutwurst
b92eda5b0d Revert to actions/upload-artifact@v3 to see if it fixes the upload-issue. 2024-01-12 10:03:19 +01:00
Oliver Köster
38444739b7 Merge pull request #509 from stklcode/fix/mega-p-leveling
fix manual leveling from Mega P TFT
2024-01-11 22:11:15 +01:00
Stefan Kalscheuer
8b67bfe695 fix manual leveling from Mega P TFT
Conversion from enqueue_now_P() to injectCommands() causes issues when
executing multiple consecutive commands. Inject a single multi-line
string instead of 3 injections make the leveling feature work again.

Fixes: 524d6fbcdf
2024-01-11 19:57:11 +01:00
Oliver Köster
48db31732f Merge pull request #506 from stklcode/fix/501-runout-threshold
increase threshold for filament runout
2024-01-07 16:58:21 +01:00
Stefan Kalscheuer
2f1941697d increase threshold for filament runout
Increase the threshold from 5 to 20 to reduce the chance of false
positive triggers.
2024-01-06 18:44:14 +01:00
Knutwurst
f9164e3a6e Set filament runout pins. 2023-10-14 13:43:10 +02:00
Knutwurst
ca34b2acc2 Cleanup old pin definitions to avoid confusion. 2023-10-14 09:44:56 +02:00
Knutwurst
e0a4e25ffa More relaxed thermal runaway parameters for all printers especially for the print bed to allow higher temperatures. 2023-09-28 18:33:58 +02:00
Knutwurst
97c3391cd9 Revert "Disable file sorting (for testing purpose only)"
This reverts commit af83c12790.
2023-07-17 11:06:38 +02:00
Knutwurst
ca66eeb43e Reset SoftEndstop behaviour 2023-07-17 11:06:20 +02:00
Knutwurst
af83c12790 Disable file sorting (for testing purpose only) 2023-07-15 11:55:27 +02:00
Knutwurst
98613781e9 Disable ALL setSoftEndstopState() methods to rule out any issued regarding the soft endstops 2023-07-15 11:54:48 +02:00
Knutwurst
f122af1903 Revert "Disable SoftEndstop handling while printing."
This reverts commit 76cb3aec92.
2023-07-15 11:49:37 +02:00
Knutwurst
76cb3aec92 Disable SoftEndstop handling while printing. 2023-07-08 11:38:28 +02:00
Knutwurst
93e90f37f8 Bump build date and version 2023-07-06 16:27:34 +02:00
Oliver Köster
160575dd4f Merge pull request #477 from stklcode/fix/render-folder-regression
partially revert static outputString in RenderCurrentFolder
2023-06-25 16:53:55 +02:00
Stefan Kalscheuer
f10f396cc1 partially revert static outputString in RenderCurrentFolder
The optimization only applies to targets with DGUS2_TFT set. On other
targets the fixed-size array may be of insufficient size.

However, remove the potentially problematic initialization with a single
nullpointer (empty string), as this will be overwritten in the very next
line anyway.

Fixes: a9c018f18c
2023-06-25 15:42:12 +02:00
Knutwurst
e169b0e627 Decrease heater check count to 60000. This fixes #475 2023-06-24 15:18:07 +02:00
Oliver Köster
02d7c31b4c Merge pull request #474 from stklcode/cleanup
Cleanup
2023-06-24 14:52:58 +02:00
Stefan Kalscheuer
b93faf009c github: remove duplicate "Configurations" section from PR template 2023-06-24 14:13:13 +02:00
Stefan Kalscheuer
33c91b345e remove unused PowerKill() 2023-06-24 14:09:27 +02:00
Stefan Kalscheuer
1822172d44 use boolean literals instead of implicit int conversion 2023-06-24 14:04:11 +02:00
Stefan Kalscheuer
0cedfaf9a6 remove unused declarations from anycubic_touchscreen.h 2023-06-24 14:03:21 +02:00
Oliver Köster
0981430d4b Merge pull request #473 from stklcode/fix/render-current-folder
use static initialization for output string in RenderCurrentFolder
2023-06-24 12:50:47 +02:00
Stefan Kalscheuer
a9c018f18c use static initialization for output string in RenderCurrentFolder
The dynamic sized variable outputString may not be properly initialized.
Second issue, we fill the line for directories beyond fileNameLength, so
the initialization is not always sufficient.

We now initialize outputString statically with the maximum printable
size which should resolve both.

Also clean up some variable declarations.
2023-06-24 12:37:51 +02:00
Knutwurst
4d5ba3899b Remove duplicate softEndstop setting. It's already set by the print timer. 2023-06-24 11:38:08 +02:00
Knutwurst
339125801e Fix typos 2023-06-20 15:07:17 +02:00
Knutwurst
614e54657d Cleanup touchscreen code a little 2023-06-17 19:29:21 +02:00
Knutwurst
524d6fbcdf Refactor A22 move X/Y/Z or extrude function. 2023-06-15 17:29:50 +02:00
Knutwurst
b940864e18 Implement 'M73' to set print job progress, overrides Knutwurst's built-in estimate 2023-06-14 22:18:43 +02:00
Knutwurst
71b3968100 Revert default ESP speed to 500k. 2023-06-14 21:37:00 +02:00
Knutwurst
fb335408dc Activate assist level button on 4MAX. This is a trial and error commit. 2023-06-14 17:16:01 +02:00
Knutwurst
b24edb9de7 Add 4MAX Pro code for servo endstop angle adjustment. 2023-06-14 17:00:45 +02:00
Knutwurst
9bdf4d658e Disable ESP. 2023-06-14 16:19:37 +02:00
Knutwurst
9afe777c26 Cleanup code and use clang-formatter to improve readabilty. 2023-06-14 15:11:17 +02:00
Knutwurst
1e27c22bdd Bump build date and version 2023-06-14 11:41:25 +02:00
Knutwurst
b646757a1b Implement 4MAX Pro 2.0 assisted level feature. 2023-06-14 11:04:00 +02:00
Knutwurst
4df951c501 Substiture KNUTWURST_TFT_LEVELING flag with KNUTWURST_CHIRON. 2023-06-14 10:35:01 +02:00
Knutwurst
e0bb686818 Add support for SD extender. 2023-06-13 13:39:30 +02:00
Knutwurst
ff3c981420 Add TODO for SD Extender support. 2023-06-13 12:45:35 +02:00
Knutwurst
f06a7a1454 Update build date. 2023-06-13 12:27:19 +02:00
Knutwurst
201a693283 Make sorting much faster and prevent it from using too much RAM. 2023-06-13 12:07:17 +02:00
Knutwurst
2a33df6da5 Remove unnecessary newlines in serial protocol 2023-06-13 08:54:19 +02:00
Knutwurst
05bd0da620 Add missing break; 2023-06-13 01:16:45 +02:00
Knutwurst
e4081fc7c3 Restructure A6 Get SD Card printing status 2023-06-13 01:12:13 +02:00
Knutwurst
1d2c42d994 A26 refresh SD routine refactoring to it is faster when no sd card is present. 2023-06-12 18:51:20 +02:00
Knutwurst
1be2be4b08 Update build date. 2023-06-12 09:36:27 +02:00
Knutwurst
afa7be67fa Add clang-format config file. 2023-06-11 18:53:37 +02:00
Knutwurst
72c57b37e6 Remove FilamentRunoutCheck on Startup. 2023-06-11 13:42:29 +02:00
Knutwurst
688cb03275 Update Wifi pin header documentation. 2023-06-11 11:52:17 +02:00
Knutwurst
b356da3f9b Update Bulddate. 2023-06-11 11:31:31 +02:00
Knutwurst
cb3848deaf Refactor printing status and time display for anycubic 1.0 tft. 2023-06-11 11:27:17 +02:00
Knutwurst
68a4857305 Revert "Remove thermalManager dependency from 4MAX AutoPowerOff."
This reverts commit de446f0520.
2023-06-11 08:57:12 +02:00
Knutwurst
000c489b63 Restructure fileList to load faster. 2023-06-10 17:32:34 +02:00
Knutwurst
556be8126b Enable Autosave after ABL on chiron models. 2023-06-10 00:29:27 +02:00
Knutwurst
b21b25ddf9 Add initialization to OutputString. You never know. 2023-06-09 22:50:42 +02:00
Knutwurst
2849d5afc3 Switch back from char* to const char* withyout copy routine for testing. 2023-06-09 22:36:30 +02:00
Knutwurst
c10a05b8dd Check for inserted flag from marlin instead of separate check. 2023-06-09 22:27:12 +02:00
Knutwurst
3225d0dad3 Revert File list refactoring a253776. 2023-06-09 22:07:34 +02:00
Knutwurst
d528646009 Remove duplicate sd card check 2023-06-09 13:46:36 +02:00
Knutwurst
a253776044 File list refactoring. 2023-06-09 13:16:27 +02:00
Oliver Köster
ecdbf477ec Merge pull request #462 from stklcode/marlin-2.1.2.1
Merge upstream changes from Marlin 2.1.2.1
2023-06-09 08:50:09 +02:00
Knutwurst
4335238131 Fix anycubics typos in laser implementation. 2023-06-08 22:03:08 +02:00
Knutwurst
dc28578f54 Disable Steppers after one Minute 2023-06-08 18:26:53 +02:00
Knutwurst
de446f0520 Remove thermalManager dependency from 4MAX AutoPowerOff. 2023-06-08 18:17:51 +02:00
Knutwurst
f89e25ce3e Remove debugging defines and auto save after BLTouch leveling. This is saved afterwards when closing the menu. 2023-06-08 18:07:49 +02:00
Knutwurst
4c0ed10367 Rework file counting and substitute probe.offset.z with setZOffset_mm which is an ExtUI function. Also increase build number. 2023-06-08 18:00:11 +02:00
Knutwurst
c77aacbbd9 Set build version for next release 2023-06-07 21:59:21 +02:00
Knutwurst
4206e3c4e8 Invert setSoftEndstopState logic on print stop 2023-06-07 21:39:14 +02:00
Knutwurst
dfc9cbe8b1 Change Chiron and 4MAX filament load length. 2023-06-07 18:55:48 +02:00
Knutwurst
9c7e330363 Fix AutoPowerOff menu selection. 2023-06-07 18:02:01 +02:00
Knutwurst
580d56bd37 Fix PowerOffFlag handling. 2023-06-07 16:16:06 +02:00
Knutwurst
588f703684 Add Special Menu BLTouch HighSpeed Mode selection 2023-06-07 12:39:56 +02:00
Knutwurst
c48395f801 Fix 4MAX build 2023-06-07 09:09:14 +02:00
Knutwurst
f7060d5524 Add more TFT debugging messages. 2023-06-07 09:03:20 +02:00
Knutwurst
acee1592c9 Add setSoftEndstopState to TFT print and stop functions. 2023-06-07 08:49:56 +02:00
Knutwurst
442f66c145 Disable soft endstops while printing, so that mesh points below 0 can be reached. 2023-06-07 08:48:05 +02:00
Knutwurst
b5b3da41f5 Disable software endstops when manual or auto leveling is activated, so the nozzle can be set to a lower point than the endstop. 2023-06-07 08:35:43 +02:00
Knutwurst
38edd9375b Revert "Disable automatic mesh adjustment when Z offset is altered."
This reverts commit fb7a29ce8e.
2023-06-07 08:14:28 +02:00
Knutwurst
fb7a29ce8e Disable automatic mesh adjustment when Z offset is altered. 2023-06-06 21:44:08 +02:00
Knutwurst
056dd71494 Substitute LCD_SERIAL.println() with LCD_SERIAL.print(,2) to ensure display compatibility. 2023-06-06 19:06:50 +02:00
Knutwurst
09b448773f Revert define, because it breaks the build. 2023-06-06 17:01:43 +02:00
Knutwurst
223df2956a Fix display of single mesh points 2023-06-06 17:01:06 +02:00
Knutwurst
9376b95148 Fix live Z offset. 2023-06-06 16:46:09 +02:00
Knutwurst
fbd1b7b9bf Fix PowerOff. 2023-06-03 21:15:52 +02:00
Knutwurst
61fba37678 Reenable auto power off on 4MAX Pro 2.0 2023-06-03 19:45:48 +02:00
Knutwurst
7b0aa6ec6a Code cleanup. 2023-06-03 19:45:21 +02:00
Knutwurst
70ccd6a957 Refactor Chiron A31 Adjust all Probe Points routine 2023-06-03 19:29:59 +02:00
Knutwurst
6bc410a0e3 Unify special menu defines for both display types. Also fix NoSD message and error, when no SD card is present. 2023-06-03 18:51:02 +02:00
Knutwurst
011752e02a Improve file list rendering speed. 2023-06-03 09:20:54 +02:00
Knutwurst
471d7f47a0 Remove unnecessary code from get-sd-list routine. 2023-06-03 00:20:25 +02:00
Knutwurst
0670fb9253 Revert from const char* to char* because it breaks Anycubic 1.0 without SD card. 2023-06-02 22:57:16 +02:00
Knutwurst
501ebfd159 Fix load fw defaults gcode in special menu. 2023-06-02 22:23:53 +02:00
Knutwurst
dedc00fb0d Reenable automatic filament feed on M600, because a little purge is needed to enable the continue button. 2023-06-02 19:42:13 +02:00
Knutwurst
acc3c74905 New load/unload values for chiron. 2023-06-02 19:02:36 +02:00
Knutwurst
d1f269d654 Fix build 2023-06-02 18:59:12 +02:00
Knutwurst
d4fe673b96 Add M600 config for CHIRON. 2023-06-02 18:54:52 +02:00
Knutwurst
862ac308c7 Clean dead code and disable debugging messages. 2023-06-02 18:18:49 +02:00
Knutwurst
75c541cafb Change preheat temperatures. 2023-06-02 18:02:17 +02:00
Knutwurst
bb4ee37676 Set release version and clean up some code snippets. 2023-06-02 17:42:29 +02:00
Knutwurst
bf80c9b8dd Suppress AUTO_ASSIGN_WARNING on Chiron and 4MAX builds. 2023-06-02 17:01:25 +02:00
Knutwurst
79eaf1a8b5 Allow manual probing on Chiron. 2023-06-02 16:57:27 +02:00
Knutwurst
ff5b808dea Add new mediaPrintingState for probing, which is needed by the chiron routine. 2023-06-02 16:48:10 +02:00
Knutwurst
37ef0ca742 Add more debug output. 2023-06-02 13:14:48 +02:00
Knutwurst
fd84ec3523 Add TODO in case A31 - Adjust all Probe Points 2023-06-02 11:16:11 +02:00
Knutwurst
afa411f065 Substitute settings() with command injection. 2023-06-02 08:52:05 +02:00
Knutwurst
d93ff45af6 Set build version and date. Also enable TFT debugging. 2023-06-02 08:48:41 +02:00
Knutwurst
8fb71f482e Fix build 2023-06-02 08:47:06 +02:00
Knutwurst
325bcb7e01 Rebuild Chiron leveling feature. 2023-06-02 08:38:28 +02:00
Knutwurst
0af71b9817 Rename CodeSeen to FindToken. 2023-06-01 22:13:43 +02:00
Knutwurst
8e828a48b9 Revert duplicate Z2 pin definitions on 4MAX and Chiron. 2023-06-01 22:01:17 +02:00
Knutwurst
a356788dc7 Add fix for .GCO files on DGUS2 Clone Display 2023-06-01 19:27:01 +02:00
Knutwurst
6499c6b7c3 Simplify non-printable char filter loop. 2023-06-01 18:42:30 +02:00
Knutwurst
fda51c1c46 Remove unneccessary code in the filename check. 2023-06-01 17:13:17 +02:00
Knutwurst
0c25c876d3 Some refactoring and cleanup. No breaking changes. 2023-06-01 09:14:14 +02:00
Knutwurst
067fe2f074 Bump version and date for next major release. 2023-05-31 21:21:39 +02:00
Knutwurst
e8d38ba955 Enable alphabetical SD card file sorting. 2023-05-31 21:19:37 +02:00
Knutwurst
6d257896c0 Beautify DGUS2 Clone file display. Might need some refactoring. 2023-05-31 16:57:20 +02:00
Knutwurst
2af4a2d4e6 Fix sanitization of directory names on Anycubic 1.0 Display. 2023-05-31 15:19:18 +02:00
Knutwurst
c83dad91f3 Z2 Stepper pin definitions for CHIRON and 4MAX. 2023-05-30 22:10:31 +02:00
Knutwurst
429b8cc1fa Fix warnings in 4MAX Build 2023-05-30 22:00:27 +02:00
Knutwurst
2e030524e2 Disable debug output. 2023-05-30 21:18:41 +02:00
Knutwurst
45cbc380d9 Update build date. 2023-05-30 19:26:27 +02:00
Knutwurst
cf0611a7d9 Use const char* because it's not altered past that point. 2023-05-30 17:33:39 +02:00
Knutwurst
9c4c58235b Fix compiler warnings for Chiron build and Directory selection on Anycubic 1.0 displays. 2023-05-30 16:46:30 +02:00
Knutwurst
75ffa32980 Use SENDLINE instead of SEND to create directory name on anycubic 1.0 display. 2023-05-30 16:07:26 +02:00
Knutwurst
e0d858d812 Fix misuse of const char pointer by creating a new string which represents the filename. 2023-05-30 15:09:46 +02:00
Knutwurst
ad86d96a31 Cleanup 2023-05-30 09:22:25 +02:00
Knutwurst
6c4a0a887a Remove old PrintList() implementation + some cleanup 2023-05-29 20:48:58 +02:00
Knutwurst
e940c218cd Do not remove current selection if Special Menu is enabled, so items can be tapped multiple times. 2023-05-29 20:40:27 +02:00
Knutwurst
1df0ee59d2 Set correct filament sensor pins for chiron in correspondig header and enable new file list implementation. 2023-05-29 20:34:08 +02:00
Knutwurst
9244ea5890 New file list render implementation - WIP! 2023-05-29 20:07:06 +02:00
Knutwurst
8e34d7dc7c Fix 4MAXP2 Build. 2023-05-29 19:27:55 +02:00
Knutwurst
7fbbbba752 Fix Typo 2023-05-29 14:20:28 +02:00
Knutwurst
2b5816037a Add custom M600 configuration for DirectExtruder 4MAX Pro 2.0. 2023-05-29 12:35:07 +02:00
Knutwurst
e008a96269 Fix Chiron and 4MAX Pro 2.0 Filament rundout sensor. 2023-05-29 11:39:00 +02:00
Knutwurst
952e0db31e Fix that you could not get out of a selected directory. Refactor Touchscreen file handling. 2023-05-29 11:20:22 +02:00
Knutwurst
69efa3376a Set lowest point for BLTouch from 2 to 10 mm. 2023-05-28 22:57:50 +02:00
Stefan Kalscheuer
bdd6e0c7fe lower the maximum hotend temperature to stay within the thermistor range
The default thermistor type 1 supports a maximum value of 300°C. The
maximum heater temperature plus overshoot value must stay within that
range. For all targets but 4MAXP2 we use type 1 with a default overshoot
value of 15°C, so let's lower the maximum heater temperature to 285.
2023-05-28 17:18:03 +02:00
Stefan Kalscheuer
f92a587638 Merge upstream changes from Marlin 2.1.2.1 2023-05-26 18:50:47 +02:00
628 changed files with 43463 additions and 31084 deletions

222
.clang-format Normal file
View File

@@ -0,0 +1,222 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: true
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: true
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakArrays: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Attach
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: true
IndentCaseBlocks: true
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentRequiresClause: true
IndentWidth: 2
IndentWrappedFunctionNames: true
InsertBraces: true
InsertNewlineAtEOF: true
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
PPIndentWidth: -1
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
...

29
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,29 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/python-3/.devcontainer/base.Dockerfile
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
ARG VARIANT="3.9.0-buster"
FROM python:${VARIANT}
# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
# && rm -rf /tmp/pip-tmp
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
RUN pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
RUN platformio update
# To get the test platforms
RUN pip install PyYaml
#ENV PATH /code/buildroot/bin/:/code/buildroot/tests/:${PATH}

View File

@@ -0,0 +1,51 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/python-3
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
"VARIANT": "3.9.0-buster",
// Options
"INSTALL_NODE": "false",
"NODE_VERSION": "lts/*"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"platformio.platformio-ide",
"marlinfirmware.auto-build",
"editorconfig.editorconfig"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}

0
.github/ISSUE_TEMPLATE/bug_report.md vendored Executable file → Normal file
View File

0
.github/ISSUE_TEMPLATE/config.yml vendored Executable file → Normal file
View File

0
.github/ISSUE_TEMPLATE/feature_request.md vendored Executable file → Normal file
View File

View File

@@ -28,9 +28,6 @@ Clearly describe the submitted changes with lots of details. Include images wher
<!-- Attach Configurations ZIP and any other files needed to test this PR. -->
### Configurations
<!-- Attach any Configuration.h, Configuration_adv.h, or platformio.ini files needed to compile/test your Pull Request. -->
### Related Issues

View File

@@ -90,10 +90,10 @@ jobs:
steps:
- name: Setup Python 3.7
uses: actions/setup-python@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax.
python-version: '3.10' # 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
@@ -124,7 +124,7 @@ jobs:
# .pio/build/${{ matrix.platform }}/${{ matrix.platform }}_v*.hex
- name: Archive all artifacts into one ZIP file
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v3
with:
name: Knuwurst-all-in-one-${{github.sha}}
path: |

45
.gitignore vendored
View File

@@ -21,35 +21,18 @@
# Generated files
_Version.h
bdf2u8g
bdf2u8g.exe
genpages.exe
marlin_config.json
mczip.h
*.gen
*.sublime-workspace
#
# OS
#
applet/
.DS_Store
#
# Misc
#
*~
*.orig
*.rej
*.bak
*.idea
*.i
*.ii
*.swp
tags
#
# C++
#
# Compiled Object files
# Compiled C++ Object files
*.slo
*.lo
*.o
@@ -80,10 +63,7 @@ tags
*.out
*.app
#
# C
#
# Object files
# Compiled C Object files
*.o
*.ko
*.obj
@@ -143,13 +123,13 @@ vc-fileutils.settings
.vscode/*
!.vscode/extensions.json
#Simulation
# Simulation files
imgui.ini
eeprom.dat
spi_flash.bin
fs.img
#cmake
# CMake
CMakeLists.txt
src/CMakeLists.txt
CMakeListsPrivate.txt
@@ -170,3 +150,16 @@ __pycache__
# IOLogger logs
*_log.csv
# Misc.
*~
*.orig
*.rej
*.bak
*.idea
*.i
*.ii
*.swp
tags
*.logs
*.bak

0
LICENSE Executable file → Normal file
View File

View File

@@ -1,11 +1,16 @@
SCRIPTS_DIR := buildroot/share/scripts
CONTAINER_RT_BIN := docker
CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio
CONTAINER_IMAGE := marlin-dev
help:
@echo "Tasks for local development:"
@echo "* tests-single-ci: Run a single test from inside the CI"
@echo "* tests-single-local: Run a single test locally"
@echo "* tests-single-local-docker: Run a single test locally, using docker-compose"
@echo "* tests-single-local-docker: Run a single test locally, using docker"
@echo "* tests-all-local: Run all tests locally"
@echo "* tests-all-local-docker: Run all tests locally, using docker-compose"
@echo "* setup-local-docker: Setup local docker-compose"
@echo "* tests-all-local-docker: Run all tests locally, using docker"
@echo "* setup-local-docker: Build the local docker image"
@echo ""
@echo "Options for testing:"
@echo " TEST_TARGET Set when running tests-single-*, to select the"
@@ -34,19 +39,21 @@ tests-single-local:
tests-single-local-docker:
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi
docker-compose run --rm marlin $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
.PHONY: tests-single-local-docker
tests-all-local:
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& for TEST_TARGET in $$(./get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
&& for TEST_TARGET in $$($(SCRIPTS_DIR)/get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
.PHONY: tests-all-local
tests-all-local-docker:
docker-compose run --rm marlin $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
.PHONY: tests-all-local-docker
setup-local-docker:
docker-compose build
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
.PHONY: setup-local-docker

109
Marlin/Configuration.h Executable file → Normal file
View File

@@ -35,17 +35,14 @@
*
* Advanced settings can be found in Configuration_adv.h
*/
#define CONFIGURATION_H_VERSION 02010200
#define CONFIGURATION_H_VERSION 02010201
#define ANYCUBIC_TOUCHSCREEN
#define KNUTWURST_SPECIAL_MENU
#define KNUTWURST_SPECIAL_MENU_WO_SD
// #define ANYCUBIC_TFT_DEBUG
// #define POWER_OUTAGE_TEST
#define LCD_SERIAL_PORT 3
#define EXT_LEVEL_HIGH 0.1
/*
* This feature is for debugging purpose only.
* It enabled more console output and should be
@@ -59,6 +56,7 @@
*/
#if ENABLED(KNUTWURST_CHIRON)
#define TRIGORILLA_MAPPING_CHIRON
#define NO_AUTO_ASSIGN_WARNING
#else
#define TRIGORILLA_MAPPING_I3MEGA
#define SWAP_Z_MOTORS
@@ -75,18 +73,6 @@
// #define KNUTWURST_MEGA_P_LASER
#endif
/*
* This enables the integrated leveling features
* in the anycubic touchscreen. It's currently only
* supported by the Anycubic Chiron and therefore it
* is automatically set if the chiron is enabled.
*
*/
#if ENABLED(KNUTWURST_CHIRON)
#define KNUTWURST_TFT_LEVELING
#endif
/*
* To ensure the correct endstop configuration,
* this has to be enabled to alter the motherboard
@@ -94,22 +80,10 @@
*/
#if ENABLED(KNUTWURST_4MAXP2)
#define ANYCUBIC_4_MAX_PRO_ENDSTOPS
#define NO_AUTO_ASSIGN_WARNING
#endif
/*
* Here you can set the default preheat-Temperatures
* which are set when you use the builtin preheat
* functions in the TFT.
*
* These settings are required and not set by PlatformIO.
*/
#define KNUTWURST_PRHEAT_NOZZLE_PLA 200
#define KNUTWURST_PRHEAT_BED_PLA 60
#define KNUTWURST_PRHEAT_NOZZLE_ABS 240
#define KNUTWURST_PRHEAT_BED_ABS 90
// ===========================================================================
// ============================= Getting Started =============================
// ===========================================================================
@@ -193,13 +167,13 @@
---------------
|| D37 D35 ||
|| ||
|| [D17] [D16] || <---- Connect your ESP8266 here (TX/RX)
|| [D17] [D16] || <---- Connect your ESP8266 Wifi module here (TX/RX)
/|| ||
||| D23 D25 ||
\|| ||
|| D27 D29 ||
|| ||
|| GND 5V ||
|| [GND] [5V] || <---- Connect your ESP8266 Wifi module here (GND/VIO)
---------------
*/
@@ -208,8 +182,8 @@
* Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
*/
// #define SERIAL_PORT_2 2
// #define BAUDRATE_2 500000 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE
//#define SERIAL_PORT_2 2
//#define BAUDRATE_2 500000 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE
/**
* Select a third serial port on the board to use for communication with the host.
@@ -355,24 +329,6 @@
// #define SINGLENOZZLE_STANDBY_FAN
#endif
// @section multi-material
/**
* Multi-Material Unit
* Set to one of these predefined models:
*
* PRUSA_MMU1 : Průša MMU1 (The "multiplexer" version)
* PRUSA_MMU2 : Průša MMU2
* PRUSA_MMU2S : Průša MMU2S (Requires MK3S extruder with motion sensor, EXTRUDERS = 5)
* EXTENDABLE_EMU_MMU2 : MMU with configurable number of filaments (ERCF, SMuFF or similar with Průša MMU2 compatible firmware)
* EXTENDABLE_EMU_MMU2S : MMUS with configurable number of filaments (ERCF, SMuFF or similar with Průša MMU2 compatible firmware)
*
* Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails.
* See additional options in Configuration_adv.h.
* :["PRUSA_MMU1", "PRUSA_MMU2", "PRUSA_MMU2S", "EXTENDABLE_EMU_MMU2", "EXTENDABLE_EMU_MMU2S"]
*/
// #define MMU_MODEL PRUSA_MMU2
// A dual extruder that uses a single stepper motor
// #define SWITCHING_EXTRUDER
#if ENABLED(SWITCHING_EXTRUDER)
@@ -506,6 +462,24 @@
// #define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle
// #define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle
// @section multi-material
/**
* Multi-Material Unit
* Set to one of these predefined models:
*
* PRUSA_MMU1 : Průša MMU1 (The "multiplexer" version)
* PRUSA_MMU2 : Průša MMU2
* PRUSA_MMU2S : Průša MMU2S (Requires MK3S extruder with motion sensor, EXTRUDERS = 5)
* EXTENDABLE_EMU_MMU2 : MMU with configurable number of filaments (ERCF, SMuFF or similar with Průša MMU2 compatible firmware)
* EXTENDABLE_EMU_MMU2S : MMUS with configurable number of filaments (ERCF, SMuFF or similar with Průša MMU2 compatible firmware)
*
* Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails.
* See additional options in Configuration_adv.h.
* :["PRUSA_MMU1", "PRUSA_MMU2", "PRUSA_MMU2S", "EXTENDABLE_EMU_MMU2", "EXTENDABLE_EMU_MMU2S"]
*/
// #define MMU_MODEL PRUSA_MMU2
// @section psu control
/**
@@ -740,7 +714,11 @@
// Above this temperature the heater will be switched off.
// This can protect components from overheating, but NOT from shorts and failures.
// (Use MINTEMP for thermistor short/failure protection.)
#define HEATER_0_MAXTEMP 300
#if ENABLED(KNUTWURST_4MAXP2)
#define HEATER_0_MAXTEMP 300
#else
#define HEATER_0_MAXTEMP 285
#endif
#define HEATER_1_MAXTEMP 275
#define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275
@@ -1659,7 +1637,7 @@
* Use G29 repeatedly, adjusting the Z height at each point with movement commands
* or (with LCD_BED_LEVELING) the LCD controller.
*/
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING)
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_CHIRON)
#define PROBE_MANUALLY
#endif
@@ -1678,7 +1656,7 @@
/**
* Z Servo Probe, such as an endstop switch on a rotating arm.
*/
#if ENABLED(KNUTWURST_TFT_LEVELING)
#if ENABLED(KNUTWURST_CHIRON)
#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector.
#define Z_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles
#endif
@@ -1845,11 +1823,11 @@
// #define NOZZLE_TO_PROBE_OFFSET { 29, -15, 0 } //X-Carriage
#endif
#if ENABLED(KNUTWURST_TFT_LEVELING)
#if ENABLED(KNUTWURST_CHIRON)
#define NOZZLE_TO_PROBE_OFFSET { 0, 0, -16.8 }
#endif
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING)
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_CHIRON)
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
#endif
@@ -1939,7 +1917,7 @@
#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes
// #define Z_AFTER_PROBING 5 // Z position after probing is done
#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping
#define Z_PROBE_LOW_POINT -10 // Farthest distance below the trigger-point to go before stopping
// For M851 give a range for adjusting the Z probe offset
#define Z_PROBE_OFFSET_RANGE_MIN -50
@@ -2426,6 +2404,9 @@
// NOTE: After 'M412 H1' the host handles filament runout and this script does not apply.
#define FILAMENT_RUNOUT_SCRIPT "M600"
// More relaxed threshold to prevent false-positive triggers (default: 5)
#define FILAMENT_RUNOUT_THRESHOLD 20
// After a runout is detected, continue printing this length of filament
// before executing the runout script. Useful for a sensor at the end of
// a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
@@ -2477,7 +2458,7 @@
* leveling in steps so you can manually adjust the Z height at each grid-point.
* With an LCD controller the process is guided step-by-step.
*/
#if EITHER(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING)
#if EITHER(KNUTWURST_BLTOUCH, KNUTWURST_CHIRON)
// #define AUTO_BED_LEVELING_3POINT
// #define AUTO_BED_LEVELING_LINEAR
#define AUTO_BED_LEVELING_BILINEAR
@@ -2485,7 +2466,7 @@
// #define MESH_BED_LEVELING
#endif
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING)
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_CHIRON)
// #define AUTO_BED_LEVELING_3POINT
// #define AUTO_BED_LEVELING_LINEAR
// #define AUTO_BED_LEVELING_BILINEAR
@@ -2851,14 +2832,14 @@
// Preheat Constants - Up to 10 are supported without changes
//
#define PREHEAT_1_LABEL "PLA"
#define PREHEAT_1_TEMP_HOTEND 180
#define PREHEAT_1_TEMP_BED 70
#define PREHEAT_1_TEMP_HOTEND 200
#define PREHEAT_1_TEMP_BED 60
// #define PREHEAT_1_TEMP_CHAMBER 35
#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
#define PREHEAT_2_LABEL "ABS"
#define PREHEAT_2_TEMP_HOTEND 240
#define PREHEAT_2_TEMP_BED 110
#define PREHEAT_2_TEMP_BED 90
// #define PREHEAT_2_TEMP_CHAMBER 35
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
@@ -3300,7 +3281,7 @@
//
// Elefu RA Board Control Panel
// http://www.elefu.com/index.php?route=product/product&product_id=53
// https://web.archive.org/web/20140823033947/http://www.elefu.com/index.php?route=product/product&product_id=53
//
// #define RA_CONTROL_PANEL
@@ -3992,7 +3973,7 @@
* Set this manually if there are extra servos needing manual control.
* Set to 0 to turn off servo support.
*/
#if ENABLED(KNUTWURST_TFT_LEVELING)
#if ENABLED(KNUTWURST_CHIRON)
#define NUM_SERVOS 1 // Note: Servo index starts with 0 for M280-M282 commands
#endif

126
Marlin/Configuration_adv.h Executable file → Normal file
View File

@@ -30,7 +30,7 @@
*
* Basic settings can be found in Configuration.h
*/
#define CONFIGURATION_ADV_H_VERSION 02010200
#define CONFIGURATION_ADV_H_VERSION 02010201
// @section develop
@@ -304,13 +304,13 @@
*/
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
#if ENABLED(KNUTWURST_CHIRON)
#define THERMAL_PROTECTION_PERIOD 60 // Seconds
#define THERMAL_PROTECTION_PERIOD 30 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 20 // Degrees Celsius
#define WATCH_TEMP_PERIOD 60 // Seconds
#define WATCH_TEMP_INCREASE 10 // Degrees Celsius
#define WATCH_TEMP_INCREASE 5 // Degrees Celsius
#else
#define THERMAL_PROTECTION_PERIOD 10 // Seconds
#define THERMAL_PROTECTION_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 15 // Degrees Celsius
// #define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
@@ -340,22 +340,22 @@
*/
#if ENABLED(THERMAL_PROTECTION_BED)
#if ENABLED(KNUTWURST_CHIRON)
#define THERMAL_PROTECTION_BED_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 10 // Degrees Celsius
#define THERMAL_PROTECTION_BED_PERIOD 120 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 15 // Degrees Celsius
/**
* As described above, except for the bed (M140/M190/M303).
*/
#define WATCH_BED_TEMP_PERIOD 120 // Seconds
#define WATCH_BED_TEMP_INCREASE 10 // Degrees Celsius
#define WATCH_BED_TEMP_PERIOD 300 // Seconds
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
#else
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_PERIOD 30 // 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_PERIOD 120 // Seconds
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
#endif
#endif
@@ -491,10 +491,10 @@
* Thermistors able to support high temperature tend to have a hard time getting
* good readings at room and lower temperatures. This means TEMP_SENSOR_X_RAW_LO_TEMP
* will probably be caught when the heating element first turns on during the
* preheating process, which will trigger a min_temp_error as a safety measure
* preheating process, which will trigger a MINTEMP error as a safety measure
* and force stop everything.
* To circumvent this limitation, we allow for a preheat time (during which,
* min_temp_error won't be triggered) and add a min_temp buffer to handle
* MINTEMP error won't be triggered) and add a min_temp buffer to handle
* aberrant readings.
*
* If you want to enable this feature for your hotend thermistor(s)
@@ -502,7 +502,7 @@
*/
// The number of consecutive low temperature errors that can occur
// before a min_temp_error is triggered. (Shouldn't be more than 10.)
// before a MINTEMP error is triggered. (Shouldn't be more than 10.)
#if ENABLED(KNUTWURST_CHIRON)
#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 3
#else
@@ -870,7 +870,7 @@
#endif
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_ // Z2 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Y endstop
#define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Z endstop
#endif
#ifdef Z3_DRIVER_TYPE
// #define INVERT_Z3_VS_Z_DIR // Z3 direction signal is the opposite of Z
@@ -880,14 +880,14 @@
#elif ENABLED(KNUTWURST_CHIRON)
#define Z2_USE_ENDSTOP _XMAX_
#endif
#define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Y endstop
#define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Z endstop
#endif
#endif
#ifdef Z4_DRIVER_TYPE
// #define INVERT_Z4_VS_Z_DIR // Z4 direction signal is the opposite of Z
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z4_USE_ENDSTOP _ZMAX_ // Z4 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Y endstop
#define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Z endstop
#endif
#endif
#endif
@@ -1117,7 +1117,7 @@
* Set DISABLE_INACTIVE_? 'true' to shut down axis steppers after an idle period.
* The Deactive Time can be overridden with M18 and M84. Set to 0 for No Timeout.
*/
#define DEFAULT_STEPPER_DEACTIVE_TIME 180
#define DEFAULT_STEPPER_DEACTIVE_TIME 60
#define DISABLE_INACTIVE_X true
#define DISABLE_INACTIVE_Y true
#define DISABLE_INACTIVE_Z true // Set 'false' if the nozzle could fall onto your printed part!
@@ -1479,12 +1479,12 @@
#endif // HAS_DISPLAY || DWIN_LCD_PROUI
// Add 'M73' to set print job progress, overrides Marlin's built-in estimate
// #define SET_PROGRESS_MANUALLY
#define SET_PROGRESS_MANUALLY
#if ENABLED(SET_PROGRESS_MANUALLY)
#define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done
#define SET_REMAINING_TIME // Add 'R' parameter to set remaining time
// #define SET_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction
// #define M73_REPORT // Report M73 values to host
#define SET_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction
#define M73_REPORT // Report M73 values to host
#if BOTH(M73_REPORT, SDSUPPORT)
#define M73_REPORT_SD_ONLY // Report only when printing from SD
#endif
@@ -1611,15 +1611,15 @@
* - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!)
* - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!)
*/
// #define SDCARD_SORT_ALPHA
#define SDCARD_SORT_ALPHA
// SD Card Sorting options
#if ENABLED(SDCARD_SORT_ALPHA)
#define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each.
#define SDSORT_LIMIT 20 // Maximum number of sorted items (10-256). Costs 27 bytes each.
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
#define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 G-code.
#define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting.
#define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
#define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting.
#define SDSORT_USES_STACK true // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
#define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option.
#define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
#define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting.
@@ -2658,29 +2658,73 @@
*/
#define ADVANCED_PAUSE_FEATURE
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract.
// This short retract is done immediately, before parking the nozzle.
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 30 // (mm/s) Unload filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_UNLOAD_LENGTH 555 // (mm) The length of filament for a complete unload.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
// Set to 0 for manual unloading.
#define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load.
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material.
// 0 to disable start loading and skip to fast load only
#define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 30 // (mm/s) Load filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 538 // (mm) Load length of filament, from extruder gear to nozzle.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
#if ENABLED(KNUTWURST_4MAXP2)
#define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract.
// This short retract is done immediately, before parking the nozzle.
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 30 // (mm/s) Unload filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_UNLOAD_LENGTH 5 // (mm) The length of filament for a complete unload.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
// Set to 0 for manual unloading.
#define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load.
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material.
// 0 to disable start loading and skip to fast load only
#define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 30 // (mm/s) Load filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 10 // (mm) Load length of filament, from extruder gear to nozzle.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
#endif
#if ENABLED(KNUTWURST_CHIRON)
#define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract.
// This short retract is done immediately, before parking the nozzle.
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 30 // (mm/s) Unload filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_UNLOAD_LENGTH 5 // (mm) The length of filament for a complete unload.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
// Set to 0 for manual unloading.
#define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load.
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material.
// 0 to disable start loading and skip to fast load only
#define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 30 // (mm/s) Load filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 550 // (mm) Load length of filament, from extruder gear to nozzle.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
#endif
#if NONE(KNUTWURST_CHIRON, KNUTWURST_4MAXP2)
#define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract.
// This short retract is done immediately, before parking the nozzle.
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 30 // (mm/s) Unload filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_UNLOAD_LENGTH 555 // (mm) The length of filament for a complete unload.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
// Set to 0 for manual unloading.
#define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load.
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material.
// 0 to disable start loading and skip to fast load only
#define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 30 // (mm/s) Load filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 538 // (mm) Load length of filament, from extruder gear to nozzle.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
#endif
#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted.
#define ADVANCED_PAUSE_PURGE_FEEDRATE 2 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate.
#define ADVANCED_PAUSE_PURGE_LENGTH 2 // (mm) Length to extrude after loading.
// Set to 0 for manual extrusion.
// Filament can be extruded repeatedly from the Filament Change menu
// until extrusion is consistent, and to purge old filament.
// #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park.
#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused.

0
Marlin/Marlin.ino Executable file → Normal file
View File

4
Marlin/Version.h Executable file → Normal file
View File

@@ -28,7 +28,7 @@
/**
* Marlin release version identifier
*/
//#define SHORT_BUILD_VERSION "2.1.2"
//#define SHORT_BUILD_VERSION "2.1.2.1"
/**
* 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 "2022-08-06"
//#define STRING_DISTRIBUTION_DATE "2023-05-16"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.

0
Marlin/lib/readme.txt Executable file → Normal file
View File

View File

@@ -23,6 +23,10 @@
#include "../../inc/MarlinConfig.h"
//#define DEBUG_AVR_FAST_PWM
#define DEBUG_OUT ENABLED(DEBUG_AVR_FAST_PWM)
#include "../../core/debug_out.h"
struct Timer {
volatile uint8_t* TCCRnQ[3]; // max 3 TCCR registers per timer
volatile uint16_t* OCRnQ[3]; // max 3 OCR registers per timer
@@ -108,12 +112,15 @@ const Timer get_pwm_timer(const pin_t pin) {
}
void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
DEBUG_ECHOLNPGM("set_pwm_frequency(pin=", pin, ", freq=", f_desired, ")");
const Timer timer = get_pwm_timer(pin);
if (timer.isProtected || !timer.isPWM) return; // Don't proceed if protected timer or not recognized
const bool is_timer2 = timer.n == 2;
const uint16_t maxtop = is_timer2 ? 0xFF : 0xFFFF;
DEBUG_ECHOLNPGM("maxtop=", maxtop);
uint16_t res = 0xFF; // resolution (TOP value)
uint8_t j = CS_NONE; // prescaler index
uint8_t wgm = WGM_PWM_PC_8; // waveform generation mode
@@ -121,23 +128,29 @@ void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
// Calculating the prescaler and resolution to use to achieve closest frequency
if (f_desired != 0) {
constexpr uint16_t prescaler[] = { 1, 8, (32), 64, (128), 256, 1024 }; // (*) are Timer 2 only
uint16_t f = (F_CPU) / (2 * 1024 * maxtop) + 1; // Start with the lowest non-zero frequency achievable (1 or 31)
uint16_t f = (F_CPU) / (uint32_t(maxtop) << 11) + 1; // Start with the lowest non-zero frequency achievable (for 16MHz, 1 or 31)
DEBUG_ECHOLNPGM("f=", f);
DEBUG_ECHOLNPGM("(prescaler loop)");
LOOP_L_N(i, COUNT(prescaler)) { // Loop through all prescaler values
const uint16_t p = prescaler[i];
const uint32_t p = prescaler[i]; // Extend to 32 bits for calculations
DEBUG_ECHOLNPGM("prescaler[", i, "]=", p);
uint16_t res_fast_temp, res_pc_temp;
if (is_timer2) {
#if ENABLED(USE_OCR2A_AS_TOP) // No resolution calculation for TIMER2 unless enabled USE_OCR2A_AS_TOP
const uint16_t rft = (F_CPU) / (p * f_desired);
res_fast_temp = rft - 1;
res_pc_temp = rft / 2;
DEBUG_ECHOLNPGM("(Timer2) res_fast_temp=", res_fast_temp, " res_pc_temp=", res_pc_temp);
#else
res_fast_temp = res_pc_temp = maxtop;
DEBUG_ECHOLNPGM("(Timer2) res_fast_temp=", maxtop, " res_pc_temp=", maxtop);
#endif
}
else {
if (p == 32 || p == 128) continue; // Skip TIMER2 specific prescalers when not TIMER2
const uint16_t rft = (F_CPU) / (p * f_desired);
DEBUG_ECHOLNPGM("(Not Timer 2) F_CPU=" STRINGIFY(F_CPU), " prescaler=", p, " f_desired=", f_desired);
res_fast_temp = rft - 1;
res_pc_temp = rft / 2;
}
@@ -147,23 +160,27 @@ void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
// Calculate frequencies of test prescaler and resolution values
const uint16_t f_fast_temp = (F_CPU) / (p * (1 + res_fast_temp)),
f_pc_temp = (F_CPU) / (2 * p * res_pc_temp);
const int f_diff = _MAX(f, f_desired) - _MIN(f, f_desired),
f_pc_temp = (F_CPU) / ((p * res_pc_temp) << 1),
f_diff = _MAX(f, f_desired) - _MIN(f, f_desired),
f_fast_diff = _MAX(f_fast_temp, f_desired) - _MIN(f_fast_temp, f_desired),
f_pc_diff = _MAX(f_pc_temp, f_desired) - _MIN(f_pc_temp, f_desired);
DEBUG_ECHOLNPGM("f_fast_temp=", f_fast_temp, " f_pc_temp=", f_pc_temp, " f_diff=", f_diff, " f_fast_diff=", f_fast_diff, " f_pc_diff=", f_pc_diff);
if (f_fast_diff < f_diff && f_fast_diff <= f_pc_diff) { // FAST values are closest to desired f
// Set the Wave Generation Mode to FAST PWM
wgm = is_timer2 ? uint8_t(TERN(USE_OCR2A_AS_TOP, WGM2_FAST_PWM_OCR2A, WGM2_FAST_PWM)) : uint8_t(WGM_FAST_PWM_ICRn);
// Remember this combination
f = f_fast_temp; res = res_fast_temp; j = i + 1;
DEBUG_ECHOLNPGM("(FAST) updated f=", f);
}
else if (f_pc_diff < f_diff) { // PHASE CORRECT values are closes to desired f
// Set the Wave Generation Mode to PWM PHASE CORRECT
wgm = is_timer2 ? uint8_t(TERN(USE_OCR2A_AS_TOP, WGM2_PWM_PC_OCR2A, WGM2_PWM_PC)) : uint8_t(WGM_PWM_PC_ICRn);
f = f_pc_temp; res = res_pc_temp; j = i + 1;
DEBUG_ECHOLNPGM("(PHASE) updated f=", f);
}
}
} // prescaler loop
}
_SET_WGMnQ(timer, wgm);

View File

@@ -293,11 +293,11 @@ enum ClockSource2 : uint8_t {
#if HAS_MOTOR_CURRENT_PWM
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN || P == MOTOR_CURRENT_PWM_XY_PIN)
#elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN)
#else
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN)
#endif
#else
#define PWM_CHK_MOTOR_CURRENT(P) false

View File

@@ -27,6 +27,9 @@
* Hardware Pin : 02 03 06 07 01 05 15 16 17 18 23 24 25 26 64 63 13 12 46 45 44 43 78 77 76 75 74 73 72 71 60 59 58 57 56 55 54 53 50 70 52 51 42 41 40 39 38 37 36 35 22 21 20 19 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 | 04 08 09 10 11 14 27 28 29 30 31 32 33 34 47 48 49 61 62 65 66 67 68 69 79 80 81 98 99 100
* Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 | E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx
* Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 73 75 76 77 74 xx xx xx xx xx
*
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
#include "../fastio.h"

View File

@@ -26,6 +26,9 @@
*
* Logical Pin: 38 39 40 41 42 43 44 45 16 10 11 12 06 07 08 09 30 31 32 33 34 35 36 37 17 18 19 20 21 22 23 24 00 01 13 05 02 03 14 15 46 47 48 49 50 51 52 53 25 26 27 28 29 04
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5
*
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
#include "../fastio.h"

View File

@@ -26,6 +26,9 @@
*
* Logical Pin: 08 09 10 11 12 13 14 15 16 17 18 19 20 21 00 01 02 03 04 05 06 07
* Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
*
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
#include "../fastio.h"

View File

@@ -26,6 +26,9 @@
*
* Logical Pin: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
* Port: B0 B1 B2 B3 B4 B5 B6 B7 D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 C2 C3 C4 C5 C6 C7 A7 A6 A5 A4 A3 A2 A1 A0
*
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
/** ATMega644

View File

@@ -27,6 +27,9 @@
* Logical Pin: 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7
* The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
*
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
#include "../fastio.h"

View File

@@ -20,7 +20,3 @@
*
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/AVR."
#endif

View File

@@ -25,6 +25,10 @@
* Test AVR-specific configuration values for errors at compile-time.
*/
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/AVR."
#endif
/**
* Check for common serial pin conflicts
*/

View File

@@ -27,13 +27,14 @@
// intRes = longIn1 * longIn2 >> 24
// uses:
// A[tmp] to store 0
// B[tmp] to store bits 16-23 of the 48bit result. The top bit is used to round the two byte result.
// note that the lower two bytes and the upper byte of the 48bit result are not calculated.
// this can cause the result to be out by one as the lower bytes may cause carries into the upper ones.
// B A are bits 24-39 and are the returned value
// C B A is longIn1
// D C B A is longIn2
// r1, r0 for the result of mul.
// [tmp1] to store 0.
// [tmp2] to store bits 16-23 of the 56 bit result. The top bit of [tmp2] is used for rounding.
// Note that the lower two bytes and the upper two bytes of the 56 bit result are not calculated.
// This can cause the result to be out by one as the lower bytes may cause carries into the upper ones.
// [intRes] (A B) is bits 24-39 and is the returned value.
// [longIn1] (C B A) is a 24 bit parameter.
// [longIn2] (D C B A) is a 32 bit parameter.
//
FORCE_INLINE static uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2) {
uint8_t tmp1;
@@ -66,11 +67,9 @@ FORCE_INLINE static uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2
A("add %[tmp2], r1")
A("adc %A[intRes], %[tmp1]")
A("adc %B[intRes], %[tmp1]")
A("lsr %[tmp2]")
A("adc %A[intRes], %[tmp1]")
A("adc %B[intRes], %[tmp1]")
A("mul %D[longIn2], %A[longIn1]")
A("add %A[intRes], r0")
A("lsl %[tmp2]")
A("adc %A[intRes], r0")
A("adc %B[intRes], r1")
A("mul %D[longIn2], %B[longIn1]")
A("add %B[intRes], r0")
@@ -85,11 +84,16 @@ FORCE_INLINE static uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2
return intRes;
}
// intRes = intIn1 * intIn2 >> 16
// intRes = intIn1 * intIn2 >> 8
// uses:
// r26 to store 0
// r27 to store the byte 1 of the 24 bit result
FORCE_INLINE static uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) {
// r1, r0 for the result of mul. After the second mul, r0 holds bits 0-7 of the 24 bit result and
// the top bit of r0 is used for rounding.
// [tmp] to store 0.
// [intRes] (A B) is bits 8-15 and is the returned value.
// [charIn1] is an 8 bit parameter.
// [intIn2] (B A) is a 16 bit parameter.
//
FORCE_INLINE static uint16_t MultiU8X16toH16(uint8_t charIn1, uint16_t intIn2) {
uint8_t tmp;
uint16_t intRes;
__asm__ __volatile__ (
@@ -97,10 +101,8 @@ FORCE_INLINE static uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) {
A("mul %[charIn1], %B[intIn2]")
A("movw %A[intRes], r0")
A("mul %[charIn1], %A[intIn2]")
A("add %A[intRes], r1")
A("adc %B[intRes], %[tmp]")
A("lsr r0")
A("adc %A[intRes], %[tmp]")
A("lsl r0")
A("adc %A[intRes], r1")
A("adc %B[intRes], %[tmp]")
A("clr r1")
: [intRes] "=&r" (intRes),

View File

@@ -64,11 +64,13 @@
#define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
#if AVR_ATmega1284_FAMILY
#define DIGITAL_PIN_TO_ANALOG_PIN(P) int(analogInputToDigitalPin(0) - (P))
#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(7) && (P) <= analogInputToDigitalPin(0))
#define IS_ANALOG(P) WITHIN(P, analogInputToDigitalPin(7), analogInputToDigitalPin(0))
#define DIGITAL_PIN_TO_ANALOG_PIN(P) int(IS_ANALOG(P) ? (P) - analogInputToDigitalPin(7) : -1)
#else
#define DIGITAL_PIN_TO_ANALOG_PIN(P) int((P) - analogInputToDigitalPin(0))
#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7)))
#define _ANALOG1(P) WITHIN(P, analogInputToDigitalPin(0), analogInputToDigitalPin(7))
#define _ANALOG2(P) WITHIN(P, analogInputToDigitalPin(8), analogInputToDigitalPin(15))
#define IS_ANALOG(P) (_ANALOG1(P) || _ANALOG2(P))
#define DIGITAL_PIN_TO_ANALOG_PIN(P) int(_ANALOG1(P) ? (P) - analogInputToDigitalPin(0) : _ANALOG2(P) ? (P) - analogInputToDigitalPin(8) + 8 : -1)
#endif
#define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
#define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin

View File

@@ -44,14 +44,14 @@ typedef uint16_t hal_timer_t;
#define MF_TIMER_TEMP 0
#endif
#define TEMP_TIMER_FREQUENCY ((F_CPU) / 64.0 / 256.0)
#define TEMP_TIMER_FREQUENCY (((F_CPU) + 0x2000) / 0x4000)
#define STEPPER_TIMER_RATE HAL_TIMER_RATE
#define STEPPER_TIMER_PRESCALE 8
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000)
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A)

View File

@@ -20,7 +20,3 @@
*
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/DUE."
#endif

View File

@@ -25,6 +25,10 @@
* Test Arduino Due specific configuration values for errors at compile-time.
*/
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/DUE."
#endif
/**
* Check for common serial pin conflicts
*/
@@ -77,7 +81,7 @@
#endif
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on DUE."
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported for HAL/DUE."
#endif
#if HAS_TMC_SW_SERIAL

View File

@@ -342,16 +342,16 @@ void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v
}
else
pindata.pwm_duty_ticks = duty; // PWM duty count = # of 4µs ticks per full PWM cycle
return;
}
else
#endif
{
const int8_t cid = get_pwm_channel(pin, PWM_FREQUENCY, PWM_RESOLUTION);
if (cid >= 0) {
const uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, _BV(PWM_RESOLUTION)-1);
ledcWrite(cid, duty);
}
}
const int8_t cid = get_pwm_channel(pin, PWM_FREQUENCY, PWM_RESOLUTION);
if (cid >= 0) {
const uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, _BV(PWM_RESOLUTION)-1);
ledcWrite(cid, duty);
}
}
int8_t MarlinHAL::set_pwm_frequency(const pin_t pin, const uint32_t f_desired) {
@@ -360,17 +360,15 @@ int8_t MarlinHAL::set_pwm_frequency(const pin_t pin, const uint32_t f_desired) {
pwm_pin_data[pin & 0x7F].pwm_cycle_ticks = 1000000UL / f_desired / 4; // # of 4µs ticks per full PWM cycle
return 0;
}
else
#endif
{
const int8_t cid = channel_for_pin(pin);
if (cid >= 0) {
if (f_desired == ledcReadFreq(cid)) return cid; // no freq change
ledcDetachPin(chan_pin[cid]);
chan_pin[cid] = 0; // remove old freq channel
}
return get_pwm_channel(pin, f_desired, PWM_RESOLUTION); // try for new one
}
const int8_t cid = channel_for_pin(pin);
if (cid >= 0) {
if (f_desired == ledcReadFreq(cid)) return cid; // no freq change
ledcDetachPin(chan_pin[cid]);
chan_pin[cid] = 0; // remove old freq channel
}
return get_pwm_channel(pin, f_desired, PWM_RESOLUTION); // try for new one
}
// use hardware PWM if avail, if not then ISR

View File

@@ -50,14 +50,12 @@
#define MYSERIAL1 flushableSerial
#if EITHER(WIFISUPPORT, ESP3D_WIFISUPPORT)
#if ENABLED(ESP3D_WIFISUPPORT)
typedef ForwardSerial1Class< decltype(Serial2Socket) > DefaultSerial1;
extern DefaultSerial1 MSerial0;
#define MYSERIAL2 MSerial0
#else
#define MYSERIAL2 webSocketSerial
#endif
#if ENABLED(ESP3D_WIFISUPPORT)
typedef ForwardSerial1Class< decltype(Serial2Socket) > DefaultSerial1;
extern DefaultSerial1 MSerial0;
#define MYSERIAL2 MSerial0
#elif ENABLED(WIFISUPPORT)
#define MYSERIAL2 webSocketSerial
#endif
#define CRITICAL_SECTION_START() portENTER_CRITICAL(&hal.spinlock)

View File

@@ -149,30 +149,28 @@ void stepperTask(void *parameter) {
dma.rw_pos = 0;
while (dma.rw_pos < DMA_SAMPLE_COUNT) {
// Fill with the port data post pulse_phase until the next step
if (nextMainISR && TERN1(LIN_ADVANCE, nextAdvanceISR))
i2s_push_sample();
// i2s_push_sample() is also called from Stepper::pulse_phase_isr() and Stepper::advance_isr()
// in a rare case where both are called, we need to double decrement the counters
const uint8_t push_count = 1 + (!nextMainISR && TERN0(LIN_ADVANCE, !nextAdvanceISR));
#if ENABLED(LIN_ADVANCE)
if (!nextAdvanceISR) {
Stepper::advance_isr();
nextAdvanceISR = Stepper::la_interval;
}
else if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;
#endif
if (!nextMainISR) {
Stepper::pulse_phase_isr();
nextMainISR = Stepper::block_phase_isr();
}
#if ENABLED(LIN_ADVANCE)
else if (!nextAdvanceISR) {
Stepper::advance_isr();
nextAdvanceISR = Stepper::la_interval;
}
#endif
else
i2s_push_sample();
nextMainISR -= push_count;
TERN_(LIN_ADVANCE, nextAdvanceISR -= push_count);
nextMainISR--;
#if ENABLED(LIN_ADVANCE)
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;
if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
nextAdvanceISR--;
#endif
}
}
}

View File

@@ -20,7 +20,3 @@
*
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/ESP32."
#endif

View File

@@ -21,12 +21,19 @@
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/ESP32."
#endif
#if ENABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is not yet implemented for ESP32. Disable EMERGENCY_PARSER to continue."
#endif
#if (ENABLED(SPINDLE_LASER_USE_PWM) && SPINDLE_LASER_FREQUENCY > 78125) || (ENABLED(FAST_PWM_FAN_FREQUENCY) && FAST_PWM_FAN_FREQUENCY > 78125)
#error "SPINDLE_LASER_FREQUENCY and FAST_PWM_FREQUENCY maximum value is 78125Hz for ESP32."
#if ENABLED(SPINDLE_LASER_USE_PWM) && SPINDLE_LASER_FREQUENCY > 78125
#error "SPINDLE_LASER_FREQUENCY maximum value is 78125Hz for ESP32."
#endif
#if ENABLED(FAST_PWM_FAN) && FAST_PWM_FAN_FREQUENCY > 78125
#error "FAST_PWM_FREQUENCY maximum value is 78125Hz for ESP32."
#endif
#if HAS_TMC_SW_SERIAL
@@ -56,3 +63,7 @@
#if BOTH(I2S_STEPPER_STREAM, LIN_ADVANCE) && DISABLED(EXPERIMENTAL_I2S_LA)
#error "I2S stream is currently incompatible with LIN_ADVANCE."
#endif
#if BOTH(I2S_STEPPER_STREAM, PRINTCOUNTER) && PRINTCOUNTER_SAVE_INTERVAL > 0 && DISABLED(PRINTCOUNTER_SYNC)
#error "PRINTCOUNTER_SAVE_INTERVAL may cause issues on ESP32 with an I2S expander. Define PRINTCOUNTER_SYNC in Configuration.h for an imperfect solution."
#endif

View File

@@ -111,12 +111,12 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
/**
* Set the upper value of the timer, when the timer reaches this upper value the
* interrupt should be triggered and the counter reset
* @param timer_num timer number to set the count to
* @param count threshold at which the interrupt is triggered
* @param timer_num timer number to set the compare value to
* @param compare threshold at which the interrupt is triggered
*/
void HAL_timer_set_compare(const uint8_t timer_num, hal_timer_t count) {
void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
const tTimerConfig timer = timer_config[timer_num];
timer_set_alarm_value(timer.group, timer.idx, count);
timer_set_alarm_value(timer.group, timer.idx, compare);
}
/**

View File

@@ -27,7 +27,7 @@
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#endif
#include HAL_PATH(.,HAL.h)
#include HAL_PATH(..,HAL.h)
extern MarlinHAL hal;
#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)

View File

@@ -20,7 +20,3 @@
*
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/LINUX."
#endif

View File

@@ -31,13 +31,17 @@
#endif
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on LINUX."
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported for HAL/LINUX."
#endif
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/LINUX."
#endif
#if HAS_TMC_SW_SERIAL
#error "TMC220x Software Serial is not supported on LINUX."
#error "TMC220x Software Serial is not supported for HAL/LINUX."
#endif
#if ENABLED(POSTMORTEM_DEBUGGING)
#error "POSTMORTEM_DEBUGGING is not yet supported on LINUX."
#error "POSTMORTEM_DEBUGGING is not yet supported for HAL/LINUX."
#endif

View File

@@ -25,10 +25,10 @@
#include "../../inc/MarlinConfigPre.h"
#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
// spiBeginTransaction.
#define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
// spiBeginTransaction.
#endif
// Onboard SD

View File

@@ -60,7 +60,7 @@
// ------------------------
// Public functions
// ------------------------
#if ENABLED(LPC_SOFTWARE_SPI)
#if ENABLED(SOFTWARE_SPI)
// Software SPI
@@ -161,7 +161,7 @@
// TODO: Implement this method
}
#endif // LPC_SOFTWARE_SPI
#endif // SOFTWARE_SPI
/**
* @brief Wait until TXE (tx empty) flag is set and BSY (busy) flag unset.

View File

@@ -20,7 +20,3 @@
*
*/
#pragma once
#if HAS_FSMC_TFT
#error "Sorry! FSMC TFT displays are not current available for HAL/LPC1768."
#endif

View File

@@ -30,5 +30,5 @@
// LPC1768 boards seem to lose steps when saving to EEPROM during print (issue #20785)
// TODO: Which other boards are incompatible?
#if defined(MCU_LPC1768) && ENABLED(FLASH_EEPROM_EMULATION) && PRINTCOUNTER_SAVE_INTERVAL > 0
#define PRINTCOUNTER_SYNC 1
#define PRINTCOUNTER_SYNC
#endif

View File

@@ -77,6 +77,10 @@ static_assert(!(NUM_SERVOS && ENABLED(FAST_PWM_FAN)), "BLTOUCH and Servos are in
#endif
#endif
#if HAS_FSMC_TFT
#error "Sorry! FSMC TFT displays are not current available for HAL/LPC1768."
#endif
static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported on LPC176x.");
/**

View File

@@ -29,8 +29,8 @@
*/
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
#define pwm_details(pin) pin = pin // do nothing // print PWM details
#define pwm_status(pin) false //Print a pin's PWM status. Return true if it's currently a PWM pin.
#define pwm_details(pin) NOOP // do nothing
#define pwm_status(pin) false // Print a pin's PWM status. Return true if it's currently a PWM pin.
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
#define digitalRead_mod(p) extDigitalRead(p)
#define PRINT_PORT(p)

View File

@@ -24,10 +24,10 @@
#include "../../core/macros.h"
#if BOTH(SDSUPPORT, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
// spiBeginTransaction.
#define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
// spiBeginTransaction.
#endif
/** onboard SD card */

View File

@@ -208,8 +208,8 @@ public:
MarlinHAL() {}
// Watchdog
static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});
static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {});
static void watchdog_init();
static void watchdog_refresh();
static void init() {} // Called early in setup()
static void init_board() {} // Called less early in setup()

View File

@@ -31,7 +31,7 @@
#endif
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on LINUX."
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported for HAL/LINUX."
#endif
#if HAS_TMC_SW_SERIAL

View File

@@ -27,8 +27,8 @@
*/
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
#define pwm_details(pin) pin = pin // do nothing // print PWM details
#define pwm_status(pin) false //Print a pin's PWM status. Return true if it's currently a PWM pin.
#define pwm_details(pin) NOOP // do nothing
#define pwm_status(pin) false // Print a pin's PWM status. Return true if it's currently a PWM pin.
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
#define digitalRead_mod(p) digitalRead(p)
#define PRINT_PORT(p)

View File

@@ -25,7 +25,7 @@
#include "../../inc/MarlinConfigPre.h"
#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
#define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
// spiBeginTransaction.

View File

@@ -34,4 +34,3 @@ void u8g_i2c_stop();
#ifdef __cplusplus
}
#endif

View File

@@ -40,5 +40,3 @@ uint8_t u8g_com_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
#define U8G_COM_T6963 u8g_com_null_fn
#define U8G_COM_FAST_PARALLEL u8g_com_null_fn
#define U8G_COM_UC_I2C u8g_com_null_fn

View File

@@ -64,7 +64,7 @@
}
void spiInit(uint8_t spiRate) {
// Use datarates Marlin uses
// Use Marlin datarates
uint32_t clock;
switch (spiRate) {
case SPI_FULL_SPEED: clock = 8000000; break;

View File

@@ -213,4 +213,3 @@
#define DIO53_PIN PIN_PA21
#define DIO54_PIN PIN_PA06
#define DIO55_PIN PIN_PA07

View File

@@ -20,12 +20,4 @@
*
*/
/**
* SAMD21 HAL developed by Bart Meijer (brupje)
* Based on SAMD51 HAL by Giuliano Zaro (AKA GMagician)
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/SAMD21."
#endif

View File

@@ -29,6 +29,10 @@
* Test SAMD21 specific configuration values for errors at compile-time.
*/
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/SAMD21."
#endif
#if SERVO_TC == MF_TIMER_RTC
#error "Servos can't use RTC timer"
#endif
@@ -42,7 +46,7 @@
#endif
#if ENABLED(FAST_PWM_FAN)
#error "Features requiring Hardware PWM (FAST_PWM_FAN) are not yet supported on SAMD21."
#error "Features requiring Hardware PWM (FAST_PWM_FAN) are not yet supported for HAL/SAMD21."
#endif
#if ENABLED(POSTMORTEM_DEBUGGING)

View File

@@ -47,11 +47,11 @@ const tTimerConfig timer_config[NUM_HARDWARE_TIMERS] = {
{ {.pTcc=TCC0}, TimerType::tcc, TCC0_IRQn, TC_PRIORITY(0) }, // 0 - stepper (assigned priority 2)
{ {.pTcc=TCC1}, TimerType::tcc, TCC1_IRQn, TC_PRIORITY(1) }, // 1 - stepper (needed by 32 bit timers)
{ {.pTcc=TCC2}, TimerType::tcc, TCC2_IRQn, 5 }, // 2 - tone (reserved by framework and fixed assigned priority 5)
{ {.pTc=TC3}, TimerType::tc, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1)
{ {.pTc=TC4}, TimerType::tc, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used)
{ {.pTc=TC5}, TimerType::tc, TC5_IRQn, TC_PRIORITY(5) },
{ {.pTc=TC6}, TimerType::tc, TC6_IRQn, TC_PRIORITY(6) },
{ {.pTc=TC7}, TimerType::tc, TC7_IRQn, TC_PRIORITY(7) },
{ {.pTc=TC3}, TimerType::tc, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1)
{ {.pTc=TC4}, TimerType::tc, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used)
{ {.pTc=TC5}, TimerType::tc, TC5_IRQn, TC_PRIORITY(5) },
{ {.pTc=TC6}, TimerType::tc, TC6_IRQn, TC_PRIORITY(6) },
{ {.pTc=TC7}, TimerType::tc, TC7_IRQn, TC_PRIORITY(7) },
{ {.pRtc=RTC}, TimerType::rtc, RTC_IRQn, TC_PRIORITY(8) } // 8 - temperature (assigned priority 6)
};

View File

@@ -20,7 +20,3 @@
*
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/SAMD51."
#endif

View File

@@ -29,6 +29,10 @@
* Test SAMD51 specific configuration values for errors at compile-time.
*/
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/SAMD51."
#endif
#if ENABLED(FLASH_EEPROM_EMULATION)
#warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Manager/releases"
#endif
@@ -55,7 +59,7 @@
#endif
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on SAMD51."
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported for HAL/SAMD51."
#endif
#if ENABLED(POSTMORTEM_DEBUGGING)

View File

@@ -138,7 +138,7 @@
typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs.
#ifdef STM32G0B1xx
#if defined(STM32G0B1xx) || defined(STM32H7xx)
typedef int32_t pin_t;
#else
typedef int16_t pin_t;

View File

@@ -78,7 +78,6 @@ static SPISettings spiConfig;
case SPI_SPEED_6: delaySPIFunc = &delaySPI_2000; break; // desired: 250,000 actual: ~210K
default: delaySPIFunc = &delaySPI_4000; break; // desired: 125,000 actual: ~123K
}
SPI.begin();
}
// Begin SPI transaction, set clock, bit order, data mode

View File

@@ -48,7 +48,7 @@ static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE];
bool PersistentStore::access_start() {
if (!card.isMounted()) return false;
SdFile file, root = card.getroot();
MediaFile file, root = card.getroot();
if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
return true;
@@ -63,7 +63,7 @@ bool PersistentStore::access_start() {
bool PersistentStore::access_finish() {
if (!card.isMounted()) return false;
SdFile file, root = card.getroot();
MediaFile file, root = card.getroot();
int bytes_written = 0;
if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE);

View File

@@ -30,5 +30,5 @@
// Some STM32F4 boards may lose steps when saving to EEPROM during print (PR #17946)
#if defined(STM32F4xx) && ENABLED(FLASH_EEPROM_EMULATION) && PRINTCOUNTER_SAVE_INTERVAL > 0
#define PRINTCOUNTER_SYNC 1
#define PRINTCOUNTER_SYNC
#endif

View File

@@ -286,6 +286,9 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) {
go_to_transfer_speed();
hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_ENABLE;
hsd.Init.ClockDiv = 8;
#if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined
retry_Cnt = retryCnt;
for (;;) {
@@ -433,7 +436,10 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
#else
uint8_t retries = SDIO_READ_RETRIES;
while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true;
while (retries--) {
if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true;
delay(10);
}
return false;
#endif

View File

@@ -44,7 +44,7 @@ static void USBH_UserProcess(USBH_HandleTypeDef *phost, uint8_t id) {
break;
case HOST_USER_DISCONNECTION:
//SERIAL_ECHOLNPGM("APPLICATION_DISCONNECT");
//usb.setUsbTaskState(USB_STATE_RUNNING);
usb.setUsbTaskState(USB_STATE_INIT);
break;
case HOST_USER_CLASS_ACTIVE:
//SERIAL_ECHOLNPGM("APPLICATION_READY");

View File

@@ -47,7 +47,7 @@ static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE];
bool PersistentStore::access_start() {
if (!card.isMounted()) return false;
SdFile file, root = card.getroot();
MediaFile file, root = card.getroot();
if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
return true; // false aborts the save
@@ -62,7 +62,7 @@ bool PersistentStore::access_start() {
bool PersistentStore::access_finish() {
if (!card.isMounted()) return false;
SdFile file, root = card.getroot();
MediaFile file, root = card.getroot();
int bytes_written = 0;
if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE);

View File

@@ -39,7 +39,7 @@ inline uint8_t timer_and_index_for_pin(const pin_t pin, timer_dev **timer_ptr) {
void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
const uint16_t duty = invert ? v_size - v : v;
if (PWM_PIN(pin)) {
timer_dev *timer; UNUSED(timer);
timer_dev *timer;
if (timer_freq[timer_and_index_for_pin(pin, &timer)] == 0)
set_pwm_frequency(pin, PWM_FREQUENCY);
const uint8_t channel = PIN_MAP[pin].timer_channel;
@@ -55,7 +55,7 @@ void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v
void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer
timer_dev *timer; UNUSED(timer);
timer_dev *timer;
timer_freq[timer_and_index_for_pin(pin, &timer)] = f_desired;
// Protect used timers

View File

@@ -1,11 +1,31 @@
/*-----------------------------------------------------------------------
/ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
/ * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
/ * Low level disk interface module include file (C)ChaN, 2015
/-----------------------------------------------------------------------*/
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
/*-----------------------------------------------------------------------
/ * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
/ * Low level disk interface module include file (c) ChaN, 2015
/-----------------------------------------------------------------------*/
#define _DISKIO_WRITE 1 /* 1: Enable disk_write function */
#define _DISKIO_IOCTL 1 /* 1: Enable disk_ioctl function */
#define _DISKIO_ISDIO 0 /* 1: Enable iSDIO control function */

View File

@@ -20,7 +20,3 @@
*
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/TEENSY31_32."
#endif

View File

@@ -25,22 +25,26 @@
* Test TEENSY35_36 specific configuration values for errors at compile-time.
*/
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for Teensy 3.1/3.2."
#endif
#if ENABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is not yet implemented for Teensy 3.1/3.2. Disable EMERGENCY_PARSER to continue."
#endif
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on Teensy 3.1/3.2."
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported for Teensy 3.1/3.2."
#endif
#if HAS_TMC_SW_SERIAL
#error "TMC220x Software Serial is not supported on Teensy 3.1/3.2."
#error "TMC220x Software Serial is not supported for Teensy 3.1/3.2."
#endif
#if ENABLED(POSTMORTEM_DEBUGGING)
#error "POSTMORTEM_DEBUGGING is not yet supported on Teensy 3.1/3.2."
#error "POSTMORTEM_DEBUGGING is not yet supported for Teensy 3.1/3.2."
#endif
#if USING_PULLDOWNS
#error "PULLDOWN pin mode is not available on Teensy 3.1/3.2 boards."
#error "PULLDOWN pin mode is not available for Teensy 3.1/3.2."
#endif

View File

@@ -20,7 +20,3 @@
*
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/TEENSY35_36."
#endif

View File

@@ -25,22 +25,26 @@
* Test TEENSY35_36 specific configuration values for errors at compile-time.
*/
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for Teensy 3.5/3.6."
#endif
#if ENABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is not yet implemented for Teensy 3.5/3.6. Disable EMERGENCY_PARSER to continue."
#endif
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on Teensy 3.5/3.6."
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported for Teensy 3.5/3.6."
#endif
#if HAS_TMC_SW_SERIAL
#error "TMC220x Software Serial is not supported on Teensy 3.5/3.6."
#error "TMC220x Software Serial is not supported for Teensy 3.5/3.6."
#endif
#if ENABLED(POSTMORTEM_DEBUGGING)
#error "POSTMORTEM_DEBUGGING is not yet supported on Teensy 3.5/3.6."
#error "POSTMORTEM_DEBUGGING is not yet supported for Teensy 3.5/3.6."
#endif
#if USING_PULLDOWNS
#error "PULLDOWN pin mode is not available on Teensy 3.5/3.6 boards."
#error "PULLDOWN pin mode is not available for Teensy 3.5/3.6."
#endif

View File

@@ -20,7 +20,3 @@
*
*/
#pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/TEENSY40_41."
#endif

View File

@@ -25,18 +25,22 @@
* Test TEENSY41 specific configuration values for errors at compile-time.
*/
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for Teensy 4.0/4.1."
#endif
#if ENABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is not yet implemented for Teensy 4.0/4.1. Disable EMERGENCY_PARSER to continue."
#endif
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on Teensy 4.0/4.1."
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported for Teensy 4.0/4.1."
#endif
#if HAS_TMC_SW_SERIAL
#error "TMC220x Software Serial is not supported on Teensy 4.0/4.1."
#error "TMC220x Software Serial is not supported for Teensy 4.0/4.1."
#endif
#if ENABLED(POSTMORTEM_DEBUGGING)
#error "POSTMORTEM_DEBUGGING is not yet supported on Teensy 4.0/4.1."
#error "POSTMORTEM_DEBUGGING is not yet supported for Teensy 4.0/4.1."
#endif

View File

@@ -24,34 +24,34 @@
#define XSTR(V...) #V
#ifdef __AVR__
#define HAL_PATH(PATH, NAME) XSTR(PATH/AVR/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/AVR/NAME)
#elif defined(ARDUINO_ARCH_SAM)
#define HAL_PATH(PATH, NAME) XSTR(PATH/DUE/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/DUE/NAME)
#elif defined(__MK20DX256__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/TEENSY31_32/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/TEENSY31_32/NAME)
#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/TEENSY35_36/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/TEENSY35_36/NAME)
#elif defined(__IMXRT1062__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/TEENSY40_41/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/TEENSY40_41/NAME)
#elif defined(TARGET_LPC1768)
#define HAL_PATH(PATH, NAME) XSTR(PATH/LPC1768/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/LPC1768/NAME)
#elif defined(__STM32F1__) || defined(TARGET_STM32F1)
#define HAL_PATH(PATH, NAME) XSTR(PATH/STM32F1/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/STM32F1/NAME)
#elif defined(ARDUINO_ARCH_STM32)
#ifndef HAL_STM32
#define HAL_STM32
#endif
#define HAL_PATH(PATH, NAME) XSTR(PATH/STM32/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/STM32/NAME)
#elif defined(ARDUINO_ARCH_ESP32)
#define HAL_PATH(PATH, NAME) XSTR(PATH/ESP32/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/ESP32/NAME)
#elif defined(__PLAT_LINUX__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/LINUX/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/LINUX/NAME)
#elif defined(__PLAT_NATIVE_SIM__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/NATIVE_SIM/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/NATIVE_SIM/NAME)
#elif defined(__SAMD51__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/SAMD51/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/SAMD51/NAME)
#elif defined(__SAMD21__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/SAMD21/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/SAMD21/NAME)
#else
#error "Unsupported Platform!"
#endif

View File

@@ -33,13 +33,14 @@
#if ENABLED(SOFT_I2C_EEPROM)
#include <SlowSoftWire.h>
SlowSoftWire Wire = SlowSoftWire(I2C_SDA_PIN, I2C_SCL_PIN, true);
SlowSoftWire eWire = SlowSoftWire(I2C_SDA_PIN, I2C_SCL_PIN, true);
#else
#include <Wire.h>
#define eWire Wire
#endif
void eeprom_init() {
Wire.begin(
eWire.begin(
#if PINS_EXIST(I2C_SCL, I2C_SDA) && DISABLED(SOFT_I2C_EEPROM)
uint8_t(I2C_SDA_PIN), uint8_t(I2C_SCL_PIN)
#endif
@@ -75,16 +76,16 @@ static uint8_t _eeprom_calc_device_address(uint8_t * const pos) {
static void _eeprom_begin(uint8_t * const pos) {
const unsigned eeprom_address = (unsigned)pos;
Wire.beginTransmission(_eeprom_calc_device_address(pos));
eWire.beginTransmission(_eeprom_calc_device_address(pos));
if (!SMALL_EEPROM)
Wire.write(uint8_t((eeprom_address >> 8) & 0xFF)); // Address High, if needed
Wire.write(uint8_t(eeprom_address & 0xFF)); // Address Low
eWire.write(uint8_t((eeprom_address >> 8) & 0xFF)); // Address High, if needed
eWire.write(uint8_t(eeprom_address & 0xFF)); // Address Low
}
void eeprom_write_byte(uint8_t *pos, uint8_t value) {
_eeprom_begin(pos);
Wire.write(value);
Wire.endTransmission();
eWire.write(value);
eWire.endTransmission();
// wait for write cycle to complete
// this could be done more efficiently with "acknowledge polling"
@@ -93,9 +94,9 @@ void eeprom_write_byte(uint8_t *pos, uint8_t value) {
uint8_t eeprom_read_byte(uint8_t *pos) {
_eeprom_begin(pos);
Wire.endTransmission();
Wire.requestFrom(_eeprom_calc_device_address(pos), (byte)1);
return Wire.available() ? Wire.read() : 0xFF;
eWire.endTransmission();
eWire.requestFrom(_eeprom_calc_device_address(pos), (byte)1);
return eWire.available() ? eWire.read() : 0xFF;
}
#endif // USE_SHARED_EEPROM

View File

@@ -21,6 +21,9 @@
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(WIFISUPPORT)
#include "Delay.h"
void esp_wifi_init(void) { // init ESP01 WIFI module pins
@@ -41,3 +44,5 @@ void esp_wifi_init(void) { // init ESP01 WIFI module pi
OUT_WRITE(ESP_WIFI_MODULE_ENABLE_PIN, HIGH);
#endif
}
#endif // WIFISUPPORT

14
Marlin/src/MarlinCore.cpp Executable file → Normal file
View File

@@ -34,6 +34,10 @@
#include "HAL/shared/esp_wifi.h"
#include "HAL/shared/cpu_exception/exception_hook.h"
#if ENABLED(WIFISUPPORT)
#include "HAL/shared/esp_wifi.h"
#endif
#ifdef ARDUINO
#include <pins_arduino.h>
#endif
@@ -518,8 +522,8 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
if (ELAPSED(ms, next_cub_ms_##N)) { \
next_cub_ms_##N = ms + CUB_DEBOUNCE_DELAY_##N; \
CODE; \
queue.inject(F(BUTTON##N##_GCODE)); \
TERN_(HAS_MARLINUI_MENU, ui.quick_feedback()); \
queue.inject(F(BUTTON##N##_GCODE)); \
TERN_(HAS_MARLINUI_MENU, ui.quick_feedback()); \
} \
} \
}while(0)
@@ -773,7 +777,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
* - Update the Průša MMU2
* - Handle Joystick jogging
*/
void idle(bool no_stepper_sleep/*=false*/) {
void idle(const bool no_stepper_sleep/*=false*/) {
#ifdef MAX7219_DEBUG_PROFILE
CodeProfiler idle_profiler;
#endif
@@ -1268,7 +1272,9 @@ void setup() {
SETUP_RUN(hal.init_board());
SETUP_RUN(esp_wifi_init());
#if ENABLED(WIFISUPPORT)
SETUP_RUN(esp_wifi_init());
#endif
// Report Reset Reason
if (mcu & RST_POWER_ON) SERIAL_ECHOLNPGM(STR_POWERUP);

View File

@@ -30,7 +30,7 @@
void stop();
// Pass true to keep steppers from timing out
void idle(bool no_stepper_sleep=false);
void idle(const bool no_stepper_sleep=false);
inline void idle_no_sleep() { idle(true); }
#if ENABLED(G38_PROBE_TARGET)

311
Marlin/src/core/boards.h Executable file → Normal file
View File

@@ -21,6 +21,11 @@
*/
#pragma once
/**
* Whenever changes are made to this file, please update Marlin/Makefile
* and _data/boards.yml in the MarlinDocumentation repo.
*/
#include "macros.h"
#define BOARD_UNKNOWN -1
@@ -224,7 +229,7 @@
#define BOARD_5DPRINT 1707 // 5DPrint D8 Driver Board
//
// LPC1768 ARM Cortex M3
// LPC1768 ARM Cortex-M3
//
#define BOARD_RAMPS_14_RE_ARM_EFB 2000 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend, Fan, Bed)
@@ -245,7 +250,7 @@
#define BOARD_EMOTRONIC 2015 // eMotion-Tech eMotronic
//
// LPC1769 ARM Cortex M3
// LPC1769 ARM Cortex-M3
//
#define BOARD_MKS_SGEN 2500 // MKS-SGen
@@ -262,7 +267,7 @@
#define BOARD_FLY_CDY 2511 // FLYmaker FLY CDY
//
// SAM3X8E ARM Cortex M3
// SAM3X8E ARM Cortex-M3
//
#define BOARD_DUE3DOM 3000 // DUE3DOM for Arduino DUE
@@ -295,185 +300,197 @@
#define BOARD_KRATOS32 3027 // K.3D Kratos32 (Arduino Due Shield)
//
// SAM3X8C ARM Cortex M3
// SAM3X8C ARM Cortex-M3
//
#define BOARD_PRINTRBOARD_G2 3100 // Printrboard G2
#define BOARD_ADSK 3101 // Arduino DUE Shield Kit (ADSK)
//
// STM32 ARM Cortex-M0+
//
#define BOARD_BTT_EBB42_V1_1 4000 // BigTreeTech EBB42 V1.1 (STM32G0B1CB)
#define BOARD_BTT_SKR_MINI_E3_V3_0 4001 // BigTreeTech SKR Mini E3 V3.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_E3_EZ_V1_0 4002 // BigTreeTech Manta E3 EZ V1.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_M4P_V1_0 4003 // BigTreeTech Manta M4P V1.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_M5P_V1_0 4004 // BigTreeTech Manta M5P V1.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_M8P_V1_0 4005 // BigTreeTech Manta M8P V1.0 (STM32G0B1VE)
#define BOARD_BTT_MANTA_M8P_V1_1 4006 // BigTreeTech Manta M8P V1.1 (STM32G0B1VE)
//
// STM32 ARM Cortex-M3
//
#define BOARD_MALYAN_M200_V2 4000 // STM32F070CB controller
#define BOARD_MALYAN_M300 4001 // STM32F070-based delta
#define BOARD_STM32F103RE 4002 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_MALYAN_M200 4003 // STM32C8 Libmaple-based STM32F1 controller
#define BOARD_STM3R_MINI 4004 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_GTM32_PRO_VB 4005 // STM32F103VE controller
#define BOARD_GTM32_MINI 4006 // STM32F103VE controller
#define BOARD_GTM32_MINI_A30 4007 // STM32F103VE controller
#define BOARD_GTM32_REV_B 4008 // STM32F103VE controller
#define BOARD_MORPHEUS 4009 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller
#define BOARD_CHITU3D 4010 // Chitu3D (STM32F103RE)
#define BOARD_MKS_ROBIN 4011 // MKS Robin (STM32F103ZE)
#define BOARD_MKS_ROBIN_MINI 4012 // MKS Robin Mini (STM32F103VE)
#define BOARD_MKS_ROBIN_NANO 4013 // MKS Robin Nano (STM32F103VE)
#define BOARD_MKS_ROBIN_NANO_V2 4014 // MKS Robin Nano V2 (STM32F103VE)
#define BOARD_MKS_ROBIN_LITE 4015 // MKS Robin Lite/Lite2 (STM32F103RC)
#define BOARD_MKS_ROBIN_LITE3 4016 // MKS Robin Lite3 (STM32F103RC)
#define BOARD_MKS_ROBIN_PRO 4017 // MKS Robin Pro (STM32F103ZE)
#define BOARD_MKS_ROBIN_E3 4018 // MKS Robin E3 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3_V1_1 4019 // MKS Robin E3 V1.1 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3D 4020 // MKS Robin E3D (STM32F103RC)
#define BOARD_MKS_ROBIN_E3D_V1_1 4021 // MKS Robin E3D V1.1 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3P 4022 // MKS Robin E3p (STM32F103VE)
#define BOARD_BTT_EBB42_V1_1 4023 // BigTreeTech EBB42 V1.1 (STM32G0B1CB)
#define BOARD_BTT_SKR_MINI_V1_1 4024 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_0 4025 // BigTreeTech SKR Mini E3 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_2 4026 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V2_0 4027 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_MINI_E3_V3_0 4028 // BigTreeTech SKR Mini E3 V3.0 (STM32G0B1RE)
#define BOARD_BTT_SKR_MINI_E3_V3_0_1 4029 // BigTreeTech SKR Mini E3 V3.0.1 (STM32F401RC)
#define BOARD_BTT_SKR_MINI_MZ_V1_0 4030 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC)
#define BOARD_BTT_SKR_E3_DIP 4031 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_CR6 4032 // BigTreeTech SKR CR6 v1.0 (STM32F103RE)
#define BOARD_JGAURORA_A5S_A1 4033 // JGAurora A5S A1 (STM32F103ZE)
#define BOARD_FYSETC_AIO_II 4034 // FYSETC AIO_II (STM32F103RC)
#define BOARD_FYSETC_CHEETAH 4035 // FYSETC Cheetah (STM32F103RC)
#define BOARD_FYSETC_CHEETAH_V12 4036 // FYSETC Cheetah V1.2 (STM32F103RC)
#define BOARD_LONGER3D_LK 4037 // Longer3D LK1/2 - Alfawise U20/U20+/U30 (STM32F103VE)
#define BOARD_CCROBOT_MEEB_3DP 4038 // ccrobot-online.com MEEB_3DP (STM32F103RC)
#define BOARD_CHITU3D_V5 4039 // Chitu3D TronXY X5SA V5 Board (STM32F103ZE)
#define BOARD_CHITU3D_V6 4040 // Chitu3D TronXY X5SA V6 Board (STM32F103ZE)
#define BOARD_CHITU3D_V9 4041 // Chitu3D TronXY X5SA V9 Board (STM32F103ZE)
#define BOARD_CREALITY_V4 4042 // Creality v4.x (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V422 4043 // Creality v4.2.2 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V423 4044 // Creality v4.2.3 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V425 4045 // Creality v4.2.5 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V427 4046 // Creality v4.2.7 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V4210 4047 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30
#define BOARD_CREALITY_V431 4048 // Creality v4.3.1 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_A 4049 // Creality v4.3.1a (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_B 4050 // Creality v4.3.1b (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_C 4051 // Creality v4.3.1c (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_D 4052 // Creality v4.3.1d (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V452 4053 // Creality v4.5.2 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V453 4054 // Creality v4.5.3 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V521 4055 // Creality v5.2.1 (STM32F103VE) as found in the SV04
#define BOARD_CREALITY_V24S1 4056 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7
#define BOARD_CREALITY_V24S1_301 4057 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1
#define BOARD_CREALITY_V25S1 4058 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro
#define BOARD_TRIGORILLA_PRO 4059 // Trigorilla Pro (STM32F103ZE)
#define BOARD_FLY_MINI 4060 // FLYmaker FLY MINI (STM32F103RC)
#define BOARD_FLSUN_HISPEED 4061 // FLSUN HiSpeedV1 (STM32F103VE)
#define BOARD_BEAST 4062 // STM32F103RE Libmaple-based controller
#define BOARD_MINGDA_MPX_ARM_MINI 4063 // STM32F103ZE Mingda MD-16
#define BOARD_GTM32_PRO_VD 4064 // STM32F103VE controller
#define BOARD_ZONESTAR_ZM3E2 4065 // Zonestar ZM3E2 (STM32F103RC)
#define BOARD_ZONESTAR_ZM3E4 4066 // Zonestar ZM3E4 V1 (STM32F103VC)
#define BOARD_ZONESTAR_ZM3E4V2 4067 // Zonestar ZM3E4 V2 (STM32F103VC)
#define BOARD_ERYONE_ERY32_MINI 4068 // Eryone Ery32 mini (STM32F103VE)
#define BOARD_PANDA_PI_V29 4069 // Panda Pi V2.9 - Standalone (STM32F103RC)
#define BOARD_MALYAN_M200_V2 5000 // STM32F070CB controller
#define BOARD_MALYAN_M300 5001 // STM32F070-based delta
#define BOARD_STM32F103RE 5002 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_MALYAN_M200 5003 // STM32C8 Libmaple-based STM32F1 controller
#define BOARD_STM3R_MINI 5004 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_GTM32_PRO_VB 5005 // STM32F103VE controller
#define BOARD_GTM32_MINI 5006 // STM32F103VE controller
#define BOARD_GTM32_MINI_A30 5007 // STM32F103VE controller
#define BOARD_GTM32_REV_B 5008 // STM32F103VE controller
#define BOARD_MORPHEUS 5009 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller
#define BOARD_CHITU3D 5010 // Chitu3D (STM32F103RE)
#define BOARD_MKS_ROBIN 5011 // MKS Robin (STM32F103ZE)
#define BOARD_MKS_ROBIN_MINI 5012 // MKS Robin Mini (STM32F103VE)
#define BOARD_MKS_ROBIN_NANO 5013 // MKS Robin Nano (STM32F103VE)
#define BOARD_MKS_ROBIN_NANO_V2 5014 // MKS Robin Nano V2 (STM32F103VE)
#define BOARD_MKS_ROBIN_LITE 5015 // MKS Robin Lite/Lite2 (STM32F103RC)
#define BOARD_MKS_ROBIN_LITE3 5016 // MKS Robin Lite3 (STM32F103RC)
#define BOARD_MKS_ROBIN_PRO 5017 // MKS Robin Pro (STM32F103ZE)
#define BOARD_MKS_ROBIN_E3 5018 // MKS Robin E3 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3_V1_1 5019 // MKS Robin E3 V1.1 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3D 5020 // MKS Robin E3D (STM32F103RC)
#define BOARD_MKS_ROBIN_E3D_V1_1 5021 // MKS Robin E3D V1.1 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3P 5022 // MKS Robin E3P (STM32F103VE)
#define BOARD_BTT_SKR_MINI_V1_1 5023 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_0 5024 // BigTreeTech SKR Mini E3 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_2 5025 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V2_0 5026 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_MINI_MZ_V1_0 5027 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC)
#define BOARD_BTT_SKR_E3_DIP 5028 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_CR6 5029 // BigTreeTech SKR CR6 v1.0 (STM32F103RE)
#define BOARD_JGAURORA_A5S_A1 5030 // JGAurora A5S A1 (STM32F103ZE)
#define BOARD_FYSETC_AIO_II 5031 // FYSETC AIO_II (STM32F103RC)
#define BOARD_FYSETC_CHEETAH 5032 // FYSETC Cheetah (STM32F103RC)
#define BOARD_FYSETC_CHEETAH_V12 5033 // FYSETC Cheetah V1.2 (STM32F103RC)
#define BOARD_LONGER3D_LK 5034 // Longer3D LK1/2 - Alfawise U20/U20+/U30 (STM32F103VE)
#define BOARD_CCROBOT_MEEB_3DP 5035 // ccrobot-online.com MEEB_3DP (STM32F103RC)
#define BOARD_CHITU3D_V5 5036 // Chitu3D TronXY X5SA V5 Board (STM32F103ZE)
#define BOARD_CHITU3D_V6 5037 // Chitu3D TronXY X5SA V6 Board (STM32F103ZE)
#define BOARD_CHITU3D_V9 5038 // Chitu3D TronXY X5SA V9 Board (STM32F103ZE)
#define BOARD_CREALITY_V4 5039 // Creality v4.x (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V422 5040 // Creality v4.2.2 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V423 5041 // Creality v4.2.3 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V425 5042 // Creality v4.2.5 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V427 5043 // Creality v4.2.7 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V4210 5044 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30
#define BOARD_CREALITY_V431 5045 // Creality v4.3.1 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_A 5046 // Creality v4.3.1a (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_B 5047 // Creality v4.3.1b (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_C 5048 // Creality v4.3.1c (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_D 5049 // Creality v4.3.1d (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V452 5050 // Creality v4.5.2 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V453 5051 // Creality v4.5.3 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V521 5052 // Creality v5.2.1 (STM32F103VE) as found in the SV04
#define BOARD_CREALITY_V24S1 5053 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7
#define BOARD_CREALITY_V24S1_301 5054 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1
#define BOARD_CREALITY_V25S1 5055 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro
#define BOARD_TRIGORILLA_PRO 5056 // Trigorilla Pro (STM32F103ZE)
#define BOARD_FLY_MINI 5057 // FLYmaker FLY MINI (STM32F103RC)
#define BOARD_FLSUN_HISPEED 5058 // FLSUN HiSpeedV1 (STM32F103VE)
#define BOARD_BEAST 5059 // STM32F103RE Libmaple-based controller
#define BOARD_MINGDA_MPX_ARM_MINI 5060 // STM32F103ZE Mingda MD-16
#define BOARD_GTM32_PRO_VD 5061 // STM32F103VE controller
#define BOARD_ZONESTAR_ZM3E2 5062 // Zonestar ZM3E2 (STM32F103RC)
#define BOARD_ZONESTAR_ZM3E4 5063 // Zonestar ZM3E4 V1 (STM32F103VC)
#define BOARD_ZONESTAR_ZM3E4V2 5064 // Zonestar ZM3E4 V2 (STM32F103VC)
#define BOARD_ERYONE_ERY32_MINI 5065 // Eryone Ery32 mini (STM32F103VE)
#define BOARD_PANDA_PI_V29 5066 // Panda Pi V2.9 - Standalone (STM32F103RC)
#define BOARD_SOVOL_V131 5067 // Sovol V1.3.1 (GD32F103RET6)
//
// ARM Cortex-M4F
//
#define BOARD_TEENSY31_32 4100 // Teensy3.1 and Teensy3.2
#define BOARD_TEENSY35_36 4101 // Teensy3.5 and Teensy3.6
#define BOARD_TEENSY31_32 5100 // Teensy3.1 and Teensy3.2
#define BOARD_TEENSY35_36 5101 // Teensy3.5 and Teensy3.6
//
// STM32 ARM Cortex-M4F
//
#define BOARD_ARMED 4200 // Arm'ed STM32F4-based controller
#define BOARD_RUMBA32_V1_0 4201 // RUMBA32 STM32F446VE based controller from Aus3D
#define BOARD_RUMBA32_V1_1 4202 // RUMBA32 STM32F446VE based controller from Aus3D
#define BOARD_RUMBA32_MKS 4203 // RUMBA32 STM32F446VE based controller from Makerbase
#define BOARD_RUMBA32_BTT 4204 // RUMBA32 STM32F446VE based controller from BIGTREETECH
#define BOARD_BLACK_STM32F407VE 4205 // BLACK_STM32F407VE
#define BOARD_BLACK_STM32F407ZE 4206 // BLACK_STM32F407ZE
#define BOARD_BTT_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
#define BOARD_BTT_SKR_PRO_V1_2 4208 // BigTreeTech SKR Pro v1.2 (STM32F407ZG)
#define BOARD_BTT_BTT002_V1_0 4209 // BigTreeTech BTT002 v1.0 (STM32F407VG)
#define BOARD_BTT_E3_RRF 4210 // BigTreeTech E3 RRF (STM32F407VG)
#define BOARD_BTT_SKR_V2_0_REV_A 4211 // BigTreeTech SKR v2.0 Rev A (STM32F407VG)
#define BOARD_BTT_SKR_V2_0_REV_B 4212 // BigTreeTech SKR v2.0 Rev B (STM32F407VG/STM32F429VG)
#define BOARD_BTT_GTR_V1_0 4213 // BigTreeTech GTR v1.0 (STM32F407IGT)
#define BOARD_BTT_OCTOPUS_V1_0 4214 // BigTreeTech Octopus v1.0 (STM32F446ZE)
#define BOARD_BTT_OCTOPUS_V1_1 4215 // BigTreeTech Octopus v1.1 (STM32F446ZE)
#define BOARD_BTT_OCTOPUS_PRO_V1_0 4216 // BigTreeTech Octopus Pro v1.0 (STM32F446ZE / STM32F429ZG)
#define BOARD_LERDGE_K 4217 // Lerdge K (STM32F407ZG)
#define BOARD_LERDGE_S 4218 // Lerdge S (STM32F407VE)
#define BOARD_LERDGE_X 4219 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 4220 // VAkE 403D (STM32F446VE)
#define BOARD_FYSETC_S6 4221 // FYSETC S6 (STM32F446VE)
#define BOARD_FYSETC_S6_V2_0 4222 // FYSETC S6 v2.0 (STM32F446VE)
#define BOARD_FYSETC_SPIDER 4223 // FYSETC Spider (STM32F446VE)
#define BOARD_FLYF407ZG 4224 // FLYmaker FLYF407ZG (STM32F407ZG)
#define BOARD_MKS_ROBIN2 4225 // MKS_ROBIN2 (STM32F407ZE)
#define BOARD_MKS_ROBIN_PRO_V2 4226 // MKS Robin Pro V2 (STM32F407VE)
#define BOARD_MKS_ROBIN_NANO_V3 4227 // MKS Robin Nano V3 (STM32F407VG)
#define BOARD_MKS_ROBIN_NANO_V3_1 4228 // MKS Robin Nano V3.1 (STM32F407VE)
#define BOARD_MKS_MONSTER8_V1 4229 // MKS Monster8 V1 (STM32F407VE)
#define BOARD_MKS_MONSTER8_V2 4230 // MKS Monster8 V2 (STM32F407VE)
#define BOARD_ANET_ET4 4231 // ANET ET4 V1.x (STM32F407VG)
#define BOARD_ANET_ET4P 4232 // ANET ET4P V1.x (STM32F407VG)
#define BOARD_FYSETC_CHEETAH_V20 4233 // FYSETC Cheetah V2.0 (STM32F401RC)
#define BOARD_TH3D_EZBOARD_V2 4234 // TH3D EZBoard v2.0 (STM32F405RG)
#define BOARD_OPULO_LUMEN_REV3 4235 // Opulo Lumen PnP Controller REV3 (STM32F407VE / STM32F407VG)
#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4236 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE)
#define BOARD_MKS_EAGLE 4237 // MKS Eagle (STM32F407VE)
#define BOARD_ARTILLERY_RUBY 4238 // Artillery Ruby (STM32F401RC)
#define BOARD_FYSETC_SPIDER_V2_2 4239 // FYSETC Spider V2.2 (STM32F446VE)
#define BOARD_CREALITY_V24S1_301F4 4240 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4
#define BOARD_OPULO_LUMEN_REV4 4241 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 4242 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 4243 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 4244 // TRONXY V10 (STM32F446ZE)
#define BOARD_ARMED 5200 // Arm'ed STM32F4-based controller
#define BOARD_RUMBA32_V1_0 5201 // RUMBA32 STM32F446VE based controller from Aus3D
#define BOARD_RUMBA32_V1_1 5202 // RUMBA32 STM32F446VE based controller from Aus3D
#define BOARD_RUMBA32_MKS 5203 // RUMBA32 STM32F446VE based controller from Makerbase
#define BOARD_RUMBA32_BTT 5204 // RUMBA32 STM32F446VE based controller from BIGTREETECH
#define BOARD_BLACK_STM32F407VE 5205 // BLACK_STM32F407VE
#define BOARD_BLACK_STM32F407ZE 5206 // BLACK_STM32F407ZE
#define BOARD_BTT_SKR_MINI_E3_V3_0_1 5207 // BigTreeTech SKR Mini E3 V3.0.1 (STM32F401RC)
#define BOARD_BTT_SKR_PRO_V1_1 5208 // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
#define BOARD_BTT_SKR_PRO_V1_2 5209 // BigTreeTech SKR Pro v1.2 (STM32F407ZG)
#define BOARD_BTT_BTT002_V1_0 5210 // BigTreeTech BTT002 v1.0 (STM32F407VG)
#define BOARD_BTT_E3_RRF 5211 // BigTreeTech E3 RRF (STM32F407VG)
#define BOARD_BTT_SKR_V2_0_REV_A 5212 // BigTreeTech SKR v2.0 Rev A (STM32F407VG)
#define BOARD_BTT_SKR_V2_0_REV_B 5213 // BigTreeTech SKR v2.0 Rev B (STM32F407VG/STM32F429VG)
#define BOARD_BTT_GTR_V1_0 5214 // BigTreeTech GTR v1.0 (STM32F407IGT)
#define BOARD_BTT_OCTOPUS_V1_0 5215 // BigTreeTech Octopus v1.0 (STM32F446ZE)
#define BOARD_BTT_OCTOPUS_V1_1 5216 // BigTreeTech Octopus v1.1 (STM32F446ZE)
#define BOARD_BTT_OCTOPUS_PRO_V1_0 5217 // BigTreeTech Octopus Pro v1.0 (STM32F446ZE / STM32F429ZG)
#define BOARD_LERDGE_K 5218 // Lerdge K (STM32F407ZG)
#define BOARD_LERDGE_S 5219 // Lerdge S (STM32F407VE)
#define BOARD_LERDGE_X 5220 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 5221 // VAkE 403D (STM32F446VE)
#define BOARD_FYSETC_S6 5222 // FYSETC S6 (STM32F446VE)
#define BOARD_FYSETC_S6_V2_0 5223 // FYSETC S6 v2.0 (STM32F446VE)
#define BOARD_FYSETC_SPIDER 5224 // FYSETC Spider (STM32F446VE)
#define BOARD_FLYF407ZG 5225 // FLYmaker FLYF407ZG (STM32F407ZG)
#define BOARD_MKS_ROBIN2 5226 // MKS Robin2 V1.0 (STM32F407ZE)
#define BOARD_MKS_ROBIN_PRO_V2 5227 // MKS Robin Pro V2 (STM32F407VE)
#define BOARD_MKS_ROBIN_NANO_V3 5228 // MKS Robin Nano V3 (STM32F407VG)
#define BOARD_MKS_ROBIN_NANO_V3_1 5229 // MKS Robin Nano V3.1 (STM32F407VE)
#define BOARD_MKS_MONSTER8_V1 5230 // MKS Monster8 V1 (STM32F407VE)
#define BOARD_MKS_MONSTER8_V2 5231 // MKS Monster8 V2 (STM32F407VE)
#define BOARD_ANET_ET4 5232 // ANET ET4 V1.x (STM32F407VG)
#define BOARD_ANET_ET4P 5233 // ANET ET4P V1.x (STM32F407VG)
#define BOARD_FYSETC_CHEETAH_V20 5234 // FYSETC Cheetah V2.0 (STM32F401RC)
#define BOARD_TH3D_EZBOARD_V2 5235 // TH3D EZBoard v2.0 (STM32F405RG)
#define BOARD_OPULO_LUMEN_REV3 5236 // Opulo Lumen PnP Controller REV3 (STM32F407VE / STM32F407VG)
#define BOARD_MKS_ROBIN_NANO_V1_3_F4 5237 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE)
#define BOARD_MKS_EAGLE 5238 // MKS Eagle (STM32F407VE)
#define BOARD_ARTILLERY_RUBY 5239 // Artillery Ruby (STM32F401RC)
#define BOARD_FYSETC_SPIDER_V2_2 5240 // FYSETC Spider V2.2 (STM32F446VE)
#define BOARD_CREALITY_V24S1_301F4 5241 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4
#define BOARD_OPULO_LUMEN_REV4 5242 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 5243 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 5244 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 5245 // TRONXY V10 (STM32F446ZE)
//
// ARM Cortex M7
// ARM Cortex-M7
//
#define BOARD_REMRAM_V1 5000 // RemRam v1
#define BOARD_TEENSY41 5001 // Teensy 4.1
#define BOARD_T41U5XBB 5002 // T41U5XBB Teensy 4.1 breakout board
#define BOARD_NUCLEO_F767ZI 5003 // ST NUCLEO-F767ZI Dev Board
#define BOARD_BTT_SKR_SE_BX_V2 5004 // BigTreeTech SKR SE BX V2.0 (STM32H743II)
#define BOARD_BTT_SKR_SE_BX_V3 5005 // BigTreeTech SKR SE BX V3.0 (STM32H743II)
#define BOARD_BTT_SKR_V3_0 5006 // BigTreeTech SKR V3.0 (STM32H743VG)
#define BOARD_BTT_SKR_V3_0_EZ 5007 // BigTreeTech SKR V3.0 EZ (STM32H743VG)
#define BOARD_REMRAM_V1 6000 // RemRam v1
#define BOARD_TEENSY41 6001 // Teensy 4.1
#define BOARD_T41U5XBB 6002 // T41U5XBB Teensy 4.1 breakout board
#define BOARD_NUCLEO_F767ZI 6003 // ST NUCLEO-F767ZI Dev Board
#define BOARD_BTT_SKR_SE_BX_V2 6004 // BigTreeTech SKR SE BX V2.0 (STM32H743II)
#define BOARD_BTT_SKR_SE_BX_V3 6005 // BigTreeTech SKR SE BX V3.0 (STM32H743II)
#define BOARD_BTT_SKR_V3_0 6006 // BigTreeTech SKR V3.0 (STM32H743VG)
#define BOARD_BTT_SKR_V3_0_EZ 6007 // BigTreeTech SKR V3.0 EZ (STM32H743VG)
#define BOARD_BTT_OCTOPUS_MAX_EZ_V1_0 6008 // BigTreeTech Octopus Max EZ V1.0 (STM32H723VE / STM32H723ZE)
//
// Espressif ESP32 WiFi
//
#define BOARD_ESPRESSIF_ESP32 6000 // Generic ESP32
#define BOARD_MRR_ESPA 6001 // MRR ESPA based on ESP32 (native pins only)
#define BOARD_MRR_ESPE 6002 // MRR ESPE based on ESP32 (with I2S stepper stream)
#define BOARD_E4D_BOX 6003 // E4d@BOX
#define BOARD_RESP32_CUSTOM 6004 // Rutilea ESP32 custom board
#define BOARD_FYSETC_E4 6005 // FYSETC E4
#define BOARD_PANDA_ZHU 6006 // Panda_ZHU
#define BOARD_PANDA_M4 6007 // Panda_M4
#define BOARD_MKS_TINYBEE 6008 // MKS TinyBee based on ESP32 (with I2S stepper stream)
#define BOARD_ENWI_ESPNP 6009 // enwi ESPNP based on ESP32 (with I2S stepper stream)
#define BOARD_ESPRESSIF_ESP32 7000 // Generic ESP32
#define BOARD_MRR_ESPA 7001 // MRR ESPA based on ESP32 (native pins only)
#define BOARD_MRR_ESPE 7002 // MRR ESPE based on ESP32 (with I2S stepper stream)
#define BOARD_E4D_BOX 7003 // E4d@BOX
#define BOARD_RESP32_CUSTOM 7004 // Rutilea ESP32 custom board
#define BOARD_FYSETC_E4 7005 // FYSETC E4
#define BOARD_PANDA_ZHU 7006 // Panda_ZHU
#define BOARD_PANDA_M4 7007 // Panda_M4
#define BOARD_MKS_TINYBEE 7008 // MKS TinyBee based on ESP32 (with I2S stepper stream)
#define BOARD_ENWI_ESPNP 7009 // enwi ESPNP based on ESP32 (with I2S stepper stream)
//
// SAMD51 ARM Cortex M4
// SAMD51 ARM Cortex-M4
//
#define BOARD_AGCM4_RAMPS_144 6100 // RAMPS 1.4.4
#define BOARD_BRICOLEMON_V1_0 6101 // Bricolemon
#define BOARD_BRICOLEMON_LITE_V1_0 6102 // Bricolemon Lite
#define BOARD_AGCM4_RAMPS_144 7100 // RAMPS 1.4.4
#define BOARD_BRICOLEMON_V1_0 7101 // Bricolemon
#define BOARD_BRICOLEMON_LITE_V1_0 7102 // Bricolemon Lite
//
// SAMD21 ARM Cortex M4
// SAMD21 ARM Cortex-M4
//
#define BOARD_MINITRONICS20 6103 // Minitronics v2.0
#define BOARD_MINITRONICS20 7103 // Minitronics v2.0
//
// Custom board
@@ -485,7 +502,7 @@
// Simulations
//
#define BOARD_LINUX_RAMPS 9999
#define BOARD_SIMULATED 9999
#define _MB_1(B) (defined(BOARD_##B) && MOTHERBOARD==BOARD_##B)
#define MB(V...) DO(MB,||,V)

0
Marlin/src/core/debug_out.h Executable file → Normal file
View File

0
Marlin/src/core/drivers.h Executable file → Normal file
View File

1
Marlin/src/core/language.h Executable file → Normal file
View File

@@ -192,6 +192,7 @@
#define STR_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
#define STR_ERR_HOTEND_TOO_COLD "Hotend too cold"
#define STR_ERR_EEPROM_WRITE "Error writing to EEPROM!"
#define STR_ERR_EEPROM_CORRUPT "EEPROM Corrupt"
#define STR_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle"
#define STR_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button"

13
Marlin/src/core/macros.h Executable file → Normal file
View File

@@ -634,7 +634,9 @@
#define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()()
// Force define expansion
#define EVAL(V...) EVAL16(V)
#define EVAL EVAL16
#define EVAL4096(V...) EVAL2048(EVAL2048(V))
#define EVAL2048(V...) EVAL1024(EVAL1024(V))
#define EVAL1024(V...) EVAL512(EVAL512(V))
#define EVAL512(V...) EVAL256(EVAL256(V))
#define EVAL256(V...) EVAL128(EVAL128(V))
@@ -712,10 +714,11 @@
( DEFER2(__RREPEAT2)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP,V) ) \
( /* Do nothing */ )
#define __RREPEAT2() _RREPEAT2
#define RREPEAT_S(S,N,OP) EVAL1024(_RREPEAT(S,SUB##S(N),OP))
#define RREPEAT(N,OP) RREPEAT_S(0,N,OP)
#define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V))
#define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V)
#define RREPEAT_S(S,N,OP) EVAL1024(_RREPEAT(S,SUB##S(N),OP))
#define RREPEAT(N,OP) RREPEAT_S(0,N,OP)
#define RREPEAT_1(N,OP) RREPEAT_S(1,INCREMENT(N),OP)
#define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V))
#define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V)
// Call OP(A) with each item as an argument
#define _MAP(_MAP_OP,A,V...) \

0
Marlin/src/core/millis_t.h Executable file → Normal file
View File

0
Marlin/src/core/multi_language.h Executable file → Normal file
View File

5
Marlin/src/core/serial.cpp Executable file → Normal file
View File

@@ -85,11 +85,6 @@ void serial_offset(const_float_t v, const uint8_t sp/*=0*/) {
SERIAL_DECIMAL(v);
}
void serial_ternary(const bool onoff, FSTR_P const pre, FSTR_P const on, FSTR_P const off, FSTR_P const post/*=nullptr*/) {
if (pre) serial_print(pre);
serial_print(onoff ? on : off);
if (post) serial_print(post);
}
void serialprint_onoff(const bool onoff) { serial_print(onoff ? F(STR_ON) : F(STR_OFF)); }
void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EOL(); }
void serialprint_truefalse(const bool tf) { serial_print(tf ? F("true") : F("false")); }

11
Marlin/src/core/serial.h Executable file → Normal file
View File

@@ -327,7 +327,12 @@ inline void serial_echolnpair(FSTR_P const fstr, T v) { serial_echolnpair_P(FTOP
void serial_echo_start();
void serial_error_start();
void serial_ternary(const bool onoff, FSTR_P const pre, FSTR_P const on, FSTR_P const off, FSTR_P const post=nullptr);
inline void serial_ternary(const bool onoff, FSTR_P const pre, FSTR_P const on, FSTR_P const off, FSTR_P const post=nullptr) {
if (pre) serial_print(pre);
if (onoff && on) serial_print(on);
if (!onoff && off) serial_print(off);
if (post) serial_print(post);
}
void serialprint_onoff(const bool onoff);
void serialprintln_onoff(const bool onoff);
void serialprint_truefalse(const bool tf);
@@ -337,8 +342,8 @@ void serial_offset(const_float_t v, const uint8_t sp=0); // For v==0 draw space
void print_bin(const uint16_t val);
void print_pos(NUM_AXIS_ARGS(const_float_t), FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr);
inline void print_pos(const xyz_pos_t &xyz, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) {
print_pos(NUM_AXIS_ELEM(xyz), prefix, suffix);
inline void print_pos(const xyze_pos_t &xyze, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) {
print_pos(NUM_AXIS_ELEM(xyze), prefix, suffix);
}
#define SERIAL_POS(SUFFIX,VAR) do { print_pos(VAR, F(" " STRINGIFY(VAR) "="), F(" : " SUFFIX "\n")); }while(0)

117
Marlin/src/core/types.h Executable file → Normal file
View File

@@ -430,21 +430,24 @@ struct XYval {
FI XYval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYval<T>& operator+=(const XYZval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYval<T>& operator-=(const XYZval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYval<T>& operator*=(const XYZval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
FI XYval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator/=(const XYZval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator+=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator-=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator*=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator/=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator*=(const float &p) { x *= p; y *= p; return *this; }
FI XYval<T>& operator*=(const int &p) { x *= p; y *= p; return *this; }
FI XYval<T>& operator>>=(const int &p) { _RS(x); _RS(y); return *this; }
FI XYval<T>& operator<<=(const int &p) { _LS(x); _LS(y); return *this; }
// Exact comparisons. For floats a "NEAR" operation may be better.
FI bool operator==(const XYval<T> &rs) const { return x == rs.x && y == rs.y; }
FI bool operator==(const XYZval<T> &rs) const { return x == rs.x && y == rs.y; }
FI bool operator==(const XYZEval<T> &rs) const { return x == rs.x && y == rs.y; }
FI bool operator==(const XYval<T> &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); }
FI bool operator==(const XYZval<T> &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); }
FI bool operator==(const XYZEval<T> &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); }
FI bool operator!=(const XYval<T> &rs) const { return !operator==(rs); }
FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
@@ -465,15 +468,9 @@ struct XYZval {
FI void reset() { NUM_AXIS_GANG(x =, y =, z =, i =, j =, k =, u =, v =, w =) 0; }
// Setters taking struct types and arrays
FI void set(const T px) { x = px; }
FI void set(const T px, const T py) { x = px; y = py; }
FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
FI void set(const XYval<T> pxy, const T pz) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y, z = pz, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP); }
FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; }
#if HAS_Z_AXIS
FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w ); }
#endif
FI void set(const XYval<T> pxy) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y,,,,,,,); }
FI void set(const XYval<T> pxy, const T pz) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y, z = pz,,,,,,); }
FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
#if LOGICAL_AXES > NUM_AXES
FI void set(const T (&arr)[LOGICAL_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
FI void set(LOGICAL_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w ); }
@@ -481,6 +478,17 @@ struct XYZval {
FI void set(const T (&arr)[DISTINCT_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
#endif
#endif
// Setter for all individual args
FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
// Setters with fewer elements leave the rest untouched
#if HAS_Y_AXIS
FI void set(const T px) { x = px; }
#endif
#if HAS_Z_AXIS
FI void set(const T px, const T py) { x = px; y = py; }
#endif
#if HAS_I_AXIS
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
#endif
@@ -545,14 +553,14 @@ struct XYZval {
FI XYZval<T>& operator= (const XYZEval<T> &rs) { set(NUM_AXIS_ELEM(rs)); return *this; }
// Override other operators to get intuitive behaviors
FI XYZval<T> operator+ (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator+ (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator- (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator- (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator* (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator* (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator/ (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator/ (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator+ (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator+ (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator- (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator- (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator* (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator* (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator/ (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator/ (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator+ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
FI XYZval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
FI XYZval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
@@ -585,10 +593,10 @@ struct XYZval {
FI XYZval<T> operator-() { XYZval<T> o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; }
// Modifier operators
FI XYZval<T>& operator+=(const XYval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; }
FI XYZval<T>& operator-=(const XYval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; }
FI XYZval<T>& operator*=(const XYval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; }
FI XYZval<T>& operator/=(const XYval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; }
FI XYZval<T>& operator+=(const XYval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; }
FI XYZval<T>& operator-=(const XYval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; }
FI XYZval<T>& operator*=(const XYval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; }
FI XYZval<T>& operator/=(const XYval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; }
FI XYZval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
FI XYZval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
FI XYZval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
@@ -620,9 +628,31 @@ struct XYZEval {
// Reset all to 0
FI void reset() { LOGICAL_AXIS_GANG(e =, x =, y =, z =, i =, j =, k =, u =, v =, w =) 0; }
// Setters for some number of linear axes, not all
FI void set(const T px) { x = px; }
FI void set(const T px, const T py) { x = px; y = py; }
// Setters taking struct types and arrays
FI void set(const XYval<T> pxy) { x = pxy.x; OPTCODE(HAS_Y_AXIS, y = pxy.y) }
FI void set(const XYZval<T> pxyz) { set(NUM_AXIS_ELEM(pxyz)); }
FI void set(const XYval<T> pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); }
FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
#if LOGICAL_AXES > NUM_AXES
FI void set(const T (&arr)[LOGICAL_AXES]) { LOGICAL_AXIS_CODE(e = arr[LOGICAL_AXES-1], x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
FI void set(const XYval<T> pxy, const T pz, const T pe) { set(pxy, pz); e = pe; }
FI void set(const XYZval<T> pxyz, const T pe) { set(pxyz); e = pe; }
FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
#if DISTINCT_AXES > LOGICAL_AXES
FI void set(const T (&arr)[DISTINCT_AXES]) { LOGICAL_AXIS_CODE(e = arr[LOGICAL_AXES-1], x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
#endif
#endif
// Setter for all individual args
FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
// Setters with fewer elements leave the rest untouched
#if HAS_Y_AXIS
FI void set(const T px) { x = px; }
#endif
#if HAS_Z_AXIS
FI void set(const T px, const T py) { x = px; y = py; }
#endif
#if HAS_I_AXIS
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
#endif
@@ -642,19 +672,6 @@ struct XYZEval {
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pu, const T pv) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; v = pv; }
#endif
// Setters taking struct types and arrays
FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
FI void set(const XYZval<T> pxyz) { set(NUM_AXIS_ELEM(pxyz)); }
#if HAS_Z_AXIS
FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
#endif
FI void set(const XYval<T> pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); }
#if LOGICAL_AXES > NUM_AXES
FI void set(const XYval<T> pxy, const T pz, const T pe) { set(pxy, pz); e = pe; }
FI void set(const XYZval<T> pxyz, const T pe) { set(pxyz); e = pe; }
FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
#endif
// Length reduced to one dimension
FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); }
// Pointer to the data as a simple array
@@ -739,10 +756,10 @@ struct XYZEval {
FI XYZEval<T> operator-() { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); }
// Modifier operators
FI XYZEval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYZEval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYZEval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYZEval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
FI XYZEval<T>& operator+=(const XYval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; }
FI XYZEval<T>& operator-=(const XYval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; }
FI XYZEval<T>& operator*=(const XYval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; }
FI XYZEval<T>& operator/=(const XYval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; }
FI XYZEval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
FI XYZEval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
FI XYZEval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }

0
Marlin/src/core/utility.cpp Executable file → Normal file
View File

0
Marlin/src/core/utility.h Executable file → Normal file
View File

0
Marlin/src/feature/babystep.cpp Executable file → Normal file
View File

0
Marlin/src/feature/babystep.h Executable file → Normal file
View File

View File

@@ -32,8 +32,8 @@ enum MeshLevelingState : char {
MeshReset // G29 S5
};
#define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_CELLS_X))
#define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_CELLS_Y))
#define MESH_X_DIST (float((MESH_MAX_X) - (MESH_MIN_X)) / (GRID_MAX_CELLS_X))
#define MESH_Y_DIST (float((MESH_MAX_Y) - (MESH_MIN_Y)) / (GRID_MAX_CELLS_Y))
class mesh_bed_leveling {
public:

View File

@@ -59,7 +59,7 @@ void unified_bed_leveling::report_current_mesh() {
void unified_bed_leveling::report_state() {
echo_name();
SERIAL_ECHO_TERNARY(planner.leveling_active, " System v" UBL_VERSION " ", "", "in", "active\n");
serial_ternary(planner.leveling_active, F(" System v" UBL_VERSION " "), nullptr, F("in"), F("active\n"));
serial_delay(50);
}

View File

@@ -38,8 +38,8 @@ enum MeshPointType : char { INVALID, REAL, SET_IN_BITMAP, CLOSEST };
struct mesh_index_pair;
#define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_CELLS_X))
#define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_CELLS_Y))
#define MESH_X_DIST (float((MESH_MAX_X) - (MESH_MIN_X)) / (GRID_MAX_CELLS_X))
#define MESH_Y_DIST (float((MESH_MAX_Y) - (MESH_MIN_Y)) / (GRID_MAX_CELLS_Y))
#if ENABLED(OPTIMIZED_MESH_STORAGE)
typedef int16_t mesh_store_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
@@ -264,9 +264,9 @@ public:
return UBL_Z_RAISE_WHEN_OFF_MESH;
#endif
const uint8_t mx = _MIN(cx, (GRID_MAX_POINTS_X) - 2) + 1, my = _MIN(cy, (GRID_MAX_POINTS_Y) - 2) + 1,
x0 = get_mesh_x(cx), x1 = get_mesh_x(cx + 1);
const float z1 = calc_z0(rx0, x0, z_values[cx][cy], x1, z_values[mx][cy]),
const uint8_t mx = _MIN(cx, (GRID_MAX_POINTS_X) - 2) + 1, my = _MIN(cy, (GRID_MAX_POINTS_Y) - 2) + 1;
const float x0 = get_mesh_x(cx), x1 = get_mesh_x(cx + 1),
z1 = calc_z0(rx0, x0, z_values[cx][cy], x1, z_values[mx][cy]),
z2 = calc_z0(rx0, x0, z_values[cx][my], x1, z_values[mx][my]);
float z0 = calc_z0(ry0, get_mesh_y(cy), z1, get_mesh_y(cy + 1), z2);

View File

@@ -318,9 +318,7 @@ void unified_bed_leveling::G29() {
TERN_(HAS_MULTI_HOTEND, if (active_extruder != 0) tool_change(0, true));
// Position bed horizontally and Z probe vertically.
#if defined(SAFE_BED_LEVELING_START_X) || defined(SAFE_BED_LEVELING_START_Y) || defined(SAFE_BED_LEVELING_START_Z) \
|| defined(SAFE_BED_LEVELING_START_I) || defined(SAFE_BED_LEVELING_START_J) || defined(SAFE_BED_LEVELING_START_K) \
|| defined(SAFE_BED_LEVELING_START_U) || defined(SAFE_BED_LEVELING_START_V) || defined(SAFE_BED_LEVELING_START_W)
#if HAS_SAFE_BED_LEVELING
xyze_pos_t safe_position = current_position;
#ifdef SAFE_BED_LEVELING_START_X
safe_position.x = SAFE_BED_LEVELING_START_X;
@@ -351,7 +349,7 @@ void unified_bed_leveling::G29() {
#endif
do_blocking_move_to(safe_position);
#endif
#endif // HAS_SAFE_BED_LEVELING
}
// Invalidate one or more nearby mesh points, possibly all.
@@ -887,8 +885,32 @@ void set_message_with_feedback(FSTR_P const fstr) {
ui.capture();
save_ubl_active_state_and_disable(); // Disable bed level correction for probing
do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), MANUAL_PROBE_START_Z);
//, _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f);
do_blocking_move_to(
xyz_pos_t({
0.5f * ((MESH_MAX_X) - (MESH_MIN_X)),
0.5f * ((MESH_MAX_Y) - (MESH_MIN_Y)),
MANUAL_PROBE_START_Z
#ifdef SAFE_BED_LEVELING_START_I
, SAFE_BED_LEVELING_START_I
#endif
#ifdef SAFE_BED_LEVELING_START_J
, SAFE_BED_LEVELING_START_J
#endif
#ifdef SAFE_BED_LEVELING_START_K
, SAFE_BED_LEVELING_START_K
#endif
#ifdef SAFE_BED_LEVELING_START_U
, SAFE_BED_LEVELING_START_U
#endif
#ifdef SAFE_BED_LEVELING_START_V
, SAFE_BED_LEVELING_START_V
#endif
#ifdef SAFE_BED_LEVELING_START_W
, SAFE_BED_LEVELING_START_W
#endif
})
//, _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f
);
planner.synchronize();
SERIAL_ECHOPGM("Place shim under nozzle");
@@ -1467,7 +1489,7 @@ void unified_bed_leveling::smart_fill_mesh() {
float measured_z;
bool abort_flag = false;
#ifdef VALIDATE_MESH_TILT
#if ENABLED(VALIDATE_MESH_TILT)
float z1, z2, z3; // Needed for algorithm validation below
#endif
@@ -1483,9 +1505,7 @@ void unified_bed_leveling::smart_fill_mesh() {
abort_flag = true;
else {
measured_z -= get_z_correction(points[0]);
#ifdef VALIDATE_MESH_TILT
z1 = measured_z;
#endif
TERN_(VALIDATE_MESH_TILT, z1 = measured_z);
if (param.V_verbosity > 3) {
serial_spaces(16);
SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
@@ -1498,9 +1518,7 @@ void unified_bed_leveling::smart_fill_mesh() {
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
measured_z = probe.probe_at_point(points[1], PROBE_PT_RAISE, param.V_verbosity);
#ifdef VALIDATE_MESH_TILT
z2 = measured_z;
#endif
TERN_(VALIDATE_MESH_TILT, z2 = measured_z);
if (isnan(measured_z))
abort_flag = true;
else {
@@ -1518,9 +1536,7 @@ void unified_bed_leveling::smart_fill_mesh() {
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
measured_z = probe.probe_at_point(points[2], PROBE_PT_LAST_STOW, param.V_verbosity);
#ifdef VALIDATE_MESH_TILT
z3 = measured_z;
#endif
TERN_(VALIDATE_MESH_TILT, z3 = measured_z);
if (isnan(measured_z))
abort_flag = true;
else {
@@ -1667,7 +1683,7 @@ void unified_bed_leveling::smart_fill_mesh() {
* The Z error between the probed point locations and the get_z_correction()
* numbers for those locations should be 0.
*/
#ifdef VALIDATE_MESH_TILT
#if ENABLED(VALIDATE_MESH_TILT)
auto d_from = []{ DEBUG_ECHOPGM("D from "); };
auto normed = [&](const xy_pos_t &pos, const_float_t zadd) {
return normal.x * pos.x + normal.y * pos.y + zadd;

View File

@@ -42,9 +42,14 @@ bool BLTouch::od_5v_mode; // Initialized by settings.load, 0 = Open Drai
#include "../core/debug_out.h"
bool BLTouch::command(const BLTCommand cmd, const millis_t &ms) {
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("BLTouch Command :", cmd);
servo[Z_PROBE_SERVO_NR].move(cmd);
safe_delay(_MAX(ms, (uint32_t)BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay
const BLTCommand current = servo[Z_PROBE_SERVO_NR].read();
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("BLTouch from ", current, " to ", cmd);
// If the new command is the same, skip it (and the delay).
// The previous write should've already delayed to detect the alarm.
if (cmd != current) {
servo[Z_PROBE_SERVO_NR].move(cmd);
safe_delay(_MAX(ms, (uint32_t)BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay
}
return triggered();
}

View File

@@ -35,6 +35,8 @@
PROMPT_INFO
};
extern const char CONTINUE_STR[], DISMISS_STR[];
#endif
class HostUI {
@@ -111,6 +113,9 @@ class HostUI {
static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void prompt_do(const PromptReason reason, const char * const cstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void continue_prompt(FSTR_P const fstr) { prompt_do(PROMPT_USER_CONTINUE, fstr, FPSTR(CONTINUE_STR)); }
static void continue_prompt(const char * const cstr) { prompt_do(PROMPT_USER_CONTINUE, cstr, FPSTR(CONTINUE_STR)); }
static void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2);
}
@@ -124,5 +129,3 @@ class HostUI {
};
extern HostUI hostui;
extern const char CONTINUE_STR[], DISMISS_STR[];

View File

@@ -108,7 +108,7 @@ void Marlin_NeoPixel::init() {
set_color(adaneo1.Color
TERN(LED_USER_PRESET_STARTUP,
(LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE),
(255, 255, 255, 255))
(0, 0, 0, 0))
);
}

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