Skip to content

Commit 8907374

Browse files
committed
MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v034-dev-squashed-2025
MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v034-dev-squashed-2025 THIS IS A DEMONSTRATION OF ALL CHANGES IN ONE COMMIT ON TOP OF MARLIN BUGFIX-2.1.x by MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v034-dev DO NOT USE IN PRODUCTION!!! v034 will have its own branch when it is released!!! commit 381b8b125478bcccef970f6f5115d63fa25d63fe Author: ThomasToka <[email protected]> Date: Thu May 29 18:46:42 2025 +0200 v034 update v034 update commit 6d4ef32a1ffa34bcad0ead03ba4274b4a6d96d9a Author: ThomasToka <[email protected]> Date: Thu May 29 15:56:41 2025 +0200 past merge fixes commit fa0ab4c311a7e01c03368ed31f1d99a1d1df11f8 Merge: 1a53db3 a270cc3 Author: ThomasToka <[email protected]> Date: Thu May 29 13:56:13 2025 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v034-rebase commit 1a53db3 Author: ThomasToka <[email protected]> Date: Sat Mar 8 12:09:31 2025 +0100 v033 update fix advance_k title icon revert v029 M402 move from lcd_rts to powerloss revert v029 MarlinCore changes / reintroduce boot up delay screen update restoring LA Text icon commit 560b19b Merge: 3e5919c 6ba0813 Author: ThomasToka <[email protected]> Date: Sat Mar 15 11:24:57 2025 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v033 commit 3e5919c Author: ThomasToka <[email protected]> Date: Sun Feb 16 13:13:00 2025 +0100 v032 update upstream merge laser stop fix picLayers unsigned int to int pins file update total_probing new default 5 m117 negative numbers to layers fix compilation on linux screen firmware update commit f1d8f59 Merge: 8c0be16 efba06c Author: ThomasToka <[email protected]> Date: Fri Feb 28 17:02:37 2025 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v032 commit 8c0be16 Author: ThomasToka <[email protected]> Date: Wed Dec 25 11:14:23 2024 +0100 v031 update fix settingsload on triggered filament runout sensor fix stop on filament runout prevent negative layer numbers in M117 to reach the display remove software_autoscroll and clean up update filament sensor stop redirect page screen update commit b5428bf Author: ThomasToka <[email protected]> Date: Sun Dec 15 15:28:16 2024 +0100 v030 update v030 update "The first layer optimization update" v030 probe changes probe final update past merge fixes weighted probe in case of two probes measured_z fix v030 screen update commit 702c6ad Merge: 5b4cbbb 4eb8a87 Author: ThomasToka <[email protected]> Date: Fri Dec 20 18:28:54 2024 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v030-dev commit 5b4cbbb Author: ThomasToka <[email protected]> Date: Sun Oct 20 12:49:29 2024 +0200 v029 update follow upstream lcr_rts integration part 1 code cleanup and more TERN powerloss fix part 3 version update M19 boot_zraise update remove RTS_Init delay in MarlinCore screen update commit 5e6847d Author: ThomasToka <[email protected]> Date: Wed Oct 9 11:25:17 2024 +0200 v028 screen hotfix commit c7da535 Author: ThomasToka <[email protected]> Date: Tue Oct 8 18:19:44 2024 +0200 v028 update v028 update ini update Version update M25 update TERN_ update probe on point 1 fix power recovery save fix on pause sites power recovery fix past merge updates past merge Conditionals-3-etc.h update past merge Conditionals-2-LCD.h update past merge Configuration.h update plr offset to m19 fix early card mount commit lcd_rts_laser fixes screen update commit a9959f4 Merge: 19a708d 70ef797 Author: ThomasToka <[email protected]> Date: Mon Oct 7 20:15:54 2024 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v028-dev commit 19a708d Author: ThomasToka <[email protected]> Date: Thu May 9 13:13:20 2024 +0200 v027 update v027 "The save and load update part2" - included all upstream commits - shrinked lcd_rts code again - add M19 S7 functionality for mesh_size (F), marginx (X), marginy (Y), probescount (P) ex. M19 S7 X0 Y0 F7 P1 - added M19 to load and save function on the restore site. you can set X0 and Y0 and it will reaccount based on the probe offsets set earlier. execute M19 always as last in your SETTINGS.GCO - fixed unwanted save on entering the device site - changed some lcd and marlin ids for some sites and realligned in marlin code. - changed probe offsets blue writing in the fields to white as here the pads must be used - hotfix 1 included commit 837a3c3 Merge: 23ed2a4 bab1917 Author: ThomasToka <[email protected]> Date: Thu May 9 12:59:21 2024 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v027-dev commit 23ed2a4 Author: ThomasToka <[email protected]> Date: Mon Mar 4 12:37:58 2024 +0100 v026 service release - included all upstream commits - fixed compilation after upstream commits - fixed adjust site save during printing - fixed a selden visual bug on mesh restart - shrinked lcd_rts code to fit flash space - prepared for hotend_fan integration - steps changed to x 80.0 and y 80.0 - screen files update commit 43a811f Merge: 75ce38e d773570 Author: ThomasToka <[email protected]> Date: Sun Apr 21 10:51:21 2024 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v026-dev commit 75ce38e Author: ThomasToka <[email protected]> Date: Tue Jan 23 14:37:19 2024 +0100 v025 update - probe margins are now working for 0 y offset users - lcd_rts_settings.probe_margin_y -> lcd_rts_settings.probe_margin_y_front - lcd_rts_settings.probe_min_margin_y -> lcd_rts_settings.probe_margin_y_back - hotfix 1 - hotfix 2 commit d358456 Merge: bfdfcd1 7455776 Author: ThomasToka <[email protected]> Date: Mon Jan 15 18:51:11 2024 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v025-merge commit bfdfcd1 Author: ThomasToka <[email protected]> Date: Mon Jan 8 17:06:30 2024 +0100 v024 update - octoprint support added - cardreader extended - custom M19 function added - reduced jerk to 12x 12y 8e - fixed laser after g28 -OctoPrint-E3S1PROFORKBYTT_Thumbnails is now able to send thumbnails to the display commit 587fc04 Merge: 8d92453 991f433 Author: ThomasToka <[email protected]> Date: Thu Jan 4 18:37:34 2024 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v024-dev commit 8d92453 Author: ThomasToka <[email protected]> Date: Wed Dec 20 15:34:48 2023 +0100 v023 update v023 update - added new thumbnail preview scripts for Orca v1.8.x, Prusa v2.7.x, Cura 5.x - added printdata (layer, material usage, z height, z_layer height) if a the thumbnail preview script is used - added material usage during print in g (gram) and m (meter) - added M84 toggle on the main, pause, finish and resume site (not active during print) - added G28 home button on the main, pause, finish and resume site (not active during print) - M73 is now automatically added if the new thumbnail preview script is used and can be activated on the main. no other plugin is now needed for this - slightly adjusted the y park position from (Y_MAX_POS - 10) to (Y_MAX_POS - 50) - fixed a bug on print stop so the print data and time will be resetted correctly - fixed a bug where M73 time and ui.time interfered. - code clean up and variables missspelling corrected in preview.cpp - changed qr code to pic to preserve some variables from beeing overwritten - octorprint print data hotfixed - hotfix 2 included commit 1c1789d Author: FroggieFrog <[email protected]> Date: Wed Dec 13 15:53:44 2023 +0100 translate some comments compile fix preview.pp translate some comments cleanup preview.cpp cleanup preview.h cleanup preview.h cleanup preview.cpp commit 7c56296 Merge: a18db83 81cfa23 Author: ThomasToka <[email protected]> Date: Tue Dec 12 17:18:23 2023 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v023-dev commit a18db83 Author: ThomasToka <[email protected]> Date: Tue Dec 12 15:07:35 2023 +0100 v022 update - added dynamic probes. you can now choose 1-5 probes for autoleveling, cr-touch measuring and assisted tramming - added assisted tramming on the cr-touch site - removed select print file scrolling on mainsite - rearranged main site with new select file field - selected print file shown on main site has now three visibility functions 1) under 25 chars centered and bigger 2) from 26 to 55 chars left arranged and in two rows. 3) over 55 chars like 2 but cropped to 55 chars - cardreader now supports filenames up to 55 chars shown in 2 lines - adjusted M117 messages to be shown like a select file with the 3 mentioned options - fixed folders and files accounting so always the correct site number is shown - restructured lcd_rts code with new classes. it saved around 4k flash space - fixed inability to enter the adjust site during printing when G29 was in the start Gcode due to a wrong routing in g29cpp and ubl_g29.cpp - rearranged address space for cardreader update - with this release the firmware is not more backward compatible to the stock firmware. this means you cant mix screen of stock and my firmware anymore. naturally a downgrade to both stock mainboard and stock screen firmware is still possible. commit 4ad2e72 Merge: 91576d4 483b8dc Author: ThomasToka <[email protected]> Date: Wed Dec 6 20:37:11 2023 +0100 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v022-dev commit 91576d4 Merge: 1a5e187 4a4c1db Author: ThomasToka <[email protected]> Date: Tue Dec 5 12:35:31 2023 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v022-dev commit 1a5e187 Author: ThomasToka <[email protected]> Date: Tue Dec 5 11:44:16 2023 +0100 v021 update "The mesh colors update part 2" - meshes are now colored - added main site preheat shortcuts (inactive during print) - added main site cool and off toggle for temps/fans (inactive during print) - added optional M73 functionality toggle to show slicer time - added M600 on demand functionality (active during print) - added mesh status on main site - reworked about site for qrcode display - introduced new classes to save flash space commit deaebde Author: ThomasToka <[email protected]> Date: Sun Nov 26 18:37:24 2023 +0100 v020 update "The instructions update" - added hints on cr-touch measuring site - added hints on manual tramming site - changed behavior of the home button on cr-touch measuring site - changed behavior of the home button on the manual tramming site - changed linear advance to 3 digits. - changed default linear advance K value to 0.035 - added a guard to not overflow the display on loading a too big gcode preview image - increased gcode preview image size to 24KB by moving it from 0xB000 to 0xA000 commit 2bbc78d Author: ThomasToka <[email protected]> Date: Fri Nov 24 02:01:23 2023 +0100 v019 update The rectangle update - active mesh points have now a rectangle - secured mesh edit on leveling - secured edit mesh points on leveling - secured mesh size change on leveling - screen updates to reflect the rectangles - screen fixed to have a consistent output on page change - mainboard fixed to not show a wrong mesh size on autoleveling start - stripped code down and removed unneded code commit 3b8a34e Merge: 1328d65 1bee537 Author: ThomasToka <[email protected]> Date: Fri Nov 24 00:19:11 2023 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v019-dev commit 1328d65 Author: ThomasToka <[email protected]> Date: Mon Nov 20 15:56:51 2023 +0100 v18 update v018 update "The mesh colors update" - mesh viewer now shows a coloured mesh after generation - fixed default preview pic reset on sd card pull - fixed folders and files icons reset on sd card pull - reduced variables on startup - rearranged the plus tramming point 1 to be in the middle of 310x310 size - lots of unused variables deleted Included hotfix 1: - input shaping defaults not populated to the screen - probe offsets not populated to the screen Included hotfix 2: - 10 x 10 mesh affected by mirroring the mesh on leveling end - 10 x 10 mesh affected by mirroring the mesh on reboot - 10 x 10 affected to not edit points correctly - screen firmware affected by some wrong variables on the 10 x10 mesh commit 0235725 Merge: 3e6de02 aed5772 Author: ThomasToka <[email protected]> Date: Sat Nov 18 18:43:46 2023 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v018-dev commit 3e6de02 Author: ThomasToka <[email protected]> Date: Wed Nov 15 21:39:56 2023 +0100 v017 update - folders and files icons - folders and files colors (folders blue, files white) - stripping of the gcode preview class to save flash without interferance of our functionality - probe pull up after reboot fix commit 3f36bfc Merge: 14e36e4 3e8a5b6 Author: ThomasToka <[email protected]> Date: Wed Nov 15 21:04:30 2023 +0100 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v017 commit 14e36e4 Author: ThomasToka <[email protected]> Date: Fri Nov 3 22:32:26 2023 +0100 v016 update "The dynamic ubl update" - mesh points and margins are now dynamic for ubl builds also - adjusted basic Linear Advance settings and Jerk Settings - code cleanup, removed old now not more needed functions - G30 cr-touch patch hotfix - m84 invalidate axes hotfix commit 0859250 Author: ThomasToka <[email protected]> Date: Sat Oct 28 20:13:02 2023 +0200 v015 update - "The dynamic abl mesh size update" - power loss recovery fix - included two past v015 release hotfixes commit 10700e9 Merge: fd60eef f82d010 Author: ThomasToka <[email protected]> Date: Fri Oct 27 18:47:08 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v015 commit fd60eef Author: ThomasToka <[email protected]> Date: Fri Oct 13 20:55:23 2023 +0200 v014 update The mesh edit update. commit 7ff1cd8 Author: ThomasToka <[email protected]> Date: Mon Oct 9 21:37:17 2023 +0200 v013 update - fixed pause at height - changed POWER_LOSS_MIN_Z_CHANGE 0.05 to POWER_LOSS_MIN_Z_CHANGE 0.1 - some screen sites reworked to show the power loss and filament runout toggle commit 8cea81d Merge: 6ec4289 b58d5da Author: ThomasToka <[email protected]> Date: Mon Oct 9 17:33:40 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v013 commit 6ec4289 Author: ThomasToka <[email protected]> Date: Mon Sep 25 01:55:03 2023 +0200 v012 update "The dynamic abl y margin update" - y margin is now dynamic - cardreader supports folders up to 65 chars - reworked mesh sites and cr-touch site commit 6ae056e Author: ThomasToka <[email protected]> Date: Wed Sep 20 00:23:25 2023 +0200 cardreader revert increasing vfat entries does not work as expected as it uses too much ram. commit 75dc11d Author: ThomasToka <[email protected]> Date: Tue Sep 19 17:50:11 2023 +0200 v011 update - changed progressbar to a own developed - adjusted filescrolling behavior - cardreader now reads filenames up to 78 chars (incl. fileextension) commit b2860e1 Author: ThomasToka <[email protected]> Date: Fri Sep 15 15:06:06 2023 +0200 v010 hotfix -flickering reduced for dacai users -fixing probe margin for 0 y offset users so they at least can use the cr-touch measuring. - mesh is updated on entering leveling page now commit 0e99b75 Author: ThomasToka <[email protected]> Date: Thu Sep 14 18:57:37 2023 +0200 v010 update - scrolling printfile update - v010 screen files commit e1512be Author: ThomasToka <[email protected]> Date: Tue Sep 12 11:59:18 2023 +0200 the v009 screen files commit fdd8b41 Author: ThomasToka <[email protected]> Date: Tue Sep 12 09:19:05 2023 +0200 the plus 2mm more probing margin Ender 3 S1 Plus needs 2mm more probing margin on x commit 6b318e2 Author: ThomasToka <[email protected]> Date: Tue Sep 12 08:00:09 2023 +0200 cr-touch measuring dynamic margin update - this update adds the dynamic margin to the cr-touch measuring function - this update fixed multiple cr-touch leveling starts - v009 flag set commit 38dc90d Author: ThomasToka <[email protected]> Date: Tue Sep 5 10:49:44 2023 +0200 forgotten laser feature for Plus F4 builds commit 6437bb1 Merge: 46f421e 11f98ad Author: ThomasToka <[email protected]> Date: Mon Sep 4 20:08:42 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v009-dev commit 46f421e Author: ThomasToka <[email protected]> Date: Sun Sep 3 01:51:50 2023 +0200 the v008 update inkl screen sources commit 81e700e Author: ThomasToka <[email protected]> Date: Fri Sep 1 10:19:04 2023 +0200 disabling M34 / enabling NO_SD_AUTOSTART disabled M34 enabled NO_SD_AUTOSTART disabled again. commit 8774499 Author: ThomasToka <[email protected]> Date: Thu Aug 31 22:06:05 2023 +0200 environment update part 2 F1 builds can do everything. commit 8705ab0 Author: ThomasToka <[email protected]> Date: Thu Aug 31 21:46:30 2023 +0200 prerelease environment updates splitting fdm and laser builds commit f484370 Author: ThomasToka <[email protected]> Date: Wed Aug 30 18:26:14 2023 +0200 revert dynamic ubl commit b97c210 Author: ThomasToka <[email protected]> Date: Wed Aug 30 16:47:40 2023 +0200 gcode preview update part1 commit 436b6bb Author: ThomasToka <[email protected]> Date: Mon Aug 28 12:36:33 2023 +0200 Ubl Update prepare part1 commit de21504 Author: ThomasToka <[email protected]> Date: Mon Aug 28 12:35:49 2023 +0200 past merge temperature fix commit 1d6d03d Merge: 5019d5a f6de698 Author: ThomasToka <[email protected]> Date: Wed Aug 23 15:58:10 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v008-dev commit 5019d5a Merge: 7f08cf8 db5ead4 Author: ThomasToka <[email protected]> Date: Sun Aug 20 11:31:17 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v008-dev commit 7f08cf8 Author: ThomasToka <[email protected]> Date: Sun Aug 20 02:18:08 2023 +0200 the dynamic abl probing margin update Part 2 of my dynamic upgrade series. Thanks to Mriscoc for inspiration and some code i re-used. commit 9f8baa5 Author: ThomasToka <[email protected]> Date: Tue Aug 15 15:11:49 2023 +0200 screen sound blurry hotfixed commit 0f60401 Author: ThomasToka <[email protected]> Date: Tue Aug 15 13:29:35 2023 +0200 fixed screen sources commit 89e383e Author: ThomasToka <[email protected]> Date: Tue Aug 15 12:47:54 2023 +0200 the hotend offset fix commit 23bd459 Author: ThomasToka <[email protected]> Date: Sun Aug 13 14:43:38 2023 +0200 v006 screen sources upload commit 780d067 Author: ThomasToka <[email protected]> Date: Sun Aug 13 14:23:33 2023 +0200 typo in ubl10x10 name output fixed commit 5f747cd Author: ThomasToka <[email protected]> Date: Sun Aug 13 13:34:31 2023 +0200 v006 version and lcd_rts_defines basic implemenation commit cf6201c Author: ThomasToka <[email protected]> Date: Sun Aug 13 00:35:48 2023 +0200 the volume and brightness update commit a4f86d0 Author: ThomasToka <[email protected]> Date: Fri Aug 11 23:27:49 2023 +0200 settings.cpp dynamic fix upgrade commit 8198c82 Author: ThomasToka <[email protected]> Date: Fri Aug 11 22:25:55 2023 +0200 lcd_rts patch eeprom commit 3c72754 Author: ThomasToka <[email protected]> Date: Wed Aug 9 22:11:50 2023 +0200 reducing lcd_rts_settings_t commit a0f30d5 Author: ThomasToka <[email protected]> Date: Wed Aug 9 21:29:30 2023 +0200 small needed fixes commit 9cf6080 Merge: d1ae955 2bac783 Author: ThomasToka <[email protected]> Date: Tue Aug 8 08:20:31 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v006-dev commit d1ae955 Author: ThomasToka <[email protected]> Date: Tue Aug 8 08:02:32 2023 +0200 lcd_rts_settings struct basic implementation commit 3a1cccd Author: ThomasToka <[email protected]> Date: Sun Aug 6 10:50:45 2023 +0200 settings save fix commit ea2cc2c Author: ThomasToka <[email protected]> Date: Sun Aug 6 10:50:19 2023 +0200 past release updates backlash off autopid numbers fix commit 9ab2fe6 Author: ThomasToka <[email protected]> Date: Sat Aug 5 13:35:41 2023 +0200 screen sources update commit 3ae702c Author: ThomasToka <[email protected]> Date: Sat Aug 5 13:00:06 2023 +0200 double variable deleted commit e3c48bd Author: ThomasToka <[email protected]> Date: Sat Aug 5 11:35:25 2023 +0200 v005 past merge updates and LCD_RTS_DEBUG commit ac400f1 Merge: f75c324 f66323e Author: ThomasToka <[email protected]> Date: Sat Aug 5 10:36:28 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v005 commit f75c324 Author: ThomasToka <[email protected]> Date: Sat Aug 5 10:23:24 2023 +0200 backlash compensation enabled commit 1d13b0f Author: ThomasToka <[email protected]> Date: Mon Jul 31 21:58:06 2023 +0200 laser cardreader upgrade commit 9601d21 Author: ThomasToka <[email protected]> Date: Mon Jul 31 21:21:52 2023 +0200 the cardreader upgrade activating 40 maxfiles and 8 sites commit 9dd3745 Author: ThomasToka <[email protected]> Date: Sat Jul 29 18:11:33 2023 +0200 reverse temporary changes to marlin state commit 64c7975 Author: ThomasToka <[email protected]> Date: Sat Jul 29 17:54:56 2023 +0200 Fixing powerloss as bugfix-2.1.x is buggy commit c5199ef Author: ThomasToka <[email protected]> Date: Fri Jul 28 15:12:27 2023 +0200 v004 screen source update commit c4c4b28 Author: ThomasToka <[email protected]> Date: Fri Jul 28 13:02:03 2023 +0200 serial silence commit f3f2881 Author: ThomasToka <[email protected]> Date: Fri Jul 28 12:49:04 2023 +0200 m3 m5 float with disabled laser device commit 6233ef7 Merge: 1a3f46b 2a82ca8 Author: ThomasToka <[email protected]> Date: Fri Jul 28 09:43:21 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v004-dev commit 1a3f46b Author: ThomasToka <[email protected]> Date: Thu Jul 27 22:16:18 2023 +0200 laser feature updates part6 commit 0ab5906 Merge: 9583124 6ba50aa Author: ThomasToka <[email protected]> Date: Thu Jul 27 19:29:18 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v004-dev commit 9583124 Author: ThomasToka <[email protected]> Date: Thu Jul 27 19:14:50 2023 +0200 laser feature updates part5 commit 9c9d6f3 Author: ThomasToka <[email protected]> Date: Thu Jul 27 18:53:22 2023 +0200 laser feature updates part4 commit a07abe4 Author: ThomasToka <[email protected]> Date: Thu Jul 27 17:49:19 2023 +0200 laser feature cardreader fix commit 0167db2 Author: ThomasToka <[email protected]> Date: Thu Jul 27 16:33:58 2023 +0200 laser feature range update commit 8d84dc0 Author: ThomasToka <[email protected]> Date: Thu Jul 27 16:05:43 2023 +0200 laser feature updates part3 commit 7e6361a Author: ThomasToka <[email protected]> Date: Thu Jul 27 15:26:44 2023 +0200 laser feature update part2 commit 94b26fb Author: ThomasToka <[email protected]> Date: Tue Jul 25 22:53:06 2023 +0200 powerloss / pin / runout save commit 6a92159 Author: ThomasToka <[email protected]> Date: Tue Jul 25 11:54:02 2023 +0200 laser feature power update first try commit a85d32e Merge: 9bc1796 79be07f Author: ThomasToka <[email protected]> Date: Tue Jul 25 00:27:27 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v004-dev commit 9bc1796 Author: ThomasToka <[email protected]> Date: Tue Jul 25 00:26:41 2023 +0200 powercontinue follow up feedrates yet to be fixed.. commit 004eb2c Author: ThomasToka <[email protected]> Date: Mon Jul 24 17:34:40 2023 +0200 the bool update commit 5884496 Author: ThomasToka <[email protected]> Date: Mon Jul 24 17:04:19 2023 +0200 home offset threshold commit d489bb8 Author: ThomasToka <[email protected]> Date: Mon Jul 24 16:44:40 2023 +0200 powerrecover updates commit 1c65875 Merge: 3f64061 e451dec Author: ThomasToka <[email protected]> Date: Sun Jul 23 23:23:33 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v004-dev commit 3f64061 Author: ThomasToka <[email protected]> Date: Sun Jul 23 23:22:42 2023 +0200 v004 updates commit 782a92d Author: ThomasToka <[email protected]> Date: Sat Jul 22 10:39:28 2023 +0200 including my Marlin PR MarlinFirmware#26099 Add M221 to M503/M502 MarlinFirmware#26099 commit 5a6132d Author: ThomasToka <[email protected]> Date: Fri Jul 21 20:50:11 2023 +0200 add version to filenames - remove -LA- as all builds include LA - add version string for better recognization of versions commit 6f24287 Author: ThomasToka <[email protected]> Date: Fri Jul 21 18:35:04 2023 +0200 Add extruder flowrate to M221 report followup Add M211 to the report followup reset and default value commit 4becd4a Merge: 23e5711 91c6a71 Author: ThomasToka <[email protected]> Date: Fri Jul 21 10:26:04 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v004-dev commit 23e5711 Author: ThomasToka <[email protected]> Date: Fri Jul 21 10:09:10 2023 +0200 trying to read screen version from the stream commit 5e43853 Author: ThomasToka <[email protected]> Date: Thu Jul 20 18:31:03 2023 +0200 laser feature babystepping fix after upstream change commit 5db4f00 Merge: a951d3d 6bc4230 Author: ThomasToka <[email protected]> Date: Thu Jul 20 15:14:41 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v004-dev commit a951d3d Author: ThomasToka <[email protected]> Date: Thu Jul 20 12:03:11 2023 +0200 screen files update visual bug on the adjust page for zoffset fixed commit c9abe8d Author: ThomasToka <[email protected]> Date: Wed Jul 19 17:41:55 2023 +0200 M221 on M503 fix output fix commit 59239d2 Author: ThomasToka <[email protected]> Date: Wed Jul 19 16:29:14 2023 +0200 auto cr-touch point 1 fix / screen v003 release - point 1 was misscalculated on cr-touch autorun. fixed. - screen v003 incl source release commit 0773c09 Author: ThomasToka <[email protected]> Date: Wed Jul 19 15:02:29 2023 +0200 m221 report update Implemented M221 report on M503 commit 6c4ef51 Author: ThomasToka <[email protected]> Date: Wed Jul 19 12:47:32 2023 +0200 v003 update fixes - flag v003 - enabled gcode_repeat_markers - adjusted abl and meshviewer vor 7x7 and 10x10 versions - added flow - extended home_offset function - disabled sd_finished_releasecommand as we do it in end gcode if needed commit faac038 Merge: f88f40d 885e9cc Author: ThomasToka <[email protected]> Date: Wed Jul 19 12:44:55 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v003-dev commit f88f40d Author: ThomasToka <[email protected]> Date: Mon Jul 17 11:51:03 2023 +0200 format fix runout.cpp commit 342695e Merge: 7267d25 244de24 Author: ThomasToka <[email protected]> Date: Mon Jul 17 11:49:26 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v003-dev commit 7267d25 Author: ThomasToka <[email protected]> Date: Sun Jul 16 21:30:04 2023 +0200 fix runout status an all events - fix runout disabled status on all events (start,pause, etc) commit bc2daee Merge: 59f42f7 810c169 Author: ThomasToka <[email protected]> Date: Sun Jul 16 21:28:51 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE-v003-dev commit 59f42f7 Author: ThomasToka <[email protected]> Date: Sun Jul 16 21:28:00 2023 +0200 v003 updates - reintroduce 7x7 and 10x10 build generally - add abl7x7 and abl10x10 builds - fix runout disabled status on all events (start,pause, etc) commit 2d02ccd Author: ThomasToka <[email protected]> Date: Sun Jul 16 00:49:41 2023 +0200 past v002 ubl fix tramming points fix for cr-touch and tramming with ubl commit c6c4d14 Author: ThomasToka <[email protected]> Date: Sat Jul 15 18:16:12 2023 +0200 Updated Screenfiles cause of missing font commit 5e86301 Author: ThomasToka <[email protected]> Date: Sat Jul 15 14:54:29 2023 +0200 Screen firmware source code upload Additionally: - z_values output to serial not needed so deactivated - home offset serial output only in debug mode commit 6c62210 Merge: ff8af9b 28f69a0 Author: ThomasToka <[email protected]> Date: Sat Jul 15 12:48:51 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-v002-dev commit ff8af9b Author: ThomasToka <[email protected]> Date: Sat Jul 15 12:47:53 2023 +0200 v002 update configs and last minute fixes -safe tramming points after M84 -no workspace offsets -ubl grid point fixes commit 1fc9ebc Author: ThomasToka <[email protected]> Date: Tue Jun 20 19:15:59 2023 +0200 Revert M206 Home Offset behavior MarlinFirmware#25996 MarlinFirmware#25996 commit 2e437a8 Author: ThomasToka <[email protected]> Date: Wed Jul 12 18:40:40 2023 +0200 point_num_real meshviewer fix fixes point_num_real to match the address space of the mashviewer. commit 0039d17 Author: ThomasToka <[email protected]> Date: Wed Jul 12 17:15:31 2023 +0200 PR compatibilty changes only if needed and then in a "enabled" area. commit 59f98b3 Author: ThomasToka <[email protected]> Date: Wed Jul 12 15:08:00 2023 +0200 The Filament runout icon update commit 20a88f5 Author: ThomasToka <[email protected]> Date: Wed Jul 12 14:12:29 2023 +0200 The UBL Update - stabilizing should work reliably now :) commit c78c4b0 Author: ThomasToka <[email protected]> Date: Tue Jul 11 22:34:00 2023 +0200 The UBL Update - first try correction seems to work :-) commit 4edfefd Author: ThomasToka <[email protected]> Date: Tue Jul 11 21:43:15 2023 +0200 The UBL Update - first try.. loading after reboot still broken.. investigating.. commit 8e8ceb5 Merge: 52c4ae9 bcf61cc Author: ThomasToka <[email protected]> Date: Thu Jul 6 11:15:50 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-v001-JULI-UPDATE commit 52c4ae9 Merge: 608e4a3 57d26f7 Author: ThomasToka <[email protected]> Date: Wed Jul 5 14:06:31 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-v001-JULI-UPDATE commit 608e4a3 Merge: 66afd46 87b2af2 Author: ThomasToka <[email protected]> Date: Tue Jul 4 20:19:22 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-v001-JULI-UPDATE commit 87b2af2 Author: thinkyhead <[email protected]> Date: Tue Jul 4 06:06:45 2023 +0000 [cron] Bump distribution date (2023-07-04) commit 9799b57 Author: Scott Lahteine <[email protected]> Date: Sat Jul 1 20:38:17 2023 -0500 🎨 Misc. fixes and formatting commit 66afd46 Merge: 07cc565 4a734e4 Author: ThomasToka <[email protected]> Date: Mon Jun 26 14:03:05 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit 07cc565 Merge: bb79690 60f591f Author: ThomasToka <[email protected]> Date: Mon Jun 26 13:58:01 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit bb79690 Merge: 139fee9 2dc7668 Author: ThomasToka <[email protected]> Date: Tue Jun 20 18:27:23 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit 139fee9 Merge: 4b7cd78 733209f Author: ThomasToka <[email protected]> Date: Mon Jun 19 13:22:27 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit 4b7cd78 Merge: 8f4674c dd1792b Author: ThomasToka <[email protected]> Date: Sun Jun 18 10:40:30 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit 8f4674c Merge: a958692 eca80db Author: ThomasToka <[email protected]> Date: Fri Jun 16 13:00:53 2023 +0200 Merge branch 'bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit a958692 Author: ThomasToka <[email protected]> Date: Tue Jun 13 20:28:00 2023 +0200 PlatformIO Name output Fix Unified the output of the compile files after upstream commit commit d6c501d Merge: 361ee45 1726ba5 Author: ThomasToka <[email protected]> Date: Tue Jun 13 19:53:50 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit 361ee45 Author: ThomasToka <[email protected]> Date: Sun Jun 11 15:08:53 2023 +0200 build system simplyfied after upstream commit commit ad3b7c4 Merge: 9e791cc fd632da Author: ThomasToka <[email protected]> Date: Sun Jun 11 14:19:29 2023 +0200 Merge branch 'MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE' of https://github.com/ThomasToka/Marlin into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit fd632da Merge: df2e2d8 85067e1 Author: ThomasToka <[email protected]> Date: Sun Jun 11 14:19:09 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit 9e791cc Author: ThomasToka <[email protected]> Date: Sun Jun 11 14:12:01 2023 +0200 laser feature readjusted - laser feature enable in build system for ablbuilds - laser feature disable globally so ubl is buildable again commit df2e2d8 Merge: d5edd7b b5d3d01 Author: ThomasToka <[email protected]> Date: Sat Jun 10 16:46:27 2023 +0200 Merge branch 'MarlinFirmware:bugfix-2.1.x' into MARLIN-E3S1PROFORK-BYTT-RELEASE-CODE commit d5edd7b Author: ThomasToka <[email protected]> Date: Sat Jun 10 16:41:16 2023 +0200 MARLIN-E3S1PROFORK-BYTT initial commit This is MARLIN-E3S1PRO-FORK-BYTT Release Candidate 1. This fork was ported from the Original Creality Ender 3 S1 Pro Code from here: https://github.com/CrealityOfficial/Ender-3S1/tree/s1_pro This port was created by Thomas Toka. This code is based on Marlin bugfix-2.1.x taken from: Marlin Github on the 21st may 2023 after this commit: MarlinFirmware@06b1f85 Other Code was implemented from: Creality Github Synman Github Mriscoc Github johncarlson21 Github Initial commit code taken from the Creality Ender 3 S1 Github Repo: CrealityOfficial/Ender-3S1@f8be17f Crosschecked with the initial and following commits of Synman: synman@25d641e Laser implementation partly taken from Creality´s commit from: CrealityOfficial/Ender-3S1@cb5f3c3 Extended temperature table from mriscoc from: https://github.com/mriscoc/Ender3V2S1/blob/Ender3V2S1-Released/Marlin/src/module/thermistor/thermistor_1.h#L27 Cardreader Update inspiration taken from: https://github.com/CrealityOfficial/CR-10-Smart-Pro/blob/main/Marlin/src/lcd/dwin/lcd_rts.cpp Autopid implementation taken from here: https://github.com/CrealityOfficial/Ender-5S1 Meshviewer taken from: https://github.com/johncarlson21/SV04-Marlin-2.1.x housekeeping clean no. 1 included housekeeping clean no. 2 included housekeeping clean no. 3 included housekeeping clean no. 4 included housekeeping clean no. 5 included
1 parent 127bc94 commit 8907374

File tree

106 files changed

+13018
-937
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+13018
-937
lines changed

Marlin/Configuration.h

Lines changed: 275 additions & 115 deletions
Large diffs are not rendered by default.

Marlin/Configuration_adv.h

Lines changed: 114 additions & 91 deletions
Large diffs are not rendered by default.

Marlin/src/HAL/STM32/timers.cpp

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,116 @@ static constexpr bool verify_no_timer_conflicts() {
327327
// when hovering over it, making it easy to identify the conflicting timers.
328328
static_assert(verify_no_timer_conflicts(), "One or more timer conflict detected. Examine \"timers_in_use\" to help identify conflict.");
329329

330+
#if ALL(E3S1PRO_RTS, LASER_FEATURE)
331+
332+
#define LASER_TIMER_NUM 3
333+
#define LASER_TIMER_DEV _TIMER_DEV(LASER_TIMER_NUM)
334+
#define LASER_TIMER_PRESCALE(timer_clk, freq) ((timer_clk) / ((freq) * (LASER_TIMER_PWM_MAX + 1)))
335+
#define LASER_TIMER_IRQ_PRIO 1
336+
337+
typedef enum
338+
{
339+
LASER_PWM_STATE_L = 0,
340+
LASER_PWM_STATE_H
341+
}laser_pwm_state_t;
342+
343+
static HardwareTimer *timer_laser = nullptr;
344+
static uint8_t laser_h = 0, laser_l = 0;
345+
static laser_pwm_state_t laser_pwm_state;
346+
347+
FORCE_INLINE static void laser_timer_set_compare(const hal_timer_t overflow)
348+
{
349+
if (timer_laser)
350+
{
351+
timer_laser->setOverflow(overflow + 1, TICK_FORMAT);
352+
if (overflow < timer_laser->getCount())
353+
timer_laser->refresh();
354+
}
355+
}
356+
357+
static void laser_timer_handler(void)
358+
{
359+
// SERIAL_ECHO_MSG("laser_timer_handler");
360+
361+
switch(laser_pwm_state)
362+
{
363+
case LASER_PWM_STATE_L:
364+
laser_timer_set_compare(laser_h);
365+
WRITE(LASER_SOFT_PWM_PIN, 1);
366+
laser_pwm_state = LASER_PWM_STATE_H;
367+
break;
368+
case LASER_PWM_STATE_H:
369+
laser_timer_set_compare(laser_l);
370+
WRITE(LASER_SOFT_PWM_PIN, 0);
371+
laser_pwm_state = LASER_PWM_STATE_L;
372+
break;
373+
}
374+
}
375+
376+
void laser_timer_soft_pwm_start(uint8_t pwm)
377+
{
378+
// SERIAL_ECHOLNPAIR("laser_timer_soft_pwm_start():", pwm);
379+
380+
if(timer_laser == nullptr) return;
381+
382+
if(pwm > LASER_TIMER_PWM_MAX) pwm = LASER_TIMER_PWM_MAX;
383+
384+
if(pwm == 0x00)
385+
{
386+
laser_timer_soft_pwm_stop();
387+
}
388+
else if(pwm == 0xFF)
389+
{
390+
timer_laser->pause();
391+
OUT_WRITE(LASER_SOFT_PWM_PIN, 1);
392+
}
393+
else
394+
{
395+
timer_laser->pause();
396+
laser_pwm_state = LASER_PWM_STATE_H;
397+
WRITE(LASER_SOFT_PWM_PIN, 1);
398+
laser_l = LASER_TIMER_PWM_MAX - pwm;
399+
laser_h = pwm;
400+
laser_timer_set_compare(laser_h);
401+
timer_laser->resume();
402+
// 立即进入中断 -> 设置为0无法触发中断
403+
// laser_timer_set_compare(0);
404+
}
405+
}
406+
407+
408+
void laser_timer_soft_pwm_stop(void)
409+
{
410+
// SERIAL_ECHO_MSG("laser_timer_soft_pwm_stop()");
411+
412+
laser_timer_soft_pwm_start(1);
413+
}
414+
415+
void laser_timer_soft_pwm_close()
416+
{
417+
// SERIAL_ECHO_MSG("laser_timer_soft_pwm_close()");
418+
419+
if(timer_laser == nullptr) return;
420+
421+
timer_laser->pause();
422+
WRITE(LASER_SOFT_PWM_PIN, 0);
423+
}
424+
425+
void laser_timer_soft_pwm_init()
426+
{
427+
const uint32_t frequency = LASER_TIMER_FREQUENCY;
428+
if(timer_laser == nullptr)
429+
{
430+
timer_laser = new HardwareTimer(LASER_TIMER_DEV);
431+
uint32_t prescale = LASER_TIMER_PRESCALE(timer_laser->getTimerClkFreq(), frequency);
432+
timer_laser->setPrescaleFactor(prescale);
433+
timer_laser->setOverflow(_MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (timer_laser->getTimerClkFreq()) / (prescale) /* /frequency */), TICK_FORMAT);
434+
timer_laser->setPreloadEnable(false);
435+
if(!timer_laser->hasInterrupt()) timer_laser->attachInterrupt(laser_timer_handler);
436+
timer_laser->pause();
437+
timer_laser->setInterruptPriority(LASER_TIMER_IRQ_PRIO, 0);
438+
}
439+
}
440+
#endif
441+
330442
#endif // HAL_STM32

Marlin/src/HAL/STM32/timers.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,13 @@ FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const ha
118118

119119
#define HAL_timer_isr_prologue(T) NOOP
120120
#define HAL_timer_isr_epilogue(T) NOOP
121+
122+
#if ALL(E3S1PRO_RTS, LASER_FEATURE)
123+
#define LASER_TIMER_FREQUENCY 1000 // PWM freq:1000Hz
124+
#define LASER_TIMER_PWM_MAX 255 // PWM value range: 0~255
125+
126+
void laser_timer_soft_pwm_init();
127+
void laser_timer_soft_pwm_start(uint8_t pwm);
128+
void laser_timer_soft_pwm_stop(void);
129+
void laser_timer_soft_pwm_close();
130+
#endif

Marlin/src/HAL/STM32F1/timers.cpp

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,79 @@ timer_dev* HAL_get_timer_dev(int number) {
180180
}
181181
}
182182

183+
#if ALL(E3S1PRO_RTS, LASER_FEATURE)
184+
static unsigned int sw=0, laser_h = 0, laser_l = 0;
185+
186+
void laser_timer_soft_pwm_start(uint8_t pwm)
187+
{
188+
//SERIAL_ECHOLNPAIR("laser_timer_soft_pwm_start():", pwm);
189+
190+
if(pwm>255) pwm =255;
191+
if(pwm<=0) pwm = 1;
192+
193+
if(pwm <= 0X00){//
194+
timer_pause(LASER_TIMER_DEV);
195+
WRITE(LASER_SOFT_PWM_PIN, 0); //WRITE(PC0, 0);
196+
}else if(pwm>=0xFE){
197+
timer_pause(LASER_TIMER_DEV);
198+
199+
WRITE(LASER_SOFT_PWM_PIN, 1); //WRITE(PC0, 0);
200+
}else{
201+
timer_pause(LASER_TIMER_DEV);
202+
sw = 0;
203+
laser_l = 256 - pwm;
204+
laser_h = pwm;
205+
timer_resume(LASER_TIMER_DEV);
206+
}
207+
}
208+
209+
void laser_timer_soft_pwm_stop(void)
210+
{
211+
// SERIAL_ECHO_MSG("laser_timer_soft_pwm_stop()");
212+
// SERIAL_ECHOLNPAIR(str, val)
213+
214+
laser_timer_soft_pwm_start(1);
215+
}
216+
217+
void laser_timer_soft_pwm_close()
218+
{
219+
timer_pause(LASER_TIMER_DEV);
220+
WRITE(LASER_SOFT_PWM_PIN, 0);//WRITE(PC0, 0);
221+
}
222+
223+
void laser_timer_handler(void)
224+
{
225+
// SERIAL_ECHO_MSG("laser_timer_handler");
226+
227+
switch(sw)
228+
{
229+
case 0:
230+
timer_set_reload(LASER_TIMER_DEV, laser_l);//0xFFFF);
231+
WRITE(LASER_SOFT_PWM_PIN, 1);//WRITE(PC0, 1);
232+
sw = 1;
233+
break;
234+
case 1:
235+
timer_set_reload(LASER_TIMER_DEV, laser_h);//0xFFFF);
236+
WRITE(LASER_SOFT_PWM_PIN, 0);//WRITE(PC0, 0);
237+
sw=0;
238+
break;
239+
}
240+
}
241+
242+
void laser_timer_soft_pwm_init()
243+
{
244+
const uint32_t frequency = LASER_TIMER_FREQUENCY;
245+
timer_pause(LASER_TIMER_DEV);
246+
//timer_set_mode(LASER_TIMER_DEV, TEMP_TIMER_CHAN, TIMER_OUTPUT_COMPARE);
247+
timer_set_count(LASER_TIMER_DEV, 0);
248+
timer_set_prescaler(LASER_TIMER_DEV, (uint16_t)(LASER_TIMER_PRESCALE(frequency) - 1));
249+
timer_set_reload(LASER_TIMER_DEV, LASER_TIMER_PWM_MAX);//0xFFFF);
250+
//timer_set_compare(LASER_TIMER_DEV, TEMP_TIMER_CHAN, _MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (F_CPU) / (LASER_TIMER_PRESCALE) / frequency));
251+
timer_attach_interrupt(LASER_TIMER_DEV, TEMP_TIMER_CHAN, laser_timer_handler);
252+
timer_set_interrupt_priority(LASER_TIMER_NUM, LASER_TIMER_IRQ_PRIO);
253+
timer_generate_update(LASER_TIMER_DEV);
254+
// timer_resume(LASER_TIMER_DEV);
255+
}
256+
#endif
257+
183258
#endif // __STM32F1__

Marlin/src/HAL/STM32F1/timers.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,18 @@ FORCE_INLINE static void timer_no_ARR_preload_ARPE(timer_dev *dev) {
199199
void HAL_timer_set_interrupt_priority(uint_fast8_t timer_num, uint_fast8_t priority);
200200

201201
#define TIMER_OC_NO_PRELOAD 0 // Need to disable preload also on compare registers.
202+
203+
#if ALL(E3S1PRO_RTS, LASER_FEATURE)
204+
#define LASER_TIMER_NUM 3
205+
#define LASER_TIMER_DEV TIMER_DEV(LASER_TIMER_NUM)
206+
#define LASER_TIMER_FREQUENCY 1000 // PWM freq:1000Hz
207+
#define LASER_TIMER_PWM_MAX 255 // PWM value range: 0~255
208+
#define LASER_TIMER_PRESCALE(freq) (HAL_TIMER_RATE / (freq * (LASER_TIMER_PWM_MAX + 1))) // (72M/1000*256)=281
209+
#define LASER_TIMER_CHAN 1
210+
#define LASER_TIMER_IRQ_PRIO 1
211+
212+
void laser_timer_soft_pwm_init();
213+
void laser_timer_soft_pwm_start(uint8_t pwm);
214+
void laser_timer_soft_pwm_stop(void);
215+
void laser_timer_soft_pwm_close();
216+
#endif

0 commit comments

Comments
 (0)