Compare commits

...

341 Commits

Author SHA1 Message Date
3d-gussner f3e0dfd481
Merge pull request #4858 from 3d-gussner/MK3_build_tags
Add `t` and `c` build
2025-08-19 08:52:51 +02:00
3d-gussner 7731024edb
Merge pull request #4859 from 3d-gussner/MK3_Fix_M256
Fix M256 S mode
2025-04-22 22:03:53 +02:00
3d-gussner f915455dae Fix M256 S parameter 2025-04-22 18:42:22 +02:00
3d-gussner 295142a010 Fix semantic versioning 2025-04-16 07:31:41 +02:00
3d-gussner 242bc9d7a8 Prepare also draft releases when `t` or `c` tags are created 2025-04-16 07:20:29 +02:00
3d-gussner 88730dca2a Update github action to build `t` test (Alpha, Beta, RC) and `c` community tags 2025-04-16 06:51:17 +02:00
3d-gussner 66797abf84 Add `c`ommunity tag 2025-04-16 06:08:48 +02:00
3d-gussner 26ed278d02
Merge pull request #4763 from sarusani/RemoveLoadMenuOnAutoload
Remove lcd_menu_AutoLoadFilament
2025-03-10 08:17:12 +01:00
3d-gussner 6c6476cc6c
Merge pull request #4851 from 3d-gussner/MK3_LCD_Brightness
Add M256 [ B | D | S | T ]
2025-02-28 20:00:33 +01:00
3d-gussner a7682997f4 Optimisation, thanks @gudnimg 2025-02-28 07:56:51 +01:00
3d-gussner 34450f52a8 Add M256
- Removed hardcoded values and added
  - LCD_BACKLIGHT_LEVEL_HIGH 130
  - LCD_BACKLIGHT_LEVEL_LOW 50
  - LCD_BACKLIGHT_FORCE_ON 30
  - LCD_BACKLIGHT_TIMEOUT 15
2025-02-26 13:35:29 +01:00
3d-gussner a29c246af1
Merge pull request #4846 from 3d-gussner/MK3_M300_duration_set_4s_limit
M300 set 3.5s duration limit
2025-02-13 10:52:28 +01:00
sarusani 29907639ae Remove lcd_menu_AutoLoadFilament 2025-02-12 11:42:55 +01:00
3d-gussner c40af0c896 M300 set 3.5s duration limit 2025-02-11 17:59:50 +01:00
3d-gussner 9fb034a985
Merge pull request #4847 from 3d-gussner/MK3_action_cache_v4
Change actions/cache to v4
2025-02-11 17:57:34 +01:00
3d-gussner 1965743ba2 Change actions/cache to v4 2025-02-11 17:31:28 +01:00
3d-gussner c798754ec2
Merge pull request #4845 from 3d-gussner/MK3_workflow_atrifacts_v4
Update upload-atrifacts to version 4 as 3 is deprecated
2025-02-11 16:55:27 +01:00
sarusani e80c9fa315 Align MIN_Z raise for unload & load
Align values for load and unload to prevent movement between unload & load operations.
2025-02-11 06:03:43 +01:00
Anna Snoeijs 1a0e0a804f Added description on how to install dependencies on Fedora based distributions 2025-02-11 06:00:32 +01:00
3d-gussner c21dc36507 Update upload-atrifacts to version 4 as 3 is deprecated 2025-02-11 05:55:58 +01:00
3d-gussner e10c8d9c5a Fix rebase issue fix 2024-12-30 13:58:58 +01:00
3d-gussner 477d7ae5ef Add multiscreen message with `Cont.|Cancel`
Remove `Continue?` from some mesages to save "translation space" and replace multiscreen from `Yes|No` to `Cont.|Cancel`
Remove `Print canceled.` from check messages to save again "translation sapce" and after confirming the message the Status Line shows that it has been stopped.

fix rebase issue
2024-12-30 13:58:58 +01:00
3d-gussner ee4d8bb5e5 Fix lcd_status_message_level 2024-12-30 13:57:58 +01:00
3d-gussner 80cb13003e Show filename after SD print finished 2024-12-30 13:57:58 +01:00
gudnimg 901f63e90f remove incomplete dual stepper configuration
If either Y_DUAL_STEPPER_DRIVERS or Z_DUAL_STEPPER_DRIVERS is defined
the compilation will fail with an error message. This configuration will likely
never be fully implemented unless someone from the community steps up.
2024-12-30 13:57:08 +01:00
3d-gussner 3ea620c27a Eject translations in German and Dutch not shorten as it fits now the multiple choice. 2024-12-24 07:52:50 +01:00
3d-gussner a704b99d81 Fix multiple choice
Fixes #4819
2024-12-24 07:52:50 +01:00
gudnimg d3f95592c1 Convert uart2.c to a C++ file 2024-11-27 09:16:41 +01:00
gudnimg 6b01929382 Trim empty lines 2024-11-27 09:16:41 +01:00
gudnimg 4a0973941f Mark uart2_putchar and uart2_getchar as static 2024-11-27 09:16:41 +01:00
gudnimg 51e81217dd Remove unhelpful comments and constants 2024-11-27 09:16:41 +01:00
gudnimg 18bda84876 remove unused function uart2_rx_str_P 2024-11-27 09:16:41 +01:00
3d-gussner b7e3216944
Merge pull request #4811 from 3d-gussner/MK3_new_1st_layer_cal
Optimze and new first layer calibration
2024-11-27 09:10:04 +01:00
3d-gussner b67554eb01 Switch back from `%g` to `.4f`
Set short length so the square is printed in the middle of the bed
Both purge lines with and without MMU end at X=202.5 to get the square in the middle of the bed
2024-11-20 12:10:33 +01:00
Alexandra Voinea 7a47bf30be Fix end of meander overextrusion with new pattern 2024-11-20 09:28:21 +01:00
Alexandra Voinea 24ce71eded Optimize meander moves 2024-11-20 09:11:18 +01:00
Alexandra Voinea 519724b53d Ensure all meander moves are done using relative mode
Without this the first vertical move of the new meander would be slightly longer than expected due to using absolute moves from a negative Y starting position
2024-11-20 08:57:36 +01:00
Alexandra Voinea 81d124affd Minor nitpicks 2024-11-20 08:52:12 +01:00
Alexandra Voinea 13d12c0ffa Get rid of float casts 2024-11-20 08:38:19 +01:00
gudnimg e84ade3542 optimisation: combine a few functions calls into one
Change in memory:
Flash: -34 bytes
SRAM: 0 bytes
2024-11-19 19:50:12 +01:00
Alex Voinea 658df9d04d Extract G91 to messages.h/cpp 2024-11-18 10:12:05 +01:00
Alex Voinea 1319af8a12 Ensure that a correct feedrate is used at all times 2024-11-18 10:09:10 +01:00
Alex Voinea 44f9b953c5 remove unused step parameter in lay1cal sqaure 2024-11-18 09:51:02 +01:00
gudnimg 0b5afa3092 Unload the filament at parked position
We don't want to unload while the nozzle is still smudged against the bed.
2024-11-18 09:45:51 +01:00
gudnimg a0278b2844 Fix an issue where MMU unloads filament while its cooling down
Change in memory:
Flash: -6 bytes
SRAM: 0 bytes
2024-11-18 09:45:51 +01:00
3d-gussner d1470d8abc New first layer calibration
- changed to relative mode to save buffer and code size
- added NEW_FIRST_LAYER_CAL to perform 1st layer cal from front to back
2024-11-14 14:45:25 +01:00
3d-gussner d8d058a63b
Add Set parameter in M78 Statistics gcode (#4809)
* Add Set Statistics

* EEPROM_FILAMENTUSED is in centimeter and not meter
Fix few things

* Fix typo
2024-11-14 08:20:39 +01:00
3d-gussner 0fb17b1643
Merge pull request #4805 from 3d-gussner/MK3_Fix_MMU
Remove hardcoded MMU tool count
2024-11-10 11:56:55 +01:00
3d-gussner cdb6635eac Remove hardcoded MMU tool count
- Preload to MMU -> All
- Loading Test -> All
- SpoolJoin
2024-10-29 15:50:01 +01:00
3d-gussner ef3527eb0f
Merge pull request #4782 from 3d-gussner/MK3_3141_po
Update po files
2024-09-24 16:45:16 +02:00
3d-gussner 21084af026 Update po files 2024-09-24 16:37:43 +02:00
3d-gussner 24bfa8db59
Merge pull request #4780 from leptun/MBL_relax_tight_thresholds
Further relax the MBL tight threshold
2024-09-24 13:47:02 +02:00
Alex Voinea f12683f3ff Further relax the MBL tight threshold 2024-09-24 10:33:23 +02:00
3d-gussner aa4de7ae7e
Merge pull request #4773 from 3d-gussner/MK3_fix_unload
PFW-1561 Fix MMU unload issue
2024-09-23 07:39:18 +02:00
3d-gussner 402b9ed93a Add `#ifdef FANCHECK` thanks @gudnimg 2024-09-23 07:00:17 +02:00
3d-gussner 65a26e882b Enable Tune menu during fan check issues, user can then disable the fan check if needed.
Send //action:cancel when LCD Stop print is selected.
2024-09-18 16:09:46 +02:00
3d-gussner 29c920c801 Fix MMU unload issue after a fan check issue has been solved 2024-09-18 16:09:46 +02:00
3d-gussner ab5c7ac6c6
Merge pull request #4772 from gudnimg/FW-1562
PFW-1562 Fix an issue where safety timer is not handled correctly in `mFilamentPrompt` menu
2024-09-17 16:30:37 +02:00
gudnimg de092b35d5 PFW-1562 Fix an issue where safety timer is not handled correctly in mFilamentPrompt menu 2024-09-15 10:28:10 +00:00
3d-gussner 5aa67489da
Merge pull request #4768 from 3d-gussner/MK3_3141_test_prep
Prepare FW 3.14.1 for testing
2024-09-04 09:54:21 +02:00
3d-gussner 7d3032c001 Bump up version to FW3.14.1-RC1-8225 2024-09-04 09:33:47 +02:00
3d-gussner 2c621e025a Update pot and po files 2024-09-04 09:32:30 +02:00
3d-gussner 6ea47967da
Merge pull request #4765 from leptun/MBL_fixes
Region MBL fixes
2024-09-04 07:42:48 +02:00
3d-gussner 4e9e20c67f
Merge pull request #4766 from gudnimg/remove-sm4_line_xyze_ui
Remove sm4 line xyze UI
2024-09-03 15:22:56 +02:00
3d-gussner 2fed2f00f7
Update Czech translation
Thanks to @DRracer
2024-09-03 13:27:53 +02:00
3d-gussner 1c0a59f7c9
Update Hungarian translation
Thanks to @AttilaSVK
2024-09-03 11:47:14 +02:00
3d-gussner 3facdb4576 Add new message and translations 2024-09-03 09:34:18 +02:00
Alex Voinea cb502ee7bc Update MSG_MBL_FAILED translations
Thanks @3d-gussner
2024-09-03 09:28:16 +02:00
Alex Voinea b614b9c43d Do not prompt for steel sheet on bed during XYZ calibration
Thanks @3d-gussner
2024-09-03 09:28:16 +02:00
Alex Voinea b58d2ecccb Prompt user for Z calibration after failed MBL with yes-no screen 2024-09-03 09:28:15 +02:00
Alex Voinea 357b68cf76 Ask for steel sheet on bed during Z calibration 2024-09-03 09:28:15 +02:00
Alex Voinea d2119c24e1 Prompt Z calibration when 7x7 MBL is enabled 2024-09-03 09:28:15 +02:00
Alex Voinea 8196e48684 Reduce number of Z realignments before Z calibration is requested 2024-09-03 09:28:15 +02:00
Alex Voinea d8e3c2b481 Relax 3x3 MBL threshold 2024-09-03 09:28:15 +02:00
3d-gussner 83c43fba02
Merge pull request #4767 from gudnimg/linearity-correction-opt-v2
optimisation: Simplify saving linearity correction
2024-09-02 11:18:44 +02:00
Guðni Már Gilbert b3a682d330 Always re-init the TMC drivers after leaving linearity correction menu
Change in memory:
Flash: -22 bytes
SRAM: 0 bytes
2024-09-01 22:14:25 +00:00
gudnimg 312f79c5f5 optimisation: Simplify saving linearity correction
Keep in mind that the EEPROM addresses are in descending order. This means we
can't use eeprom_read_block() or eeprom_update_block()

Address --> Axis
3831 --> X-axis
3830 --> Y-axis
3829 --> Z-axis
3828 --> E-axis

Change in memory:
Flash: -118 bytes
SRAM: 0 bytes
2024-09-01 12:34:00 +00:00
Guðni Már Gilbert aa8569600c Fix build and make sm4 a C++ file 2024-09-01 12:12:24 +00:00
Guðni Már Gilbert a2d45e5d11 cleanup: remove unused global sm4_cpu_time 2024-09-01 12:11:56 +00:00
Guðni Már Gilbert f115adf894 cleanup: remove unused function sm4_get_dir 2024-09-01 12:11:56 +00:00
Guðni Már Gilbert 5a5c68f563 cleanup: remove unused function sm4_get_dir_bits 2024-09-01 12:11:56 +00:00
Guðni Már Gilbert 7d3c416d04 cleanup: remove unused function sm4_line_xyze_ui
No change in code size. Reason for removing this function
is just to reduce lines of code that is maintained.
2024-09-01 12:11:22 +00:00
3d-gussner 6c99a4463e
Merge pull request #4755 from sarusani/AddLoadIfAutoloadDisabled
Add "load filament" if autoload is disabled
2024-08-30 17:11:37 +02:00
sarusani a259482b6b Add load option if autoload is disabled 2024-08-30 14:48:45 +02:00
3d-gussner 923f926223
Merge pull request #4749 from gudnimg/remove-auto-bed-leveling
Remove legacy Auto Bed Leveling code
2024-08-30 10:44:50 +02:00
3d-gussner d3c326de99
Merge pull request #4727 from gudnimg/improve-missing-filament
PFW-1559 Add filament presence check at start of print
2024-08-30 10:44:05 +02:00
Guðni Már Gilbert af6fbb13de
Merge pull request #8 from 3d-gussner/MK3_fix_PR4727
Fix LCD output and add translations
2024-08-30 08:35:27 +00:00
3d-gussner 56de4bf53b Update Community translation list
- Croatian, Swedish and Norwegian are inactive since the last few translation review requests have not been done
2024-08-30 08:14:23 +02:00
3d-gussner b9b32b0d9f Update Slovak translation
Thanks to @ingbrzy @shatter136
2024-08-28 12:07:20 +02:00
3d-gussner 6af6b402cc Update Czech and Italian translations
Thanks to @DRRacer and @wavexx
2024-08-28 11:29:28 +02:00
3d-gussner 1a717986c1 Update Hungarian translation
Thanks to @AttilaSVK
2024-08-27 07:11:32 +02:00
3d-gussner 6fa80045b5 Another Dutch translation fix 2024-08-26 14:15:31 +02:00
3d-gussner ff9a476121 Update Dutch translation
Thanks to @stelgenhof
2024-08-26 14:13:28 +02:00
3d-gussner e90b536c9b Update Romainian translations
Thanks to @petrubecheru and @Hauzman
2024-08-26 13:46:23 +02:00
3d-gussner b353f1f008 Add missing translations
Used `trans -b :cs+de+es+fr+hr+hu+it+nl+no+pl+ro+sk+sv "<text>"` to translate
Looked at pre-translated text to reuse as much as possible.
2024-08-26 10:02:56 +02:00
3d-gussner c1360d7bfb Fix LCD output
Configuration->HW Setup->Checks showed `a`

MSG_FILAMENT `Filament` can only be 8 chars long and only ES and IT had `Filemanto` as translation.
But as ES the `o` in `Filamento` was overwritten by `[Estricto]` I removed the MSG_FILAMENT to be translated.
Saves few bytes.
2024-08-26 09:20:05 +02:00
gudnimg f7e3195d78 Remove CUSTOM_M_CODES define 2024-08-24 16:33:00 +00:00
Guðni Már Gilbert 2b1c49dae2 Remove legacy Auto Bed Leveling code
The goal is to clean up the project
2024-08-24 07:11:38 +00:00
Guðni Már Gilbert f5fe658728 fixup after rebase 2024-08-24 07:10:24 +00:00
Guðni Már Gilbert 5e66e71a48 Check if MMU is enabled by reading EEPROM 2024-08-24 07:10:24 +00:00
gudnimg 4ed5b36199 Use a fresh EEPROM cell for the new value 2024-08-24 07:10:24 +00:00
gudnimg 40d3830e6d Simplify filament_presence_check usage
Pull all checks needed into the function such that the caller
only needs to check the return value

Also added description for the filament_presence_check function
2024-08-24 07:10:23 +00:00
gudnimg 75c980c4e7 optimisation: deduplicate more code
Change in memory:
Flash: -54 bytes
SRAM: 0 bytes
2024-08-24 07:10:23 +00:00
Guðni Már Gilbert b7caf36207 optimisation: deduplicate printer check toggle menus
This saves ~100B of flash
2024-08-24 07:10:23 +00:00
Guðni Már Gilbert bf72ecc3f9 Add filament presence check at start of print
A new menu setting is added to configure how strict the check should be.

- None: No check is performed
- Warning (default): The user is warned about missing and is prompted to continue with Yes/No. If No is selected, the print is aborted. If no user input is given (e.g. from host printing) then the warning will expire in 30 seconds and assume the Yes option was selected
- Strict: If the filament is not detected when a print is started, it is immediately canceled.

The check is currently performed on G-codes: M24 and M75. Starting a SD print and Host print respectively.
2024-08-24 07:10:23 +00:00
3d-gussner 055f601ad3
Merge pull request #4751 from sarusani/FilamentRunoutActions
Send host actions on filament runout
2024-08-23 15:13:08 +02:00
3d-gussner 96d6192be5
Merge pull request #4760 from 3d-gussner/MK3_New_github_issue_templates
New GitHub issue templates
2024-08-23 14:52:02 +02:00
3d-gussner d3cec58a7a
Merge pull request #4761 from 3d-gussner/MK3_MMU303
Update MMU version to 3.0.3
2024-08-23 14:40:41 +02:00
3d-gussner 8fe73a0dc2 Update to MMU FW 3.0.3 2024-08-23 14:31:49 +02:00
3d-gussner c27fb616e0
Merge pull request #4737 from sarusani/ReplaceSetReadyMenuEntry
Allow to replace Set Ready menu entry
2024-08-23 14:30:44 +02:00
3d-gussner 7d66cd1ca0
Merge pull request #4758 from sarusani/CheckFSBeforeNozzleChange
Abort nozzle change if filament is loaded
2024-08-23 11:18:28 +02:00
sarusani a2022471ce Send host actions on filament runout 2024-08-23 10:44:38 +02:00
sarusani a9e7f387e8 Replace Set Ready menu entry
Replace "Set Ready"/"Set nor Ready" menu entry with "Print from host" entry.
Use "action:start" instead of "action:ready"
2024-08-23 10:24:01 +02:00
sarusani 64d9f201da Exit Nozzle Change if filament is loaded
Abort Nozzle change if fsensor is enabled and filament is present.
2024-08-23 10:12:01 +02:00
3d-gussner 2f7715a0b0
Merge pull request #4759 from Panayiotis-git/MK3_M600_Filament_name
PFW-1204: M600 - Show filament name at the Insert filament prompt
2024-08-22 16:26:58 +02:00
3d-gussner 0e84d0bb41 Update some text 2024-08-22 14:45:15 +02:00
Panayiotis-git 815b68678d M600 - Show filament name at the Insert filament prompt 2024-08-21 20:56:13 +03:00
3d-gussner f64f2bbe68
Merge pull request #4747 from gudnimg/minor-fixes-for-future-tests
Fix compiler warning and add missing includes in unit test environment
2024-08-20 11:14:06 +02:00
3d-gussner e2e6999887
Merge pull request #4753 from gudnimg/remove-HEATER_BED_DUTY_CYCLE_DIVIDER
Remove dead configuration `HEATER_BED_DUTY_CYCLE_DIVIDER`
2024-08-19 08:47:22 +02:00
Guðni Már Gilbert 3da141b3a7 Remove dead configuration HEATER_BED_DUTY_CYCLE_DIVIDER
Setting HEATER_BED_DUTY_CYCLE_DIVIDER has no effect on the firmware
2024-08-15 17:58:07 +00:00
3d-gussner 21fc1ddf00
Merge pull request #4750 from sarusani/LessZAxisMovementOnManualFilamentUnload
Lower MIN_Z_FOR_UNLOAD
2024-08-14 13:03:32 +02:00
sarusani d3f2dce430 Lower MIN_Z_FOR_UNLOAD
Sync value with Buddy firmware
2024-08-14 12:09:41 +02:00
3d-gussner 2f9dafcf97 Fix even more syntax 2024-08-14 11:16:49 +02:00
3d-gussner dad1e4081e Fix more syntax issues 2024-08-14 11:08:47 +02:00
3d-gussner be6c85cf0c Fix syntax 2024-08-14 11:04:39 +02:00
3d-gussner 8b2074e808 New github issue templates 2024-08-14 10:40:31 +02:00
Guðni Már Gilbert 80f27618c9 Marlin: drop lcd.h include
Only include it where needed
2024-08-13 23:40:18 +00:00
Guðni Már Gilbert 41245b2a59 Marlin: drop mmu2.h include
We should only be including it where needed
2024-08-13 23:26:09 +00:00
Guðni Már Gilbert 835caa0230 mesh_bed_calibration: drop Marlin.h include 2024-08-13 23:23:21 +00:00
Guðni Már Gilbert 0153eb05a1 util: add stdio.h include for sprintf_P 2024-08-09 14:57:07 +00:00
Guðni Már Gilbert a1fcb8564e util: reorder includes alphabetically
Place system includes on top
2024-08-09 14:57:07 +00:00
gudnimg f628c5f912 util: should include avr/eeprom.h
The file is calling eeprom_read_byte and should include avr/eeprom.h
2024-08-09 14:57:07 +00:00
gudnimg 9ae8beacc6 eeprom: add missing include stddef.h
Fixes compiler warning in test environment:

Prusa-Firmware/Firmware/eeprom.h:712:51: error: ‘size_t’ has not been declared
712 | bool eeprom_is_initialized_block(const void *__p, size_t __n);
      |
2024-08-09 14:57:07 +00:00
gudnimg ad1e3cb12a Configuration: missing stdint.h include
The following error is raised in unit testing environment:

Prusa-Firmware/Firmware/Configuration.h:16:14: error: ‘uint16_t’ does not name a type
   16 | extern const uint16_t _nPrinterType;
2024-08-09 14:57:07 +00:00
gudnimg 10d156b28c tests: Fix a compiler warning in tests -fpermissive
Prusa-Firmware/tests/../Firmware/util.h:114:25: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
  114 |         pStrEnd = strchr(this->ptr, '"');
      |                   ~~~~~~^~~~~~~~~~~~~~~~
      |                         |
      |                         const char*
2024-08-09 14:57:07 +00:00
3d-gussner 428091b7c7
Merge pull request #4736 from gudnimg/cleanup_recursion_hack
Remove recursion workaround in Nozzle Change
2024-08-08 11:17:28 +02:00
3d-gussner 80148a862d
Merge pull request #4744 from 3d-gussner/MK3_Update_Stale_bot
Update Stale bot message
2024-08-07 06:48:43 +02:00
3d-gussner bf19b34e11
Merge pull request #4746 from gudnimg/fix-broken-unit-tests-pipeline
tests: test_run_all target must depend on tests executable
2024-08-06 14:58:47 +02:00
gudnimg 0a60eb435c tests: test_run_all target must depend on tests executable
Otherwise the tests and Catch2 isn't built
2024-08-06 10:29:44 +00:00
3d-gussner ebbd58c6e2
Merge pull request #4733 from gudnimg/upgrade-ninja
Upgrade ninja from 1.10.2 to 1.12.1
2024-08-06 06:19:06 +02:00
3d-gussner ed3867ab09
Merge pull request #4745 from gudnimg/readme_update
Update Python version in README
2024-08-06 06:11:21 +02:00
Guðni Már Gilbert b2c17960df Update Python version in README
Python 3.6 and 3.7 are EOL
2024-08-05 17:16:10 +00:00
3d-gussner decebab9d4 Update Stale bot message 2024-08-05 09:36:27 +02:00
Guðni Már Gilbert c795b3956c
Merge pull request #4741 from gudnimg/cleanup_followup_gudni
PR 4739 follow-up (two things were missed)
2024-08-03 20:11:59 +00:00
gudnimg efc4cc4996 Remove unused enum MeshLevelingState 2024-08-03 16:48:08 +00:00
gudnimg 15670f21bd lcd_pick_babystep() doesn't exist anywhere 2024-08-03 16:32:41 +00:00
gudnimg 371c040e8a EEPROM_BABYSTEP_Z0 is no longer used anywhere in the code base 2024-08-03 16:32:20 +00:00
Guðni Már Gilbert 25a11bb7d7 Forbid LcdUpdateDisabler to call lcd_update()
The fixes a scenario where:

lcd_status_screen() calls lcd_commands() upon exiting
lcd_show_fullscreen_message_and_wait_P(_T(MSG_NOZZLE_CNG_READ_HELP));
and so not allowing the user to leave the screen since it will keep being rendered endlessly.

This change only affects lcd_show_fullscreen_message_and_wait_P
2024-08-03 15:43:08 +00:00
Guðni Már Gilbert f96cc2f400 cleanup recursion workaround in nozzle change
This fix is no longer needed today.

LCD knob clicks / and rotation, take care of updating lcd_draw_update.

The real bug was likely lcd_show_multiscreen_message_yes_no_and_wait_P calling lcd_update(), this is fixed now since.
2024-08-03 15:43:08 +00:00
Guðni Már Gilbert 48f7cd5270 Upgrade ninja from 1.10.2 to 1.12.1
The update brings better support for Windows :)

Changelogs:
* https://github.com/ninja-build/ninja/releases/tag/v1.12.1
* https://github.com/ninja-build/ninja/releases/tag/v1.12.0
* https://github.com/ninja-build/ninja/releases/tag/v1.11.1
* https://github.com/ninja-build/ninja/releases/tag/v1.11.0
2024-08-03 15:38:02 +00:00
Guðni Már Gilbert a926675c35 bootstrap: fix DeprecationWarning
DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.

See:
https://docs.python.org/3.12/library/tarfile.html#tarfile-extraction-filter
2024-08-03 15:38:02 +00:00
Guðni Már Gilbert ff16bfd8fa
Merge pull request #4739 from gudnimg/prune-disabled-code
Remove a bit of unused code which is disabled at compile time
2024-08-03 10:34:40 +00:00
Guðni Már Gilbert 23f92b24b8
Merge pull request #4735 from gudnimg/cleanup-dead-variable
Remove commented variable `load_filament_time`
2024-08-02 16:10:17 +00:00
Guðni Már Gilbert 04a7175cc7 Remove LARGE_FLASH preprocessor symbol
It's not very useful as is ... probably remnant from Marlin 1
2024-07-31 12:06:35 +00:00
Guðni Már Gilbert 81f1ec4975 Remove unused messages 2024-07-31 11:57:49 +00:00
Guðni Már Gilbert 0d45228dbd Remove commented lcd_update_enable(true) 2024-07-31 11:15:39 +00:00
gudnimg 396a8ca4f9 Remove VT100 code 2024-07-31 10:35:18 +00:00
gudnimg eb7969441a Remove Servo..h/cpp 2024-07-31 10:31:05 +00:00
gudnimg 2cbbdbacd5 Remove a bit of unused code which is disabled at compile time
Some of these have been used > 6 years and don't compile anymore.

Reason to want this removed is just to reduce the code we maintain
2024-07-31 09:53:45 +00:00
Guðni Már Gilbert 3f650a24aa
Merge pull request #4738 from sarusani/OptimzeEnum
Add type to enum
2024-07-30 20:01:17 +00:00
sarusani d485e4fb0b Add type to save 50B
Saves 50bytes
2024-07-30 15:15:05 +02:00
Guðni Már Gilbert bb1bb4d717 Remove commented variable load_filament_time 2024-07-28 17:41:23 +00:00
3d-gussner 5119e47419
Merge pull request #4728 from gudnimg/fix-mFilamentPrompt-timeout
Fix regression introduced in 3.13.0 where `mFilamentPrompt` menu times out after 30 seconds
2024-07-26 15:33:12 +02:00
gudnimg 8382815110 Fix inconsistent indendation in mFilamentPrompt() 2024-07-26 11:55:32 +00:00
gudnimg faa01b5a5f Fix an issue where mFilamentPrompt menu times out
Fixes a regression introduced in 3.13.0 here: a7e9ccfb57 (diff-5fbfdca43c192573e31d8e78d255c510fb6e213b118cf38173277ec2a2163880R7462)

Before 3.13.0, the menu never timed out until the safety timer turned off the heaters
After 3.13.0, the menu times out after 30 seconds.

The commit restores pre-3.13.0 behavior
2024-07-26 11:52:20 +00:00
3d-gussner cea5f70974
Merge pull request #4710 from Tirpitz93/fix-dev-and-dirty-cmake
Fix String substitution when `DEV` flavour is built dirty
2024-07-25 08:46:28 +02:00
3d-gussner 3722a17e5a
Merge pull request #4647 from gudnimg/mmu-sync-april
MMU maintenance: Sync with 32-bit FW a little bit
2024-07-24 10:02:24 +02:00
gudnimg 4dc9fd4972 MMU: revert fallthrough in LogicStep 2024-07-23 15:55:47 +00:00
3d-gussner 3cb722403b
Merge pull request #4717 from gudnimg/fix-unconsumed-button-press
Fix an issue in manual fan check where prior knob clicks are not consumed
2024-07-16 08:57:30 +02:00
gudnimg a7004cd067 Fix an issue in manual fan check where prior knob clicks are not consumed 2024-07-15 13:52:30 +00:00
3d-gussner 39c8c4f560
Merge pull request #4659 from 3d-gussner/MK3_build_script
PFW-1460 Update build scripts
2024-07-12 08:36:32 +02:00
3d-gussner 62a1c1478d
Merge pull request #4708 from 3d-gussner/MK3_Cmake_workaround_wildcard_issue_non_Linux
Cmake workaround wildcard issue non linux system
2024-07-12 08:35:34 +02:00
3d-gussner 2ed3ee8410
Merge pull request #4280 from sarusani/DelayZAxisonAutoload
Delay Z-Axis on Autoload
2024-07-11 09:00:50 +02:00
lselter 695ba5d5db Fix String substitution when `DEV` flavour is built with a dirty local version both instances of -D were replaced with commit count 2024-07-09 15:44:40 +01:00
3d-gussner f687fe3e2e Fix MK2.5/S builds on Windows 2024-07-09 16:07:02 +02:00
3d-gussner d769fcc094 Workaround for Windows/Mac wildcard issue
Only zip MK2.5/S and E3DREVO on Linux
2024-07-09 15:43:52 +02:00
gudnimg 99e306f4a3 MMU: minor formatting sync 2024-07-06 17:24:40 +00:00
gudnimg d548bb68fd MMU: revert WaitForHotendTargetTempBeep(); position in code
The 8-bit FW uses a different Fullscreen UI which doesn't show the current temperature. So, for now, keep calling WaitForHotendTargetTempBeep  before showing the full-screen message.
2024-07-06 16:55:32 +00:00
Guðni Már Gilbert 09f1d85e9c MMU: Revert changes to execute_extruder_sequence loop
The previous for-loop is more memory efficient and saves 20 bytes of Flash
2024-07-06 16:55:32 +00:00
Guðni Már Gilbert 61b4270129 MMU: allow inlining UInt16ToHex
Saves 22 bytes of Flash
2024-07-06 16:55:32 +00:00
Guðni Már Gilbert 592fc56bfc MMU: Sync code with 32-bit
The changes in this commit are mainly formatting

But there are some changes like adding a new function planner_draining()
2024-07-06 16:55:32 +00:00
sarusani 5efae44eb7 Delay Z-Axis on Autoload
Delay z-axis movement when the operators hand is close to the printhead.
2024-07-05 16:12:07 +02:00
3d-gussner 72ffc28952 Add build.py 2024-07-05 09:06:22 +02:00
3d-gussner e405e9140c
Merge pull request #4687 from 3d-gussner/MK3_Replace_hard_coded_values_1
Replace hardcoded values
2024-07-05 07:54:07 +02:00
3d-gussner bc48d34a2f Replace hradecoded XYZ Z correction value with Z_MAX_POS_XYZ_CALIBRATION_CORRECTION 2024-07-04 10:12:38 +02:00
3d-gussner 152b290d1d
Merge pull request #4689 from 3d-gussner/MK3_PFW-964
PFW-964: Skip filament unload/load after Shipping factory reset
2024-07-03 13:20:49 +02:00
3d-gussner 3c7ae1e9fc
Merge pull request #4690 from 3d-gussner/MK3_Documentation
Update doxygen documentation remove white spaces
2024-05-30 14:43:29 +02:00
3d-gussner ac63fafc33
Merge pull request #4696 from 3d-gussner/MK3_Fix_cmake_MK25S_build
Fix cmake build of MK2.5 and MK25S
2024-05-30 14:42:13 +02:00
3d-gussner db64997687 Add `${FW_LANG_PATCH}.bin` to DEPENDS 2024-05-30 08:21:51 +02:00
3d-gussner 827c3025a4 Fix cmake build of MK2.5 and MK25S 2024-05-29 18:01:53 +02:00
3d-gussner 45a223a1f9 Remove White spaces 2024-05-20 19:09:03 +02:00
3d-gussner e110153ee2 Cleanup doxgen documentation and white spaces 2024-05-20 18:35:09 +02:00
3d-gussner 9a56f1e4c1 Skip filament unload/load after Shipping factory reset
when MMU is enabled. With MMU enabled no filament should be
loaded while idle.
2024-05-16 12:48:49 +02:00
3d-gussner eaeb722adb
Merge pull request #4681 from gudnimg/add-workaround-for-tune-button
MMU: Add workaround for broken Tune button
2024-05-06 12:50:41 +02:00
Guðni Már Gilbert 6f915ee401 MMU: Add workaround for broken Tune button
If the MMU is processing a command, the Tune button can't be executed.

Change in memory:
Flash: +16 bytes
SRAM: 0 bytes
2024-05-04 00:22:17 +00:00
3d-gussner abdee5b7f3
Merge pull request #4679 from 3d-gussner/MK3_Crash_detect_raise_z
Replace hard coded crash z lift value with Pause Z lift value.
2024-05-03 08:08:48 +02:00
3d-gussner 08d26fdee2 Replace hard coded crash z lift value with Z lift value.
With `M125 Z<value>` you can set the Z lift value via gcode as requested.
Fixes #3419
2024-05-02 11:37:13 +02:00
gudnimg 28502a2b6e optimisation: remove 1 more call to __divsf3
Changing (feedrate * feedmultiply) / 6000.f
to (feedrate * feedmultiply) * (1.f / 6000.f)

Replaces the call to __divsf3 with __mulsf3 which is better

No change in memory
2024-04-23 09:18:45 +02:00
Guðni Már Gilbert 2c46e1b344 optimisation: remove 3 calls to __divsf3
Change in memory:
Flash: -34 bytes
SRAM: 0 bytes
2024-04-23 09:18:45 +02:00
3d-gussner d22245b482
Merge pull request #4658 from 3d-gussner/MK3_PFW-762_Ambient_shutdown_80C
PFW-762 ambient shutdown at 80 C
2024-04-19 15:06:03 +02:00
3d-gussner e8d55486fe
Merge pull request #4661 from gudnimg/PFW-1557
PFW-1557 MMU: Improve unload handling when print is aborted
2024-04-15 15:13:09 +02:00
3d-gussner 6e40fe05fc
Merge pull request #4657 from 3d-gussner/MK3_PP_ACCEL_JERK
Add max acceleration mm per s2, feedrates and jerk save and restor du…
2024-04-15 15:11:57 +02:00
3d-gussner 34591f0465
Merge pull request #4663 from 3d-gussner/MK3_Fix_Autoreport
Fix Autoreport
2024-04-15 15:06:12 +02:00
3d-gussner 51b119a3ec Fix Autoreport broken in 3957dc91aa 2024-04-15 12:09:43 +02:00
3d-gussner 1292a82f70 Fix typos 2024-04-15 07:45:36 +02:00
3d-gussner f50e754f26 Use of `eeprom_update_block_notify` and `eeprom_read_block` reduces the flash usage a lot.
Thanks to @gudnimg
2024-04-15 07:45:36 +02:00
3d-gussner 5c0e014215 Add max acceleration mm per s2, feedrates and jerk save and restor during power panic
Thanks to @wavexx in #2456
2024-04-15 07:45:36 +02:00
gudnimg 16dfcfeb9a MMU: Improve unload handling when print is aborted
- Don't allow re-heating the nozzle or the MMU to unload the filament if the print was aborted by a temperature error
- Allow MMU to unload filament if there is no temperature error, and there is no fan error when Fan check is enabled
- When Fan check is disabled, the MMU may unload if there is no temperature error

Change in memory:
Flash: +14 bytes
SRAM: 0 bytes

PFW-1557
2024-04-14 12:07:56 +00:00
3d-gussner 52ac95f082
Merge pull request #4600 from sarusani/ChangeRevoNozzleChangeMenu
Adjust Nozzle Change Menu For Quick Change Nozzles
2024-04-11 19:19:01 +02:00
3d-gussner 361ce65e5c
Merge pull request #4644 from sarusani/AddEjectToFilamentLoadMSG
Add Eject Option To Filament Load Message
2024-04-11 19:18:42 +02:00
3d-gussner 36282aae1b Change Ambient board thermistor safety shutdown to 80 C 2024-04-10 17:56:26 +02:00
3d-gussner 5b96ff6d37
Merge pull request #4656 from 3d-gussner/MK3_PP_EXT_MINTEMP
Add Extrude mintemp save and restore during power panic
2024-04-09 18:44:47 +02:00
sarusani bc04f16906 Adjust Nozzle Change Menu For Quick Change Nozzles
- Show warning if extruder temp is > 40 degrees
- Use fan to speed up cooldown
- Show confirmation msg
- Show nozzle diameter setting after nozzle change
2024-04-09 16:12:46 +02:00
sarusani bd935db31e Add Eject Option To Filament Load Message 2024-04-09 15:50:17 +02:00
3d-gussner e5d504b855 Add Extrude mintemp save and restore during power panic
Thanks to @wavexx in #3008
2024-04-09 09:34:24 +02:00
3d-gussner 02822c59ad
Merge pull request #4591 from gudnimg/cleanup_cancel_heatup
Remove redundant ` cancel_heatup` assignment
2024-04-09 08:17:09 +02:00
3d-gussner fbbcdd0808
Merge pull request #4613 from gudnimg/optimise-axis_ustep_resolution
optimisation: initialise `axis_ustep_resolution` in EEPROM
2024-04-08 16:13:52 +02:00
Guðni Már Gilbert 022eaa1820
Merge pull request #4645 from gudnimg/full-screen-code-duplicate
ultralcd: merge two functions into one as cleanup
2024-04-06 13:50:48 +00:00
3d-gussner ed9d7f3ac1 ultralcd: merge two functions into one
lcd_show_fullscreen_message_yes_no_and_wait_P and lcd_show_multiscreen_message_yes_no_and_wait_P
are the same function. Let's drop one of them so we only have one symbol for the function.

No change in memory

Fix rebase
2024-04-05 19:33:15 +02:00
3d-gussner a4a7b09fe7
Merge pull request #4651 from 3d-gussner/MK3_Fix_Insert_filament_fr_hu
Fix issue Insert filament ... message in French and Hungarian
2024-04-04 09:20:48 +02:00
3d-gussner c515038e7d
Merge pull request #4650 from 3d-gussner/MK3_LCD_Menu_cleanup
LCD_Menu_cleanup
2024-04-04 09:19:50 +02:00
3d-gussner feebac54fc Fix issue #4424
Fix rebase
2024-04-04 09:08:44 +02:00
3d-gussner b3a410abdc Fix #3361 2024-04-04 09:04:48 +02:00
3d-gussner 3fa03ec1fb
Merge pull request #4565 from 3d-gussner/MK3_All_translations_in_messages
Move all _i(" to messages.cpp/.h
2024-04-04 09:03:30 +02:00
3d-gussner a93cd93756 Move `MK3 firmware detected on MK3S printer` and `MK3S firmware detected on MK3 printer` to `messages.cpp/.h`
Update pot and po files
2024-04-04 08:58:46 +02:00
3d-gussner 97584d571e Update all `_i("` to `messages.cpp/.h`
Update `lang/po/*.po*` files
2024-04-04 08:23:40 +02:00
3d-gussner af03662c8f
Merge pull request #4602 from 3d-gussner/MK3_M913
Enable M913
2024-04-04 07:30:06 +02:00
3d-gussner 0c9bf5d435
Merge pull request #4635 from 3d-gussner/MK3_PP_improvements
Power Panic and LCD menu
2024-03-28 06:59:07 +01:00
3d-gussner 8d1be264e5 Thanks to @gudnimg pointing out duplicate if statements that are covered by the top-level if statement. 2024-03-27 17:44:50 +01:00
3d-gussner 9e8aadd8af Revert split if statements
Kept few as these get too long
2024-03-27 10:15:07 +01:00
3d-gussner 5f26d5f7da Fix MK2.5 builds
- removed `reset_uvlo` as `#ifdef UVLO_SUPPORT` everywhere for MK2.5 is a huge change.
2024-03-27 09:42:59 +01:00
3d-gussner 1ac69247d7 Fix and improve PowerPanic
- No wait for heatup during host print recovery
- No extra Z lift when power panic happens during paused print
  - added an extra EEPROM value
  - fixed `EEPROM_LAST_ITEM`
  - changed EEPROM version to 3.14.0
- Added `reset_uvlo` function
2024-03-27 09:09:55 +01:00
3d-gussner 52275322a2 Remove redundant check 2024-03-20 08:41:29 +01:00
Alex Voinea b6e2a8875b M913 report rescaled currents 2024-03-15 12:47:18 +01:00
3d-gussner 2df8a18fde Fix MK2.5/S builds 2024-03-15 12:47:18 +01:00
3d-gussner 82d102d740 Enable M913 2024-03-15 12:47:18 +01:00
3d-gussner 9f8115639a LCD menu
- Hide menus during recovering
- Un-/Load filament with FSensor active only show Load OR Unload depending on FS sate
- Host
  - Reprint only shown when M79 timer is active
  - Resume only shown when M79 timer active
- Stop print always shown when printing, paused and recovering
2024-03-13 17:43:00 +01:00
3d-gussner a04063f966 Fix DEBUG_UVLO_AUTOMATIC_RECOVER 2024-03-13 17:43:00 +01:00
3d-gussner e2823c3c35 Reset EEPROM_UVLO after recovering
Undo PP Z lift
2024-03-13 17:43:00 +01:00
3d-gussner 9e52b78285 Add ubs_timer.start to PRUSA uvlo
Cleanup format
2024-03-13 17:43:00 +01:00
3d-gussner 15ea2784c3 Fix another saved_printing_type issue 2024-03-13 17:43:00 +01:00
3d-gussner 4e032f6f11 Change to saved_printing_type fixes few issues during power panic recovery 2024-03-13 17:43:00 +01:00
3d-gussner fc157d1f6c Fix missing eeprom_update_byte for debuging 2024-03-13 17:43:00 +01:00
3d-gussner 5b7c583dba Fix `print_saved_in_ram` to be true for both SD and host prints 2024-03-13 17:43:00 +01:00
3d-gussner 9ec5639d29 Rename `sd_print_saved_in_ram` to `print_saved_in_ram` as it saves sd and host prints 2024-03-13 17:43:00 +01:00
3d-gussner 112d3c672c Update debug_printer_states 2024-03-13 17:43:00 +01:00
3d-gussner 16aa2e7834 Hide LCD menu "Reprint" during power panic recovery 2024-03-13 17:43:00 +01:00
3d-gussner 886d610524 Cancle power recovery correctly using cancel_saved_printing(); 2024-03-13 17:43:00 +01:00
3d-gussner 95c6ea5889 Fix to correct EEPROM address 2024-03-13 17:42:59 +01:00
3d-gussner 47235bbf62 Power panic recover lift by 20 Z_PAUSE_LIFT only once
by setting PENDING_RECOVERY_RETRY
Also the default saved_printing_type after a reboot is now PRINT_TYPE_NONE
2024-03-13 17:42:59 +01:00
3d-gussner 88b77ecce2 Add bool printer_recovering 2024-03-13 17:42:59 +01:00
3d-gussner 517900c3fe Add DEBUG_PRINTER_STATES 2024-03-13 17:42:59 +01:00
3d-gussner 4235f784b9
Merge pull request #4622 from prusa3d/vintagepc/automatic-releases
Auto-create releases when a build is tagged.
2024-03-13 16:27:16 +01:00
3d-gussner 9df3846ffa
Remove white space 2024-03-13 16:23:51 +01:00
VintagePC 18c7c8c55b Quotes, perhaps 2024-03-12 18:55:38 -04:00
vintagepc 2ad76e225b
Update build.yml
Use ${{ github.workspace }} instead
2024-03-12 07:40:34 -04:00
VintagePC 50ba83219f Try fixing paths 2024-03-11 19:02:24 -04:00
vintagepc 84259de765
Update build.yml
Fix bug in run specifiers
2024-03-11 08:31:19 -04:00
3d-gussner b43ee3bf3d
Merge pull request #4628 from 3d-gussner/MK3_Stale_action_V9
Update stale action to v9 as Node.js 16 are deprecated.
2024-03-08 13:01:54 +01:00
3d-gussner ad35740092 Update stale action to v9 as Node.js 16 are deprecated. 2024-03-08 10:49:12 +01:00
VintagePC 361627d91d Use simplified filenames without hash/build counter 2024-03-04 18:51:11 -05:00
3d-gussner 1619db5b62
Merge pull request #4625 from 3d-gussner/MK3_MMU302
Bump up MMU FW version to 3.0.2
2024-03-04 14:06:18 +01:00
D.R.racer 4bca4021c6 Bump up MMU FW version to 3.0.2
.
2024-03-04 11:55:54 +01:00
VintagePC c0284497e3 Facilitate automatic release uploads of artifacts 2024-03-01 20:00:27 -05:00
3d-gussner 2d9dbecd5d
Merge pull request #4619 from 3d-gussner/MK3_DEBUG_EEPROM_CHANGES
Add DEBUG_EEPROM_CHANGES

I gonna merge this and maybe @gudnimg can improve it later. Need this for 3.14.0 PowerPanic debugging
2024-02-27 16:16:32 +01:00
3d-gussner f9bdb8b8aa Add DEBUG_EEPROM_CHANGES 2024-02-27 08:56:18 +01:00
3d-gussner c7b5fd59ed
Merge pull request #4617 from leptun/cherrypick_xyzcal_use_stallguard_during_z_cal
Cherrypick xyzcal use stallguard during z cal
2024-02-26 10:27:45 +01:00
Alex Voinea af64d446bf Fix MK2.5 build 2024-02-26 10:14:01 +01:00
Alex Voinea aededa34bb Properly check for Z crashes while lowering/raising Z for Z calibration 2024-02-26 10:13:56 +01:00
Alex Voinea 326019a8bf Use stallguard during Z calibration after XYZ calibration 2024-02-26 10:13:51 +01:00
Alex Voinea 692f062fee Add tmc currents debug 2024-02-26 10:13:45 +01:00
Guðni Már Gilbert 0a727d8573 optimisation: initialise axis_ustep_resolution in EEPROM
When the cs variable is loaded into RAM, cs.axis_ustep_resolution will always have some value and none of the 0xff values.

Change in memory:
Flash: -40 bytes
SRAM: 0 bytes
2024-02-24 15:46:32 +00:00
3d-gussner 665692b73e
Merge pull request #4614 from gudnimg/sudo-apt-update
CI: Add sudo apt-get update
2024-02-24 16:44:02 +01:00
Guðni Már Gilbert 704003295a CI: Add sudo apt-get update
See: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/customizing-github-hosted-runners#installing-software-on-ubuntu-runners

> Note: Always run sudo apt-get update before installing a package. In case the apt index is stale, this command fetches and re-indexes any available packages, which helps prevent package installation failures.
2024-02-24 15:29:21 +00:00
3d-gussner c5a036d817
Merge pull request #4601 from leptun/MK3_TMC_restore_currents_post_home
Mk3 TMC restore currents post home
2024-02-19 17:08:24 +01:00
Alex Voinea ccb956eae4
Restore custom currents after homing end 2024-02-19 15:33:06 +01:00
Alex Voinea e6a4856196
Restore default XY currents after homing 2024-02-19 15:32:22 +01:00
3d-gussner f80fb4c17c
Merge pull request #4594 from 3d-gussner/MK3_Action_fix
Update action as v3 is deprecated
2024-02-13 20:08:25 +01:00
3d-gussner f9671d40c7 Update action as v3 is deprecated 2024-02-13 08:32:54 +01:00
3d-gussner dc3b3387ed
Merge pull request #4593 from 3d-gussner/MK3_Fix_Stop_print_for_host_prints
Fix Stop print to send host action when host print is active
2024-02-05 10:39:49 +01:00
3d-gussner 8e26a95630
Merge pull request #4590 from gudnimg/PFW-1552-v2
PFW-1552 Fix a regression introduced in f022567
2024-02-05 08:54:52 +01:00
3d-gussner 727a82bb3d Fix Stop print to send host action when host print is active 2024-02-05 08:14:10 +01:00
gudnimg 020239687a Remove redundant cancel_heatup assignment
cancel_heatup is set to false inside wait_for_heater()
there is no need to do it before the function call

Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
2024-02-04 12:15:58 +00:00
gudnimg 794251884a PFW-1552 Fix a regression introduced in f022567
Aborting the print while the nozzle and bed are still heating up
to their target temperatures should disable the heaters immediately.
2024-02-04 12:06:14 +00:00
3d-gussner c999c2948e
Merge pull request #4586 from leptun/fix_3x3_mbl
Fix 3x3 mbl condition
2024-02-03 12:57:16 +01:00
Alex Voinea bacb0b1b07
Fix 3x3 mbl condition 2024-02-02 14:45:30 +01:00
3d-gussner 6682237c7a
Merge pull request #4582 from gudnimg/PFW-1552
PFW-1552 and PFW-1544: Fix issue with MMU unload when a print is stopped with a cold nozzle
2024-02-01 06:22:49 +01:00
3d-gussner 6714d4df3f
Merge pull request #4547 from 3d-gussner/MK3_PL_Fixes
Fix few PrusaLink/PrusaConnect reported issue
2024-01-29 13:08:26 +01:00
3d-gussner e7ef3d6db5 Fix nitpicking 2024-01-29 13:07:48 +01:00
3d-gussner 52ba1b534d Add HOST power panic auto recovery option
Change `PRINT_TYPE_USB` to `PRINT_TYPE_HOST`

Fix more rebase issues

Fix rebase issue again
2024-01-29 13:07:48 +01:00
3d-gussner ffeda98894 Add power panic recovery to active state
Fix M79 send only recovery action when power panic recovery is pending

Fix rebase issues
2024-01-29 13:07:48 +01:00
3d-gussner d1b88e1684 Don't show `Print from SD` when host print is paused 2024-01-29 13:07:48 +01:00
3d-gussner c9aba688e3 Saving few bytes by removing spaces in `//action:` host commands. Thanks to @sarusani pointing out inconsistent documentation.
Renaming `MSG_OCTOPRINT_*` to `MSG_HOST_ACTION_*` as it is used also with PrusaLink and other host printing solutions

Fix rebase issues
2024-01-29 13:07:48 +01:00
3d-gussner fda30f82c8 Don't show `Set Ready`when not idle 2024-01-29 13:07:48 +01:00
3d-gussner e5c5720d03
Merge pull request #4583 from gudnimg/PFW-1553
PFW-1553 fix regression where SD card file is not closed when stopping paused print
2024-01-29 09:48:55 +01:00
gudnimg abcb1017f3 PFW-1553 fix regression where SD card file is not closed when stopping paused print
When a print is paused, card.sdprinting is set to false. Instead we can check
if the SD card has been mounted and try to close the file.

The closefile() method will check internally whether or not the file is open.
2024-01-27 15:21:08 +00:00
gudnimg f022567239 PFW-1522 Fix an issue where MMU unloads while nozzle is cold if print is stopped
In the case of a Fan Error, the print is paused. If the nozzle is allowed to cool for a while before the print is stopped via the LCD, then the MMU will try to unload with a cold nozzle.

This can happen with ANY recoverable thermal errors.

In this commit I attempt to fix all scenarios. Including PFW-1544 where the nozzle is cooling down when the print has finished normally.

PFW-1544
PFW-1552

Change in memory:
Flash: +74 bytes
SRAM: 0 bytes
2024-01-27 11:54:54 +00:00
gudnimg c0b76dd5cf cleanup: move st_synchronize under the if statement
If the if statement is not true, then the st_synchronize call is not useful

The raise_z call above the if statement does not need it since it always calls st_synchronize (blocking move)

No change in memory
2024-01-27 10:47:23 +00:00
3d-gussner 8fa97cffda
Merge pull request #4576 from 3d-gussner/MK3_Improve_Versioning_and_Dump
PFW-1307: Add commit number and hash to `M115`
2024-01-23 15:57:23 +01:00
3d-gussner 3957dc91aa Add commit number and hash to `M115`
Don't show UUID only if defined
2024-01-22 16:31:23 +01:00
3d-gussner b80965731f
Merge pull request #4421 from gudnimg/sd-card-mount-opt
cleanup: Don't set root directory if SD card fails to mount + 3 renames
2024-01-22 09:11:19 +01:00
3d-gussner 02b91dc2cb
Merge pull request #4563 from 3d-gussner/MK3_Quick_nozzle_change_menu
Add nozzle diameter change to main menu for REVO builds
2024-01-19 14:26:18 +01:00
3d-gussner b56330819c
Merge pull request #4573 from 3d-gussner/MK3_Improve_build
Improve cmake build
2024-01-19 14:23:17 +01:00
3d-gussner 902c2f71c9 New hex file naming 2024-01-19 14:21:47 +01:00
3d-gussner a21647e0a7
Merge pull request #4574 from 3d-gussner/MK3_Remove_travis
Remove Travis checks
2024-01-19 14:12:27 +01:00
3d-gussner 8e91fb978b Remove Travis checks
Github actions work well and no need for additional travis check.
2024-01-19 08:28:35 +01:00
3d-gussner 6da1ec924b
Merge pull request #4567 from 3d-gussner/MK3_M850_show_active_sheet
M850 shows active sheet
2024-01-15 08:56:04 +01:00
3d-gussner 339a10eb81
Merge pull request #4556 from gudnimg/usb-timer-fix
Restart USB timer during long moves
2024-01-12 14:41:51 +01:00
3d-gussner 98889cafbf
Merge pull request #4560 from gudnimg/fix-print-paused
Fix pause indicator when print job timer is not used
2024-01-12 14:41:33 +01:00
3d-gussner f3e5444d47 M850 shows active sheet
Prevent sheet being active if not initialized
2024-01-12 13:41:55 +01:00
3d-gussner 13fb11889e Minor cosmetic changes voted by community 2024-01-12 07:20:33 +01:00
gudnimg adf2ecabc1 Fix pause indicator when print job timer is not used
Fixes #4554

Change in memory:
Flash: +50 bytes
SRAM: +1 byte
2024-01-11 19:30:30 +00:00
3d-gussner d5a5835059 Add nozzle change to main menu when QUICK_NOZZLE_CHANGE is defined
Add Nozzle diameter to Info screen when printer inactive and QUICK_NOZZLE_CHANGE defined
Solves #4488
2024-01-11 07:36:51 +01:00
3d-gussner 8d50d29776
Merge pull request #4553 from sarusani/shutdownHostLCDEntry
Add Shutdown host to LCD Menu
2024-01-11 07:33:16 +01:00
3d-gussner 6424703d2b
Merge pull request #4562 from 3d-gussner/MK3_Fix_Tune_Auto_home_layer_shift
PFW-1551: Fix Pause->Tune->Auto Home layer shift
2024-01-11 07:31:30 +01:00
3d-gussner f18fc2bbce Fix Pause->Tune->Auto Home layer shift 2024-01-09 11:07:29 +01:00
3d-gussner d6250592b2
Merge pull request #4559 from 3d-gussner/MK3_PFW-849_Selftest
PFW-849 Unify Selftest messages
2024-01-08 08:25:23 +01:00
sarusani 2199ef8bc4 Add translations 2024-01-06 09:40:51 +01:00
Guðni Már Gilbert ae31c0ec31 optimisation: used expired() instead of elapsed()
If the timer is expired, then the timer is stopped. This is OK since
we are starting the timer again anyway

Change in memory:
Flash: -14 bytes
SRAM: 0 bytes
2024-01-06 00:23:19 +00:00
gudnimg 09952db139 Restart USB timer during long moves
When long moves are planned and executed the USB timer can expire.

In PrusaSlicer 2.7.1 the Toolchange command (T0, T1, etc.) is sent while the USB timer is expired. This will trigger
a manual MMU unload in the firmware. Not only does this trigger a loud beep from the buzzer, but this will also significantly increase print time.

The issue only affects host prints. SD card printing does not have this issue.

Fixes #4551

The fix in this commit is the following:
If there are blocks queued while printing via host AND the USB timer is halfway expired WHILE executing a move. Then simply restart the timer to keep it alive.

Change in memory:
Flash: +62 bytes
SRAM: 0 bytes
2024-01-06 00:23:19 +00:00
sarusani 59093107fd Add #ifdef HOST_SHUTDOWN 2024-01-06 00:45:06 +01:00
sarusani 49f9d7abdc Add Shutdown host to LCD Menu
Add "Shutdown host" entry to LCD menu if printer is not active and host is connected.
2024-01-06 00:45:06 +01:00
3d-gussner db044163f9 Unify Selftest messages 2024-01-04 11:18:07 +01:00
3d-gussner ba027dd41e
Merge pull request #4552 from gudnimg/reprint-opt
reprint: reduce duplicate code
2024-01-03 14:45:57 +01:00
gudnimg 9bd043c83b Move restore_file_from_sd out of power panic file
This function is not specific to power panic. Some printer models
do not have power panic enabled.

This change fixes a build failure

No change in memory
2023-12-30 12:19:51 +00:00
gudnimg ceec54f026 reprint: reduce duplicate code
restore_file_from_sd function now supports any
filename extension. If a print was finished (to allow reprinting) then the
EEPROM filename and extension should always be valid.

Change in memory:
Flash: -312 bytes
SRAM: 0 bytes
2023-12-30 12:06:46 +00:00
3d-gussner 45d70b195d
Merge pull request #4405 from gudnimg/mmu-response-fix
MMU: always wait for a request's expected response
2023-12-22 16:34:27 +01:00
3d-gussner 8aa344ea38
Merge pull request #4545 from 3d-gussner/MK3_Fix_M850
Fix M850 output and documentation
2023-12-19 17:26:16 +01:00
3d-gussner c9ea5fa746 Fix M850 output and documentation 2023-12-19 15:34:16 +01:00
3d-gussner 15a3fb998c
Merge pull request #4541 from sarusani/actionReadyOpt
Remove leading M118 from "action:ready" & "action:not_ready"
2023-12-19 15:02:09 +01:00
3d-gussner b894fcc11c
Merge pull request #4534 from sarusani/oozePrevention
Prevent oozing after filament load
2023-12-19 15:01:50 +01:00
sarusani 2c4474b1dd Remove leading "M118" 2023-12-16 12:51:17 +01:00
sarusani e5d6d72d23 Add #ifdef 2023-12-15 14:09:46 +01:00
sarusani 1407f29362 Prevent oozing after filament load
Retract 10mm of filament after loading
2023-12-14 14:20:46 +01:00
gudnimg c384524877 mmu: always wait for a request's expected response
If a planned request is activated when the current status is finished
then the firmware must wait for the response when the request
is expecting it

An example is a register read or a register write.

manage_response not return unless the register has been read or
written. And we must see the response to know if an error should be
reported.

Step to reproduce issue:
1. Fail selector homing
2. Select 'Tune' item
3. Observe issue. In this situation you can see the value
for the previous register read is shown. Which is 0. This very timing dependent and does not always happen.
4. Repeat step 2 until the issue appears. It may take a few times.
2023-12-10 12:54:18 +00:00
gudnimg 40786a24e0 Rename "cardOK" to "mounted"
Sync the Prusa firmware a little bit with Marlin 2.1
2023-12-09 10:52:26 +00:00
gudnimg d94f263843 Rename initsd() to mount()
Sync the Prusa firmware with Marlin 2.1 a little bit.
2023-12-09 10:50:30 +00:00
gudnimg 42855f9f13 Rename setroot() to cdroot()
This way the name is the same as Marlin 2.1
2023-12-09 10:50:30 +00:00
gudnimg e0eb8b8a24 optimisation: if SD card fails to mount, do not set root directory
I noticed this on Marlin 2.1 side, it should apply here as well.
2023-12-09 10:50:30 +00:00
3d-gussner 3c64874e20
Merge pull request #4530 from 3d-gussner/MK3_fixc_cmake_t_tags
Fix cmake with tags starting with `t`
2023-12-05 17:19:57 +01:00
3d-gussner 1868839dc6 Fix cmake with tags starting with `t` 2023-12-05 15:42:47 +01:00
183 changed files with 14675 additions and 17069 deletions

View File

@ -1,34 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]<Enter comprehensive title>"
labels: bug
assignees: ''
---
<!--
Please, before you create a new bug report, please make sure you searched in open and closed issues and couldn't find anything that matches.
-->
**Printer type** - [e.g. MK3S, MK3, MK2.5S, MK2.5, MK2S, MK2]
**Printer firmware version** - [e.g. 3.8.1, 3.8.1-RC1, ...]
**MMU upgrade** - [e.g. MMU2S, MMU2, MMU1]
**MMU upgrade firmware version** - [e.g. 1.0.6, 1.0.6-RC2, ...]
**SD card or USB/Octoprint**
Please let us know if you print via SD card or USB/Octoprint
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Please describe steps to reproduce the behavior.
**Expected behavior**
A clear and concise description of what you expected to happen.
**G-code**
Please attach a G-code. This will make it easier for us to replicate the error.
**Video**
Please attach a video. It usually helps to solve the problem.

96
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,96 @@
name: Bug report
description: File a bug report
title: '[BUG] '
labels:
- bug
body:
- type: markdown
attributes:
value: |
Before you create a new bug report, please check if an issue with it already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment.
- type: dropdown
id: printer_model
attributes:
label: Printer model
description: Enter the printer model(s) where you encountered the issue
options:
- MK3S/+
- MK3
- MK2.5S
- MK2.5
validations:
required: true
- type: dropdown
id: mmu_model
attributes:
label: MMU model
description: Enter the MMU model(s) where you encountered the issue
multiple: false
options:
- No-MMU
- MMU3
- MMU2S
validations:
required: true
- type: input
id: firmware_version
attributes:
label: Firmware versions
description: |
If you're using a custom firmware (not downloaded from Prusa), please note that!
placeholder: '3.14.0, 3.12.0-RC1, 3.14.0 and 3.0.2...'
validations:
required: true
- type: input
id: optional_upgrades
attributes:
label: Upgrades and modifications
description: 'If your printer has upgrades or was modified, please note that! If not, please write None or leave blank.'
placeholder: |
None, custom extruder/hotend (which), different frame, ...
- type: dropdown
id: printing_from
attributes:
label: Printing from...
multiple: false
options:
- SD Card
- PrusaLink
- PrusaConnect
- OctoPrint
- Other host software
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe the bug
description: Write a concise description of the bug.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: How to reproduce
description: |
If you are able to reproduce the issue - meaning that you can trigger it yourself by following certain steps - please describe the step-by-step process in as much detail as possible!
- type: textarea
id: expected_behavior
attributes:
label: Expected behavior
description: |
If the printer did something unexpected, or if the procedure is missing a step that would resolve the issue, please provide a step-by-step process of how it should behave.
- type: textarea
id: files
attributes:
label: Files
description: |
Provide at least one of these (ideally as many as you can) to help developers track down the bug.
*To upload files, compress them into a .zip file and drag them to the text area to upload.* Images and videos can be uploaded directly.
- **gcode** file
- **3mf project** which includes the model and printer settings
- **video** or **photos** of the issue happening
**Crash dump: Do not share the file publicly**, as the crash dump contains a raw snapshot of the printer's memory and may include unencrypted sensitive information.
Please send the crash dump file to Prusa by emailing it to reports@prusa3d.com and referencing this issue. In reply to the email, you will be automatically assigned a reference code to be mentioned in the issue. Sharing this file is important and helps us investigate the bug.

View File

@ -1,17 +0,0 @@
---
name: Community
about: Related to "Community made" features
title: "[Community made] <Enter comprehensive title>"
labels: community_made
assignees: ''
---
Prusa Research will NOT follow up these issues!
The maintainers of the "Community made" feature should/will react.
Please, before you create a new "Community made" ticket, please make sure you searched in open and closed issues and couldn't find anything that matches.
**Which Community made feature do you want to address?**
**What is your request/question/suggestion?**

25
.github/ISSUE_TEMPLATE/community.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Community
description: Related to "Community made" features
title: '[Community made] '
labels:
- community_made
body:
- type: markdown
attributes:
value: >
Prusa Research will NOT follow up these issues!
The maintainers of the "Community made" feature should/will react.
Please, before you create a new "Community made" ticket, please make sure you searched in open and closed issues and couldn't find anything that matches.
- type: textarea
id: which_community
attributes:
label: Which Community made feature do you want to address?
validations:
required: true
- type: textarea
id: What_about_community
attributes:
label: What is your request/question/suggestion?
validations:
required: true

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,11 @@
contact_links:
- name: Do you need Support?
url: https://help.prusa3d.com/article/customer-support_2287
about: If you are not sure whether what you are reporting is a bug, please contact our support team first. We are providing full 24/7 customer support.
- name: Knowledge Base
url: https://help.prusa3d.com/
about: We have a comprehensive help documentation that could be helpful for troubleshooting.
- name: Prusa Forum
url: https://forum.prusa3d.com/
about: Please get in touch on our Prusa Forum! (Not an official support channel)
blank_issues_enabled: false

View File

@ -1,20 +0,0 @@
---
name: Enhancement
about: Suggest an idea for this project
title: " [ENHANCEMENT]<Enter comprehensive title>"
labels: enhancement
assignees: ''
---
Please, before you create a new feature request, please make sure you searched in open and closed issues and couldn't find anything that matches.
Enter what type of printer or upgrade the enhancement applies to.
**Printer type** - [e.g. MK3S, MK3, MK2.5S, MK2.5, MK2S, MK2]
**MMU Upgrade** - [e.g. MMU2S, MMU2, MMU1]
**Is your enhancement related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.

35
.github/ISSUE_TEMPLATE/enhancement.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Enhancement
description: Suggest an improvement of the existing functionality
title: '[ENHANCEMENT] '
labels:
- enhancement
body:
- type: markdown
attributes:
value: |
Before you create a new enhancement, please check if an issue with it already exists (either open or closed) by using the search bar on the issues page.
- type: checkboxes
id: printer_model
attributes:
label: Printer model
description: Select the printer model(s) where you would like this enhancement
options:
- label: MK3S/+
- label: MK3
- label: MK2.5S
- label: MK2.5
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe the enhancement
description: How would this enhancement improve your experience? Do you have a specific use case where this enhancemnet is especially needed?
validations:
required: true
- type: textarea
id: expected_functionality
attributes:
label: Expected functionality
description: |
Describe the way the enhancement would change existing functionality. You can also describe it in a step-by-step basis if applicable.

View File

@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE REQUEST]<Enter comprehensive title>"
labels: feature request
assignees: ''
---
Please, before you create a new feature request, please make sure you searched in open and closed issues and couldn't find anything that matches.
If it makes sense, enter what type of printer or upgrade the feature request applies to.
**Printer type** - [e.g. MK3S, MK3, MK2.5S, MK2.5, MK2S, MK2]
**MMU Upgrade** - [e.g. MMU2S, MMU2, MMU1]
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.

View File

@ -0,0 +1,35 @@
name: Feature request
description: Suggest new functionality
title: '[FEATURE REQUEST] '
labels:
- feature request
body:
- type: markdown
attributes:
value: |
Before you create a new feature request, please check if an issue with it already exists (either open or closed) by using the search bar on the issues page.
- type: checkboxes
id: printer_model
attributes:
label: Printer model
description: Select the printer model(s) where you would like this feature
options:
- label: MK3S/+
- label: MK3
- label: MK2.5S
- label: MK2.5
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe the feature
description: How would this feature improve the printer? Are there specific use cases where this would be beneficial? Describe how you would use it.
validations:
required: true
- type: textarea
id: expected_functionality
attributes:
label: Expected functionality
description: |
Describe the way the feature would work. You can also describe it in a step-by-step basis if applicable.

View File

@ -1,12 +0,0 @@
---
name: Question
about: What do you want to know?
title: "[QUESTION]<Enter comprehensive title>"
labels: question
assignees: ''
---
Please, before you create a new question, please make sure you searched in open and closed issues and couldn't find anything that matches.
**What is your question?**

16
.github/ISSUE_TEMPLATE/question.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Question
description: Ask a firmware specific question
title: '[QUESTION] '
labels:
- question
body:
- type: markdown
attributes:
value: |
Before you create a new question, please check if an issue with it already exists (either open or closed) by using the search bar on the issues page.
- type: textarea
id: question
attributes:
label: Question
validations:
required: true

View File

@ -1,10 +0,0 @@
#!/bin/sh
set -xe
rm -rf build
mkdir build
cd build
cmake .. \
-DCMAKE_TOOLCHAIN_FILE="../cmake/AvrGcc.cmake" \
-DCMAKE_BUILD_TYPE=Release \
-G Ninja
ninja ALL_FIRMWARE

View File

@ -1,12 +0,0 @@
#!/bin/sh
set -xe
rm -rf build
mkdir build
cd build
cmake .. \
-DCMAKE_TOOLCHAIN_FILE="../cmake/AvrGcc.cmake" \
-DCMAKE_BUILD_TYPE=Release \
-G Ninja
# ignore all failures in order to show as much output as possible
ninja -k0 check_lang || true

View File

@ -1,8 +0,0 @@
#!/bin/sh
set -xe
rm -rf build
mkdir build
cd build
cmake .. -G Ninja
ninja tests
ctest

View File

@ -1,34 +0,0 @@
#!/bin/sh
set -xe
cp Firmware/variants/MK3S.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK3S variant failed" && false; }
bash -x build.sh EN_FARM || { echo "MK3S EN_FARM failed" && false; }
rm Firmware/Configuration_prusa.h
cp Firmware/variants/MK3.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK3 variant failed" && false; }
bash -x build.sh EN_FARM || { echo "MK3 EN_FARM failed" && false; }
rm Firmware/Configuration_prusa.h
cp Firmware/variants/MK25S-RAMBo13a.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK25S-RAMBo13a variant failed" && false; }
rm Firmware/Configuration_prusa.h
cp Firmware/variants/MK25S-RAMBo10a.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK25S-RAMBo10a variant failed" && false; }
rm Firmware/Configuration_prusa.h
cp Firmware/variants/MK25-RAMBo13a.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK25-RAMBo13a variant failed" && false; }
rm Firmware/Configuration_prusa.h
cp Firmware/variants/MK25-RAMBo10a.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK25-RAMBo10a variant failed" && false; }
rm Firmware/Configuration_prusa.h
cp Firmware/variants/MK3S-E3DREVO.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK3S-E3DREVO variant failed" && false; }
rm Firmware/Configuration_prusa.h
cp Firmware/variants/MK3-E3DREVO.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK3-E3DREVO variant failed" && false; }
rm Firmware/Configuration_prusa.h
cp Firmware/variants/MK3S-E3DREVO_HF_60W.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK3S-E3DREVO_HF_60W variant failed" && false; }
rm Firmware/Configuration_prusa.h
cp Firmware/variants/MK3-E3DREVO_HF_60W.h Firmware/Configuration_prusa.h
bash -x build.sh || { echo "MK3-E3DREVO_HF_60W variant failed" && false; }
rm Firmware/Configuration_prusa.h

View File

@ -6,6 +6,10 @@ on:
- '*'
push:
branches: [ MK3, MK3_* ]
tags:
- 'v*'
- 't*'
- 'c*'
env:
GH_ANNOTATIONS: 1
@ -18,11 +22,12 @@ jobs:
# setup base required dependencies
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install cmake ninja-build python3-pyelftools python3-regex python3-polib
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout ${{ github.event.pull_request.head.ref }}
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ github.event.pull_request }}
with:
ref: ${{ github.event.pull_request.head.sha }}
@ -30,7 +35,7 @@ jobs:
fetch-depth: 0
- name: Checkout ${{ github.event.ref }}
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ !github.event.pull_request }}
with:
ref: ${{ github.event.ref }}
@ -38,7 +43,7 @@ jobs:
fetch-depth: 0
- name: Cache Dependencies
uses: actions/cache@v3.0.11
uses: actions/cache@v4
id: cache-pkgs
with:
path: ".dependencies"
@ -60,11 +65,22 @@ jobs:
- name: Upload artifacts
if: ${{ !github.event.pull_request }}
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4
with:
name: Firmware
path: build/*.hex
- name: RELEASE THE KRAKEN
if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/t') || startsWith(github.ref, 'refs/tags/c')
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ github.ref_name }}
draft: true
files: |
${{ github.workspace }}/build/release/*.hex
${{ github.workspace }}/build/release/*.zip
check-lang:
runs-on: ubuntu-latest
@ -72,11 +88,12 @@ jobs:
# setup base required dependencies
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install gcc-11 g++11 lcov cmake ninja-build python3-pyelftools python3-regex python3-polib
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout ${{ github.event.pull_request.head.ref }}
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ github.event.pull_request }}
with:
ref: ${{ github.event.pull_request.head.sha }}
@ -84,7 +101,7 @@ jobs:
fetch-depth: 0
- name: Checkout ${{ github.event.ref }}
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ !github.event.pull_request }}
with:
ref: ${{ github.event.ref }}
@ -92,7 +109,7 @@ jobs:
fetch-depth: 0
- name: Cache Dependencies
uses: actions/cache@v3.0.11
uses: actions/cache@v4
id: cache-pkgs
with:
path: ".dependencies"
@ -119,11 +136,12 @@ jobs:
# setup base required dependencies
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install gcc-11 g++11 lcov cmake ninja-build python3-pyelftools python3-regex python3-polib
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout ${{ github.event.pull_request.head.ref }}
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ github.event.pull_request }}
with:
ref: ${{ github.event.pull_request.head.sha }}
@ -131,7 +149,7 @@ jobs:
fetch-depth: 0
- name: Checkout ${{ github.event.ref }}
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ !github.event.pull_request }}
with:
ref: ${{ github.event.ref }}
@ -139,7 +157,7 @@ jobs:
fetch-depth: 0
- name: Cache Dependencies
uses: actions/cache@v3.0.11
uses: actions/cache@v4
id: cache-pkgs
with:
path: ".dependencies"

View File

@ -18,14 +18,15 @@ jobs:
# setup base required dependencies
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install cmake ninja-build python3-pyelftools python3-regex python3-polib
# build the base branch
- name: Checkout base
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache Dependencies
uses: actions/cache@v3.0.11
uses: actions/cache@v4
id: cache-pkgs
with:
path: ".dependencies"
@ -53,7 +54,7 @@ jobs:
# build the PR branch
- name: Checkout PR
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
clean: false
ref: ${{ github.event.pull_request.head.sha }}

View File

@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Don't ever mark PRs as stale.
days-before-pr-stale: -1
stale-issue-message: 'This issue has been flagged as stale because it has been open for 60 days with no activity. The issue will be closed in 7 days unless someone removes the "stale" label or adds a comment.'
stale-issue-message: 'Thank you for your contribution to our project. This issue has not received any updates for 60 days and may be considered "stale." If this issue is still important to you, please add an update within the next 7 days to keep it open. Administrators can manually reopen the issue if necessary.'
close-issue-message: 'This issue has been closed due to lack of recent activity. Please consider opening a new one if needed.'
# Don't act on things assigned to a milestone or assigned to someone.
exempt-all-milestones: true

View File

@ -1,55 +0,0 @@
dist: focal
language: minimal
cache:
directories:
# cmake project dependencies
- .dependencies/
# legacy PF-build dependencies
- ./../PF-build-env/
before_install:
# Prepare the dependencies for the old build environment
- sudo apt-get install -y python3-polib python3-pyelftools python3-regex
# Undo whatever *GARBAGE* travis is doing with python and restore the system version
- mkdir -p .dependencies/python3
- ln -sf /usr/bin/python3 .dependencies/python3/python3
- PATH=$PWD/.dependencies/python3:$PATH
# Bootstrap cmake/ninja for the new build environment
- ./utils/bootstrap.py
- PATH=$(./utils/bootstrap.py --print-dependency-directory "cmake")/bin:$PATH
- PATH=$(./utils/bootstrap.py --print-dependency-directory "ninja"):$PATH
# Arduino IDE adds a lot of noise caused by network traffic, firewall it off
- sudo iptables -P INPUT DROP
- sudo iptables -P FORWARD DROP
- sudo iptables -P OUTPUT ACCEPT
- sudo iptables -A INPUT -i lo -j ACCEPT
- sudo iptables -A OUTPUT -o lo -j ACCEPT
- sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
jobs:
include:
# legacy build.sh environment
- stage: legacy
script: ./.github/travis/legacy-build.sh
# cmake-based build
- stage: cmake
script: ./.github/travis/cmake-build.sh
# cmake tests
- stage: tests
script: ./.github/travis/cmake-test.sh
# language checks
- stage: lang
script: ./.github/travis/cmake-lang.sh
stages:
- cmake
- lang
- legacy
- tests

View File

@ -3,7 +3,7 @@
"name": "avr-gcc",
"toolchainFile": "${workspaceFolder}/cmake/AvrGcc.cmake",
"cmakeSettings": {
"CMAKE_MAKE_PROGRAM": "${workspaceFolder}/.dependencies/ninja-1.10.2/ninja",
"CMAKE_MAKE_PROGRAM": "${workspaceFolder}/.dependencies/ninja-1.12.1/ninja",
"CMAKE_BUILD_TYPE": "Release"
}
}

View File

@ -8,14 +8,14 @@ resolve_version_variables()
OPTION(ENFORCE_VERSION_MATCH "Enforce checking that configuration.h matches any parsed git tags" OFF)
OPTION(NO_TAG_IS_FATAL "If tag parsing fails, issue a fatal error" OFF)
set(PROJECT_VERSION_SUFFIX
set(PROJECT_VERSION_HASH
"<auto>"
CACHE
STRING
"Version suffix to be appended to the final filename (<ver+PROJECT_VERSION_SUFFIX>). Overrides git hash if set."
"Version suffix to be appended to the final filename (<ver+PROJECT_VERSION_HASH>). Overrides git hash if set."
)
if(PROJECT_VERSION_SUFFIX STREQUAL "<auto>")
set(PROJECT_VERSION_SUFFIX "${FW_COMMIT_HASH}")
if(PROJECT_VERSION_HASH STREQUAL "<auto>")
set(PROJECT_VERSION_HASH "${FW_COMMIT_HASH}")
endif()
set(PROJECT_VERSION_FULL
"<auto>"
@ -36,18 +36,29 @@ set(CUSTOM_COMPILE_OPTIONS
CACHE STRING "Allows adding custom C/C++ flags"
)
set(FN_PREFIX "FW${PROJECT_VERSION}+${PROJECT_VERSION_SUFFIX}")
#set(FN_VERSION_SUFFIX "FW${PROJECT_VERSION}+${PROJECT_VERSION_HASH}")
set(FN_VERSION_SUFFIX "FW_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_REV}")
if(PROJECT_VERSION_FLV AND PROJECT_VERSION_FLV_VER)
set (FN_VERSION_SUFFIX "${FN_VERSION_SUFFIX}-${PROJECT_VERSION_FLV}${PROJECT_VERSION_FLV_VER}")
endif()
set(FN_VERSION_DEBUG_SUFFIX "${FN_VERSION_SUFFIX}+${PROJECT_VERSION_COMMIT}")
# Inform user about the resolved settings
# Inform user about the resolved settings from Configuration.h
message(STATUS "Project version (Configuration.h): ${PROJECT_VERSION}")
message(STATUS "Project version suffix ..........: ${PROJECT_VERSION_SUFFIX}")
message(STATUS "Project version description......: ${PROJECT_VERSION_FULL}")
#message(STATUS "Project version major............: ${PROJECT_VERSION_MAJOR}") #For debuging
#message(STATUS "Project version minor............: ${PROJECT_VERSION_MINOR}") #For debuging
#message(STATUS "Project version revision.........: ${PROJECT_VERSION_REV}") #For debuging
#message(STATUS "Project version flavor...........: ${PROJECT_VERSION_FLV}") #For debuging
#message(STATUS "Project version fla-revison......: ${PROJECT_VERSION_FLV_VER}") #For debuging
#message(STATUS "Project version commit number....: ${PROJECT_VERSION_COMMIT}") #For debuging
message(STATUS "Filename suffix..................: ${FN_VERSION_SUFFIX}")
message(STATUS "Filename debug suffix ...........: ${FN_VERSION_DEBUG_SUFFIX}")
#message(STATUS "Host OS .........................: ${CMAKE_HOST_SYSTEM_NAME}")
# testing
# SET(FW_COMMIT_DSC "v3.13.0-1234")
if(NOT "${PROJECT_VERSION_SUFFIX}" STREQUAL "UNKNOWN" AND NOT "${FW_COMMIT_DSC}" MATCHES ".+NOTFOUND.+") # else -> no commit hash is known... likely no git.
string(REGEX MATCH "v([0-9]+)\.([0-9]+)\.([0-9]+)-?(${DEV_TAG_REGEX})?([0-9]+)?-([0-9]+)" TAG_VERSION "${FW_COMMIT_DSC}")
if(NOT "${PROJECT_VERSION_HASH}" STREQUAL "UNKNOWN" AND NOT "${FW_COMMIT_DSC}" MATCHES ".+NOTFOUND.+") # else -> no commit hash is known... likely no git.
string(REGEX MATCH "[v|t|c]([0-9]+)\.([0-9]+)\.([0-9]+)-?(${DEV_TAG_REGEX})?([0-9]+)?-([0-9]+)" TAG_VERSION "${FW_COMMIT_DSC}")
if (CMAKE_MATCH_4) # Do we have a build type?
decode_flavor_code(PROJECT_VER_TAG_FLV "${CMAKE_MATCH_4}" "${CMAKE_MATCH_5}")
@ -83,6 +94,7 @@ MESSAGE(STATUS "Commit Nr: Configuration.h: ${PROJECT_VERSION_COMMIT} Tag: ${CMA
MESSAGE(STATUS "These tag values will override Configuration.h")
SET(PROJECT_VERSION ${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}.${PROJECT_VER_TAG_FLV})
SET(PROJECT_VERSION_COMMIT ${CMAKE_MATCH_6})
git_get_repository(PROJECT_REPOSITORY)
else(GIT_FOUND)
if (NO_TAG_IS_FATAL)
@ -94,6 +106,28 @@ set(FW_COMMIT_HASH ${FW_COMMIT_HASH_UNKNOWN}) # Clear it, the code expects a bin
set(PROJECT_VERSION_TIMESTAMP "0")
endif()
if(CMAKE_MATCH_1 AND CMAKE_MATCH_2)
set(FN_VERSION_SUFFIX "FW_${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
endif()
if(CMAKE_MATCH_4 AND CMAKE_MATCH_5)
set (FN_VERSION_SUFFIX "${FN_VERSION_SUFFIX}-${CMAKE_MATCH_4}${CMAKE_MATCH_5}")
endif()
if(CMAKE_MATCH_6 AND PROJECT_VERSION_HASH)
set(FN_VERSION_DEBUG_SUFFIX "${FN_VERSION_SUFFIX}+${CMAKE_MATCH_6}_${PROJECT_VERSION_HASH}")
endif()
# Inform user about the resolved settings from github
message(STATUS "Project version git..............: ${PROJECT_VERSION}")
message(STATUS "Project version git hash.........: ${PROJECT_VERSION_HASH}")
message(STATUS "Project version git description..: ${PROJECT_VERSION_FULL}")
#message(STATUS "Project version git major........: ${CMAKE_MATCH_1}") #For debuging
#message(STATUS "Project version git minor........: ${CMAKE_MATCH_2}") #For debuging
#message(STATUS "Project version git revision.....: ${CMAKE_MATCH_3}") #For debuging
#message(STATUS "Project version git flavor.......: ${CMAKE_MATCH_4}") #For debuging
#message(STATUS "Project version git fla-revison..: ${CMAKE_MATCH_5}") #For debuging
#message(STATUS "Project version git commit number: ${CMAKE_MATCH_6}") #For debuging
message(STATUS "Filename suffix .................: ${FN_VERSION_SUFFIX}")
message(STATUS "Filename debug suffix ...........: ${FN_VERSION_DEBUG_SUFFIX}")
# Language configuration
set(MAIN_LANGUAGES
cs de es fr it pl
@ -212,15 +246,13 @@ set(FW_SOURCES
power_panic.cpp
printer_state.cpp
Prusa_farm.cpp
qr_solve.cpp
rbuf.c
Sd2Card.cpp
SdBaseFile.cpp
SdFatUtil.cpp
SdFile.cpp
SdVolume.cpp
Servo.cpp
sm4.c
sm4.cpp
sound.cpp
speed_lookuptable.cpp
spi.c
@ -236,10 +268,9 @@ set(FW_SOURCES
tmc2130.cpp
tone04.c
twi.cpp
uart2.c
uart2.cpp
ultralcd.cpp
util.cpp
vector_3.cpp
xflash.c
xflash_dump.cpp
xyzcal.cpp
@ -394,7 +425,13 @@ function(fw_add_variant variant_name)
# Single-language build
set(FW_EN "${variant_name}_ENGLISH")
set(FW_HEX ${CMAKE_BINARY_DIR}/${FN_PREFIX}-${FW_EN}.hex)
#MK3S_MK3S+_FW_3.13.2-RC1_ENGLISH.hex
set(hex_variant_name "${variant_name}")
if(hex_variant_name STRGREATER_EQUAL "MK3S")
string(REPLACE "MK3S" "MK3S_MK3S+" hex_variant_name ${hex_variant_name})
endif()
set(FW_HEX "${CMAKE_BINARY_DIR}/${hex_variant_name}_${FN_VERSION_SUFFIX}_ENGLISH.hex")
#message(STATUS "Hex filename: ${FW_HEX}")
add_base_binary(${FW_EN})
target_compile_definitions(${FW_EN} PUBLIC LANG_MODE=0 FW_VARIANT="${variant_header}")
@ -468,7 +505,15 @@ function(fw_add_variant variant_name)
if(${HAS_XFLASH} GREATER_EQUAL 0)
# X-Flash based build (catalogs appended to patched binary)
set(FW_LANG_FINAL "${variant_name}_MULTILANG")
set(LANG_HEX ${CMAKE_BINARY_DIR}/${FN_PREFIX}-${FW_LANG_FINAL}.hex)
set(hex_variant_name "${variant_name}")
#MK3S_MK3S+_FW_3.13.2-RC1+7651_deadbeef_MULTILANG.hex
if(hex_variant_name STRGREATER_EQUAL "MK3S")
string(REPLACE "MK3S" "MK3S_MK3S+" hex_variant_name ${hex_variant_name})
endif()
set(LANG_HEX ${CMAKE_BINARY_DIR}/${hex_variant_name}_${FN_VERSION_SUFFIX}_MULTILANG.hex)
set(LANG_DEBUG_HEX ${CMAKE_BINARY_DIR}/${hex_variant_name}_${FN_VERSION_DEBUG_SUFFIX}_MULTILANG.hex)
#message(STATUS "Hex filename .....: ${LANG_HEX}")
#message(STATUS "Hex debug filename: ${LANG_DEBUG_HEX}")
set(LANG_CATBIN ${LANG_TMP_DIR}/${variant_name}_cat.bin)
set(LANG_CATHEX ${LANG_TMP_DIR}/${variant_name}_cat.hex)
@ -496,6 +541,10 @@ function(fw_add_variant variant_name)
COMMAND ${CMAKE_COMMAND} -E cat ${FW_LANG_PATCH}.hex ${LANG_CATHEX} > ${FW_LANG_FINAL}.hex
COMMAND ${CMAKE_COMMAND} -E create_hardlink ${FW_LANG_FINAL}.hex ${LANG_HEX}
BYPRODUCTS ${LANG_HEX}
COMMAND ${CMAKE_COMMAND} -E create_hardlink ${FW_LANG_FINAL}.hex ${LANG_DEBUG_HEX}
BYPRODUCTS ${LANG_DEBUG_HEX}
COMMAND ${CMAKE_COMMAND} -E create_hardlink ${FW_LANG_FINAL}.hex ${CMAKE_BINARY_DIR}/release/${hex_variant_name}_${FN_VERSION_SUFFIX}_MULTILANG.hex
BYPRODUCTS ${CMAKE_BINARY_DIR}/release/${hex_variant_name}_${FN_VERSION_SUFFIX}_MULTILANG.hex
DEPENDS ${FW_LANG_PATCH}.hex ${LANG_CATHEX}
COMMENT "Generating final ${FW_LANG_FINAL}.hex"
)
@ -506,17 +555,18 @@ function(fw_add_variant variant_name)
set(ALL_VARIANT_HEXES "")
# Non-xflash, e.g. MK2.5
foreach(LANG IN LISTS SELECTED_LANGUAGES)
set(FW_LANG_FINAL ${variant_name}-en_${LANG})
set(LANG_HEX ${CMAKE_BINARY_DIR}/${FN_PREFIX}-${FW_LANG_FINAL}.hex)
set(FW_LANG_FINAL ${variant_name}_en-${LANG})
set(LANG_HEX ${CMAKE_BINARY_DIR}/${variant_name}_${FN_VERSION_SUFFIX}_en-${LANG}.hex)
set(LANG_DEBUG_HEX ${CMAKE_BINARY_DIR}/${variant_name}_${FN_VERSION_DEBUG_SUFFIX}_en-${LANG}.hex)
set(LANG_BIN ${LANG_TMP_DIR}/${variant_name}_${LANG}.bin)
# Patched binary with pre-baked secondary language
add_custom_command(
OUTPUT ${FW_LANG_FINAL}.bin
COMMAND ${CMAKE_OBJCOPY} -O binary ${FW_LANG_BASE} ${FW_LANG_FINAL}.bin
COMMAND ${CMAKE_COMMAND} -E copy ${FW_LANG_PATCH}.bin ${FW_LANG_FINAL}.bin
COMMAND "${Python3_EXECUTABLE}" ${CMAKE_SOURCE_DIR}/lang/lang-patchsec.py ${FW_LANG_BASE} ${LANG_BIN}
${FW_LANG_FINAL}.bin
DEPENDS ${FW_LANG_BASE} ${LANG_BIN}
DEPENDS ${FW_LANG_BASE} ${FW_LANG_PATCH}.bin ${LANG_BIN}
COMMENT "Generating ${FW_LANG_FINAL}.bin"
)
@ -526,6 +576,8 @@ function(fw_add_variant variant_name)
COMMAND ${CMAKE_OBJCOPY} -I binary -O ihex ${FW_LANG_FINAL}.bin ${FW_LANG_FINAL}.hex
COMMAND ${CMAKE_COMMAND} -E create_hardlink ${FW_LANG_FINAL}.hex ${LANG_HEX}
BYPRODUCTS ${LANG_HEX}
COMMAND ${CMAKE_COMMAND} -E create_hardlink ${FW_LANG_FINAL}.hex ${LANG_DEBUG_HEX}
BYPRODUCTS ${LANG_DEBUG_HEX}
DEPENDS ${FW_LANG_FINAL}.bin
COMMENT "Creating ${FW_LANG_FINAL}.hex"
)
@ -534,6 +586,15 @@ function(fw_add_variant variant_name)
list(APPEND ALL_VARIANT_HEXES ${FW_LANG_FINAL})
endforeach()
add_custom_target("${variant_name}-All-Languages" DEPENDS ${ALL_VARIANT_HEXES})
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
add_custom_command(TARGET "${variant_name}-All-Languages"
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory "release"
COMMAND ${CMAKE_COMMAND} -E tar "cfv" "release/${variant_name}_${FN_VERSION_SUFFIX}.zip" --format=zip ${variant_name}_${FN_VERSION_SUFFIX}_en*.hex
BYPRODUCTS "${CMAKE_BINARY_DIR}/release/${variant_name}_${FN_VERSION_SUFFIX}.zip"
)
endif()
add_dependencies(ALL_MULTILANG "${variant_name}-All-Languages")
endif()
endfunction()
@ -576,6 +637,18 @@ if(CMAKE_CROSSCOMPILING)
endforeach(THIS_VAR IN LISTS FW_VARIANTS)
endif()
SET(REVO_FW_ZIP_NAME "E3D_REVO_FW_MK3_MK3S_MK3S+_${FN_VERSION_SUFFIX}.zip")
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
add_custom_command(TARGET ALL_MULTILANG
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/release
BYPRODUCTS ${CMAKE_BINARY_DIR}/release/${REVO_FW_ZIP_NAME}
COMMAND ${CMAKE_COMMAND} -E tar "cfv" "${REVO_FW_ZIP_NAME}" --format=zip *E3DREVO*.hex
COMMAND ${CMAKE_COMMAND} -E rm *E3DREVO*.hex
)
endif()
#
# Tests
#

View File

@ -1,6 +1,7 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
#include <stdint.h>
#include "boards.h"
#define STR_HELPER(x) #x
@ -20,9 +21,9 @@ extern const char _sPrinterMmuName[] PROGMEM;
#ifndef CMAKE_CONTROL
#define FW_MAJOR 3
#define FW_MINOR 14
#define FW_REVISION 0
#define FW_COMMITNR 7943
#define FW_FLAVOR BETA //uncomment if DEV, ALPHA, BETA or RC
#define FW_REVISION 1
#define FW_COMMITNR 8225
#define FW_FLAVOR RC //uncomment if DEV, ALPHA, BETA or RC
#define FW_FLAVERSION 1 //uncomment if FW_FLAVOR is defined and versioning is needed. Limited to max 8.
#endif
@ -34,7 +35,7 @@ extern const char _sPrinterMmuName[] PROGMEM;
// Construct the TWEAK value as it is expected from the enum.
#define FW_TWEAK (CONCAT(FIRMWARE_REVISION_,FW_FLAVOR) + FW_FLAVERSION)
#define FW_VERSION STR(FW_MAJOR) "." STR(FW_MINOR) "." STR(FW_REVISION) "-" STR(FW_FLAVOR) "" STR(FW_FLAVERSION)
#define FW_VERSION_FULL STR(FW_MAJOR) "." STR(FW_MINOR) "." STR(FW_REVISION) "-" STR(FW_FLAVOR) "" STR(FW_FLAVERSION) "-" STR(FW_COMMITNR)
#define FW_VERSION_FULL STR(FW_MAJOR) "." STR(FW_MINOR) "." STR(FW_REVISION) "-" STR(FW_FLAVOR) "" STR(FW_FLAVERSION) "+" STR(FW_COMMITNR)
#endif
// The full version string and repository source are set via cmake
@ -70,7 +71,7 @@ extern const char _sPrinterMmuName[] PROGMEM;
// build by the user have been successfully uploaded into firmware.
#define STRING_VERSION_CONFIG_H SOURCE_DATE_EPOCH " " SOURCE_TIME_EPOCH // build date and time
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define STRING_CONFIG_H_AUTHOR FW_REPOSITORY // Who made the changes.
// SERIAL_PORT selects which serial port should be used for communication with the host.
// This allows the connection of wireless adapters (for instance) to non-default port pins.
@ -121,13 +122,6 @@ extern const char _sPrinterMmuName[] PROGMEM;
#define TEMP_HYSTERESIS 5 // (degC) range of +/- temperatures considered "close" to the target one
#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
// average current. The value should be an integer and the heat bed will be turned on for 1 interval of
// HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
//#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=I^2/R
//#define BED_WATTS (12.0*12.0/1.1) // P=I^2/R
@ -290,124 +284,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
#define HOME_Z_SEARCH_THRESHOLD 0.15f // Threshold of the Z height in calibration
//============================= Bed Auto Leveling ===========================
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
#define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#ifdef ENABLE_AUTO_BED_LEVELING
// There are 2 different ways to pick the X and Y locations to probe:
// - "grid" mode
// Probe every point in a rectangular grid
// You must specify the rectangle, and the density of sample points
// This mode is preferred because there are more measurements.
// It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
// - "3-point" mode
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points
#define AUTO_BED_LEVELING_GRID
// with AUTO_BED_LEVELING_GRID, the bed is sampled in a
// AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
// and least squares solution is calculated
// Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID
// set the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20
// set the number of grid points per dimension
// I wouldn't see a reason to go above 3 (=9 probing points on the bed)
#define AUTO_BED_LEVELING_GRID_POINTS 2
#else // not AUTO_BED_LEVELING_GRID
// with no grid, just probe 3 arbitrary points. A simple cross-product
// is used to esimate the plane of the print bed
#define ABL_PROBE_PT_1_X 15
#define ABL_PROBE_PT_1_Y 180
#define ABL_PROBE_PT_2_X 15
#define ABL_PROBE_PT_2_Y 20
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_LEVELING_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER -25
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
#define Z_RAISE_BEFORE_HOMING 5 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points
//#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
//#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
//The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
// You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
// #define PROBE_SERVO_DEACTIVATION_DELAY 300
//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!
//#define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
// When defined, it will:
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled
// - If stepper drivers timeout, it will need X and Y homing again before Z homing
// - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
// - Block Z homing only when the probe is outside bed area.
#ifdef Z_SAFE_HOMING
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28)
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28)
#endif
#ifdef AUTO_BED_LEVELING_GRID // Check if Probe_Offset * Grid Points is greater than Probing Range
#if X_PROBE_OFFSET_FROM_EXTRUDER < 0
#if (-(X_PROBE_OFFSET_FROM_EXTRUDER * AUTO_BED_LEVELING_GRID_POINTS) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION))
#error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
#endif
#else
#if ((X_PROBE_OFFSET_FROM_EXTRUDER * AUTO_BED_LEVELING_GRID_POINTS) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION))
#error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
#endif
#endif
#if Y_PROBE_OFFSET_FROM_EXTRUDER < 0
#if (-(Y_PROBE_OFFSET_FROM_EXTRUDER * AUTO_BED_LEVELING_GRID_POINTS) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION))
#error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
#endif
#else
#if ((Y_PROBE_OFFSET_FROM_EXTRUDER * AUTO_BED_LEVELING_GRID_POINTS) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION))
#error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
#endif
#endif
#endif
#endif // ENABLE_AUTO_BED_LEVELING
// The position of the homing switches
//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
@ -425,17 +301,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
//=============================Additional Features===========================
//===========================================================================
// Custom M code points
#define CUSTOM_M_CODES
#ifdef CUSTOM_M_CODES
#ifdef ENABLE_AUTO_BED_LEVELING
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -15
#define Z_PROBE_OFFSET_RANGE_MAX -5
#endif // ENABLE_AUTO_BED_LEVELING
#endif // CUSTOM_M_CODES
// Host Keepalive
//
// When enabled Marlin will send a busy status message to the host
@ -459,6 +324,10 @@ your extruder heater takes 2 minutes to hit the target on heating.
#define SDSUPPORT
#define LCD_WIDTH 20
#define LCD_HEIGHT 4
#define LCD_BACKLIGHT_LEVEL_HIGH 130
#define LCD_BACKLIGHT_LEVEL_LOW 50
#define LCD_BACKLIGHT_FORCE_ON 30
#define LCD_BACKLIGHT_TIMEOUT 15
// Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
@ -489,26 +358,12 @@ your extruder heater takes 2 minutes to hit the target on heating.
//define BlinkM/CyzRgb Support
//#define BLINKM
/*********************************************************************\
* R/C SERVO support
* Sponsored by TrinityLabs, Reworked by codexmas
**********************************************************************/
// Number of servos
//
// If you select a configuration below, this will receive a default value and does not need to be set manually
// set it manually if you have more servos than extruders and wish to manually control some
// leaving it undefined or defining as 0 will disable the servo subsystem
// If unsure, leave commented / disabled
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm). Used by the volumetric extrusion.
// Try to maintain a minimum distance from the bed even when Z is
// unknown when doing the following operations
#define MIN_Z_FOR_LOAD 50 // lcd filament loading or autoload
#define MIN_Z_FOR_UNLOAD 50 // lcd filament unloading
#define MIN_Z_FOR_LOAD 35 // lcd filament loading or autoload (values for load and unload have been unified to prevent movement between unload & load operations!)
#define MIN_Z_FOR_UNLOAD 35 // lcd filament unloading
#define MIN_Z_FOR_SWAP 27 // filament change (including M600)
#define MIN_Z_FOR_PREHEAT 10 // lcd preheat

View File

@ -106,6 +106,9 @@ void Config_PrintSettings(uint8_t level)
#ifdef THERMAL_MODEL
thermal_model_report_settings();
#endif
printf_P(PSTR(
"%SStatistics:\n%S M78 S%lu T%lu\n"),
echomagic, echomagic, eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED), eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME));
}
#endif
@ -116,10 +119,6 @@ static_assert (EXTRUDERS == 1, "ConfigurationStore M500_conf not implemented for
static_assert (NUM_AXIS == 4, "ConfigurationStore M500_conf not implemented for more axis."
"Fix axis_steps_per_mm max_feedrate_normal max_acceleration_mm_per_s2_normal max_jerk max_feedrate_silent"
" max_acceleration_mm_per_s2_silent array size.");
#ifdef ENABLE_AUTO_BED_LEVELING
static_assert (false, "zprobe_zoffset was not initialized in printers in field to -(Z_PROBE_OFFSET_FROM_EXTRUDER), so it contains"
"0.0, if this is not acceptable, increment EEPROM_VERSION to force use default_conf");
#endif
static_assert (sizeof(M500_conf) == 209, "sizeof(M500_conf) has changed, ensure that EEPROM_VERSION has been incremented, "
"or if you added members in the end of struct, ensure that historically uninitialized values will be initialized."
@ -181,7 +180,7 @@ static const M500_conf default_conf PROGMEM =
void Config_StoreSettings()
{
strcpy_P(cs.version, default_conf.version);
eeprom_update_block(reinterpret_cast<uint8_t*>(&cs), reinterpret_cast<uint8_t*>(EEPROM_M500_base), sizeof(cs));
eeprom_update_block_notify(reinterpret_cast<uint8_t*>(&cs), reinterpret_cast<uint8_t*>(EEPROM_M500_base), sizeof(cs));
#ifdef THERMAL_MODEL
thermal_model_save_settings();
#endif
@ -214,6 +213,10 @@ bool Config_RetrieveSettings()
eeprom_init_default_block(&EEPROM_M500_base->max_feedrate_silent, sizeof(EEPROM_M500_base->max_feedrate_silent), default_conf.max_feedrate_silent);
eeprom_init_default_block(&EEPROM_M500_base->max_acceleration_mm_per_s2_silent, sizeof(EEPROM_M500_base->max_acceleration_mm_per_s2_silent), default_conf.max_acceleration_mm_per_s2_silent);
#ifdef TMC2130
eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution);
#endif // TMC2130
// load the CS to RAM
eeprom_read_block(reinterpret_cast<uint8_t*>(&cs), reinterpret_cast<uint8_t*>(EEPROM_M500_base), sizeof(cs));
calculate_extruder_multipliers();
@ -231,11 +234,6 @@ bool Config_RetrieveSettings()
cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY;
}
if(cs.axis_ustep_resolution[X_AXIS] == 0xff){ cs.axis_ustep_resolution[X_AXIS] = TMC2130_USTEPS_XY; }
if(cs.axis_ustep_resolution[Y_AXIS] == 0xff){ cs.axis_ustep_resolution[Y_AXIS] = TMC2130_USTEPS_XY; }
if(cs.axis_ustep_resolution[Z_AXIS] == 0xff){ cs.axis_ustep_resolution[Z_AXIS] = TMC2130_USTEPS_Z; }
if(cs.axis_ustep_resolution[E_AXIS] == 0xff){ cs.axis_ustep_resolution[E_AXIS] = TMC2130_USTEPS_E; }
tmc2130_set_res(X_AXIS, cs.axis_ustep_resolution[X_AXIS]);
tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]);
tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]);

View File

@ -19,7 +19,7 @@ typedef struct
uint32_t min_segment_time_us; //!< (µs) M205 B
float max_jerk[4]; //!< Jerk is a maximum immediate velocity change.
float add_homing[3];
float zprobe_zoffset; //!< Only used with define ENABLE_AUTO_BED_LEVELING
float zprobe_zoffset; //!< unused
float Kp;
float Ki;
float Kd;

View File

@ -69,6 +69,9 @@
// Keepalive period which is restarted with M79
#define M79_TIMEOUT 30 * 1000 // ms
// A timer which is restarted everytime a G-command is added to the command queue.
#define USB_TIMER_TIMEOUT 10 * 1000 // ms
//===========================================================================
//=============================Mechanical Settings===========================
//===========================================================================
@ -122,34 +125,6 @@
#endif //End auto min/max positions
//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
// A single Z stepper driver is usually used to drive 2 stepper motors.
// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
//#define Z_DUAL_STEPPER_DRIVERS
#ifdef Z_DUAL_STEPPER_DRIVERS
#undef EXTRUDERS
#define EXTRUDERS 1
#endif
// Same again but for Y Axis.
//#define Y_DUAL_STEPPER_DRIVERS
// Define if the two Y drives need to rotate in opposite directions
#define INVERT_Y2_VS_Y_DIR 1
#ifdef Y_DUAL_STEPPER_DRIVERS
#undef EXTRUDERS
#define EXTRUDERS 1
#endif
#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
#error "You cannot have dual drivers for both Y and Z"
#endif
//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
#define X_HOME_RETRACT_MM 5
#define Y_HOME_RETRACT_MM 5

View File

@ -120,7 +120,7 @@ void write_mem(uint16_t address, uint16_t count, const uint8_t* data, const dcod
switch (type)
{
case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break;
case dcode_mem_t::eeprom: eeprom_write_byte((uint8_t*)address, data[i]); break;
case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break;
case dcode_mem_t::progmem: break;
case dcode_mem_t::xflash: break;
}
@ -191,13 +191,6 @@ void dcode_3()
#include <avr/wdt.h>
#include "bootapp.h"
#if 0
extern float current_temperature_pinda;
extern float axis_steps_per_mm[NUM_AXIS];
#define LOG(args...) printf(args)
#endif //0
#define LOG(args...)
/*!
@ -255,7 +248,7 @@ void dcode_1()
LOG("D1 - Clear EEPROM and RESET\n");
cli();
for (int i = 0; i < 8192; i++)
eeprom_write_byte((unsigned char*)i, (unsigned char)0xff);
eeprom_write_byte_notify((unsigned char*)i, (unsigned char)0xff);
softReset();
}
#endif
@ -348,7 +341,6 @@ void dcode_4()
- The hex address needs to be lowercase without the 0 before the x
- Count is decimal
- The hex data needs to be lowercase
*/
void dcode_5()
{
@ -487,12 +479,12 @@ void dcode_8()
else if (strchr_pointer[1+1] == '!')
{
cal_status = 1;
eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, cal_status);
eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 0, 8); //40C - 20um - 8usteps
eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 1, 24); //45C - 60um - 24usteps
eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 2, 48); //50C - 120um - 48usteps
eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 3, 80); //55C - 200um - 80usteps
eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 4, 120); //60C - 300um - 120usteps
eeprom_write_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, cal_status);
eeprom_write_word_notify(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 0, 8); //40C - 20um - 8usteps
eeprom_write_word_notify(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 1, 24); //45C - 60um - 24usteps
eeprom_write_word_notify(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 2, 48); //50C - 120um - 48usteps
eeprom_write_word_notify(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 3, 80); //55C - 200um - 80usteps
eeprom_write_word_notify(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 4, 120); //60C - 300um - 120usteps
}
else
{

View File

@ -8,6 +8,7 @@
#include "language.h"
#include "menu.h"
#include "messages.h"
#include "mmu2.h"
#include "planner.h"
#include "temperature.h"
#include "ultralcd.h"
@ -41,7 +42,7 @@ FSensorBlockRunout::~FSensorBlockRunout() { }
#endif // FILAMENT_SENSOR
void Filament_sensor::setEnabled(bool enabled) {
eeprom_update_byte((uint8_t *)EEPROM_FSENSOR, enabled);
eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled);
if (enabled) {
fsensor.init();
} else {
@ -52,21 +53,21 @@ void Filament_sensor::setEnabled(bool enabled) {
void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) {
autoLoadEnabled = state;
if (updateEEPROM) {
eeprom_update_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state);
eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state);
}
}
void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) {
runoutEnabled = state;
if (updateEEPROM) {
eeprom_update_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED, state);
eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED, state);
}
}
void Filament_sensor::setActionOnError(SensorActionOnError state, bool updateEEPROM) {
sensorActionOnError = state;
if (updateEEPROM) {
eeprom_update_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state);
eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state);
}
}
@ -148,6 +149,7 @@ void Filament_sensor::triggerFilamentRemoved() {
void Filament_sensor::filRunout() {
// SERIAL_ECHOLNPGM("filRunout");
sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED);
runoutEnabled = false;
autoLoadEnabled = false;
stop_and_save_print_to_ram(0, 0);
@ -288,7 +290,7 @@ const char *IR_sensor_analog::getIRVersionText() {
void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) {
sensorRevision = rev;
if (updateEEPROM) {
eeprom_update_byte((uint8_t *)EEPROM_FSENSOR_PCB, (uint8_t)rev);
eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_PCB, (uint8_t)rev);
}
}
@ -311,22 +313,7 @@ bool IR_sensor_analog::checkVoltage(uint16_t raw) {
puts_P(PSTR("fsensor v0.4 in fault range 4.6-5V - unconnected"));
return false;
}
/// newer IR sensor cannot normally produce 0-0.3V, this is considered a failure
#if 0 // Disabled as it has to be decided if we gonna use this or not.
if(IRsensor_Hopen_TRESHOLD <= raw && raw <= IRsensor_VMax_TRESHOLD) {
puts_P(PSTR("fsensor v0.4 in fault range 0.0-0.3V - wrong IR sensor"));
return false;
}
#endif
}
/// If IR sensor is "uknown state" and filament is not loaded > 1.5V return false
#if 0
#error "I really think this code can't be enabled anymore because we are constantly checking this voltage."
if((sensorRevision == SensorRevision::_Undef) && (raw > IRsensor_Lmax_TRESHOLD)) {
puts_P(PSTR("Unknown IR sensor version and no filament loaded detected."));
return false;
}
#endif
// otherwise the IR fsensor is considered working correctly
return true;
}
@ -446,7 +433,7 @@ void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) {
resetStepCount();
jamErrCnt = 0;
if (updateEEPROM) {
eeprom_update_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION, state);
eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION, state);
}
}

View File

@ -21,7 +21,6 @@
#include "Configuration.h"
#include "pins.h"
#include "Timer.h"
#include "mmu2.h"
#include "printer_state.h"
#ifndef AT90USB
@ -64,8 +63,6 @@
#define MYSERIAL MSerial
#endif
#include "lcd.h"
#define SERIAL_PROTOCOL(x) (MYSERIAL.print(x))
#define SERIAL_PROTOCOL_F(x,y) (MYSERIAL.print(x,y))
#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x)))
@ -124,13 +121,8 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#endif
#if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
#ifdef Y_DUAL_STEPPER_DRIVERS
#define enable_y() { WRITE(Y_ENABLE_PIN, Y_ENABLE_ON); WRITE(Y2_ENABLE_PIN, Y_ENABLE_ON); }
#define disable_y() { WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON); WRITE(Y2_ENABLE_PIN, !Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
#else
#define enable_y() WRITE(Y_ENABLE_PIN, Y_ENABLE_ON)
#define disable_y() { WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
#endif
#define enable_y() WRITE(Y_ENABLE_PIN, Y_ENABLE_ON)
#define disable_y() { WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
#else
#define enable_y() ;
#define disable_y() ;
@ -138,21 +130,11 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1
#if defined(Z_AXIS_ALWAYS_ON)
#ifdef Z_DUAL_STEPPER_DRIVERS
#define poweron_z() { WRITE(Z_ENABLE_PIN, Z_ENABLE_ON); WRITE(Z2_ENABLE_PIN, Z_ENABLE_ON); }
#define poweroff_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); WRITE(Z2_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
#else
#define poweron_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON)
#define poweroff_z() {}
#endif
#else
#ifdef Z_DUAL_STEPPER_DRIVERS
#define poweron_z() { WRITE(Z_ENABLE_PIN, Z_ENABLE_ON); WRITE(Z2_ENABLE_PIN, Z_ENABLE_ON); }
#define poweroff_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); WRITE(Z2_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
#else
#define poweron_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON)
#define poweroff_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
#endif
#endif
#else
#define poweron_z() {}
@ -197,6 +179,7 @@ void kill(const char *full_screen_message = NULL);
void finishAndDisableSteppers();
void UnconditionalStop(); // Stop heaters, motion and clear current print status
void ConditionalStop(); // Similar to UnconditionalStop, but doesn't disable heaters
void ThermalStop(bool allow_pause = false); // Emergency stop used by overtemp functions which allows
// recovery (with pause=true)
bool IsStopped(); // Returns true if the print has been stopped
@ -252,6 +235,7 @@ uint16_t restore_interrupted_gcode();
float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min);
#ifdef TMC2130
void check_Z_crash(void);
void homeaxis(uint8_t axis, uint8_t cnt = 1, uint8_t* pstep = 0);
#else
void homeaxis(uint8_t axis, uint8_t cnt = 1);
@ -279,6 +263,7 @@ extern int fan_speed[2];
#define active_extruder 0
extern bool mesh_bed_leveling_flag;
extern bool did_pause_print;
// save/restore printing
extern bool saved_printing;
@ -310,8 +295,18 @@ extern LongTimer safetyTimer;
// the print is paused, that still counts as a "running" print.
bool printJobOngoing();
// Make debug_printer_states available everywhere
#ifdef DEBUG_PRINTER_STATES
void debug_printer_states();
#endif //DEBUG_PRINTER_STATES
// Printing is paused according to SD or host indicators
bool printingIsPaused();
bool printer_active();
bool printer_recovering();
//! Beware - mcode_in_progress is set as soon as the command gets really processed,
//! which is not the same as posting the M600 command into the command queue
//! There can be a considerable lag between posting M600 and its real processing which might result
@ -354,9 +349,6 @@ void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_
void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_points_num, float shift_x, float shift_y);
#endif //HEATBED_ANALYSIS
float temp_comp_interpolation(float temperature);
#if 0
void show_fw_version_warnings();
#endif
uint8_t check_printer_version();
#ifdef PINDA_THERMISTOR
@ -380,6 +372,7 @@ void refresh_print_state_in_ram();
void refresh_saved_feedrate_multiplier_in_ram();
void clear_print_state_in_ram();
extern void stop_and_save_print_to_ram(float z_move, float e_move);
void restore_file_from_sd();
void restore_extruder_temperature_from_ram();
extern void restore_print_from_ram_and_continue(float e_move);
extern void cancel_saved_printing();
@ -403,7 +396,7 @@ extern uint8_t calc_percent_done();
/*enum MarlinBusyState {
NOT_BUSY, // Not in a handler
IN_HANDLER, // Processing a GCode
IN_PROCESS, // Known to be blocking command input (as in G29)
IN_PROCESS, // Known to be blocking command input
PAUSED_FOR_USER, // Blocking pending any input
PAUSED_FOR_INPUT // Blocking pending text input (concept)
};*/
@ -443,10 +436,10 @@ void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex);
#define UVLO !(PINE & (1<<4))
void M600_load_filament();
void M600_load_filament_movements();
void M600_load_filament(const char* filament_name);
void M600_load_filament_movements(const char* filament_name);
void M600_wait_for_user();
bool M600_check_state_and_repeat();
bool M600_check_state_and_repeat(const char* filament_name);
void load_filament_final_feed();
void marlin_wait_for_click();
float raise_z(float delta);

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,7 @@
#include "ultralcd.h"
#include "Filament_sensor.h"
#include "language.h"
#include "lcd.h"
#include "stopwatch.h"
#ifdef PRUSA_FARM
@ -238,7 +239,7 @@ void prusa_statistics(uint8_t _message) {
if (busy_state == PAUSED_FOR_USER) {
prusa_statistics_case0(15);
}
else if (print_job_timer.isPaused()) {
else if (printingIsPaused()) {
prusa_statistics_case0(14);
}
else if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) {
@ -403,7 +404,7 @@ void farm_mode_init() {
fsensor.setAutoLoadEnabled(false);
#endif //FILAMENT_SENSOR
// ~ FanCheck -> on
eeprom_update_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED, true);
eeprom_update_byte_notify((uint8_t*)EEPROM_FAN_CHECK_ENABLED, true);
}
}
@ -447,9 +448,9 @@ bool farm_prusa_code_seen() {
void farm_gcode_g98() {
farm_mode = 1;
eeprom_update_byte((unsigned char *)EEPROM_FARM_MODE, farm_mode);
eeprom_update_byte_notify((unsigned char *)EEPROM_FARM_MODE, farm_mode);
SilentModeMenu = SILENT_MODE_OFF;
eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, SilentModeMenu);
fCheckModeInit(); // alternatively invoke printer reset
}
@ -461,7 +462,7 @@ void farm_gcode_g99() {
void farm_disable() {
farm_mode = false;
eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode);
eeprom_update_byte_notify((uint8_t*)EEPROM_FARM_MODE, farm_mode);
}
#else //PRUSA_FARM

View File

@ -1,344 +0,0 @@
/*
Servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
Copyright (c) 2009 Michael Margolis. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method.
The servos are pulsed in the background using the value most recently written using the write() method
Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached.
Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four.
The methods are:
Servo - Class for manipulating servo motors connected to Arduino pins.
attach(pin ) - Attaches a servo motor to an i/o pin.
attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds
default min is 544, max is 2400
write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds)
writeMicroseconds() - Sets the servo pulse width in microseconds
read() - Gets the last written servo pulse width as an angle between 0 and 180.
readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release)
attached() - Returns true if there is a servo attached.
detach() - Stops an attached servos from pulsing its i/o pin.
*/
#include "Configuration.h"
#ifdef NUM_SERVOS
#include <avr/interrupt.h>
#include <Arduino.h>
#include "Servo.h"
#define usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / 8) // converts microseconds to tick (assumes prescale of 8) // 12 Aug 2009
#define ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds
#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays // 12 August 2009
//#define NBR_TIMERS (MAX_SERVOS / SERVOS_PER_TIMER)
static servo_t servos[MAX_SERVOS]; // static array of servo structures
static volatile int8_t Channel[_Nbr_16timers ]; // counter for the servo being pulsed for each timer (or -1 if refresh interval)
uint8_t ServoCount = 0; // the total number of attached servos
// convenience macros
#define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / SERVOS_PER_TIMER)) // returns the timer controlling this servo
#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % SERVOS_PER_TIMER) // returns the index of the servo on this timer
#define SERVO_INDEX(_timer,_channel) ((_timer*SERVOS_PER_TIMER) + _channel) // macro to access servo index by timer and channel
#define SERVO(_timer,_channel) (servos[SERVO_INDEX(_timer,_channel)]) // macro to access servo class by timer and channel
#define SERVO_MIN() (MIN_PULSE_WIDTH - this->min * 4) // minimum value in uS for this servo
#define SERVO_MAX() (MAX_PULSE_WIDTH - this->max * 4) // maximum value in uS for this servo
/************ static functions common to all instances ***********************/
static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t *TCNTn, volatile uint16_t* OCRnA)
{
if( Channel[timer] < 0 )
*TCNTn = 0; // channel set to -1 indicated that refresh interval completed so reset the timer
else{
if( SERVO_INDEX(timer,Channel[timer]) < ServoCount && SERVO(timer,Channel[timer]).Pin.isActive == true )
digitalWrite( SERVO(timer,Channel[timer]).Pin.nbr,LOW); // pulse this channel low if activated
}
Channel[timer]++; // increment to the next channel
if( SERVO_INDEX(timer,Channel[timer]) < ServoCount && Channel[timer] < SERVOS_PER_TIMER) {
*OCRnA = *TCNTn + SERVO(timer,Channel[timer]).ticks;
if(SERVO(timer,Channel[timer]).Pin.isActive == true) // check if activated
digitalWrite( SERVO(timer,Channel[timer]).Pin.nbr,HIGH); // its an active channel so pulse it high
}
else {
// finished all channels so wait for the refresh period to expire before starting over
if( ((unsigned)*TCNTn) + 4 < usToTicks(REFRESH_INTERVAL) ) // allow a few ticks to ensure the next OCR1A not missed
*OCRnA = (unsigned int)usToTicks(REFRESH_INTERVAL);
else
*OCRnA = *TCNTn + 4; // at least REFRESH_INTERVAL has elapsed
Channel[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel
}
}
#ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform
// Interrupt handlers for Arduino
#if defined(_useTimer1)
SIGNAL (TIMER1_COMPA_vect)
{
handle_interrupts(_timer1, &TCNT1, &OCR1A);
}
#endif
#if defined(_useTimer3)
SIGNAL (TIMER3_COMPA_vect)
{
handle_interrupts(_timer3, &TCNT3, &OCR3A);
}
#endif
#if defined(_useTimer4)
SIGNAL (TIMER4_COMPA_vect)
{
handle_interrupts(_timer4, &TCNT4, &OCR4A);
}
#endif
#if defined(_useTimer5)
SIGNAL (TIMER5_COMPA_vect)
{
handle_interrupts(_timer5, &TCNT5, &OCR5A);
}
#endif
#elif defined WIRING
// Interrupt handlers for Wiring
#if defined(_useTimer1)
void Timer1Service()
{
handle_interrupts(_timer1, &TCNT1, &OCR1A);
}
#endif
#if defined(_useTimer3)
void Timer3Service()
{
handle_interrupts(_timer3, &TCNT3, &OCR3A);
}
#endif
#endif
static void initISR(timer16_Sequence_t timer)
{
#if defined (_useTimer1)
if(timer == _timer1) {
TCCR1A = 0; // normal counting mode
TCCR1B = _BV(CS11); // set prescaler of 8
TCNT1 = 0; // clear the timer count
#if defined(__AVR_ATmega8__)|| defined(__AVR_ATmega128__)
TIFR |= _BV(OCF1A); // clear any pending interrupts;
TIMSK |= _BV(OCIE1A) ; // enable the output compare interrupt
#else
// here if not ATmega8 or ATmega128
TIFR1 |= _BV(OCF1A); // clear any pending interrupts;
TIMSK1 |= _BV(OCIE1A) ; // enable the output compare interrupt
#endif
#if defined(WIRING)
timerAttach(TIMER1OUTCOMPAREA_INT, Timer1Service);
#endif
}
#endif
#if defined (_useTimer3)
if(timer == _timer3) {
TCCR3A = 0; // normal counting mode
TCCR3B = _BV(CS31); // set prescaler of 8
TCNT3 = 0; // clear the timer count
#if defined(__AVR_ATmega128__)
TIFR |= _BV(OCF3A); // clear any pending interrupts;
ETIMSK |= _BV(OCIE3A); // enable the output compare interrupt
#else
TIFR3 = _BV(OCF3A); // clear any pending interrupts;
TIMSK3 = _BV(OCIE3A) ; // enable the output compare interrupt
#endif
#if defined(WIRING)
timerAttach(TIMER3OUTCOMPAREA_INT, Timer3Service); // for Wiring platform only
#endif
}
#endif
#if defined (_useTimer4)
if(timer == _timer4) {
TCCR4A = 0; // normal counting mode
TCCR4B = _BV(CS41); // set prescaler of 8
TCNT4 = 0; // clear the timer count
TIFR4 = _BV(OCF4A); // clear any pending interrupts;
TIMSK4 = _BV(OCIE4A) ; // enable the output compare interrupt
}
#endif
#if defined (_useTimer5)
if(timer == _timer5) {
TCCR5A = 0; // normal counting mode
TCCR5B = _BV(CS51); // set prescaler of 8
TCNT5 = 0; // clear the timer count
TIFR5 = _BV(OCF5A); // clear any pending interrupts;
TIMSK5 = _BV(OCIE5A) ; // enable the output compare interrupt
}
#endif
}
static void finISR(timer16_Sequence_t timer)
{
//disable use of the given timer
#if defined WIRING // Wiring
if(timer == _timer1) {
#if defined(__AVR_ATmega1281__)||defined(__AVR_ATmega2561__)
TIMSK1 &= ~_BV(OCIE1A) ; // disable timer 1 output compare interrupt
#else
TIMSK &= ~_BV(OCIE1A) ; // disable timer 1 output compare interrupt
#endif
timerDetach(TIMER1OUTCOMPAREA_INT);
}
else if(timer == _timer3) {
#if defined(__AVR_ATmega1281__)||defined(__AVR_ATmega2561__)
TIMSK3 &= ~_BV(OCIE3A); // disable the timer3 output compare A interrupt
#else
ETIMSK &= ~_BV(OCIE3A); // disable the timer3 output compare A interrupt
#endif
timerDetach(TIMER3OUTCOMPAREA_INT);
}
#else
//For arduino - in future: call here to a currently undefined function to reset the timer
#endif
}
static bool isTimerActive(timer16_Sequence_t timer)
{
// returns true if any servo is active on this timer
for(uint8_t channel=0; channel < SERVOS_PER_TIMER; channel++) {
if(SERVO(timer,channel).Pin.isActive == true)
return true;
}
return false;
}
/****************** end of static functions ******************************/
Servo::Servo()
{
if( ServoCount < MAX_SERVOS) {
this->servoIndex = ServoCount++; // assign a servo index to this instance
servos[this->servoIndex].ticks = usToTicks(DEFAULT_PULSE_WIDTH); // store default values - 12 Aug 2009
}
else
this->servoIndex = INVALID_SERVO ; // too many servos
}
uint8_t Servo::attach(int pin)
{
return this->attach(pin, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH);
}
uint8_t Servo::attach(int pin, int min, int max)
{
if(this->servoIndex < MAX_SERVOS ) {
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
if (pin > 0) this->pin = pin; else pin = this->pin;
#endif
pinMode( pin, OUTPUT) ; // set servo pin to output
servos[this->servoIndex].Pin.nbr = pin;
// todo min/max check: abs(min - MIN_PULSE_WIDTH) /4 < 128
this->min = (MIN_PULSE_WIDTH - min)/4; //resolution of min/max is 4 uS
this->max = (MAX_PULSE_WIDTH - max)/4;
// initialize the timer if it has not already been initialized
timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex);
if(isTimerActive(timer) == false)
initISR(timer);
servos[this->servoIndex].Pin.isActive = true; // this must be set after the check for isTimerActive
}
return this->servoIndex ;
}
void Servo::detach()
{
servos[this->servoIndex].Pin.isActive = false;
timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex);
if(isTimerActive(timer) == false) {
finISR(timer);
}
}
void Servo::write(int value)
{
if(value < MIN_PULSE_WIDTH)
{ // treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds)
if(value < 0) value = 0;
if(value > 180) value = 180;
value = map(value, 0, 180, SERVO_MIN(), SERVO_MAX());
}
this->writeMicroseconds(value);
}
void Servo::writeMicroseconds(int value)
{
// calculate and store the values for the given channel
byte channel = this->servoIndex;
if( (channel < MAX_SERVOS) ) // ensure channel is valid
{
if( value < SERVO_MIN() ) // ensure pulse width is valid
value = SERVO_MIN();
else if( value > SERVO_MAX() )
value = SERVO_MAX();
value = value - TRIM_DURATION;
value = usToTicks(value); // convert to ticks after compensating for interrupt overhead - 12 Aug 2009
uint8_t oldSREG = SREG;
cli();
servos[channel].ticks = value;
SREG = oldSREG;
}
}
int Servo::read() // return the value as degrees
{
return map( this->readMicroseconds()+1, SERVO_MIN(), SERVO_MAX(), 0, 180);
}
int Servo::readMicroseconds()
{
unsigned int pulsewidth;
if( this->servoIndex != INVALID_SERVO )
pulsewidth = ticksToUs(servos[this->servoIndex].ticks) + TRIM_DURATION ; // 12 aug 2009
else
pulsewidth = 0;
return pulsewidth;
}
bool Servo::attached()
{
return servos[this->servoIndex].Pin.isActive ;
}
#endif

View File

@ -1,135 +0,0 @@
/*
Servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
Copyright (c) 2009 Michael Margolis. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method.
The servos are pulsed in the background using the value most recently written using the write() method
Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached.
Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four.
The sequence used to seize timers is defined in timers.h
The methods are:
Servo - Class for manipulating servo motors connected to Arduino pins.
attach(pin ) - Attaches a servo motor to an i/o pin.
attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds
default min is 544, max is 2400
write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds)
writeMicroseconds() - Sets the servo pulse width in microseconds
read() - Gets the last written servo pulse width as an angle between 0 and 180.
readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release)
attached() - Returns true if there is a servo attached.
detach() - Stops an attached servos from pulsing its i/o pin.
*/
#ifndef Servo_h
#define Servo_h
#include <inttypes.h>
/*
* Defines for 16 bit timers used with Servo library
*
* If _useTimerX is defined then TimerX is a 16 bit timer on the current board
* timer16_Sequence_t enumerates the sequence that the timers should be allocated
* _Nbr_16timers indicates how many 16 bit timers are available.
*
*/
// Say which 16 bit timers can be used and in what order
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
#define _useTimer5
//#define _useTimer1
#define _useTimer3
#define _useTimer4
//typedef enum { _timer5, _timer1, _timer3, _timer4, _Nbr_16timers } timer16_Sequence_t ;
typedef enum { _timer5, _timer3, _timer4, _Nbr_16timers } timer16_Sequence_t ;
#elif defined(__AVR_ATmega32U4__)
//#define _useTimer1
#define _useTimer3
//typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;
typedef enum { _timer3, _Nbr_16timers } timer16_Sequence_t ;
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
#define _useTimer3
//#define _useTimer1
//typedef enum { _timer3, _timer1, _Nbr_16timers } timer16_Sequence_t ;
typedef enum { _timer3, _Nbr_16timers } timer16_Sequence_t ;
#elif defined(__AVR_ATmega128__) ||defined(__AVR_ATmega1281__) || defined(__AVR_ATmega1284P__) ||defined(__AVR_ATmega2561__)
#define _useTimer3
//#define _useTimer1
//typedef enum { _timer3, _timer1, _Nbr_16timers } timer16_Sequence_t ;
typedef enum { _timer3, _Nbr_16timers } timer16_Sequence_t ;
#else // everything else
//#define _useTimer1
//typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;
typedef enum { _Nbr_16timers } timer16_Sequence_t ;
#endif
#define Servo_VERSION 2 // software version of this library
#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo
#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo
#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached
#define REFRESH_INTERVAL 20000 // minimum time to refresh servos in microseconds
#define SERVOS_PER_TIMER 12 // the maximum number of servos controlled by one timer
#define MAX_SERVOS (_Nbr_16timers * SERVOS_PER_TIMER)
#define INVALID_SERVO 255 // flag indicating an invalid servo index
typedef struct {
uint8_t nbr :6 ; // a pin number from 0 to 63
uint8_t isActive :1 ; // true if this channel is enabled, pin not pulsed if false
} ServoPin_t ;
typedef struct {
ServoPin_t Pin;
unsigned int ticks;
} servo_t;
class Servo
{
public:
Servo();
uint8_t attach(int pin); // attach the given pin to the next free channel, sets pinMode, returns channel number or 0 if failure
uint8_t attach(int pin, int min, int max); // as above but also sets min and max values for writes.
void detach();
void write(int value); // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds
void writeMicroseconds(int value); // Write pulse width in microseconds
int read(); // returns current pulse width as an angle between 0 and 180 degrees
int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release)
bool attached(); // return true if this servo is attached, otherwise false
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
int pin; // store the hardware pin of the servo
#endif
private:
uint8_t servoIndex; // index into the channel data for this servo
int8_t min; // minimum is this value times 4 added to MIN_PULSE_WIDTH
int8_t max; // maximum is this value times 4 added to MAX_PULSE_WIDTH
};
#endif

View File

@ -30,9 +30,9 @@ void SpoolJoin::toggleSpoolJoin()
{
if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled)
{
eeprom_write_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Enabled);
eeprom_update_byte_notify((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Enabled);
} else {
eeprom_write_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled);
eeprom_update_byte_notify((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled);
}
}
@ -55,7 +55,7 @@ uint8_t SpoolJoin::nextSlot()
SERIAL_ECHOPGM("SpoolJoin: ");
SERIAL_ECHO((int)currentMMUSlot);
if (currentMMUSlot >= 4) currentMMUSlot = 0;
if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0;
else currentMMUSlot++;
SERIAL_ECHOPGM(" -> ");

View File

@ -31,7 +31,7 @@ void TCodes(char *const strchr_pointer, const uint8_t codeValue) {
} else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){
// load to extruder gears; if mmu is not present do nothing
if (MMU2::mmu2.Enabled()) {
MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), _T(MSG_FILAMENT)));
MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT));
}
} else if (strchr_pointer[index] == 'c'){
// load from extruder gears to nozzle (nozzle should be preheated)

View File

@ -17,7 +17,7 @@ bool backlightSupport = 0; //only if it's true will any of the settings be visib
uint8_t backlightLevel_HIGH = 0;
uint8_t backlightLevel_LOW = 0;
uint8_t backlightMode = BACKLIGHT_MODE_BRIGHT;
int16_t backlightTimer_period = 10;
int16_t backlightTimer_period = LCD_BACKLIGHT_TIMEOUT;
LongTimer backlightTimer;
static void backlightTimer_reset() //used for resetting the timer and waking the display. Triggered on user interactions.
@ -32,7 +32,7 @@ void force_bl_on(bool section_start)
if (section_start)
{
backlightMode = BACKLIGHT_MODE_BRIGHT;
if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30;
if (backlightLevel_HIGH < LCD_BACKLIGHT_FORCE_ON) backlightLevel_HIGH = LCD_BACKLIGHT_FORCE_ON;
}
else
{
@ -62,10 +62,10 @@ void backlight_wake(const uint8_t flashNo)
void backlight_save() //saves all backlight data to eeprom.
{
eeprom_update_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, backlightLevel_HIGH);
eeprom_update_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, backlightLevel_LOW);
eeprom_update_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, backlightMode);
eeprom_update_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period);
eeprom_update_byte_notify((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, backlightLevel_HIGH);
eeprom_update_byte_notify((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, backlightLevel_LOW);
eeprom_update_byte_notify((uint8_t *)EEPROM_BACKLIGHT_MODE, backlightMode);
eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period);
}
void backlight_update()
@ -93,9 +93,9 @@ void backlight_init()
//initialize backlight
backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO);
backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, 130);
backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, 50);
backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, 10); // in seconds
backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, LCD_BACKLIGHT_LEVEL_HIGH);
backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, LCD_BACKLIGHT_LEVEL_LOW);
backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT); // in seconds
SET_OUTPUT(LCD_BL_PIN);
backlightTimer_reset();

View File

@ -24,7 +24,7 @@ CardReader::CardReader()
filesize = 0;
sdpos = 0;
sdprinting = false;
cardOK = false;
mounted = false;
saving = false;
logging = false;
workDirDepth = 0;
@ -198,9 +198,9 @@ void CardReader::ls(ls_param params)
}
void CardReader::initsd(bool doPresort/* = true*/)
void CardReader::mount(bool doPresort/* = true*/)
{
cardOK = false;
mounted = false;
if(root.isOpen())
root.close();
#ifdef SDSLOW
@ -226,33 +226,21 @@ void CardReader::initsd(bool doPresort/* = true*/)
}
else
{
cardOK = true;
mounted = true;
SERIAL_ECHO_START;
SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK
}
workDir=root;
curDir=&root;
workDirDepth = 0;
#ifdef SDCARD_SORT_ALPHA
if (doPresort)
presort();
#endif
/*
if(!workDir.openRoot(&volume))
if (mounted)
{
SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL);
cdroot(doPresort);
}
*/
}
void CardReader::setroot(bool doPresort)
void __attribute__((noinline)) CardReader::cdroot(bool doPresort)
{
workDir=root;
workDirDepth = 0;
curDir=&workDir;
#ifdef SDCARD_SORT_ALPHA
if (doPresort)
@ -264,14 +252,14 @@ void CardReader::setroot(bool doPresort)
void CardReader::release()
{
sdprinting = false;
cardOK = false;
mounted = false;
SERIAL_ECHO_START;
SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED
}
void CardReader::startFileprint()
{
if(cardOK)
if(mounted)
{
sdprinting = true;
SetPrinterState(PrinterState::IsSDPrinting); //set printer state to hide LCD menu
@ -346,7 +334,7 @@ bool CardReader::diveSubfolder (const char *&fileName)
const char *dirname_start, *dirname_end;
if (fileName[0] == '/') // absolute path
{
setroot(false);
cdroot(false);
dirname_start = fileName + 1;
while (*dirname_start)
{
@ -396,7 +384,7 @@ static const char ofSDPrinting[] PROGMEM = "SD-PRINTING";
static const char ofWritingToFile[] PROGMEM = "Writing to file: ";
void CardReader::openFileReadFilteredGcode(const char* name, bool replace_current/* = false*/){
if(!cardOK)
if(!mounted)
return;
if(file.isOpen()){ //replacing current file by new file, or subfile call
@ -461,7 +449,7 @@ void CardReader::openFileReadFilteredGcode(const char* name, bool replace_curren
void CardReader::openFileWrite(const char* name)
{
if(!cardOK)
if(!mounted)
return;
if(file.isOpen()){ //replacing current file by new file, or subfile call
#if 0
@ -525,7 +513,7 @@ void CardReader::openFileWrite(const char* name)
void CardReader::removeFile(const char* name)
{
if(!cardOK) return;
if(!mounted) return;
file.close();
sdprinting = false;
@ -558,7 +546,7 @@ uint32_t CardReader::getFileSize()
void CardReader::getStatus(bool arg_P)
{
if (print_job_timer.isPaused())
if (printingIsPaused())
{
if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD))
SERIAL_PROTOCOLLNPGM("SD print paused");
@ -626,10 +614,10 @@ void CardReader::checkautostart(bool force)
return;
}
autostart_stilltocheck = false;
if(!cardOK)
if(!mounted)
{
initsd();
if(!cardOK) //fail
mount();
if(!mounted) //fail
return;
}
@ -814,7 +802,7 @@ void CardReader::presort() {
// If you use folders to organize, 20 may be enough
if (fileCnt > SDSORT_LIMIT) {
if ((sdSort != SD_SORT_NONE) && !farm_mode) {
lcd_show_fullscreen_message_and_wait_P(_i("Some files will not be sorted. Max. No. of files in 1 folder for sorting is 100."));////MSG_FILE_CNT c=20 r=6
lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT));
}
fileCnt = SDSORT_LIMIT;
}

View File

@ -27,7 +27,7 @@ public:
inline ls_param(bool LFN, bool timestamp):LFN(LFN), timestamp(timestamp) { }
} __attribute__((packed));
void initsd(bool doPresort = true);
void mount(bool doPresort = true);
void write_command(char *buf);
void write_command_no_newline(char *buf);
//files auto[0-9].g on the sd card are performed in a row
@ -55,11 +55,10 @@ public:
void getDirName(char* name, uint8_t level);
uint8_t getWorkDirDepth();
void ls(ls_param params);
bool chdir(const char * relpath, bool doPresort);
void updir();
void setroot(bool doPresort);
void cdroot(bool doPresort);
#ifdef SDCARD_SORT_ALPHA
void presort();
@ -90,8 +89,8 @@ public:
public:
bool saving;
bool logging;
bool sdprinting ;
bool cardOK ;
bool sdprinting;
bool mounted;
char filename[FILENAME_LENGTH];
// There are scenarios when simple modification time is not enough (on MS Windows)
// Therefore these timestamps hold the most recent one of creation/modification date/times

View File

@ -368,7 +368,7 @@ void get_command()
}
// start of serial line processing loop
while (((MYSERIAL.available() > 0 && !saved_printing) || (MYSERIAL.available() > 0 && print_job_timer.isPaused())) && !cmdqueue_serial_disabled) { //is print is saved (crash detection or filament detection), dont process data from serial line
while (((MYSERIAL.available() > 0 && !saved_printing) || (MYSERIAL.available() > 0 && printingIsPaused())) && !cmdqueue_serial_disabled) { //is print is saved (crash detection or filament detection), dont process data from serial line
#ifdef ENABLE_MEATPACK
// MeatPack Changes
@ -484,7 +484,7 @@ void get_command()
if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) {
usb_timer.start();
SetPrinterState(PrinterState::IsHostPrinting); //set printer state busy printing to hide LCD menu while USB printing
eeprom_update_byte((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY);
eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY);
}
if (allow_when_stopped == false && Stopped == true) {
// Stopped can be set either during error states (thermal error: cannot continue), or
@ -670,7 +670,9 @@ void get_command()
sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes);
SERIAL_ECHO_START;
SERIAL_ECHOLN(time);
#ifndef SHOW_FILENAME_AFTER_FINISH
lcd_setstatus(time);
#endif //SHOW_FILENAME_AFTER_FINISH
card.printingHasFinished();
card.checkautostart(true);

View File

@ -26,7 +26,7 @@ void eeprom_init()
eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0);
if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE)
{
eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), 0);
eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), 0);
// When upgrading from version older version (before multiple sheets were implemented in v3.8.0)
// Sheet 1 uses the previous Live adjust Z (@EEPROM_BABYSTEP_Z)
int last_babystep = eeprom_read_word((uint16_t *)EEPROM_BABYSTEP_Z);
@ -49,7 +49,7 @@ void eeprom_init()
// initialize custom mendel name in eeprom
if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) {
//SERIAL_ECHOLN("Init Custom Mendel Name");
eeprom_update_block(CUSTOM_MENDEL_NAME, (uint8_t*)EEPROM_CUSTOM_MENDEL_NAME, sizeof(CUSTOM_MENDEL_NAME));
eeprom_update_block_notify(CUSTOM_MENDEL_NAME, (uint8_t*)EEPROM_CUSTOM_MENDEL_NAME, sizeof(CUSTOM_MENDEL_NAME));
} //else SERIAL_ECHOLN("Found Custom Mendel Name");
#ifdef PINDA_TEMP_COMP
@ -66,11 +66,11 @@ void eeprom_init()
}
void eeprom_adjust_bed_reset() {
eeprom_update_byte((uint8_t*)EEPROM_BED_CORRECTION_VALID, 1);
eeprom_update_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT, 0);
eeprom_update_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT, 0);
eeprom_update_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT, 0);
eeprom_update_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR, 0);
eeprom_update_byte_notify((uint8_t*)EEPROM_BED_CORRECTION_VALID, 1);
eeprom_update_byte_notify((uint8_t*)EEPROM_BED_CORRECTION_LEFT, 0);
eeprom_update_byte_notify((uint8_t*)EEPROM_BED_CORRECTION_RIGHT, 0);
eeprom_update_byte_notify((uint8_t*)EEPROM_BED_CORRECTION_FRONT, 0);
eeprom_update_byte_notify((uint8_t*)EEPROM_BED_CORRECTION_REAR, 0);
}
//! @brief Get default sheet name for index
@ -137,12 +137,175 @@ int8_t eeprom_next_initialized_sheet(int8_t sheet)
return -1;
}
#ifdef DEBUG_EEPROM_CHANGES
static void eeprom_byte_notify(uint8_t *dst, uint8_t previous_value, uint8_t value, bool write) {
printf_P(PSTR("EEPROMChng b %s %u %d -> %d\n"), write ? "write":"", dst , previous_value, value);
}
static void eeprom_word_notify(uint16_t *dst, uint16_t previous_value, uint16_t value, bool write) {
printf_P(PSTR("EEPROMChng w %s %u %u -> %u\n"), write ? "write":"", dst , previous_value, value);
}
static void eeprom_dword_notify(uint32_t *dst, uint32_t previous_value, uint32_t value, bool write) {
printf_P(PSTR("EEPROMChng d %s %u %x -> %x\n"), write ? "write":"", reinterpret_cast<const uint16_t>(dst) , previous_value, value);
}
static void eeprom_float_notify(float *dst, float previous_value, float value, bool write) {
printf_P(PSTR("EEPROMChng f %s %u %f -> %f\n"), write ? "write":"", reinterpret_cast<const uint16_t>(dst) , previous_value, value);
}
static void eeprom_block_notify(void *dst, const uint8_t *previous_values, const uint8_t *values, size_t size, bool write) {
for(size_t i = 0; i < size; ++i){
if (previous_values[i] != values[i] || write) {
printf_P(PSTR("EEPROMChng bl %s %u %x -> %x\n"), write ? "write":"", reinterpret_cast<const uint16_t>(dst) + i, previous_values[i], values[i]);
}
}
}
#endif //DEBUG_EEPROM_CHANGES
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_write_byte_notify(uint8_t *dst, uint8_t value){
#else
void eeprom_write_byte_notify(uint8_t *dst, uint8_t value, bool active){
if (active) {
uint8_t previous_value = eeprom_read_byte(dst);
eeprom_byte_notify(dst, previous_value, value, true);
}
#endif //DEBUG_EEPROM_CHANGES
eeprom_write_byte(dst, value);
}
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_update_byte_notify(uint8_t *dst, uint8_t value){
#else
void eeprom_update_byte_notify(uint8_t *dst, uint8_t value, bool active){
if (active) {
uint8_t previous_value = eeprom_read_byte(dst);
if (previous_value != value) {
eeprom_byte_notify(dst, previous_value, value, false);
}
}
#endif //DEBUG_EEPROM_CHANGES
eeprom_update_byte(dst, value);
}
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_write_word_notify(uint16_t *dst, uint16_t value){
#else
void eeprom_write_word_notify(uint16_t *dst, uint16_t value, bool active){
if (active) {
uint16_t previous_value = eeprom_read_word(dst);
eeprom_word_notify(dst, previous_value, value, true);
}
#endif //DEBUG_EEPROM_CHANGES
eeprom_write_word(dst, value);
}
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_update_word_notify(uint16_t *dst, uint16_t value){
#else
void eeprom_update_word_notify(uint16_t *dst, uint16_t value, bool active){
if (active) {
uint16_t previous_value = eeprom_read_word(dst);
if (previous_value != value) {
eeprom_word_notify(dst, previous_value, value, false);
}
}
#endif //DEBUG_EEPROM_CHANGES
eeprom_update_word(dst, value);
}
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_write_dword_notify(uint32_t *dst, uint32_t value){
#else
void eeprom_write_dword_notify(uint32_t *dst, uint32_t value, bool active){
if (active) {
uint32_t previous_value = eeprom_read_dword(dst);
eeprom_dword_notify(dst, previous_value, value, true);
}
#endif //DEBUG_EEPROM_CHANGES
eeprom_write_dword(dst, value);
}
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_update_dword_notify(uint32_t *dst, uint32_t value){
#else
void eeprom_update_dword_notify(uint32_t *dst, uint32_t value, bool active){
if (active) {
uint32_t previous_value = eeprom_read_dword(dst);
if (previous_value != value) {
eeprom_dword_notify(dst, previous_value, value, false);
}
}
#endif //DEBUG_EEPROM_CHANGES
eeprom_update_dword(dst, value);
}
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_write_float_notify(float *dst, float value){
#else
void eeprom_write_float_notify(float *dst, float value, bool active){
if (active) {
float previous_value = eeprom_read_float(dst);
eeprom_float_notify(dst, previous_value, value, true);
}
#endif //DEBUG_EEPROM_CHANGES
eeprom_write_float(dst, value);
}
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_update_float_notify(float *dst, float value){
#else
void eeprom_update_float_notify(float *dst, float value, bool active){
if (active) {
float previous_value = eeprom_read_float(dst);
if (previous_value != value) {
eeprom_float_notify(dst, previous_value, value, false);
}
}
#endif //DEBUG_EEPROM_CHANGES
eeprom_update_float(dst, value);
}
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_write_block_notify(const void *__src, void *__dst, size_t __n){
eeprom_write_block(__src, __dst, __n);
#else
void eeprom_write_block_notify(const void *__src, void *__dst, size_t __n, bool active){
if (active) {
uint8_t previous_values[__n];
uint8_t new_values[__n];
eeprom_read_block(previous_values, __dst, __n);
eeprom_write_block(__src, __dst, __n);
eeprom_read_block(new_values, __dst, __n);
eeprom_block_notify(__dst, previous_values, new_values, __n, true);
}
#endif //DEBUG_EEPROM_CHANGES
}
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){
eeprom_update_block(__src, __dst, __n);
#else
void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n, bool active){
if (active) {
uint8_t previous_values[__n];
uint8_t new_values[__n];
eeprom_read_block(previous_values, __dst, __n);
eeprom_update_block(__src, __dst, __n);
eeprom_read_block(new_values, __dst, __n);
eeprom_block_notify(__dst, previous_values, new_values, __n, false);
}
#endif //DEBUG_EEPROM_CHANGES
}
void eeprom_switch_to_next_sheet()
{
int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet));
sheet = eeprom_next_initialized_sheet(sheet);
if (sheet >= 0) eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), sheet);
if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet);
}
bool __attribute__((noinline)) eeprom_is_sheet_initialized(uint8_t sheet_num) {
@ -163,44 +326,44 @@ void eeprom_update_block_P(const void *__src, void *__dst, size_t __n) {
const uint8_t *src = (const uint8_t*)__src;
uint8_t *dst = (uint8_t*)__dst;
while (__n--) {
eeprom_update_byte(dst++, pgm_read_byte(src++));
eeprom_update_byte_notify(dst++, pgm_read_byte(src++));
}
}
void eeprom_toggle(uint8_t *__p) {
eeprom_write_byte(__p, !eeprom_read_byte(__p));
eeprom_write_byte_notify(__p, !eeprom_read_byte(__p));
}
void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) {
eeprom_write_byte(__p, eeprom_read_byte(__p) + 1);
eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1);
}
void __attribute__((noinline)) eeprom_increment_word(uint16_t *__p) {
eeprom_write_word(__p, eeprom_read_word(__p) + 1);
eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1);
}
void __attribute__((noinline)) eeprom_increment_dword(uint32_t *__p) {
eeprom_write_dword(__p, eeprom_read_dword(__p) + 1);
eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + 1);
}
void __attribute__((noinline)) eeprom_add_byte(uint8_t *__p, uint8_t add) {
eeprom_write_byte(__p, eeprom_read_byte(__p) + add);
eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + add);
}
void __attribute__((noinline)) eeprom_add_word(uint16_t *__p, uint16_t add) {
eeprom_write_word(__p, eeprom_read_word(__p) + add);
eeprom_write_word_notify(__p, eeprom_read_word(__p) + add);
}
void __attribute__((noinline)) eeprom_add_dword(uint32_t *__p, uint32_t add) {
eeprom_write_dword(__p, eeprom_read_dword(__p) + add);
eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add);
}
uint8_t __attribute__((noinline)) eeprom_init_default_byte(uint8_t *__p, uint8_t def) {
uint8_t val = eeprom_read_byte(__p);
if (val == EEPROM_EMPTY_VALUE) {
eeprom_write_byte(__p, def);
eeprom_write_byte_notify(__p, def);
return def;
}
return val;
@ -209,7 +372,7 @@ uint8_t __attribute__((noinline)) eeprom_init_default_byte(uint8_t *__p, uint8_t
uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) {
uint16_t val = eeprom_read_word(__p);
if (val == EEPROM_EMPTY_VALUE16) {
eeprom_write_word(__p, def);
eeprom_write_word_notify(__p, def);
return def;
}
return val;
@ -218,7 +381,7 @@ uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint1
uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) {
uint32_t val = eeprom_read_dword(__p);
if (val == EEPROM_EMPTY_VALUE32) {
eeprom_write_dword(__p, def);
eeprom_write_dword_notify(__p, def);
return def;
}
return val;
@ -226,12 +389,12 @@ uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint
void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) {
if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32)
eeprom_write_float(__p, def);
eeprom_write_float_notify(__p, def);
}
void __attribute__((noinline)) eeprom_init_default_block(void *__p, size_t __n, const void *def) {
if (!eeprom_is_initialized_block(__p, __n))
eeprom_update_block(def, __p, __n);
eeprom_update_block_notify(def, __p, __n);
}
void __attribute__((noinline)) eeprom_init_default_block_P(void *__p, size_t __n, const void *def) {

View File

@ -12,6 +12,7 @@
#define EEPROM_H
#include <stdint.h>
#include <stddef.h>
#include "Configuration_var.h"
// Custom Mendel Name
@ -83,7 +84,7 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
To convert hex to dec https://www.rapidtables.com/convert/number/hex-to-decimal.html
Version: 1.0.2
Version: 3.14.1
---------------------------------------------------------------------------------
@ -106,8 +107,8 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
| ^ | ^ | ^ | f0h 240 | ^ __P__ | needs Z calibration | ^ | ^
| ^ | ^ | ^ | fah 250 | ^ | needs XYZ calibration | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Unknown (legacy) | ^ | ^
| 0x0FF5 4085 | uint16 | EEPROM_BABYSTEP_Z0 | ??? | ff ffh 65535 | Babystep for Z ??? | ??? | D3 Ax0ff5 C2
| 0x0FF1 4081 | uint32 | EEPROM_FILAMENTUSED | ??? | 00 00 00 00h 0 __S/P__| Filament used in meters | ??? | D3 Ax0ff1 C4
| 0x0FF5 4085 | uint16 | _EEPROM_FREE_NR12_ | ??? | ff ffh 65535 | _Free EEPROM space_ | _free space_ | D3 Ax0ff5 C2
| 0x0FF1 4081 | uint32 | EEPROM_FILAMENTUSED | ??? | 00 00 00 00h 0 __S/P__| Filament used in centimeters | ??? | D3 Ax0ff1 C4
| 0x0FED 4077 | uint32 | EEPROM_TOTALTIME | ??? | 00 00 00 00h 0 __S/P__| Total print time in minutes | ??? | D3 Ax0fed C4
| 0x0FE5 4069 | float | EEPROM_BED_CALIBRATION_CENTER | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fe5 C8
| 0x0FDD 4061 | float | EEPROM_BED_CALIBRATION_VEC_X | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fdd C8
@ -382,6 +383,41 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
| 0x0C94 3220 | uint8 | EEPROM_KILL_PENDING_FLAG | 42h, ffh | ffh | Kill pending flag (0x42 magic value) | kill() | D3 Ax0c94 C1
| 0x0C91 3217 | char[3] | EEPROM_FILENAME_EXTENSION | ??? | ffffffffh | DOS 8.3 filename extension | Power Panic | D3 Ax0c91 C1
| 0x0C80 3200 | char[17]| EEPROM_CUSTOM_MENDEL_NAME | Prusa i3 MK3S| ffffffffffffffffff... | Custom Printer Name | | D3 Ax0c80 C17
| 0x0C7F 3199 | bool | EEPROM_UVLO_Z_LIFTED | 00h 0 | 00h | Power Panic Z axis NOT lifted | Power Panic | D3 Ax0c7f C1
| ^ | ^ | ^ | 01h 1 | 01h | Power Panic Z axis lifted | ^ | ^
| 0x0C7d 3197 | uint16 | EEPROM_UVLO_EXTRUDE_MINTEMP | 0-305 | afh 175 | Power Panic Extrude mintemp | Power Panic | D3 Ax0c7d C2
| 0x0C6D 3181 | uint32 | EEPROM_UVLO_ACCELL_MM_S2_NORMAL | ??? | ff ff ff ffh | Power Panic acceleration mm per s2 normal | Power Panic | D3 Ax0c6d C16
| ^ | ^ | ^ | ??? | ^ | E-axis | ^ | D3 Ax0c79 C4
| ^ | ^ | ^ | ??? | ^ | Z-axis | ^ | D3 Ax0c75 C4
| ^ | ^ | ^ | ??? | ^ | Y-axis | ^ | D3 Ax0c71 C4
| ^ | ^ | ^ | ??? | ^ | X-axis | ^ | D3 Ax0c6d C4
| 0x0C5D 3165 | uint32 | EEPROM_UVLO_ACCELL_MM_S2_SILENT | ??? | ff ff ff ffh | Power Panic acceleration mm per s2 silent | Power Panic | D3 Ax0c5d C16
| ^ | ^ | ^ | ??? | ^ | E-axis | ^ | D3 Ax0c69 C4
| ^ | ^ | ^ | ??? | ^ | Z-axis | ^ | D3 Ax0c65 C4
| ^ | ^ | ^ | ??? | ^ | Y-axis | ^ | D3 Ax0c61 C4
| ^ | ^ | ^ | ??? | ^ | X-axis | ^ | D3 Ax0c5d C4
| 0x0C4D 3149 | float | EEPROM_UVLO_MAX_FEEDRATE_NORMAL | ??? | ff ff ff ffh | Power Panic max feedrate normal | Power Panic | D3 Ax0c4d C16
| ^ | ^ | ^ | ??? | ^ | E-axis | ^ | D3 Ax0d59 C4
| ^ | ^ | ^ | ??? | ^ | Z-axis | ^ | D3 Ax0d55 C4
| ^ | ^ | ^ | ??? | ^ | Y-axis | ^ | D3 Ax0d51 C4
| ^ | ^ | ^ | ??? | ^ | X-axis | ^ | D3 Ax0c4d C4
| 0x0C3D 3133 | float | EEPROM_UVLO_MAX_FEEDRATE_SILENT | ??? | ff ff ff ffh | Power Panic max feedrate silent | Power Panic | D3 Ax0c3d C16
| ^ | ^ | ^ | ??? | ^ | E-axis | ^ | D3 Ax0d49 C4
| ^ | ^ | ^ | ??? | ^ | Z-axis | ^ | D3 Ax0d45 C4
| ^ | ^ | ^ | ??? | ^ | Y-axis | ^ | D3 Ax0d41 C4
| ^ | ^ | ^ | ??? | ^ | X-axis | ^ | D3 Ax0c3d C4
| 0x0C39 3129 | float | EEPROM_UVLO_MIN_FEEDRATE | ??? | ff ff ff ffh | Power Panic min feedrate | Power Panic | D3 Ax0c39 C4
| 0x0C35 3125 | float | EEPROM_UVLO_MIN_TRAVEL_FEEDRATE | ??? | ff ff ff ffh | Power Panic min travel feedrate | Power Panic | D3 Ax0c35 C4
| 0x0C31 3121 | uint32 | EEPROM_UVLO_MIN_SEGMENT_TIME_US | ??? | ff ff ff ffh | Power Panic min segment time us | Power Panic | D3 Ax0c31 C4
| 0x0C21 3105 | float | EEPROM_UVLO_MAX_JERK | ??? | ff ff ff ffh | Power Panic max jerk | Power Panic | D3 Ax0c21 C16
| ^ | ^ | ^ | ??? | ^ | E-axis | ^ | D3 Ax0d2d C4
| ^ | ^ | ^ | ??? | ^ | Z-axis | ^ | D3 Ax0d29 C4
| ^ | ^ | ^ | ??? | ^ | Y-axis | ^ | D3 Ax0d25 C4
| ^ | ^ | ^ | ??? | ^ | X-axis | ^ | D3 Ax0c21 C4
| 0x0C11 3089 | uint8 | EEPROM_CHECK_FILAMENT | 01h 1 | ffh 255 | Check mode for filament is: __warn__ | LCD menu | D3 Ax0c11 C1
| ^ | ^ | ^ | 02h 2 | ^ | Check mode for filament is: __strict__ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for filament is: __none__ | ^ | ^
|Address begin|Bit/Type | Name | Valid values | Default/FactoryReset | Description |Gcode/Function| Debug code
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--:
@ -405,7 +441,7 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
#define _EEPROM_FREE_NR11_ 4090 // uint16_t
#define EEPROM_BABYSTEP_Z 4088 //legacy, multiple values stored now in EEPROM_Sheets_base
#define EEPROM_CALIBRATION_STATUS_V1 4087 // legacy, used up to v3.11
#define EEPROM_BABYSTEP_Z0 4085
#define _EEPROM_FREE_NR12_ (EEPROM_CALIBRATION_STATUS_V1 - 2) // uint16_t
#define EEPROM_FILAMENTUSED 4081
// uint32_t
#define EEPROM_TOTALTIME 4077
@ -621,9 +657,19 @@ static Sheets * const EEPROM_Sheets_base = (Sheets*)(EEPROM_SHEETS_BASE);
#define EEPROM_KILL_PENDING_FLAG (EEPROM_KILL_MESSAGE-1) //uint8
#define EEPROM_FILENAME_EXTENSION (EEPROM_KILL_PENDING_FLAG - 3) // 3 x char
#define EEPROM_CUSTOM_MENDEL_NAME (EEPROM_FILENAME_EXTENSION-17) //char[17]
#define EEPROM_UVLO_Z_LIFTED (EEPROM_CUSTOM_MENDEL_NAME-1) //bool
#define EEPROM_UVLO_EXTRUDE_MINTEMP (EEPROM_UVLO_Z_LIFTED-2) //uint16_t
#define EEPROM_UVLO_ACCELL_MM_S2_NORMAL (EEPROM_UVLO_EXTRUDE_MINTEMP-4*4) // 4 x float
#define EEPROM_UVLO_ACCELL_MM_S2_SILENT (EEPROM_UVLO_ACCELL_MM_S2_NORMAL-4*4) // 4 x uint32_t
#define EEPROM_UVLO_MAX_FEEDRATE_NORMAL (EEPROM_UVLO_ACCELL_MM_S2_SILENT-4*4) // 4 x uint32_t
#define EEPROM_UVLO_MAX_FEEDRATE_SILENT (EEPROM_UVLO_MAX_FEEDRATE_NORMAL-4*4) // 4 x float
#define EEPROM_UVLO_MIN_FEEDRATE (EEPROM_UVLO_MAX_FEEDRATE_SILENT-4) //float
#define EEPROM_UVLO_MIN_TRAVEL_FEEDRATE (EEPROM_UVLO_MIN_FEEDRATE-4) //float
#define EEPROM_UVLO_MIN_SEGMENT_TIME_US (EEPROM_UVLO_MIN_TRAVEL_FEEDRATE-4) //uint32_t
#define EEPROM_UVLO_MAX_JERK (EEPROM_UVLO_MIN_SEGMENT_TIME_US-4*4) // 4 x float
#define EEPROM_CHECK_FILAMENT (EEPROM_UVLO_MAX_JERK-1) // uint8_t
//This is supposed to point to last item to allow EEPROM overrun check. Please update when adding new items.
#define EEPROM_LAST_ITEM EEPROM_FILENAME_EXTENSION
#define EEPROM_LAST_ITEM EEPROM_CHECK_FILAMENT
// !!!!!
// !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!!
// !!!!!
@ -684,6 +730,30 @@ uint32_t eeprom_init_default_dword(uint32_t *__p, uint32_t def);
void eeprom_init_default_float(float *__p, float def);
void eeprom_init_default_block(void *__p, size_t __n, const void *def);
void eeprom_init_default_block_P(void *__p, size_t __n, const void *def);
/// Updates eeprom byte and notifies the changed eeprom address (just the address!) onto the serial line
#ifndef DEBUG_EEPROM_CHANGES
void eeprom_write_byte_notify(uint8_t *dst, uint8_t value);
void eeprom_update_byte_notify(uint8_t *dst, uint8_t value);
void eeprom_write_word_notify(uint16_t *dst, uint16_t value);
void eeprom_update_word_notify(uint16_t *dst, uint16_t value);
void eeprom_write_dword_notify(uint32_t *dst, uint32_t value);
void eeprom_update_dword_notify(uint32_t *dst, uint32_t value);
void eeprom_write_float_notify(float *dst, float value);
void eeprom_update_float_notify(float *dst, float value);
void eeprom_write_block_notify(const void *__src, void *__dst , size_t __size);
void eeprom_update_block_notify(const void *__src, void *__dst, size_t __size);
#else
void eeprom_write_byte_notify(uint8_t *dst, uint8_t value, bool active = true);
void eeprom_update_byte_notify(uint8_t *dst, uint8_t value, bool active = true);
void eeprom_write_word_notify(uint16_t *dst, uint16_t value, bool active = true);
void eeprom_update_word_notify(uint16_t *dst, uint16_t value, bool active = true);
void eeprom_write_dword_notify(uint32_t *dst, uint32_t value, bool active = true);
void eeprom_update_dword_notify(uint32_t *dst, uint32_t value, bool active = true);
void eeprom_write_float_notify(float *dst, float value, bool active = true);
void eeprom_update_float_notify(float *dst, float value, bool active = true);
void eeprom_write_block_notify(const void *__src, void *__dst , size_t __size, bool active = true);
void eeprom_update_block_notify(const void *__src, void *__dst, size_t __size , bool active = true);
#endif //DEBUG_EEPROM_CHANGES
#endif
#endif // EEPROM_H

View File

@ -94,7 +94,7 @@ void fanSpeedError(unsigned char _fan) {
if (printJobOngoing()) {
// A print is ongoing, pause the print normally
if(!print_job_timer.isPaused()) {
if(!printingIsPaused()) {
if (usb_timer.running())
lcd_pause_usb_print();
else
@ -149,7 +149,7 @@ void checkFanSpeed()
lcd_reset_alert_level(); //for another fan speed error
lcd_setstatuspgm(MSG_WELCOME); // Reset the status line message to visually show the error is gone
}
if (fans_check_enabled && (fan_check_error == EFCE_OK))
if (fans_check_enabled && (fan_check_error != EFCE_REPORTED))
{
for (uint8_t fan = 0; fan < 2; fan++)
{
@ -238,7 +238,7 @@ bool extruder_altfan_detect()
void altfanOverride_toggle()
{
altfanStatus.altfanOverride = !altfanStatus.altfanOverride;
eeprom_update_byte((uint8_t *)EEPROM_ALTFAN_OVERRIDE, altfanStatus.altfanOverride);
eeprom_update_byte_notify((uint8_t *)EEPROM_ALTFAN_OVERRIDE, altfanStatus.altfanOverride);
}
bool altfanOverride_get()

View File

@ -37,12 +37,31 @@ static constexpr float spacing(float layer_height, float extrusion_width, float
static void lay1cal_common_enqueue_loop(const char * const * cmd_sequence, const uint8_t steps) {
for (uint8_t i = 0; i < steps; ++i)
{
enquecommand_P(static_cast<char*>(pgm_read_ptr(cmd_sequence + i)));
void * const pgm_ptr = pgm_read_ptr(cmd_sequence + i);
// M702 is currently only used with MMU enabled
if (pgm_ptr == MSG_M702 && !MMU2::mmu2.Enabled()) {
continue;
}
enquecommand_P(static_cast<char*>(pgm_ptr));
}
}
static const char extrude_fmt[] PROGMEM = "G1 X%d Y%d E%-.5f";
static const char zero_extrusion[] PROGMEM = "G92 E0";
static const char extrude_fmt_X[] PROGMEM = "G1X%.4fE%.4f";
static const char extrude_fmt_Y[] PROGMEM = "G1Y%.4fE%.4f";
static const char zero_extrusion[] PROGMEM = "G92E0";
static const char feedrate_F1080[] PROGMEM = "G1F1080";
#ifndef NEW_FIRST_LAYER_CAL
static constexpr int8_t invert = 1;
static constexpr float short_length = 20;
static constexpr float square_width = short_length;
#else
static constexpr int8_t invert = -1;
static constexpr float short_length = 13.2812; //max_pos[1]/2 / meander * 2
static constexpr float square_width = short_length*2;
#endif //NEW_FIRST_LAYER_CAL
static constexpr float long_length = 150;
//! @brief Wait for preheat
void lay1cal_wait_preheat()
@ -72,8 +91,8 @@ bool lay1cal_load_filament(uint8_t filament)
if (MMU2::mmu2.Enabled())
{
enquecommand_P(MSG_M83);
enquecommand_P(PSTR("G1 Y-3 F1000"));
enquecommand_P(PSTR("G1 Z0.4 F1000"));
enquecommand_P(PSTR("G1Y-3F1000"));
enquecommand_P(PSTR("G1Z0.4"));
uint8_t currentTool = MMU2::mmu2.get_current_tool();
if(currentTool == filament ){
@ -96,22 +115,19 @@ bool lay1cal_load_filament(uint8_t filament)
//! @param extrusion_width the width of the extrusion layer
void lay1cal_intro_line(bool extraPurgeNeeded, float layer_height, float extrusion_width)
{
static const char cmd_intro_mmu_3[] PROGMEM = "G1 X55 E29 F1073";
static const char cmd_intro_mmu_4[] PROGMEM = "G1 X5 E29 F1800";
static const char cmd_intro_mmu_5[] PROGMEM = "G1 X55 E8 F2000";
static const char cmd_intro_mmu_6[] PROGMEM = "G1 Z0.3 F1000";
static const char cmd_intro_mmu_8[] PROGMEM = "G1 X240 E25 F2200";
static const char cmd_intro_mmu_9[] PROGMEM = "G1 Y-2 F1000";
static const char cmd_intro_mmu_10[] PROGMEM = "G1 X55 E25 F1400";
static const char cmd_intro_mmu_11[] PROGMEM = "G1 Z0.2 F1000";
static const char cmd_intro_mmu_12[] PROGMEM = "G1 X5 E4 F1000";
static const char * const intro_mmu_cmd[] PROGMEM =
static const char cmd_intro_mmu_3[] PROGMEM = "G1X55E29F1073";
static const char cmd_intro_mmu_4[] PROGMEM = "G1X5E29F1800";
static const char cmd_intro_mmu_5[] PROGMEM = "G1X55E8F2000";
static const char cmd_intro_mmu_6[] PROGMEM = "G1Z0.3F1000";
static const char cmd_intro_mmu_8[] PROGMEM = "G1X240E25F2200";
static const char cmd_intro_mmu_9[] PROGMEM = "G1Y-2F1000";
static const char cmd_intro_mmu_10[] PROGMEM = "G1X202.5E8F1400";
static const char cmd_intro_mmu_11[] PROGMEM = "G1Z0.2";
static const char * const cmd_intro_mmu[] PROGMEM =
{
// first 2 items are only relevant if filament was not loaded - i.e. extraPurgeNeeded == true
cmd_intro_mmu_3,
cmd_intro_mmu_4,
cmd_intro_mmu_5,
cmd_intro_mmu_6,
zero_extrusion,
@ -119,42 +135,42 @@ void lay1cal_intro_line(bool extraPurgeNeeded, float layer_height, float extrusi
cmd_intro_mmu_9,
cmd_intro_mmu_10,
cmd_intro_mmu_11,
cmd_intro_mmu_12,
};
if (MMU2::mmu2.Enabled())
{
for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i)
for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i)
{
enquecommand_P(static_cast<char*>(pgm_read_ptr(&intro_mmu_cmd[i])));
enquecommand_P(static_cast<char*>(pgm_read_ptr(&cmd_intro_mmu[i])));
}
}
else
{
static const char fmt1[] PROGMEM = "G1 X%d E%-.3f F1000";
enquecommandf_P(fmt1, 60, count_e(layer_height, extrusion_width * 4.f, 60));
enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40));
enquecommand_P(feedrate_F1080); //fixed velocity for the intro line
enquecommandf_P(extrude_fmt_X, 60.f, count_e(layer_height, extrusion_width * 4.f, 60));
enquecommandf_P(extrude_fmt_X, 202.5f, count_e(layer_height, extrusion_width * 8.f, 142.5));
}
}
//! @brief Setup for printing meander
void lay1cal_before_meander()
{
static const char cmd_pre_meander_2[] PROGMEM = "G90"; //use absolute coordinates
static const char cmd_pre_meander_4[] PROGMEM = "G1 E-1.5 F2100";
static const char cmd_pre_meander_5[] PROGMEM = "G1 Z5 F7200";
static const char cmd_pre_meander_6[] PROGMEM = "M204 S1000"; //set acceleration
static const char cmd_pre_meander_7[] PROGMEM = "G1 F4000";
#ifndef NEW_FIRST_LAYER_CAL
static const char cmd_pre_meander_4[] PROGMEM = "G1E-1.5F2100";
static const char cmd_pre_meander_5[] PROGMEM = "G1Z5F7200";
#endif //NEW_FIRST_LAYER_CAL
static const char cmd_pre_meander_6[] PROGMEM = "M204S1000"; //set acceleration
static const char * const cmd_pre_meander[] PROGMEM =
{
zero_extrusion,
cmd_pre_meander_2,
MSG_G90,
MSG_M83, // use relative distances for extrusion
#ifndef NEW_FIRST_LAYER_CAL
cmd_pre_meander_4,
cmd_pre_meander_5,
#endif //NEW_FIRST_LAYER_CAL
cmd_pre_meander_6,
cmd_pre_meander_7,
};
lay1cal_common_enqueue_loop(cmd_pre_meander, (sizeof(cmd_pre_meander)/sizeof(cmd_pre_meander[0])));
@ -163,88 +179,86 @@ void lay1cal_before_meander()
//! @brief Print meander start
void lay1cal_meander_start(float layer_height, float extrusion_width)
{
enquecommand_P(PSTR("G1 X50 Y155"));
static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200";
#ifndef NEW_FIRST_LAYER_CAL
enquecommand_P(PSTR("G1X50Y155"));
#endif //_NEW_FIRST_LAYER_CAL
static const char fmt1[] PROGMEM = "G1Z%.2f";
enquecommandf_P(fmt1, layer_height);
enquecommand_P(PSTR("G1 F1080"));
enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25));
enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25));
enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100));
enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20));
enquecommand_P(feedrate_F1080);
enquecommand_P(MSG_G91); //enable relative XYZ
#ifdef NEW_FIRST_LAYER_CAL
enquecommandf_P(extrude_fmt_Y, short_length, count_e(layer_height, extrusion_width, short_length));
enquecommandf_P(extrude_fmt_X, long_length*invert, count_e(layer_height, extrusion_width, long_length));
enquecommandf_P(extrude_fmt_Y, -short_length*invert, count_e(layer_height, extrusion_width, short_length));
#else
enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 4.f, 25));
enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 2.f, 25));
enquecommandf_P(extrude_fmt_X, 100.f*invert, count_e(layer_height, extrusion_width, 100));
enquecommandf_P(extrude_fmt_Y, -20.f*invert, count_e(layer_height, extrusion_width, 20));
#endif //_NEW_FIRST_LAYER_CAL
}
//! @brief Print meander
//! @param cmd_buffer character buffer needed to format gcodes
void lay1cal_meander(float layer_height, float extrusion_width)
{
const float short_length = 20;
float long_length = 150;
const float long_extrusion = count_e(layer_height, extrusion_width, long_length);
const float short_extrusion = count_e(layer_height, extrusion_width, short_length);
uint8_t y_pos = 135;
uint8_t x_pos = 50;
for(uint8_t i = 0; i <= 4; ++i)
for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir)
{
enquecommandf_P(extrude_fmt, x_pos, y_pos, long_extrusion);
y_pos -= short_length;
enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion);
x_pos += long_length;
long_length = -long_length;
enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion);
enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion);
}
#ifdef NEW_FIRST_LAYER_CAL
constexpr float mid_length = 0.5f * long_length - 0.5f * square_width;
const float mid_extrusion = count_e(layer_height, extrusion_width, mid_length);
enquecommandf_P(extrude_fmt_X, -mid_length, mid_extrusion); //~Middle of bed X125
enquecommandf_P(extrude_fmt_Y, short_length, short_extrusion); //~Middle of bed Y105
#endif //NEW_FIRST_LAYER_CAL
}
//! @brief Print square
//!
//! This function needs to be called 4 times with step of 0,4,8,12
//! This function enqueues 4 lines of the square, so it needs to be called multiple times
//!
//! @param cmd_buffer character buffer needed to format gcodes
//! @param i iteration
void lay1cal_square(uint8_t step, float layer_height, float extrusion_width)
void lay1cal_square(float layer_height, float extrusion_width)
{
const float long_length = 20;
const float short_length = spacing(layer_height, extrusion_width);
const float long_extrusion = count_e(layer_height, extrusion_width, long_length);
const float short_extrusion = count_e(layer_height, extrusion_width, short_length);
static const char fmt1[] PROGMEM = "G1 X%d Y%-.2f E%-.3f";
const float Y_spacing = spacing(layer_height, extrusion_width);
const float long_extrusion = count_e(layer_height, extrusion_width, square_width);
const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing);
for (uint8_t i = step; i < step+4; ++i)
for (uint8_t i = 0; i < 4; i++)
{
enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion);
enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion);
enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion);
enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion);
enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion);
enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion);
enquecommandf_P(extrude_fmt_X, -square_width*invert, long_extrusion);
enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion);
}
}
void lay1cal_finish(bool mmu_enabled)
void lay1cal_finish()
{
static const char cmd_cal_finish_1[] PROGMEM = "G1 E-0.075 F2100"; //retract
static const char cmd_cal_finish_2[] PROGMEM = "M104 S0"; // turn off temperature
static const char cmd_cal_finish_3[] PROGMEM = "M140 S0"; // turn off heatbed
static const char cmd_cal_finish_4[] PROGMEM = "G1 Z10 F1300"; //lift Z
static const char cmd_cal_finish_5[] PROGMEM = "G1 X10 Y180 F4000"; //Go to parking position
static const char cmd_cal_finish_3[] PROGMEM = "G1E-0.075F2100"; // Retract
static const char cmd_cal_finish_4[] PROGMEM = "M140S0"; // Turn off bed heater
static const char cmd_cal_finish_5[] PROGMEM = "G1Z10F1300"; // Lift Z
static const char cmd_cal_finish_6[] PROGMEM = "G1X10Y180F4000"; // Go to parking position
static const char cmd_cal_finish_8[] PROGMEM = "M104S0"; // Turn off hotend heater
static const char * const cmd_cal_finish[] PROGMEM =
{
MSG_M107, // turn off printer fan
cmd_cal_finish_1,
cmd_cal_finish_2,
cmd_cal_finish_3,
cmd_cal_finish_4,
cmd_cal_finish_5
MSG_G90, // Set to Absolute Positioning
MSG_M107, // Turn off printer fan
cmd_cal_finish_3, // Retract
cmd_cal_finish_4, // Turn off bed heater
cmd_cal_finish_5, // Lift Z
cmd_cal_finish_6, // Go to parking position
MSG_M702, // Unload filament (MMU only)
cmd_cal_finish_8, // Turn off hotend heater
MSG_M84 // Disable stepper motors
};
lay1cal_common_enqueue_loop(cmd_cal_finish, (sizeof(cmd_cal_finish)/sizeof(cmd_cal_finish[0])));
if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle
enquecommand_P(MSG_M84);// disable motors
}

View File

@ -12,7 +12,7 @@ void lay1cal_intro_line(bool skipExtraPurge, float layer_height, float extrusion
void lay1cal_before_meander();
void lay1cal_meander_start(float layer_height, float extrusion_width);
void lay1cal_meander(float layer_height, float extrusion_width);
void lay1cal_square(uint8_t step, float layer_height, float extrusion_width);
void lay1cal_finish(bool mmu_enabled);
void lay1cal_square(float layer_height, float extrusion_width);
void lay1cal_finish();
#endif /* FIRMWARE_FIRST_LAY_CAL_H_ */

View File

@ -13,10 +13,6 @@
#define PROTOCOL_VERSION "1.0"
#ifndef MACHINE_UUID
#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
#endif
#if (LANG_MODE == 0) //primary language only
#define PROGMEM_I2 __attribute__((section(".progmem0")))
#define PROGMEM_I1 __attribute__((section(".progmem1")))

View File

@ -22,8 +22,6 @@
#define LCD_8BIT
#endif
// #define VT100
// commands
#define LCD_CLEARDISPLAY 0x01
#define LCD_RETURNHOME 0x02
@ -77,10 +75,6 @@ static uint8_t lcd_displaymode = 0;
uint8_t lcd_currline;
static uint8_t lcd_ddram_address; // no need for preventing ddram overflow
#ifdef VT100
uint8_t lcd_escape[8];
#endif
struct CustomCharacter {
uint8_t colByte;
uint8_t rowData[4];
@ -95,28 +89,9 @@ static const CustomCharacter Font[] PROGMEM = {
#define CUSTOM_CHARACTERS_CNT (sizeof(Font) / sizeof(Font[0]))
static void lcd_display(void);
#if 0
static void lcd_no_display(void);
static void lcd_no_cursor(void);
static void lcd_cursor(void);
static void lcd_no_blink(void);
static void lcd_blink(void);
static void lcd_scrollDisplayLeft(void);
static void lcd_scrollDisplayRight(void);
static void lcd_leftToRight(void);
static void lcd_rightToLeft(void);
static void lcd_autoscroll(void);
static void lcd_no_autoscroll(void);
#endif
static void lcd_print_custom(uint8_t c);
static void lcd_invalidate_custom_characters();
#ifdef VT100
void lcd_escape_write(uint8_t chr);
#endif
static void lcd_pulseEnable(void)
{
WRITE(LCD_PINS_ENABLE,HIGH);
@ -164,16 +139,9 @@ static void lcd_write(uint8_t value)
if (value == '\n') {
if (lcd_currline > 3) lcd_currline = -1;
lcd_set_cursor(0, lcd_currline + 1); // LF
}
else if ((value >= 0x80) && (value < (0x80 + CUSTOM_CHARACTERS_CNT))) {
} else if ((value >= 0x80) && (value < (0x80 + CUSTOM_CHARACTERS_CNT))) {
lcd_print_custom(value);
}
#ifdef VT100
else if (lcd_escape[0] || (value == '\e')) {
lcd_escape_write(value);
}
#endif
else {
} else {
lcd_send(value, HIGH);
lcd_ddram_address++; // no need for preventing ddram overflow
}
@ -207,10 +175,6 @@ static void lcd_begin(uint8_t clear)
lcd_displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT;
// set the entry mode
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
#ifdef VT100
lcd_escape[0] = 0;
#endif
}
static int lcd_putchar(char c, FILE *)
@ -278,83 +242,6 @@ void lcd_display(void)
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
#if 0
void lcd_no_display(void)
{
lcd_displaycontrol &= ~LCD_DISPLAYON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
#endif
#ifdef VT100 //required functions for VT100
// Turns the underline cursor on/off
void lcd_no_cursor(void)
{
lcd_displaycontrol &= ~LCD_CURSORON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
void lcd_cursor(void)
{
lcd_displaycontrol |= LCD_CURSORON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
#endif
#if 0
// Turn on and off the blinking cursor
void lcd_no_blink(void)
{
lcd_displaycontrol &= ~LCD_BLINKON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
void lcd_blink(void)
{
lcd_displaycontrol |= LCD_BLINKON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
// These commands scroll the display without changing the RAM
void lcd_scrollDisplayLeft(void)
{
lcd_command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT);
}
void lcd_scrollDisplayRight(void)
{
lcd_command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT);
}
// This is for text that flows Left to Right
void lcd_leftToRight(void)
{
lcd_displaymode |= LCD_ENTRYLEFT;
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
}
// This is for text that flows Right to Left
void lcd_rightToLeft(void)
{
lcd_displaymode &= ~LCD_ENTRYLEFT;
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
}
// This will 'right justify' text from the cursor
void lcd_autoscroll(void)
{
lcd_displaymode |= LCD_ENTRYSHIFTINCREMENT;
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
}
// This will 'left justify' text from the cursor
void lcd_no_autoscroll(void)
{
lcd_displaymode &= ~LCD_ENTRYSHIFTINCREMENT;
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
}
#endif
/// @brief set the current LCD row
/// @param row LCD row number, ranges from 0 to LCD_HEIGHT - 1
static void FORCE_INLINE lcd_set_current_row(uint8_t row)
@ -443,144 +330,6 @@ void lcd_createChar_P(uint8_t location, const CustomCharacter *char_p)
lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address
}
#ifdef VT100
//Supported VT100 escape codes:
//EraseScreen "\x1b[2J"
//CursorHome "\x1b[%d;%dH"
//CursorShow "\x1b[?25h"
//CursorHide "\x1b[?25l"
void lcd_escape_write(uint8_t chr)
{
#define escape_cnt (lcd_escape[0]) //escape character counter
#define is_num_msk (lcd_escape[1]) //numeric character bit mask
#define chr_is_num (is_num_msk & 0x01) //current character is numeric
#define e_2_is_num (is_num_msk & 0x04) //escape char 2 is numeric
#define e_3_is_num (is_num_msk & 0x08) //...
#define e_4_is_num (is_num_msk & 0x10)
#define e_5_is_num (is_num_msk & 0x20)
#define e_6_is_num (is_num_msk & 0x40)
#define e_7_is_num (is_num_msk & 0x80)
#define e2_num (lcd_escape[2] - '0') //number from character 2
#define e3_num (lcd_escape[3] - '0') //number from character 3
#define e23_num (10*e2_num+e3_num) //number from characters 2 and 3
#define e4_num (lcd_escape[4] - '0') //number from character 4
#define e5_num (lcd_escape[5] - '0') //number from character 5
#define e45_num (10*e4_num+e5_num) //number from characters 4 and 5
#define e6_num (lcd_escape[6] - '0') //number from character 6
#define e56_num (10*e5_num+e6_num) //number from characters 5 and 6
if (escape_cnt > 1) // escape length > 1 = "\x1b["
{
lcd_escape[escape_cnt] = chr; // store current char
if ((chr >= '0') && (chr <= '9')) // char is numeric
is_num_msk |= (1 | (1 << escape_cnt)); //set mask
else
is_num_msk &= ~1; //clear mask
}
switch (escape_cnt++)
{
case 0:
if (chr == 0x1b) return; // escape = "\x1b"
break;
case 1:
is_num_msk = 0x00; // reset 'is number' bit mask
if (chr == '[') return; // escape = "\x1b["
break;
case 2:
switch (chr)
{
case '2': return; // escape = "\x1b[2"
case '?': return; // escape = "\x1b[?"
default:
if (chr_is_num) return; // escape = "\x1b[%1d"
}
break;
case 3:
switch (lcd_escape[2])
{
case '?': // escape = "\x1b[?"
if (chr == '2') return; // escape = "\x1b[?2"
break;
case '2':
if (chr == 'J') // escape = "\x1b[2J"
{ lcd_clear(); break; } // EraseScreen
default:
if (e_2_is_num && // escape = "\x1b[%1d"
((chr == ';') || // escape = "\x1b[%1d;"
chr_is_num)) // escape = "\x1b[%2d"
return;
}
break;
case 4:
switch (lcd_escape[2])
{
case '?': // "\x1b[?"
if ((lcd_escape[3] == '2') && (chr == '5')) return; // escape = "\x1b[?25"
break;
default:
if (e_2_is_num) // escape = "\x1b[%1d"
{
if ((lcd_escape[3] == ';') && chr_is_num) return; // escape = "\x1b[%1d;%1d"
else if (e_3_is_num && (chr == ';')) return; // escape = "\x1b[%2d;"
}
}
break;
case 5:
switch (lcd_escape[2])
{
case '?':
if ((lcd_escape[3] == '2') && (lcd_escape[4] == '5')) // escape = "\x1b[?25"
switch (chr)
{
case 'h': // escape = "\x1b[?25h"
lcd_cursor(); // CursorShow
break;
case 'l': // escape = "\x1b[?25l"
lcd_no_cursor(); // CursorHide
break;
}
break;
default:
if (e_2_is_num) // escape = "\x1b[%1d"
{
if ((lcd_escape[3] == ';') && e_4_is_num) // escape = "\x1b%1d;%1dH"
{
if (chr == 'H') // escape = "\x1b%1d;%1dH"
lcd_set_cursor(e4_num, e2_num); // CursorHome
else if (chr_is_num)
return; // escape = "\x1b%1d;%2d"
}
else if (e_3_is_num && (lcd_escape[4] == ';') && chr_is_num)
return; // escape = "\x1b%2d;%1d"
}
}
break;
case 6:
if (e_2_is_num) // escape = "\x1b[%1d"
{
if ((lcd_escape[3] == ';') && e_4_is_num && e_5_is_num && (chr == 'H')) // escape = "\x1b%1d;%2dH"
lcd_set_cursor(e45_num, e2_num); // CursorHome
else if (e_3_is_num && (lcd_escape[4] == ';') && e_5_is_num) // escape = "\x1b%2d;%1d"
{
if (chr == 'H') // escape = "\x1b%2d;%1dH"
lcd_set_cursor(e5_num, e23_num); // CursorHome
else if (chr_is_num) // "\x1b%2d;%2d"
return;
}
}
break;
case 7:
if (e_2_is_num && e_3_is_num && (lcd_escape[4] == ';')) // "\x1b[%2d;"
if (e_5_is_num && e_6_is_num && (chr == 'H')) // "\x1b[%2d;%2dH"
lcd_set_cursor(e56_num, e23_num); // CursorHome
break;
}
escape_cnt = 0; // reset escape
}
#endif //VT100
int lcd_putc(char c)
{
return fputc(c, lcdout);

View File

@ -22,19 +22,6 @@ extern void lcd_clear(void);
extern void lcd_home(void);
/*extern void lcd_no_display(void);
extern void lcd_display(void);
extern void lcd_no_blink(void);
extern void lcd_blink(void);
extern void lcd_no_cursor(void);
extern void lcd_cursor(void);
extern void lcd_scrollDisplayLeft(void);
extern void lcd_scrollDisplayRight(void);
extern void lcd_leftToRight(void);
extern void lcd_rightToLeft(void);
extern void lcd_autoscroll(void);
extern void lcd_no_autoscroll(void);*/
extern void lcd_set_cursor(uint8_t col, uint8_t row);
/// @brief Change the cursor column position while preserving the current row position
@ -70,19 +57,6 @@ extern void lcd_print(unsigned int, int = 10);
extern void lcd_print(long, int = 10);
extern void lcd_print(unsigned long, int = 10);
//! @brief Clear screen
#define ESC_2J "\x1b[2J"
//! @brief Show cursor
#define ESC_25h "\x1b[?25h"
//! @brief Hide cursor
#define ESC_25l "\x1b[?25l"
//! @brief Set cursor to
//! @param c column
//! @param r row
#define ESC_H(c,r) "\x1b["#r";"#c"H"
#define LCD_UPDATE_INTERVAL 100
#define LCD_TIMEOUT_TO_STATUS 30000ul //!< Generic timeout to status screen in ms, when no user action.
#define LCD_TIMEOUT_TO_STATUS_BABYSTEP_Z 90000ul //!< Specific timeout for lcd_babystep_z screen in ms.
@ -137,18 +111,18 @@ extern void lcd_buttons_update(void);
//! When constructed (on stack), original state state of lcd_update_enabled is stored
//! and LCD updates are disabled.
//! When destroyed (gone out of scope), original state of LCD update is restored.
//! It has zero overhead compared to storing bool saved = lcd_update_enabled
//! and calling lcd_update_enable(false) and lcd_update_enable(saved).
//! Do not call lcd_update_enable() to prevent calling lcd_update() in sensitive code.
//! in certain scenarios it will cause recursion e.g. in the menus.
class LcdUpdateDisabler
{
public:
LcdUpdateDisabler(): m_updateEnabled(lcd_update_enabled)
{
lcd_update_enable(false);
lcd_update_enabled = false;
}
~LcdUpdateDisabler()
{
lcd_update_enable(m_updateEnabled);
lcd_update_enabled = m_updateEnabled;
}
private:

View File

@ -475,10 +475,8 @@ static void _menu_edit_P()
// disable after first use and/or if the initial value is not minEditValue
_md->minJumpValue = 0;
}
_md->currentValue += lcd_encoder;
lcd_encoder = 0; // Consume knob rotation event
// Constrain the value in case it's outside the allowed limits
_md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue);
lcd_set_cursor(0, 1);

View File

@ -2,6 +2,7 @@
#include "ConfigurationStore.h"
#include "util.h"
#include "language.h"
#include "lcd.h"
#include "mesh_bed_calibration.h"
#include "mesh_bed_leveling.h"
#include "stepper.h"
@ -373,7 +374,7 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
angleDiff = fabs(a2 - a1);
/// XY skew and Y-bed skew
DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2));
eeprom_update_float((float *)(EEPROM_XYZ_CAL_SKEW), angleDiff); //storing xyz cal. skew to be able to show in support menu later
eeprom_update_float_notify((float *)(EEPROM_XYZ_CAL_SKEW), angleDiff); //storing xyz cal. skew to be able to show in support menu later
if (angleDiff > bed_skew_angle_mild)
result = (angleDiff > bed_skew_angle_extreme) ?
BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME :
@ -499,19 +500,6 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
}
#endif // SUPPORT_VERBOSITY
#if 0
if (result == BED_SKEW_OFFSET_DETECTION_PERFECT && fabs(a1) < bed_skew_angle_mild && fabs(a2) < bed_skew_angle_mild) {
#ifdef SUPPORT_VERBOSITY
if (verbosity_level > 0)
SERIAL_ECHOLNPGM("Very little skew detected. Disabling skew correction.");
#endif // SUPPORT_VERBOSITY
// Just disable the skew correction.
vec_x[0] = MACHINE_AXIS_SCALE_X;
vec_x[1] = 0.f;
vec_y[0] = 0.f;
vec_y[1] = MACHINE_AXIS_SCALE_Y;
}
#else
if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) {
#ifdef SUPPORT_VERBOSITY
if (verbosity_level > 0)
@ -583,7 +571,6 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
}
#endif // SUPPORT_VERBOSITY
}
#endif
// Invert the transformation matrix made of vec_x, vec_y and cntr.
{
@ -669,16 +656,16 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
*/
void reset_bed_offset_and_skew()
{
eeprom_update_dword((uint32_t*)(EEPROM_BED_CALIBRATION_CENTER+0), 0x0FFFFFFFF);
eeprom_update_dword((uint32_t*)(EEPROM_BED_CALIBRATION_CENTER+4), 0x0FFFFFFFF);
eeprom_update_dword((uint32_t*)(EEPROM_BED_CALIBRATION_VEC_X +0), 0x0FFFFFFFF);
eeprom_update_dword((uint32_t*)(EEPROM_BED_CALIBRATION_VEC_X +4), 0x0FFFFFFFF);
eeprom_update_dword((uint32_t*)(EEPROM_BED_CALIBRATION_VEC_Y +0), 0x0FFFFFFFF);
eeprom_update_dword((uint32_t*)(EEPROM_BED_CALIBRATION_VEC_Y +4), 0x0FFFFFFFF);
eeprom_update_dword_notify((uint32_t*)(EEPROM_BED_CALIBRATION_CENTER+0), 0x0FFFFFFFF);
eeprom_update_dword_notify((uint32_t*)(EEPROM_BED_CALIBRATION_CENTER+4), 0x0FFFFFFFF);
eeprom_update_dword_notify((uint32_t*)(EEPROM_BED_CALIBRATION_VEC_X +0), 0x0FFFFFFFF);
eeprom_update_dword_notify((uint32_t*)(EEPROM_BED_CALIBRATION_VEC_X +4), 0x0FFFFFFFF);
eeprom_update_dword_notify((uint32_t*)(EEPROM_BED_CALIBRATION_VEC_Y +0), 0x0FFFFFFFF);
eeprom_update_dword_notify((uint32_t*)(EEPROM_BED_CALIBRATION_VEC_Y +4), 0x0FFFFFFFF);
// Reset the 8 16bit offsets.
for (int8_t i = 0; i < 4; ++ i)
eeprom_update_dword((uint32_t*)(EEPROM_BED_CALIBRATION_Z_JITTER+i*4), 0x0FFFFFFFF);
eeprom_update_dword_notify((uint32_t*)(EEPROM_BED_CALIBRATION_Z_JITTER+i*4), 0x0FFFFFFFF);
}
bool is_bed_z_jitter_data_valid()
@ -1199,8 +1186,6 @@ BedSkewOffsetDetectionResultType find_bed_induction_sensor_point_xy(int
MYSERIAL.println(current_position[Z_AXIS]);
}
#endif //SUPPORT_VERBOSITY
//lcd_show_fullscreen_message_and_wait_P(PSTR("First hit"));
//lcd_update_enable(true);
float init_x_position = current_position[X_AXIS];
float init_y_position = current_position[Y_AXIS];
@ -2443,9 +2428,9 @@ BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level
world2machine_update(vec_x, vec_y, cntr);
// Fearlessly store the calibration values into the eeprom.
eeprom_update_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8);
eeprom_update_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8);
eeprom_update_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8);
eeprom_update_block_notify(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8);
eeprom_update_block_notify(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8);
eeprom_update_block_notify(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8);
#ifdef SUPPORT_VERBOSITY
if (verbosity_level >= 10) {
@ -2537,7 +2522,7 @@ BedSkewOffsetDetectionResultType improve_bed_offset_and_skew(int8_t method, int8
bool endstop_z_enabled = enable_z_endstop(false);
#ifdef MESH_BED_CALIBRATION_SHOW_LCD
lcd_display_message_fullscreen_P(_i("Improving bed calibration point"));////MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1 c=20 r=4
lcd_display_message_fullscreen_P(_T(MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1));
#endif /* MESH_BED_CALIBRATION_SHOW_LCD */
// Collect a matrix of 9x9 points.
@ -2731,9 +2716,9 @@ BedSkewOffsetDetectionResultType improve_bed_offset_and_skew(int8_t method, int8
world2machine_update(vec_x, vec_y, cntr);
// Fearlessly store the calibration values into the eeprom.
eeprom_update_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8);
eeprom_update_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8);
eeprom_update_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8);
eeprom_update_block_notify(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8);
eeprom_update_block_notify(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8);
eeprom_update_block_notify(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8);
// Correct the current_position to match the transformed coordinate system after world2machine_rotation_and_skew and world2machine_shift were set.
world2machine_update_current();
@ -2838,6 +2823,10 @@ void go_home_with_z_lift()
// Returns false if the reference values are more than 3mm far away.
bool sample_mesh_and_store_reference()
{
bool result = false;
#ifdef TMC2130
tmc2130_home_enter(Z_AXIS_MASK);
#endif
bool endstops_enabled = enable_endstops(false);
bool endstop_z_enabled = enable_z_endstop(false);
@ -2853,30 +2842,25 @@ bool sample_mesh_and_store_reference()
// Sample Z heights for the mesh bed leveling.
// In addition, store the results into an eeprom, to be used later for verification of the bed leveling process.
{
// The first point defines the reference.
// Lower Z to the mesh search height with stall detection
enable_endstops(true);
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
go_to_current(homing_feedrate[Z_AXIS]/60);
#ifdef TMC2130
check_Z_crash();
#endif
enable_endstops(false);
// Move XY to first point
current_position[X_AXIS] = BED_X0;
current_position[Y_AXIS] = BED_Y0;
world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
go_to_current(homing_feedrate[X_AXIS]/60);
set_destination_to_current();
enable_endstops(true);
homeaxis(Z_AXIS);
#ifdef TMC2130
if (!axis_known_position[Z_AXIS] && (!READ(Z_TMC2130_DIAG))) //Z crash
{
kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW));
return false;
}
#endif //TMC2130
enable_endstops(false);
if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um
{
kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW));
return false;
}
mbl.set_z(0, 0, current_position[Z_AXIS]);
}
@ -2902,7 +2886,6 @@ bool sample_mesh_and_store_reference()
if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um
{
kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW));
return false;
}
// Get cords of measuring point
@ -2921,7 +2904,7 @@ bool sample_mesh_and_store_reference()
// The span of the Z offsets is extreme. Give up.
// Homing failed on some of the points.
SERIAL_PROTOCOLLNPGM("Exreme span of the Z values!");
return false;
goto end;
}
}
@ -2936,7 +2919,7 @@ bool sample_mesh_and_store_reference()
continue;
float dif = mbl.z_values[j][i] - mbl.z_values[0][0];
int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f));
eeprom_update_word((uint16_t*)addr, *reinterpret_cast<uint16_t*>(&dif_quantized));
eeprom_update_word_notify((uint16_t*)addr, *reinterpret_cast<uint16_t*>(&dif_quantized));
#if 0
{
uint16_t z_offset_u = eeprom_read_word((uint16_t*)addr);
@ -2961,9 +2944,14 @@ bool sample_mesh_and_store_reference()
go_home_with_z_lift();
result = true;
end:
enable_endstops(endstops_enabled);
enable_z_endstop(endstop_z_enabled);
return true;
#ifdef TMC2130
tmc2130_home_exit();
#endif
return result;
}
#ifndef NEW_XYZCAL
@ -3098,11 +3086,7 @@ void count_xyz_details(float (&distanceMin)[2]) {
eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8);
eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8);
eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8);
#if 0
a2 = -1 * asin(vec_y[0] / MACHINE_AXIS_SCALE_Y);
a1 = asin(vec_x[1] / MACHINE_AXIS_SCALE_X);
angleDiff = fabs(a2 - a1);
#endif
for (uint8_t mesh_point = 0; mesh_point < 2; ++mesh_point) {
float y = vec_x[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2) + vec_y[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2 + 1) + cntr[1];
distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH);

View File

@ -1,6 +1,6 @@
#pragma once
#include "Marlin.h"
#include <avr/pgmspace.h>
#define BED_ZERO_REF_X (- 22.f + X_PROBE_OFFSET_FROM_EXTRUDER) // -22 + 23 = 1
#define BED_ZERO_REF_Y (- 0.6f + Y_PROBE_OFFSET_FROM_EXTRUDER + 4.f) // -0.6 + 5 + 4 = 8.4
@ -163,7 +163,7 @@ float BED_Y(const uint8_t row);
* Negative: failed
*/
enum BedSkewOffsetDetectionResultType {
enum BedSkewOffsetDetectionResultType : int8_t {
// Detection failed, some point was not found.
BED_SKEW_OFFSET_DETECTION_POINT_FOUND = 0, //!< Point found
BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND = -1, //!< Point not found.

View File

@ -18,7 +18,8 @@ const char MSG_BED_HEATING[] PROGMEM_I1 = ISTR("Bed Heating"); ////MSG_BED_HEATI
const char MSG_BED_LEVELING_FAILED_POINT_LOW[] PROGMEM_I1 = ISTR("Bed leveling failed. Sensor didn't trigger. Debris on nozzle? Waiting for reset."); ////MSG_BED_LEVELING_FAILED_POINT_LOW c=20 r=6
const char MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED[] PROGMEM_I1 = ISTR("XYZ calibration failed. Please consult the manual."); ////MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED c=20 r=8
const char MSG_BELT_STATUS[] PROGMEM_I1 = ISTR("Belt status");////MSG_BELT_STATUS c=18
const char MSG_CANCEL[] PROGMEM_I1 = ISTR(">Cancel");////MSG_CANCEL c=10
const char MSG_EJECT[] PROGMEM_I1 = ISTR("Eject"); ////MSG_EJECT c=9
const char MSG_CANCEL[] PROGMEM_I1 = ISTR("Cancel");////MSG_CANCEL c=9
const char MSG_CALIBRATE_Z_AUTO[] PROGMEM_I1 = ISTR("Calibrating Z"); ////MSG_CALIBRATE_Z_AUTO c=20 r=2
const char MSG_CARD_MENU[] PROGMEM_I1 = ISTR("Print from SD"); ////MSG_CARD_MENU c=18
const char MSG_CHECKING_X[] PROGMEM_I1 = ISTR("Checking X axis"); ////MSG_CHECKING_X c=20
@ -34,7 +35,6 @@ const char MSG_ERROR[] PROGMEM_I1 = ISTR("ERROR:"); ////MSG_ERROR c=10
const char MSG_EXTRUDER[] PROGMEM_I1 = ISTR("Extruder"); ////MSG_EXTRUDER c=17
const char MSG_FANS_CHECK[] PROGMEM_I1 = ISTR("Fans check"); ////MSG_FANS_CHECK c=13
const char MSG_FIL_RUNOUTS[] PROGMEM_I1 = ISTR("Fil. runouts"); ////MSG_FIL_RUNOUTS c=15
const char MSG_FILAMENT[] PROGMEM_I1 = ISTR("Filament"); ////MSG_FILAMENT c=17
const char MSG_FAN_SPEED[] PROGMEM_I1 = ISTR("Fan speed"); ////MSG_FAN_SPEED c=14
const char MSG_HOTEND_FAN_SPEED[] PROGMEM_I1 = ISTR("Hotend fan:");////MSG_HOTEND_FAN_SPEED c=15
const char MSG_PRINT_FAN_SPEED[] PROGMEM_I1 = ISTR("Print fan:"); ////MSG_PRINT_FAN_SPEED c=15
@ -102,8 +102,15 @@ const char MSG_SELFTEST_MOTOR[] PROGMEM_I1 = ISTR("Motor"); ////MSG_SELFTEST_MOT
const char MSG_SELFTEST_FILAMENT_SENSOR[] PROGMEM_I1 = ISTR("Filament sensor"); ////MSG_SELFTEST_FILAMENT_SENSOR c=17
const char MSG_SELFTEST_WIRINGERROR[] PROGMEM_I1 = ISTR("Wiring error"); ////MSG_SELFTEST_WIRINGERROR c=18
const char MSG_SETTINGS[] PROGMEM_I1 = ISTR("Settings"); ////MSG_SETTINGS c=18
#ifndef REPLACE_SETREADY
const char MSG_SET_READY[] PROGMEM_I1 = ISTR("Set Ready"); ////MSG_SET_READY c=18
const char MSG_SET_NOT_READY[] PROGMEM_I1 = ISTR("Set not Ready"); ////MSG_SET_NOT_READY c=18
#else
const char MSG_HOSTPRINT[] PROGMEM_I1 = ISTR("Print from host"); ////MSG_HOSTPRINT c=18
#endif //REPLACE_SETREADY
#ifdef HOST_SHUTDOWN
const char MSG_SHUTDOWN_HOST[] PROGMEM_I1 = ISTR("Shutdown host"); ////MSG_SHUTDOWN_HOST c=18
#endif //HOST_SHUTOWN
const char MSG_SELECT_LANGUAGE[] PROGMEM_I1 = ISTR("Select language"); ////MSG_SELECT_LANGUAGE c=18
const char MSG_SORTING_FILES[] PROGMEM_I1 = ISTR("Sorting files"); ////MSG_SORTING_FILES c=20
const char MSG_TOTAL[] PROGMEM_I1 = ISTR("Total"); ////MSG_TOTAL c=6
@ -118,6 +125,7 @@ const char MSG_SILENT[] PROGMEM_I1 = ISTR("Silent"); ////MSG_SILENT c=7
const char MSG_NORMAL[] PROGMEM_I1 = ISTR("Normal"); ////MSG_NORMAL c=7
const char MSG_STEALTH[] PROGMEM_I1 = ISTR("Stealth"); ////MSG_STEALTH c=7
const char MSG_STEEL_SHEET_CHECK[] PROGMEM_I1 = ISTR("Is steel sheet on heatbed?"); ////MSG_STEEL_SHEET_CHECK c=20 r=3
const char MSG_Z_CALIBRATION_PROMPT[] PROGMEM_I1 = ISTR("Z calibration recommended. Run it now?"); ////MSG_Z_CALIBRATION_PROMPT c=20 r=3
const char MSG_STOP_PRINT[] PROGMEM_I1 = ISTR("Stop print"); ////MSG_STOP_PRINT c=18
const char MSG_STOPPED[] PROGMEM_I1 = ISTR("STOPPED."); ////MSG_STOPPED c=20
const char MSG_PINDA_CALIBRATION[] PROGMEM_I1 = ISTR("PINDA cal."); ////MSG_PINDA_CALIBRATION c=13
@ -141,14 +149,15 @@ const char MSG_NONE[] PROGMEM_I1 = ISTR("None"); ////MSG_NONE c=8
const char MSG_WARN[] PROGMEM_I1 = ISTR("Warn"); ////MSG_WARN c=8
const char MSG_STRICT[] PROGMEM_I1 = ISTR("Strict"); ////MSG_STRICT c=8
const char MSG_MODEL[] PROGMEM_I1 = ISTR("Model"); ////MSG_MODEL c=8
const char MSG_GCODE_DIFF_PRINTER_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced for a different printer type. Continue?"); ////MSG_GCODE_DIFF_PRINTER_CONTINUE c=20 r=3
const char MSG_GCODE_DIFF_PRINTER_CANCELLED[] PROGMEM_I1 =ISTR("G-code sliced for a different printer type. Please re-slice the model again. Print cancelled."); ////MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=8
const char MSG_GCODE_NEWER_FIRMWARE_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced for a newer firmware. Continue?"); ////MSG_GCODE_NEWER_FIRMWARE_CONTINUE c=20 r=3
const char MSG_GCODE_NEWER_FIRMWARE_CANCELLED[] PROGMEM_I1 = ISTR("G-code sliced for a newer firmware. Please update the firmware. Print cancelled."); ////MSG_GCODE_NEWER_FIRMWARE_CANCELLED c=20 r=8
const char MSG_GCODE_DIFF_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced for a different level. Continue?"); ////MSG_GCODE_DIFF_CONTINUE c=20 r=3
const char MSG_GCODE_DIFF_CANCELLED[] PROGMEM_I1 = ISTR("G-code sliced for a different level. Please re-slice the model again. Print cancelled."); ////MSG_GCODE_DIFF_CANCELLED c=20 r=8
const char MSG_NOZZLE_DIFFERS_CONTINUE[] PROGMEM_I1 = ISTR("Nozzle diameter differs from the G-code. Continue?"); ////MSG_NOZZLE_DIFFERS_CONTINUE c=20 r=3
const char MSG_NOZZLE_DIFFERS_CANCELLED[] PROGMEM_I1 = ISTR("Nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled."); ////MSG_NOZZLE_DIFFERS_CANCELLED c=20 r=8
const char MSG_GCODE_DIFF_PRINTER_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced for a different printer type."); ////MSG_GCODE_DIFF_PRINTER_CONTINUE c=20 r=3
const char MSG_GCODE_DIFF_PRINTER_CANCELLED[] PROGMEM_I1 =ISTR("G-code sliced for a different printer type. Please re-slice the model again."); ////MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=8
const char MSG_GCODE_NEWER_FIRMWARE_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced for a newer firmware."); ////MSG_GCODE_NEWER_FIRMWARE_CONTINUE c=20 r=3
const char MSG_GCODE_NEWER_FIRMWARE_CANCELLED[] PROGMEM_I1 = ISTR("G-code sliced for a newer firmware. Please update the firmware."); ////MSG_GCODE_NEWER_FIRMWARE_CANCELLED c=20 r=8
const char MSG_GCODE_DIFF_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced for a different level."); ////MSG_GCODE_DIFF_CONTINUE c=20 r=3
const char MSG_GCODE_DIFF_CANCELLED[] PROGMEM_I1 = ISTR("G-code sliced for a different level. Please re-slice the model again."); ////MSG_GCODE_DIFF_CANCELLED c=20 r=8
const char MSG_MISSING_FILAMENT[] PROGMEM_I1 = ISTR("There is no filament loaded."); ////MSG_MISSING_FILAMENT c=20 r=3
const char MSG_NOZZLE_DIFFERS_CONTINUE[] PROGMEM_I1 = ISTR("Nozzle diameter differs from the G-code."); ////MSG_NOZZLE_DIFFERS_CONTINUE c=20 r=3
const char MSG_NOZZLE_DIFFERS_CANCELLED[] PROGMEM_I1 = ISTR("Nozzle diameter differs from the G-code. Please check the value in settings."); ////MSG_NOZZLE_DIFFERS_CANCELLED c=20 r=8
const char MSG_NOZZLE_DIAMETER[] PROGMEM_I1 = ISTR("Nozzle d."); ////MSG_NOZZLE_DIAMETER c=10
const char MSG_MMU_MODE[] PROGMEM_I1 = ISTR("MMU Mode"); ////MSG_MMU_MODE c=8
const char MSG_SD_CARD[] PROGMEM_I1 = ISTR("SD card"); ////MSG_SD_CARD c=8
@ -189,34 +198,203 @@ extern const char MSG_TM_ACK_ERROR[] PROGMEM_I1 = ISTR("Clear TM error");////MSG
extern const char MSG_LOAD_ALL[] PROGMEM_I1 = ISTR("Load All"); ////MSG_LOAD_ALL c=18
extern const char MSG_NOZZLE_CNG_MENU [] PROGMEM_I1 = ISTR("Nozzle change");////MSG_NOZZLE_CNG_MENU c=18
extern const char MSG_NOZZLE_CNG_READ_HELP [] PROGMEM_I1 = ISTR("For a Nozzle change please read\nprusa.io/nozzle-mk3s");////MSG_NOZZLE_CNG_READ_HELP c=20 r=4
#ifdef QUICK_NOZZLE_CHANGE
extern const char MSG_NOZZLE_CNG_COOLDOWN [] PROGMEM_I1 = ISTR("Nozzle is hot! Wait for cooldown.");////MSG_NOZZLE_CNG_COOLDOWN c=20 r=3
extern const char MSG_NOZZLE_CNG_CHANGED [] PROGMEM_I1 = ISTR("Nozzle changed?");////MSG_NOZZLE_CNG_CHANGED_QUICK c=20 r=3
#else
extern const char MSG_NOZZLE_CNG_CHANGED [] PROGMEM_I1 = ISTR("Hotend at 280C! Nozzle changed and tightened to specs?");////MSG_NOZZLE_CNG_CHANGED c=20 r=6
#endif //QUICK_NOZZLE_CHANGE
extern const char MSG_REPRINT [] PROGMEM_I1 = ISTR("Reprint"); ////MSG_REPRINT c=18
extern const char MSG_FILE_CNT [] PROGMEM_I1 = ISTR("Some files will not be sorted. Max. No. of files in 1 folder for sorting is 100."); ////MSG_FILE_CNT c=20 r=6
extern const char MSG_CHANGED_MOTHERBOARD [] PROGMEM_I1 = ISTR("Warning: motherboard type changed."); ////MSG_CHANGED_MOTHERBOARD c=20 r=4
extern const char MSG_CHANGED_PRINTER [] PROGMEM_I1 = ISTR("Warning: printer type changed."); ////MSG_CHANGED_PRINTER c=20 r=4
extern const char MSG_CHANGED_BOTH [] PROGMEM_I1 = ISTR("Warning: both printer type and motherboard type changed."); ////MSG_CHANGED_BOTH c=20 r=4
extern const char MSG_DEFAULT_SETTINGS_LOADED [] PROGMEM_I1 = ISTR("Old settings found. Default PID, Esteps etc. will be set."); ////MSG_DEFAULT_SETTINGS_LOADED c=20 r=6
extern const char MSG_FORCE_SELFTEST [] PROGMEM_I1 = ISTR("Selftest will be run to calibrate accurate sensorless rehoming."); ////MSG_FORCE_SELFTEST c=20 r=8
extern const char MSG_MBL_FAILED [] PROGMEM_I1 = ISTR("Mesh bed leveling failed. Print canceled."); ////MSG_MBL_FAILED c=20 r=4
extern const char MSG_ZLEVELING_ENFORCED [] PROGMEM_I1 = ISTR("Some problem encountered, Z-leveling enforced ..."); ////MSG_ZLEVELING_ENFORCED c=20 r=4
extern const char MSG_UNLOAD_SUCCESSFUL [] PROGMEM_I1 = ISTR("Was filament unload successful?"); ////MSG_UNLOAD_SUCCESSFUL c=20 r=3
extern const char MSG_CHECK_IDLER [] PROGMEM_I1 = ISTR("Please open idler and remove filament manually."); ////MSG_CHECK_IDLER c=20 r=4
extern const char MSG_RUN_XYZ [] PROGMEM_I1 = ISTR("Please run XYZ calibration first."); ////MSG_RUN_XYZ c=20 r=4
extern const char MSG_TEMP_CAL_WARNING [] PROGMEM_I1 = ISTR("Stable ambient temperature 21-26C is needed a rigid stand is required."); ////MSG_TEMP_CAL_WARNING c=20 r=4
extern const char MSG_USERWAIT [] PROGMEM_I1 = ISTR("Wait for user..."); ////MSG_USERWAIT c=20
extern const char MSG_NO_MOVE [] PROGMEM_I1 = ISTR("No move."); ////MSG_NO_MOVE c=20
extern const char MSG_BED_HEATING_SAFETY_DISABLED [] PROGMEM_I1 = ISTR("Heating disabled by safety timer."); ////MSG_BED_HEATING_SAFETY_DISABLED c=20 r=4
extern const char MSG_PRESS_TO_PREHEAT [] PROGMEM_I1 = ISTR("Press the knob to preheat nozzle and continue."); ////MSG_PRESS_TO_PREHEAT c=20 r=4
extern const char MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1 [] PROGMEM_I1 = ISTR("Improving bed calibration point"); ////MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1 c=20 r=4
extern const char MSG_MMU_RESTORE_TEMP [] PROGMEM_I1 = ISTR("MMU Retry: Restoring temperature..."); ////MSG_MMU_RESTORE_TEMP c=20 r=4
extern const char MSG_MMU_SENSITIVITY [] PROGMEM_I1 = ISTR("Sensitivity"); ////MSG_MMU_SENSITIVITY c=18
extern const char MSG_RECOVERING_PRINT [] PROGMEM_I1 = ISTR("Recovering print"); ////MSG_RECOVERING_PRINT c=20
extern const char MSG_HOMEYZ_DONE [] PROGMEM_I1 = ISTR("Calibration done"); ////MSG_HOMEYZ_DONE c=20
extern const char MSG_PINDA_PREHEAT [] PROGMEM_I1 = ISTR("PINDA Heating"); ////MSG_PINDA_PREHEAT c=20
extern const char MSG_PID_RUNNING [] PROGMEM_I1 = ISTR("PID cal."); ////MSG_PID_RUNNING c=20
extern const char MSG_PID_FINISHED [] PROGMEM_I1 = ISTR("PID cal. finished"); ////MSG_PID_FINISHED c=20
extern const char MSG_AMBIENT [] PROGMEM_I1 = ISTR("Ambient"); ////MSG_AMBIENT c=14
extern const char MSG_DATE [] PROGMEM_I1 = ISTR("Date:"); ////MSG_DATE c=17
extern const char MSG_MMU_CONNECTED [] PROGMEM_I1 = ISTR("MMU connected"); ////MSG_MMU_CONNECTED c=18
extern const char MSG_UNKNOWN [] PROGMEM_I1 = ISTR("unknown"); ////MSG_UNKNOWN c=13
extern const char MSG_PRINTER_IP [] PROGMEM_I1 = ISTR("Printer IP Addr:"); ////MSG_PRINTER_IP c=18
extern const char MSG_XYZ_DETAILS [] PROGMEM_I1 = ISTR("XYZ cal. details"); ////MSG_XYZ_DETAILS c=18
extern const char MSG_INFO_EXTRUDER [] PROGMEM_I1 = ISTR("Extruder info"); ////MSG_INFO_EXTRUDER c=18
extern const char MSG_INFO_SENSORS [] PROGMEM_I1 = ISTR("Sensor info"); ////MSG_INFO_SENSORS c=18
extern const char MSG_MENU_TEMPERATURES [] PROGMEM_I1 = ISTR("Temperatures"); ////MSG_MENU_TEMPERATURES c=18
extern const char MSG_MENU_VOLTAGES [] PROGMEM_I1 = ISTR("Voltages"); ////MSG_MENU_VOLTAGES c=18
extern const char MSG_PRESS_KNOB [] PROGMEM_I1 = ISTR("Press the knob"); ////MSG_PRESS_KNOB c=20
extern const char MSG_TO_LOAD_FIL [] PROGMEM_I1 = ISTR("to load filament"); ////MSG_TO_LOAD_FIL c=20
extern const char MSG_TO_UNLOAD_FIL [] PROGMEM_I1 = ISTR("to unload filament"); ////MSG_TO_UNLOAD_FIL c=20
extern const char MSG_PREHEATING_TO_LOAD [] PROGMEM_I1 = ISTR("Preheating to load"); ////MSG_PREHEATING_TO_LOAD c=20
extern const char MSG_PREHEATING_TO_UNLOAD [] PROGMEM_I1 = ISTR("Preheating to unload"); ////MSG_PREHEATING_TO_UNLOAD c=20
extern const char MSG_PREHEATING_TO_EJECT [] PROGMEM_I1 = ISTR("Preheating to eject"); ////MSG_PREHEATING_TO_EJECT c=20
extern const char MSG_PREHEATING_TO_CUT [] PROGMEM_I1 = ISTR("Preheating to cut"); ////MSG_PREHEATING_TO_CUT c=20
extern const char MSG_INSERT_FILAMENT [] PROGMEM_I1 = ISTR("Insert filament"); ////MSG_INSERT_FILAMENT c=20
extern const char MSG_PRESS [] PROGMEM_I1 = ISTR("and press the knob"); ////MSG_PRESS c=20 r=2
extern const char MSG_CHANGE_SUCCESS [] PROGMEM_I1 = ISTR("Change success!"); ////MSG_CHANGE_SUCCESS c=20
extern const char MSG_LOADING_COLOR [] PROGMEM_I1 = ISTR("Loading color"); ////MSG_LOADING_COLOR c=20
extern const char MSG_CORRECTLY [] PROGMEM_I1 = ISTR("Changed correctly"); ////MSG_CORRECTLY c=19
extern const char MSG_NOT_LOADED [] PROGMEM_I1 = ISTR("Filament not loaded"); ////MSG_NOT_LOADED c=19
extern const char MSG_NOT_COLOR [] PROGMEM_I1 = ISTR("Color not correct"); ////MSG_NOT_COLOR c=19
#ifndef REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
extern const char MSG_AUTOLOADING_ENABLED [] PROGMEM_I1 = ISTR("Autoloading filament is active, just press the knob and insert filament..."); ////MSG_AUTOLOADING_ENABLED c=20 r=4
#endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
extern const char MSG_FILAMENT_USED [] PROGMEM_I1 = ISTR("Filament used"); ////MSG_FILAMENT_USED c=19
extern const char MSG_PRINT_TIME [] PROGMEM_I1 = ISTR("Print time"); ////MSG_PRINT_TIME c=19
extern const char MSG_TOTAL_FILAMENT [] PROGMEM_I1 = ISTR("Total filament"); ////MSG_TOTAL_FILAMENT c=19
extern const char MSG_TOTAL_PRINT_TIME [] PROGMEM_I1 = ISTR("Total print time"); ////MSG_TOTAL_PRINT_TIME c=19
extern const char MSG_Y_DIST_FROM_MIN [] PROGMEM_I1 = ISTR("Y distance from min"); ////MSG_Y_DIST_FROM_MIN c=20
extern const char MSG_LEFT [] PROGMEM_I1 = ISTR("Left"); ////MSG_LEFT c=10
extern const char MSG_RIGHT [] PROGMEM_I1 = ISTR("Right"); ////MSG_RIGHT c=10
extern const char MSG_MEASURED_SKEW [] PROGMEM_I1 = ISTR("Measured skew"); ////MSG_MEASURED_SKEW c=14
extern const char MSG_SLIGHT_SKEW [] PROGMEM_I1 = ISTR("Slight skew"); ////MSG_SLIGHT_SKEW c=14
extern const char MSG_SEVERE_SKEW [] PROGMEM_I1 = ISTR("Severe skew"); ////MSG_SEVERE_SKEW c=14
extern const char MSG_MEASURED_OFFSET [] PROGMEM_I1 = ISTR("[0;0] point offset"); ////MSG_MEASURED_OFFSET c=20
extern const char MSG_BABYSTEPPING_Z [] PROGMEM_I1 = ISTR("Adjusting Z"); ////MSG_BABYSTEPPING_Z c=13
extern const char MSG_BED_CORRECTION_LEFT [] PROGMEM_I1 = ISTR("Left side [\xe4m]"); ////MSG_BED_CORRECTION_LEFT c=14
extern const char MSG_BED_CORRECTION_RIGHT [] PROGMEM_I1 = ISTR("Right side[\xe4m]"); ////MSG_BED_CORRECTION_RIGHT c=14
extern const char MSG_BED_CORRECTION_FRONT [] PROGMEM_I1 = ISTR("Front side[\xe4m]"); ////MSG_BED_CORRECTION_FRONT c=14
extern const char MSG_BED_CORRECTION_REAR [] PROGMEM_I1 = ISTR("Rear side [\xe4m]"); ////MSG_BED_CORRECTION_REAR c=14
extern const char MSG_SET_TEMPERATURE [] PROGMEM_I1 = ISTR("Set temperature:"); ////MSG_SET_TEMPERATURE c=20
extern const char MSG_WAITING_TEMP_PINDA [] PROGMEM_I1 = ISTR("Waiting for PINDA probe cooling"); ////MSG_WAITING_TEMP_PINDA c=20 r=3
extern const char MSG_WAITING_TEMP [] PROGMEM_I1 = ISTR("Waiting for nozzle and bed cooling"); ////MSG_WAITING_TEMP c=20 r=4
extern const char MSG_MOVE_CARRIAGE_TO_THE_TOP_Z [] PROGMEM_I1 = ISTR("Calibrating Z. Rotate the knob to move the Z carriage up to the end stoppers. Click when done."); ////MSG_MOVE_CARRIAGE_TO_THE_TOP_Z c=20 r=8
extern const char MSG_MOVE_CARRIAGE_TO_THE_TOP [] PROGMEM_I1 = ISTR("Calibrating XYZ. Rotate the knob to move the Z carriage up to the end stoppers. Click when done."); ////MSG_MOVE_CARRIAGE_TO_THE_TOP c=20 r=8
extern const char MSG_CONFIRM_CARRIAGE_AT_THE_TOP [] PROGMEM_I1 = ISTR("Are left and right Z-carriages all up?"); ////MSG_CONFIRM_CARRIAGE_AT_THE_TOP c=20 r=3
extern const char MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND [] PROGMEM_I1 = ISTR("XYZ calibration failed. Bed calibration point was not found."); ////MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND c=20 r=6
extern const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_BOTH_FAR [] PROGMEM_I1 = ISTR("XYZ calibration failed. Front calibration points not reachable."); ////MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_BOTH_FAR c=20 r=6
extern const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR [] PROGMEM_I1 = ISTR("XYZ calibration failed. Right front calibration point not reachable."); ////MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR c=20 r=6
extern const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR [] PROGMEM_I1 = ISTR("XYZ calibration compromised. Front calibration points not reachable."); ////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR c=20 r=8
extern const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR [] PROGMEM_I1 = ISTR("XYZ calibration compromised. Right front calibration point not reachable."); ////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR c=20 r=8
extern const char MSG_BED_SKEW_OFFSET_DETECTION_PERFECT [] PROGMEM_I1 = ISTR("XYZ calibration ok. X/Y axes are perpendicular. Congratulations!"); ////MSG_BED_SKEW_OFFSET_DETECTION_PERFECT c=20 r=8
extern const char MSG_BED_SKEW_OFFSET_DETECTION_SKEW_MILD [] PROGMEM_I1 = ISTR("XYZ calibration all right. X/Y axes are slightly skewed. Good job!"); ////MSG_BED_SKEW_OFFSET_DETECTION_SKEW_MILD c=20 r=8
extern const char MSG_BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME [] PROGMEM_I1 = ISTR("XYZ calibration all right. Skew will be corrected automatically."); ////MSG_BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME c=20 r=8
extern const char MSG_PINDA_CAL_FAILED [] PROGMEM_I1 = ISTR("PINDA calibration failed"); ////MSG_PINDA_CAL_FAILED c=20 r=4
extern const char MSG_MOVE_X [] PROGMEM_I1 = ISTR("Move X"); ////MSG_MOVE_X c=18
extern const char MSG_MOVE_Y [] PROGMEM_I1 = ISTR("Move Y"); ////MSG_MOVE_Y c=18
extern const char MSG_MOVE_Z [] PROGMEM_I1 = ISTR("Move Z"); ////MSG_MOVE_Z c=18
extern const char MSG_CRASH_DET_ONLY_IN_NORMAL [] PROGMEM_I1 = ISTR("Crash detection can\nbe turned on only in\nNormal mode"); ////MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
extern const char MSG_CRASH_DET_STEALTH_FORCE_OFF [] PROGMEM_I1 = ISTR("WARNING:\nCrash detection\ndisabled in\nStealth mode"); ////MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
extern const char MSG_MODE_CHANGE_IN_PROGRESS [] PROGMEM_I1 = ISTR("Mode change in progress..."); ////MSG_MODE_CHANGE_IN_PROGRESS c=20 r=3
extern const char MSG_COPY_SEL_LANG [] PROGMEM_I1 = ISTR("Copy selected language?"); ////MSG_COPY_SEL_LANG c=20 r=3
extern const char MSG_SHEET_OFFSET [] PROGMEM_I1 = ISTR("Sheet %.7s\nZ offset: %+1.3fmm\n%cContinue\n%cReset"); ////MSG_SHEET_OFFSET c=20 r=4
extern const char MSG_PLEASE_LOAD_PLA [] PROGMEM_I1 = ISTR("Please load filament first."); ////MSG_PLEASE_LOAD_PLA c=20 r=4
extern const char MSG_WIZARD_RERUN [] PROGMEM_I1 = ISTR("Running Wizard will delete current calibration results and start from the beginning."); ////MSG_WIZARD_RERUN c=20 r=7
extern const char MSG_MMU_INSERT_FILAMENT_FIRST_TUBE [] PROGMEM_I1 = ISTR("Please insert filament into the first tube of the MMU, then press the knob to load it."); ////MSG_MMU_INSERT_FILAMENT_FIRST_TUBE c=20 r=6
extern const char MSG_WIZARD_LOAD_FILAMENT [] PROGMEM_I1 = ISTR("Please insert filament into the extruder, then press the knob to load it."); ////MSG_WIZARD_LOAD_FILAMENT c=20 r=6
extern const char MSG_WIZARD_V2_CAL [] PROGMEM_I1 = ISTR("Now I will calibrate distance between tip of the nozzle and heatbed surface."); ////MSG_WIZARD_V2_CAL c=20 r=8
extern const char MSG_SELECT_FIL_1ST_LAYERCAL [] PROGMEM_I1 = ISTR("Select a filament for the First Layer Calibration and select it in the on-screen menu."); ////MSG_SELECT_FIL_1ST_LAYERCAL c=20 r=7
extern const char MSG_SELECT_TEMP_MATCHES_MATERIAL [] PROGMEM_I1 = ISTR("Select temperature which matches your material."); ////MSG_SELECT_TEMP_MATCHES_MATERIAL c=20 r=4
extern const char MSG_WIZARD_V2_CAL_2 [] PROGMEM_I1 = ISTR("The printer will start printing a zig-zag line. Rotate the knob until you reach the optimal height. Check the pictures in the handbook (Calibration chapter)."); ////MSG_WIZARD_V2_CAL_2 c=20 r=12
extern const char MSG_WIZARD_SELFTEST [] PROGMEM_I1 = ISTR("First, I will run the selftest to check most common assembly problems."); ////MSG_WIZARD_SELFTEST c=20 r=8
extern const char MSG_WIZARD_XYZ_CAL [] PROGMEM_I1 = ISTR("I will run xyz calibration now. It will take up to 24 mins."); ////MSG_WIZARD_XYZ_CAL c=20 r=8
extern const char MSG_REMOVE_SHIPPING_HELPERS [] PROGMEM_I1 = ISTR("Please remove shipping helpers first."); ////MSG_REMOVE_SHIPPING_HELPERS c=20 r=3
extern const char MSG_REMOVE_TEST_PRINT [] PROGMEM_I1 = ISTR("Now remove the test print from steel sheet."); ////MSG_REMOVE_TEST_PRINT c=20 r=4
extern const char MSG_WIZARD_Z_CAL [] PROGMEM_I1 = ISTR("I will run z calibration now."); ////MSG_WIZARD_Z_CAL c=20 r=8
extern const char MSG_WIZARD_WILL_PREHEAT [] PROGMEM_I1 = ISTR("Now I will preheat nozzle for PLA."); ////MSG_WIZARD_WILL_PREHEAT c=20 r=4
extern const char MSG_TM_CAL [] PROGMEM_I1 = ISTR("Thermal model cal. takes approx. 12 mins. See\nprusa.io/tm-cal"); ////MSG_TM_CAL c=20 r=4
extern const char MSG_SEL_PREHEAT_TEMP [] PROGMEM_I1 = ISTR("Select nozzle preheat temperature which matches your material."); ////MSG_SEL_PREHEAT_TEMP c=20 r=6
extern const char MSG_WIZARD_REPEAT_V2_CAL [] PROGMEM_I1 = ISTR("Do you want to repeat last step to readjust distance between nozzle and heatbed?"); ////MSG_WIZARD_REPEAT_V2_CAL c=20 r=7
extern const char MSG_WIZARD_CLEAN_HEATBED [] PROGMEM_I1 = ISTR("Please clean heatbed and then press the knob."); ////MSG_WIZARD_CLEAN_HEATBED c=20 r=8
extern const char MSG_ADDITIONAL_SHEETS [] PROGMEM_I1 = ISTR("If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets."); ////MSG_ADDITIONAL_SHEETS c=20 r=8
extern const char MSG_X_CORRECTION [] PROGMEM_I1 = ISTR("X-correct"); ////MSG_X_CORRECTION c=13
extern const char MSG_Y_CORRECTION [] PROGMEM_I1 = ISTR("Y-correct"); ////MSG_Y_CORRECTION c=13
extern const char MSG_Z_CORRECTION [] PROGMEM_I1 = ISTR("Z-correct"); ////MSG_Z_CORRECTION c=13
extern const char MSG_EXTRUDER_CORRECTION [] PROGMEM_I1 = ISTR("E-correct"); ////MSG_EXTRUDER_CORRECTION c=13
extern const char MSG_CHECKS [] PROGMEM_I1 = ISTR("Checks"); ////MSG_CHECKS c=18
extern const char MSG_TEMPERATURE [] PROGMEM_I1 = ISTR("Temperature"); ////MSG_TEMPERATURE c=18
extern const char MSG_MOVE_AXIS [] PROGMEM_I1 = ISTR("Move axis"); ////MSG_MOVE_AXIS c=18
extern const char MSG_DISABLE_STEPPERS [] PROGMEM_I1 = ISTR("Disable steppers"); ////MSG_DISABLE_STEPPERS c=18
extern const char MSG_LIN_CORRECTION [] PROGMEM_I1 = ISTR("Lin. correction"); ////MSG_LIN_CORRECTION c=18
extern const char MSG_WIZARD [] PROGMEM_I1 = ISTR("Wizard"); ////MSG_WIZARD c=17
extern const char MSG_BELTTEST [] PROGMEM_I1 = ISTR("Belt test"); ////MSG_BELTTEST c=18
extern const char MSG_SELFTEST [] PROGMEM_I1 = ISTR("Selftest"); ////MSG_SELFTEST c=18
extern const char MSG_CALIBRATE_BED [] PROGMEM_I1 = ISTR("Calibrate XYZ"); ////MSG_CALIBRATE_BED c=18
extern const char MSG_BED_CORRECTION_MENU [] PROGMEM_I1 = ISTR("Bed level correct"); ////MSG_BED_CORRECTION_MENU c=18
extern const char MSG_PID_EXTRUDER [] PROGMEM_I1 = ISTR("PID calibration"); ////MSG_PID_EXTRUDER c=17
extern const char MSG_SHOW_END_STOPS [] PROGMEM_I1 = ISTR("Show end stops"); ////MSG_SHOW_END_STOPS c=18
extern const char MSG_CALIBRATE_BED_RESET [] PROGMEM_I1 = ISTR("Reset XYZ calibr."); ////MSG_CALIBRATE_BED_RESET c=18
extern const char MSG_SELECT [] PROGMEM_I1 = ISTR("Select"); ////MSG_SELECT c=18
extern const char MSG_RENAME [] PROGMEM_I1 = ISTR("Rename"); ////MSG_RENAME c=18
extern const char MSG_PREHEAT [] PROGMEM_I1 = ISTR("Preheat"); ////MSG_PREHEAT c=18
extern const char MSG_CNG_SDCARD [] PROGMEM_I1 = ISTR("Change SD card"); ////MSG_CNG_SDCARD c=18
extern const char MSG_NO_CARD [] PROGMEM_I1 = ISTR("No SD card"); ////MSG_NO_CARD c=18
extern const char MSG_INIT_SDCARD [] PROGMEM_I1 = ISTR("Init. SD card"); ////MSG_INIT_SDCARD c=18
extern const char MSG_LOAD_TO_NOZZLE [] PROGMEM_I1 = ISTR("Load to nozzle"); ////MSG_LOAD_TO_NOZZLE c=18
extern const char MSG_AUTOLOAD_FILAMENT [] PROGMEM_I1 = ISTR("AutoLoad filament"); ////MSG_AUTOLOAD_FILAMENT c=18
extern const char MSG_STATISTICS [] PROGMEM_I1 = ISTR("Statistics"); ////MSG_STATISTICS c=18
extern const char MSG_FAIL_STATS [] PROGMEM_I1 = ISTR("Fail stats"); ////MSG_FAIL_STATS c=18
extern const char MSG_MMU_FAIL_STATS [] PROGMEM_I1 = ISTR("Fail stats MMU"); ////MSG_MMU_FAIL_STATS c=18
extern const char MSG_SUPPORT [] PROGMEM_I1 = ISTR("Support"); ////MSG_SUPPORT c=18
extern const char MSG_SPEED [] PROGMEM_I1 = ISTR("Speed"); ////MSG_SPEED c=15
extern const char MSG_FLOW [] PROGMEM_I1 = ISTR("Flow"); ////MSG_FLOW c=15
extern const char MSG_INSERT_FIL [] PROGMEM_I1 = ISTR("Insert the filament (do not load it) into the extruder and then press the knob."); ////MSG_INSERT_FIL c=20 r=6
extern const char MSG_UNLOAD_FILAMENT_REPEAT [] PROGMEM_I1 = ISTR("Please unload the filament first, then repeat this action."); ////MSG_UNLOAD_FILAMENT_REPEAT c=20 r=4
extern const char MSG_CHECK_IR_CONNECTION [] PROGMEM_I1 = ISTR("Please check the IR sensor connection, unload filament if present."); ////MSG_CHECK_IR_CONNECTION c=20 r=4
extern const char MSG_FS_VERIFIED [] PROGMEM_I1 = ISTR("Sensor verified, remove the filament now."); ////MSG_FS_VERIFIED c=20 r=3
extern const char MSG_FIL_FAILED [] PROGMEM_I1 = ISTR("Verification failed, remove the filament and try again."); ////MSG_FIL_FAILED c=20 r=4
extern const char MSG_SELFTEST_START [] PROGMEM_I1 = ISTR("Selftest start"); ////MSG_SELFTEST_START c=20
extern const char MSG_SELFTEST_OK [] PROGMEM_I1 = ISTR("Selftest OK"); ////MSG_SELFTEST_OK c=20
extern const char MSG_SELFTEST_ERROR [] PROGMEM_I1 = ISTR("Selftest error!"); ////MSG_SELFTEST_ERROR c=20
extern const char MSG_SELFTEST_PLEASECHECK [] PROGMEM_I1 = ISTR("Please check:"); ////MSG_SELFTEST_PLEASECHECK c=20
extern const char MSG_SELFTEST_HEATERTHERMISTOR [] PROGMEM_I1 = ISTR("Heater/Thermistor"); ////MSG_SELFTEST_HEATERTHERMISTOR c=20
extern const char MSG_SELFTEST_NOTCONNECTED [] PROGMEM_I1 = ISTR("Not connected"); ////MSG_SELFTEST_NOTCONNECTED c=20
extern const char MSG_SELFTEST_BEDHEATER [] PROGMEM_I1 = ISTR("Bed/Heater"); ////MSG_SELFTEST_BEDHEATER c=20
extern const char MSG_SELFTEST_ENDSTOPS [] PROGMEM_I1 = ISTR("Endstops"); ////MSG_SELFTEST_ENDSTOPS c=20
extern const char MSG_SELFTEST_ENDSTOP [] PROGMEM_I1 = ISTR("Endstop"); ////MSG_SELFTEST_ENDSTOP c=16
extern const char MSG_SELFTEST_ENDSTOP_NOTHIT [] PROGMEM_I1 = ISTR("Endstop not hit"); ////MSG_SELFTEST_ENDSTOP_NOTHIT c=20
extern const char MSG_LOOSE_PULLEY [] PROGMEM_I1 = ISTR("Loose pulley"); ////MSG_LOOSE_PULLEY c=20
extern const char MSG_SELFTEST_AXIS_LENGTH [] PROGMEM_I1 = ISTR("Axis length"); ////MSG_SELFTEST_AXIS_LENGTH c=20
extern const char MSG_SELFTEST_AXIS [] PROGMEM_I1 = ISTR("Axis"); ////MSG_SELFTEST_AXIS c=16
extern const char MSG_SELFTEST_FANS [] PROGMEM_I1 = ISTR("Front/left fans"); ////MSG_SELFTEST_FANS c=20
extern const char MSG_SELFTEST_SWAPPED [] PROGMEM_I1 = ISTR("Swapped"); ////MSG_SELFTEST_SWAPPED c=16
extern const char MSG_FALSE_TRIGGERING [] PROGMEM_I1 = ISTR("False triggering"); ////MSG_FALSE_TRIGGERING c=20
extern const char MSG_SELFTEST_FS_LEVEL [] PROGMEM_I1 = ISTR("%s level expected"); ////MSG_SELFTEST_FS_LEVEL c=20
extern const char MSG_SELFTEST_CHECK_ENDSTOPS [] PROGMEM_I1 = ISTR("Checking endstops"); ////MSG_SELFTEST_CHECK_ENDSTOPS c=20
extern const char MSG_SELFTEST_CHECK_Z [] PROGMEM_I1 = ISTR("Checking Z axis"); ////MSG_SELFTEST_CHECK_Z c=20
extern const char MSG_SELFTEST_CHECK_HOTEND [] PROGMEM_I1 = ISTR("Checking hotend"); ////MSG_SELFTEST_CHECK_HOTEND c=20
extern const char MSG_SELFTEST_CHECK_ALLCORRECT [] PROGMEM_I1 = ISTR("All correct"); ////MSG_SELFTEST_CHECK_ALLCORRECT c=20
extern const char MSG_CALIBRATING_HOME [] PROGMEM_I1 = ISTR("Calibrating home"); ////MSG_CALIBRATING_HOME c=20
extern const char MSG_CHECKING_FILE [] PROGMEM_I1 = ISTR("Checking file"); ////MSG_CHECKING_FILE c=17
extern const char MSG_FILE_INCOMPLETE [] PROGMEM_I1 = ISTR("File incomplete."); ////MSG_FILE_INCOMPLETE c=20 r=3
extern const char MSG_SD_REMOVED [] PROGMEM_I1 = ISTR("Card removed"); ////MSG_SD_REMOVED c=20
extern const char MSG_NEW_FIRMWARE_AVAILABLE [] PROGMEM_I1 = ISTR("New firmware version available:"); ////MSG_NEW_FIRMWARE_AVAILABLE c=20 r=2
extern const char MSG_NEW_FIRMWARE_PLEASE_UPGRADE [] PROGMEM_I1 = ISTR("Please upgrade."); ////MSG_NEW_FIRMWARE_PLEASE_UPGRADE c=20
extern const char MSG_FW_MK3_DETECTED [] PROGMEM_I1 = ISTR(PRINTER_NAME " firmware detected on " PRINTER_NAME_ALTERNATE " printer"); ////MSG_FW_MK3_DETECTED c=20 r=4
//not internationalized messages
#if 0
const char MSG_FW_VERSION_BETA[] PROGMEM_N1 = "You are using a BETA firmware version! It is in a development state! Use this version with CAUTION as it may DAMAGE the printer!"; ////MSG_FW_VERSION_BETA c=20 r=8
#endif
const char MSG_SPOOL_JOIN[] PROGMEM_N1 = "SpoolJoin"; ////MSG_SPOOL_JOIN c=13
const char MSG_FIRMWARE[] PROGMEM_N1 = "Firmware"; ////MSG_FIRMWARE c=8
const char MSG_FILAMENT[] PROGMEM_N1 = "Filament"; ////MSG_FILAMENT c=8
const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[] PROGMEM_N1 = "FlashAir"; ////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY c=8
const char MSG_PINDA[] PROGMEM_N1 = "PINDA"; ////MSG_PINDA c=5
const char MSG_WELCOME[] PROGMEM_N1 = WELCOME_MSG;
const char MSG_SD_WORKDIR_FAIL[] PROGMEM_N1 = "workDir open failed"; ////
const char MSG_BROWNOUT_RESET[] PROGMEM_N1 = " Brown out Reset"; ////
const char MSG_EXTERNAL_RESET[] PROGMEM_N1 = " External Reset"; ////
const char MSG_FILE_SAVED[] PROGMEM_N1 = "Done saving file."; ////
const char MSG_POSITION_UNKNOWN[] PROGMEM_N1 = "Home X/Y before Z"; ////
const char MSG_SOFTWARE_RESET[] PROGMEM_N1 = " Software Reset"; ////
const char MSG_UNKNOWN_COMMAND[] PROGMEM_N1 = "Unknown command: \""; ////
const char MSG_WATCHDOG_RESET[] PROGMEM_N1 = " Watchdog Reset"; ////
const char MSG_Z_MAX[] PROGMEM_N1 = "z_max: "; ////
const char MSG_Z_MIN[] PROGMEM_N1 = "z_min: "; ////
const char MSG_ZPROBE_OUT[] PROGMEM_N1 = "Z probe out. bed"; ////
#ifdef ENABLE_AUTO_BED_LEVELING
const char MSG_ZPROBE_ZOFFSET[] PROGMEM_N1 = "Z Offset"; ////
#endif
const char MSG_TMC_OVERTEMP[] PROGMEM_N1 = "TMC DRIVER OVERTEMP"; ////
const char MSG_Enqueing[] PROGMEM_N1 = "enqueing \""; ////
const char MSG_ENDSTOPS_HIT[] PROGMEM_N1 = "endstops hit: "; ////
const char MSG_SD_ERR_WRITE_TO_FILE[] PROGMEM_N1 = "error writing to file"; ////
const char MSG_OK[] PROGMEM_N1 = "ok"; ////
const char MSG_OK_CAPS[] PROGMEM_N1 = "OK"; ////
@ -225,15 +403,20 @@ const char MSG_ENDSTOP_OPEN[] PROGMEM_N1 = "open"; ////
const char MSG_POWERUP[] PROGMEM_N1 = "PowerUp"; ////
const char MSG_ERR_STOPPED[] PROGMEM_N1 = "Printer stopped due to errors. Supervision required."; ////
const char MSG_ENDSTOP_HIT[] PROGMEM_N1 = "TRIGGERED"; ////
const char MSG_OCTOPRINT_ASK_PAUSE[] PROGMEM_N1 = "// action:pause"; ////
const char MSG_OCTOPRINT_PAUSED[] PROGMEM_N1 = "// action:paused"; ////
const char MSG_OCTOPRINT_ASK_RESUME[] PROGMEM_N1 = "// action:resume"; ////
const char MSG_OCTOPRINT_RESUMED[] PROGMEM_N1 = "// action:resumed"; ////
const char MSG_OCTOPRINT_CANCEL[] PROGMEM_N1 = "// action:cancel"; ////
const char MSG_OCTOPRINT_READY[] PROGMEM_N1 = "// action:ready"; ////
const char MSG_OCTOPRINT_NOT_READY[] PROGMEM_N1 = "// action:not_ready"; ////
const char MSG_OCTOPRINT_START[] PROGMEM_N1 = "// action:start"; ////
const char MSG_OCTOPRINT_UVLO_RECOVERY_READY[] PROGMEM_N1 = "// action:uvlo_recovery_ready"; ////
const char MSG_HOST_ACTION_ASK_PAUSE[] PROGMEM_N1 = "//action:pause"; ////
const char MSG_HOST_ACTION_PAUSED[] PROGMEM_N1 = "//action:paused"; ////
const char MSG_HOST_ACTION_ASK_RESUME[] PROGMEM_N1 = "//action:resume"; ////
const char MSG_HOST_ACTION_RESUMED[] PROGMEM_N1 = "//action:resumed"; ////
const char MSG_HOST_ACTION_CANCEL[] PROGMEM_N1 = "//action:cancel"; ////
const char MSG_HOST_ACTION_READY[] PROGMEM_N1 = "//action:ready"; ////
const char MSG_HOST_ACTION_NOT_READY[] PROGMEM_N1 = "//action:not_ready"; ////
const char MSG_HOST_ACTION_START[] PROGMEM_N1 = "//action:start"; ////
const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[] PROGMEM_N1 = "//action:uvlo_recovery_ready"; ////
const char MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY[] PROGMEM_N1 = "//action:uvlo_auto_recovery_ready"; ////
const char MSG_HOST_ACTION_NOTIFICATION[] PROGMEM_N1 = "//action:notification %S\n"; ////
#ifdef HOST_SHUTDOWN
const char MSG_HOST_ACTION_SHUTDOWN[] PROGMEM_N1 = "//action:shutdown"; ////
#endif //HOST_SHUTOWN
const char MSG_FANCHECK_HOTEND[] PROGMEM_N1 = "Err:HOTEND FAN ERROR"; ////c=20
const char MSG_FANCHECK_PRINT[] PROGMEM_N1 = "Err:PRINT FAN ERROR"; ////c=20
const char MSG_M112_KILL[] PROGMEM_N1 = "M112 called. Emergency Stop."; ////c=20
@ -241,10 +424,13 @@ const char MSG_ADVANCE_K[] PROGMEM_N1 = "Advance K:"; ////c=13
const char MSG_POWERPANIC_DETECTED[] PROGMEM_N1 = "POWER PANIC DETECTED"; ////c=20
const char MSG_LCD_STATUS_CHANGED[] PROGMEM_N1 = "LCD status changed";
const char MSG_UNKNOWN_CODE[] PROGMEM_N1 = "Unknown %c code: %s\n";
const char MSG_FILAMENT_RUNOUT_DETECTED[] PROGMEM_N1 = "Filament runout detected!"; ////c=20 r=2
// Common G-gcodes
const char G1_E_F2700[] PROGMEM_N1 = "G1 E%-.3f F2700";
const char G28W[] PROGMEM_N1 = "G28 W";
const char MSG_G90[] PROGMEM_N1 = "G90";
const char MSG_G91[] PROGMEM_N1 = "G91";
const char MSG_M23[] PROGMEM_N1 = "M23 %s";
const char MSG_M24[] PROGMEM_N1 = "M24";
const char MSG_M83[] PROGMEM_N1 = "M83";

View File

@ -21,6 +21,7 @@ extern const char MSG_BED_HEATING[];
extern const char MSG_BED_LEVELING_FAILED_POINT_LOW[];
extern const char MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED[];
extern const char MSG_BELT_STATUS[];
extern const char MSG_EJECT[];
extern const char MSG_CANCEL[];
extern const char MSG_CALIBRATE_Z_AUTO[];
extern const char MSG_CARD_MENU[];
@ -37,7 +38,6 @@ extern const char MSG_ERROR[];
extern const char MSG_EXTRUDER[];
extern const char MSG_FANS_CHECK[];
extern const char MSG_FIL_RUNOUTS[];
extern const char MSG_FILAMENT[];
extern const char MSG_FAN_SPEED[];
extern const char MSG_HOTEND_FAN_SPEED[];
extern const char MSG_PRINT_FAN_SPEED[];
@ -104,8 +104,15 @@ extern const char MSG_SELFTEST_MOTOR[];
extern const char MSG_SELFTEST_FILAMENT_SENSOR[];
extern const char MSG_SELFTEST_WIRINGERROR[];
extern const char MSG_SETTINGS[];
#ifndef REPLACE_SETREADY
extern const char MSG_SET_READY[];
extern const char MSG_SET_NOT_READY[];
#else
extern const char MSG_HOSTPRINT[];
#endif
#ifdef HOST_SHUTDOWN
extern const char MSG_SHUTDOWN_HOST[];
#endif //HOST_SHUTOWN
extern const char MSG_SELECT_LANGUAGE[];
extern const char MSG_SORTING_FILES[];
extern const char MSG_TOTAL[];
@ -120,6 +127,7 @@ extern const char MSG_SILENT[];
extern const char MSG_NORMAL[];
extern const char MSG_STEALTH[];
extern const char MSG_STEEL_SHEET_CHECK[];
extern const char MSG_Z_CALIBRATION_PROMPT[];
extern const char MSG_STOP_PRINT[];
extern const char MSG_STOPPED[];
extern const char MSG_PINDA_CALIBRATION[];
@ -149,6 +157,7 @@ extern const char MSG_GCODE_NEWER_FIRMWARE_CONTINUE[];
extern const char MSG_GCODE_NEWER_FIRMWARE_CANCELLED[];
extern const char MSG_GCODE_DIFF_CONTINUE[];
extern const char MSG_GCODE_DIFF_CANCELLED[];
extern const char MSG_MISSING_FILAMENT[];
extern const char MSG_NOZZLE_DIFFERS_CONTINUE[];
extern const char MSG_NOZZLE_DIFFERS_CANCELLED[];
extern const char MSG_NOZZLE_DIAMETER[];
@ -191,34 +200,201 @@ extern const char MSG_LOAD_ALL[];
extern const char MSG_NOZZLE_CNG_MENU [];
extern const char MSG_NOZZLE_CNG_READ_HELP [];
extern const char MSG_NOZZLE_CNG_CHANGED [];
#ifdef QUICK_NOZZLE_CHANGE
extern const char MSG_NOZZLE_CNG_COOLDOWN [];
#endif //QUICK_NOZZLE_CHANGE
extern const char MSG_REPRINT [];
extern const char MSG_FILE_CNT [];
extern const char MSG_CHANGED_MOTHERBOARD [];
extern const char MSG_CHANGED_PRINTER [];
extern const char MSG_CHANGED_BOTH [];
extern const char MSG_DEFAULT_SETTINGS_LOADED [];
extern const char MSG_FORCE_SELFTEST [];
extern const char MSG_MBL_FAILED [];
extern const char MSG_ZLEVELING_ENFORCED [];
extern const char MSG_UNLOAD_SUCCESSFUL [];
extern const char MSG_CHECK_IDLER [];
extern const char MSG_RUN_XYZ [];
extern const char MSG_TEMP_CAL_WARNING [];
extern const char MSG_USERWAIT [];
extern const char MSG_NO_MOVE [];
extern const char MSG_BED_HEATING_SAFETY_DISABLED [];
extern const char MSG_PRESS_TO_PREHEAT [];
extern const char MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1 [];
extern const char MSG_MMU_RESTORE_TEMP [];
extern const char MSG_MMU_SENSITIVITY [];
extern const char MSG_RECOVERING_PRINT [];
extern const char MSG_HOMEYZ_DONE [];
extern const char MSG_PINDA_PREHEAT [];
extern const char MSG_PID_RUNNING [];
extern const char MSG_PID_FINISHED [];
extern const char MSG_AMBIENT [];
extern const char MSG_DATE [];
extern const char MSG_MMU_CONNECTED [];
extern const char MSG_UNKNOWN [];
extern const char MSG_PRINTER_IP [];
extern const char MSG_XYZ_DETAILS [];
extern const char MSG_INFO_EXTRUDER [];
extern const char MSG_INFO_SENSORS [];
extern const char MSG_MENU_TEMPERATURES [];
extern const char MSG_MENU_VOLTAGES [];
extern const char MSG_PRESS_KNOB [];
extern const char MSG_TO_LOAD_FIL [];
extern const char MSG_TO_UNLOAD_FIL [];
extern const char MSG_PREHEATING_TO_LOAD [];
extern const char MSG_PREHEATING_TO_UNLOAD [];
extern const char MSG_PREHEATING_TO_EJECT [];
extern const char MSG_PREHEATING_TO_CUT [];
extern const char MSG_INSERT_FILAMENT [];
extern const char MSG_PRESS [];
extern const char MSG_CHANGE_SUCCESS [];
extern const char MSG_LOADING_COLOR [];
extern const char MSG_CORRECTLY [];
extern const char MSG_NOT_LOADED [];
extern const char MSG_NOT_COLOR [];
#ifndef REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
extern const char MSG_AUTOLOADING_ENABLED [];
#endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
extern const char MSG_FILAMENT_USED [];
extern const char MSG_PRINT_TIME [];
extern const char MSG_TOTAL_FILAMENT [];
extern const char MSG_TOTAL_PRINT_TIME [];
extern const char MSG_Y_DIST_FROM_MIN [];
extern const char MSG_LEFT [];
extern const char MSG_RIGHT [];
extern const char MSG_MEASURED_SKEW [];
extern const char MSG_SLIGHT_SKEW [];
extern const char MSG_SEVERE_SKEW [];
extern const char MSG_MEASURED_OFFSET [];
extern const char MSG_BABYSTEPPING_Z [];
extern const char MSG_BED_CORRECTION_LEFT [];
extern const char MSG_BED_CORRECTION_RIGHT [];
extern const char MSG_BED_CORRECTION_FRONT [];
extern const char MSG_BED_CORRECTION_REAR [];
extern const char MSG_SET_TEMPERATURE [];
extern const char MSG_WAITING_TEMP_PINDA [];
extern const char MSG_WAITING_TEMP [];
extern const char MSG_MOVE_CARRIAGE_TO_THE_TOP_Z [];
extern const char MSG_MOVE_CARRIAGE_TO_THE_TOP [];
extern const char MSG_CONFIRM_CARRIAGE_AT_THE_TOP [];
extern const char MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND [];
extern const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_BOTH_FAR [];
extern const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR [];
extern const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR [];
extern const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR [];
extern const char MSG_BED_SKEW_OFFSET_DETECTION_PERFECT [];
extern const char MSG_BED_SKEW_OFFSET_DETECTION_SKEW_MILD [];
extern const char MSG_BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME [];
extern const char MSG_PINDA_CAL_FAILED [];
extern const char MSG_MOVE_X [];
extern const char MSG_MOVE_Y [];
extern const char MSG_MOVE_Z [];
extern const char MSG_CRASH_DET_ONLY_IN_NORMAL [];
extern const char MSG_CRASH_DET_STEALTH_FORCE_OFF [];
extern const char MSG_MODE_CHANGE_IN_PROGRESS [];
extern const char MSG_COPY_SEL_LANG [];
extern const char MSG_SHEET_OFFSET [];
extern const char MSG_PLEASE_LOAD_PLA [];
extern const char MSG_WIZARD_RERUN [];
extern const char MSG_MMU_INSERT_FILAMENT_FIRST_TUBE [];
extern const char MSG_WIZARD_LOAD_FILAMENT [];
extern const char MSG_WIZARD_V2_CAL [];
extern const char MSG_SELECT_FIL_1ST_LAYERCAL [];
extern const char MSG_SELECT_TEMP_MATCHES_MATERIAL [];
extern const char MSG_WIZARD_V2_CAL_2 [];
extern const char MSG_WIZARD_SELFTEST [];
extern const char MSG_WIZARD_XYZ_CAL [];
extern const char MSG_REMOVE_SHIPPING_HELPERS [];
extern const char MSG_REMOVE_TEST_PRINT [];
extern const char MSG_WIZARD_Z_CAL [];
extern const char MSG_WIZARD_WILL_PREHEAT [];
extern const char MSG_TM_CAL [];
extern const char MSG_SEL_PREHEAT_TEMP [];
extern const char MSG_WIZARD_REPEAT_V2_CAL [];
extern const char MSG_WIZARD_CLEAN_HEATBED [];
extern const char MSG_ADDITIONAL_SHEETS [];
extern const char MSG_X_CORRECTION [];
extern const char MSG_Y_CORRECTION [];
extern const char MSG_Z_CORRECTION [];
extern const char MSG_EXTRUDER_CORRECTION [];
extern const char MSG_CHECKS [];
extern const char MSG_TEMPERATURE [];
extern const char MSG_MOVE_AXIS [];
extern const char MSG_DISABLE_STEPPERS [];
extern const char MSG_LIN_CORRECTION [];
extern const char MSG_WIZARD [];
extern const char MSG_BELTTEST [];
extern const char MSG_SELFTEST [];
extern const char MSG_CALIBRATE_BED [];
extern const char MSG_BED_CORRECTION_MENU [];
extern const char MSG_PID_EXTRUDER [];
extern const char MSG_SHOW_END_STOPS [];
extern const char MSG_CALIBRATE_BED_RESET [];
extern const char MSG_SELECT [];
extern const char MSG_RENAME [];
extern const char MSG_PREHEAT [];
extern const char MSG_CNG_SDCARD [];
extern const char MSG_NO_CARD [];
extern const char MSG_INIT_SDCARD [];
extern const char MSG_LOAD_TO_NOZZLE [];
extern const char MSG_AUTOLOAD_FILAMENT [];
extern const char MSG_STATISTICS [];
extern const char MSG_FAIL_STATS [];
extern const char MSG_MMU_FAIL_STATS [];
extern const char MSG_SUPPORT [];
extern const char MSG_SPEED [];
extern const char MSG_FLOW [];
extern const char MSG_INSERT_FIL [];
extern const char MSG_UNLOAD_FILAMENT_REPEAT [];
extern const char MSG_CHECK_IR_CONNECTION [];
extern const char MSG_FS_VERIFIED [];
extern const char MSG_FIL_FAILED [];
extern const char MSG_SELFTEST_START [];
extern const char MSG_SELFTEST_OK [];
extern const char MSG_SELFTEST_ERROR [];
extern const char MSG_SELFTEST_PLEASECHECK [];
extern const char MSG_SELFTEST_HEATERTHERMISTOR [];
extern const char MSG_SELFTEST_NOTCONNECTED [];
extern const char MSG_SELFTEST_BEDHEATER [];
extern const char MSG_SELFTEST_ENDSTOPS [];
extern const char MSG_SELFTEST_ENDSTOP [];
extern const char MSG_SELFTEST_ENDSTOP_NOTHIT [];
extern const char MSG_LOOSE_PULLEY [];
extern const char MSG_SELFTEST_AXIS_LENGTH [];
extern const char MSG_SELFTEST_AXIS [];
extern const char MSG_SELFTEST_FANS [];
extern const char MSG_SELFTEST_SWAPPED [];
extern const char MSG_FALSE_TRIGGERING [];
extern const char MSG_SELFTEST_FS_LEVEL [];
extern const char MSG_SELFTEST_CHECK_ENDSTOPS [];
extern const char MSG_SELFTEST_CHECK_Z [];
extern const char MSG_SELFTEST_CHECK_HOTEND [];
extern const char MSG_SELFTEST_CHECK_ALLCORRECT [];
extern const char MSG_CALIBRATING_HOME [];
extern const char MSG_CHECKING_FILE [];
extern const char MSG_FILE_INCOMPLETE [];
extern const char MSG_SD_REMOVED [];
extern const char MSG_NEW_FIRMWARE_AVAILABLE [];
extern const char MSG_NEW_FIRMWARE_PLEASE_UPGRADE [];
extern const char MSG_FW_MK3_DETECTED [];
//not internationalized messages
#if 0
extern const char MSG_FW_VERSION_BETA[];
#endif
extern const char MSG_SPOOL_JOIN[];
extern const char MSG_FIRMWARE[];
extern const char MSG_FILAMENT[];
extern const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[];
extern const char MSG_PINDA[];
extern const char MSG_WELCOME[];
extern const char MSG_SD_WORKDIR_FAIL[];
extern const char MSG_BROWNOUT_RESET[];
extern const char MSG_EXTERNAL_RESET[];
extern const char MSG_FILE_SAVED[];
extern const char MSG_POSITION_UNKNOWN[];
extern const char MSG_SOFTWARE_RESET[];
extern const char MSG_UNKNOWN_COMMAND[];
extern const char MSG_WATCHDOG_RESET[];
extern const char MSG_Z_MAX[];
extern const char MSG_Z_MIN[];
extern const char MSG_ZPROBE_OUT[];
#ifdef ENABLE_AUTO_BED_LEVELING
extern const char MSG_ZPROBE_ZOFFSET[];
#endif
extern const char MSG_TMC_OVERTEMP[];
extern const char MSG_Enqueing[];
extern const char MSG_ENDSTOPS_HIT[];
extern const char MSG_SD_ERR_WRITE_TO_FILE[];
extern const char MSG_OK[];
extern const char MSG_OK_CAPS[];
@ -229,15 +405,20 @@ extern const char MSG_ERR_STOPPED[];
extern const char MSG_ENDSTOP_HIT[];
extern const char MSG_EJECT_FROM_MMU[];
extern const char MSG_CUT_FILAMENT[];
extern const char MSG_OCTOPRINT_ASK_PAUSE[];
extern const char MSG_OCTOPRINT_PAUSED[];
extern const char MSG_OCTOPRINT_ASK_RESUME[];
extern const char MSG_OCTOPRINT_RESUMED[];
extern const char MSG_OCTOPRINT_CANCEL[];
extern const char MSG_OCTOPRINT_READY[];
extern const char MSG_OCTOPRINT_NOT_READY[];
extern const char MSG_OCTOPRINT_START[];
extern const char MSG_OCTOPRINT_UVLO_RECOVERY_READY[];
extern const char MSG_HOST_ACTION_ASK_PAUSE[];
extern const char MSG_HOST_ACTION_PAUSED[];
extern const char MSG_HOST_ACTION_ASK_RESUME[];
extern const char MSG_HOST_ACTION_RESUMED[];
extern const char MSG_HOST_ACTION_CANCEL[];
extern const char MSG_HOST_ACTION_READY[];
extern const char MSG_HOST_ACTION_NOT_READY[];
extern const char MSG_HOST_ACTION_START[];
extern const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[];
extern const char MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY[];
extern const char MSG_HOST_ACTION_NOTIFICATION[];
#ifdef HOST_SHUTDOWN
extern const char MSG_HOST_ACTION_SHUTDOWN[];
#endif //HOST_SHUTOWN
extern const char MSG_FANCHECK_HOTEND[];
extern const char MSG_FANCHECK_PRINT[];
extern const char MSG_M112_KILL[];
@ -245,10 +426,13 @@ extern const char MSG_ADVANCE_K[];
extern const char MSG_POWERPANIC_DETECTED[];
extern const char MSG_LCD_STATUS_CHANGED[];
extern const char MSG_UNKNOWN_CODE[];
extern const char MSG_FILAMENT_RUNOUT_DETECTED[];
// Common G-gcodes
extern const char G1_E_F2700[];
extern const char G28W[];
extern const char MSG_G90[];
extern const char MSG_G91[];
extern const char MSG_M23[];
extern const char MSG_M24[];
extern const char MSG_M83[];

View File

@ -34,7 +34,7 @@ void waitForHotendTargetTemp(uint16_t delay, F f) {
}
void WaitForHotendTargetTempBeep() {
waitForHotendTargetTemp(3000, []{ });
waitForHotendTargetTemp(200, [] {});
MakeSound(Prompt);
}
@ -73,14 +73,17 @@ void MMU2::Start() {
mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication
SetCurrentTool(MMU2_NO_TOOL);
state = xState::Connecting;
// start the communication
logic.Start();
logic.ResetRetryAttempts();
logic.ResetCommunicationTimeoutAttempts();
state = xState::Connecting;
logic.Start();
}
MMU2::~MMU2() {}
void MMU2::Stop() {
StopKeepPowered();
PowerOff();
@ -153,8 +156,9 @@ void MMU2::PowerOn() {
}
bool MMU2::ReadRegister(uint8_t address) {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
do {
logic.ReadRegister(address); // we may signal the accepted/rejected status of the response as return value of this function
} while (!manage_response(false, false));
@ -165,8 +169,9 @@ bool MMU2::ReadRegister(uint8_t address) {
}
bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
// special cases - intercept requests of registers which influence the printer's behaviour too + perform the change even on the printer's side
switch (address) {
@ -192,12 +197,11 @@ void MMU2::mmu_loop() {
// Atomic compare_exchange would have been the most appropriate solution here, but this gets called only in Marlin's task,
// so thread safety should be kept
static bool avoidRecursion = false;
if (avoidRecursion)
if (avoidRecursion) {
return;
}
avoidRecursion = true;
mmu_loop_inner(true);
avoidRecursion = false;
}
@ -208,7 +212,7 @@ void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) {
void MMU2::CheckFINDARunout() {
// Check for FINDA filament runout
if (!FindaDetectsFilament() && check_fsensor()) {
if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors
SERIAL_ECHOLNPGM("FINDA filament runout!");
marlin_stop_and_save_print_to_ram();
restore_print_from_ram_and_continue(0);
@ -301,8 +305,12 @@ bool MMU2::VerifyFilamentEnteredPTFE() {
filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR);
tlur.Progress(filament_inserted);
safe_delay_keep_alive(0);
if (planner_draining()) {
return false; // power panic or a similar issue happened, bail out fast
}
}
}
Disable_E0();
if (!filament_inserted) {
IncrementLoadFails();
@ -318,8 +326,9 @@ bool MMU2::ToolChangeCommonOnce(uint8_t slot) {
Disable_E0(); // it may seem counterintuitive to disable the E-motor, but it gets enabled in the planner whenever the E-motor is to move
tool_change_extruder = slot;
logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in
if (manage_response(true, true))
if (manage_response(true, true)) {
break;
}
// otherwise: failed to perform the command - unload first and then let it run again
IncrementMMUFails();
@ -335,7 +344,7 @@ bool MMU2::ToolChangeCommonOnce(uint8_t slot) {
}
if (VerifyFilamentEnteredPTFE()) {
return true; // success
} else { // Prepare a retry attempt
} else { // Prepare a retry attempt
UnloadInner();
if (retries == 2 && cutter_enabled()) {
CutFilamentInner(slot); // try cutting filament tip at the last attempt
@ -347,6 +356,9 @@ bool MMU2::ToolChangeCommonOnce(uint8_t slot) {
void MMU2::ToolChangeCommon(uint8_t slot) {
while (!ToolChangeCommonOnce(slot)) { // while not successfully fed into extruder's PTFE tube
if (planner_draining()) {
return; // power panic happening, pretend the G-code finished ok
}
// failed autoretry, report an error by forcing a "printer" error into the MMU infrastructure - it is a hack to leverage existing code
// @@TODO theoretically logic layer may not need to be spoiled with the printer error - may be just the manage_response needs it...
logic.SetPrinterError(ErrorCode::LOAD_TO_EXTRUDER_FAILED);
@ -357,15 +369,16 @@ void MMU2::ToolChangeCommon(uint8_t slot) {
static_cast<void>(manage_response(true, true)); // yes, I'd like to silence [[nodiscard]] warning at this spot by casting to void
}
SetCurrentTool(slot); //filament change is finished
SetCurrentTool(slot); // filament change is finished
SpoolJoin::spooljoin.setSlot(slot);
++toolchange_counter;
}
bool MMU2::tool_change(uint8_t slot) {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
if (slot != extruder) {
if (/*FindaDetectsFilament()*/
@ -390,8 +403,9 @@ bool MMU2::tool_change(uint8_t slot) {
///- Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load.
///- Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated.
bool MMU2::tool_change(char code, uint8_t slot) {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
FSensorBlockRunout blockRunout;
@ -435,8 +449,9 @@ void MMU2::SetCurrentTool(uint8_t ex){
}
bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
// @@TODO - this is not supported in the new MMU yet
// slot = slot; // @@TODO
@ -461,8 +476,9 @@ void MMU2::UnloadInner() {
for (;;) {
Disable_E0();
logic.UnloadFilament();
if (manage_response(false, true))
if (manage_response(false, true)) {
break;
}
IncrementMMUFails();
}
MakeSound(Confirm);
@ -473,8 +489,9 @@ void MMU2::UnloadInner() {
}
bool MMU2::unload() {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
WaitForHotendTargetTempBeep();
@ -482,6 +499,7 @@ bool MMU2::unload() {
ReportingRAII rep(CommandInProgress::UnloadFilament);
UnloadInner();
}
ScreenUpdateEnable();
return true;
}
@ -490,15 +508,17 @@ void MMU2::CutFilamentInner(uint8_t slot) {
for (;;) {
Disable_E0();
logic.CutFilament(slot);
if (manage_response(false, true))
if (manage_response(false, true)) {
break;
}
IncrementMMUFails();
}
}
bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
if (enableFullScreenMsg) {
FullScreenMsgCut(slot);
@ -528,8 +548,9 @@ bool MMU2::loading_test(uint8_t slot) {
}
bool MMU2::load_filament(uint8_t slot) {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
FullScreenMsgLoad(slot);
{
@ -537,8 +558,9 @@ bool MMU2::load_filament(uint8_t slot) {
for (;;) {
Disable_E0();
logic.LoadFilament(slot);
if (manage_response(false, false))
if (manage_response(false, false)) {
break;
}
IncrementMMUFails();
}
MakeSound(SoundType::Confirm);
@ -548,8 +570,9 @@ bool MMU2::load_filament(uint8_t slot) {
}
bool MMU2::load_filament_to_nozzle(uint8_t slot) {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
WaitForHotendTargetTempBeep();
@ -574,8 +597,9 @@ bool MMU2::load_filament_to_nozzle(uint8_t slot) {
}
bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) {
if (!WaitForMMUReady())
if (!WaitForMMUReady()) {
return false;
}
if (enableFullScreenMsg) {
FullScreenMsgEject(slot);
@ -589,8 +613,9 @@ bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) {
for (;;) {
Disable_E0();
logic.EjectFilament(slot);
if (manage_response(false, true))
if (manage_response(false, true)) {
break;
}
IncrementMMUFails();
}
SetCurrentTool(MMU2_NO_TOOL);
@ -611,8 +636,9 @@ void MMU2::Home(uint8_t mode) {
}
void MMU2::SaveHotendTemp(bool turn_off_nozzle) {
if (mmu_print_saved & SavedState::Cooldown)
if (mmu_print_saved & SavedState::Cooldown) {
return;
}
if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) {
Disable_E0();
@ -701,8 +727,7 @@ void MMU2::CheckUserInput() {
lastButton = Buttons::NoButton; // Clear it.
}
if (mmu2.MMULastErrorSource() == MMU2::ErrorSourcePrinter && btn != Buttons::NoButton)
{
if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) {
// When the printer has raised an error screen, and a button was selected
// the error screen should always be dismissed.
ClearPrinterError();
@ -720,7 +745,7 @@ void MMU2::CheckUserInput() {
SERIAL_ECHOLN((int)buttons_to_uint8t(btn));
ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else...
if (mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) {
if (mmu2.MMULastErrorSource() == ErrorSourceMMU) {
// Do not send a button to the MMU unless the MMU is in error state
Button(buttons_to_uint8t(btn));
}
@ -782,6 +807,7 @@ bool MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
// - failed -> then do the safety moves on the printer like before
// - finished ok -> proceed with reading other commands
safe_delay_keep_alive(0); // calls LogicStep() and remembers its return status
// also disables stepper motor unlocking
if (mmu_print_saved & SavedState::CooldownPending) {
if (!nozzleTimeout.running()) {
@ -803,9 +829,8 @@ bool MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
// command/operation completed, let Marlin continue its work
// the E may have some more moves to finish - wait for them
ResumeHotendTemp();
ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved.
if (!TuneMenuEntered())
{
ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved.
if (!TuneMenuEntered()) {
// If the error screen is sleeping (running 'Tune' menu)
// then don't reset retry attempts because we this will trigger
// an automatic retry attempt when 'Tune' button is selected. We want the
@ -920,15 +945,19 @@ void MMU2::filament_ramming() {
execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step));
}
void MMU2::execute_extruder_sequence(const E_Step *sequence, uint8_t steps) {
void MMU2::execute_extruder_sequence(const E_Step *sequence, uint8_t stepCount) {
planner_synchronize();
// Plan the moves
const E_Step *step = sequence;
for (uint8_t i = steps; i > 0; --i) {
for (uint8_t i = stepCount; i > 0; --i) {
extruder_move(pgm_read_float(&(step->extrude)), pgm_read_float(&(step->feedRate)));
step++;
}
planner_synchronize(); // it looks like it's better to sync the moves at the end - smoother move (if the sequence is not too long).
// Wait for the moves to finish
// it looks like it's better to sync the moves at the end - smoother move (if the sequence is not too long).
planner_synchronize();
Disable_E0();
}
@ -1031,7 +1060,7 @@ void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) {
switch (pc) {
case ProgressCode::UnloadingToFinda:
if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament
|| ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) {
|| ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) {
// If MK3S sent U0 command, ramming sequence takes care of releasing the filament.
// If Toolchange is done while printing, PrusaSlicer takes care of releasing the filament
// If printing is not in progress, ToolChange will issue a U0 command.
@ -1079,14 +1108,10 @@ void MMU2::OnMMUProgressMsgSame(ProgressCode pc) {
case FilamentState::AT_FSENSOR:
// fsensor triggered, finish FeedingToExtruder state
loadFilamentStarted = false;
// Abort any excess E-move from the planner queue
planner_abort_queued_moves();
// After the MMU knows the FSENSOR is triggered it will:
// 1. Push the filament by additional 30mm (see fsensorToNozzle)
// 2. Disengage the idler and push another 2mm.
extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate());
{
extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate());
}
break;
case FilamentState::NOT_PRESENT:
// fsensor not triggered, continue moving extruder

View File

@ -11,6 +11,7 @@ typedef float feedRate_t;
#else
#include "protocol_logic.h"
#include <atomic>
#include <memory>
#endif
struct E_Step;
@ -32,6 +33,7 @@ struct Version {
class MMU2 {
public:
MMU2();
~MMU2();
/// Powers ON the MMU, then initializes the UART and protocol logic
void Start();
@ -48,17 +50,17 @@ public:
/// Different levels of resetting the MMU
enum ResetForm : uint8_t {
Software = 0, ///< sends a X0 command into the MMU, the MMU will watchdog-reset itself
ResetPin = 1, ///< trigger the reset pin of the MMU
CutThePower = 2, ///< power off and power on (that includes +5V and +24V power lines)
Software = 0, ///< sends a X0 command into the MMU, the MMU will watchdog-reset itself
ResetPin = 1, ///< trigger the reset pin of the MMU
CutThePower = 2, ///< power off and power on (that includes +5V and +24V power lines)
EraseEEPROM = 42, ///< erase MMU EEPROM and then perform a software reset
};
/// Saved print state on error.
enum SavedState : uint8_t {
None = 0, // No state saved.
None = 0, // No state saved.
ParkExtruder = 1, // The extruder was parked.
Cooldown = 2, // The extruder was allowed to cool.
Cooldown = 2, // The extruder was allowed to cool.
CooldownPending = 4,
};
@ -207,9 +209,9 @@ public:
};
inline void InvokeErrorScreen(ErrorCode ec) {
// The printer may not raise an error when the MMU is busy
if (!logic.CommandInProgress() // MMU must not be busy
if (!logic.CommandInProgress() // MMU must not be busy
&& MMUCurrentErrorCode() == ErrorCode::OK // The protocol must not be in error state
&& lastErrorCode != ec) // The error code is not a duplicate
&& lastErrorCode != ec) // The error code is not a duplicate
{
ReportError(ec, ErrorSource::ErrorSourcePrinter);
}
@ -273,7 +275,9 @@ private:
StepStatus LogicStep(bool reportErrors);
void filament_ramming();
void execute_extruder_sequence(const E_Step *sequence, uint8_t steps);
void execute_extruder_sequence(const E_Step *sequence, uint8_t stepCount);
void execute_load_to_nozzle_sequence();
/// Reports an error into attached ExtUIs
@ -342,8 +346,9 @@ private:
void SetCurrentTool(uint8_t ex);
ProtocolLogic logic; ///< implementation of the protocol logic layer
uint8_t extruder; ///< currently active slot in the MMU ... somewhat... not sure where to get it from yet
ProtocolLogic logic; ///< implementation of the protocol logic layer
uint8_t extruder; ///< currently active slot in the MMU ... somewhat... not sure where to get it from yet
uint8_t tool_change_extruder; ///< only used for UI purposes
pos3d resume_position;

View File

@ -287,7 +287,7 @@ static const char MSG_DESC_FILAMENT_CHANGE[] PROGMEM_I1 = ISTR("M600 Filament Ch
static const char MSG_DESC_UNKNOWN_ERROR[] PROGMEM_I1 = ISTR("Unexpected error occurred."); ////MSG_DESC_UNKNOWN_ERROR c=20 r=8
// Read explanation in mmu2_protocol_logic.cpp -> supportedMmuFWVersion
static constexpr char MSG_DESC_FW_UPDATE_NEEDED[] PROGMEM_I1 = ISTR("MMU FW version is incompatible with printer FW.Update to version 3.0.1."); ////MSG_DESC_FW_UPDATE_NEEDED c=20 r=8
static constexpr char MSG_DESC_FW_UPDATE_NEEDED[] PROGMEM_I1 = ISTR("MMU FW version is incompatible with printer FW.Update to version 3.0.3."); ////MSG_DESC_FW_UPDATE_NEEDED c=20 r=8
static constexpr uint8_t szFWUN = sizeof(MSG_DESC_FW_UPDATE_NEEDED);
// at least check the individual version characters in MSG_DESC_FW_UPDATE_NEEDED
static_assert(MSG_DESC_FW_UPDATE_NEEDED[szFWUN - 7] == ('0' + mmuVersionMajor));
@ -355,7 +355,7 @@ static const char MSG_BTN_RETRY[] PROGMEM_I1 = ISTR("Retry"); ////MSG_BTN_RETRY
static const char MSG_BTN_RESET_MMU[] PROGMEM_I1 = ISTR("ResetMMU"); ////MSG_BTN_RESET_MMU c=8
static const char MSG_BTN_UNLOAD[] PROGMEM_I1 = ISTR("Unload"); ////MSG_BTN_UNLOAD c=8
static const char MSG_BTN_LOAD[] PROGMEM_I1 = ISTR("Load"); ////MSG_BTN_LOAD c=8
static const char MSG_BTN_EJECT[] PROGMEM_I1 = ISTR("Eject"); ////MSG_BTN_EJECT c=8
//static const char MSG_BTN_EJECT[] PROGMEM_I1 = ISTR("Eject"); //Reuse MSG_EJECT c=9
//static const char MSG_BTN_TUNE_MMU[] PROGMEM_I1 = ISTR("Tune"); //Reuse MSG_TUNE c=8
static const char MSG_BTN_STOP[] PROGMEM_I1 = ISTR("Stop"); ////MSG_BTN_STOP c=8
static const char MSG_BTN_DISABLE_MMU[] PROGMEM_I1 = ISTR("Disable"); ////MSG_BTN_DISABLE_MMU c=8
@ -368,7 +368,7 @@ static const char * const btnOperation[] PROGMEM = {
_R(MSG_BTN_RESET_MMU),
_R(MSG_BTN_UNLOAD),
_R(MSG_BTN_LOAD),
_R(MSG_BTN_EJECT),
_R(MSG_EJECT),
_R(MSG_TUNE),
_R(MSG_BTN_STOP),
_R(MSG_BTN_DISABLE_MMU),

View File

@ -29,17 +29,17 @@ static constexpr uint8_t FindErrorIndex(uint16_t pec) {
return (i != errorCodesEnd) ? (i-errorCodes) : (errorCodesSize - 1);
}
// check that the searching algoritm works
static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER) == 0);
static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1);
static_assert( FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2);
static_assert( FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK) == 3);
// check that the searching algorithm works
static_assert(FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER) == 0);
static_assert(FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1);
static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2);
static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK) == 3);
constexpr ErrorCode operator&(ErrorCode a, ErrorCode b){
constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) {
return (ErrorCode)((uint16_t)a & (uint16_t)b);
}
constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask){
constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) {
return (uint16_t)ec & (uint16_t)mask;
}
@ -96,93 +96,115 @@ uint8_t PrusaErrorCodeIndex(ErrorCode ec) {
return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY);
case ErrorCode::MCU_UNDERVOLTAGE_VCC:
return FindErrorIndex(ERR_ELECTRICAL_MMU_MCU_ERROR);
default: break;
default:
break;
}
// Electrical issues which can be detected somehow.
// Need to be placed before TMC-related errors in order to process couples of error bits between single ones
// and to keep the code size down.
if (ContainsBit(ec, ErrorCode::TMC_PULLEY_BIT)) {
if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION)
if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) {
return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED);
}
} else if (ContainsBit(ec, ErrorCode::TMC_SELECTOR_BIT)) {
if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION)
if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) {
return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED);
}
} else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) {
if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION)
if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) {
return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED);
}
}
// TMC-related errors - multiple of these can occur at once
// - in such a case we report the first which gets found/converted into Prusa-Error-Codes (usually the fact, that one TMC has an issue is serious enough)
// By carefully ordering the checks here we can prioritize the errors being reported to the user.
if (ContainsBit(ec, ErrorCode::TMC_PULLEY_BIT)) {
if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH))
if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_ERROR);
if (ContainsBit(ec, ErrorCode::TMC_RESET))
}
if (ContainsBit(ec, ErrorCode::TMC_RESET)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET);
if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP))
}
if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR);
if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND))
}
if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED);
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN))
}
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) {
return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT);
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR))
}
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) {
return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR);
}
} else if (ContainsBit(ec, ErrorCode::TMC_SELECTOR_BIT)) {
if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH))
if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_ERROR);
if (ContainsBit(ec, ErrorCode::TMC_RESET))
}
if (ContainsBit(ec, ErrorCode::TMC_RESET)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET);
if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP))
}
if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR);
if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND))
}
if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED);
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN))
}
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) {
return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT);
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR))
}
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) {
return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR);
}
} else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) {
if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH))
if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_ERROR);
if (ContainsBit(ec, ErrorCode::TMC_RESET))
}
if (ContainsBit(ec, ErrorCode::TMC_RESET)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET);
if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP))
}
if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR);
if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND))
}
if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) {
return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED);
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN))
}
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) {
return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT);
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR))
}
if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) {
return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR);
}
}
// if nothing got caught, return a generic runtime error
// if nothing got caught, return a generic error
return FindErrorIndex(ERR_OTHER_UNKNOWN_ERROR);
}
uint16_t PrusaErrorCode(uint8_t i){
uint16_t PrusaErrorCode(uint8_t i) {
return pgm_read_word(errorCodes + i);
}
const char * PrusaErrorTitle(uint8_t i){
const char *PrusaErrorTitle(uint8_t i) {
return (const char *)pgm_read_ptr(errorTitles + i);
}
const char * PrusaErrorDesc(uint8_t i){
const char *PrusaErrorDesc(uint8_t i) {
return (const char *)pgm_read_ptr(errorDescs + i);
}
uint8_t PrusaErrorButtons(uint8_t i){
uint8_t PrusaErrorButtons(uint8_t i) {
return pgm_read_byte(errorButtons + i);
}
const char * PrusaErrorButtonTitle(uint8_t bi){
const char *PrusaErrorButtonTitle(uint8_t bi) {
// -1 represents the hidden NoOperation button which is not drawn in any way
return (const char *)pgm_read_ptr(btnOperation + bi - 1);
}
const char * PrusaErrorButtonMore(){
const char *PrusaErrorButtonMore() {
return MSG_BTN_MORE;
}
@ -193,7 +215,6 @@ Buttons ButtonPressed(ErrorCode ec) {
const auto result = ButtonAvailable(ec);
buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation
return result;
}
@ -342,7 +363,7 @@ Buttons ButtonAvailable(ErrorCode ec) {
return Buttons::NoButton;
}
void SetButtonResponse(ButtonOperations rsp){
void SetButtonResponse(ButtonOperations rsp) {
buttonSelectedOperation = rsp;
}

View File

@ -6,7 +6,7 @@
#include "mmu2/error_codes.h"
#else
#include "buttons.h"
#include "../../../../../../Prusa-Error-Codes/04_MMU/button_operations.h"
#include "../../../../../../Prusa-Error-Codes/include/button_operations.h"
#include "../../../../../../Prusa-Firmware-MMU/src/logic/error_codes.h"
#endif

View File

@ -55,7 +55,7 @@ void LogEchoEvent_P(const char *msg_P);
} while (0)
#define MMU2_ERROR_MSG(S) MMU2_ECHO_MSG(S) //!@todo Decide MMU errors on serial line
#else // #ifndef UNITTEST
#else // #ifndef UNITTEST
#include "stubs/stub_interfaces.h"
#define MMU2_ECHO_MSGLN(S) marlinLogSim.AppendLine(S)
#define MMU2_ERROR_MSGLN(S) marlinLogSim.AppendLine(S)
@ -65,4 +65,4 @@ void LogEchoEvent_P(const char *msg_P);
#define SERIAL_ECHOPGM(S) /* */
#define SERIAL_ECHOLN(S) /*marlinLogSim.AppendLine(S)*/
#endif // #ifndef UNITTEST
#endif // #ifndef UNITTEST

View File

@ -28,6 +28,7 @@ void extruder_schedule_turning(float feed_rate);
float move_raise_z(float delta);
void planner_abort_queued_moves();
bool planner_draining();
void planner_synchronize();
bool planner_any_moves();
float stepper_get_machine_position_E_mm();
@ -42,8 +43,8 @@ void nozzle_park();
bool marlin_printingIsActive();
void marlin_manage_heater();
void marlin_manage_inactivity(bool b);
void marlin_idle(bool b);
void marlin_manage_inactivity(bool ignore_stepper_queue);
void marlin_idle(bool ignore_stepper_queue);
void marlin_refresh_print_state_in_ram();
void marlin_clear_print_state_in_ram();
void marlin_stop_and_save_print_to_ram();

View File

@ -38,6 +38,10 @@ void planner_abort_queued_moves() {
planner_aborted = false;
}
bool planner_draining() {
return planner_aborted;
}
void planner_synchronize() {
st_synchronize();
}
@ -46,33 +50,33 @@ bool planner_any_moves() {
return blocks_queued();
}
float planner_get_machine_position_E_mm(){
float planner_get_machine_position_E_mm() {
return current_position[E_AXIS];
}
float stepper_get_machine_position_E_mm(){
float stepper_get_machine_position_E_mm() {
return st_get_position_mm(E_AXIS);
}
float planner_get_current_position_E(){
float planner_get_current_position_E() {
return current_position[E_AXIS];
}
void planner_set_current_position_E(float e){
void planner_set_current_position_E(float e) {
current_position[E_AXIS] = e;
}
pos3d planner_current_position(){
pos3d planner_current_position() {
return pos3d(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]);
}
void motion_do_blocking_move_to_xy(float rx, float ry, float feedRate_mm_s){
void motion_do_blocking_move_to_xy(float rx, float ry, float feedRate_mm_s) {
current_position[X_AXIS] = rx;
current_position[Y_AXIS] = ry;
planner_line_to_current_position_sync(feedRate_mm_s);
}
void motion_do_blocking_move_to_z(float z, float feedRate_mm_s){
void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) {
current_position[Z_AXIS] = z;
planner_line_to_current_position_sync(feedRate_mm_s);
}
@ -84,32 +88,31 @@ void nozzle_park() {
}
bool marlin_printingIsActive() {
// return IS_SD_PRINTING || usb_timer_running();
return printer_active();
}
void marlin_manage_heater(){
void marlin_manage_heater() {
manage_heater();
}
void marlin_manage_inactivity(bool b){
manage_inactivity(b);
void marlin_manage_inactivity(bool ignore_stepper_queue) {
manage_inactivity(ignore_stepper_queue);
}
void marlin_idle(bool b){
void marlin_idle(bool ignore_stepper_queue) {
manage_heater();
manage_inactivity(b);
manage_inactivity(ignore_stepper_queue);
}
void marlin_refresh_print_state_in_ram(){
void marlin_refresh_print_state_in_ram() {
refresh_print_state_in_ram();
}
void marlin_clear_print_state_in_ram(){
void marlin_clear_print_state_in_ram() {
clear_print_state_in_ram();
}
void marlin_stop_and_save_print_to_ram(){
void marlin_stop_and_save_print_to_ram() {
stop_and_save_print_to_ram(0,0);
}
@ -133,10 +136,15 @@ void safe_delay_keep_alive(uint16_t t) {
delay_keep_alive(t);
}
void Enable_E0(){ enable_e0(); }
void Disable_E0(){ disable_e0(); }
void Enable_E0() {
enable_e0();
}
bool all_axes_homed(){
void Disable_E0() {
disable_e0();
}
bool all_axes_homed() {
return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS];
}

View File

@ -30,7 +30,7 @@ static const char MSG_PROGRESS_HOMING[] PROGMEM_I1 = ISTR("Homing"); /
static const char MSG_PROGRESS_MOVING_SELECTOR[] PROGMEM_I1 = ISTR("Moving selector"); ////MSG_PROGRESS_MOVING_SELECTOR c=20
static const char MSG_PROGRESS_FEED_FSENSOR[] PROGMEM_I1 = ISTR("Feeding to FSensor"); ////MSG_PROGRESS_FEED_FSENSOR c=20
static const char * const progressTexts[] PROGMEM = {
static const char *const progressTexts[] PROGMEM = {
_R(MSG_PROGRESS_OK),
_R(MSG_PROGRESS_ENGAGE_IDLER),
_R(MSG_PROGRESS_DISENGAGE_IDLER),
@ -62,11 +62,11 @@ static const char * const progressTexts[] PROGMEM = {
_R(MSG_PROGRESS_FEED_FSENSOR)
};
const char * ProgressCodeToText(ProgressCode pc){
const char *ProgressCodeToText(ProgressCode pc) {
// @@TODO ?? a better fallback option?
return ( (uint16_t)pc <= (sizeof(progressTexts) / sizeof(progressTexts[0])) )
? static_cast<const char *>(pgm_read_ptr(&progressTexts[(uint16_t)pc]))
: static_cast<const char *>(pgm_read_ptr(&progressTexts[0]));
return ((uint16_t)pc <= (sizeof(progressTexts) / sizeof(progressTexts[0])))
? static_cast<const char *>(pgm_read_ptr(&progressTexts[(uint16_t)pc]))
: static_cast<const char *>(pgm_read_ptr(&progressTexts[0]));
}
} // namespace MMU2

View File

@ -1,4 +1,4 @@
/// @file
/// @file mmu2_protocol.cpp
#include "mmu2_protocol.h"
// protocol definition
@ -112,11 +112,8 @@ DecodeStatus Protocol::DecodeRequest(uint8_t c) {
rqState = RequestStates::Code;
return DecodeStatus::MessageCompleted;
}
} else {
requestMsg.code = RequestMsgCodes::unknown;
rqState = RequestStates::Error;
return DecodeStatus::Error;
}
[[fallthrough]];
default: //case error:
if (IsNewLine(c)) {
rqState = RequestStates::Code;

View File

@ -1,4 +1,4 @@
/// @file protocol.h
/// @file mmu2_protocol.h
#pragma once
#include <stdint.h>
#include "mmu2_crc.h"
@ -8,6 +8,7 @@ namespace modules {
/// @brief The MMU communication protocol implementation and related stuff.
///
/// See description of the new protocol in the MMU 2021 doc
namespace protocol {
/// Definition of request message codes
@ -179,17 +180,9 @@ public:
/// @returns number of bytes written into txbuff
static uint8_t EncodeResponseReadFINDA(const RequestMsg &msg, uint8_t findaValue, uint8_t *txbuff);
/// Encode response to Query operation status
/// @param msg source request message for this response
/// @param code status of operation (Processing, Error, Finished)
/// @param value related to status of operation(e.g. error code or progress)
/// @param rcs status of operation (Processing, Error, Finished)
/// @param txbuff where to format the message
/// @returns number of bytes written into txbuff
static uint8_t EncodeResponseQueryOperation(const RequestMsg &msg, ResponseCommandStatus rcs, uint8_t *txbuff);

View File

@ -6,7 +6,7 @@
// on MK3/S/+ we shuffle the timers a bit, thus "_millis" may not equal "millis"
#include "system_timer.h"
#else
// irrelevant on Buddy FW, just keep "_millis" as "millis"
// irrelevant on Buddy FW, just keep "_millis" as "millis"
#include <wiring_time.h>
#define _millis millis
#ifdef UNITTEST
@ -32,18 +32,18 @@ namespace MMU2 {
static constexpr uint8_t supportedMmuFWVersion[3] PROGMEM = { mmuVersionMajor, mmuVersionMinor, mmuVersionPatch };
const Register ProtocolLogic::regs8Addrs[ProtocolLogic::regs8Count] PROGMEM = {
Register::FINDA_State, // FINDA state
Register::FINDA_State, // FINDA state
Register::Set_Get_Selector_Slot, // Selector slot
Register::Set_Get_Idler_Slot, // Idler slot
Register::Set_Get_Idler_Slot, // Idler slot
};
const Register ProtocolLogic::regs16Addrs[ProtocolLogic::regs16Count] PROGMEM = {
Register::MMU_Errors, // MMU errors - aka statistics
Register::MMU_Errors, // MMU errors - aka statistics
Register::Get_Pulley_Position, // Pulley position [mm]
};
const Register ProtocolLogic::initRegs8Addrs[ProtocolLogic::initRegs8Count] PROGMEM = {
Register::Extra_Load_Distance, // extra load distance [mm]
Register::Extra_Load_Distance, // extra load distance [mm]
Register::Pulley_Slow_Feedrate, // pulley slow feedrate [mm/s]
};
@ -186,7 +186,7 @@ StepStatus ProtocolLogic::ExpectingMessage() {
break;
}
}
[[fallthrough]]; // otherwise
[[fallthrough]]; // otherwise
default:
RecordUARTActivity(); // something has happened on the UART, update the timeout record
return ProtocolError;
@ -194,7 +194,7 @@ StepStatus ProtocolLogic::ExpectingMessage() {
}
if (bytesConsumed != 0) {
RecordUARTActivity(); // something has happened on the UART, update the timeout record
return Processing; // consumed some bytes, but message still not ready
return Processing; // consumed some bytes, but message still not ready
} else if (Elapsed(linkLayerTimeout) && currentScope != Scope::Stopped) {
return CommunicationTimeout;
}
@ -267,6 +267,8 @@ StepStatus ProtocolLogic::ScopeStep() {
if (!ExpectsResponse()) {
// we are waiting for something
switch (currentScope) {
case Scope::StartSeq:
return Processing;
case Scope::DelayedRestart:
return DelayedRestartWait();
case Scope::Idle:
@ -280,17 +282,18 @@ StepStatus ProtocolLogic::ScopeStep() {
}
} else {
// we are expecting a message
if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) // this whole statement takes 12B
if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B
return expmsg;
}
// process message
switch (currentScope) {
case Scope::StartSeq:
return StartSeqStep(); // ~270B
case Scope::Idle:
return IdleStep(); // ~300B
return IdleStep(); // ~300B
case Scope::Command:
return CommandStep(); // ~430B
return CommandStep(); // ~430B
case Scope::Stopped:
return StoppedStep();
default:
@ -335,7 +338,7 @@ StepStatus ProtocolLogic::StartSeqStep() {
StepStatus ProtocolLogic::DelayedRestartWait() {
if (Elapsed(heartBeatPeriod)) { // this basically means, that we are waiting until there is some traffic on
while (uart->read() != -1)
; // clear the input buffer
; // clear the input buffer
// switch to StartSeq
Start();
}
@ -723,12 +726,13 @@ void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) {
for (uint8_t i = 0; i < lrb; ++i) {
uint8_t b = lastReceivedBytes[i];
// Check for printable character, including space
if (b < 32 || b > 127)
if (b < 32 || b > 127) {
b = '.';
}
*dst++ = b;
}
*dst = 0; // terminate properly
lrb = 0; // reset the input buffer index in case of a clean message
lrb = 0; // reset the input buffer index in case of a clean message
}
void ProtocolLogic::LogRequestMsg(const uint8_t *txbuff, uint8_t size) {
@ -738,8 +742,9 @@ void ProtocolLogic::LogRequestMsg(const uint8_t *txbuff, uint8_t size) {
for (uint8_t i = 0; i < size; ++i) {
uint8_t b = txbuff[i];
// Check for printable character, including space
if (b < 32 || b > 127)
if (b < 32 || b > 127) {
b = '.';
}
tmp[i + 1] = b;
}
tmp[size + 1] = 0;
@ -809,14 +814,11 @@ StepStatus ProtocolLogic::Step() {
// We are ok, switching to Idle if there is no potential next request planned.
// But the trouble is we must report a finished command if the previous command has just been finished
// i.e. only try to find some planned command if we just finished the Idle cycle
bool previousCommandFinished = currentScope == Scope::Command; // @@TODO this is a nasty hack :(
if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle
if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle
SwitchToIdle();
} else {
} else if (ExpectsResponse()) {
// if the previous cycle was Idle and now we have planned a new command -> avoid returning Finished
if (!previousCommandFinished && currentScope == Scope::Command) {
currentStatus = Processing;
}
currentStatus = Processing;
}
} break;
case CommandRejected:
@ -848,8 +850,9 @@ StepStatus ProtocolLogic::Step() {
}
uint8_t ProtocolLogic::CommandInProgress() const {
if (currentScope != Scope::Command)
if (currentScope != Scope::Command) {
return 0;
}
return (uint8_t)ReqMsg().code;
}
@ -865,7 +868,7 @@ void ProtocolLogic::ResetRetryAttempts() {
retryAttempts = MAX_RETRIES;
}
void __attribute__((noinline)) ProtocolLogic::ResetCommunicationTimeoutAttempts() {
void ProtocolLogic::ResetCommunicationTimeoutAttempts() {
SERIAL_ECHOLNPGM("RSTCommTimeout");
dataTO.Reset();
}

View File

@ -52,22 +52,22 @@ class ProtocolLogic;
/// ProtocolLogic stepping statuses
enum StepStatus : uint_fast8_t {
Processing = 0,
MessageReady, ///< a message has been successfully decoded from the received bytes
Finished, ///< Scope finished successfully
Interrupted, ///< received "Finished" message related to a different command than originally issued (most likely the MMU restarted while doing something)
MessageReady, ///< a message has been successfully decoded from the received bytes
Finished, ///< Scope finished successfully
Interrupted, ///< received "Finished" message related to a different command than originally issued (most likely the MMU restarted while doing something)
CommunicationTimeout, ///< the MMU failed to respond to a request within a specified time frame
ProtocolError, ///< bytes read from the MMU didn't form a valid response
CommandRejected, ///< the MMU rejected the command due to some other command in progress, may be the user is operating the MMU locally (button commands)
CommandError, ///< the command in progress stopped due to unrecoverable error, user interaction required
VersionMismatch, ///< the MMU reports its firmware version incompatible with our implementation
PrinterError, ///< printer's explicit error - MMU is fine, but the printer was unable to complete the requested operation
ProtocolError, ///< bytes read from the MMU didn't form a valid response
CommandRejected, ///< the MMU rejected the command due to some other command in progress, may be the user is operating the MMU locally (button commands)
CommandError, ///< the command in progress stopped due to unrecoverable error, user interaction required
VersionMismatch, ///< the MMU reports its firmware version incompatible with our implementation
PrinterError, ///< printer's explicit error - MMU is fine, but the printer was unable to complete the requested operation
CommunicationRecovered,
ButtonPushed, ///< The MMU reported the user pushed one of its three buttons.
ButtonPushed, ///< The MMU reported the user pushed one of its three buttons.
};
inline constexpr uint32_t linkLayerTimeout = 2000; ///< default link layer communication timeout
inline constexpr uint32_t linkLayerTimeout = 2000; ///< default link layer communication timeout
inline constexpr uint32_t dataLayerTimeout = linkLayerTimeout * 3; ///< data layer communication timeout
inline constexpr uint32_t heartBeatPeriod = linkLayerTimeout / 2; ///< period of heart beat messages (Q0)
inline constexpr uint32_t heartBeatPeriod = linkLayerTimeout / 2; ///< period of heart beat messages (Q0)
static_assert(heartBeatPeriod < linkLayerTimeout && linkLayerTimeout < dataLayerTimeout, "Incorrect ordering of timeouts");
@ -229,9 +229,9 @@ private:
ErrorCode explicitPrinterError;
enum class State : uint_fast8_t {
Stopped, ///< stopped for whatever reason
Stopped, ///< stopped for whatever reason
InitSequence, ///< initial sequence running
Running ///< normal operation - Idle + Command processing
Running ///< normal operation - Idle + Command processing
};
enum class Scope : uint_fast8_t {
@ -347,25 +347,25 @@ private:
/// Activate the planned state once the immediate response to a sent request arrived
bool ActivatePlannedRequest();
uint32_t lastUARTActivityMs; ///< timestamp - last ms when something occurred on the UART
DropOutFilter dataTO; ///< Filter of short consecutive drop outs which are recovered instantly
uint32_t lastUARTActivityMs; ///< timestamp - last ms when something occurred on the UART
DropOutFilter dataTO; ///< Filter of short consecutive drop outs which are recovered instantly
ResponseMsg rsp; ///< decoded response message from the MMU protocol
ResponseMsg rsp; ///< decoded response message from the MMU protocol
State state; ///< internal state of ProtocolLogic
State state; ///< internal state of ProtocolLogic
Protocol protocol; ///< protocol codec
Protocol protocol; ///< protocol codec
std::array<uint8_t, 16> lastReceivedBytes; ///< remembers the last few bytes of incoming communication for diagnostic purposes
uint8_t lrb;
MMU2Serial *uart; ///< UART interface
MMU2Serial *uart; ///< UART interface
ErrorCode errorCode; ///< last received error code from the MMU
ErrorCode errorCode; ///< last received error code from the MMU
ProgressCode progressCode; ///< last received progress code from the MMU
Buttons buttonCode; ///< Last received button from the MMU.
Buttons buttonCode; ///< Last received button from the MMU.
uint8_t lastFSensor; ///< last state of filament sensor
uint8_t lastFSensor; ///< last state of filament sensor
#ifndef __AVR__
uint8_t txbuff[Protocol::MaxRequestSize()]; ///< In Buddy FW - a static transmit buffer needs to exist as DMA cannot be used from CCMRAM.

View File

@ -11,6 +11,7 @@
#include "ultralcd.h"
#include "Filament_sensor.h"
#include "language.h"
#include "lcd.h"
#include "temperature.h"
#include "sound.h"
@ -346,7 +347,7 @@ void TryLoadUnloadReporter::DumpToSerial(){
/// Disables MMU in EEPROM
void DisableMMUInSettings() {
eeprom_update_byte((uint8_t *)EEPROM_MMU_ENABLED, false);
eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false);
mmu2.Status();
}
@ -393,7 +394,7 @@ void FullScreenMsgLoad(uint8_t slot){
}
void FullScreenMsgRestoringTemperature(){
lcd_display_message_fullscreen_P(_i("MMU Retry: Restoring temperature...")); ////MSG_MMU_RESTORE_TEMP c=20 r=4
lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP));
}
void ScreenUpdateEnable(){
@ -455,7 +456,7 @@ void tuneIdlerStallguardThresholdMenu() {
);
MENU_ITEM_BACK_P(_T(MSG_DONE));
MENU_ITEM_EDIT_int3_P(
_i("Sensitivity"), ////MSG_MMU_SENSITIVITY c=18
_T(MSG_MMU_SENSITIVITY),
&_md->currentValue,
_md->item.minValue,
_md->item.maxValue
@ -464,6 +465,15 @@ void tuneIdlerStallguardThresholdMenu() {
}
void tuneIdlerStallguardThreshold() {
if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand)
{
// Workaround to mitigate an issue where the Tune menu doesn't
// work if the MMU is running a command. For example the Idler
// homing fails during toolchange.
// To save the print, make the Tune button unresponsive for now.
return;
}
putErrorScreenToSleep = true;
menu_submenu(tuneIdlerStallguardThresholdMenu);
}

View File

@ -13,9 +13,12 @@ namespace MMU2 {
/// When the printer's FW starts, the MMU mode is either Stopped or NotResponding (based on user's preference).
/// When the MMU successfully establishes communication, the state changes to Active.
enum class xState : uint_fast8_t {
Active, ///< MMU has been detected, connected, communicates and is ready to be worked with.
/// The user doesn't want the printer to work with the MMU. The MMU itself is not powered and does not work at all.
/// !!! Must be 0 !!! marlin_vars.mmu2_state is set to 0 if not active
Stopped,
Active, ///< MMU has been detected, connected, communicates and is ready to be worked with.
Connecting, ///< MMU is connected but it doesn't communicate (yet). The user wants the MMU, but it is not ready to be worked with.
Stopped ///< The user doesn't want the printer to work with the MMU. The MMU itself is not powered and does not work at all.
};
} // namespace MMU2

View File

@ -5,6 +5,6 @@ namespace MMU2 {
static constexpr uint8_t mmuVersionMajor = 3;
static constexpr uint8_t mmuVersionMinor = 0;
static constexpr uint8_t mmuVersionPatch = 1;
static constexpr uint8_t mmuVersionPatch = 3;
} // namespace MMU2

View File

@ -56,7 +56,7 @@ void mc_arc(const float* position, float* target, const float* offset, float fee
if (cs.arc_segments_per_sec > 0)
{
// 20200417 - FormerLurker - Implement MIN_ARC_SEGMENTS if it is defined - from Marlin 2.0 implementation
float mm_per_arc_segment_sec = (feed_rate / 60.0f) * (1.0f / cs.arc_segments_per_sec);
float mm_per_arc_segment_sec = feed_rate / (60.f * float(cs.arc_segments_per_sec));
if (mm_per_arc_segment_sec < mm_per_arc_segment)
mm_per_arc_segment = mm_per_arc_segment_sec;
}

View File

@ -3,8 +3,6 @@
#include "boards.h"
#define LARGE_FLASH true
/*****************************************************************
* Rambo Pin Assignments 1.3
******************************************************************/

View File

@ -57,6 +57,7 @@
#include "temperature.h"
#include "fancheck.h"
#include "ultralcd.h"
#include "lcd.h"
#include "language.h"
#include "ConfigurationStore.h"
@ -84,15 +85,6 @@ float* max_feedrate = cs.max_feedrate_normal;
uint32_t* max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal;
uint32_t max_acceleration_steps_per_s2[NUM_AXIS];
#ifdef ENABLE_AUTO_BED_LEVELING
// this holds the required transform to compensate for bed level
matrix_3x3 plan_bed_level_matrix = {
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0,
};
#endif // #ifdef ENABLE_AUTO_BED_LEVELING
// The current position of the tool in absolute steps
long position[NUM_AXIS]; //rescaled from extern when axis_steps_per_mm are changed by gcode
static float previous_speed[NUM_AXIS]; // Speed of previous path line segment
@ -123,7 +115,7 @@ static uint8_t g_cntr_planner_queue_min = 0;
//===========================================================================
#ifdef PREVENT_DANGEROUS_EXTRUDE
int extrude_min_temp = EXTRUDE_MINTEMP;
#endif
#endif //PREVENT_DANGEROUS_EXTRUDE
#ifdef LIN_ADVANCE
float extruder_advance_K = LA_K_DEF;
@ -757,53 +749,8 @@ void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate
plan_reset_next_e_sched = true;
}
#ifdef ENABLE_AUTO_BED_LEVELING
apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
#endif // ENABLE_AUTO_BED_LEVELING
// Apply the machine correction matrix.
{
#if 0
SERIAL_ECHOPGM("Planner, current position - servos: ");
MYSERIAL.print(st_get_position_mm(X_AXIS), 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(st_get_position_mm(Y_AXIS), 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(st_get_position_mm(Z_AXIS), 5);
SERIAL_ECHOLNPGM("");
SERIAL_ECHOPGM("Planner, target position, initial: ");
MYSERIAL.print(x, 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(y, 5);
SERIAL_ECHOLNPGM("");
SERIAL_ECHOPGM("Planner, world2machine: ");
MYSERIAL.print(world2machine_rotation_and_skew[0][0], 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(world2machine_rotation_and_skew[0][1], 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(world2machine_rotation_and_skew[1][0], 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(world2machine_rotation_and_skew[1][1], 5);
SERIAL_ECHOLNPGM("");
SERIAL_ECHOPGM("Planner, offset: ");
MYSERIAL.print(world2machine_shift[0], 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(world2machine_shift[1], 5);
SERIAL_ECHOLNPGM("");
#endif
world2machine(x, y);
#if 0
SERIAL_ECHOPGM("Planner, target position, corrected: ");
MYSERIAL.print(x, 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(y, 5);
SERIAL_ECHOLNPGM("");
#endif
}
// Apply the machine correction matrix.
world2machine(x, y);
// The target position of the tool in absolute steps
// Calculate target position in absolute steps
@ -856,7 +803,7 @@ void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate
}
#endif
}
#endif
#endif //PREVENT_DANGEROUS_EXTRUDE
// Number of steps for each axis
#ifndef COREXY
@ -1291,27 +1238,8 @@ Having the real displacement of the head, we can calculate the total movement le
ENABLE_STEPPER_DRIVER_INTERRUPT();
}
#ifdef ENABLE_AUTO_BED_LEVELING
vector_3 plan_get_position() {
vector_3 position = vector_3(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS), st_get_position_mm(Z_AXIS));
//position.debug("in plan_get position");
//plan_bed_level_matrix.debug("in plan_get bed_level");
matrix_3x3 inverse = matrix_3x3::transpose(plan_bed_level_matrix);
//inverse.debug("in plan_get inverse");
position.apply_rotation(inverse);
//position.debug("after rotation");
return position;
}
#endif // ENABLE_AUTO_BED_LEVELING
void plan_set_position(float x, float y, float z, const float &e)
{
#ifdef ENABLE_AUTO_BED_LEVELING
apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
#endif // ENABLE_AUTO_BED_LEVELING
world2machine(x, y);
position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]);
@ -1364,7 +1292,7 @@ void set_extrude_min_temp(int temp)
{
extrude_min_temp = temp;
}
#endif
#endif //PREVENT_DANGEROUS_EXTRUDE
// Calculate the steps/s^2 acceleration rates, based on the mm/s^s
void reset_acceleration_rates()

View File

@ -26,10 +26,6 @@
#include "Marlin.h"
#ifdef ENABLE_AUTO_BED_LEVELING
#include "vector_3.h"
#endif // ENABLE_AUTO_BED_LEVELING
enum BlockFlag {
// Planner flag to recalculate trapezoids on entry junction.
// This flag has an optimization purpose only.
@ -130,24 +126,9 @@ typedef struct {
extern float extruder_advance_K; // Linear-advance K factor
#endif
#ifdef ENABLE_AUTO_BED_LEVELING
// this holds the required transform to compensate for bed level
extern matrix_3x3 plan_bed_level_matrix;
#endif // #ifdef ENABLE_AUTO_BED_LEVELING
// Initialize the motion plan subsystem
void plan_init();
// Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in
// millimaters. Feed rate specifies the speed of the motion.
#ifdef ENABLE_AUTO_BED_LEVELING
void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate);
// Get the position applying the bed level matrix if enabled
vector_3 plan_get_position();
#else
/// Extracting common call of
/// plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], ...
/// saves almost 5KB.
@ -159,15 +140,9 @@ void plan_buffer_line_destinationXYZE(float feed_rate);
void plan_set_position_curposXYZE();
void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const float* gcode_start_position = NULL, uint16_t segment_idx = 0);
//void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder);
#endif // ENABLE_AUTO_BED_LEVELING
// Set position. Used for G92 instructions.
//#ifdef ENABLE_AUTO_BED_LEVELING
void plan_set_position(float x, float y, float z, const float &e);
//#else
//void plan_set_position(const float &x, const float &y, const float &z, const float &e);
//#endif // ENABLE_AUTO_BED_LEVELING
void plan_set_z_position(const float &z);
void plan_set_e_position(const float &e);
@ -266,7 +241,7 @@ extern bool planner_aborted;
#ifdef PREVENT_DANGEROUS_EXTRUDE
extern int extrude_min_temp;
void set_extrude_min_temp(int temp);
#endif
#endif //PREVENT_DANGEROUS_EXTRUDE
void reset_acceleration_rates();
#endif

View File

@ -41,7 +41,7 @@ void uvlo_() {
unsigned long time_start = _millis();
// True if a print is already saved to RAM
const bool sd_print_saved_in_ram = saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD);
const bool print_saved_in_ram = saved_printing && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE);
const bool pos_invalid = mesh_bed_leveling_flag || homing_flag;
// Conserve as much power as soon as possible
@ -66,7 +66,7 @@ void uvlo_() {
tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]);
#endif //TMC2130
if (!sd_print_saved_in_ram && !isPartialBackupAvailable)
if (!print_saved_in_ram && !isPartialBackupAvailable)
{
saved_bed_temperature = target_temperature_bed;
saved_extruder_temperature = target_temperature[active_extruder];
@ -78,7 +78,7 @@ void uvlo_() {
disable_heater();
// Fetch data not included in a partial back-up
if (!sd_print_saved_in_ram) {
if (!print_saved_in_ram) {
// Calculate the file position, from which to resume this print.
save_print_file_state();
@ -99,7 +99,7 @@ void uvlo_() {
// When there is no position already saved, then we must grab whatever the current position is.
// This is most likely a position where the printer is in the middle of a G-code move
if (!sd_print_saved_in_ram && !isPartialBackupAvailable)
if (!print_saved_in_ram && !isPartialBackupAvailable)
{
memcpy(saved_pos, current_position, sizeof(saved_pos));
if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID;
@ -113,11 +113,11 @@ void uvlo_() {
// mesh bed leveling offset value.
logical_z -= mbl.get_z(saved_pos[X_AXIS], saved_pos[Y_AXIS]);
}
eeprom_update_float((float*)EEPROM_UVLO_CURRENT_POSITION_Z, logical_z);
eeprom_update_float_notify((float*)EEPROM_UVLO_CURRENT_POSITION_Z, logical_z);
// Store the print E position before we lose track
eeprom_update_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E), saved_pos[E_AXIS]);
eeprom_update_byte((uint8_t*)EEPROM_UVLO_E_ABS, !saved_extruder_relative_mode);
eeprom_update_float_notify((float*)(EEPROM_UVLO_CURRENT_POSITION_E), saved_pos[E_AXIS]);
eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_E_ABS, !saved_extruder_relative_mode);
// Clean the input command queue, inhibit serial processing using saved_printing
cmdqueue_reset();
@ -149,7 +149,7 @@ void uvlo_() {
poweroff_z();
// Write the file position.
eeprom_update_dword((uint32_t*)(EEPROM_FILE_POSITION), saved_sdpos);
eeprom_update_dword_notify((uint32_t*)(EEPROM_FILE_POSITION), saved_sdpos);
// Store the mesh bed leveling offsets. This is 2*7*7=98 bytes, which takes 98*3.4us=333us in worst case.
for (uint8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point)
@ -158,41 +158,56 @@ void uvlo_() {
uint8_t iy = mesh_point / MESH_NUM_X_POINTS;
// Scale the z value to 1u resolution.
int16_t v = mbl_was_active ? int16_t(floor(mbl.z_values[iy][ix] * 1000.f + 0.5f)) : 0;
eeprom_update_word((uint16_t*)(EEPROM_UVLO_MESH_BED_LEVELING_FULL +2*mesh_point), *reinterpret_cast<uint16_t*>(&v));
eeprom_update_word_notify((uint16_t*)(EEPROM_UVLO_MESH_BED_LEVELING_FULL +2*mesh_point), *reinterpret_cast<uint16_t*>(&v));
}
// Write the _final_ Z position
eeprom_update_float((float*)EEPROM_UVLO_TINY_CURRENT_POSITION_Z, current_position[Z_AXIS]);
eeprom_update_float_notify((float*)EEPROM_UVLO_TINY_CURRENT_POSITION_Z, current_position[Z_AXIS]);
// Store the current position.
eeprom_update_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 0), saved_pos[X_AXIS]);
eeprom_update_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4), saved_pos[Y_AXIS]);
eeprom_update_float_notify((float*)(EEPROM_UVLO_CURRENT_POSITION + 0), saved_pos[X_AXIS]);
eeprom_update_float_notify((float*)(EEPROM_UVLO_CURRENT_POSITION + 4), saved_pos[Y_AXIS]);
// Store the current feed rate, temperatures, fan speed and extruder multipliers (flow rates)
eeprom_update_word((uint16_t*)EEPROM_UVLO_FEEDRATE, saved_feedrate2);
eeprom_update_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY, feedmultiply);
eeprom_update_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND, saved_extruder_temperature);
eeprom_update_byte((uint8_t*)EEPROM_UVLO_TARGET_BED, saved_bed_temperature);
eeprom_update_byte((uint8_t*)EEPROM_UVLO_FAN_SPEED, saved_fan_speed);
eeprom_update_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0), extruder_multiplier[0]);
eeprom_update_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY), (uint16_t)extrudemultiply);
eeprom_update_word_notify((uint16_t*)EEPROM_UVLO_FEEDRATE, saved_feedrate2);
eeprom_update_word_notify((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY, feedmultiply);
eeprom_update_word_notify((uint16_t*)EEPROM_UVLO_TARGET_HOTEND, saved_extruder_temperature);
eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_TARGET_BED, saved_bed_temperature);
eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_FAN_SPEED, saved_fan_speed);
eeprom_update_float_notify((float*)(EEPROM_EXTRUDER_MULTIPLIER_0), extruder_multiplier[0]);
eeprom_update_word_notify((uint16_t*)(EEPROM_EXTRUDEMULTIPLY), (uint16_t)extrudemultiply);
eeprom_update_float((float*)(EEPROM_UVLO_ACCELL), cs.acceleration);
eeprom_update_float((float*)(EEPROM_UVLO_RETRACT_ACCELL), cs.retract_acceleration);
eeprom_update_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL), cs.travel_acceleration);
eeprom_update_float_notify((float*)(EEPROM_UVLO_ACCELL), cs.acceleration);
eeprom_update_float_notify((float*)(EEPROM_UVLO_RETRACT_ACCELL), cs.retract_acceleration);
eeprom_update_float_notify((float*)(EEPROM_UVLO_TRAVEL_ACCELL), cs.travel_acceleration);
// Store the saved target
eeprom_update_block(saved_start_position, (float *)EEPROM_UVLO_SAVED_START_POSITION, sizeof(saved_start_position));
eeprom_update_block_notify(saved_start_position, (float *)EEPROM_UVLO_SAVED_START_POSITION, sizeof(saved_start_position));
eeprom_update_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX, saved_segment_idx);
eeprom_update_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE, saved_printing_type);
eeprom_update_word_notify((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX, saved_segment_idx);
eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_PRINT_TYPE, saved_printing_type);
#ifdef LIN_ADVANCE
eeprom_update_float((float*)(EEPROM_UVLO_LA_K), extruder_advance_K);
eeprom_update_float_notify((float*)(EEPROM_UVLO_LA_K), extruder_advance_K);
#endif
#ifdef PREVENT_DANGEROUS_EXTRUDE
eeprom_update_word_notify((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP, extrude_min_temp);
#endif //PREVENT_DANGEROUS_EXTRUDE
eeprom_update_block_notify(cs.max_acceleration_mm_per_s2_normal, (uint32_t *)EEPROM_UVLO_ACCELL_MM_S2_NORMAL, sizeof(cs.max_acceleration_mm_per_s2_normal));
eeprom_update_block_notify(cs.max_acceleration_mm_per_s2_silent, (uint32_t *)EEPROM_UVLO_ACCELL_MM_S2_SILENT, sizeof(cs.max_acceleration_mm_per_s2_silent));
eeprom_update_block_notify(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal));
eeprom_update_block_notify(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent));
eeprom_update_float_notify((float *)(EEPROM_UVLO_MIN_FEEDRATE), cs.minimumfeedrate);
eeprom_update_float_notify((float *)(EEPROM_UVLO_MIN_TRAVEL_FEEDRATE), cs.mintravelfeedrate);
eeprom_update_dword_notify((uint32_t *)(EEPROM_UVLO_MIN_SEGMENT_TIME_US), cs.min_segment_time_us);
eeprom_update_block_notify(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk));
// Finally store the "power outage" flag.
eeprom_update_byte((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY);
if (did_pause_print) {
eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_Z_LIFTED, 1);
}
eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY);
// Increment power failure counter
eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT);
@ -260,11 +275,11 @@ static void uvlo_tiny() {
poweroff_z();
// Update Z position
eeprom_update_float((float*)(EEPROM_UVLO_TINY_CURRENT_POSITION_Z), current_position[Z_AXIS]);
eeprom_update_float_notify((float*)(EEPROM_UVLO_TINY_CURRENT_POSITION_Z), current_position[Z_AXIS]);
}
// Update the the "power outage" flag.
eeprom_update_byte((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY_RETRY);
eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY_RETRY);
// Increment power failure counter
eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT);
@ -286,7 +301,7 @@ void setup_uvlo_interrupt() {
EIMSK |= (1 << 4);
// check if power was lost before we armed the interrupt
if(!(PINE & (1 << 4)) && eeprom_read_byte((uint8_t*)EEPROM_UVLO) != PowerPanic::NO_PENDING_RECOVERY)
if(!(PINE & (1 << 4)) && printer_recovering())
{
SERIAL_ECHOLNRPGM(MSG_INT4);
uvlo_drain_reset();
@ -310,16 +325,22 @@ ISR(INT4_vect) {
}
void recover_print(uint8_t automatic) {
lcd_setstatuspgm(_i("Recovering print"));////MSG_RECOVERING_PRINT c=20
lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT));
// Recover position, temperatures and extrude_multipliers
bool mbl_was_active = recover_machine_state_after_power_panic();
// Lift the print head 25mm, first to avoid collisions with oozed material with the print,
// and second also so one may remove the excess priming material.
if(eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::PENDING_RECOVERY)
{
enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + 25);
// Undo PP Z Lift by setting current Z pos to + Z_PAUSE_LIFT
// With first PP or Pause + PP the Z has been already lift.
// After a reboot the printer doesn't know the Z height and we have to set its previous value
if(eeprom_read_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED) == 1 ) {
current_position[Z_AXIS] += Z_PAUSE_LIFT;
}
// Lift the print head ONCE plus Z_PAUSE_LIFT first to avoid collisions with oozed material with the print,
if(eeprom_read_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED) == 0) {
enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT);
eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_Z_LIFTED, 1);
}
// Home X and Y axes. Homing just X and Y shall not touch the babystep and the world2machine
@ -328,7 +349,10 @@ void recover_print(uint8_t automatic) {
// Set the target bed and nozzle temperatures and wait.
enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]);
enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed);
enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]);
//No need to wait for hotend heatup while host printing, as print will pause and wait for host.
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) {
enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]);
}
enquecommand_P(MSG_M83); //E axis relative mode
// If not automatically recoreverd (long power loss)
@ -410,39 +434,20 @@ bool recover_machine_state_after_power_panic() {
extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K);
#endif
#ifdef PREVENT_DANGEROUS_EXTRUDE
extrude_min_temp = eeprom_read_word((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP);
#endif //PREVENT_DANGEROUS_EXTRUDE
eeprom_read_block(cs.max_acceleration_mm_per_s2_normal, (uint32_t *)EEPROM_UVLO_ACCELL_MM_S2_NORMAL, sizeof(cs.max_acceleration_mm_per_s2_normal));
eeprom_read_block(cs.max_acceleration_mm_per_s2_silent, (uint32_t *)EEPROM_UVLO_ACCELL_MM_S2_SILENT, sizeof(cs.max_acceleration_mm_per_s2_silent));
eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal));
eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent));
cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE);
cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE);
cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US);
eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk));
return mbl_was_active;
}
/// @brief Read saved filename from EEPROM and send g-code command: M23 <filename>
void restore_file_from_sd()
{
char filename[FILENAME_LENGTH];
char dir_name[9];
char extension_ptr[5];
uint8_t depth = eeprom_read_byte((uint8_t*)EEPROM_DIR_DEPTH);
for (uint8_t i = 0; i < depth; i++) {
eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8);
dir_name[8] = '\0';
card.chdir(dir_name, false);
}
// Recover DOS 8.3 filename without extension.
// Short filenames are always null terminated.
eeprom_read_block(filename, (const char *)EEPROM_FILENAME, 8);
// Add null delimiter in case all 8 characters were not NULL
filename[8] = '\0';
// Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g"
extension_ptr[0] = '.';
eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3);
extension_ptr[4] = '\0';
strcat(filename, extension_ptr);
enquecommandf_P(MSG_M23, filename);
}
void restore_print_from_eeprom(bool mbl_was_active) {
int feedrate_rec;
int feedmultiply_rec;
@ -456,7 +461,7 @@ void restore_print_from_eeprom(bool mbl_was_active) {
SERIAL_ECHOPGM(", feedmultiply:");
MYSERIAL.println(feedmultiply_rec);
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD)
if (saved_printing_type == PowerPanic::PRINT_TYPE_SD)
{ // M23
restore_file_from_sd();
}
@ -498,12 +503,12 @@ void restore_print_from_eeprom(bool mbl_was_active) {
// SD: Position in file, USB: g-code line number
uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION));
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD)
if (saved_printing_type == PowerPanic::PRINT_TYPE_SD)
{
// Set a position in the file.
enquecommandf_P(PSTR("M26 S%lu"), position);
}
else if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_USB)
else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST)
{
// Set line number
enquecommandf_P(PSTR("M110 N%lu"), position);
@ -512,4 +517,5 @@ void restore_print_from_eeprom(bool mbl_was_active) {
enquecommand_P(PSTR("G4 S0"));
enquecommand_P(PSTR("PRUSA uvlo"));
}
#endif //UVLO_SUPPORT

View File

@ -10,7 +10,7 @@ enum PowerPanicFlag : uint8_t {
// Types of printjobs possible when power panic is triggered
enum PrintType : uint8_t {
PRINT_TYPE_SD = 0,
PRINT_TYPE_USB = 1,
PRINT_TYPE_HOST = 1,
PRINT_TYPE_NONE = 2,
};
} // namespace PowerPanic

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
#include "Configuration.h"
#ifdef AUTO_BED_LEVELING_GRID
void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy );
double ddot ( int n, double dx[], int incx, double dy[], int incy );
double dnrm2 ( int n, double x[], int incx );
void dqrank ( double a[], int lda, int m, int n, double tol, int *kr,
int jpvt[], double qraux[] );
void dqrdc ( double a[], int lda, int n, int p, double qraux[], int jpvt[],
double work[], int job );
int dqrls ( double a[], int lda, int m, int n, double tol, int *kr, double b[],
double x[], double rsd[], int jpvt[], double qraux[], int itask );
void dqrlss ( double a[], int lda, int m, int n, int kr, double b[], double x[],
double rsd[], int jpvt[], double qraux[] );
int dqrsl ( double a[], int lda, int n, int k, double qraux[], double y[],
double qy[], double qty[], double b[], double rsd[], double ab[], int job );
void dscal ( int n, double sa, double x[], int incx );
void dswap ( int n, double x[], int incx, double y[], int incy );
double *qr_solve ( int m, int n, double a[], double b[] );
#endif

View File

@ -1,5 +1,4 @@
//sm4.c - simple 4-axis stepper control
//sm4.cpp - simple 4-axis stepper control
#include "sm4.h"
#include <avr/io.h>
#include <avr/pgmspace.h>
@ -49,28 +48,6 @@ sm4_update_pos_cb_t sm4_update_pos_cb = 0;
sm4_calc_delay_cb_t sm4_calc_delay_cb = 0;
uint16_t sm4_cpu_time = 0;
uint8_t sm4_get_dir(uint8_t axis)
{
switch (axis)
{
#if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
case 0: return (PORTL & 2)?XDIR;
case 1: return (PORTL & 1)?YDIR;
case 2: return (PORTL & 4)?ZDIR;
case 3: return (PORTL & 64)?EDIR;
#elif ((MOTHERBOARD == BOARD_EINSY_1_0a))
case 0: return (PORTL & 1)?XDIR;
case 1: return (PORTL & 2)?YDIR;
case 2: return (PORTL & 4)?ZDIR;
case 3: return (PORTL & 64)?EDIR;
#endif
}
return 0;
}
void sm4_set_dir(uint8_t axis, uint8_t dir)
{
switch (axis)
@ -90,30 +67,9 @@ void sm4_set_dir(uint8_t axis, uint8_t dir)
asm("nop");
}
uint8_t sm4_get_dir_bits(void)
{
register uint8_t dir_bits = 0;
register uint8_t portL = PORTL;
//TODO -optimize in asm
#if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
if (portL & 2) dir_bits |= 1;
if (portL & 1) dir_bits |= 2;
if (portL & 4) dir_bits |= 4;
if (portL & 64) dir_bits |= 8;
dir_bits ^= dir_mask;
#elif ((MOTHERBOARD == BOARD_EINSY_1_0a))
if (portL & 1) dir_bits |= 1;
if (portL & 2) dir_bits |= 2;
if (portL & 4) dir_bits |= 4;
if (portL & 64) dir_bits |= 8;
dir_bits ^= dir_mask;
#endif
return dir_bits;
}
void sm4_set_dir_bits(uint8_t dir_bits)
{
register uint8_t portL = PORTL;
uint8_t portL = PORTL;
portL &= 0xb8; //set direction bits to zero
//TODO -optimize in asm
#if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
@ -139,7 +95,7 @@ void sm4_do_step(uint8_t axes_mask)
#ifdef TMC2130_DEDGE_STEPPING
PINC = (axes_mask & 0x0f); // toggle step signals by mask
#else
register uint8_t portC = PORTC & 0xf0;
uint8_t portC = PORTC & 0xf0;
PORTC = portC | (axes_mask & 0x0f); //set step signals by mask
asm("nop");
PORTC = portC; //set step signals to zero
@ -148,60 +104,6 @@ void sm4_do_step(uint8_t axes_mask)
#endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a))
}
uint16_t sm4_line_xyze_ui(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t de)
{
uint16_t dd = (uint16_t)(sqrt((float)(((uint32_t)dx)*dx + ((uint32_t)dy*dy) + ((uint32_t)dz*dz) + ((uint32_t)de*de))) + 0.5);
uint16_t nd = dd;
uint16_t cx = dd;
uint16_t cy = dd;
uint16_t cz = dd;
uint16_t ce = dd;
uint16_t x = 0;
uint16_t y = 0;
uint16_t z = 0;
uint16_t e = 0;
while (nd)
{
if (sm4_stop_cb && (*sm4_stop_cb)()) break;
uint8_t sm = 0; //step mask
if (cx <= dx)
{
sm |= 1;
cx += dd;
x++;
}
if (cy <= dy)
{
sm |= 2;
cy += dd;
y++;
}
if (cz <= dz)
{
sm |= 4;
cz += dd;
z++;
}
if (ce <= de)
{
sm |= 8;
ce += dd;
e++;
}
cx -= dx;
cy -= dy;
cz -= dz;
ce -= de;
sm4_do_step(sm);
uint16_t delay = SM4_DEFDELAY;
if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd);
if (delay) delayMicroseconds(delay);
nd--;
}
if (sm4_update_pos_cb) (*sm4_update_pos_cb)(x, y, z, e);
return nd;
}
uint16_t sm4_line_xyz_ui(uint16_t dx, uint16_t dy, uint16_t dz){
uint16_t dd = (uint16_t)(sqrt((float)(((uint32_t)dx)*dx + ((uint32_t)dy*dy) + ((uint32_t)dz*dz))) + 0.5);
uint16_t nd = dd;

View File

@ -5,12 +5,6 @@
#include <inttypes.h>
#include "config.h"
#if defined(__cplusplus)
extern "C" {
#endif //defined(__cplusplus)
// callback prototype for stop condition (return 0 - continue, return 1 - stop)
typedef uint8_t (*sm4_stop_cb_t)();
@ -30,16 +24,9 @@ extern sm4_update_pos_cb_t sm4_update_pos_cb;
// callback pointer - calc_delay
extern sm4_calc_delay_cb_t sm4_calc_delay_cb;
// returns direction for single axis (0 - positive, 1 - negative)
extern uint8_t sm4_get_dir(uint8_t axis);
// set direction for single axis (0 - positive, 1 - negative)
extern void sm4_set_dir(uint8_t axis, uint8_t dir);
// returns direction of all axes as bitmask (0 - positive, 1 - negative)
extern uint8_t sm4_get_dir_bits(void);
// set direction for all axes as bitmask (0 - positive, 1 - negative)
extern void sm4_set_dir_bits(uint8_t dir_bits);
@ -47,11 +34,6 @@ extern void sm4_set_dir_bits(uint8_t dir_bits);
extern void sm4_do_step(uint8_t axes_mask);
// xyze linear-interpolated relative move, returns remaining diagonal steps (>0 means stoped)
extern uint16_t sm4_line_xyze_ui(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t de);
extern uint16_t sm4_line_xyz_ui(uint16_t dx, uint16_t dy, uint16_t dz);
#if defined(__cplusplus)
}
#endif //defined(__cplusplus)
#endif //_SM4_H

View File

@ -30,7 +30,7 @@ void Sound_Init(void)
void Sound_SaveMode(void)
{
eeprom_update_byte((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode);
eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode);
}
void Sound_CycleState(void)

View File

@ -26,6 +26,7 @@
#include "planner.h"
#include "temperature.h"
#include "ultralcd.h"
#include "lcd.h"
#include "cardreader.h"
#include "speed_lookuptable.h"
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
@ -58,14 +59,6 @@ uint16_t SP_min = 0x21FF;
#ifdef DEBUG_YSTEP_DUP_PIN
#define _STEP_PIN_Y_DUP_AXIS DEBUG_YSTEP_DUP_PIN
#endif
#ifdef Y_DUAL_STEPPER_DRIVERS
#error Y_DUAL_STEPPER_DRIVERS not fully implemented
#define _STEP_PIN_Y2_AXIS Y2_STEP_PIN
#endif
#ifdef Z_DUAL_STEPPER_DRIVERS
#error Z_DUAL_STEPPER_DRIVERS not fully implemented
#define _STEP_PIN_Z2_AXIS Z2_STEP_PIN
#endif
#ifdef TMC2130
#define STEPPER_MINIMUM_PULSE TMC2130_MINIMUM_PULSE
@ -1078,17 +1071,9 @@ void st_init()
#endif
#if defined(Y_DIR_PIN) && Y_DIR_PIN > -1
SET_OUTPUT(Y_DIR_PIN);
#if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_DIR_PIN) && (Y2_DIR_PIN > -1)
SET_OUTPUT(Y2_DIR_PIN);
#endif
#endif
#if defined(Z_DIR_PIN) && Z_DIR_PIN > -1
SET_OUTPUT(Z_DIR_PIN);
#if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_DIR_PIN) && (Z2_DIR_PIN > -1)
SET_OUTPUT(Z2_DIR_PIN);
#endif
#endif
#if defined(E0_DIR_PIN) && E0_DIR_PIN > -1
SET_OUTPUT(E0_DIR_PIN);
@ -1107,20 +1092,10 @@ void st_init()
#if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
SET_OUTPUT(Y_ENABLE_PIN);
if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
#if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_ENABLE_PIN) && (Y2_ENABLE_PIN > -1)
SET_OUTPUT(Y2_ENABLE_PIN);
if(!Y_ENABLE_ON) WRITE(Y2_ENABLE_PIN,HIGH);
#endif
#endif
#if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1
SET_OUTPUT(Z_ENABLE_PIN);
if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH);
#if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_ENABLE_PIN) && (Z2_ENABLE_PIN > -1)
SET_OUTPUT(Z2_ENABLE_PIN);
if(!Z_ENABLE_ON) WRITE(Z2_ENABLE_PIN,HIGH);
#endif
#endif
#if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1)
SET_OUTPUT(E0_ENABLE_PIN);
@ -1200,19 +1175,11 @@ void st_init()
SET_OUTPUT(DEBUG_YSTEP_DUP_PIN);
WRITE(DEBUG_YSTEP_DUP_PIN,INVERT_Y_STEP_PIN);
#endif //DEBUG_YSTEP_DUP_PIN
#if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_STEP_PIN) && (Y2_STEP_PIN > -1)
SET_OUTPUT(Y2_STEP_PIN);
WRITE(Y2_STEP_PIN,INVERT_Y_STEP_PIN);
#endif
disable_y();
#endif
#if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1)
SET_OUTPUT(Z_STEP_PIN);
WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN);
#if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_STEP_PIN) && (Z2_STEP_PIN > -1)
SET_OUTPUT(Z2_STEP_PIN);
WRITE(Z2_STEP_PIN,INVERT_Z_STEP_PIN);
#endif
#ifdef PSU_Delta
init_force_z();
#endif // PSU_Delta
@ -1372,7 +1339,7 @@ void babystep(const uint8_t axis,const bool direction)
case X_AXIS:
{
enable_x();
uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction.
uint8_t old_x_dir_pin = READ(X_DIR_PIN);
uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction;
//setup new step
@ -1400,7 +1367,7 @@ void babystep(const uint8_t axis,const bool direction)
case Y_AXIS:
{
enable_y();
uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction.
uint8_t old_y_dir_pin = READ(Y_DIR_PIN);
uint8_t new_y_dir_pin = (INVERT_Y_DIR)^direction;
//setup new step
@ -1428,35 +1395,23 @@ void babystep(const uint8_t axis,const bool direction)
case Z_AXIS:
{
enable_z();
uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction.
uint8_t old_z_dir_pin = READ(Z_DIR_PIN);
uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z;
//setup new step
if (new_z_dir_pin != old_z_dir_pin) {
WRITE_NC(Z_DIR_PIN, new_z_dir_pin);
#ifdef Z_DUAL_STEPPER_DRIVERS
WRITE_NC(Z2_DIR_PIN, new_z_dir_pin);
#endif
delayMicroseconds(STEPPER_SET_DIR_DELAY);
}
//perform step
STEP_NC_HI(Z_AXIS);
#ifdef Z_DUAL_STEPPER_DRIVERS
STEP_NC_HI(Z2_AXIS);
#endif
STEPPER_MINIMUM_DELAY;
STEP_NC_LO(Z_AXIS);
#ifdef Z_DUAL_STEPPER_DRIVERS
STEP_NC_LO(Z2_AXIS);
#endif
//get old pin state back.
if (new_z_dir_pin != old_z_dir_pin) {
WRITE_NC(Z_DIR_PIN, old_z_dir_pin);
#ifdef Z_DUAL_STEPPER_DRIVERS
WRITE_NC(Z2_DIR_PIN, old_z_dir_pin);
#endif
}
}
break;

View File

@ -36,6 +36,7 @@
#include "fancheck.h"
#include "messages.h"
#include "language.h"
#include "lcd.h"
#include "SdFatUtil.h"
@ -1147,25 +1148,6 @@ FORCE_INLINE static void soft_pwm_core()
#endif
} else WRITE(HEATER_0_PIN,0);
}
#if defined(HEATER_BED_PIN) && HEATER_BED_PIN > -1
#if 0 // @@DR vypnuto pro hw pwm bedu
// tuhle prasarnu bude potreba poustet ve stanovenych intervalech, jinak nemam moc sanci zareagovat
// teoreticky by se tato cast uz vubec nemusela poustet
if ((pwm_count & ((1 << HEATER_BED_SOFT_PWM_BITS) - 1)) == 0)
{
soft_pwm_b = soft_pwm_bed >> (7 - HEATER_BED_SOFT_PWM_BITS);
# ifndef SYSTEM_TIMER_2
// tady budu krokovat pomalou frekvenci na automatu - tohle je rizeni spinani a rozepinani
// jako ridici frekvenci mam 2khz, jako vystupni frekvenci mam 30hz
// 2kHz jsou ovsem ve slysitelnem pasmu, mozna bude potreba jit s frekvenci nahoru (a tomu taky prizpusobit ostatni veci)
// Teoreticky bych mohl stahnout OCR0B citac na 6, cimz bych se dostal nekam ke 40khz a tady potom honit PWM rychleji nebo i pomaleji
// to nicemu nevadi. Soft PWM scale by se 20x zvetsilo (no dobre, 16x), cimz by se to posunulo k puvodnimu 30Hz PWM
//if(soft_pwm_b > 0) WRITE(HEATER_BED_PIN,1); else WRITE(HEATER_BED_PIN,0);
# endif //SYSTEM_TIMER_2
}
#endif
#endif
#ifdef FAN_SOFT_PWM
if ((pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1)) == 0)
@ -1182,14 +1164,6 @@ FORCE_INLINE static void soft_pwm_core()
#endif
}
#if 0 // @@DR
#if defined(HEATER_BED_PIN) && HEATER_BED_PIN > -1
if (soft_pwm_b < (pwm_count & ((1 << HEATER_BED_SOFT_PWM_BITS) - 1))){
//WRITE(HEATER_BED_PIN,0);
}
//WRITE(HEATER_BED_PIN, pwm_count & 1 );
#endif
#endif
#ifdef FAN_SOFT_PWM
if (soft_pwm_fan < (pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1))) WRITE(FAN_PIN,0);
#endif
@ -2431,17 +2405,17 @@ void thermal_model_load_settings()
void thermal_model_save_settings()
{
eeprom_update_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE, thermal_model::enabled);
eeprom_update_float((float*)EEPROM_THERMAL_MODEL_P, thermal_model::data.P);
eeprom_update_float((float*)EEPROM_THERMAL_MODEL_U, thermal_model::data.U);
eeprom_update_float((float*)EEPROM_THERMAL_MODEL_V, thermal_model::data.V);
eeprom_update_float((float*)EEPROM_THERMAL_MODEL_C, thermal_model::data.C);
eeprom_update_float((float*)EEPROM_THERMAL_MODEL_D, thermal_model::data.fS);
eeprom_update_word((uint16_t*)EEPROM_THERMAL_MODEL_L, thermal_model::data.L);
eeprom_update_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float));
eeprom_update_float((float*)EEPROM_THERMAL_MODEL_Ta_corr, thermal_model::data.Ta_corr);
eeprom_update_float((float*)EEPROM_THERMAL_MODEL_W, thermal_model::data.warn);
eeprom_update_float((float*)EEPROM_THERMAL_MODEL_E, thermal_model::data.err);
eeprom_update_byte_notify((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE, thermal_model::enabled);
eeprom_update_float_notify((float*)EEPROM_THERMAL_MODEL_P, thermal_model::data.P);
eeprom_update_float_notify((float*)EEPROM_THERMAL_MODEL_U, thermal_model::data.U);
eeprom_update_float_notify((float*)EEPROM_THERMAL_MODEL_V, thermal_model::data.V);
eeprom_update_float_notify((float*)EEPROM_THERMAL_MODEL_C, thermal_model::data.C);
eeprom_update_float_notify((float*)EEPROM_THERMAL_MODEL_D, thermal_model::data.fS);
eeprom_update_word_notify((uint16_t*)EEPROM_THERMAL_MODEL_L, thermal_model::data.L);
eeprom_update_block_notify(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float));
eeprom_update_float_notify((float*)EEPROM_THERMAL_MODEL_Ta_corr, thermal_model::data.Ta_corr);
eeprom_update_float_notify((float*)EEPROM_THERMAL_MODEL_W, thermal_model::data.warn);
eeprom_update_float_notify((float*)EEPROM_THERMAL_MODEL_E, thermal_model::data.err);
}
namespace thermal_model_cal {

View File

@ -30,18 +30,25 @@ static constexpr uint8_t default_dedge_bit = 0;
//mode
uint8_t tmc2130_mode = TMC2130_MODE_NORMAL;
uint8_t tmc2130_current_h[4] = TMC2130_CURRENTS_H;
//running currents
uint8_t tmc2130_current_r[4] = TMC2130_CURRENTS_R;
static constexpr uint8_t tmc2130_default_current_h[4] = TMC2130_CURRENTS_H;
//running currents
static constexpr uint8_t tmc2130_default_current_r[4] = TMC2130_CURRENTS_R;
//running currents for homing
static uint8_t tmc2130_current_r_home[4] = TMC2130_CURRENTS_R_HOME;
static constexpr uint8_t tmc2130_current_r_home[4] = TMC2130_CURRENTS_R_HOME;
static constexpr MotorCurrents homing_currents_P[NUM_AXIS] PROGMEM = {
MotorCurrents(tmc2130_current_r_home[0], tmc2130_current_r_home[0]),
MotorCurrents(tmc2130_current_r_home[1], tmc2130_current_r_home[1]),
MotorCurrents(tmc2130_current_r_home[2], tmc2130_current_r_home[2]),
MotorCurrents(tmc2130_current_r_home[3], tmc2130_current_r_home[3])
};
MotorCurrents currents[NUM_AXIS] = {
MotorCurrents(tmc2130_current_r[0], tmc2130_current_h[0]),
MotorCurrents(tmc2130_current_r[1], tmc2130_current_h[1]),
MotorCurrents(tmc2130_current_r[2], tmc2130_current_h[2]),
MotorCurrents(tmc2130_current_r[3], tmc2130_current_h[3])
MotorCurrents(tmc2130_default_current_r[0], tmc2130_default_current_h[0]),
MotorCurrents(tmc2130_default_current_r[1], tmc2130_default_current_h[1]),
MotorCurrents(tmc2130_default_current_r[2], tmc2130_default_current_h[2]),
MotorCurrents(tmc2130_default_current_r[3], tmc2130_default_current_h[3])
};
union ChopConfU {
@ -422,8 +429,8 @@ void tmc2130_home_enter(uint8_t axes_mask)
tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL);
tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16));
tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, __tcoolthrs(axis));
currents[axis].setiRun(tmc2130_current_r_home[axis]);
tmc2130_setup_chopper(axis, tmc2130_mres[axis]);
MotorCurrents curr(homing_currents_P[axis]);
tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr);
tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull
}
}
@ -519,17 +526,12 @@ static constexpr bool getIntpolBit([[maybe_unused]]const uint8_t axis, const uin
return (mres != 0); // intpol to 256 only if microsteps aren't 256
}
static void SetCurrents(const uint8_t axis) {
uint8_t iHold = currents[axis].getiHold();
const uint8_t iRun = currents[axis].getiRun();
static void SetCurrents(const uint8_t axis, const MotorCurrents &curr) {
uint8_t iHold = curr.getiHold();
const uint8_t iRun = curr.getiRun();
// Make sure iHold never exceeds iRun at runtime
if (iHold > iRun) {
iHold = iRun;
// Update global array such that M913 reports correct values
currents[axis].setiHold(iRun);
if (curr.iHoldIsClamped()) {
// Let user know firmware modified the value
SERIAL_ECHO_START;
SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current"));
@ -551,11 +553,13 @@ static void SetCurrents(const uint8_t axis) {
};
IHoldRun ihold_irun(iHold, iRun);
#ifdef DEBUG_TMC_CURRENTS
printf_P(PSTR("SetCurrents(axis=%u, iHold=%u, iRun=%u, vsense=%u, reg=%08lX)\n"), axis, iHold, iRun, curr.getvSense(), ihold_irun.dw);
#endif //DEBUG_TMC_CURRENTS
tmc2130_wr(axis, TMC2130_REG_IHOLD_IRUN, ihold_irun.dw);
}
void tmc2130_setup_chopper(uint8_t axis, uint8_t mres)
void tmc2130_setup_chopper(uint8_t axis, uint8_t mres, const MotorCurrents *curr /* = nullptr */)
{
// Initialise the chopper configuration
ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres);
@ -567,30 +571,19 @@ void tmc2130_setup_chopper(uint8_t axis, uint8_t mres)
chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2
tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw);
SetCurrents(axis);
}
void tmc2130_set_current_h(uint8_t axis, uint8_t current)
{
// DBG(_n("tmc2130_set_current_h(axis=%d, current=%d\n"), axis, current);
currents[axis].setiHold(current);
tmc2130_setup_chopper(axis, tmc2130_mres[axis]);
}
void tmc2130_set_current_r(uint8_t axis, uint8_t current)
{
// DBG(_n("tmc2130_set_current_r(axis=%d, current=%d\n"), axis, current);
currents[axis].setiRun(current);
tmc2130_setup_chopper(axis, tmc2130_mres[axis]);
if (curr == nullptr) {
curr = &currents[axis];
}
SetCurrents(axis, *curr);
}
void tmc2130_print_currents()
{
printf_P(_n("tmc2130_print_currents()\n\tH\tR\nX\t%d\t%d\nY\t%d\t%d\nZ\t%d\t%d\nE\t%d\t%d\n"),
currents[0].getiHold(), currents[0].getiRun(),
currents[1].getiHold(), currents[1].getiRun(),
currents[2].getiHold(), currents[2].getiRun(),
currents[3].getiHold(), currents[3].getiRun()
currents[0].getOriginaliHold(), currents[0].getOriginaliRun(),
currents[1].getOriginaliHold(), currents[1].getOriginaliRun(),
currents[2].getOriginaliHold(), currents[2].getOriginaliRun(),
currents[3].getOriginaliHold(), currents[3].getOriginaliRun()
);
}
@ -1039,8 +1032,8 @@ bool tmc2130_home_calibrate(uint8_t axis)
bubblesort_uint8(cnt, cl, val);
tmc2130_home_origin[axis] = val[cl-1];
printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]);
if (axis == X_AXIS) eeprom_update_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]);
else if (axis == Y_AXIS) eeprom_update_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]);
if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]);
else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]);
return true;
}

View File

@ -95,13 +95,19 @@ struct MotorCurrents {
}
}
// PROGMEM initializer
inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); }
constexpr inline __attribute__((always_inline)) MotorCurrents(uint8_t ir, uint8_t ih)
: vSense((ir < 32) ? 1 : 0)
, iRun((ir < 32) ? ir : (ir >> 1))
, iHold((ir < 32) ? ih : (ih >> 1)) {}
inline uint8_t getiRun() const { return iRun; }
inline uint8_t getiHold() const { return iHold; }
inline uint8_t getiHold() const { return min(iHold, iRun); }
inline uint8_t getOriginaliRun() const { return vSense ? iRun : iRun << 1; }
inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); }
inline bool iHoldIsClamped() const { return iHold > iRun; }
inline uint8_t getvSense() const { return vSense; }
void __attribute__((noinline)) setiRun(uint8_t ir) {
@ -165,12 +171,8 @@ extern uint16_t tmc2130_sg_measure_stop();
// Enable or Disable crash detection according to EEPROM
void crashdet_use_eeprom_setting();
extern void tmc2130_setup_chopper(uint8_t axis, uint8_t mres);
extern void tmc2130_setup_chopper(uint8_t axis, uint8_t mres, const MotorCurrents *curr = nullptr);
//set holding current for any axis (M911)
extern void tmc2130_set_current_h(uint8_t axis, uint8_t current);
//set running current for any axis (M912)
extern void tmc2130_set_current_r(uint8_t axis, uint8_t current);
//print currents (M913)
extern void tmc2130_print_currents();

View File

@ -1,85 +0,0 @@
//uart2.c
#include "uart2.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "rbuf.h"
#include "macros.h"
#define UART2_BAUD 115200
#define UART_BAUD_SELECT(baudRate,xtalCpu) (((float)(xtalCpu))/(((float)(baudRate))*8.0)-1.0+0.5)
#define uart2_rxcomplete (UCSR2A & (1 << RXC2))
#define uart2_txcomplete (UCSR2A & (1 << TXC2))
#define uart2_txready (UCSR2A & (1 << UDRE2))
uint8_t uart2_ibuf[20] = {0, 0};
FILE _uart2io = {0};
int uart2_putchar(char c, _UNUSED FILE *stream)
{
while (!uart2_txready);
UDR2 = c; // transmit byte
// while (!uart2_txcomplete); // wait until byte sent
// UCSR2A |= (1 << TXC2); // delete TXCflag
return 0;
}
int uart2_getchar(_UNUSED FILE *stream)
{
if (rbuf_empty(uart2_ibuf)) return -1;
return rbuf_get(uart2_ibuf);
}
//uart init (io + FILE stream)
void uart2_init(uint32_t baudRate)
{
DDRH &= ~0x01;
PORTH |= 0x01;
rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4);
UCSR2A |= (1 << U2X2); // baudrate multiplier
UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate
UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter
UCSR2B |= (1 << RXCIE2); // enable rx interrupt
fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream
}
//returns 1 if chars in input buffer match to str
//returns -1 if chars does not match and 0 for empty buffer
int8_t uart2_rx_str_P(const char* str)
{
uint8_t r = rbuf_r(uart2_ibuf); //get read index
uint8_t w = rbuf_w(uart2_ibuf); //get write index
// printf_P(PSTR("uart2_rx_str_P r=%d w=%d\n"), r, w);
uint8_t e = rbuf_l(uart2_ibuf) - 1; //get end index
uint8_t len = strlen_P(str); //get string length
str += len; //last char will be compared first
// printf_P(PSTR(" len=%d\n"), len);
while (len--) //loop over all chars
{
if (w == r) return 0; //empty buffer - return 0
if ((--w) == 255) w = e; //decrement index
char c0 = pgm_read_byte(--str); //read char from str
char c1 = uart2_ibuf[4 + w]; //read char from input buffer
// printf_P(PSTR(" uart2_rx_str_P w=%d l=%d c0=%02x c1=%02x\n"), w, len, c0, c1);
if (c0 == c1) continue; //if match, continue with next char
if ((c0 == '\r') && (c1 == '\n')) //match cr as lf
continue;
if ((c0 == '\n') && (c1 == '\r')) //match lf as cr
continue;
return -1; //no match - return -1
}
return 1; //all characters match - return 1
}
ISR(USART2_RX_vect)
{
//printf_P(PSTR("USART2_RX_vect \n") );
if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer
{ //rx buffer full
//uart2_rx_clr(); //for sure, clear input buffer
puts_P(PSTR("USART2 rx Full!!!"));
}
}

50
Firmware/uart2.cpp Normal file
View File

@ -0,0 +1,50 @@
//uart2.c
#include "uart2.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "rbuf.h"
#include "macros.h"
#define UART_BAUD_SELECT(baudRate,xtalCpu) (((float)(xtalCpu))/(((float)(baudRate))*8.0)-1.0+0.5)
#define uart2_txready (UCSR2A & (1 << UDRE2))
uint8_t uart2_ibuf[20] = {0, 0};
FILE _uart2io;
static int uart2_putchar(char c, _UNUSED FILE *stream)
{
while (!uart2_txready);
UDR2 = c; // transmit byte
return 0;
}
static int uart2_getchar(_UNUSED FILE *stream)
{
if (rbuf_empty(uart2_ibuf)) return -1;
return rbuf_get(uart2_ibuf);
}
//uart init (io + FILE stream)
void uart2_init(uint32_t baudRate)
{
DDRH &= ~0x01;
PORTH |= 0x01;
rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4);
UCSR2A |= (1 << U2X2); // baudrate multiplier
UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate
UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter
UCSR2B |= (1 << RXCIE2); // enable rx interrupt
fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream
}
ISR(USART2_RX_vect)
{
if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer
{ //rx buffer full
puts_P(PSTR("USART2 rx Full!!!"));
}
}

View File

@ -5,22 +5,9 @@
#include <inttypes.h>
#include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif //defined(__cplusplus)
extern FILE _uart2io;
#define uart2io (&_uart2io)
void uart2_init(uint32_t baudRate);
extern void uart2_init(uint32_t baudRate);
extern int8_t uart2_rx_str_P(const char* str);
#if defined(__cplusplus)
}
#endif //defined(__cplusplus)
#endif //_UART2_H

File diff suppressed because it is too large Load Diff

View File

@ -47,11 +47,10 @@ void lcd_setalertstatuspgm(const char* message, uint8_t severity = LCD_STATUS_AL
uint8_t get_message_level();
void lcd_reset_alert_level();
void lcd_pick_babystep();
uint8_t lcd_alright();
void show_preheat_nozzle_warning();
void lcd_wait_interact();
void lcd_loading_filament();
void lcd_wait_interact(const char* filament_name);
void lcd_loading_filament(const char* filament_name);
void lcd_change_success();
void lcd_loading_color();
void lcd_sdcard_stop();
@ -60,7 +59,11 @@ void lcd_pause_usb_print();
void lcd_send_action_start();
void lcd_resume_print();
void lcd_print_stop(); // interactive print stop
void print_stop(bool interactive=false);
/// @brief Stop the print immediately
/// @param interactive True if the user acknowledged the action from the LCD: resume processing USB commands again
/// @param unconditional_stop True when the print is stopped by a serious error condition e.g. Thermal Runaway. False otherwise.
void print_stop(bool interactive=false, bool unconditional_stop=false);
#ifdef THERMAL_MODEL
void lcd_thermal_model_cal();
#endif //THERMAL_MODEL
@ -90,12 +93,12 @@ extern bool lcd_wait_for_click_delay(uint16_t nDelay);
void lcd_show_choices_prompt_P(uint8_t selected, const char *first_choice, const char *second_choice, uint8_t second_col, const char *third_choice = nullptr);
extern void lcd_show_fullscreen_message_and_wait_P(const char *msg);
extern uint8_t lcd_show_yes_no_and_wait(bool allow_timeouting = true, uint8_t default_selection = LCD_MIDDLE_BUTTON_CHOICE);
extern uint8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, uint8_t default_selection = LCD_MIDDLE_BUTTON_CHOICE);
extern uint8_t lcd_show_multiscreen_message_with_choices_and_wait_P(
const char * const msg, bool allow_timeouting, uint8_t default_selection,
const char * const first_choice, const char * const second_choice, const char * const third_choice = nullptr,
uint8_t second_col = 7);
extern uint8_t lcd_show_multiscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, uint8_t default_selection = LCD_MIDDLE_BUTTON_CHOICE);
extern uint8_t lcd_show_multiscreen_message_cont_cancel_and_wait_P(const char *msg, bool allow_timeouting = true, uint8_t default_selection = LCD_MIDDLE_BUTTON_CHOICE);
// Ask the user to move the Z axis up to the end stoppers and let
// the user confirm that it has been done.
@ -132,16 +135,16 @@ extern LcdCommands lcd_commands_type;
enum class CustomMsg : uint_least8_t
{
Status, //!< status message from lcd_status_message variable
MeshBedLeveling, //!< Mesh bed leveling in progress
FilamentLoading, //!< Loading filament in progress
PidCal, //!< PID tuning in progress
TempCal, //!< PINDA temperature calibration
TempCompPreheat, //!< Temperature compensation preheat
M0Wait, //!< M0/M1 Wait command working even from SD
M117, //!< M117 Set the status line message on the LCD
Resuming, //!< Resuming message
MMUProgress, ///< MMU progress message
Status, //!< 0 status message from lcd_status_message variable
MeshBedLeveling, //!< 1 Mesh bed leveling in progress
FilamentLoading, //!< 2 Loading filament in progress
PidCal, //!< 3 PID tuning in progress
TempCal, //!< 4 PINDA temperature calibration
TempCompPreheat, //!< 5 Temperature compensation preheat
M0Wait, //!< 6 M0/M1 Wait command working even from SD
M117, //!< 7 M117 Set the status line message on the LCD
Resuming, //!< 8 Resuming message
MMUProgress, ///< 9 MMU progress message
};
extern CustomMsg custom_message_type;
@ -218,6 +221,9 @@ void lcd_temp_calibration_set();
void lcd_language();
#endif
void lcd_z_calibration_prompt(bool allowTimeouting);
void prompt_steel_sheet_on_bed(bool wantedState);
void lcd_wizard();
//! @brief Wizard state
@ -254,4 +260,10 @@ extern void lcd_pinda_temp_compensation_toggle();
extern void lcd_heat_bed_on_load_toggle();
#ifdef COMMUNITY_PREVENT_OOZE
extern void retract_for_ooze_prevention();
#endif //COMMUNITY_PREVENT_OOZE
extern void sendHostNotification_P(const char* message);
#endif //ULTRALCD_H

View File

@ -1,12 +1,17 @@
#include "Configuration.h"
#include "ultralcd.h"
#include "menu.h"
#include "sound.h"
#include "language.h"
#include "util.h"
#include <avr/eeprom.h>
#include <avr/pgmspace.h>
#include <stdio.h> // for sprintf_P
#include "Configuration.h"
#include "Filament_sensor.h"
#include "language.h"
#include "lcd.h"
#include "Marlin.h" // delay_keep_alive
#include "menu.h"
#include "Prusa_farm.h"
#include "sound.h"
#include "ultralcd.h"
#include "util.h"
// Allocate the version string in the program memory. Otherwise the string lands either on the stack or in the global RAM.
static const char FW_VERSION_STR[] PROGMEM = FW_VERSION;
@ -198,7 +203,7 @@ bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4])
bool show_upgrade_dialog_if_version_newer(const char *version_string)
{
if(oCheckVersion == ClCheckVersion::_None)
if(oCheckVersion == ClCheckMode::_None)
return false;
int8_t upgrade = is_provided_version_newer(version_string);
@ -206,11 +211,11 @@ bool show_upgrade_dialog_if_version_newer(const char *version_string)
return false;
if (upgrade) {
lcd_display_message_fullscreen_P(_i("New firmware version available:"));////MSG_NEW_FIRMWARE_AVAILABLE c=20 r=2
lcd_display_message_fullscreen_P(_T(MSG_NEW_FIRMWARE_AVAILABLE));
lcd_puts_at_P(0, 2, PSTR(""));
for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c)
lcd_putc(*c);
lcd_puts_at_P(0, 3, _i("Please upgrade."));////MSG_NEW_FIRMWARE_PLEASE_UPGRADE c=20
lcd_puts_at_P(0, 3, _T(MSG_NEW_FIRMWARE_PLEASE_UPGRADE));
Sound_MakeCustom(50,1000,false);
delay_keep_alive(500);
Sound_MakeCustom(50,1000,false);
@ -227,41 +232,43 @@ bool show_upgrade_dialog_if_version_newer(const char *version_string)
void update_current_firmware_version_to_eeprom()
{
for (int8_t i = 0; i < FW_PRUSA3D_MAGIC_LEN; ++ i){
eeprom_update_byte((uint8_t*)(EEPROM_FIRMWARE_PRUSA_MAGIC+i), pgm_read_byte(FW_PRUSA3D_MAGIC_STR+i));
eeprom_update_byte_notify((uint8_t*)(EEPROM_FIRMWARE_PRUSA_MAGIC+i), pgm_read_byte(FW_PRUSA3D_MAGIC_STR+i));
}
eeprom_update_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[0]));
eeprom_update_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1]));
eeprom_update_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2]));
eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[0]));
eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1]));
eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2]));
// See FirmwareRevisionFlavorType for the definition of firmware flavors.
eeprom_update_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[3]));
eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[3]));
}
ClNozzleDiameter oNozzleDiameter;
ClCheckMode oCheckMode;
ClCheckModel oCheckModel;
ClCheckVersion oCheckVersion;
ClCheckGcode oCheckGcode;
ClCheckMode oCheckModel;
ClCheckMode oCheckVersion;
ClCheckMode oCheckGcode;
ClCheckMode oCheckFilament;
void fCheckModeInit() {
oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn);
if (farm_mode) {
oCheckMode = ClCheckMode::_Strict;
eeprom_update_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Strict);
eeprom_update_byte_notify((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Strict);
}
oNozzleDiameter = (ClNozzleDiameter)eeprom_init_default_byte((uint8_t *)EEPROM_NOZZLE_DIAMETER, (uint8_t)ClNozzleDiameter::_Diameter_400);
eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT);
oCheckModel = (ClCheckModel)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckModel::_Warn);
oCheckVersion = (ClCheckVersion)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckVersion::_Warn);
oCheckGcode = (ClCheckGcode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckGcode::_Warn);
oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn);
oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn);
oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn);
oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn);
}
static void render_M862_warnings(const char* warning, const char* strict, uint8_t check)
{
if (check == 1) { // Warning, stop print if user selects 'No'
if (lcd_show_fullscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) {
if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) {
lcd_print_stop();
}
} else if (check == 2) { // Strict, always stop print
@ -298,7 +305,7 @@ void nozzle_diameter_check(uint16_t nDiameter) {
}
void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) {
if (oCheckModel == ClCheckModel::_None)
if (oCheckModel == ClCheckMode::_None)
return;
if (nPrinterModel == actualPrinterModel)
return;
@ -324,7 +331,7 @@ uint8_t mCompareValue(uint16_t nX, uint16_t nY) {
}
void fw_version_check(const char *pVersion) {
if (oCheckVersion == ClCheckVersion::_None)
if (oCheckVersion == ClCheckMode::_None)
return;
uint16_t aVersion[4];
@ -365,8 +372,36 @@ void fw_version_check(const char *pVersion) {
);
}
bool filament_presence_check() {
// When MMU is enabled, this is not necessary and the G-code file
// should always tell the MMU which filament to load.
if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) {
goto done;
}
if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) {
if (oCheckFilament == ClCheckMode::_None) {
goto done;
}
render_M862_warnings(
_T(MSG_MISSING_FILAMENT)
,_T(MSG_MISSING_FILAMENT) //Identical messages
,(uint8_t)oCheckFilament
);
if (lcd_commands_type == LcdCommands::StopPrint) {
// Print job was canceled
return false;
}
}
done:
return true;
}
void gcode_level_check(uint16_t nGcodeLevel) {
if (oCheckGcode == ClCheckGcode::_None)
if (oCheckGcode == ClCheckMode::_None)
return;
if (nGcodeLevel <= (uint16_t)GCODE_LEVEL)
return;
@ -438,12 +473,12 @@ void calibration_status_set(CalibrationStatus components)
{
CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2);
status |= components;
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status);
eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status);
}
void calibration_status_clear(CalibrationStatus components)
{
CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2);
status &= ~components;
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status);
eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status);
}

View File

@ -55,30 +55,6 @@ enum class ClCheckMode:uint_least8_t
_Undef=EEPROM_EMPTY_VALUE
};
enum class ClCheckModel:uint_least8_t
{
_None,
_Warn,
_Strict,
_Undef=EEPROM_EMPTY_VALUE
};
enum class ClCheckVersion:uint_least8_t
{
_None,
_Warn,
_Strict,
_Undef=EEPROM_EMPTY_VALUE
};
enum class ClCheckGcode:uint_least8_t
{
_None,
_Warn,
_Strict,
_Undef=EEPROM_EMPTY_VALUE
};
#define COMPARE_VALUE_EQUAL (((uint8_t)ClCompareValue::_Equal<<6)+((uint8_t)ClCompareValue::_Equal<<4)+((uint8_t)ClCompareValue::_Equal<<2)+((uint8_t)ClCompareValue::_Equal))
enum class ClCompareValue:uint_least8_t
{
@ -96,7 +72,7 @@ public:
: len(0)
, found(false)
{
char * pStrEnd = NULL;
const char * pStrEnd = NULL;
// Start of the string
this->ptr = strchr(pStr, '"');
@ -129,9 +105,10 @@ private:
extern ClNozzleDiameter oNozzleDiameter;
extern ClCheckMode oCheckMode;
extern ClCheckModel oCheckModel;
extern ClCheckVersion oCheckVersion;
extern ClCheckGcode oCheckGcode;
extern ClCheckMode oCheckModel;
extern ClCheckMode oCheckVersion;
extern ClCheckMode oCheckGcode;
extern ClCheckMode oCheckFilament;
void fCheckModeInit();
void nozzle_diameter_check(uint16_t nDiameter);
@ -140,6 +117,20 @@ void printer_smodel_check(const char *pStrPos, const char *actualPrinterSModel);
void fw_version_check(const char *pVersion);
void gcode_level_check(uint16_t nGcodeLevel);
/// Check if the filament is present before starting a print job.
/// Depending on the check level set in the menus the printer will:
/// - None: not issue any warning about missing filament
/// - Warning (default): The user is warned about missing filament
/// and is prompted to continue with Yes/No. If No is selected,
/// the print is aborted. If no user input is given (e.g. from
/// host printing) then the warning will expire in 30 seconds and
/// the printer assumes the Yes option was selected.
/// - Strict: If the filament is not detected when a print is started,
/// it is immediately canceled with a message saying the filament is
/// missing.
/// @returns false if the print is canceled, true otherwise
bool filament_presence_check();
uint16_t nPrinterType(bool bMMu);
const char *sPrinterType(bool bMMu);

View File

@ -24,6 +24,7 @@
#define HEATBED_V2
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define TACH0PULLUP
// Uncomment the below for the E3D PT100 temperature sensor (with or without PT100 Amplifier)
@ -125,7 +126,9 @@
#define DEBUG_DCODE2
#define DEBUG_DCODE3
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
#ifdef DEBUG_BUILD
//#define _NO_ASM
@ -200,6 +203,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
//#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -233,6 +239,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -246,6 +261,18 @@
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
*------------------------------------*/
@ -305,9 +332,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -493,4 +520,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -24,6 +24,7 @@
#define HEATBED_V2
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define TACH0PULLUP
// Uncomment the below for the E3D PT100 temperature sensor (with or without PT100 Amplifier)
@ -126,7 +127,9 @@
#define DEBUG_DCODE2
#define DEBUG_DCODE3
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
#ifdef DEBUG_BUILD
//#define _NO_ASM
@ -201,6 +204,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
//#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -234,6 +240,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -247,6 +262,18 @@
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
*------------------------------------*/
@ -306,9 +333,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -497,4 +524,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -24,6 +24,7 @@
#define HEATBED_V2
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define TACH0PULLUP
// Uncomment the below for the E3D PT100 temperature sensor (with or without PT100 Amplifier)
@ -125,7 +126,9 @@
#define DEBUG_DCODE2
#define DEBUG_DCODE3
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
#ifdef DEBUG_BUILD
//#define _NO_ASM
@ -200,6 +203,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
//#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -233,6 +239,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -246,6 +261,18 @@
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
*------------------------------------*/
@ -305,9 +332,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -501,4 +528,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -24,6 +24,7 @@
#define HEATBED_V2
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define TACH0PULLUP
// Uncomment the below for the E3D PT100 temperature sensor (with or without PT100 Amplifier)
@ -126,7 +127,9 @@
#define DEBUG_DCODE2
#define DEBUG_DCODE3
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
#ifdef DEBUG_BUILD
//#define _NO_ASM
@ -201,6 +204,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
//#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -234,6 +240,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -247,6 +262,18 @@
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
*------------------------------------*/
@ -306,9 +333,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -502,4 +529,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -23,6 +23,7 @@
// Electronics
#define MOTHERBOARD BOARD_EINSY_1_0a
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define HAS_SECOND_SERIAL_PORT
@ -64,6 +65,9 @@
#define Z_MAX_POS 210
#define Z_MIN_POS 0.15
// Z height correction value
#define Z_MAX_POS_XYZ_CALIBRATION_CORRECTION 2
// Canceled home position
#define X_CANCEL_POS 50
#define Y_CANCEL_POS 190
@ -164,7 +168,9 @@
#define DEBUG_DCODE6
//#define DEBUG_PULLUP_CRASH //Test Pullup crash
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
//#define DEBUG_SEC_LANG //secondary language debug output at startup
//#define DEBUG_XFLASH //debug external spi flash
@ -317,7 +323,7 @@
#define HEATER_0_MAXTEMP 305
#endif
#define BED_MAXTEMP 125
#define AMBIENT_MAXTEMP 100
#define AMBIENT_MAXTEMP 80
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)
// Define PID constants for extruder with PT100
@ -334,6 +340,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -367,6 +376,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -402,6 +420,17 @@
#include "thermal_model/e3d_REVO.h"
#define THERMAL_MODEL_DEFAULT E3D_REVO // Default E3D REVO model parameters
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
@ -452,9 +481,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -658,4 +687,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -23,6 +23,7 @@
// Electronics
#define MOTHERBOARD BOARD_EINSY_1_0a
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define HAS_SECOND_SERIAL_PORT
@ -64,6 +65,9 @@
#define Z_MAX_POS 210
#define Z_MIN_POS 0.15
// Z height correction value
#define Z_MAX_POS_XYZ_CALIBRATION_CORRECTION 2
// Canceled home position
#define X_CANCEL_POS 50
#define Y_CANCEL_POS 190
@ -164,7 +168,9 @@
#define DEBUG_DCODE6
//#define DEBUG_PULLUP_CRASH //Test Pullup crash
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
//#define DEBUG_SEC_LANG //secondary language debug output at startup
//#define DEBUG_XFLASH //debug external spi flash
@ -317,7 +323,7 @@
#define HEATER_0_MAXTEMP 305
#endif
#define BED_MAXTEMP 125
#define AMBIENT_MAXTEMP 100
#define AMBIENT_MAXTEMP 80
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)
// Define PID constants for extruder with PT100
@ -335,6 +341,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -368,6 +377,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -403,6 +421,17 @@
#include "thermal_model/e3d_REVO_HF_60W.h"
#define THERMAL_MODEL_DEFAULT E3D_REVO_HF_60W // Default E3D REVO HF 60W model parameters
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
@ -453,9 +482,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -659,4 +688,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -23,6 +23,7 @@
// Electronics
#define MOTHERBOARD BOARD_EINSY_1_0a
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define HAS_SECOND_SERIAL_PORT
@ -64,6 +65,9 @@
#define Z_MAX_POS 210
#define Z_MIN_POS 0.15
// Z height correction value
#define Z_MAX_POS_XYZ_CALIBRATION_CORRECTION 2
// Canceled home position
#define X_CANCEL_POS 50
#define Y_CANCEL_POS 190
@ -164,7 +168,9 @@
#define DEBUG_DCODE6
//#define DEBUG_PULLUP_CRASH //Test Pullup crash
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
//#define DEBUG_SEC_LANG //secondary language debug output at startup
//#define DEBUG_XFLASH //debug external spi flash
@ -317,7 +323,7 @@
#define HEATER_0_MAXTEMP 305
#endif
#define BED_MAXTEMP 125
#define AMBIENT_MAXTEMP 100
#define AMBIENT_MAXTEMP 80
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)
// Define PID constants for extruder with PT100
@ -337,6 +343,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
//#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -370,6 +379,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -405,6 +423,17 @@
#include "thermal_model/e3d_v6.h"
#define THERMAL_MODEL_DEFAULT E3D_V6 // Default model parameters
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
@ -455,9 +484,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -661,4 +690,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -17,11 +17,12 @@
#define NOZZLE_TYPE "E3DREVO"
// Printer name
#define CUSTOM_MENDEL_NAME "Prusa i3 MK3S-R"
#define CUSTOM_MENDEL_NAME "Prusa i3 MK3S+R"
// Electronics
#define MOTHERBOARD BOARD_EINSY_1_0a
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define HAS_SECOND_SERIAL_PORT
// PSU
@ -66,6 +67,9 @@
#define Z_MAX_POS 210
#define Z_MIN_POS 0.15
// Z height correction value
#define Z_MAX_POS_XYZ_CALIBRATION_CORRECTION 9
// Canceled home position
#define X_CANCEL_POS 50
#define Y_CANCEL_POS 190
@ -166,7 +170,9 @@
#define DEBUG_DCODE6
//#define DEBUG_PULLUP_CRASH //Test Pullup crash
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
//#define DEBUG_SEC_LANG //secondary language debug output at startup
//#define DEBUG_XFLASH //debug external spi flash
@ -319,7 +325,7 @@
#define HEATER_0_MAXTEMP 305
#endif
#define BED_MAXTEMP 125
#define AMBIENT_MAXTEMP 100
#define AMBIENT_MAXTEMP 80
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)
// Define PID constants for extruder with PT100
@ -336,6 +342,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -371,6 +380,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -406,6 +424,17 @@
#include "thermal_model/e3d_REVO.h"
#define THERMAL_MODEL_DEFAULT E3D_REVO // Default E3D REVO model parameters
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
@ -456,9 +485,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -670,4 +699,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -17,11 +17,12 @@
#define NOZZLE_TYPE "E3DREVO_HF_60W"
// Printer name
#define CUSTOM_MENDEL_NAME "Prusa MK3S-RHF60"
#define CUSTOM_MENDEL_NAME "Prusa MK3S+RHF60"
// Electronics
#define MOTHERBOARD BOARD_EINSY_1_0a
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define HAS_SECOND_SERIAL_PORT
// PSU
@ -66,6 +67,9 @@
#define Z_MAX_POS 210
#define Z_MIN_POS 0.15
// Z height correction value
#define Z_MAX_POS_XYZ_CALIBRATION_CORRECTION 9
// Canceled home position
#define X_CANCEL_POS 50
#define Y_CANCEL_POS 190
@ -166,7 +170,9 @@
#define DEBUG_DCODE6
//#define DEBUG_PULLUP_CRASH //Test Pullup crash
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
//#define DEBUG_SEC_LANG //secondary language debug output at startup
//#define DEBUG_XFLASH //debug external spi flash
@ -319,7 +325,7 @@
#define HEATER_0_MAXTEMP 305
#endif
#define BED_MAXTEMP 125
#define AMBIENT_MAXTEMP 100
#define AMBIENT_MAXTEMP 80
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)
// Define PID constants for extruder with PT100
@ -337,6 +343,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -372,6 +381,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -407,6 +425,17 @@
#include "thermal_model/e3d_REVO_HF_60W.h"
#define THERMAL_MODEL_DEFAULT E3D_REVO_HF_60W // Default E3D REVO HF 60W model parameters
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
@ -457,9 +486,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -671,4 +700,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -22,6 +22,7 @@
// Electronics
#define MOTHERBOARD BOARD_EINSY_1_0a
#define STEEL_SHEET
//#define NEW_FIRST_LAYER_CAL //from front to back
#define HAS_SECOND_SERIAL_PORT
// PSU
@ -66,6 +67,9 @@
#define Z_MAX_POS 210
#define Z_MIN_POS 0.15
// Z height correction value
#define Z_MAX_POS_XYZ_CALIBRATION_CORRECTION 9
// Canceled home position
#define X_CANCEL_POS 50
#define Y_CANCEL_POS 190
@ -166,7 +170,9 @@
#define DEBUG_DCODE6
//#define DEBUG_PULLUP_CRASH //Test Pullup crash
//#define DEBUG_PRINTER_STATES
//#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
//#define DEBUG_BUILD
//#define DEBUG_SEC_LANG //secondary language debug output at startup
//#define DEBUG_XFLASH //debug external spi flash
@ -319,7 +325,7 @@
#define HEATER_0_MAXTEMP 305
#endif
#define BED_MAXTEMP 125
#define AMBIENT_MAXTEMP 100
#define AMBIENT_MAXTEMP 80
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)
// Define PID constants for extruder with PT100
@ -339,6 +345,9 @@
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
//#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -374,6 +383,15 @@
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -409,6 +427,17 @@
#include "thermal_model/e3d_v6.h"
#define THERMAL_MODEL_DEFAULT E3D_V6 // Default model parameters
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
@ -459,9 +488,9 @@
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// This sets the max power delivered to the bed.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -673,4 +702,14 @@
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

View File

@ -132,6 +132,9 @@ EXTRUDER SETTINGS
// Extrude mintemp
#define EXTRUDE_MINTEMP 175
// Quick nozzle change supported
//#define QUICK_NOZZLE_CHANGE
// Extruder cooling fans
#define EXTRUDER_0_AUTO_FAN_PIN 8
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@ -162,6 +165,15 @@ CHANGE FILAMENT SETTINGS
#define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15
//Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif
/*------------------------------------
@ -175,6 +187,18 @@ ADDITIONAL FEATURES SETTINGS
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45
/*------------------------------------
HOST FEATURES
*------------------------------------*/
// Uncomment if the host supports '//action:shutdown'. It will add "Shutdown host" to the LCD meun.
//#define HOST_SHUTDOWN
// Uncomment if the host doesn't support '//action:ready' & '//action:notready'.
// This will replace the "Set Ready"/"Set not Ready" LCD menu entry with
// "Print from host" and send '//action:start' instead.
//#define REPLACE_SETREADY
/*------------------------------------
MOTOR CURRENT SETTINGS
*------------------------------------*/
@ -234,9 +258,9 @@ BED SETTINGS
//
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// This sets the max power delivered to the bed.
// All forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
@ -406,4 +430,14 @@ THERMISTORS SETTINGS
#define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
/*------------------------------------
COMMUNITY FEATURES
*------------------------------------*/
//Show filename instead of print time after SD card print finished
//#define SHOW_FILENAME_AFTER_FINISH
//Remove the "AutoLoad filament" LCD menu entry if autoload is enabled.
//#define REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY
#endif //__CONFIGURATION_PRUSA_H

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