Compare commits

..

337 Commits

Author SHA1 Message Date
InsanityAutomation b788ce25f5 Update Configuration_adv.h 2024-01-09 11:10:48 -05:00
InsanityAutomation 1a9a5b82a8 AddTwinNebula 2024-01-09 09:33:38 -05:00
InsanityAutomation cb9f103421 Merge branch 'bugfix-2.1.x' into LulzbotTestBase 2024-01-09 09:03:28 -05:00
InsanityAutomation 9479cd9ce7 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2024-01-09 09:00:33 -05:00
InsanityAutomation c7de99b141 Update Configuration_adv.h 2024-01-06 19:36:23 -05:00
InsanityAutomation 9ad55840bb Update SanityCheck.h 2024-01-06 18:41:49 -05:00
InsanityAutomation 81011a71b1 Merge branch 'bugfix-2.1.x' into LulzbotTestBase 2024-01-06 18:41:43 -05:00
InsanityAutomation 832e1ca0e7 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2024-01-01 14:03:46 -05:00
InsanityAutomation 83bdfeb5cb Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-11-08 09:39:42 -05:00
InsanityAutomation 6128d61186 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-08-04 09:47:12 -04:00
InsanityAutomation 6657c44cc7 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-07-26 11:52:43 -04:00
InsanityAutomation 52c37ee699 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-06-23 09:26:59 -04:00
InsanityAutomation 134958a535 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-04-24 13:25:58 -04:00
InsanityAutomation 0f7ef6b586 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-03-10 09:10:03 -05:00
InsanityAutomation 9cbb6b1512 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-02-06 15:59:13 -05:00
InsanityAutomation af85a271a5 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-02-03 15:20:56 -05:00
MarkMan0 a7eacbcc49 🐛 Fix, Refactor PID scaling (#25096) 2022-12-17 23:48:33 -06:00
Scott Lahteine 05e2e059e3 🐛 Fix M593 F 2022-12-17 23:04:49 -06:00
InsanityAutomation 2cc52318e3 Merge branch 'bugfix-2.1.x' into LulzbotTestBase 2022-11-30 15:28:39 -05:00
Scott Lahteine d602fb9421 use the conditional 2022-10-20 09:09:56 -04:00
InsanityAutomation 8c1e4b5250 Update Configuration_adv.h 2022-10-18 17:52:28 -04:00
InsanityAutomation d2a5d2d220 Fix FTDUI Status Screen Timeout 2022-10-18 17:52:20 -04:00
InsanityAutomation 9ff3500dda Merge branch 'bugfix-2.1.x' into LulzbotTestBase 2022-10-18 17:21:43 -04:00
InsanityAutomation 30e5554171 Update Configuration_adv.h 2022-08-08 10:43:32 -04:00
InsanityAutomation 190204e6b8 Merge branch 'FixArduinoDUEServos' into LulzbotTestBase 2022-06-21 10:13:56 -04:00
Jason Smith 9d4aff6eab Fix DUE timer behavior when disabling servos 2022-06-12 14:39:54 -07:00
InsanityAutomation d74ecde544 Merge branch 'FixArduinoDUEServos' into LulzbotTestBase 2022-06-11 12:20:50 -04:00
Scott Lahteine ad4cf3e332 pick best clock for prescaler 2022-06-10 22:22:40 -05:00
Scott Lahteine 701ab0db8e define HAL_TIMER_PRESCALER 2022-06-10 21:09:25 -05:00
Scott Lahteine b3f2f44124 set inactive servos LOW 2022-06-10 20:28:03 -05:00
Scott Lahteine a03ee01cee match samd51 to others 2022-06-10 20:28:03 -05:00
Scott Lahteine 9bb87da816 apply SERVO_TIMER_PRESCALER to intervals 2022-06-10 19:52:03 -05:00
Scott Lahteine 5fbb7cbe6a ws 2022-06-10 19:06:30 -05:00
InsanityAutomation 8af96b8cdd Update Servo.cpp 2022-06-09 15:48:08 -04:00
Scott Lahteine 5cdc4527d3 Merge branch 'bugfix-2.1.x' into pr/24305 2022-06-09 00:52:57 -05:00
Scott Lahteine 0206af6c07 fix servo index check, add comments 2022-06-09 00:23:09 -05:00
InsanityAutomation fb5dd40949 Revise timer to MCK/2
Co-Authored-By: sjasonsmith <20053467+sjasonsmith@users.noreply.github.com>
2022-06-08 22:24:25 -04:00
InsanityAutomation 9c1366ed99 Archim2 USB Hang Fix 2022-06-08 19:43:34 -04:00
InsanityAutomation e7c505d415 Merge branch 'bugfix-2.1.x' into LulzbotTestBase 2022-06-08 17:38:26 -04:00
InsanityAutomation e304aa9da7 Revise timer to MCK/2 2022-06-08 17:38:04 -04:00
Scott Lahteine c1775c9005 Remove MOVE_SERVO, DETACH_SERVO 2022-06-07 22:29:17 -05:00
Scott Lahteine dbd9321380 use simple fix 2022-06-07 22:28:44 -05:00
Scott Lahteine 7f6622e6ac test this if nothing else works 2022-06-07 19:31:29 -05:00
Scott Lahteine 04ffe9493b Try adjusting finISR also ?? 2022-06-07 19:31:29 -05:00
Scott Lahteine 6c39286626 Try Servo::detach adjustment ?? 2022-06-07 19:31:29 -05:00
Scott Lahteine 86b9e7ee13 servo cleanup 2022-06-07 19:31:29 -05:00
Scott Lahteine 6566031ec6 keep check for good SERVO_INDEX 2022-06-07 17:09:28 -05:00
InsanityAutomation e7a6c77d74 Resolve DUE Servo pulse issue 2022-06-07 09:14:26 -04:00
InsanityAutomation 2436e2463c Resolve DUE Servo pulse issue 2022-06-07 09:11:41 -04:00
InsanityAutomation 9fffe26c20 Allow configurable dwell for servo move on Switching Nozzle 2022-06-07 09:11:08 -04:00
InsanityAutomation 3ab1c95ab3 Update Configuration.h 2022-05-29 18:42:03 -04:00
InsanityAutomation 7f32519aa9 Use raw positions for G34 probing to honor M206 offsets 2022-05-29 18:36:14 -04:00
InsanityAutomation ff91016e81 Config improvements 2022-05-29 17:23:13 -04:00
InsanityAutomation 4615345773 Import Marcios EMI Filtering 2022-05-29 15:33:29 -04:00
InsanityAutomation 25ff9813c6 fix upstream warnings 2022-05-22 13:53:09 -04:00
InsanityAutomation 8ba8ae85c4 minor tweaks 2022-05-22 13:52:46 -04:00
InsanityAutomation dc1cd03897 Additional merge conflicts not flagged by rebase 2022-05-22 13:39:26 -04:00
InsanityAutomation 304ca54aba Merge branch 'bugfix-2.0.x' into LulzbotTestBase 2022-05-22 13:34:16 -04:00
InsanityAutomation e175f3f729 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2022-05-22 13:04:47 -04:00
InsanityAutomation 641fc9c833 Merge branch 'LulzbotTestBase' of https://github.com/InsanityAutomation/Marlin into LulzbotTestBase 2022-05-22 13:04:29 -04:00
Roxy-3D 6e2597593a Allow BTT Octopus boards to use ST-Link for programing and debugging 2022-05-13 17:48:59 -05:00
Roxy-3D c29a949a13 Update stm32f4.ini
Allow Platform-IO to upload to the Octopus boards directly with an ST-Link attached.
2022-05-13 17:29:50 -05:00
Marcio Teixeira 26268313c4 Remove tags from non-clickable text. 2021-08-06 20:22:29 -04:00
Marcio Teixeira da8412db6a Additional tweaks for FTDI Eve spinner dialog box 2021-08-06 20:22:04 -04:00
InsanityAutomation 9bf6c900c4 A few fixes 2021-08-06 20:21:05 -04:00
InsanityAutomation aa6e7b0300 Update preflight-checks.py 2021-08-05 22:18:48 -04:00
InsanityAutomation 0663c5a372 Merge branch 'bugfix-2.0.x' into LulzbotTestBase 2021-08-02 11:08:17 -04:00
InsanityAutomation ad42498dfb Merge branch 'bugfix-2.0.x' into LulzbotTestBase 2021-06-05 13:07:08 -04:00
InsanityAutomation 662d03896b Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-06-05 12:51:39 -04:00
InsanityAutomation 8b09d27cd9 Custom User Menus confirm and hide when printing 2021-03-12 16:15:03 -05:00
InsanityAutomation d7c8cf3a9e Update Configuration_adv.h 2021-02-08 11:15:49 -05:00
InsanityAutomation c9ae761066 Merge branch 'LulzbotTestBase' of https://github.com/InsanityAutomation/Marlin into LulzbotTestBase 2021-01-03 12:46:00 -05:00
InsanityAutomation 7bed426de3 Update G12 for Taz Pro 2021-01-03 12:41:19 -05:00
InsanityAutomation 048de70ee6 Fix mesh screen include 2021-01-03 12:27:05 -05:00
InsanityAutomation 6049f226bc Merge branch 'bugfix-2.0.x' into LulzbotTestBase 2021-01-03 12:26:36 -05:00
InsanityAutomation c02083677a Fixes after rebase 2020-11-15 14:05:26 -05:00
InsanityAutomation 64ed7aff53 Merge branch 'bugfix-2.0.x' into LulzbotTestBase 2020-11-13 19:26:18 -05:00
thinkyhead a694291420 [cron] Bump distribution date (2020-10-20) 2020-10-20 00:15:55 +00:00
Scott Lahteine 0216e032be Host prompt followup 2020-10-19 04:34:14 -05:00
Scott Lahteine 2d8aa0cea1 Tweak a host prompt call 2020-10-19 04:25:48 -05:00
InsanityAutomation d1eb100806 Update G28.cpp 2020-10-16 09:30:41 -04:00
InsanityAutomation 1d3c53ae2f Update G34_M422.cpp 2020-10-12 09:07:45 -04:00
InsanityAutomation 97d5da4c11 Update platformio.ini 2020-10-12 09:07:45 -04:00
InsanityAutomation 359e0641c4 set config version 2020-10-12 09:07:45 -04:00
InsanityAutomation 2c4e4edade Tweak env 2020-10-12 09:07:45 -04:00
InsanityAutomation c6ae6c53a8 Update G29.cpp 2020-10-12 09:07:45 -04:00
InsanityAutomation c596e9f3f0 Fix z-min mechanical gantry alignment 2020-10-12 09:07:45 -04:00
InsanityAutomation 37ebee1cef Merge compatability fixes 2020-10-12 09:07:45 -04:00
InsanityAutomation 76cbaeeb2e Update Configuration_adv.h 2020-10-12 09:07:45 -04:00
InsanityAutomation 79b8ad13f1 Tweaks for MiniV2 broken endstop and gantry calibration position 2020-10-12 09:07:45 -04:00
InsanityAutomation d0a8bc29be Update Configuration_adv.h 2020-10-12 09:07:45 -04:00
InsanityAutomation 10901d9092 Make thermal timing more forgiving, at least until PID can be better tuned for BMG-M 2020-10-12 09:07:45 -04:00
InsanityAutomation dddc232294 Update Configuration_adv.h 2020-10-12 09:07:45 -04:00
InsanityAutomation 1419f2637e Adjust PID and currents on tool menu 2020-10-12 09:07:45 -04:00
InsanityAutomation 91b08d2deb Nozzle as proble home offset application to probe points 2020-10-12 09:07:45 -04:00
InsanityAutomation 2f3af1c9da Allow M206 offsets to apply to z safe home move 2020-10-12 09:07:45 -04:00
InsanityAutomation 2d6a5201cf Batch 1 2020-10-12 09:07:44 -04:00
InsanityAutomation a390a348d0 Enable Post G28 by default as its usually necessary 2020-10-12 09:07:44 -04:00
InsanityAutomation b3a732b43a Update Configuration_adv.h 2020-10-12 09:07:44 -04:00
Scott Lahteine bb6d74383e Provide MSG_ITERATION 2020-10-12 09:07:44 -04:00
Scott Lahteine 9e8b2121dd reorder 2020-10-12 09:07:44 -04:00
Scott Lahteine af91b4d29f Stepper current refactor 2020-10-12 09:07:44 -04:00
Scott Lahteine 609325a8b4 Various fixes, cleanup 2020-10-12 09:07:44 -04:00
InsanityAutomation 3bd861bf19 DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-10-12 09:07:44 -04:00
InsanityAutomation ed3de53587 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-12 09:07:44 -04:00
InsanityAutomation 82eddcd6e7 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-12 09:07:44 -04:00
InsanityAutomation 3929349c1b Fix z-min mechanical gantry alignment 2020-10-12 09:07:44 -04:00
InsanityAutomation e095f94f9f Merge compatability fixes 2020-10-12 09:07:44 -04:00
InsanityAutomation 9127ec6bd7 Update Configuration_adv.h 2020-10-12 09:07:40 -04:00
InsanityAutomation 7a9d26d1a0 Tweaks for MiniV2 broken endstop and gantry calibration position 2020-10-12 09:07:40 -04:00
InsanityAutomation af0b517e8f Update Configuration_adv.h 2020-10-12 09:07:40 -04:00
InsanityAutomation aeb062b33e Bring over pro tft fixes from main branch 2020-10-12 09:07:40 -04:00
InsanityAutomation 15fe76dd6a Make thermal timing more forgiving, at least until PID can be better tuned for BMG-M 2020-10-12 09:07:40 -04:00
InsanityAutomation 7265db1b36 Update Configuration_adv.h 2020-10-12 09:07:39 -04:00
InsanityAutomation c5104c1d2b Adjust PID and currents on tool menu 2020-10-12 09:07:39 -04:00
InsanityAutomation 8b91d1d255 Nozzle as proble home offset application to probe points 2020-10-12 09:07:39 -04:00
InsanityAutomation 9518cb0f2e Allow M206 offsets to apply to z safe home move 2020-10-12 09:07:18 -04:00
InsanityAutomation c2bd4928a5 Batch 1 2020-10-12 09:06:42 -04:00
InsanityAutomation 7120df3b85 Update G34_M422.cpp 2020-10-12 09:06:39 -04:00
InsanityAutomation f25156971b Revert "Merge branch 'Reimplement-Prusa-M915-into-G34' of https://github.com/InsanityAutomation/Marlin into Reimplement-Prusa-M915-into-G34"
This reverts commit 491cfc6ae0, reversing
changes made to d42b24369f.
2020-10-12 09:06:39 -04:00
Scott Lahteine 650ca3baa6 Move test 2020-10-12 09:06:36 -04:00
Scott Lahteine 3ceb4a5c46 Add a CI test 2020-10-12 09:06:30 -04:00
Scott Lahteine 8511d9e781 Update Configuration_adv.h 2020-10-12 09:06:30 -04:00
InsanityAutomation 7aa6d3ef09 Enable Post G28 by default as its usually necessary 2020-10-12 09:06:30 -04:00
InsanityAutomation f7fdbb4eb3 Update Configuration_adv.h 2020-10-12 09:06:25 -04:00
InsanityAutomation 7d0cd9ccf5 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-12 09:05:22 -04:00
InsanityAutomation ead8d29316 Enable Post G28 by default as its usually necessary 2020-10-12 09:05:15 -04:00
InsanityAutomation 58a6d42db6 Update Configuration_adv.h 2020-10-12 09:05:12 -04:00
InsanityAutomation 50833c9836 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-12 09:03:49 -04:00
InsanityAutomation 5d704b8494 Fix rebase issues 2020-10-12 09:03:17 -04:00
Scott Lahteine 3621a0a3f6 Update G34_M422.cpp 2020-10-12 09:03:17 -04:00
Scott Lahteine 10b9e5ca34 Move test 2020-10-12 09:03:17 -04:00
Scott Lahteine bcef7ad91b ibid 2020-10-12 09:03:17 -04:00
Scott Lahteine 1666980b5b Fix wrapper on G34_M422.cpp 2020-10-12 09:03:17 -04:00
Scott Lahteine 58a6d1b8d4 Add a CI test 2020-10-12 09:03:17 -04:00
Scott Lahteine 2151f4c50b Use MOTOR_CURRENT_COUNT 2020-10-12 09:03:17 -04:00
Scott Lahteine ee7e532761 Update G34_M422.cpp 2020-10-12 09:03:17 -04:00
Scott Lahteine 4a7665a1e9 Update Configuration_adv.h 2020-10-12 09:03:17 -04:00
InsanityAutomation 1e4d50b6e8 Update Configuration_adv.h 2020-10-12 09:03:17 -04:00
InsanityAutomation 3ae543dd30 Fix compile errors 2020-10-12 09:03:17 -04:00
Scott Lahteine 041959f903 Clean up G34/M422 2020-10-12 09:03:17 -04:00
Scott Lahteine df922ed7c8 Stepper current refactor 2020-10-12 09:03:17 -04:00
Scott Lahteine 41534e78f8 Various fixes, cleanup 2020-10-12 09:03:17 -04:00
InsanityAutomation fabdb6a51e DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-10-12 09:03:16 -04:00
InsanityAutomation fac1a75596 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-12 09:03:16 -04:00
InsanityAutomation bd5ded15e7 Enable Post G28 by default as its usually necessary 2020-10-12 09:03:16 -04:00
InsanityAutomation 530e807bcd Prevent min move from going into overflow sending Z to 65k 2020-10-12 09:03:16 -04:00
InsanityAutomation 251a0268c4 Update Configuration_adv.h 2020-10-12 09:03:16 -04:00
InsanityAutomation 4fdded0e2d Fix compile errors 2020-10-12 09:03:16 -04:00
Scott Lahteine f4e26c785f …and… 2020-10-12 09:03:16 -04:00
Scott Lahteine 9100ed15fa Fix sprintf_P call 2020-10-12 09:03:16 -04:00
Scott Lahteine dc82db35d4 helpful patch 2020-10-12 09:03:16 -04:00
Scott Lahteine 610fb6fd35 Clean up G34/M422 2020-10-12 09:03:16 -04:00
Scott Lahteine 594882f7a9 Provide MSG_ITERATION 2020-10-12 09:03:16 -04:00
Scott Lahteine 4e160fea16 reorder 2020-10-12 09:03:16 -04:00
Scott Lahteine 99d5ad3b09 Stepper current refactor 2020-10-12 09:03:16 -04:00
Scott Lahteine a9f6080931 Various fixes, cleanup 2020-10-12 09:03:16 -04:00
InsanityAutomation 1b0301c89f Add missed lines from working branch 2020-10-12 09:03:16 -04:00
InsanityAutomation 94798e4465 Update G34_M422.cpp 2020-10-12 09:03:16 -04:00
InsanityAutomation 65b59a6646 DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-10-12 09:03:15 -04:00
InsanityAutomation 09f5b5d00a Sanity Checks, gcode calls 2020-10-12 09:03:15 -04:00
InsanityAutomation 3487cbad21 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-12 09:03:15 -04:00
InsanityAutomation da8e07b697 Merge branch 'LulzbotTestBase' of https://github.com/InsanityAutomation/Marlin into LulzbotTestBase 2020-10-11 17:00:24 -04:00
InsanityAutomation 402a13a980 Update G34_M422.cpp 2020-10-11 11:48:45 -04:00
InsanityAutomation 56f7a03a5c Update platformio.ini 2020-10-11 11:32:20 -04:00
InsanityAutomation 3113388293 set config version 2020-10-11 10:06:50 -04:00
InsanityAutomation eecfc0479a Tweak env 2020-10-11 10:06:50 -04:00
InsanityAutomation 9984643e4c Update G29.cpp 2020-10-11 10:06:50 -04:00
InsanityAutomation 58114b32ba Fix z-min mechanical gantry alignment 2020-10-11 10:06:50 -04:00
InsanityAutomation 50a6fb637f Merge compatability fixes 2020-10-11 10:06:50 -04:00
InsanityAutomation d71b12cd8b Update Configuration_adv.h 2020-10-11 10:06:50 -04:00
InsanityAutomation 42842f71e0 Tweaks for MiniV2 broken endstop and gantry calibration position 2020-10-11 10:06:49 -04:00
InsanityAutomation 5213de4eaa Update Configuration_adv.h 2020-10-11 10:06:49 -04:00
InsanityAutomation 602c9fffe0 Make thermal timing more forgiving, at least until PID can be better tuned for BMG-M 2020-10-11 10:06:49 -04:00
InsanityAutomation 4d73906008 Update Configuration_adv.h 2020-10-11 10:06:49 -04:00
InsanityAutomation 0da50d80ef Adjust PID and currents on tool menu 2020-10-11 10:06:49 -04:00
InsanityAutomation f0bbc163c6 Nozzle as proble home offset application to probe points 2020-10-11 10:06:49 -04:00
InsanityAutomation 78aec86650 Allow M206 offsets to apply to z safe home move 2020-10-11 10:06:42 -04:00
InsanityAutomation 6bd2a602ca Batch 1 2020-10-11 10:06:42 -04:00
InsanityAutomation 6b923de48d Enable Post G28 by default as its usually necessary 2020-10-11 10:06:38 -04:00
InsanityAutomation a645efd189 Update Configuration_adv.h 2020-10-11 10:06:35 -04:00
Scott Lahteine a717a3eacb Provide MSG_ITERATION 2020-10-11 10:06:24 -04:00
Scott Lahteine da03b84eff reorder 2020-10-11 10:06:20 -04:00
Scott Lahteine aa6d23c7cb Stepper current refactor 2020-10-11 10:06:20 -04:00
Scott Lahteine 2a1826f1ed Various fixes, cleanup 2020-10-11 10:06:16 -04:00
InsanityAutomation 8e79ea09e4 DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-10-11 10:06:07 -04:00
InsanityAutomation e29dbb946e Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-11 10:06:00 -04:00
InsanityAutomation b1f8fa881d Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-11 10:05:50 -04:00
InsanityAutomation c2a2d04b50 Update G29.cpp 2020-10-11 10:05:43 -04:00
InsanityAutomation 84d0a5ebd1 Fix z-min mechanical gantry alignment 2020-10-11 10:05:43 -04:00
InsanityAutomation 6ed5c22d7c Merge compatability fixes 2020-10-11 10:05:39 -04:00
InsanityAutomation 07246fdc30 Update Configuration_adv.h 2020-10-11 10:05:35 -04:00
InsanityAutomation 14899ca3f7 Tweaks for MiniV2 broken endstop and gantry calibration position 2020-10-11 10:05:35 -04:00
InsanityAutomation 2d0972d35d Update Configuration_adv.h 2020-10-11 10:05:35 -04:00
InsanityAutomation c43828b2e3 Bring over pro tft fixes from main branch 2020-10-11 10:05:34 -04:00
InsanityAutomation bc13685c46 Make thermal timing more forgiving, at least until PID can be better tuned for BMG-M 2020-10-11 10:05:26 -04:00
InsanityAutomation 14d374dc2b Update Configuration_adv.h 2020-10-11 10:05:26 -04:00
InsanityAutomation 5dc45f2ceb Adjust PID and currents on tool menu 2020-10-11 10:05:26 -04:00
InsanityAutomation 8ed81063a2 Nozzle as proble home offset application to probe points 2020-10-11 10:05:26 -04:00
InsanityAutomation cb92d78a46 Allow M206 offsets to apply to z safe home move 2020-10-11 10:05:21 -04:00
InsanityAutomation d94a20e63a Batch 1 2020-10-11 10:05:10 -04:00
InsanityAutomation b2ff518c27 Update G29.cpp 2020-10-11 09:55:14 -04:00
Scott Lahteine 4c1d5e8fcf Update G29.cpp 2020-10-11 09:55:14 -04:00
Scott Lahteine e13d6ba012 safe_homing_xy is defined in motion.h 2020-10-11 09:55:14 -04:00
InsanityAutomation ec08edd240 Update G28.cpp 2020-10-11 09:55:13 -04:00
InsanityAutomation 1c890a9da0 Apply home offsets to probing and Z Safe Homing 2020-10-11 09:55:13 -04:00
InsanityAutomation e070ce987f Update G34_M422.cpp 2020-10-11 09:51:37 -04:00
InsanityAutomation 45b75301a8 Revert "Merge branch 'Reimplement-Prusa-M915-into-G34' of https://github.com/InsanityAutomation/Marlin into Reimplement-Prusa-M915-into-G34"
This reverts commit 491cfc6ae0, reversing
changes made to d42b24369f.
2020-10-11 09:45:39 -04:00
InsanityAutomation 491cfc6ae0 Merge branch 'Reimplement-Prusa-M915-into-G34' of https://github.com/InsanityAutomation/Marlin into Reimplement-Prusa-M915-into-G34 2020-10-11 09:44:41 -04:00
InsanityAutomation d42b24369f Fix rebase issues 2020-10-11 09:43:57 -04:00
Scott Lahteine 8280cfef43 Update G34_M422.cpp 2020-10-10 14:24:29 -04:00
Scott Lahteine 785da0db6c Move test 2020-10-10 14:24:29 -04:00
Scott Lahteine eaad3c451c ibid 2020-10-10 14:24:29 -04:00
Scott Lahteine fd751bd3fe Fix wrapper on G34_M422.cpp 2020-10-10 14:24:14 -04:00
Scott Lahteine 0785d312f7 Add a CI test 2020-10-10 14:24:14 -04:00
Scott Lahteine 5dc96c7324 Use MOTOR_CURRENT_COUNT 2020-10-10 14:24:13 -04:00
Scott Lahteine 2532ef1049 Update G34_M422.cpp 2020-10-10 14:24:13 -04:00
Scott Lahteine dd2d4df3dc Update Configuration_adv.h 2020-10-10 14:24:13 -04:00
InsanityAutomation a583d8998f Update Configuration_adv.h 2020-10-10 14:24:13 -04:00
InsanityAutomation 953cf6f7d6 Fix compile errors 2020-10-10 14:23:11 -04:00
Scott Lahteine fcd4fa4ab7 Clean up G34/M422 2020-10-10 14:22:41 -04:00
Scott Lahteine 123a2b28fc Stepper current refactor 2020-10-10 14:21:57 -04:00
Scott Lahteine 28261437f8 Various fixes, cleanup 2020-10-10 14:20:38 -04:00
InsanityAutomation c0a48e4fe2 DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-10-10 14:19:08 -04:00
InsanityAutomation 5b2353a2ab Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-10 14:16:11 -04:00
InsanityAutomation cafd4ff6a6 Enable Post G28 by default as its usually necessary 2020-10-10 14:13:52 -04:00
InsanityAutomation f98aff039c Prevent min move from going into overflow sending Z to 65k 2020-10-10 14:13:52 -04:00
InsanityAutomation 5e93e09c1a Update Configuration_adv.h 2020-10-10 14:13:52 -04:00
InsanityAutomation ca5c5fdd40 Fix compile errors 2020-10-10 14:13:52 -04:00
Scott Lahteine 71c1b8ca6d …and… 2020-10-10 14:13:52 -04:00
Scott Lahteine e5c2fbd6ac Fix sprintf_P call 2020-10-10 14:13:52 -04:00
Scott Lahteine 3618b9c7be helpful patch 2020-10-10 14:13:52 -04:00
Scott Lahteine 7ab7cfc96d Clean up G34/M422 2020-10-10 14:13:52 -04:00
Scott Lahteine 92db4f2d84 Provide MSG_ITERATION 2020-10-10 14:13:52 -04:00
Scott Lahteine e2ce5865c9 reorder 2020-10-10 14:13:52 -04:00
Scott Lahteine 6815edf8d6 Stepper current refactor 2020-10-10 14:13:52 -04:00
Scott Lahteine f8ff1c8d6a Various fixes, cleanup 2020-10-10 14:13:51 -04:00
InsanityAutomation 6ab5745875 Add missed lines from working branch 2020-10-10 14:13:51 -04:00
InsanityAutomation 8bb6a9b44a Update G34_M422.cpp 2020-10-10 14:13:51 -04:00
InsanityAutomation 52ec2a266f DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-10-10 14:13:51 -04:00
InsanityAutomation 33f6219f06 Sanity Checks, gcode calls 2020-10-10 14:13:51 -04:00
InsanityAutomation dd6153f317 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-10 14:13:51 -04:00
InsanityAutomation 05af0cbb55 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2020-10-10 13:57:26 -04:00
Scott Lahteine ff39019034 Update G34_M422.cpp 2020-10-10 12:40:08 -05:00
Scott Lahteine a5eefa9ffa Move test 2020-10-10 12:36:35 -05:00
Scott Lahteine 109e8f88ce ibid 2020-10-10 12:34:08 -05:00
Scott Lahteine 00413994dd Fix wrapper on G34_M422.cpp 2020-10-10 12:32:19 -05:00
Scott Lahteine 8e39965b2d Add a CI test 2020-10-10 12:31:17 -05:00
Scott Lahteine 87f6e91f51 Use MOTOR_CURRENT_COUNT 2020-10-10 12:27:46 -05:00
Scott Lahteine 0cb0df6bee Update G34_M422.cpp 2020-10-10 12:17:07 -05:00
Scott Lahteine 80e2ab6ed6 Update Configuration_adv.h 2020-10-10 12:12:36 -05:00
InsanityAutomation e406791b6f set config version 2020-10-04 12:44:43 -04:00
InsanityAutomation 438eb8ebb3 Tweak env 2020-10-04 12:39:08 -04:00
InsanityAutomation 206b5ab014 Update G29.cpp 2020-10-04 12:39:08 -04:00
InsanityAutomation 2ab7fa652c Fix z-min mechanical gantry alignment 2020-10-04 12:39:08 -04:00
InsanityAutomation 87d1df38de Merge compatability fixes 2020-10-04 12:39:08 -04:00
InsanityAutomation c392cb6d9d Update Configuration_adv.h 2020-10-04 12:39:08 -04:00
InsanityAutomation 7ae0805095 Tweaks for MiniV2 broken endstop and gantry calibration position 2020-10-04 12:39:08 -04:00
InsanityAutomation a2f86e84a4 Update Configuration_adv.h 2020-10-04 12:39:08 -04:00
InsanityAutomation b8a2160f82 Bring over pro tft fixes from main branch 2020-10-04 12:39:07 -04:00
InsanityAutomation 99d49108c1 Make thermal timing more forgiving, at least until PID can be better tuned for BMG-M 2020-10-04 12:39:07 -04:00
InsanityAutomation e6671b3065 Update Configuration_adv.h 2020-10-04 12:39:07 -04:00
InsanityAutomation df82a0e497 Adjust PID and currents on tool menu 2020-10-04 12:39:07 -04:00
InsanityAutomation 1832269181 Nozzle as proble home offset application to probe points 2020-10-04 12:39:07 -04:00
InsanityAutomation 8341f282ee Allow M206 offsets to apply to z safe home move 2020-10-04 12:39:07 -04:00
InsanityAutomation 4fdf747445 Batch 1 2020-10-04 12:39:07 -04:00
InsanityAutomation 61b6a0ea9f Enable Post G28 by default as its usually necessary 2020-10-04 12:38:55 -04:00
InsanityAutomation 5006ca07be Prevent min move from going into overflow sending Z to 65k 2020-10-04 12:38:55 -04:00
InsanityAutomation 8579af67a2 Update Configuration_adv.h 2020-10-04 12:38:54 -04:00
InsanityAutomation 8f49610d3a Fix compile errors 2020-10-04 12:38:46 -04:00
Scott Lahteine 8fd08ba1f8 …and… 2020-10-04 12:38:46 -04:00
Scott Lahteine c0c4f77c36 Fix sprintf_P call 2020-10-04 12:38:46 -04:00
Scott Lahteine b6cbad224b helpful patch 2020-10-04 12:38:46 -04:00
Scott Lahteine c765c7484c Clean up G34/M422 2020-10-04 12:38:46 -04:00
Scott Lahteine 3242d3dca2 Provide MSG_ITERATION 2020-10-04 12:38:46 -04:00
Scott Lahteine 58f774e98d reorder 2020-10-04 12:38:46 -04:00
Scott Lahteine 79ff336b2b Stepper current refactor 2020-10-04 12:38:45 -04:00
Scott Lahteine 0d367432e6 Various fixes, cleanup 2020-10-04 12:38:39 -04:00
InsanityAutomation 959919bcfe Add missed lines from working branch 2020-10-04 12:38:30 -04:00
InsanityAutomation 4f7289e022 Update G34_M422.cpp 2020-10-04 12:38:30 -04:00
InsanityAutomation af8be03165 DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-10-04 12:38:30 -04:00
InsanityAutomation 88ce2c94f8 Sanity Checks, gcode calls 2020-10-04 12:36:59 -04:00
InsanityAutomation 0a52d5c032 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-04 12:36:24 -04:00
InsanityAutomation 38286d9805 Enable Post G28 by default as its usually necessary 2020-10-04 12:35:54 -04:00
InsanityAutomation 0ece75536c Prevent min move from going into overflow sending Z to 65k 2020-10-04 12:35:54 -04:00
InsanityAutomation 4b377bb032 Update Configuration_adv.h 2020-10-04 12:35:54 -04:00
InsanityAutomation 0392a56193 Fix compile errors 2020-10-04 12:35:54 -04:00
Scott Lahteine 58654b3664 …and… 2020-10-04 12:35:53 -04:00
Scott Lahteine 8b324e08d9 Fix sprintf_P call 2020-10-04 12:35:53 -04:00
Scott Lahteine 1bf3881adc helpful patch 2020-10-04 12:35:53 -04:00
Scott Lahteine e2c1ca3bca Clean up G34/M422 2020-10-04 12:35:53 -04:00
Scott Lahteine 234b15a12c Provide MSG_ITERATION 2020-10-04 12:35:53 -04:00
Scott Lahteine 80a0c3b028 reorder 2020-10-04 12:35:53 -04:00
Scott Lahteine e73644f3fe Stepper current refactor 2020-10-04 12:35:53 -04:00
Scott Lahteine 9a6d6a4405 Various fixes, cleanup 2020-10-04 12:35:52 -04:00
InsanityAutomation 777abb71b5 Add missed lines from working branch 2020-10-04 12:35:52 -04:00
InsanityAutomation ac4ffdb4e5 Update G34_M422.cpp 2020-10-04 12:35:52 -04:00
InsanityAutomation 691a297b6a DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-10-04 12:35:52 -04:00
InsanityAutomation bec97532ee Sanity Checks, gcode calls 2020-10-04 12:35:52 -04:00
InsanityAutomation 406cd0cc83 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-10-04 12:35:52 -04:00
Victor Oliveira 62af625be4 STM32F1Minor SPI fixes, systick_callback for HAL compatibility (#19565) 2020-10-01 20:52:42 -05:00
InsanityAutomation 26917ebf96 Merge branch 'Reimplement-Prusa-M915-into-G34' of https://github.com/InsanityAutomation/Marlin into Reimplement-Prusa-M915-into-G34 2020-09-23 18:53:45 -04:00
InsanityAutomation 3d8bfb036d Enable Post G28 by default as its usually necessary 2020-09-23 18:50:54 -04:00
InsanityAutomation a0f0af5da8 Prevent min move from going into overflow sending Z to 65k 2020-09-23 18:50:54 -04:00
InsanityAutomation 27c99f74ad Update Configuration_adv.h 2020-09-23 18:50:54 -04:00
InsanityAutomation 050cef7b48 Fix compile errors 2020-09-23 18:50:54 -04:00
Scott Lahteine 5d74ace99f …and… 2020-09-23 18:50:54 -04:00
Scott Lahteine 3130fd9532 Fix sprintf_P call 2020-09-23 18:50:54 -04:00
Scott Lahteine f0c531abb6 helpful patch 2020-09-23 18:50:53 -04:00
Scott Lahteine ce2874b732 Clean up G34/M422 2020-09-23 18:50:53 -04:00
Scott Lahteine a55cef1165 Provide MSG_ITERATION 2020-09-23 18:50:53 -04:00
Scott Lahteine 682b0b440d reorder 2020-09-23 18:50:53 -04:00
Scott Lahteine 7025912957 Stepper current refactor 2020-09-23 18:50:53 -04:00
Scott Lahteine bb6b23891c Various fixes, cleanup 2020-09-23 18:50:52 -04:00
InsanityAutomation 1b211947b8 Add missed lines from working branch 2020-09-23 18:50:52 -04:00
InsanityAutomation ea15d3edab Update G34_M422.cpp 2020-09-23 18:50:52 -04:00
InsanityAutomation 47c6f8a98b DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-09-23 18:50:52 -04:00
InsanityAutomation ccb2c3bb85 Sanity Checks, gcode calls 2020-09-23 18:50:52 -04:00
InsanityAutomation e74b9776e5 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-09-23 18:50:52 -04:00
InsanityAutomation e61bbe1499 Enable Post G28 by default as its usually necessary 2020-09-19 00:27:23 -04:00
InsanityAutomation ffd7062e21 Prevent min move from going into overflow sending Z to 65k 2020-09-19 00:14:10 -04:00
InsanityAutomation 7255ca0bc6 Update Configuration_adv.h 2020-09-19 00:02:06 -04:00
InsanityAutomation f7c56bc5e4 Fix compile errors 2020-09-17 11:16:01 -04:00
InsanityAutomation e4c973487b Merge branch 'bugfix-2.0.x' into Reimplement-Prusa-M915-into-G34 2020-09-17 10:40:14 -04:00
Scott Lahteine d4ab268bbf …and… 2020-09-16 16:38:01 -04:00
Scott Lahteine b4dbf606b7 Fix sprintf_P call 2020-09-16 16:38:01 -04:00
Scott Lahteine f6a1d772c2 helpful patch 2020-09-16 16:38:00 -04:00
Scott Lahteine ae208fa92f Clean up G34/M422 2020-09-16 16:38:00 -04:00
Scott Lahteine f11d496899 Provide MSG_ITERATION 2020-09-16 16:38:00 -04:00
Scott Lahteine a3d0fe53cf reorder 2020-09-16 16:38:00 -04:00
Scott Lahteine 395d11b06f Stepper current refactor 2020-09-16 16:38:00 -04:00
Scott Lahteine e79b328103 Various fixes, cleanup 2020-09-16 16:37:59 -04:00
InsanityAutomation 1c19d9a86a Add missed lines from working branch 2020-09-16 16:37:59 -04:00
InsanityAutomation 6043f88b35 Update G34_M422.cpp 2020-09-16 16:37:59 -04:00
InsanityAutomation 2087e6fbcf DIGIPOTSS in motter current array with PWM, stored to eeprom, and G34 tested 2020-09-16 16:37:59 -04:00
InsanityAutomation c67086bdba Sanity Checks, gcode calls 2020-09-16 16:37:59 -04:00
InsanityAutomation 24e6dbcf48 Add New G34 mode for current adjustable drivers
TODO : Sanity checks, Finish DAC mode, Test on Rambo
2020-09-16 16:37:58 -04:00
1633 changed files with 77427 additions and 68126 deletions
-21
View File
@@ -1,21 +0,0 @@
# Build artifacts
buildroot/
*.o
*.a
*.so
*.dylib
*.dll
*.exe
# Web assets
*.min.js
*.min.css
# Generated files
__pycache__/
*.pyc
.DS_Store
# IDE files
.vscode/
.idea/
+1 -1
View File
@@ -7,7 +7,7 @@ contact_links:
url: https://www.facebook.com/groups/1049718498464482 url: https://www.facebook.com/groups/1049718498464482
about: Please ask and answer questions here. about: Please ask and answer questions here.
- name: 🕹 Marlin on Discord - name: 🕹 Marlin on Discord
url: https://discord.com/servers/marlin-firmware-461605380783472640 url: https://discord.gg/n5NJ59y
about: Join the Discord server for support and discussion. about: Join the Discord server for support and discussion.
- name: 🔗 Marlin Discussion Forum - name: 🔗 Marlin Discussion Forum
url: https://reprap.org/forum/list.php?415 url: https://reprap.org/forum/list.php?415
+1 -1
View File
@@ -43,7 +43,7 @@ We have a Message Board and a Facebook group where our knowledgable user communi
If chat is more your speed, you can join the MarlinFirmware Discord server: If chat is more your speed, you can join the MarlinFirmware Discord server:
* Use the link https://discord.com/servers/marlin-firmware-461605380783472640 to join up as a General User. * Use the link https://discord.gg/n5NJ59y to join up as a General User.
* Even though our Discord is pretty active, it may take a while for community members to respond &mdash; please be patient! * Even though our Discord is pretty active, it may take a while for community members to respond &mdash; please be patient!
* Use the `#general` channel for general questions or discussion about Marlin. * Use the `#general` channel for general questions or discussion about Marlin.
* Other channels exist for certain topics or are limited to Patrons. Check the channel list. * Other channels exist for certain topics or are limited to Patrons. Check the channel list.
+40
View File
@@ -0,0 +1,40 @@
#
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
#
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 60
# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: false
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: [ 'no-locking' ]
# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false
# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: true
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
# exemptLabels:
# - help-wanted
# lockLabel: outdated
# pulls:
# daysUntilLock: 30
# Repository to extend settings from
# _extends: repo
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
autolabel: autolabel:
name: Auto Label name: Auto Label
if: github.repository == 'MarlinFirmware/Marlin' if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- name: Auto Label for [BUG] - name: Auto Label for [BUG]
uses: actions/github-script@v7 uses: actions/github-script@v7
+3 -3
View File
@@ -14,12 +14,12 @@ jobs:
name: Bump Distribution Date name: Bump Distribution Date
if: github.repository == 'MarlinFirmware/Marlin' if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- name: Check out bugfix-2.0.x - name: Check out bugfix-2.0.x
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
ref: bugfix-2.0.x ref: bugfix-2.0.x
@@ -39,7 +39,7 @@ jobs:
exit 0 exit 0
- name: Check out bugfix-2.1.x - name: Check out bugfix-2.1.x
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
ref: bugfix-2.1.x ref: bugfix-2.1.x
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
name: PR Bad Target name: PR Bad Target
if: github.repository == 'MarlinFirmware/Marlin' if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- uses: superbrothers/close-pull-request@v3 - uses: superbrothers/close-pull-request@v3
-73
View File
@@ -1,73 +0,0 @@
#
# ci-unit-tests.yml
# Build and execute unit tests to catch functional issues in code
#
name: CI - Unit Tests
on:
pull_request:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths-ignore:
- config/**
- data/**
- docs/**
- '**/*.md'
push:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths-ignore:
- config/**
- data/**
- docs/**
- '**/*.md'
jobs:
# This runs all unit tests as a single job. While it should be possible to break this up into
# multiple jobs, they currently run quickly and finish long before the compilation tests.
run_unit_tests:
name: Unit Test
# These tests will only be able to run on the bugfix-2.1.x branch, until the next release
# pulls them into additional branches.
if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04
steps:
- name: Check out the PR
uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Select Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- name: Install PlatformIO
run: |
pip install -U platformio
pio upgrade --dev
pio pkg update --global
- name: Run All Unit Tests
run: |
make unit-test-all-local
-48
View File
@@ -1,48 +0,0 @@
#
# ci-validate-boards.yml
# Validate boards.h to make sure it's all set up correctly
#
name: CI - Validate boards.h
# We can do the on: section as two items, one for pull requests and one for pushes...
on:
pull_request:
branches:
- bugfix-2.1.x
paths:
- 'Marlin/src/core/boards.h'
push:
branches:
- bugfix-2.1.x
paths:
- 'Marlin/src/core/boards.h'
jobs:
validate_pins_files:
name: Validate boards.h
if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04
steps:
- name: Check out the PR
uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Select Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- name: Validate core/boards.h
run: |
make validate-boards -j
-51
View File
@@ -1,51 +0,0 @@
#
# ci-validate-pins.yml
# Validate that all of the pins files are unchanged by pinsformat.py
#
name: CI - Validate Pins Files
on:
pull_request:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths:
- 'Marlin/src/pins/*/**'
push:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths:
- 'Marlin/src/pins/*/**'
jobs:
validate_pins_files:
name: Validate Pins Files
if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04
steps:
- name: Check out the PR
uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Select Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- name: Validate all pins files
run: |
make validate-pins -j
+2 -2
View File
@@ -13,7 +13,7 @@ on:
jobs: jobs:
remove_label: remove_label:
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@@ -32,7 +32,7 @@ jobs:
- "Needs: Work" - "Needs: Work"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- name: Remove Labels - name: Remove Labels
uses: actions-ecosystem/action-remove-labels@v1 uses: actions-ecosystem/action-remove-labels@v1
with: with:
+2 -2
View File
@@ -14,10 +14,10 @@ jobs:
name: Close Stale Issues name: Close Stale Issues
if: github.repository == 'MarlinFirmware/Marlin' if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/stale@v9 - uses: actions/stale@v8
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: | stale-issue-message: |
+7 -7
View File
@@ -14,18 +14,18 @@ jobs:
name: Lock Closed Issues name: Lock Closed Issues
if: github.repository == 'MarlinFirmware/Marlin' if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- uses: dessant/lock-threads@v5 - uses: dessant/lock-threads@v2
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}
process-only: 'issues' process-only: 'issues'
issue-inactive-days: '60' issue-lock-inactive-days: '60'
exclude-issue-created-before: '' issue-exclude-created-before: ''
exclude-any-issue-labels: 'no-locking' issue-exclude-labels: 'no-locking'
add-issue-labels: '' issue-lock-labels: ''
issue-comment: > issue-lock-comment: >
This issue has been automatically locked since there This issue has been automatically locked since there
has not been any recent activity after it was closed. has not been any recent activity after it was closed.
Please open a new issue for related bugs. Please open a new issue for related bugs.
@@ -1,9 +1,9 @@
# #
# ci-build-tests.yml # test-builds.yml
# Do test builds to catch compile errors # Do test builds to catch compile errors
# #
name: CI - Build Tests name: CI
on: on:
pull_request: pull_request:
@@ -14,8 +14,6 @@ on:
- config/** - config/**
- data/** - data/**
- docs/** - docs/**
- test/**
- Marlin/tests/**
- '**/*.md' - '**/*.md'
push: push:
branches: branches:
@@ -25,28 +23,21 @@ on:
- config/** - config/**
- data/** - data/**
- docs/** - docs/**
- test/**
- Marlin/tests/**
- '**/*.md' - '**/*.md'
jobs: jobs:
test_builds: test_builds:
name: Build Test name: Run All Tests
if: github.repository == 'MarlinFirmware/Marlin' if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
strategy: strategy:
fail-fast: true
matrix: matrix:
test-platform: test-platform:
# RP2040
- SKR_Pico
# Native # Native
- linux_native - linux_native
- simulator_linux_release
# AVR # AVR
- mega2560 - mega2560
@@ -109,11 +100,11 @@ jobs:
# STM32F4 # STM32F4
- ARMED - ARMED
- BTT_BTT002 - BIGTREE_BTT002
- BTT_GTR_V1_0 - BIGTREE_GTR_V1_0
- BTT_SKR_PRO - BIGTREE_SKR_PRO
- FLYF407ZG - FLYF407ZG
- STM32F446VE_fysetc - FYSETC_S6
- LERDGEK - LERDGEK
- LERDGEX - LERDGEX
- mks_robin_pro2 - mks_robin_pro2
@@ -161,7 +152,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Cache pip - name: Cache pip
uses: actions/cache@v4 uses: actions/cache@v3
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@@ -169,13 +160,13 @@ jobs:
${{ runner.os }}-pip- ${{ runner.os }}-pip-
- name: Cache PlatformIO - name: Cache PlatformIO
uses: actions/cache@v4 uses: actions/cache@v3
with: with:
path: ~/.platformio path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Select Python 3.9 - name: Select Python 3.9
uses: actions/setup-python@v5 uses: actions/setup-python@v4
with: with:
python-version: '3.9' python-version: '3.9'
architecture: 'x64' architecture: 'x64'
@@ -186,14 +177,6 @@ jobs:
pio upgrade --dev pio upgrade --dev
pio pkg update --global pio pkg update --global
- name: Install Simulator dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-net-dev
sudo apt-get install libglm-dev
- name: Run ${{ matrix.test-platform }} Tests - name: Run ${{ matrix.test-platform }} Tests
run: | run: |
make tests-single-ci TEST_TARGET=${{ matrix.test-platform }} make tests-single-ci TEST_TARGET=${{ matrix.test-platform }}
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
name: Unlock Reopened name: Unlock Reopened
if: github.repository == 'MarlinFirmware/Marlin' if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- uses: OSDKDev/unlock-issues@v1.1 - uses: OSDKDev/unlock-issues@v1.1
-4
View File
@@ -125,7 +125,6 @@ vc-fileutils.settings
# Visual Studio Code # Visual Studio Code
.vscode/* .vscode/*
!.vscode/extensions.json !.vscode/extensions.json
*.code-workspace
# Simulation files # Simulation files
imgui.ini imgui.ini
@@ -169,6 +168,3 @@ __pycache__
tags tags
*.logs *.logs
*.bak *.bak
.aider*
!.aiderignore
.env
-16
View File
@@ -1,16 +0,0 @@
/**
* Marlin-specific settings for Zed
*
* For a full list of overridable settings, and general information on folder-specific settings,
* see the documentation: https://zed.dev/docs/configuring-zed#settings-files
*/
{
"languages": {
"C": {
"enable_language_server": false
},
"C++": {
"enable_language_server": false
}
}
}
+20 -64
View File
@@ -2,24 +2,16 @@ SCRIPTS_DIR := buildroot/share/scripts
CONTAINER_RT_BIN := docker CONTAINER_RT_BIN := docker
CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio
CONTAINER_IMAGE := marlin-dev CONTAINER_IMAGE := marlin-dev
UNIT_TEST_CONFIG ?= default
help: help:
@echo "Tasks for local development:" @echo "Tasks for local development:"
@echo "make marlin : Build Marlin for the configured board" @echo "* format-pins: Reformat all pins files"
@echo "make format-pins -j : Reformat all pins files (-j for parallel execution)" @echo "* tests-single-ci: Run a single test from inside the CI"
@echo "make validate-pins -j : Validate all pins files, fails if any require reformatting" @echo "* tests-single-local: Run a single test locally"
@echo "make validate-boards -j : Validate boards.h and pins.h for standards compliance" @echo "* tests-single-local-docker: Run a single test locally, using docker"
@echo "make tests-single-ci : Run a single test from inside the CI" @echo "* tests-all-local: Run all tests locally"
@echo "make tests-single-local : Run a single test locally" @echo "* tests-all-local-docker: Run all tests locally, using docker"
@echo "make tests-single-local-docker : Run a single test locally, using docker" @echo "* setup-local-docker: Build the local docker image"
@echo "make tests-all-local : Run all tests locally"
@echo "make tests-all-local-docker : Run all tests locally, using docker"
@echo "make unit-test-single-local : Run unit tests for a single config locally"
@echo "make unit-test-single-local-docker : Run unit tests for a single config locally, using docker"
@echo "make unit-test-all-local : Run all code tests locally"
@echo "make unit-test-all-local-docker : Run all code tests locally, using docker"
@echo "make setup-local-docker : Setup local docker using buildx"
@echo "" @echo ""
@echo "Options for testing:" @echo "Options for testing:"
@echo " TEST_TARGET Set when running tests-single-*, to select the" @echo " TEST_TARGET Set when running tests-single-*, to select the"
@@ -29,85 +21,49 @@ help:
@echo " run on GitHub CI" @echo " run on GitHub CI"
@echo " ONLY_TEST Limit tests to only those that contain this, or" @echo " ONLY_TEST Limit tests to only those that contain this, or"
@echo " the index of the test (1-based)" @echo " the index of the test (1-based)"
@echo " UNIT_TEST_CONFIG Set the name of the config from the test folder, without"
@echo " the leading number. Default is 'default'". Used with the
@echo " unit-test-single-* tasks"
@echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value" @echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value"
@echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:" @echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:"
@echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!" @echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!"
.PHONY: help
marlin:
./buildroot/bin/mftest -a
.PHONY: marlin
tests-single-ci: tests-single-ci:
export GIT_RESET_HARD=true export GIT_RESET_HARD=true
$(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) PLATFORMIO_BUILD_FLAGS=-DGITHUB_ACTION $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) PLATFORMIO_BUILD_FLAGS=-DGITHUB_ACTION
.PHONY: tests-single-ci
tests-single-local: tests-single-local:
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \ export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& run_tests . $(TEST_TARGET) "$(ONLY_TEST)" && run_tests . $(TEST_TARGET) "$(ONLY_TEST)"
.PHONY: tests-single-local
tests-single-local-docker: 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 @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi @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)" $(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: tests-all-local:
@python -c "import yaml" 2>/dev/null || (echo 'pyyaml module is not installed. Install it with "python -m pip install pyyaml"' && exit 1)
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \ export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& for TEST_TARGET in $$(python $(SCRIPTS_DIR)/get_test_targets.py) ; do \ && for TEST_TARGET in $$($(SCRIPTS_DIR)/get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
if [ "$$TEST_TARGET" = "linux_native" ] && [ "$$(uname)" = "Darwin" ]; then \ .PHONY: tests-all-local
echo "Skipping tests for $$TEST_TARGET on macOS" ; \
continue ; \
fi ; \
echo "Running tests for $$TEST_TARGET" ; \
run_tests . $$TEST_TARGET || exit 1 ; \
sleep 5; \
done
tests-all-local-docker: tests-all-local-docker:
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi @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) $(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
unit-test-single-local:
platformio run -t marlin_$(UNIT_TEST_CONFIG) -e linux_native_test
unit-test-single-local-docker:
@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 unit-test-single-local UNIT_TEST_CONFIG=$(UNIT_TEST_CONFIG)
unit-test-all-local:
platformio run -t test-marlin -e linux_native_test
unit-test-all-local-docker:
@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 unit-test-all-local
setup-local-docker: setup-local-docker:
$(CONTAINER_RT_BIN) buildx build -t $(CONTAINER_IMAGE) -f docker/Dockerfile . $(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
.PHONY: setup-local-docker
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h') PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
.PHONY: $(PINS) format-pins validate-pins .PHONY: $(PINS)
$(PINS): %: $(PINS): %:
@echo "Formatting $@" @echo "Formatting $@" && node buildroot/share/scripts/pinsformat.js $@
@python $(SCRIPTS_DIR)/pinsformat.py $< $@
format-pins: $(PINS) format-pins: $(PINS)
validate-pins: format-pins
@echo "Validating pins files"
@git diff --exit-code || (git status && echo "\nError: Pins files are not formatted correctly. Run \"make format-pins\" to fix.\n" && exit 1)
BOARDS_FILE := Marlin/src/core/boards.h
.PHONY: validate-boards
validate-boards:
@echo "Validating boards.h file"
@python $(SCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1)
+551 -380
View File
File diff suppressed because it is too large Load Diff
+558 -528
View File
File diff suppressed because it is too large Load Diff
+74 -105
View File
@@ -187,17 +187,6 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1033)
# RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan) # RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan)
else ifeq ($(HARDWARE_MOTHERBOARD),1034) else ifeq ($(HARDWARE_MOTHERBOARD),1034)
# RAMPS 1.6+ (Power outputs: Hotend, Fan, Bed)
else ifeq ($(HARDWARE_MOTHERBOARD),1035)
# RAMPS 1.6+ (Power outputs: Hotend0, Hotend1, Bed)
else ifeq ($(HARDWARE_MOTHERBOARD),1036)
# RAMPS 1.6+ (Power outputs: Hotend, Fan0, Fan1)
else ifeq ($(HARDWARE_MOTHERBOARD),1037)
# RAMPS 1.6+ (Power outputs: Hotend0, Hotend1, Fan)
else ifeq ($(HARDWARE_MOTHERBOARD),1038)
# RAMPS 1.6+ (Power outputs: Spindle, Controller Fan)
else ifeq ($(HARDWARE_MOTHERBOARD),1039)
# #
# RAMPS Derivatives - ATmega1280, ATmega2560 # RAMPS Derivatives - ATmega1280, ATmega2560
# #
@@ -232,113 +221,108 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1112)
else ifeq ($(HARDWARE_MOTHERBOARD),1113) else ifeq ($(HARDWARE_MOTHERBOARD),1113)
# BigTreeTech or BIQU KFB2.0 # BigTreeTech or BIQU KFB2.0
else ifeq ($(HARDWARE_MOTHERBOARD),1114) else ifeq ($(HARDWARE_MOTHERBOARD),1114)
# Zonestar zrib V2.0 (Chinese RAMPS replica) # zrib V2.0 (Chinese RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1115) else ifeq ($(HARDWARE_MOTHERBOARD),1115)
# Zonestar zrib V5.2 (Chinese RAMPS replica) # zrib V5.2 (Chinese RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1116) else ifeq ($(HARDWARE_MOTHERBOARD),1116)
# Zonestar zrib V5.3 (Chinese RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1117)
# Felix 2.0+ Electronics Board (RAMPS like) # Felix 2.0+ Electronics Board (RAMPS like)
else ifeq ($(HARDWARE_MOTHERBOARD),1118) else ifeq ($(HARDWARE_MOTHERBOARD),1117)
# Invent-A-Part RigidBoard # Invent-A-Part RigidBoard
else ifeq ($(HARDWARE_MOTHERBOARD),1119) else ifeq ($(HARDWARE_MOTHERBOARD),1118)
# Invent-A-Part RigidBoard V2 # Invent-A-Part RigidBoard V2
else ifeq ($(HARDWARE_MOTHERBOARD),1120) else ifeq ($(HARDWARE_MOTHERBOARD),1119)
# Sainsmart 2-in-1 board # Sainsmart 2-in-1 board
else ifeq ($(HARDWARE_MOTHERBOARD),1121) else ifeq ($(HARDWARE_MOTHERBOARD),1120)
# Ultimaker # Ultimaker
else ifeq ($(HARDWARE_MOTHERBOARD),1122) else ifeq ($(HARDWARE_MOTHERBOARD),1121)
# Ultimaker (Older electronics. Pre 1.5.4. This is rare) # Ultimaker (Older electronics. Pre 1.5.4. This is rare)
else ifeq ($(HARDWARE_MOTHERBOARD),1123) else ifeq ($(HARDWARE_MOTHERBOARD),1122)
MCU ?= atmega1280 MCU ?= atmega1280
PROG_MCU ?= m1280 PROG_MCU ?= m1280
# Azteeg X3 # Azteeg X3
else ifeq ($(HARDWARE_MOTHERBOARD),1124) else ifeq ($(HARDWARE_MOTHERBOARD),1123)
# Azteeg X3 Pro # Azteeg X3 Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1125) else ifeq ($(HARDWARE_MOTHERBOARD),1124)
# Ultimainboard 2.x (Uses TEMP_SENSOR 20) # Ultimainboard 2.x (Uses TEMP_SENSOR 20)
else ifeq ($(HARDWARE_MOTHERBOARD),1126) else ifeq ($(HARDWARE_MOTHERBOARD),1125)
# Rumba # Rumba
else ifeq ($(HARDWARE_MOTHERBOARD),1127) else ifeq ($(HARDWARE_MOTHERBOARD),1126)
# Raise3D N series Rumba derivative # Raise3D N series Rumba derivative
else ifeq ($(HARDWARE_MOTHERBOARD),1128) else ifeq ($(HARDWARE_MOTHERBOARD),1127)
# Rapide Lite 200 (v1, low-cost RUMBA clone with drv) # Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
else ifeq ($(HARDWARE_MOTHERBOARD),1129) else ifeq ($(HARDWARE_MOTHERBOARD),1128)
# Formbot T-Rex 2 Plus # Formbot T-Rex 2 Plus
else ifeq ($(HARDWARE_MOTHERBOARD),1130) else ifeq ($(HARDWARE_MOTHERBOARD),1129)
# Formbot T-Rex 3 # Formbot T-Rex 3
else ifeq ($(HARDWARE_MOTHERBOARD),1131) else ifeq ($(HARDWARE_MOTHERBOARD),1130)
# Formbot Raptor # Formbot Raptor
else ifeq ($(HARDWARE_MOTHERBOARD),1132) else ifeq ($(HARDWARE_MOTHERBOARD),1131)
# Formbot Raptor 2 # Formbot Raptor 2
else ifeq ($(HARDWARE_MOTHERBOARD),1133) else ifeq ($(HARDWARE_MOTHERBOARD),1132)
# bq ZUM Mega 3D # bq ZUM Mega 3D
else ifeq ($(HARDWARE_MOTHERBOARD),1134) else ifeq ($(HARDWARE_MOTHERBOARD),1133)
# MakeBoard Mini v2.1.2 by MicroMake # MakeBoard Mini v2.1.2 by MicroMake
else ifeq ($(HARDWARE_MOTHERBOARD),1135) else ifeq ($(HARDWARE_MOTHERBOARD),1134)
# TriGorilla Anycubic version 1.3-based on RAMPS EFB # TriGorilla Anycubic version 1.3-based on RAMPS EFB
else ifeq ($(HARDWARE_MOTHERBOARD),1136) else ifeq ($(HARDWARE_MOTHERBOARD),1135)
# ... Ver 1.4 # ... Ver 1.4
else ifeq ($(HARDWARE_MOTHERBOARD),1137) else ifeq ($(HARDWARE_MOTHERBOARD),1136)
# ... Rev 1.1 (new servo pin order) # ... Rev 1.1 (new servo pin order)
else ifeq ($(HARDWARE_MOTHERBOARD),1138) else ifeq ($(HARDWARE_MOTHERBOARD),1137)
# Creality: Ender-4, CR-8 # Creality: Ender-4, CR-8
else ifeq ($(HARDWARE_MOTHERBOARD),1139) else ifeq ($(HARDWARE_MOTHERBOARD),1138)
# Creality: CR10S, CR20, CR-X # Creality: CR10S, CR20, CR-X
else ifeq ($(HARDWARE_MOTHERBOARD),1140) else ifeq ($(HARDWARE_MOTHERBOARD),1139)
# Dagoma F5 # Dagoma F5
else ifeq ($(HARDWARE_MOTHERBOARD),1141) else ifeq ($(HARDWARE_MOTHERBOARD),1140)
# Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC)
else ifeq ($(HARDWARE_MOTHERBOARD),1142)
# FYSETC F6 1.3 # FYSETC F6 1.3
else ifeq ($(HARDWARE_MOTHERBOARD),1143) else ifeq ($(HARDWARE_MOTHERBOARD),1141)
# FYSETC F6 1.4 # FYSETC F6 1.4
else ifeq ($(HARDWARE_MOTHERBOARD),1144) else ifeq ($(HARDWARE_MOTHERBOARD),1142)
# Wanhao Duplicator i3 Plus # Wanhao Duplicator i3 Plus
else ifeq ($(HARDWARE_MOTHERBOARD),1145) else ifeq ($(HARDWARE_MOTHERBOARD),1143)
# VORON Design # VORON Design
else ifeq ($(HARDWARE_MOTHERBOARD),1146) else ifeq ($(HARDWARE_MOTHERBOARD),1144)
# Tronxy TRONXY-V3-1.0 # Tronxy TRONXY-V3-1.0
else ifeq ($(HARDWARE_MOTHERBOARD),1147) else ifeq ($(HARDWARE_MOTHERBOARD),1145)
# Z-Bolt X Series # Z-Bolt X Series
else ifeq ($(HARDWARE_MOTHERBOARD),1148) else ifeq ($(HARDWARE_MOTHERBOARD),1146)
# TT OSCAR # TT OSCAR
else ifeq ($(HARDWARE_MOTHERBOARD),1147)
# Overlord/Overlord Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1148)
# ADIMLab Gantry v1
else ifeq ($(HARDWARE_MOTHERBOARD),1149) else ifeq ($(HARDWARE_MOTHERBOARD),1149)
# BIQU Tango V1 # ADIMLab Gantry v2
else ifeq ($(HARDWARE_MOTHERBOARD),1150) else ifeq ($(HARDWARE_MOTHERBOARD),1150)
# MKS GEN L V2 # BIQU Tango V1
else ifeq ($(HARDWARE_MOTHERBOARD),1151) else ifeq ($(HARDWARE_MOTHERBOARD),1151)
# MKS GEN L V2.1 # MKS GEN L V2
else ifeq ($(HARDWARE_MOTHERBOARD),1152) else ifeq ($(HARDWARE_MOTHERBOARD),1152)
# Copymaster 3D # MKS GEN L V2.1
else ifeq ($(HARDWARE_MOTHERBOARD),1153) else ifeq ($(HARDWARE_MOTHERBOARD),1153)
# Ortur 4 # Copymaster 3D
else ifeq ($(HARDWARE_MOTHERBOARD),1154) else ifeq ($(HARDWARE_MOTHERBOARD),1154)
# Tenlog D3 Hero IDEX printer # Ortur 4
else ifeq ($(HARDWARE_MOTHERBOARD),1155) else ifeq ($(HARDWARE_MOTHERBOARD),1155)
# Tenlog D3, D5, D6 IDEX Printer # Tenlog D3 Hero IDEX printer
else ifeq ($(HARDWARE_MOTHERBOARD),1156) else ifeq ($(HARDWARE_MOTHERBOARD),1156)
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed) # Tenlog D3,5,6 Pro IDEX printers
else ifeq ($(HARDWARE_MOTHERBOARD),1157) else ifeq ($(HARDWARE_MOTHERBOARD),1157)
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed) # Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
else ifeq ($(HARDWARE_MOTHERBOARD),1158) else ifeq ($(HARDWARE_MOTHERBOARD),1158)
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed) # Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
else ifeq ($(HARDWARE_MOTHERBOARD),1159) else ifeq ($(HARDWARE_MOTHERBOARD),1159)
# Longer LK1 PRO / Alfawise U20 Pro (PRO version) # Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
else ifeq ($(HARDWARE_MOTHERBOARD),1160) else ifeq ($(HARDWARE_MOTHERBOARD),1160)
# Longer LKx PRO / Alfawise Uxx Pro (PRO version) # Longer LK1 PRO / Alfawise U20 Pro (PRO version)
else ifeq ($(HARDWARE_MOTHERBOARD),1161) else ifeq ($(HARDWARE_MOTHERBOARD),1161)
# Pxmalion Core I3 # Longer LKx PRO / Alfawise Uxx Pro (PRO version)
else ifeq ($(HARDWARE_MOTHERBOARD),1162) else ifeq ($(HARDWARE_MOTHERBOARD),1162)
# Panowin Cutlass (as found in the Panowin F1) # Zonestar zrib V5.3 (Chinese RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1163) else ifeq ($(HARDWARE_MOTHERBOARD),1163)
# Kodama Bardo V1.x (as found in the Kodama Trinus) # Pxmalion Core I3
else ifeq ($(HARDWARE_MOTHERBOARD),1164) else ifeq ($(HARDWARE_MOTHERBOARD),1164)
# XTLW MFF V1.0
else ifeq ($(HARDWARE_MOTHERBOARD),1165)
# XTLW MFF V2.0
else ifeq ($(HARDWARE_MOTHERBOARD),1166)
# #
# RAMBo and derivatives # RAMBo and derivatives
@@ -356,7 +340,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1203)
else ifeq ($(HARDWARE_MOTHERBOARD),1204) else ifeq ($(HARDWARE_MOTHERBOARD),1204)
# abee Scoovo X9H # abee Scoovo X9H
else ifeq ($(HARDWARE_MOTHERBOARD),1205) else ifeq ($(HARDWARE_MOTHERBOARD),1205)
# ThinkerV2 # Rambo ThinkerV2
else ifeq ($(HARDWARE_MOTHERBOARD),1206) else ifeq ($(HARDWARE_MOTHERBOARD),1206)
# #
@@ -399,40 +383,30 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1315)
else ifeq ($(HARDWARE_MOTHERBOARD),1316) else ifeq ($(HARDWARE_MOTHERBOARD),1316)
# Geeetech GT2560 Rev B for A10(M/T/D) # Geeetech GT2560 Rev B for A10(M/T/D)
else ifeq ($(HARDWARE_MOTHERBOARD),1317) else ifeq ($(HARDWARE_MOTHERBOARD),1317)
# Geeetech GT2560 Rev B for Mecreator2
else ifeq ($(HARDWARE_MOTHERBOARD),1318)
# Geeetech GT2560 Rev B for A20(M/T/D)
else ifeq ($(HARDWARE_MOTHERBOARD),1319)
# Geeetech GT2560 Rev B for A10(M/T/D) # Geeetech GT2560 Rev B for A10(M/T/D)
else ifeq ($(HARDWARE_MOTHERBOARD),1320) else ifeq ($(HARDWARE_MOTHERBOARD),1318)
# Geeetech GT2560 Rev B for Mecreator2
else ifeq ($(HARDWARE_MOTHERBOARD),1319)
# Geeetech GT2560 Rev B for A20(M/T/D) # Geeetech GT2560 Rev B for A20(M/T/D)
else ifeq ($(HARDWARE_MOTHERBOARD),1321) else ifeq ($(HARDWARE_MOTHERBOARD),1320)
# Einstart retrofit # Einstart retrofit
else ifeq ($(HARDWARE_MOTHERBOARD),1322) else ifeq ($(HARDWARE_MOTHERBOARD),1321)
# Wanhao 0ne+ i3 Mini # Wanhao 0ne+ i3 Mini
else ifeq ($(HARDWARE_MOTHERBOARD),1323) else ifeq ($(HARDWARE_MOTHERBOARD),1322)
# Overlord/Overlord Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1324)
# ADIMLab Gantry v1
else ifeq ($(HARDWARE_MOTHERBOARD),1325)
# ADIMLab Gantry v2
else ifeq ($(HARDWARE_MOTHERBOARD),1326)
# Leapfrog Xeed 2015 # Leapfrog Xeed 2015
else ifeq ($(HARDWARE_MOTHERBOARD),1327) else ifeq ($(HARDWARE_MOTHERBOARD),1323)
# PICA Shield (original version) # PICA Shield (original version)
else ifeq ($(HARDWARE_MOTHERBOARD),1328) else ifeq ($(HARDWARE_MOTHERBOARD),1324)
# PICA Shield (rev C or later) # PICA Shield (rev C or later)
else ifeq ($(HARDWARE_MOTHERBOARD),1329) else ifeq ($(HARDWARE_MOTHERBOARD),1325)
# Intamsys 4.0 (Funmat HT) # Intamsys 4.0 (Funmat HT)
else ifeq ($(HARDWARE_MOTHERBOARD),1330) else ifeq ($(HARDWARE_MOTHERBOARD),1326)
# Malyan M180 Mainboard Version 2 (no display function, direct G-code only) # Malyan M180 Mainboard Version 2 (no display function, direct G-code only)
else ifeq ($(HARDWARE_MOTHERBOARD),1331) else ifeq ($(HARDWARE_MOTHERBOARD),1327)
# Geeetech GT2560 Rev B for A20(M/T/D)
else ifeq ($(HARDWARE_MOTHERBOARD),1328)
# Mega controller & Protoneer CNC Shield V3.00 # Mega controller & Protoneer CNC Shield V3.00
else ifeq ($(HARDWARE_MOTHERBOARD),1332) else ifeq ($(HARDWARE_MOTHERBOARD),1329)
# WEEDO 62A board (TINA2, Monoprice Cadet, etc.)
else ifeq ($(HARDWARE_MOTHERBOARD),1333)
# Geeetech GT2560 V4.1B for A10(M/T/D)
else ifeq ($(HARDWARE_MOTHERBOARD),1334)
# #
# ATmega1281, ATmega2561 # ATmega1281, ATmega2561
@@ -466,7 +440,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1502)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega644p MCU ?= atmega644p
PROG_MCU ?= m644p PROG_MCU ?= m644p
# Melzi V2 # Melzi V2.0
else ifeq ($(HARDWARE_MOTHERBOARD),1503) else ifeq ($(HARDWARE_MOTHERBOARD),1503)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
@@ -476,38 +450,33 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1504)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
PROG_MCU ?= m1284p PROG_MCU ?= m1284p
# Melzi Creality3D (for CR-10 etc) # Melzi Creality3D board (for CR-10 etc)
else ifeq ($(HARDWARE_MOTHERBOARD),1505) else ifeq ($(HARDWARE_MOTHERBOARD),1505)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
PROG_MCU ?= m1284p PROG_MCU ?= m1284p
# Melzi Creality3D (for Ender-2) # Melzi Malyan M150 board
else ifeq ($(HARDWARE_MOTHERBOARD),1506) else ifeq ($(HARDWARE_MOTHERBOARD),1506)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
PROG_MCU ?= m1284p PROG_MCU ?= m1284p
# Melzi Malyan M150 # Tronxy X5S
else ifeq ($(HARDWARE_MOTHERBOARD),1507) else ifeq ($(HARDWARE_MOTHERBOARD),1507)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
PROG_MCU ?= m1284p PROG_MCU ?= m1284p
# Tronxy X5S # STB V1.1
else ifeq ($(HARDWARE_MOTHERBOARD),1508) else ifeq ($(HARDWARE_MOTHERBOARD),1508)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
PROG_MCU ?= m1284p PROG_MCU ?= m1284p
# STB V1.1 # Azteeg X1
else ifeq ($(HARDWARE_MOTHERBOARD),1509) else ifeq ($(HARDWARE_MOTHERBOARD),1509)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
PROG_MCU ?= m1284p PROG_MCU ?= m1284p
# Azteeg X1
else ifeq ($(HARDWARE_MOTHERBOARD),1510)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
PROG_MCU ?= m1284p
# Anet 1.0 (Melzi clone) # Anet 1.0 (Melzi clone)
else ifeq ($(HARDWARE_MOTHERBOARD),1511) else ifeq ($(HARDWARE_MOTHERBOARD),1510)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
PROG_MCU ?= m1284p PROG_MCU ?= m1284p
@@ -1026,7 +995,7 @@ extcoff: $(TARGET).elf
$(NM) -n $< > $@ $(NM) -n $< > $@
# Link: create ELF output file from library. # Link: create ELF output file from library.
LDFLAGS+= -Wl,-V
$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
$(Pecho) " CXX $@" $(Pecho) " CXX $@"
$P $(CXX) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX) $P $(CXX) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
+1 -1
View File
@@ -2,7 +2,7 @@
Marlin Firmware Marlin Firmware
(c) 2011-2024 MarlinFirmware (c) 2011-2023 MarlinFirmware
Portions of Marlin are (c) by their respective authors. Portions of Marlin are (c) by their respective authors.
All code complies with GPLv2 and/or GPLv3 All code complies with GPLv2 and/or GPLv3
+3 -10
View File
@@ -41,14 +41,7 @@
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
//#define STRING_DISTRIBUTION_DATE "2025-03-18" //#define STRING_DISTRIBUTION_DATE "2024-01-09"
/**
* The protocol for communication to the host. Protocol indicates communication
* standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc.
* (Other behaviors are given by the firmware version and capabilities report.)
*/
//#define PROTOCOL_VERSION "1.0"
/** /**
* Defines a generic printer name to be output to the LCD after booting Marlin. * Defines a generic printer name to be output to the LCD after booting Marlin.
@@ -75,8 +68,8 @@
//#define WEBSITE_URL "marlinfw.org" //#define WEBSITE_URL "marlinfw.org"
/** /**
* Set the vendor info the serial USB interface, if changeable. * Set the vendor info the serial USB interface, if changable
* Currently only supported by DUE platform. * Currently only supported by DUE platform
*/ */
//#define USB_DEVICE_VENDOR_ID 0x0000 //#define USB_DEVICE_VENDOR_ID 0x0000
//#define USB_DEVICE_PRODUCT_ID 0x0000 //#define USB_DEVICE_PRODUCT_ID 0x0000
+103
View File
@@ -0,0 +1,103 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Custom Bitmap for splashscreen
*
* You may use one of the following tools to generate the C++ bitmap array from
* a black and white image:
*
* - http://www.marlinfw.org/tools/u8glib/converter.html
* - http://www.digole.com/tools/PicturetoC_Hex_converter.php
*/
#include <avr/pgmspace.h>
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
#define CUSTOM_BOOTSCREEN_BMPWIDTH 60
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
const unsigned char custom_start_bmp[574] PROGMEM = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x23, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x21, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x4c, 0x80, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x5e, 0x80, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x92, 0x40, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xa1, 0x40, 0x0, 0x0, 0x0,
0x0, 0x0, 0x1, 0x21, 0x20, 0x0, 0x0, 0x0,
0x0, 0x0, 0x2, 0x7f, 0x90, 0x0, 0x0, 0x0,
0x0, 0x0, 0x2, 0x0, 0x10, 0x0, 0x0, 0x0,
0x0, 0x0, 0x7, 0xff, 0xf8, 0x0, 0x0, 0x0,
0x0, 0x0, 0x4, 0x0, 0x8, 0x0, 0x0, 0x0,
0x0, 0x0, 0x8, 0x0, 0x4, 0x0, 0x0, 0x0,
0x0, 0x0, 0x8, 0x0, 0x6, 0x0, 0x0, 0x0,
0x0, 0x0, 0x10, 0x0, 0x2, 0x0, 0x0, 0x0,
0x0, 0x0, 0x30, 0x1e, 0x1, 0x0, 0x0, 0x0,
0x0, 0x0, 0x20, 0x7f, 0x81, 0x0, 0x0, 0x0,
0x0, 0x0, 0x41, 0xff, 0xe0, 0x80, 0x0, 0x0,
0x0, 0x0, 0x43, 0xfc, 0xf0, 0x80, 0x0, 0x0,
0x0, 0x0, 0x87, 0x3b, 0x78, 0x40, 0x0, 0x0,
0x0, 0x1, 0x8e, 0xdb, 0xfc, 0x60, 0x0, 0x0,
0x0, 0x1, 0xf, 0xeb, 0xcc, 0x20, 0x0, 0x0,
0x0, 0x2, 0x1f, 0xed, 0xb6, 0x10, 0x0, 0x0,
0x0, 0x2, 0x1f, 0xde, 0xb6, 0x10, 0x0, 0x0,
0x0, 0x4, 0x39, 0xcd, 0x7f, 0x8, 0x0, 0x0,
0x0, 0x4, 0x36, 0xe0, 0xff, 0x8, 0x0, 0x0,
0x0, 0x8, 0x7e, 0xc0, 0xbb, 0x84, 0x0, 0x0,
0x0, 0x18, 0x7f, 0x0, 0x5d, 0x86, 0x0, 0x0,
0x0, 0x10, 0x7f, 0xc0, 0xed, 0x82, 0x0, 0x0,
0x0, 0x20, 0x3c, 0xc0, 0x73, 0x1, 0x0, 0x0,
0x0, 0x20, 0x3b, 0x33, 0x7f, 0x1, 0x0, 0x0,
0x0, 0x70, 0x1b, 0xe7, 0x7e, 0x3, 0x80, 0x0,
0x0, 0xc8, 0x1d, 0xee, 0xde, 0x4, 0xc0, 0x0,
0x0, 0x88, 0xf, 0xde, 0xdc, 0x4, 0x40, 0x0,
0x1, 0x24, 0xf, 0xdf, 0x3c, 0x9, 0x20, 0x0,
0x1, 0x26, 0x7, 0xdb, 0xf8, 0x19, 0x20, 0x0,
0x2, 0x72, 0x3, 0xe7, 0xf0, 0x13, 0x90, 0x0,
0x2, 0x51, 0x1, 0xff, 0xe0, 0x22, 0x90, 0x0,
0x4, 0x89, 0x0, 0x7f, 0x80, 0x24, 0x48, 0x0,
0x9, 0x4, 0x80, 0x1e, 0x0, 0x48, 0x24, 0x0,
0xb, 0xfe, 0x40, 0x0, 0x0, 0xdf, 0xf4, 0x0,
0x10, 0x0, 0x40, 0x0, 0x0, 0x80, 0x2, 0x0,
0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x10, 0x22, 0x10, 0x3c, 0x3c, 0xe, 0x1f, 0x0,
0x10, 0x22, 0x10, 0x4, 0x22, 0x11, 0x4, 0x0,
0x10, 0x22, 0x10, 0x8, 0x22, 0x11, 0x4, 0x0,
0x10, 0x22, 0x10, 0x8, 0x3c, 0x11, 0x4, 0x0,
0x10, 0x22, 0x10, 0x10, 0x22, 0x11, 0x4, 0x0,
0x10, 0x22, 0x10, 0x20, 0x22, 0x11, 0x4, 0x0,
0x1e, 0x1c, 0x1e, 0x3c, 0x3c, 0xe, 0x4, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};
+44 -41
View File
@@ -62,11 +62,6 @@ motherboard = BOARD_RAMPS_14_EFB
serial_port = 0 serial_port = 0
baudrate = 250000 baudrate = 250000
string_config_h_author = "(default from config.ini)"
capabilities_report = on
extended_capabilities_report = on
use_watchdog = on use_watchdog = on
thermal_protection_hotends = on thermal_protection_hotends = on
thermal_protection_hysteresis = 4 thermal_protection_hysteresis = 4
@@ -82,7 +77,9 @@ temp_sensor_0 = 1
temp_hysteresis = 3 temp_hysteresis = 3
heater_0_mintemp = 5 heater_0_mintemp = 5
heater_0_maxtemp = 275 heater_0_maxtemp = 275
preheat_1_temp_hotend = 180
bang_max = 255
pidtemp = on pidtemp = on
pid_k1 = 0.95 pid_k1 = 0.95
pid_max = 255 pid_max = 255
@@ -92,14 +89,6 @@ default_kp = 22.20
default_ki = 1.08 default_ki = 1.08
default_kd = 114.00 default_kd = 114.00
temp_sensor_bed = 1
bed_mintemp = 5
bed_maxtemp = 150
thermal_protection_bed = on
thermal_protection_bed_hysteresis = 2
thermal_protection_bed_period = 20
x_driver_type = A4988 x_driver_type = A4988
y_driver_type = A4988 y_driver_type = A4988
z_driver_type = A4988 z_driver_type = A4988
@@ -132,10 +121,10 @@ default_max_acceleration = { 3000, 3000, 100, 10000 }
homing_feedrate_mm_m = { (50*60), (50*60), (4*60) } homing_feedrate_mm_m = { (50*60), (50*60), (4*60) }
homing_bump_divisor = { 2, 2, 4 } homing_bump_divisor = { 2, 2, 4 }
x_enable_on = LOW x_enable_on = 0
y_enable_on = LOW y_enable_on = 0
z_enable_on = LOW z_enable_on = 0
e_enable_on = LOW e_enable_on = 0
invert_x_dir = false invert_x_dir = false
invert_y_dir = true invert_y_dir = true
@@ -147,6 +136,11 @@ step_state_x = HIGH
step_state_y = HIGH step_state_y = HIGH
step_state_z = HIGH step_state_z = HIGH
disable_x = off
disable_y = off
disable_z = off
disable_e = off
proportional_font_ratio = 1.0 proportional_font_ratio = 1.0
default_nominal_filament_dia = 1.75 default_nominal_filament_dia = 1.75
@@ -159,13 +153,18 @@ default_retract_acceleration = 3000
default_minimumfeedrate = 0.0 default_minimumfeedrate = 0.0
default_mintravelfeedrate = 0.0 default_mintravelfeedrate = 0.0
minimum_planner_speed = 0.05
min_steps_per_segment = 6 min_steps_per_segment = 6
default_minsegmenttime = 20000 default_minsegmenttime = 20000
[config:basic] [config:basic]
bed_overshoot = 10 bed_overshoot = 10
busy_while_heating = on busy_while_heating = on
default_ejerk = 5.0
default_keepalive_interval = 2 default_keepalive_interval = 2
default_leveling_fade_height = 0.0
disable_other_extruders = on
display_charset_hd44780 = JAPANESE
eeprom_boot_silent = on eeprom_boot_silent = on
eeprom_chitchat = on eeprom_chitchat = on
endstoppullups = on endstoppullups = on
@@ -174,8 +173,10 @@ extrude_mintemp = 170
host_keepalive_feature = on host_keepalive_feature = on
hotend_overshoot = 15 hotend_overshoot = 15
jd_handle_small_segments = on jd_handle_small_segments = on
lcd_info_screen_style = 0
lcd_language = en
max_bed_power = 255 max_bed_power = 255
mesh_inset = 0
min_software_endstops = on min_software_endstops = on
max_software_endstops = on max_software_endstops = on
min_software_endstop_x = on min_software_endstop_x = on
@@ -184,48 +185,50 @@ min_software_endstop_z = on
max_software_endstop_x = on max_software_endstop_x = on
max_software_endstop_y = on max_software_endstop_y = on
max_software_endstop_z = on max_software_endstop_z = on
preheat_1_label = "PLA"
preheat_1_temp_hotend = 180
preheat_1_temp_bed = 70
preheat_1_fan_speed = 0 preheat_1_fan_speed = 0
preheat_1_label = "PLA"
preheat_2_label = "ABS" preheat_1_temp_bed = 70
preheat_2_temp_hotend = 240
preheat_2_temp_bed = 110
preheat_2_fan_speed = 0
prevent_cold_extrusion = on prevent_cold_extrusion = on
prevent_lengthy_extrude = on prevent_lengthy_extrude = on
printjob_timer_autostart = on printjob_timer_autostart = on
probing_margin = 10
show_bootscreen = on
soft_pwm_scale = 0
string_config_h_author = "(none, default config)"
temp_bed_hysteresis = 3 temp_bed_hysteresis = 3
temp_bed_residency_time = 10 temp_bed_residency_time = 10
temp_bed_window = 1 temp_bed_window = 1
temp_residency_time = 10 temp_residency_time = 10
temp_window = 1 temp_window = 1
validate_homing_endstops = on validate_homing_endstops = on
xy_probe_feedrate = (133*60)
editable_steps_per_unit = on z_clearance_between_probes = 5
z_clearance_deploy_probe = 10
z_clearance_multi_probe = 5
[config:advanced] [config:advanced]
arc_support = on arc_support = on
auto_report_temperatures = on auto_report_temperatures = on
autotemp = on autotemp = on
autotemp_min = 210
autotemp_max = 250
autotemp_factor = 0.1f
autotemp_oldweight = 0.98 autotemp_oldweight = 0.98
bed_check_interval = 5000
default_stepper_timeout_sec = 120 default_stepper_timeout_sec = 120
default_volumetric_extruder_limit = 0.00
disable_idle_x = on disable_idle_x = on
disable_idle_y = on disable_idle_y = on
disable_idle_z = on disable_idle_z = on
disable_idle_e = on disable_idle_e = on
e0_auto_fan_pin = -1 e0_auto_fan_pin = -1
encoder_100x_steps_per_sec = 80
encoder_10x_steps_per_sec = 30
encoder_rate_multiplier = on
extended_capabilities_report = on
extruder_auto_fan_speed = 255
extruder_auto_fan_temperature = 50
fanmux0_pin = -1
fanmux1_pin = -1
fanmux2_pin = -1
faster_gcode_parser = on faster_gcode_parser = on
debug_flags_gcode = on
homing_bump_mm = { 5, 5, 2 } homing_bump_mm = { 5, 5, 2 }
max_arc_segment_mm = 1.0 max_arc_segment_mm = 1.0
min_arc_segment_mm = 0.1 min_arc_segment_mm = 0.1
@@ -234,11 +237,11 @@ n_arc_correction = 25
serial_overrun_protection = on serial_overrun_protection = on
slowdown = on slowdown = on
slowdown_divisor = 2 slowdown_divisor = 2
temp_sensor_bed = 0
thermal_protection_bed_hysteresis = 2
thermocouple_max_errors = 15
tx_buffer_size = 0 tx_buffer_size = 0
bed_check_interval = 5000
watch_bed_temp_increase = 2 watch_bed_temp_increase = 2
watch_bed_temp_period = 60 watch_bed_temp_period = 60
watch_temp_increase = 2 watch_temp_increase = 2
watch_temp_period = 40 watch_temp_period = 20
-6
View File
@@ -81,12 +81,6 @@ void MarlinHAL::init() {
#if HAS_SERVO_3 #if HAS_SERVO_3
OUT_WRITE(SERVO3_PIN, LOW); OUT_WRITE(SERVO3_PIN, LOW);
#endif #endif
#if HAS_SERVO_4
OUT_WRITE(SERVO4_PIN, LOW);
#endif
#if HAS_SERVO_5
OUT_WRITE(SERVO5_PIN, LOW);
#endif
init_pwm_timers(); // Init user timers to default frequency - 1000HZ init_pwm_timers(); // Init user timers to default frequency - 1000HZ
+6 -6
View File
@@ -129,11 +129,11 @@ typedef Servo hal_servo_t;
#endif #endif
#endif #endif
#ifdef MMU_SERIAL_PORT #ifdef MMU2_SERIAL_PORT
#if !WITHIN(MMU_SERIAL_PORT, 0, 3) #if !WITHIN(MMU2_SERIAL_PORT, 0, 3)
#error "MMU_SERIAL_PORT must be from 0 to 3" #error "MMU2_SERIAL_PORT must be from 0 to 3"
#endif #endif
#define MMU_SERIAL mmuSerial #define MMU2_SERIAL mmuSerial
#endif #endif
#ifdef LCD_SERIAL_PORT #ifdef LCD_SERIAL_PORT
@@ -141,7 +141,7 @@ typedef Servo hal_servo_t;
#error "LCD_SERIAL_PORT must be from 0 to 3." #error "LCD_SERIAL_PORT must be from 0 to 3."
#endif #endif
#define LCD_SERIAL lcdSerial #define LCD_SERIAL lcdSerial
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI) #if HAS_DGUS_LCD
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free() #define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
#endif #endif
#endif #endif
@@ -159,7 +159,7 @@ typedef Servo hal_servo_t;
#define GET_PIN_MAP_INDEX(pin) pin #define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
#define HAL_SENSITIVE_PINS 0, 1 #define HAL_SENSITIVE_PINS 0, 1,
#ifdef __AVR_AT90USB1286__ #ifdef __AVR_AT90USB1286__
#define JTAG_DISABLE() do{ MCUCR = 0x80; MCUCR = 0x80; }while(0) #define JTAG_DISABLE() do{ MCUCR = 0x80; MCUCR = 0x80; }while(0)
+2
View File
@@ -119,6 +119,7 @@ void spiBegin() {
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
} }
/** begin spi transaction */ /** begin spi transaction */
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) {
// Based on Arduino SPI library // Based on Arduino SPI library
@@ -174,6 +175,7 @@ void spiBegin() {
SPSR = clockDiv | 0x01; SPSR = clockDiv | 0x01;
} }
#else // SOFTWARE_SPI || FORCE_SOFT_SPI #else // SOFTWARE_SPI || FORCE_SOFT_SPI
// ------------------------ // ------------------------
+8 -8
View File
@@ -601,20 +601,20 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
#endif // SERIAL_PORT_3 #endif // SERIAL_PORT_3
#ifdef MMU_SERIAL_PORT #ifdef MMU2_SERIAL_PORT
ISR(SERIAL_REGNAME(USART, MMU_SERIAL_PORT, _RX_vect)) { ISR(SERIAL_REGNAME(USART, MMU2_SERIAL_PORT, _RX_vect)) {
MarlinSerial<MMU2SerialCfg<MMU_SERIAL_PORT>>::store_rxd_char(); MarlinSerial<MMU2SerialCfg<MMU2_SERIAL_PORT>>::store_rxd_char();
} }
ISR(SERIAL_REGNAME(USART, MMU_SERIAL_PORT, _UDRE_vect)) { ISR(SERIAL_REGNAME(USART, MMU2_SERIAL_PORT, _UDRE_vect)) {
MarlinSerial<MMU2SerialCfg<MMU_SERIAL_PORT>>::_tx_udr_empty_irq(); MarlinSerial<MMU2SerialCfg<MMU2_SERIAL_PORT>>::_tx_udr_empty_irq();
} }
template class MarlinSerial< MMU2SerialCfg<MMU_SERIAL_PORT> >; template class MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> >;
MSerialMMU2 mmuSerial(MSerialMMU2::HasEmergencyParser); MSerialMMU2 mmuSerial(MSerialMMU2::HasEmergencyParser);
#endif // MMU_SERIAL_PORT #endif // MMU2_SERIAL_PORT
#ifdef LCD_SERIAL_PORT #ifdef LCD_SERIAL_PORT
@@ -629,7 +629,7 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >; template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser); MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI) #if HAS_DGUS_LCD
template<typename Cfg> template<typename Cfg>
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() { typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send. const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
+3 -3
View File
@@ -205,7 +205,7 @@
static ring_buffer_pos_t available(); static ring_buffer_pos_t available();
static void write(const uint8_t c); static void write(const uint8_t c);
static void flushTX(); static void flushTX();
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI) #if HAS_DGUS_LCD
static ring_buffer_pos_t get_tx_buffer_free(); static ring_buffer_pos_t get_tx_buffer_free();
#endif #endif
@@ -246,7 +246,7 @@
#endif // !USBCON #endif // !USBCON
#ifdef MMU_SERIAL_PORT #ifdef MMU2_SERIAL_PORT
template <uint8_t serial> template <uint8_t serial>
struct MMU2SerialCfg { struct MMU2SerialCfg {
static constexpr int PORT = serial; static constexpr int PORT = serial;
@@ -260,7 +260,7 @@
static constexpr bool RX_OVERRUNS = false; static constexpr bool RX_OVERRUNS = false;
}; };
typedef Serial1Class< MarlinSerial< MMU2SerialCfg<MMU_SERIAL_PORT> > > MSerialMMU2; typedef Serial1Class< MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> > > MSerialMMU2;
extern MSerialMMU2 mmuSerial; extern MSerialMMU2 mmuSerial;
#endif #endif
+1
View File
@@ -63,6 +63,7 @@
static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval) static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval)
/************ static functions common to all instances ***********************/ /************ static functions common to all instances ***********************/
static inline void handle_interrupts(const timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) { static inline void handle_interrupts(const timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) {
+3 -3
View File
@@ -35,14 +35,14 @@
#ifndef MARLIN_EEPROM_SIZE #ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1) #define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif #endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
bool PersistentStore::access_start() { return true; } bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; } bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0; uint16_t written = 0;
while (size--) { while (size--) {
uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t * const p = (uint8_t * const)pos;
uint8_t v = *value; uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v); eeprom_write_byte(p, v);
@@ -61,7 +61,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do { do {
const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing) *value = c; if (writing) *value = c;
crc16(crc, &c, 1); crc16(crc, &c, 1);
pos++; pos++;
+1 -8
View File
@@ -91,6 +91,7 @@ void endstop_ISR() { endstops.update(); }
#endif #endif
// Install Pin change interrupt for a pin. Can be called multiple times. // Install Pin change interrupt for a pin. Can be called multiple times.
void pciSetup(const int8_t pin) { void pciSetup(const int8_t pin) {
if (digitalPinHasPCICR(pin)) { if (digitalPinHasPCICR(pin)) {
@@ -345,14 +346,6 @@ void setup_endstop_interrupts() {
pciSetup(Z_MIN_PROBE_PIN); pciSetup(Z_MIN_PROBE_PIN);
#endif #endif
#endif #endif
#if USE_CALIBRATION
#if (digitalPinToInterrupt(CALIBRATION_PIN) != NOT_AN_INTERRUPT)
_ATTACH(CALIBRATION_PIN);
#else
static_assert(digitalPinHasPCICR(CALIBRATION_PIN), "CALIBRATION_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue.");
pciSetup(CALIBRATION_PIN);
#endif
#endif
// If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI. // If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI.
} }
+1 -1
View File
@@ -150,7 +150,7 @@ void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
else { else {
if (p == 32 || p == 128) continue; // Skip TIMER2 specific prescalers when not TIMER2 if (p == 32 || p == 128) continue; // Skip TIMER2 specific prescalers when not TIMER2
const uint16_t rft = (F_CPU) / (p * f_desired); 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); DEBUG_ECHOLNPGM("(Not Timer 2) F_CPU=" STRINGIFY(F_CPU), " prescaler=", p, " f_desired=", f_desired);
res_fast_temp = rft - 1; res_fast_temp = rft - 1;
res_pc_temp = rft / 2; res_pc_temp = rft / 2;
} }
+3
View File
@@ -28,6 +28,9 @@
* 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 * 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 * 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
* Analog Input : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 * Analog Input : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/ */
#include "../fastio.h" #include "../fastio.h"
+3
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 * 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 * 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" #include "../fastio.h"
+3
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 * 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 * 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" #include "../fastio.h"
+3
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 * 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 * 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 /** ATMega644
+5 -1
View File
@@ -26,7 +26,10 @@
* *
* 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 * 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 * 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
* Logical pins 46-47 aren't supported by Teensyduino, but are supported below as E2 and E3 * 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" #include "../fastio.h"
@@ -676,6 +679,7 @@
#define PF7_PWM 0 #define PF7_PWM 0
#define PF7_DDR DDRF #define PF7_DDR DDRF
/** /**
* Some of the pin mapping functions of the Teensduino extension to the Arduino IDE * Some of the pin mapping functions of the Teensduino extension to the Arduino IDE
* do not function the same as the other Arduino extensions. * do not function the same as the other Arduino extensions.
@@ -1,22 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 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
+32 -45
View File
@@ -22,23 +22,7 @@
#pragma once #pragma once
/** /**
* Pins Debugging for Atmel 8 bit AVR CPUs * PWM print routines for Atmel 8 bit AVR CPUs
*
* - NUMBER_PINS_TOTAL
* - MULTI_NAME_PAD
* - getPinByIndex(index)
* - printPinNameByIndex(index)
* - getPinIsDigitalByIndex(index)
* - digitalPinToAnalogIndex(pin)
* - getValidPinMode(pin)
* - isValidPin(pin)
* - isAnalogPin(pin)
* - digitalRead_mod(pin)
* - pwm_status(pin)
* - printPinPWM(pin)
* - printPinPort(pin)
* - printPinNumber(pin)
* - printPinAnalog(pin)
*/ */
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
@@ -55,44 +39,44 @@
#include "pinsDebug_Teensyduino.h" #include "pinsDebug_Teensyduino.h"
// Can't use the "digitalPinToPort" function from the Teensyduino type IDEs // Can't use the "digitalPinToPort" function from the Teensyduino type IDEs
// portModeRegister takes a different argument // portModeRegister takes a different argument
#define digitalPinToTimer_DEBUG(P) digitalPinToTimer(P) #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
#define digitalPinToBitMask_DEBUG(P) digitalPinToBitMask(P) #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
#define digitalPinToPort_DEBUG(P) digitalPinToPort(P) #define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
#define getValidPinMode(P) (*portModeRegister(P) & digitalPinToBitMask_DEBUG(P)) #define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin))
#elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70 #elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70
#include "pinsDebug_plus_70.h" #include "pinsDebug_plus_70.h"
#define digitalPinToTimer_DEBUG(P) digitalPinToTimer_plus_70(P) #define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p)
#define digitalPinToBitMask_DEBUG(P) digitalPinToBitMask_plus_70(P) #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p)
#define digitalPinToPort_DEBUG(P) digitalPinToPort_plus_70(P) #define digitalPinToPort_DEBUG(p) digitalPinToPort_plus_70(p)
bool getValidPinMode(pin_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
#else #else
#define digitalPinToTimer_DEBUG(P) digitalPinToTimer(P) #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
#define digitalPinToBitMask_DEBUG(P) digitalPinToBitMask(P) #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
#define digitalPinToPort_DEBUG(P) digitalPinToPort(P) #define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
bool getValidPinMode(pin_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
#define getPinByIndex(x) pgm_read_byte(&pin_array[x].pin) #define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
#endif #endif
#define isValidPin(P) (P >= 0 && P < NUMBER_PINS_TOTAL) #define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
#if AVR_ATmega1284_FAMILY #if AVR_ATmega1284_FAMILY
#define isAnalogPin(P) WITHIN(P, analogInputToDigitalPin(7), analogInputToDigitalPin(0)) #define IS_ANALOG(P) WITHIN(P, analogInputToDigitalPin(7), analogInputToDigitalPin(0))
#define digitalPinToAnalogIndex(P) int(isAnalogPin(P) ? (P) - analogInputToDigitalPin(7) : -1) #define DIGITAL_PIN_TO_ANALOG_PIN(P) int(IS_ANALOG(P) ? (P) - analogInputToDigitalPin(7) : -1)
#else #else
#define _ANALOG1(P) WITHIN(P, analogInputToDigitalPin(0), analogInputToDigitalPin(7)) #define _ANALOG1(P) WITHIN(P, analogInputToDigitalPin(0), analogInputToDigitalPin(7))
#define _ANALOG2(P) WITHIN(P, analogInputToDigitalPin(8), analogInputToDigitalPin(15)) #define _ANALOG2(P) WITHIN(P, analogInputToDigitalPin(8), analogInputToDigitalPin(15))
#define isAnalogPin(P) (_ANALOG1(P) || _ANALOG2(P)) #define IS_ANALOG(P) (_ANALOG1(P) || _ANALOG2(P))
#define digitalPinToAnalogIndex(P) int(_ANALOG1(P) ? (P) - analogInputToDigitalPin(0) : _ANALOG2(P) ? (P) - analogInputToDigitalPin(8) + 8 : -1) #define DIGITAL_PIN_TO_ANALOG_PIN(P) int(_ANALOG1(P) ? (P) - analogInputToDigitalPin(0) : _ANALOG2(P) ? (P) - analogInputToDigitalPin(8) + 8 : -1)
#endif #endif
#define getPinByIndex(x) pgm_read_byte(&pin_array[x].pin) #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 #define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin
void printPinNameByIndex(const uint8_t index) { void PRINT_ARRAY_NAME(uint8_t x) {
PGM_P const name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[index].name); PGM_P const name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name);
for (uint8_t y = 0; y < MAX_NAME_LENGTH; ++y) { for (uint8_t y = 0; y < MAX_NAME_LENGTH; ++y) {
char temp_char = pgm_read_byte(name_mem_pointer + y); char temp_char = pgm_read_byte(name_mem_pointer + y);
if (temp_char != 0) if (temp_char != 0)
@@ -104,7 +88,7 @@ void printPinNameByIndex(const uint8_t index) {
} }
} }
#define getPinIsDigitalByIndex(x) pgm_read_byte(&pin_array[x].is_digital) #define GET_ARRAY_IS_DIGITAL(x) pgm_read_byte(&pin_array[x].is_digital)
#if defined(__AVR_ATmega1284P__) // 1284 IDE extensions set this to the number of #if defined(__AVR_ATmega1284P__) // 1284 IDE extensions set this to the number of
#undef NUM_DIGITAL_PINS // digital only pins while all other CPUs have it #undef NUM_DIGITAL_PINS // digital only pins while all other CPUs have it
@@ -125,7 +109,7 @@ void printPinNameByIndex(const uint8_t index) {
* Print a pin's PWM status. * Print a pin's PWM status.
* Return true if it's currently a PWM pin. * Return true if it's currently a PWM pin.
*/ */
bool pwm_status(const uint8_t pin) { bool pwm_status(uint8_t pin) {
char buffer[20]; // for the sprintf statements char buffer[20]; // for the sprintf statements
switch (digitalPinToTimer_DEBUG(pin)) { switch (digitalPinToTimer_DEBUG(pin)) {
@@ -179,6 +163,7 @@ bool pwm_status(const uint8_t pin) {
SERIAL_ECHO_SP(2); SERIAL_ECHO_SP(2);
} // pwm_status } // pwm_status
const volatile uint8_t* const PWM_other[][3] PROGMEM = { const volatile uint8_t* const PWM_other[][3] PROGMEM = {
{ &TCCR0A, &TCCR0B, &TIMSK0 }, { &TCCR0A, &TCCR0B, &TIMSK0 },
{ &TCCR1A, &TCCR1B, &TIMSK1 }, { &TCCR1A, &TCCR1B, &TIMSK1 },
@@ -196,6 +181,7 @@ const volatile uint8_t* const PWM_other[][3] PROGMEM = {
#endif #endif
}; };
const volatile uint8_t* const PWM_OCR[][3] PROGMEM = { const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
#ifdef TIMER0A #ifdef TIMER0A
@@ -231,6 +217,7 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
#endif #endif
}; };
#define TCCR_A(T) pgm_read_word(&PWM_other[T][0]) #define TCCR_A(T) pgm_read_word(&PWM_other[T][0])
#define TCCR_B(T) pgm_read_word(&PWM_other[T][1]) #define TCCR_B(T) pgm_read_word(&PWM_other[T][1])
#define TIMSK(T) pgm_read_word(&PWM_other[T][2]) #define TIMSK(T) pgm_read_word(&PWM_other[T][2])
@@ -292,7 +279,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
if (TEST(*TMSK, TOIE)) err_prob_interrupt(); if (TEST(*TMSK, TOIE)) err_prob_interrupt();
} }
void printPinPWM(const uint8_t pin) { void pwm_details(uint8_t pin) {
switch (digitalPinToTimer_DEBUG(pin)) { switch (digitalPinToTimer_DEBUG(pin)) {
#if ABTEST(0) #if ABTEST(0)
@@ -363,7 +350,7 @@ void printPinPWM(const uint8_t pin) {
#else #else
UNUSED(print_is_also_tied); UNUSED(print_is_also_tied);
#endif #endif
} // printPinPWM } // pwm_details
#ifndef digitalRead_mod // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs #ifndef digitalRead_mod // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs
int digitalRead_mod(const pin_t pin) { // same as digitalRead except the PWM stop section has been removed int digitalRead_mod(const pin_t pin) { // same as digitalRead except the PWM stop section has been removed
@@ -372,7 +359,7 @@ void printPinPWM(const uint8_t pin) {
} }
#endif #endif
void printPinPort(const pin_t pin) { // print port number void print_port(const pin_t pin) { // print port number
#ifdef digitalPinToPort_DEBUG #ifdef digitalPinToPort_DEBUG
uint8_t x; uint8_t x;
SERIAL_ECHOPGM(" Port: "); SERIAL_ECHOPGM(" Port: ");
@@ -402,7 +389,7 @@ void printPinPort(const pin_t pin) { // print port number
#endif #endif
} }
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3d "), P); SERIAL_ECHO(buffer); }while(0) #define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0) #define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
#undef ABTEST #undef ABTEST
+1 -1
View File
@@ -102,7 +102,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
// digitalPinToBitMask(pin) is OK // digitalPinToBitMask(pin) is OK
#define digitalRead_mod(P) extDigitalRead(P) // Teensyduino's version of digitalRead doesn't #define digitalRead_mod(p) extDigitalRead(p) // Teensyduino's version of digitalRead doesn't
// disable the PWMs so we can use it as is // disable the PWMs so we can use it as is
// portModeRegister(pin) is OK // portModeRegister(pin) is OK
+26 -24
View File
@@ -23,41 +23,43 @@
/** /**
* Define SPI Pins: SCK, MISO, MOSI, SS * Define SPI Pins: SCK, MISO, MOSI, SS
* Platform pins have parentheses, e.g., "(53)", so we cannot use them.
*/ */
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
#define _PIN_SPI_SCK 13 #define AVR_SCK_PIN 13
#define _PIN_SPI_MISO 12 #define AVR_MISO_PIN 12
#define _PIN_SPI_MOSI 11 #define AVR_MOSI_PIN 11
#define _PIN_SPI_SS 10 #define AVR_SS_PIN 10
#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__) #elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
#define _PIN_SPI_SCK 7 #define AVR_SCK_PIN 7
#define _PIN_SPI_MISO 6 #define AVR_MISO_PIN 6
#define _PIN_SPI_MOSI 5 #define AVR_MOSI_PIN 5
#define _PIN_SPI_SS 4 #define AVR_SS_PIN 4
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
#define _PIN_SPI_SCK 52 #define AVR_SCK_PIN 52
#define _PIN_SPI_MISO 50 #define AVR_MISO_PIN 50
#define _PIN_SPI_MOSI 51 #define AVR_MOSI_PIN 51
#define _PIN_SPI_SS 53 #define AVR_SS_PIN 53
#elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) #elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
#define _PIN_SPI_SCK 21 #define AVR_SCK_PIN 21
#define _PIN_SPI_MISO 23 #define AVR_MISO_PIN 23
#define _PIN_SPI_MOSI 22 #define AVR_MOSI_PIN 22
#define _PIN_SPI_SS 20 #define AVR_SS_PIN 20
#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) #elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
#define _PIN_SPI_SCK 10 #define AVR_SCK_PIN 10
#define _PIN_SPI_MISO 12 #define AVR_MISO_PIN 12
#define _PIN_SPI_MOSI 11 #define AVR_MOSI_PIN 11
#define _PIN_SPI_SS 16 #define AVR_SS_PIN 16
#endif #endif
#ifndef SD_SCK_PIN #ifndef SD_SCK_PIN
#define SD_SCK_PIN _PIN_SPI_SCK #define SD_SCK_PIN AVR_SCK_PIN
#endif #endif
#ifndef SD_MISO_PIN #ifndef SD_MISO_PIN
#define SD_MISO_PIN _PIN_SPI_MISO #define SD_MISO_PIN AVR_MISO_PIN
#endif #endif
#ifndef SD_MOSI_PIN #ifndef SD_MOSI_PIN
#define SD_MOSI_PIN _PIN_SPI_MOSI #define SD_MOSI_PIN AVR_MOSI_PIN
#endif
#ifndef SD_SS_PIN
#define SD_SS_PIN AVR_SS_PIN
#endif #endif
@@ -120,7 +120,8 @@ void u8g_spiSend_sw_AVR_mode_3(uint8_t val) {
U8G_ATOMIC_END(); U8G_ATOMIC_END();
} }
#if U8G_SPI_USE_MODE_3
#if ENABLED(FYSETC_MINI_12864)
#define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_3 #define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_3
#else #else
#define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_0 #define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_0
@@ -143,9 +144,9 @@ uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
break; break;
case U8G_COM_MSG_CHIP_SELECT: case U8G_COM_MSG_CHIP_SELECT:
#if U8G_SPI_USE_MODE_3 // LCD SPI is running mode 3 while SD card is running mode 0 #if ENABLED(FYSETC_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0
if (arg_val) { // SCK idle state needs to be set to the proper idle state before if (arg_val) { // SCK idle state needs to be set to the proper idle state before
// the next chip select goes active // the next chip select goes active
u8g_com_arduino_digital_write(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active u8g_com_arduino_digital_write(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active
u8g_com_arduino_digital_write(u8g, U8G_PI_CS, LOW); u8g_com_arduino_digital_write(u8g, U8G_PI_CS, LOW);
} }
+1 -1
View File
@@ -48,7 +48,7 @@ uint16_t MarlinHAL::adc_result;
void MarlinHAL::init() { void MarlinHAL::init() {
#if HAS_MEDIA #if HAS_MEDIA
OUT_WRITE(SD_SS_PIN, HIGH); // Try to set SDSS inactive before any other SPI users start up OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
#endif #endif
usb_task_init(); // Initialize the USB stack usb_task_init(); // Initialize the USB stack
TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the min serial handler TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the min serial handler
+62 -4
View File
@@ -35,9 +35,67 @@
#include <stdint.h> #include <stdint.h>
// #include "../../core/serial_hook.h"
// Serial Ports
// // ------------------------
// Serial ports
// ------------------------
typedef ForwardSerial1Class< decltype(Serial) > DefaultSerial1;
typedef ForwardSerial1Class< decltype(Serial1) > DefaultSerial2;
typedef ForwardSerial1Class< decltype(Serial2) > DefaultSerial3;
typedef ForwardSerial1Class< decltype(Serial3) > DefaultSerial4;
extern DefaultSerial1 MSerial0;
extern DefaultSerial2 MSerial1;
extern DefaultSerial3 MSerial2;
extern DefaultSerial4 MSerial3;
#define _MSERIAL(X) MSerial##X
#define MSERIAL(X) _MSERIAL(X)
#if SERIAL_PORT == -1 || ENABLED(EMERGENCY_PARSER)
#define MYSERIAL1 customizedSerial1
#elif WITHIN(SERIAL_PORT, 0, 3)
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
#else
#error "The required SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
#endif
#ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == -1 || ENABLED(EMERGENCY_PARSER)
#define MYSERIAL2 customizedSerial2
#elif WITHIN(SERIAL_PORT_2, 0, 3)
#define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
#else
#error "SERIAL_PORT_2 must be from 0 to 3, or -1 for USB Serial."
#endif
#endif
#ifdef SERIAL_PORT_3
#if SERIAL_PORT_3 == -1 || ENABLED(EMERGENCY_PARSER)
#define MYSERIAL3 customizedSerial3
#elif WITHIN(SERIAL_PORT_3, 0, 3)
#define MYSERIAL3 MSERIAL(SERIAL_PORT_3)
#else
#error "SERIAL_PORT_3 must be from 0 to 3, or -1 for USB Serial."
#endif
#endif
#ifdef MMU2_SERIAL_PORT
#if WITHIN(MMU2_SERIAL_PORT, 0, 3)
#define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
#else
#error "MMU2_SERIAL_PORT must be from 0 to 3."
#endif
#endif
#ifdef LCD_SERIAL_PORT
#if WITHIN(LCD_SERIAL_PORT, 0, 3)
#define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
#else
#error "LCD_SERIAL_PORT must be from 0 to 3."
#endif
#endif
#include "MarlinSerial.h" #include "MarlinSerial.h"
#include "MarlinSerialUSB.h" #include "MarlinSerialUSB.h"
@@ -69,7 +127,7 @@ typedef Servo hal_servo_t;
#define HAL_ADC_RESOLUTION 10 #define HAL_ADC_RESOLUTION 10
#ifndef analogInputToDigitalPin #ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) pin_t((p < 12U) ? (p) + 54U : -1) #define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1)
#endif #endif
// //
+5 -4
View File
@@ -42,7 +42,7 @@
// Public functions // Public functions
// ------------------------ // ------------------------
#if ANY(SOFTWARE_SPI, FORCE_SOFT_SPI) #if ANY(DUE_SOFTWARE_SPI, FORCE_SOFT_SPI)
// ------------------------ // ------------------------
// Software SPI // Software SPI
@@ -600,8 +600,9 @@
OUT_WRITE(SPI_EEPROM1_CS_PIN, HIGH); OUT_WRITE(SPI_EEPROM1_CS_PIN, HIGH);
OUT_WRITE(SPI_EEPROM2_CS_PIN, HIGH); OUT_WRITE(SPI_EEPROM2_CS_PIN, HIGH);
OUT_WRITE(SPI_FLASH_CS_PIN, HIGH); OUT_WRITE(SPI_FLASH_CS_PIN, HIGH);
OUT_WRITE(SD_SS_PIN, HIGH); WRITE(SD_SS_PIN, HIGH);
WRITE(SD_SS_PIN, LOW);
OUT_WRITE(SDSS, LOW);
PIO_Configure( PIO_Configure(
g_APinDescription[SPI_PIN].pPort, g_APinDescription[SPI_PIN].pPort,
@@ -766,7 +767,7 @@
// Disable PIO on A26 and A27 // Disable PIO on A26 and A27
REG_PIOA_PDR = 0x0C000000; REG_PIOA_PDR = 0x0C000000;
OUT_WRITE(SD_SS_PIN, HIGH); OUT_WRITE(SDSS, HIGH);
// Reset SPI0 (from sam lib) // Reset SPI0 (from sam lib)
SPI0->SPI_CR = SPI_CR_SPIDIS; SPI0->SPI_CR = SPI_CR_SPIDIS;
+1
View File
@@ -474,6 +474,7 @@ void MarlinSerial<Cfg>::flushTX() {
} }
} }
// If not using the USB port as serial port // If not using the USB port as serial port
#if defined(SERIAL_PORT) && SERIAL_PORT >= 0 #if defined(SERIAL_PORT) && SERIAL_PORT >= 0
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT> >; template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT> >;
-15
View File
@@ -33,21 +33,6 @@
#include "../../core/types.h" #include "../../core/types.h"
#include "../../core/serial_hook.h" #include "../../core/serial_hook.h"
typedef ForwardSerial1Class< decltype(Serial) > DefaultSerial1;
typedef ForwardSerial1Class< decltype(Serial1) > DefaultSerial2;
typedef ForwardSerial1Class< decltype(Serial2) > DefaultSerial3;
typedef ForwardSerial1Class< decltype(Serial3) > DefaultSerial4;
extern DefaultSerial1 MSerial0;
extern DefaultSerial2 MSerial1;
extern DefaultSerial3 MSerial2;
extern DefaultSerial4 MSerial3;
#define SERIAL_INDEX_MIN 0
#define SERIAL_INDEX_MAX 3
#define EP_SERIAL_PORT(N) customizedSerial##N
#define USB_SERIAL_PORT(N) customizedSerial##N
#include "../shared/serial_ports.h"
// Define constants and variables for buffering incoming serial data. We're // Define constants and variables for buffering incoming serial data. We're
// using a ring buffer (I think), in which rx_buffer_head is the index of the // using a ring buffer (I think), in which rx_buffer_head is the index of the
// location to which to write the next incoming character and rx_buffer_tail // location to which to write the next incoming character and rx_buffer_tail
+1 -1
View File
@@ -50,7 +50,7 @@
static Flags<_Nbr_16timers> DisablePending; // ISR should disable the timer at the next timer reset static Flags<_Nbr_16timers> DisablePending; // ISR should disable the timer at the next timer reset
// ------------------------ // ------------------------
// Interrupt handler for the TC0 channel 1. /// Interrupt handler for the TC0 channel 1.
// ------------------------ // ------------------------
void Servo_Handler(const timer16_Sequence_t, Tc*, const uint8_t); void Servo_Handler(const timer16_Sequence_t, Tc*, const uint8_t);
+4 -4
View File
@@ -291,7 +291,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
uint32_t *p1 = (uint32_t*)addrflash; uint32_t *p1 = (uint32_t*)addrflash;
uint32_t *p2 = (uint32_t*)data; uint32_t *p2 = (uint32_t*)data;
int count = 0; int count = 0;
for (i = 0; i < PageSize >> 2; i++) { for (i =0; i<PageSize >> 2; i++) {
if (p1[i] != p2[i]) { if (p1[i] != p2[i]) {
uint32_t delta = p1[i] ^ p2[i]; uint32_t delta = p1[i] ^ p2[i];
while (delta) { while (delta) {
@@ -958,14 +958,14 @@ static void ee_Init() {
#ifndef MARLIN_EEPROM_SIZE #ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif #endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
bool PersistentStore::access_start() { ee_Init(); return true; } bool PersistentStore::access_start() { ee_Init(); return true; }
bool PersistentStore::access_finish() { ee_Flush(); return true; } bool PersistentStore::access_finish() { ee_Flush(); return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0; uint16_t written = 0;
while (size--) { while (size--) {
uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t * const p = (uint8_t * const)pos;
uint8_t v = *value; uint8_t v = *value;
if (v != ee_Read(uint32_t(p))) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! if (v != ee_Read(uint32_t(p))) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
ee_Write(uint32_t(p), v); ee_Write(uint32_t(p), v);
@@ -984,7 +984,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do { do {
uint8_t c = ee_Read(uint32_t(REAL_EEPROM_ADDR(pos))); uint8_t c = ee_Read(uint32_t(pos));
if (writing) *value = c; if (writing) *value = c;
crc16(crc, &c, 1); crc16(crc, &c, 1);
pos++; pos++;
+3 -3
View File
@@ -36,14 +36,14 @@
#ifndef MARLIN_EEPROM_SIZE #ifndef MARLIN_EEPROM_SIZE
#error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
#endif #endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; } bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0; uint16_t written = 0;
while (size--) { while (size--) {
uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t * const p = (uint8_t * const)pos;
uint8_t v = *value; uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v); eeprom_write_byte(p, v);
@@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do { do {
const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing) *value = c; if (writing) *value = c;
crc16(crc, &c, 1); crc16(crc, &c, 1);
pos++; pos++;
-1
View File
@@ -64,7 +64,6 @@ void setup_endstop_interrupts() {
TERN_(USE_Z4_MAX, _ATTACH(Z4_MAX_PIN)); TERN_(USE_Z4_MAX, _ATTACH(Z4_MAX_PIN));
TERN_(USE_Z4_MIN, _ATTACH(Z4_MIN_PIN)); TERN_(USE_Z4_MIN, _ATTACH(Z4_MIN_PIN));
TERN_(USE_Z_MIN_PROBE, _ATTACH(Z_MIN_PROBE_PIN)); TERN_(USE_Z_MIN_PROBE, _ATTACH(Z_MIN_PROBE_PIN));
TERN_(USE_CALIBRATION, _ATTACH(CALIBRATION_PIN));
TERN_(USE_I_MAX, _ATTACH(I_MAX_PIN)); TERN_(USE_I_MAX, _ATTACH(I_MAX_PIN));
TERN_(USE_I_MIN, _ATTACH(I_MIN_PIN)); TERN_(USE_I_MIN, _ATTACH(I_MIN_PIN));
TERN_(USE_J_MAX, _ATTACH(J_MAX_PIN)); TERN_(USE_J_MAX, _ATTACH(J_MAX_PIN));
+1 -1
View File
@@ -61,7 +61,7 @@
#else #else
#define G2_PWM_Z 0 #define G2_PWM_Z 0
#endif #endif
#if HAS_MOTOR_CURRENT_PWM_E #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#define G2_PWM_E 1 #define G2_PWM_E 1
#else #else
#define G2_PWM_E 0 #define G2_PWM_E 0
+1
View File
@@ -49,6 +49,7 @@ extern volatile uint32_t *SODR_A, *SODR_B, *CODR_A, *CODR_B;
#define PWM_MAP_INIT_ROW(IO,ZZ) { ZZ == 'A' ? SODR_A : SODR_B, ZZ == 'A' ? CODR_A : CODR_B, 1 << _PIN(IO) } #define PWM_MAP_INIT_ROW(IO,ZZ) { ZZ == 'A' ? SODR_A : SODR_B, ZZ == 'A' ? CODR_A : CODR_B, 1 << _PIN(IO) }
#define PWM_MAP_INIT { PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_X_PIN, 'B'), \ #define PWM_MAP_INIT { PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_X_PIN, 'B'), \
PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Y_PIN, 'B'), \ PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Y_PIN, 'B'), \
PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Z_PIN, 'B'), \ PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Z_PIN, 'B'), \
+1
View File
@@ -168,6 +168,7 @@ const G2_PinDescription G2_g_APinDescription[] = {
{ PIOB, PIO_PB21, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 52 { PIOB, PIO_PB21, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 52
{ PIOB, PIO_PB14, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 53 { PIOB, PIO_PB14, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 53
// 54 .. 65 - Analog pins // 54 .. 65 - Analog pins
// ---------------------- // ----------------------
{ PIOA, PIO_PA16X1_AD7, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC0, ADC7, NOT_ON_PWM, NOT_ON_TIMER }, // AD0 { PIOA, PIO_PA16X1_AD7, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC0, ADC7, NOT_ON_PWM, NOT_ON_TIMER }, // AD0
@@ -1,22 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 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
+7 -6
View File
@@ -68,15 +68,16 @@
* Usually the hardware SPI pins are only available to the LCD. This makes the DUE hard SPI used at the same time * Usually the hardware SPI pins are only available to the LCD. This makes the DUE hard SPI used at the same time
* as the TMC2130 soft SPI the most common setup. * as the TMC2130 soft SPI the most common setup.
*/ */
#define _IS_HW_SPI(P) (defined(TMC_SPI_##P) && (TMC_SPI_##P == SD_MOSI_PIN || TMC_SPI_##P == SD_MISO_PIN || TMC_SPI_##P == SD_SCK_PIN))
#if HAS_MEDIA && HAS_DRIVER(TMC2130) #if HAS_MEDIA && HAS_DRIVER(TMC2130)
#define _IS_HW_SPI(P) (defined(TMC_SPI_##P) && (TMC_SPI_##P == SD_MOSI_PIN || TMC_SPI_##P == SD_MISO_PIN || TMC_SPI_##P == SD_SCK_PIN)) #if ENABLED(TMC_USE_SW_SPI)
#if DISABLED(SOFTWARE_SPI) && ENABLED(TMC_USE_SW_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK)) #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
#error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs." #error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."
#endif #endif
#if ENABLED(SOFTWARE_SPI) && DISABLED(TMC_USE_SW_SPI) #elif ENABLED(DUE_SOFTWARE_SPI)
#error "DUE software SPI is required but is incompatible with TMC2130 hardware SPI. Enable TMC_USE_SW_SPI to fix." #error "DUE software SPI is required but is incompatible with TMC2130 hardware SPI. Enable TMC_USE_SW_SPI to fix."
#endif #endif
#undef _IS_HW_SPI
#endif #endif
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY #if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
+19 -32
View File
@@ -19,26 +19,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once
/** /**
* Pins Debugging for DUE * Support routines for Due
* */
* - NUMBER_PINS_TOTAL
* - MULTI_NAME_PAD /**
* - getPinByIndex(index) * Translation of routines & variables used by pinsDebug.h
* - printPinNameByIndex(index)
* - getPinIsDigitalByIndex(index)
* - digitalPinToAnalogIndex(pin)
* - getValidPinMode(pin)
* - isValidPin(pin)
* - isAnalogPin(pin)
* - digitalRead_mod(pin)
* - pwm_status(pin)
* - printPinPWM(pin)
* - printPinPort(pin)
* - printPinNumber(pin)
* - printPinAnalog(pin)
*/ */
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
@@ -76,20 +63,20 @@
#define NUMBER_PINS_TOTAL PINS_COUNT #define NUMBER_PINS_TOTAL PINS_COUNT
#define digitalRead_mod(P) extDigitalRead(P) // AVR digitalRead disabled PWM before it read the pin #define digitalRead_mod(p) extDigitalRead(p) // AVR digitalRead disabled PWM before it read the pin
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) #define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%02d"), P); SERIAL_ECHO(buffer); }while(0) #define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0) #define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
#define getPinByIndex(x) pin_array[x].pin #define GET_ARRAY_PIN(p) pin_array[p].pin
#define getPinIsDigitalByIndex(x) pin_array[x].is_digital #define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL)) #define VALID_PIN(pin) (pin >= 0 && pin < int8_t(NUMBER_PINS_TOTAL))
#define digitalPinToAnalogIndex(P) int(P - analogInputToDigitalPin(0)) #define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0))
#define isAnalogPin(P) WITHIN(P, pin_t(analogInputToDigitalPin(0)), pin_t(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1))) #define IS_ANALOG(P) WITHIN(P, char(analogInputToDigitalPin(0)), char(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
#define pwm_status(P) (((g_pinStatus[P] & 0xF) == PIN_STATUS_PWM) && \ #define pwm_status(pin) (((g_pinStatus[pin] & 0xF) == PIN_STATUS_PWM) && \
((g_APinDescription[P].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM)) ((g_APinDescription[pin].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM))
#define MULTI_NAME_PAD 14 // space needed to be pretty if not first name assigned to a pin #define MULTI_NAME_PAD 14 // space needed to be pretty if not first name assigned to a pin
bool getValidPinMode(const pin_t pin) { // 1: output, 0: input bool GET_PINMODE(int8_t pin) { // 1: output, 0: input
volatile Pio* port = g_APinDescription[pin].pPort; volatile Pio* port = g_APinDescription[pin].pPort;
uint32_t mask = g_APinDescription[pin].ulPin; uint32_t mask = g_APinDescription[pin].ulPin;
uint8_t pin_status = g_pinStatus[pin] & 0xF; uint8_t pin_status = g_pinStatus[pin] & 0xF;
@@ -98,14 +85,14 @@ bool getValidPinMode(const pin_t pin) { // 1: output, 0: input
|| pwm_status(pin)); || pwm_status(pin));
} }
void printPinPWM(const int32_t pin) { void pwm_details(int32_t pin) {
if (pwm_status(pin)) { if (pwm_status(pin)) {
uint32_t chan = g_APinDescription[pin].ulPWMChannel; uint32_t chan = g_APinDescription[pin].ulPWMChannel;
SERIAL_ECHOPGM("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY); SERIAL_ECHOPGM("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY);
} }
} }
void printPinPort(const pin_t) {} void print_port(const pin_t) {}
/** /**
* DUE Board pin | PORT | Label * DUE Board pin | PORT | Label
+29 -26
View File
@@ -24,38 +24,41 @@
/** /**
* Define SPI Pins: SCK, MISO, MOSI, SS * Define SPI Pins: SCK, MISO, MOSI, SS
* *
* Available chip select pins for HW SPI are 4 10 52 77 87 * Available chip select pins for HW SPI are 4 10 52 77
*/ */
#if SD_SS_PIN == 4 || SD_SS_PIN == 10 || SD_SS_PIN == 52 || SD_SS_PIN == 77 || SD_SS_PIN == 87 #if SDSS == 4 || SDSS == 10 || SDSS == 52 || SDSS == 77 || SDSS == 87
#define SD_SCK_PIN 76 #if SDSS == 4
#define SD_MISO_PIN 74 #define SPI_PIN 87
#define SD_MOSI_PIN 75 #define SPI_CHAN 1
#endif #elif SDSS == 10
#define SPI_PIN 77
#if SD_SS_PIN == 4 #define SPI_CHAN 0
#define SPI_PIN 87 #elif SDSS == 52
#define SPI_CHAN 1 #define SPI_PIN 86
#elif SD_SS_PIN == 10 #define SPI_CHAN 2
#define SPI_PIN 77 #elif SDSS == 77
#define SPI_CHAN 0 #define SPI_PIN 77
#elif SD_SS_PIN == 52 #define SPI_CHAN 0
#define SPI_PIN 86 #else
#define SPI_CHAN 2 #define SPI_PIN 87
#elif SD_SS_PIN == 77 #define SPI_CHAN 1
#define SPI_PIN 77 #endif
#define SPI_CHAN 0 #define SD_SCK_PIN 76
#elif SD_SS_PIN == 87 #define SD_MISO_PIN 74
#define SPI_PIN 87 #define SD_MOSI_PIN 75
#define SPI_CHAN 1
#else #else
#define SOFTWARE_SPI // defaults
#define DUE_SOFTWARE_SPI
#ifndef SD_SCK_PIN #ifndef SD_SCK_PIN
#define SD_SCK_PIN 52 #define SD_SCK_PIN 52
#endif #endif
#ifndef SD_MISO_PIN #ifndef SD_MISO_PIN
#define SD_MISO_PIN 50 #define SD_MISO_PIN 50
#endif #endif
#ifndef SD_MOSI_PIN #ifndef SD_MOSI_PIN
#define SD_MOSI_PIN 51 #define SD_MOSI_PIN 51
#endif #endif
#endif #endif
/* A.28, A.29, B.21, C.26, C.29 */
#define SD_SS_PIN SDSS
@@ -66,7 +66,7 @@
#include <U8glib-HAL.h> #include <U8glib-HAL.h>
#if U8G_SPI_USE_MODE_3 #if ENABLED(FYSETC_MINI_12864)
#define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_3 #define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_3
#else #else
#define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_0 #define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_0
@@ -96,15 +96,15 @@ uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
break; break;
case U8G_COM_MSG_CHIP_SELECT: case U8G_COM_MSG_CHIP_SELECT:
#if U8G_SPI_USE_MODE_3 // LCD SPI is running mode 3 while SD card is running mode 0 #if ENABLED(FYSETC_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0
if (arg_val) { // SCK idle state needs to be set to the proper idle state before if (arg_val) { // SCK idle state needs to be set to the proper idle state before
// the next chip select goes active // the next chip select goes active
u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 1); //set SCK to mode 3 idle state before CS goes active
u8g_SetPILevel_DUE(u8g, U8G_PI_CS, LOW); u8g_SetPILevel_DUE(u8g, U8G_PI_CS, LOW);
} }
else { else {
u8g_SetPILevel_DUE(u8g, U8G_PI_CS, HIGH); u8g_SetPILevel_DUE(u8g, U8G_PI_CS, HIGH);
u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 0); // Set SCK to mode 0 idle state after CS goes inactive u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 0); //set SCK to mode 0 idle state after CS goes inactive
} }
#else #else
u8g_SetPILevel_DUE(u8g, U8G_PI_CS, !arg_val); u8g_SetPILevel_DUE(u8g, U8G_PI_CS, !arg_val);
+1 -1
View File
@@ -11,7 +11,7 @@ if pioutil.is_pio_build():
if current_OS == 'Windows': if current_OS == 'Windows':
env = pioutil.env Import("env")
# Use bossac.exe on Windows # Use bossac.exe on Windows
env.Replace( env.Replace(
+11
View File
@@ -142,6 +142,7 @@
*/ */
#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) #define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack())
/** /**
* \brief Set aligned boundary. * \brief Set aligned boundary.
*/ */
@@ -282,6 +283,7 @@ typedef double F64; //!< 64-bit floating-point number.
typedef uint32_t iram_size_t; typedef uint32_t iram_size_t;
//! @} //! @}
/*! \name Status Types /*! \name Status Types
*/ */
//! @{ //! @{
@@ -289,6 +291,7 @@ typedef bool Status_bool_t; //!< Boolean status.
typedef U8 Status_t; //!< 8-bit-coded status. typedef U8 Status_t; //!< 8-bit-coded status.
//! @} //! @}
/*! \name Aliasing Aggregate Types /*! \name Aliasing Aggregate Types
*/ */
//! @{ //! @{
@@ -459,6 +462,7 @@ typedef struct
#endif #endif
//! @} //! @}
#ifndef __ASSEMBLY__ // not for assembling. #ifndef __ASSEMBLY__ // not for assembling.
//! \name Optimization Control //! \name Optimization Control
@@ -577,6 +581,7 @@ typedef struct
//! @} //! @}
/*! \name Zero-Bit Counting /*! \name Zero-Bit Counting
* *
* Under GCC, __builtin_clz and __builtin_ctz behave like macros when * Under GCC, __builtin_clz and __builtin_ctz behave like macros when
@@ -687,6 +692,7 @@ typedef struct
//! @} //! @}
/*! \name Bit Reversing /*! \name Bit Reversing
*/ */
//! @{ //! @{
@@ -726,6 +732,7 @@ typedef struct
//! @} //! @}
/*! \name Alignment /*! \name Alignment
*/ */
//! @{ //! @{
@@ -791,6 +798,7 @@ typedef struct
*/ */
#define Long_call(addr) ((*(void (*)(void))(addr))()) #define Long_call(addr) ((*(void (*)(void))(addr))())
/*! \name MCU Endianism Handling /*! \name MCU Endianism Handling
* ARM is MCU little endianism. * ARM is MCU little endianism.
*/ */
@@ -860,6 +868,7 @@ typedef struct
#define CPU_TO_BE32(x) swap32(x) #define CPU_TO_BE32(x) swap32(x)
//! @} //! @}
/*! \name Endianism Conversion /*! \name Endianism Conversion
* *
* The same considerations as for clz and ctz apply here but GCC's * The same considerations as for clz and ctz apply here but GCC's
@@ -946,6 +955,7 @@ typedef struct
//! @} //! @}
/*! \name Target Abstraction /*! \name Target Abstraction
*/ */
//! @{ //! @{
@@ -987,6 +997,7 @@ typedef U8 Byte; //!< 8-bit unsigned integer.
#endif // #ifndef __ASSEMBLY__ #endif // #ifndef __ASSEMBLY__
#ifdef __ICCARM__ #ifdef __ICCARM__
#define SHORTENUM __packed #define SHORTENUM __packed
#elif defined(__GNUC__) #elif defined(__GNUC__)
+2
View File
@@ -81,6 +81,7 @@
#define LUN_0_NAME "\"SD/MMC Card\"" #define LUN_0_NAME "\"SD/MMC Card\""
//! @} //! @}
/*! \name Actions Associated with Memory Accesses /*! \name Actions Associated with Memory Accesses
* *
* Write here the action to associate with each memory access. * Write here the action to associate with each memory access.
@@ -111,4 +112,5 @@
#define GLOBAL_WR_PROTECT false //!< Management of a global write protection. #define GLOBAL_WR_PROTECT false //!< Management of a global write protection.
//! @} //! @}
#endif // _CONF_ACCESS_H_ #endif // _CONF_ACCESS_H_
+1
View File
@@ -96,4 +96,5 @@
// - UPLL frequency: 480MHz // - UPLL frequency: 480MHz
// - USB clock: 480 / 1 = 480MHz // - USB clock: 480 / 1 = 480MHz
#endif /* CONF_CLOCK_H_INCLUDED */ #endif /* CONF_CLOCK_H_INCLUDED */
+4
View File
@@ -88,6 +88,7 @@
#endif #endif
//@} //@}
/** /**
* USB Device Callbacks definitions (Optional) * USB Device Callbacks definitions (Optional)
* @{ * @{
@@ -149,6 +150,7 @@
//@} //@}
/** /**
* USB Interface Configuration * USB Interface Configuration
* @{ * @{
@@ -208,6 +210,7 @@
//@} //@}
//@} //@}
/** /**
* Configuration of MSC interface * Configuration of MSC interface
* @{ * @{
@@ -242,6 +245,7 @@
//@} //@}
/** /**
* Description of Composite Device * Description of Composite Device
* @{ * @{
+28
View File
@@ -68,6 +68,7 @@
#endif #endif
#include "ctrl_access.h" #include "ctrl_access.h"
//_____ D E F I N I T I O N S ______________________________________________ //_____ D E F I N I T I O N S ______________________________________________
#ifdef FREERTOS_USED #ifdef FREERTOS_USED
@@ -111,6 +112,7 @@ static xSemaphoreHandle ctrl_access_semphr = NULL;
#endif // FREERTOS_USED #endif // FREERTOS_USED
#if MAX_LUN #if MAX_LUN
/*! \brief Initializes an entry of the LUN descriptor table. /*! \brief Initializes an entry of the LUN descriptor table.
@@ -240,14 +242,17 @@ static const struct
#endif #endif
#if GLOBAL_WR_PROTECT == true #if GLOBAL_WR_PROTECT == true
bool g_wr_protect; bool g_wr_protect;
#endif #endif
/*! \name Control Interface /*! \name Control Interface
*/ */
//! @{ //! @{
#ifdef FREERTOS_USED #ifdef FREERTOS_USED
bool ctrl_access_init(void) bool ctrl_access_init(void)
@@ -265,6 +270,7 @@ bool ctrl_access_init(void)
return true; return true;
} }
/*! \brief Locks accesses to LUNs. /*! \brief Locks accesses to LUNs.
* *
* \return \c true if the access was successfully locked, else \c false. * \return \c true if the access was successfully locked, else \c false.
@@ -282,6 +288,7 @@ static bool ctrl_access_lock(void)
#endif // FREERTOS_USED #endif // FREERTOS_USED
U8 get_nb_lun(void) U8 get_nb_lun(void)
{ {
#if MEM_USB == ENABLE #if MEM_USB == ENABLE
@@ -302,11 +309,13 @@ U8 get_nb_lun(void)
#endif #endif
} }
U8 get_cur_lun(void) U8 get_cur_lun(void)
{ {
return LUN_ID_0; return LUN_ID_0;
} }
Ctrl_status mem_test_unit_ready(U8 lun) Ctrl_status mem_test_unit_ready(U8 lun)
{ {
Ctrl_status status; Ctrl_status status;
@@ -328,6 +337,7 @@ Ctrl_status mem_test_unit_ready(U8 lun)
return status; return status;
} }
Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector) Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector)
{ {
Ctrl_status status; Ctrl_status status;
@@ -349,6 +359,7 @@ Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector)
return status; return status;
} }
U8 mem_sector_size(U8 lun) U8 mem_sector_size(U8 lun)
{ {
U8 sector_size; U8 sector_size;
@@ -370,6 +381,7 @@ U8 mem_sector_size(U8 lun)
return sector_size; return sector_size;
} }
bool mem_unload(U8 lun, bool unload) bool mem_unload(U8 lun, bool unload)
{ {
bool unloaded; bool unloaded;
@@ -421,6 +433,7 @@ bool mem_wr_protect(U8 lun)
return wr_protect; return wr_protect;
} }
bool mem_removal(U8 lun) bool mem_removal(U8 lun)
{ {
bool removal; bool removal;
@@ -445,6 +458,7 @@ bool mem_removal(U8 lun)
return removal; return removal;
} }
const char *mem_name(U8 lun) const char *mem_name(U8 lun)
{ {
#if MAX_LUN==0 #if MAX_LUN==0
@@ -461,14 +475,17 @@ const char *mem_name(U8 lun)
#endif #endif
} }
//! @} //! @}
#if ACCESS_USB == true #if ACCESS_USB == true
/*! \name MEM <-> USB Interface /*! \name MEM <-> USB Interface
*/ */
//! @{ //! @{
Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector) Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector)
{ {
Ctrl_status status; Ctrl_status status;
@@ -488,6 +505,7 @@ Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector)
return status; return status;
} }
Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector) Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector)
{ {
Ctrl_status status; Ctrl_status status;
@@ -507,16 +525,19 @@ Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector)
return status; return status;
} }
//! @} //! @}
#endif // ACCESS_USB == true #endif // ACCESS_USB == true
#if ACCESS_MEM_TO_RAM == true #if ACCESS_MEM_TO_RAM == true
/*! \name MEM <-> RAM Interface /*! \name MEM <-> RAM Interface
*/ */
//! @{ //! @{
Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram) Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram)
{ {
Ctrl_status status; Ctrl_status status;
@@ -543,6 +564,7 @@ Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram)
return status; return status;
} }
Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram) Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram)
{ {
Ctrl_status status; Ctrl_status status;
@@ -569,16 +591,19 @@ Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram)
return status; return status;
} }
//! @} //! @}
#endif // ACCESS_MEM_TO_RAM == true #endif // ACCESS_MEM_TO_RAM == true
#if ACCESS_STREAM == true #if ACCESS_STREAM == true
/*! \name Streaming MEM <-> MEM Interface /*! \name Streaming MEM <-> MEM Interface
*/ */
//! @{ //! @{
#if ACCESS_MEM_TO_MEM == true #if ACCESS_MEM_TO_MEM == true
#include "fat.h" #include "fat.h"
@@ -600,18 +625,21 @@ Ctrl_status stream_mem_to_mem(U8 src_lun, U32 src_addr, U8 dest_lun, U32 dest_ad
#endif // ACCESS_MEM_TO_MEM == true #endif // ACCESS_MEM_TO_MEM == true
Ctrl_status stream_state(U8 id) Ctrl_status stream_state(U8 id)
{ {
UNUSED(id); UNUSED(id);
return CTRL_GOOD; return CTRL_GOOD;
} }
U16 stream_stop(U8 id) U16 stream_stop(U8 id)
{ {
UNUSED(id); UNUSED(id);
return 0; return 0;
} }
//! @} //! @}
#endif // ACCESS_STREAM #endif // ACCESS_STREAM
+9
View File
@@ -56,6 +56,7 @@
* Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef _CTRL_ACCESS_H_ #ifndef _CTRL_ACCESS_H_
#define _CTRL_ACCESS_H_ #define _CTRL_ACCESS_H_
@@ -88,6 +89,7 @@ typedef enum
CTRL_BUSY = FAIL + 2 //!< Memory not initialized or changed. CTRL_BUSY = FAIL + 2 //!< Memory not initialized or changed.
} Ctrl_status; } Ctrl_status;
// FYI: Each Logical Unit Number (LUN) corresponds to a memory. // FYI: Each Logical Unit Number (LUN) corresponds to a memory.
// Check LUN defines. // Check LUN defines.
@@ -134,6 +136,7 @@ typedef enum
#define LUN_ID_USB (MAX_LUN) //!< First dynamic LUN (USB host mass storage). #define LUN_ID_USB (MAX_LUN) //!< First dynamic LUN (USB host mass storage).
//! @} //! @}
// Include LUN header files. // Include LUN header files.
#if LUN_0 == ENABLE #if LUN_0 == ENABLE
#include LUN_0_INCLUDE #include LUN_0_INCLUDE
@@ -163,11 +166,13 @@ typedef enum
#include LUN_USB_INCLUDE #include LUN_USB_INCLUDE
#endif #endif
// Check the configuration of write protection in conf_access.h. // Check the configuration of write protection in conf_access.h.
#ifndef GLOBAL_WR_PROTECT #ifndef GLOBAL_WR_PROTECT
#error GLOBAL_WR_PROTECT must be defined as true or false in conf_access.h #error GLOBAL_WR_PROTECT must be defined as true or false in conf_access.h
#endif #endif
#if GLOBAL_WR_PROTECT == true #if GLOBAL_WR_PROTECT == true
//! Write protect. //! Write protect.
@@ -175,6 +180,7 @@ extern bool g_wr_protect;
#endif #endif
/*! \name Control Interface /*! \name Control Interface
*/ */
//! @{ //! @{
@@ -273,6 +279,7 @@ extern const char *mem_name(U8 lun);
//! @} //! @}
#if ACCESS_USB == true #if ACCESS_USB == true
/*! \name MEM <-> USB Interface /*! \name MEM <-> USB Interface
@@ -303,6 +310,7 @@ extern Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector);
#endif // ACCESS_USB == true #endif // ACCESS_USB == true
#if ACCESS_MEM_TO_RAM == true #if ACCESS_MEM_TO_RAM == true
/*! \name MEM <-> RAM Interface /*! \name MEM <-> RAM Interface
@@ -333,6 +341,7 @@ extern Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram);
#endif // ACCESS_MEM_TO_RAM == true #endif // ACCESS_MEM_TO_RAM == true
#if ACCESS_STREAM == true #if ACCESS_STREAM == true
/*! \name Streaming MEM <-> MEM Interface /*! \name Streaming MEM <-> MEM Interface
+1
View File
@@ -57,6 +57,7 @@
#include "preprocessor.h" #include "preprocessor.h"
//! Maximal number of repetitions supported by MREPEAT. //! Maximal number of repetitions supported by MREPEAT.
#define MREPEAT_LIMIT 256 #define MREPEAT_LIMIT 256
+2
View File
@@ -128,6 +128,7 @@ static inline void osc_enable(uint32_t ul_id) {
pmc_switch_sclk_to_32kxtal(PMC_OSC_BYPASS); pmc_switch_sclk_to_32kxtal(PMC_OSC_BYPASS);
break; break;
case OSC_MAINCK_4M_RC: case OSC_MAINCK_4M_RC:
pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_4_MHz); pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_4_MHz);
break; break;
@@ -140,6 +141,7 @@ static inline void osc_enable(uint32_t ul_id) {
pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_12_MHz); pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_12_MHz);
break; break;
case OSC_MAINCK_XTAL: case OSC_MAINCK_XTAL:
pmc_switch_mainck_to_xtal(PMC_OSC_XTAL/*, pmc_switch_mainck_to_xtal(PMC_OSC_XTAL/*,
pmc_us_to_moscxtst(BOARD_OSC_STARTUP_US, pmc_us_to_moscxtst(BOARD_OSC_STARTUP_US,
+1
View File
@@ -51,4 +51,5 @@
#include "stringz.h" #include "stringz.h"
#include "mrepeat.h" #include "mrepeat.h"
#endif // _PREPROCESSOR_H_ #endif // _PREPROCESSOR_H_
+1
View File
@@ -86,6 +86,7 @@ enum scsi_sbc_mode {
SCSI_MS_MODE_CACHING = 0x08, //!< Caching mode page SCSI_MS_MODE_CACHING = 0x08, //!< Caching mode page
}; };
//! \name SBC-2 Device-Specific Parameter //! \name SBC-2 Device-Specific Parameter
//@{ //@{
#define SCSI_MS_SBC_WP 0x80 //!< Write Protected #define SCSI_MS_SBC_WP 0x80 //!< Write Protected
+16 -14
View File
@@ -18,32 +18,32 @@ extern "C" {
void sd_mmc_spi_mem_init() { void sd_mmc_spi_mem_init() {
} }
inline bool media_ready() {
return IS_SD_MOUNTED() && IS_SD_INSERTED() && !IS_SD_FILE_OPEN() && !IS_SD_PRINTING();
}
bool sd_mmc_spi_unload(bool) { return true; }
bool sd_mmc_spi_wr_protect() { return false; }
bool sd_mmc_spi_removal() { return !media_ready(); }
Ctrl_status sd_mmc_spi_test_unit_ready() { Ctrl_status sd_mmc_spi_test_unit_ready() {
#ifdef DISABLE_DUE_SD_MMC #ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
#endif #endif
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT; if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
return CTRL_GOOD; return CTRL_GOOD;
} }
// NOTE: This function is defined as returning the address of the last block // NOTE: This function is defined as returning the address of the last block
// in the card, which is cardSize() - 1 // in the card, which is cardSize() - 1
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) { Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT; if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
*nb_sector = card.diskIODriver()->cardSize() - 1; *nb_sector = card.diskIODriver()->cardSize() - 1;
return CTRL_GOOD; return CTRL_GOOD;
} }
bool sd_mmc_spi_unload(bool) { return true; }
bool sd_mmc_spi_wr_protect() { return false; }
bool sd_mmc_spi_removal() {
return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted());
}
#if ACCESS_USB == true #if ACCESS_USB == true
/** /**
* \name MEM <-> USB Interface * \name MEM <-> USB Interface
@@ -61,7 +61,8 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
#ifdef DISABLE_DUE_SD_MMC #ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
#endif #endif
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT; if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC #ifdef DEBUG_MMC
{ {
@@ -100,7 +101,8 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
#ifdef DISABLE_DUE_SD_MMC #ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
#endif #endif
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT; if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC #ifdef DEBUG_MMC
{ {
+13 -8
View File
@@ -45,6 +45,7 @@
* Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef _SD_MMC_SPI_MEM_H_ #ifndef _SD_MMC_SPI_MEM_H_
#define _SD_MMC_SPI_MEM_H_ #define _SD_MMC_SPI_MEM_H_
@@ -62,19 +63,22 @@
#error sd_mmc_spi_mem.h is #included although SD_MMC_SPI_MEM is disabled #error sd_mmc_spi_mem.h is #included although SD_MMC_SPI_MEM is disabled
#endif #endif
#include "ctrl_access.h" #include "ctrl_access.h"
//_____ D E F I N I T I O N S ______________________________________________ //_____ D E F I N I T I O N S ______________________________________________
#define SD_MMC_REMOVED 0 #define SD_MMC_REMOVED 0
#define SD_MMC_INSERTED 1 #define SD_MMC_INSERTED 1
#define SD_MMC_REMOVING 2 #define SD_MMC_REMOVING 2
//---- CONTROL FUNCTIONS ---- //---- CONTROL FUNCTIONS ----
//! //!
//! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI. //! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
//!/ //!/
void sd_mmc_spi_mem_init(); extern void sd_mmc_spi_mem_init(void);
//! //!
//! @brief This function tests the state of the SD_MMC memory and sends it to the Host. //! @brief This function tests the state of the SD_MMC memory and sends it to the Host.
@@ -87,7 +91,7 @@ void sd_mmc_spi_mem_init();
//! Media not present -> CTRL_NO_PRESENT //! Media not present -> CTRL_NO_PRESENT
//! Media has changed -> CTRL_BUSY //! Media has changed -> CTRL_BUSY
//!/ //!/
Ctrl_status sd_mmc_spi_test_unit_ready(); extern Ctrl_status sd_mmc_spi_test_unit_ready(void);
//! //!
//! @brief This function gives the address of the last valid sector. //! @brief This function gives the address of the last valid sector.
@@ -98,7 +102,7 @@ Ctrl_status sd_mmc_spi_test_unit_ready();
//! Media ready -> CTRL_GOOD //! Media ready -> CTRL_GOOD
//! Media not present -> CTRL_NO_PRESENT //! Media not present -> CTRL_NO_PRESENT
//!/ //!/
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector); extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
/*! \brief Unload/Load the SD/MMC card selected /*! \brief Unload/Load the SD/MMC card selected
* *
@@ -109,7 +113,7 @@ Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
* *
* \return \c true if unload/load done success. * \return \c true if unload/load done success.
*/ */
bool sd_mmc_spi_unload(bool unload); extern bool sd_mmc_spi_unload(bool unload);
//! //!
//! @brief This function returns the write protected status of the memory. //! @brief This function returns the write protected status of the memory.
@@ -120,14 +124,15 @@ bool sd_mmc_spi_unload(bool unload);
//! //!
//! @return false -> the memory is not write-protected (always) //! @return false -> the memory is not write-protected (always)
//!/ //!/
bool sd_mmc_spi_wr_protect(); extern bool sd_mmc_spi_wr_protect(void);
//! //!
//! @brief This function tells if the memory has been removed or not. //! @brief This function tells if the memory has been removed or not.
//! //!
//! @return false -> The memory isn't removed //! @return false -> The memory isn't removed
//! //!
bool sd_mmc_spi_removal(); extern bool sd_mmc_spi_removal(void);
//---- ACCESS DATA FUNCTIONS ---- //---- ACCESS DATA FUNCTIONS ----
@@ -147,7 +152,7 @@ bool sd_mmc_spi_removal();
//! It is ready -> CTRL_GOOD //! It is ready -> CTRL_GOOD
//! A error occur -> CTRL_FAIL //! A error occur -> CTRL_FAIL
//! //!
Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector); extern Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector);
//! This function initializes the SD/MMC memory for a write operation //! This function initializes the SD/MMC memory for a write operation
//! //!
@@ -161,7 +166,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector);
//! It is ready -> CTRL_GOOD //! It is ready -> CTRL_GOOD
//! An error occurs -> CTRL_FAIL //! An error occurs -> CTRL_FAIL
//! //!
Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector); extern Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector);
#endif // #if ACCESS_USB == true #endif // #if ACCESS_USB == true
+1
View File
@@ -212,6 +212,7 @@ extern "C" {
#define CONFIG_USBCLK_DIV #define CONFIG_USBCLK_DIV
#endif #endif
extern void sysclk_enable_usb(void); extern void sysclk_enable_usb(void);
extern void sysclk_disable_usb(void); extern void sysclk_disable_usb(void);
+1
View File
@@ -83,6 +83,7 @@ static usb_iface_desc_t UDC_DESC_STORAGE *udc_ptr_iface;
//! @} //! @}
//! \name Internal structure to store the USB device main strings //! \name Internal structure to store the USB device main strings
//! @{ //! @{
+2
View File
@@ -685,4 +685,6 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
} \endcode } \endcode
*/ */
#endif // _UDC_H_ #endif // _UDC_H_
+1
View File
@@ -213,6 +213,7 @@ void udd_send_remotewakeup(void);
*/ */
void udd_set_setup_payload( uint8_t *payload, uint16_t payload_size ); void udd_set_setup_payload( uint8_t *payload, uint16_t payload_size );
/** /**
* \name Endpoint Management * \name Endpoint Management
* *
+10
View File
@@ -457,6 +457,7 @@ void udi_cdc_data_sof_notify(void)
#endif #endif
} }
// ------------------------ // ------------------------
//------- Internal routines to control serial line //------- Internal routines to control serial line
@@ -519,6 +520,7 @@ static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask)
udi_cdc_ctrl_state_notify(port, ep_comm); udi_cdc_ctrl_state_notify(port, ep_comm);
} }
static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep) static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep)
{ {
#if UDI_CDC_PORT_NB == 1 // To optimize code #if UDI_CDC_PORT_NB == 1 // To optimize code
@@ -540,6 +542,7 @@ static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep)
} }
} }
static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
{ {
uint8_t port; uint8_t port;
@@ -575,9 +578,11 @@ static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n,
udi_cdc_ctrl_state_notify(port, ep); udi_cdc_ctrl_state_notify(port, ep);
} }
// ------------------------ // ------------------------
//------- Internal routines to process data transfer //------- Internal routines to process data transfer
static bool udi_cdc_rx_start(uint8_t port) static bool udi_cdc_rx_start(uint8_t port)
{ {
irqflags_t flags; irqflags_t flags;
@@ -627,6 +632,7 @@ static bool udi_cdc_rx_start(uint8_t port)
udi_cdc_data_received); udi_cdc_data_received);
} }
static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
{ {
uint8_t buf_sel_trans; uint8_t buf_sel_trans;
@@ -662,6 +668,7 @@ static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_
udi_cdc_rx_start(port); udi_cdc_rx_start(port);
} }
static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
{ {
uint8_t port; uint8_t port;
@@ -693,6 +700,7 @@ static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t
udi_cdc_tx_send(port); udi_cdc_tx_send(port);
} }
static void udi_cdc_tx_send(uint8_t port) static void udi_cdc_tx_send(uint8_t port)
{ {
irqflags_t flags; irqflags_t flags;
@@ -772,9 +780,11 @@ static void udi_cdc_tx_send(uint8_t port)
udi_cdc_data_sent); udi_cdc_data_sent);
} }
// ------------------------ // ------------------------
//------- Application interface //------- Application interface
//------- Application interface //------- Application interface
void udi_cdc_ctrl_signal_dcd(bool b_set) void udi_cdc_ctrl_signal_dcd(bool b_set)
+2
View File
@@ -106,6 +106,7 @@ typedef struct {
usb_ep_desc_t ep_notify; usb_ep_desc_t ep_notify;
} udi_cdc_comm_desc_t; } udi_cdc_comm_desc_t;
/** /**
* \brief Data Class interface descriptor * \brief Data Class interface descriptor
* *
@@ -120,6 +121,7 @@ typedef struct {
usb_ep_desc_t ep_out; usb_ep_desc_t ep_out;
} udi_cdc_data_desc_t; } udi_cdc_data_desc_t;
//! CDC communication endpoints size for all speeds //! CDC communication endpoints size for all speeds
#define UDI_CDC_COMM_EP_SIZE 64 #define UDI_CDC_COMM_EP_SIZE 64
//! CDC data endpoints size for FS speed (8B, 16B, 32B, 64B) //! CDC data endpoints size for FS speed (8B, 16B, 32B, 64B)
+1
View File
@@ -109,6 +109,7 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = {
.bNumConfigurations = 1 .bNumConfigurations = 1
}; };
#ifdef USB_DEVICE_HS_SUPPORT #ifdef USB_DEVICE_HS_SUPPORT
//! USB Device Qualifier Descriptor for HS //! USB Device Qualifier Descriptor for HS
COMPILER_WORD_ALIGNED COMPILER_WORD_ALIGNED
@@ -93,6 +93,7 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = {
.bNumConfigurations = 1 .bNumConfigurations = 1
}; };
#ifdef USB_DEVICE_HS_SUPPORT #ifdef USB_DEVICE_HS_SUPPORT
//! USB Device Qualifier Descriptor for HS //! USB Device Qualifier Descriptor for HS
COMPILER_WORD_ALIGNED COMPILER_WORD_ALIGNED
@@ -146,6 +147,7 @@ UDC_DESC_STORAGE udc_desc_t udc_desc_hs = {
}; };
#endif #endif
/** /**
* \name UDC structures which contains all USB Device definitions * \name UDC structures which contains all USB Device definitions
*/ */
+6
View File
@@ -86,6 +86,7 @@ UDC_DESC_STORAGE udi_api_t udi_api_msc = {
}; };
//@} //@}
/** /**
* \ingroup udi_msc_group * \ingroup udi_msc_group
* \defgroup udi_msc_group_internal Implementation of UDI MSC * \defgroup udi_msc_group_internal Implementation of UDI MSC
@@ -136,6 +137,7 @@ volatile bool udi_msc_b_reset_trans = true;
//@} //@}
/** /**
* \name Internal routines * \name Internal routines
*/ */
@@ -188,6 +190,7 @@ static void udi_msc_cbw_received(udd_ep_status_t status,
static bool udi_msc_cbw_validate(uint32_t alloc_len, uint8_t dir_flag); static bool udi_msc_cbw_validate(uint32_t alloc_len, uint8_t dir_flag);
//@} //@}
/** /**
* \name Routines to process small data packet * \name Routines to process small data packet
*/ */
@@ -214,6 +217,7 @@ static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent,
udd_ep_id_t ep); udd_ep_id_t ep);
//@} //@}
/** /**
* \name Routines to process CSW packet * \name Routines to process CSW packet
*/ */
@@ -246,6 +250,7 @@ static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent,
udd_ep_id_t ep); udd_ep_id_t ep);
//@} //@}
/** /**
* \name Routines manage sense data * \name Routines manage sense data
*/ */
@@ -302,6 +307,7 @@ static void udi_msc_sense_fail_cdb_invalid(void);
static void udi_msc_sense_command_invalid(void); static void udi_msc_sense_command_invalid(void);
//@} //@}
/** /**
* \name Routines manage SCSI Commands * \name Routines manage SCSI Commands
*/ */
@@ -293,6 +293,7 @@ do { \
# endif # endif
#endif #endif
/** /**
* \name Power management routine. * \name Power management routine.
*/ */
@@ -309,6 +310,7 @@ static bool udd_b_idle;
//! State of sleep manager //! State of sleep manager
static bool udd_b_sleep_initialized = false; static bool udd_b_sleep_initialized = false;
/*! \brief Authorize or not the CPU powerdown mode /*! \brief Authorize or not the CPU powerdown mode
* *
* \param b_enable true to authorize idle mode * \param b_enable true to authorize idle mode
@@ -336,6 +338,7 @@ static void udd_sleep_mode(bool b_idle)
//@} //@}
/** /**
* \name Control endpoint low level management routine. * \name Control endpoint low level management routine.
* *
@@ -407,6 +410,7 @@ static void udd_ctrl_send_zlp_out(void);
//! \brief Call callback associated to setup request //! \brief Call callback associated to setup request
static void udd_ctrl_endofrequest(void); static void udd_ctrl_endofrequest(void);
/** /**
* \brief Main interrupt routine for control endpoint * \brief Main interrupt routine for control endpoint
* *
@@ -418,6 +422,7 @@ static bool udd_ctrl_interrupt(void);
//@} //@}
/** /**
* \name Management of bulk/interrupt/isochronous endpoints * \name Management of bulk/interrupt/isochronous endpoints
* *
@@ -455,6 +460,7 @@ typedef struct {
uint8_t stall_requested:1; uint8_t stall_requested:1;
} udd_ep_job_t; } udd_ep_job_t;
//! Array to register a job on bulk/interrupt/isochronous endpoint //! Array to register a job on bulk/interrupt/isochronous endpoint
static udd_ep_job_t udd_ep_job[USB_DEVICE_MAX_EP]; static udd_ep_job_t udd_ep_job[USB_DEVICE_MAX_EP];
@@ -516,6 +522,7 @@ static bool udd_ep_interrupt(void);
#endif // (0!=USB_DEVICE_MAX_EP) #endif // (0!=USB_DEVICE_MAX_EP)
//@} //@}
// ------------------------ // ------------------------
//--- INTERNAL ROUTINES TO MANAGED GLOBAL EVENTS //--- INTERNAL ROUTINES TO MANAGED GLOBAL EVENTS
@@ -664,11 +671,13 @@ udd_interrupt_sof_end:
return; return;
} }
bool udd_include_vbus_monitoring(void) bool udd_include_vbus_monitoring(void)
{ {
return true; return true;
} }
void udd_enable(void) void udd_enable(void)
{ {
irqflags_t flags; irqflags_t flags;
@@ -755,6 +764,7 @@ void udd_enable(void)
cpu_irq_restore(flags); cpu_irq_restore(flags);
} }
void udd_disable(void) void udd_disable(void)
{ {
irqflags_t flags; irqflags_t flags;
@@ -856,6 +866,7 @@ void udd_attach(void)
cpu_irq_restore(flags); cpu_irq_restore(flags);
} }
void udd_detach(void) void udd_detach(void)
{ {
otg_unfreeze_clock(); otg_unfreeze_clock();
@@ -872,6 +883,7 @@ void udd_detach(void)
udd_sleep_mode(false); udd_sleep_mode(false);
} }
bool udd_is_high_speed(void) bool udd_is_high_speed(void)
{ {
#ifdef USB_DEVICE_HS_SUPPORT #ifdef USB_DEVICE_HS_SUPPORT
@@ -881,6 +893,7 @@ bool udd_is_high_speed(void)
#endif #endif
} }
void udd_set_address(uint8_t address) void udd_set_address(uint8_t address)
{ {
udd_disable_address(); udd_disable_address();
@@ -888,11 +901,13 @@ void udd_set_address(uint8_t address)
udd_enable_address(); udd_enable_address();
} }
uint8_t udd_getaddress(void) uint8_t udd_getaddress(void)
{ {
return udd_get_configured_address(); return udd_get_configured_address();
} }
uint16_t udd_get_frame_number(void) uint16_t udd_get_frame_number(void)
{ {
return udd_frame_number(); return udd_frame_number();
@@ -915,12 +930,14 @@ void udd_send_remotewakeup(void)
} }
} }
void udd_set_setup_payload(uint8_t *payload, uint16_t payload_size) void udd_set_setup_payload(uint8_t *payload, uint16_t payload_size)
{ {
udd_g_ctrlreq.payload = payload; udd_g_ctrlreq.payload = payload;
udd_g_ctrlreq.payload_size = payload_size; udd_g_ctrlreq.payload_size = payload_size;
} }
#if (0 != USB_DEVICE_MAX_EP) #if (0 != USB_DEVICE_MAX_EP)
bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes, bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes,
uint16_t MaxEndpointSize) uint16_t MaxEndpointSize)
@@ -1044,6 +1061,7 @@ bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes,
return true; return true;
} }
void udd_ep_free(udd_ep_id_t ep) void udd_ep_free(udd_ep_id_t ep)
{ {
uint8_t ep_index = ep & USB_EP_ADDR_MASK; uint8_t ep_index = ep & USB_EP_ADDR_MASK;
@@ -1056,12 +1074,14 @@ void udd_ep_free(udd_ep_id_t ep)
udd_ep_job[ep_index - 1].stall_requested = false; udd_ep_job[ep_index - 1].stall_requested = false;
} }
bool udd_ep_is_halted(udd_ep_id_t ep) bool udd_ep_is_halted(udd_ep_id_t ep)
{ {
uint8_t ep_index = ep & USB_EP_ADDR_MASK; uint8_t ep_index = ep & USB_EP_ADDR_MASK;
return Is_udd_endpoint_stall_requested(ep_index); return Is_udd_endpoint_stall_requested(ep_index);
} }
bool udd_ep_set_halt(udd_ep_id_t ep) bool udd_ep_set_halt(udd_ep_id_t ep)
{ {
uint8_t ep_index = ep & USB_EP_ADDR_MASK; uint8_t ep_index = ep & USB_EP_ADDR_MASK;
@@ -1102,6 +1122,7 @@ bool udd_ep_set_halt(udd_ep_id_t ep)
return true; return true;
} }
bool udd_ep_clear_halt(udd_ep_id_t ep) bool udd_ep_clear_halt(udd_ep_id_t ep)
{ {
uint8_t ep_index = ep & USB_EP_ADDR_MASK; uint8_t ep_index = ep & USB_EP_ADDR_MASK;
@@ -1142,6 +1163,7 @@ bool udd_ep_clear_halt(udd_ep_id_t ep)
return true; return true;
} }
bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket,
uint8_t * buf, iram_size_t buf_size, uint8_t * buf, iram_size_t buf_size,
udd_callback_trans_t callback) udd_callback_trans_t callback)
@@ -1208,6 +1230,7 @@ bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket,
#endif #endif
} }
void udd_ep_abort(udd_ep_id_t ep) void udd_ep_abort(udd_ep_id_t ep)
{ {
uint8_t ep_index = ep & USB_EP_ADDR_MASK; uint8_t ep_index = ep & USB_EP_ADDR_MASK;
@@ -1236,6 +1259,7 @@ void udd_ep_abort(udd_ep_id_t ep)
udd_ep_abort_job(ep); udd_ep_abort_job(ep);
} }
bool udd_ep_wait_stall_clear(udd_ep_id_t ep, bool udd_ep_wait_stall_clear(udd_ep_id_t ep,
udd_callback_halt_cleared_t callback) udd_callback_halt_cleared_t callback)
{ {
@@ -1270,6 +1294,7 @@ bool udd_ep_wait_stall_clear(udd_ep_id_t ep,
} }
#endif // (0 != USB_DEVICE_MAX_EP) #endif // (0 != USB_DEVICE_MAX_EP)
#ifdef USB_DEVICE_HS_SUPPORT #ifdef USB_DEVICE_HS_SUPPORT
void udd_test_mode_j(void) void udd_test_mode_j(void)
@@ -1278,17 +1303,20 @@ void udd_test_mode_j(void)
udd_enable_hs_test_mode_j(); udd_enable_hs_test_mode_j();
} }
void udd_test_mode_k(void) void udd_test_mode_k(void)
{ {
udd_enable_hs_test_mode(); udd_enable_hs_test_mode();
udd_enable_hs_test_mode_k(); udd_enable_hs_test_mode_k();
} }
void udd_test_mode_se0_nak(void) void udd_test_mode_se0_nak(void)
{ {
udd_enable_hs_test_mode(); udd_enable_hs_test_mode();
} }
void udd_test_mode_packet(void) void udd_test_mode_packet(void)
{ {
uint8_t i; uint8_t i;
@@ -1332,6 +1360,8 @@ void udd_test_mode_packet(void)
} }
#endif // USB_DEVICE_HS_SUPPORT #endif // USB_DEVICE_HS_SUPPORT
// ------------------------ // ------------------------
//--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT //--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT
@@ -1381,6 +1411,7 @@ static void udd_ctrl_init(void)
udd_ep_control_state = UDD_EPCTRL_SETUP; udd_ep_control_state = UDD_EPCTRL_SETUP;
} }
static void udd_ctrl_setup_received(void) static void udd_ctrl_setup_received(void)
{ {
irqflags_t flags; irqflags_t flags;
@@ -1442,6 +1473,7 @@ static void udd_ctrl_setup_received(void)
} }
} }
static void udd_ctrl_in_sent(void) static void udd_ctrl_in_sent(void)
{ {
static bool b_shortpacket = false; static bool b_shortpacket = false;
@@ -1525,6 +1557,7 @@ static void udd_ctrl_in_sent(void)
cpu_irq_restore(flags); cpu_irq_restore(flags);
} }
static void udd_ctrl_out_received(void) static void udd_ctrl_out_received(void)
{ {
irqflags_t flags; irqflags_t flags;
@@ -1615,6 +1648,7 @@ static void udd_ctrl_out_received(void)
cpu_irq_restore(flags); cpu_irq_restore(flags);
} }
static void udd_ctrl_underflow(void) static void udd_ctrl_underflow(void)
{ {
if (Is_udd_out_received(0)) if (Is_udd_out_received(0))
@@ -1631,6 +1665,7 @@ static void udd_ctrl_underflow(void)
} }
} }
static void udd_ctrl_overflow(void) static void udd_ctrl_overflow(void)
{ {
if (Is_udd_in_send(0)) if (Is_udd_in_send(0))
@@ -1646,6 +1681,7 @@ static void udd_ctrl_overflow(void)
} }
} }
static void udd_ctrl_stall_data(void) static void udd_ctrl_stall_data(void)
{ {
// Stall all packets on IN & OUT control endpoint // Stall all packets on IN & OUT control endpoint
@@ -1653,6 +1689,7 @@ static void udd_ctrl_stall_data(void)
udd_enable_stall_handshake(0); udd_enable_stall_handshake(0);
} }
static void udd_ctrl_send_zlp_in(void) static void udd_ctrl_send_zlp_in(void)
{ {
irqflags_t flags; irqflags_t flags;
@@ -1670,6 +1707,7 @@ static void udd_ctrl_send_zlp_in(void)
cpu_irq_restore(flags); cpu_irq_restore(flags);
} }
static void udd_ctrl_send_zlp_out(void) static void udd_ctrl_send_zlp_out(void)
{ {
irqflags_t flags; irqflags_t flags;
@@ -1685,6 +1723,7 @@ static void udd_ctrl_send_zlp_out(void)
cpu_irq_restore(flags); cpu_irq_restore(flags);
} }
static void udd_ctrl_endofrequest(void) static void udd_ctrl_endofrequest(void)
{ {
// If a callback is registered then call it // If a callback is registered then call it
@@ -1693,6 +1732,7 @@ static void udd_ctrl_endofrequest(void)
} }
} }
static bool udd_ctrl_interrupt(void) static bool udd_ctrl_interrupt(void)
{ {
@@ -1743,6 +1783,7 @@ static bool udd_ctrl_interrupt(void)
return false; return false;
} }
// ------------------------ // ------------------------
//--- INTERNAL ROUTINES TO MANAGED THE BULK/INTERRUPT/ISOCHRONOUS ENDPOINTS //--- INTERNAL ROUTINES TO MANAGED THE BULK/INTERRUPT/ISOCHRONOUS ENDPOINTS
@@ -1757,6 +1798,7 @@ static void udd_ep_job_table_reset(void)
} }
} }
static void udd_ep_job_table_kill(void) static void udd_ep_job_table_kill(void)
{ {
uint8_t i; uint8_t i;
@@ -1767,6 +1809,7 @@ static void udd_ep_job_table_kill(void)
} }
} }
static void udd_ep_abort_job(udd_ep_id_t ep) static void udd_ep_abort_job(udd_ep_id_t ep)
{ {
ep &= USB_EP_ADDR_MASK; ep &= USB_EP_ADDR_MASK;
@@ -1775,6 +1818,7 @@ static void udd_ep_abort_job(udd_ep_id_t ep)
udd_ep_finish_job(&udd_ep_job[ep - 1], true, ep); udd_ep_finish_job(&udd_ep_job[ep - 1], true, ep);
} }
static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_num) static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_num)
{ {
if (ptr_job->busy == false) { if (ptr_job->busy == false) {
@@ -1845,6 +1889,7 @@ static void udd_ep_trans_done(udd_ep_id_t ep)
udd_dma_ctrl |= UOTGHS_DEVDMACONTROL_END_BUFFIT | udd_dma_ctrl |= UOTGHS_DEVDMACONTROL_END_BUFFIT |
UOTGHS_DEVDMACONTROL_CHANN_ENB; UOTGHS_DEVDMACONTROL_CHANN_ENB;
// Disable IRQs to have a short sequence // Disable IRQs to have a short sequence
// between read of EOT_STA and DMA enable // between read of EOT_STA and DMA enable
flags = cpu_irq_save(); flags = cpu_irq_save();
@@ -129,6 +129,7 @@ extern "C" {
#define Is_udd_vbus_transition() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_VBUSTI)) #define Is_udd_vbus_transition() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_VBUSTI))
//! @} //! @}
//! @name UOTGHS device attach control //! @name UOTGHS device attach control
//! These macros manage the UOTGHS Device attach. //! These macros manage the UOTGHS Device attach.
//! @{ //! @{
@@ -140,6 +141,7 @@ extern "C" {
#define Is_udd_detached() (Tst_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_DETACH)) #define Is_udd_detached() (Tst_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_DETACH))
//! @} //! @}
//! @name UOTGHS device bus events control //! @name UOTGHS device bus events control
//! These macros manage the UOTGHS Device bus events. //! These macros manage the UOTGHS Device bus events.
//! @{ //! @{
@@ -244,6 +246,7 @@ extern "C" {
#define udd_get_configured_address() (Rd_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_UADD_Msk)) #define udd_get_configured_address() (Rd_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_UADD_Msk))
//! @} //! @}
//! @name UOTGHS Device endpoint drivers //! @name UOTGHS Device endpoint drivers
//! These macros manage the common features of the endpoints. //! These macros manage the common features of the endpoints.
//! @{ //! @{
@@ -327,6 +330,7 @@ extern "C" {
#define udd_data_toggle(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_DTSEQ_Msk)) #define udd_data_toggle(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_DTSEQ_Msk))
//! @} //! @}
//! @name UOTGHS Device control endpoint //! @name UOTGHS Device control endpoint
//! These macros control the endpoints. //! These macros control the endpoints.
//! @{ //! @{
@@ -526,6 +530,7 @@ extern "C" {
//! Tests if IN sending interrupt is enabled //! Tests if IN sending interrupt is enabled
#define Is_udd_in_send_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_TXINE)) #define Is_udd_in_send_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_TXINE))
//! Get 64-, 32-, 16- or 8-bit access to FIFO data register of selected endpoint. //! Get 64-, 32-, 16- or 8-bit access to FIFO data register of selected endpoint.
//! @param ep Endpoint of which to access FIFO data register //! @param ep Endpoint of which to access FIFO data register
//! @param scale Data scale in bits: 64, 32, 16 or 8 //! @param scale Data scale in bits: 64, 32, 16 or 8
@@ -647,6 +652,7 @@ typedef struct {
//! @} //! @}
//! @} //! @}
/// @cond 0 /// @cond 0
/**INDENT-OFF**/ /**INDENT-OFF**/
#ifdef __cplusplus #ifdef __cplusplus
+2
View File
@@ -53,6 +53,7 @@
extern "C" { extern "C" {
#endif #endif
//! \ingroup usb_group //! \ingroup usb_group
//! \defgroup otg_group UOTGHS OTG Driver //! \defgroup otg_group UOTGHS OTG Driver
//! UOTGHS low-level driver for OTG features //! UOTGHS low-level driver for OTG features
@@ -73,6 +74,7 @@ bool otg_dual_enable(void);
*/ */
void otg_dual_disable(void); void otg_dual_disable(void);
//! @name UOTGHS OTG ID pin management //! @name UOTGHS OTG ID pin management
//! The ID pin come from the USB OTG connector (A and B receptable) and //! The ID pin come from the USB OTG connector (A and B receptable) and
//! allows to select the USB mode host or device. //! allows to select the USB mode host or device.
+4
View File
@@ -374,6 +374,7 @@ typedef struct {
uint8_t bNumDeviceCaps; uint8_t bNumDeviceCaps;
} usb_dev_bos_desc_t; } usb_dev_bos_desc_t;
/** /**
* \brief USB Device Capabilities - USB 2.0 Extension Descriptor structure * \brief USB Device Capabilities - USB 2.0 Extension Descriptor structure
* *
@@ -410,6 +411,7 @@ typedef struct {
uint8_t iFunction; //!< Index of string descriptor uint8_t iFunction; //!< Index of string descriptor
} usb_association_desc_t; } usb_association_desc_t;
/** /**
* \brief Standard USB configuration descriptor structure * \brief Standard USB configuration descriptor structure
*/ */
@@ -424,6 +426,7 @@ typedef struct {
uint8_t bMaxPower; uint8_t bMaxPower;
} usb_conf_desc_t; } usb_conf_desc_t;
#define USB_CONFIG_ATTR_MUST_SET (1 << 7) //!< Must always be set #define USB_CONFIG_ATTR_MUST_SET (1 << 7) //!< Must always be set
#define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) //!< Bus-powered #define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) //!< Bus-powered
#define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) //!< Self-powered #define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) //!< Self-powered
@@ -472,6 +475,7 @@ typedef struct {
uint8_t bInterval; uint8_t bInterval;
} usb_ep_desc_t; } usb_ep_desc_t;
/** /**
* \brief A standard USB string descriptor structure * \brief A standard USB string descriptor structure
*/ */
@@ -168,6 +168,7 @@ COMPILER_PACK_SET(1)
//! \name USB CDC Descriptors //! \name USB CDC Descriptors
//@{ //@{
//! CDC Header Functional Descriptor //! CDC Header Functional Descriptor
typedef struct { typedef struct {
uint8_t bFunctionLength; uint8_t bFunctionLength;
@@ -202,6 +203,7 @@ typedef struct {
uint8_t bSlaveInterface0; uint8_t bSlaveInterface0;
} usb_cdc_union_desc_t; } usb_cdc_union_desc_t;
//! \name USB CDC Call Management Capabilities //! \name USB CDC Call Management Capabilities
//@{ //@{
//! Device handles call management itself //! Device handles call management itself
@@ -276,6 +278,7 @@ typedef struct {
//@} //@}
//@} //@}
//! \name USB CDC notification message //! \name USB CDC notification message
//@{ //@{
@@ -47,6 +47,7 @@
#ifndef _USB_PROTOCOL_MSC_H_ #ifndef _USB_PROTOCOL_MSC_H_
#define _USB_PROTOCOL_MSC_H_ #define _USB_PROTOCOL_MSC_H_
/** /**
* \ingroup usb_protocol_group * \ingroup usb_protocol_group
* \defgroup usb_msc_protocol USB Mass Storage Class (MSC) protocol definitions * \defgroup usb_msc_protocol USB Mass Storage Class (MSC) protocol definitions
@@ -88,6 +89,7 @@
#define MSC_PROTOCOL_BULK 0x50 //!< Bulk-only #define MSC_PROTOCOL_BULK 0x50 //!< Bulk-only
//@} //@}
/** /**
* \brief MSC USB requests (bRequest) * \brief MSC USB requests (bRequest)
*/ */
@@ -96,6 +98,7 @@ enum usb_reqid_msc {
USB_REQ_MSC_GET_MAX_LUN = 0xFE //!< Get Max LUN USB_REQ_MSC_GET_MAX_LUN = 0xFE //!< Get Max LUN
}; };
COMPILER_PACK_SET(1) COMPILER_PACK_SET(1)
/** /**
@@ -119,6 +122,7 @@ struct usb_msc_cbw {
#define USB_CBW_LEN_MASK 0x1F //!< Valid bits in bCBWCBLength #define USB_CBW_LEN_MASK 0x1F //!< Valid bits in bCBWCBLength
//@} //@}
/** /**
* \name A Command Status Wrapper (CSW). * \name A Command Status Wrapper (CSW).
*/ */
+8 -9
View File
@@ -209,17 +209,16 @@ int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }
// ADC // ADC
// ------------------------ // ------------------------
// https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32/api-reference/peripherals/adc.html #define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL
adc1_channel_t get_channel(int pin) { adc1_channel_t get_channel(int pin) {
switch (pin) { switch (pin) {
case 39: return ADC1_CHANNEL_3; case 39: return ADC1_CHANNEL(39);
case 36: return ADC1_CHANNEL_0; case 36: return ADC1_CHANNEL(36);
case 35: return ADC1_CHANNEL_7; case 35: return ADC1_CHANNEL(35);
case 34: return ADC1_CHANNEL_6; case 34: return ADC1_CHANNEL(34);
case 33: return ADC1_CHANNEL_5; case 33: return ADC1_CHANNEL(33);
case 32: return ADC1_CHANNEL_4; case 32: return ADC1_CHANNEL(32);
case 37: return ADC1_CHANNEL_1;
case 38: return ADC1_CHANNEL_2;
} }
return ADC1_CHANNEL_MAX; return ADC1_CHANNEL_MAX;
} }
+3 -7
View File
@@ -31,28 +31,24 @@
#ifndef MARLIN_EEPROM_SIZE #ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif #endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
bool PersistentStore::access_start() { return EEPROM.begin(MARLIN_EEPROM_SIZE); } bool PersistentStore::access_start() { return EEPROM.begin(MARLIN_EEPROM_SIZE); }
bool PersistentStore::access_finish() { EEPROM.end(); return true; } bool PersistentStore::access_finish() { EEPROM.end(); return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
for (size_t i = 0; i < size; i++) { for (size_t i = 0; i < size; i++) {
const int p = REAL_EEPROM_ADDR(pos); EEPROM.write(pos++, value[i]);
EEPROM.write(p, value[i]);
crc16(crc, &value[i], 1); crc16(crc, &value[i], 1);
++pos;
} }
return false; return false;
} }
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
for (size_t i = 0; i < size; i++) { for (size_t i = 0; i < size; i++) {
const int p = REAL_EEPROM_ADDR(pos); uint8_t c = EEPROM.read(pos++);
uint8_t c = EEPROM.read(p);
if (writing) value[i] = c; if (writing) value[i] = c;
crc16(crc, &c, 1); crc16(crc, &c, 1);
++pos;
} }
return false; return false;
} }
@@ -59,7 +59,6 @@ void setup_endstop_interrupts() {
TERN_(USE_Z4_MAX, _ATTACH(Z4_MAX_PIN)); TERN_(USE_Z4_MAX, _ATTACH(Z4_MAX_PIN));
TERN_(USE_Z4_MIN, _ATTACH(Z4_MIN_PIN)); TERN_(USE_Z4_MIN, _ATTACH(Z4_MIN_PIN));
TERN_(USE_Z_MIN_PROBE, _ATTACH(Z_MIN_PROBE_PIN)); TERN_(USE_Z_MIN_PROBE, _ATTACH(Z_MIN_PROBE_PIN));
TERN_(USE_CALIBRATION, _ATTACH(CALIBRATION_PIN));
TERN_(USE_I_MAX, _ATTACH(I_MAX_PIN)); TERN_(USE_I_MAX, _ATTACH(I_MAX_PIN));
TERN_(USE_I_MIN, _ATTACH(I_MIN_PIN)); TERN_(USE_I_MIN, _ATTACH(I_MIN_PIN));
TERN_(USE_J_MAX, _ATTACH(J_MAX_PIN)); TERN_(USE_J_MAX, _ATTACH(J_MAX_PIN));
-7
View File
@@ -37,10 +37,6 @@
// Set pin as output // Set pin as output
#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) #define _SET_OUTPUT(IO) pinMode(IO, OUTPUT)
// TODO: Store set modes in an array and use those to get the mode
#define _IS_OUTPUT(IO) true
#define _IS_INPUT(IO) true
// Set pin as input with pullup mode // Set pin as input with pullup mode
#define _PULLUP(IO, v) pinMode(IO, v ? INPUT_PULLUP : INPUT) #define _PULLUP(IO, v) pinMode(IO, v ? INPUT_PULLUP : INPUT)
@@ -74,9 +70,6 @@
// Set pin as output and init // Set pin as output and init
#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0) #define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
#define IS_OUTPUT(IO) _IS_OUTPUT(IO)
#define IS_INPUT(IO) _IS_INPUT(IO)
// digitalRead/Write wrappers // digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO) #define extDigitalRead(IO) digitalRead(IO)
#define extDigitalWrite(IO,V) digitalWrite(IO,V) #define extDigitalWrite(IO,V) digitalWrite(IO,V)
+1 -1
View File
@@ -152,7 +152,7 @@ void stepperTask(void *parameter) {
xQueueReceive(dma.queue, &dma.current, portMAX_DELAY); xQueueReceive(dma.queue, &dma.current, portMAX_DELAY);
dma.rw_pos = 0; dma.rw_pos = 0;
const bool using_ftMotion = TERN0(FT_MOTION, ftMotion.cfg.active); const bool using_ftMotion = TERN0(FT_MOTION, ftMotion.cfg.mode);
while (dma.rw_pos < DMA_SAMPLE_COUNT) { while (dma.rw_pos < DMA_SAMPLE_COUNT) {
@@ -1,22 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 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
+1 -5
View File
@@ -22,15 +22,11 @@
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
#include <WiFi.h>
#undef ENABLED
#undef DISABLED
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ALL(WIFISUPPORT, OTASUPPORT) #if ALL(WIFISUPPORT, OTASUPPORT)
#include <WiFi.h>
#include <ESPmDNS.h> #include <ESPmDNS.h>
#include <WiFiUdp.h> #include <WiFiUdp.h>
#include <ArduinoOTA.h> #include <ArduinoOTA.h>
-71
View File
@@ -1,71 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 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
#error "PINS_DEBUGGING is not yet supported for ESP32!"
/**
* Pins Debugging for ESP32
*
* - NUMBER_PINS_TOTAL
* - MULTI_NAME_PAD
* - getPinByIndex(index)
* - printPinNameByIndex(index)
* - getPinIsDigitalByIndex(index)
* - digitalPinToAnalogIndex(pin)
* - getValidPinMode(pin)
* - isValidPin(pin)
* - isAnalogPin(pin)
* - digitalRead_mod(pin)
* - pwm_status(pin)
* - printPinPWM(pin)
* - printPinPort(pin)
* - printPinNumber(pin)
* - printPinAnalog(pin)
*/
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
#define digitalRead_mod(P) extDigitalRead(P)
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%02d"), P); SERIAL_ECHO(buffer); }while(0)
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
#define getPinByIndex(x) pin_array[x].pin
#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
#define digitalPinToAnalogIndex(P) int(P - analogInputToDigitalPin(0))
#define isAnalogPin(P) WITHIN(P, pin_t(analogInputToDigitalPin(0)), pin_t(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
bool pwm_status(const pin_t) { return false; }
void printPinPort(const pin_t) {}
static bool getValidPinMode(const pin_t pin) {
return isValidPin(pin) && !IS_INPUT(pin);
}
void printPinPWM(const int32_t pin) {
if (pwm_status(pin)) {
//uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative;
//SERIAL_ECHOPGM("PWM = ", duty);
}
}
+4 -13
View File
@@ -21,16 +21,7 @@
*/ */
#pragma once #pragma once
#define PIN_SPI_SCK 18 #define SD_SS_PIN SDSS
#define PIN_SPI_MISO 19 #define SD_SCK_PIN 18
#define PIN_SPI_MOSI 23 #define SD_MISO_PIN 19
#define SD_MOSI_PIN 23
#ifndef SD_SCK_PIN
#define SD_SCK_PIN PIN_SPI_SCK
#endif
#ifndef SD_MISO_PIN
#define SD_MISO_PIN PIN_SPI_MISO
#endif
#ifndef SD_MOSI_PIN
#define SD_MOSI_PIN PIN_SPI_MOSI
#endif
+1 -1
View File
@@ -90,7 +90,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
config.counter_en = TIMER_PAUSE; config.counter_en = TIMER_PAUSE;
config.alarm_en = TIMER_ALARM_EN; config.alarm_en = TIMER_ALARM_EN;
config.intr_type = TIMER_INTR_LEVEL; config.intr_type = TIMER_INTR_LEVEL;
config.auto_reload = TIMER_AUTORELOAD_EN; config.auto_reload = true;
// Select and initialize the timer // Select and initialize the timer
timer_init(timer.group, timer.idx, &config); timer_init(timer.group, timer.idx, &config);
+2 -1
View File
@@ -53,11 +53,12 @@ typedef uint64_t hal_timer_t;
#if ENABLED(I2S_STEPPER_STREAM) #if ENABLED(I2S_STEPPER_STREAM)
#define STEPPER_TIMER_PRESCALE 1 #define STEPPER_TIMER_PRESCALE 1
#define STEPPER_TIMER_RATE 250000 // 250khz, 4µs pulses of i2s word clock #define STEPPER_TIMER_RATE 250000 // 250khz, 4µs pulses of i2s word clock
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs // wrong would be 0.25
#else #else
#define STEPPER_TIMER_PRESCALE 40 #define STEPPER_TIMER_PRESCALE 40
#define STEPPER_TIMER_RATE ((HAL_TIMER_RATE) / (STEPPER_TIMER_PRESCALE)) // frequency of stepper timer, 2MHz #define STEPPER_TIMER_RATE ((HAL_TIMER_RATE) / (STEPPER_TIMER_PRESCALE)) // frequency of stepper timer, 2MHz
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
#endif #endif
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
#define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts #define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts

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