Compare commits

...

201 Commits

Author SHA1 Message Date
3d-gussner a6eeb55690
Merge pull request #4055 from 3d-gussner/MK3_3122
Bump up FW 3.12.2 to 5713
2023-02-28 08:54:56 +01:00
3d-gussner 662f5e0248 Bump up FW 3.12.2 to 5713 2023-02-28 08:08:59 +01:00
3d-gussner db7b472929
Merge pull request #4041 from 3d-gussner/MK3_312_Fix_fil_loaded_timeout
MK3_3.12: Set `Is filament loaded? Yes|No` default to `No` without a timeout.
2023-02-21 07:18:20 +01:00
3d-gussner 0eeaa5bed6 Set `Is filament loaded? Yes|No` default to `No` without a timeout. 2023-02-20 14:17:04 +01:00
3d-gussner c3ea4f02d4
Merge pull request #4006 from wavexx/tm_ptc312
PFW-1499 TM: PTC model support (3.12)
2023-02-20 08:55:54 +01:00
Yuri D'Elia 571d25c04b TM: Move headers to support the legacy build system 2023-02-15 14:15:30 +01:00
Yuri D'Elia fd96b79ea9 TM: Split default model parameters into a separate header
Preparation to support multiple default model parameter sets
2023-02-15 13:49:51 +01:00
Yuri D'Elia 4b499583b5 TM: future-proofing for incompatible model upgrades
Introduce a model version. This is initialized at "1" and doesn't
require any upgrade/downgrade checks since it's currently
retro-compatible.
2023-02-15 13:48:25 +01:00
Yuri D'Elia 4a4be21374 TM: Fix UV identity 2023-02-15 11:24:49 +01:00
3d-gussner b76908300d
Merge pull request #4017 from 3d-gussner/MK3_3.12.2
Bump up build number and FW version
2023-02-15 09:07:38 +01:00
3d-gussner 5ca84736e4 Bump up build number and FW version 2023-02-15 08:52:27 +01:00
Yuri D'Elia 6d51752ac8 TM: Optimize temp_model_set_lag
Save about 20 bytes by rewriting the sample count check
2023-02-10 15:44:28 +01:00
Yuri D'Elia b7961ae0e9 TM: Handle L/TEMP_MODEL_LAG 2023-02-10 15:44:28 +01:00
Yuri D'Elia e147fc2cb0 TM: Handle UV (PTC loss)
Model UV as power-invariant, so that scaling P doesn't change the
intercept location (that is, the zero point remains at the same
temperature even for more powerful heaters).

NOTE: It's not clear to me whether this is generally true (couldn't
find a datasheet from the same heater in diffent power variants
showing the efficiency loss)
2023-02-10 15:44:28 +01:00
Yuri D'Elia 02775fb79e TM: Handle D/TEMP_MODEL_fS 2023-02-10 15:44:28 +01:00
Yuri D'Elia 70fd9a336b TM: Handle UVDL set/load/report/upgrade
- Expose TEMP_MODEL_fS and TEMP_MODEL_LAG as D and L respectively,
  initializing the default values based on the previous hard-coded
  values.
- Always round L to the effective sample lag to future-proof model
  upgrades or changes (the stored value _is_ the effective value).
- Introduce UV as a new linear term for PTC heaters, defaulting
  to an identity for model backward-compatibility.
2023-02-10 15:44:28 +01:00
Yuri D'Elia 5a1ed1519c TM: Allocate new eeprom parameters for PTC handling 2023-02-10 15:44:28 +01:00
Yuri D'Elia 1445c2eecc Backport eeprom functions from 3.13 2023-02-10 15:44:28 +01:00
Yuri D'Elia b23476aaf3 TM: Do not emit an "error:" on the serial for recoverable errors
Use "echo:" for thermal model error reporting to avoid octoprint
automatically sending a M112 kill.

Keep using "error:" instead for other thermal errors (MAXTEMP/etc).

This should allow resuming a thermal mode pause with the default
octoprint settings.
2023-02-10 14:25:05 +01:00
3d-gussner c740bf923c
Merge pull request #3999 from 3d-gussner/MK3_312_Thermal_model
PFW-1479: MK3_3.12 Change Temp model to Thermal model
2023-02-09 07:10:47 +01:00
3d-gussner 8aaf77a6da Change to Thermal model
Add prusa.io/tm-cal link
and update all TM related translations
2023-02-08 18:34:11 +01:00
3d-gussner c9722c2b63
Merge pull request #3956 from wavexx/tm_cal_check_312
TM: Check for PC parameters more carefully (3.12)
2023-01-27 14:57:41 +01:00
Yuri D'Elia 8ee084944a wizard: Return to status after calibration 2023-01-27 14:55:51 +01:00
Yuri D'Elia 68372c0c0e wizard: Do no set "Self test OK" as an alert message
Alert messages are intended to persist above "info" messages, thus
preventing further calibration status updates to be shown (such as
thermal model calibration).

Just set the message as a regular status message.

Fixes #3892
2023-01-27 14:55:51 +01:00
Yuri D'Elia 4e3152dc1d wizard: Disable TM warnings during calibration
During calibration model warnings are possible/normal. This is
apparently leading some into thinking the hotend might be faulty
and abort the calibration with a hard reset.

Disable warnings/beeps during calibration.

Rely on the error threshold only.
2023-01-27 14:55:37 +01:00
Yuri D'Elia 6058de4ae0 TM: Do not restrict autotune temperature
Fix a wrong type that prevents running TM autotune at temps >127
2023-01-27 14:55:27 +01:00
Yuri D'Elia 36c3814dc2 TM: Check for PC parameters more carefully 2023-01-26 23:47:17 +01:00
3d-gussner 87118c1042
Merge pull request #3934 from 3d-gussner/MK3_312_Fix_Wiz_BumpUpBuildNr
Revert inverted "Running wizard ..." message
2023-01-20 09:22:20 +01:00
3d-gussner d8ae7cbe11 Revert inverted "Running wizard ..." message
Update build number +1 for PR + one for merge
2023-01-20 09:13:19 +01:00
3d-gussner f7167595c3
Merge pull request #3932 from 3d-gussner/MK3_312_final_Version_change
Version changed (3.12.1 build 5684) for FW3.12.1
2023-01-20 06:59:25 +01:00
3d-gussner 149ecb857c Version changed (3.12.1 build 5684) for FW3.12.1 2023-01-19 16:36:26 +01:00
3d-gussner 54a3c836a7
Merge pull request #3926 from 3d-gussner/MK3_312_RC1_Version_change
Version changed (3.12.1-RC1 build 5682) for FW3.12.1-RC1
2023-01-17 10:12:14 +01:00
3d-gussner cf08422672 Version changed (3.12.1-RC1 build 5682) for FW3.12.1-RC1 2023-01-17 09:49:56 +01:00
Yuri D'Elia 4a3644052d TM: Fan measuring state reset unification
Add resetFanCheck() to reset the fan measuring state as it's needed in
several places and save some flash space.
2023-01-16 08:43:23 +01:00
Yuri D'Elia 16922c2643 TM: Restore extruder autofan state when stopping/resuming
During thermal errors all fans are set to full speed.

When the print is resumed or stopped *and* the thermal error is gone,
also restore the autofan state.

Fixes #3893
2023-01-16 08:43:23 +01:00
Yuri D'Elia 128a23544d TM: Set the cal status bit when running `M310 A` directly
Running `M310 A` should set the TM calibration bit status if the
autotune procedure was successful.

Partially addresses #3891 and #3890, since running `M310 A F0` should
*still* count as valid calibration data and is not something that can be
replicated by using the LCD (which enforces self-test).
2023-01-16 07:33:23 +01:00
Yuri D'Elia 7adfd0c670 wizard: Do not complain about missing calibration if model is disabled
This fixes #3891 without having to set the calibration bit, meaning
that if the model is later re-enabled without a real calibration, a
prompt is shown as expected.
2023-01-16 07:31:57 +01:00
3d-gussner 5b8321d602 Move Z to top during Nozzle change 2023-01-16 07:27:59 +01:00
Alex Voinea fffb15cc81 Fix MK2.5 softReset()
Disable the watchdog early in the program

More documentation for pins file

retrigger build

fix watchdog not getting disabled on user app boot

Fix interrupts not enabled during setup()
2023-01-13 15:41:54 +01:00
3d-gussner 3ea86136cd
Merge pull request #3897 from 3d-gussner/MK3_12_MMU106-fix
Fix Load filament issues with MMU FW1.0.6
2023-01-13 14:03:58 +01:00
3d-gussner 6db58f09d0 Revert LongTimers to uint32_t in mmu.cpp to fix issues with MMU2 fw 1.0.6 2023-01-13 11:20:49 +01:00
DRracer fdadc9314e
Merge pull request #3887 from 3d-gussner/MK312_Version_change
Version changed (3.12.0 build 5672) for FW3.12.0 final
2023-01-10 10:51:50 +01:00
3d-gussner fd678bc8ec Version changed (3.12.0 build 5672)
5670 +1 for the commit +1 for the merge
2023-01-10 09:55:46 +01:00
Yuri D'Elia 54356f8d97
Merge pull request #3880 from wavexx/m300_s0_m312
Make M300 S0 pause like Marlin (3.12)
2023-01-02 19:24:02 +01:00
3d-gussner 39a078306a
Merge pull request #3881 from 3d-gussner/MK3_312_Update_Cal_documention
Fix few values
2023-01-02 15:43:07 +01:00
3d-gussner cfed4bcd19 Fix few values 2023-01-02 15:18:43 +01:00
Yuri D'Elia 3c4373c0c3 Remove extra delay after critical sound
This delay doesn't exist for the tone generator, so remove it from the
pure version as well.
2023-01-02 14:27:46 +01:00
Yuri D'Elia 805e71e504 Make M300 S0 pause like Marlin
Follow Marlin's behavior and simply insert a delay for the requested
duration when using M300 S0.

When S is not specified, use the default tone instead.

Fixes #3856
2023-01-02 14:27:38 +01:00
3d-gussner 46a979271d Update calibration status v2 documentation 2023-01-02 11:22:47 +01:00
Yuri D'Elia f68479fc38 TM: Mark more internal functions as static 2023-01-02 10:52:20 +01:00
Yuri D'Elia 5a89f6934a TM: Also clear the status flags when disabling the model
Disabling the model during a warn/error condition will also stop
updating the warning/error flag, keeping the printer in an error state.

Clear all flags as well when changing model settings.
2023-01-02 10:52:20 +01:00
Yuri D'Elia 8bd0d6aeb8 wizard: Ask about the sheet before doing Z calibration
Ask to install the sheet immediately after removing the test print.
This makes further messages less confusing.
2023-01-02 10:51:47 +01:00
Yuri D'Elia fbfacd76a4 wizard: Resume the wizard for missing calibrations during upgrades
Instead of checking for explicit versions, resume the wizard if some
(new) wizard is missing.

This handles both the old SELFTEST check, the new thermal model
and any future check in the same fashion.
2023-01-02 10:51:47 +01:00
Yuri D'Elia 05f37edad5 Read version data from progmem in eeprom_fw_version_older_than 2023-01-02 10:51:47 +01:00
Yuri D'Elia a8057e0d36 wizard: Disable temperature model during hotend testing
This avoids confusing error messages if the hotend is defective and
caught by selftest itself.

Rearrange Stopped state checks (saves 2 bytes)
2023-01-02 10:51:47 +01:00
Yuri D'Elia d8ae372309 wizard: Allow partial resuming after reset
Update the eeprom FW version as soon as migration is complete, to avoid
resetting the CALIBRATION_V2 variable at each reset.

Do not implicitly reset the calibration steps for WizState::Run: do this
only for the menu action.
2023-01-02 10:51:47 +01:00
Yuri D'Elia f158a75041 Unbreak build with !PINDA_THERMISTOR 2023-01-02 10:51:47 +01:00
Yuri D'Elia 0c583ff90a Handle CALIBRATION_STATUS_TEMP_MODEL 2023-01-02 10:51:47 +01:00
Yuri D'Elia 16de033504 Handle CALIBRATION_STATUS_SELFTEST 2023-01-02 10:51:47 +01:00
Yuri D'Elia b2f3f476c4 Handle CALIBRATION_STATUS_{Z,XYZ} 2023-01-02 10:51:47 +01:00
Yuri D'Elia 17b10167a0 Handle CALIBRATION_STATUS_LIVE_ADJUST 2023-01-02 10:51:47 +01:00
Yuri D'Elia 16033b40b4 wizard: Rewrite the fw upgrade check logic
- Handle the conversion from the V1 calibration status to the V2 bitmap
  for all past FW versions.
- Allow to run the wizard in "Restore" mode (for example during upgrade
  or service prep) to complete any missing steps.
- Fix service prep to use the above feature by clearing the appropriate
  calibration bits.
- Remove exceptions for FW 3.2.0.4 which can now be handled cleanly.
2023-01-02 10:51:47 +01:00
Yuri D'Elia d478aa5c5e wizard: Rewrite the wizard handling loop
Simplify status tracking:

- S::Restore to continue to the next logical wizard item
- S::Finish for a successful failure
- S::Failed to exit while showing a failure
2023-01-02 10:51:47 +01:00
Yuri D'Elia 8a43aa0024 wizard: Remove unused wizard stages
Remove PreheatPla/IsPla, as we currently always explicitly ask for the
material type.
2023-01-02 10:51:47 +01:00
Yuri D'Elia 6285951eac Simplify altfan override initialization 2023-01-02 10:51:47 +01:00
Yuri D'Elia 612e9d9303 Replace calibration state with a new calibration bitmap
- Move calibration status/declarations to util.h
- Allows to query the status of each step independently without assuming
  any order
- Allows to extend the calibration with new steps transparently
2023-01-02 10:51:47 +01:00
Yuri D'Elia 4ff245c7ee eeprom: Fix EEPROM_HEAT_BED_ON_LOAD_FILAMENT debug offset in docs 2023-01-02 10:51:47 +01:00
Yuri D'Elia 670bca47da Simplify FW eeprom version checks
- Generalize force_selftest_if_fw_version() so we can check when upgrading
  between arbitrary FW versions.
- Do not call update_current_firmware_version_to_eeprom() prematurely
  when forcing self-test (if a reset happens before self-test completes,
  the check would be incorrectly skipped on the next run).
2023-01-02 10:51:47 +01:00
Yuri D'Elia a18f28715d backport: Stub LCDButtonChoice for LCD_LEFT_BUTTON_CHOICE 2023-01-02 10:51:47 +01:00
Yuri D'Elia 3f86636bb6 backport: Sync new offsets from MK3 2023-01-02 10:51:47 +01:00
3d-gussner 83907a9998
Merge pull request #3848 from 3d-gussner/MK3_3.12_Clear_TM_error
MK3_ 3.12: Add translations for Clear TM error message
2022-12-20 16:40:33 +01:00
3d-gussner b683351b6c Add translations for `Clear TM error` message 2022-12-20 15:39:36 +01:00
3d-gussner 9fecc77c01
Merge pull request #3846 from 3d-gussner/MK3_3.12_XYZ_cal_fix
MK3_3.12: XYZ cal change message and add LCD ouput
2022-12-20 15:14:33 +01:00
3d-gussner e511996cd4
Merge pull request #3845 from 3d-gussner/MK3_3.12_tm_partial_lock
MK3_3_12: TM: Prevent lockout on invalid model values
2022-12-20 14:37:24 +01:00
3d-gussner eb9d58a6e0
Merge pull request #3826 from 3d-gussner/MK3_3.12_tm_default_state
MK3_3.12 TM: Provide full defaults for model data and enable it by default
2022-12-20 14:35:56 +01:00
3d-gussner 5a1743711c Change xyz cal message `up to 24 min.` instead `approx. 12 min.` 2022-12-20 14:34:25 +01:00
3d-gussner 2f8b2dcad4 Add LCD output during xyz calibration 2022-12-20 14:30:06 +01:00
Yuri D'Elia 650c76e88d TM: Force initialization after reset 2022-12-20 07:06:37 +01:00
Yuri D'Elia 7bf8a64d38 Improve MSG_ACK_ERROR message 2022-12-19 10:50:50 +01:00
Yuri D'Elia 62d362f45f Also prevent longpress when Stopped 2022-12-19 10:50:34 +01:00
Yuri D'Elia 64eefa969b TM: Disallow preheat/filament actions when stopped
Require acknowledgement first

Fix cherry-pick mmu2 issue
2022-12-19 10:50:06 +01:00
Yuri D'Elia 5fc277469a TM: Allow to resume without a running print
If there is no running print, and the printer is Stopped, add a new
"Acknowledge error" menu entry to unlock the printer.

This simply calls lcd_print_stop(), which is identical in behavior to a
thermal error with a running print.
2022-12-19 10:48:40 +01:00
Yuri D'Elia 3c1c2fd2ca Use menu_set_block() in ThermalStop()
Set a menu block for fatal thermal errors instead of abusing
lcd_return_to_status() to kick the user out of the menus.

This now allows a thermal model error to be recoverable through menu
access.
2022-12-19 10:48:26 +01:00
Yuri D'Elia 5e50a15c88 Do not show/call LCD status updates when unchanged
This mostly prevents useless serial noise
2022-12-19 10:48:12 +01:00
Yuri D'Elia a551536386 TM: correctly mark repeated anomalies 2022-12-19 10:47:58 +01:00
Yuri D'Elia 3b65aa06c5 TM: Clear the Stopped state when stopping the current print
We allow resuming from the LCD via start print and resume print,
it makes sense to clear the error on stop too.

For this reason distinguish whether the action is performed
automatically or manually (ie: interactively).

The error is only cleared when the command is run interactively.
2022-12-19 10:47:41 +01:00
Yuri D'Elia 94583c861b Rename print_stop() to lcd_print_stop_finish() for clarity 2022-12-19 10:47:26 +01:00
Yuri D'Elia d37a2a173a Parenthesize IS_SD_PRINTING defensively 2022-12-19 10:47:10 +01:00
Yuri D'Elia de20fc6a5a Replace two expressions with cmd_head 2022-12-19 10:46:58 +01:00
Yuri D'Elia 5ab0dcb4c5 Allow M310 to bypass the Stopped state for recovery
Since M310 cannot change the heaters, allowing M310 S0 (and changing
parameters) allows to recover a usb-controlled printer which has been
locked-out due to bad model settings.
2022-12-19 10:46:45 +01:00
Yuri D'Elia 42125b4bb2 Keep a pointer past the line number in cmdqueue
This allows to skip line numbers transparently and perform faster
checks on the actual command to process.
2022-12-19 10:46:33 +01:00
Yuri D'Elia c890c9e8b0 TM: Do not lockout the menus on thermal errors
This prevents the ability to run gcode from the SD card.

In a thermal error with faulty values, and without serial access, this
is the only way to process an M310 instruction and recover.
2022-12-19 10:46:17 +01:00
3d-gussner d59dfc7bc7 Remove unused community translations 2022-12-16 16:08:55 +01:00
3d-gussner 4c8afd8550 Shorten French translation
Fix cherry-pick issue Remove new MMU2 messages
2022-12-16 15:58:29 +01:00
3d-gussner 263a4959d7 Fix `µ` character shown on translations
Fix cherry-pick issues
2022-12-16 15:58:29 +01:00
Yuri D'Elia 4438aa4909 TM: reset fan measuring state when changing speed
Ensure that fan checks are reset and use the new speed at each step of
the calibration.

This also gives extra time to the fan to ramp-up from a cold start,
when a fancheck could previously start right *after* the speed change.

Should fix #3791
2022-12-16 15:31:34 +01:00
Yuri D'Elia f81b2a00c1 Restore the previous model state when performing a nozzle change
Do not force-enable the model if it was previously disabled.

Fix cherry-pick issue lcd_show_fullscreen_message_yes_no_and_wait_P
2022-12-15 06:42:21 +01:00
Yuri D'Elia f194bb1242 wizard: Allow finishing the calibration through menus
If the wizard is interrupted during model calibration, allow the
menu to mark "temperature model" calibration as complete.
2022-12-15 06:32:56 +01:00
Yuri D'Elia 41be93735c eeprom: Document new calibration state 2022-12-15 06:32:35 +01:00
Yuri D'Elia 4ce808c98b wizard: Rework the thermal model calibration logic
- Correctly sequence the enqueued commands in order to check for the
  real calibration result.
- Perform autocalibration with self-check enabled.
- Only save/continue the wizard if autocalibration succeeds.
2022-12-15 06:32:14 +01:00
Yuri D'Elia 6d83a494d6 selftest: Handle thermal errors in lcd_selfcheck_check_heater
- Simplify lcd_selfcheck_check_heater loop
- Check for/abort on Stopped (indicating a thermal failure).
2022-12-15 06:32:01 +01:00
Yuri D'Elia d2019b70f2 Remove M999 remnants
This was already removed in fc10ca3146
but got reinstated by mistake in the mmu2 merge.

Also remove another incorrect Stopped usage.
2022-12-15 06:31:18 +01:00
Yuri D'Elia c7812063d9 TM: Restore all original values if autotune fails
- Ensures repeated autotune attempts with self-check can't succeed due
  to different starting conditions.
- Allows for a simpler workflow during selftest and wizard if autotune
  fails.
2022-12-15 06:29:24 +01:00
Yuri D'Elia f6c16455bb TM: Store only the last autotune result state
- Remove tm::valid and temp_model_valid as it's a duplicate of the
  calibrated() state.
- Add temp_model_autotune_result() for future use.
2022-12-15 06:29:10 +01:00
Yuri D'Elia dac73c9582 TM: Set default resistance levels for MK3/MK3S
Provide average calibrated values for all fan levels for MK3/MK3S
variants and enable the model by default.

This ensures the calibration step is not skipped unless explicitly
disabled.

Force-clear fan values during autotune to restore the previous
calibration behavior, as fan resistance levels can be too big and
prevent the autotune-with-selfcheck to fail.
2022-12-15 06:28:57 +01:00
Yuri D'Elia d84231f2d5 Fix potential buffer overflow in LCD messages 2022-12-15 06:28:46 +01:00
Yuri D'Elia 6a3d82e492 TM: Remove unnecessary display comments
Favor code readability
2022-12-15 06:28:22 +01:00
Yuri D'Elia 1e19eedf26
Merge pull request #3806 from 3d-gussner/MK3_3.12_Fix_M862.4_strict
MK3_3.12: Fix `M862.4` with [strict] mode
2022-12-12 13:04:12 +01:00
Yuri D'Elia a6eff8f8a5 Simplify firmware/gcode version comparisons
Fix cherry-pick issue
2022-12-12 12:43:13 +01:00
3d-gussner be668c89af
Merge pull request #3808 from 3d-gussner/MK3_3.12_Nozzle_change_community_translations
MK3_3.12: Nozzle change community translations
2022-12-07 07:19:53 +01:00
3d-gussner 571895412d
Merge pull request #3804 from 3d-gussner/MK3_3.12_Shorten_French
MK3_3.12: Shorten French translation
2022-12-06 16:02:49 +01:00
3d-gussner 732fb9dbfc
Merge pull request #3803 from 3d-gussner/MK3_3.12_FARM_Nozzle_change_menu
MK3_3.12: Add Nozzle change menu to FARM mode under Settings
2022-12-06 16:02:15 +01:00
3d-gussner 9f22478c35 Update lang/po/Firmware_no.po
Co-authored-by: OS-kar <104255741+OS-kar@users.noreply.github.com>
2022-12-06 15:58:44 +01:00
3d-gussner 8f1c11b016 Update Swedish translation 2022-12-06 15:58:22 +01:00
3d-gussner 1b659c5ded Update Nozzle change community translations 2022-12-06 15:57:34 +01:00
3d-gussner 49506b5348 Fix `M862.4` with [strict] mode
Max 8 falvor versions

Fix cherry-pick issues
2022-12-06 13:31:44 +01:00
3d-gussner 62eee7ddff Shorten French translation 2022-12-06 11:31:18 +01:00
3d-gussner a1da5ed1ad Add Nozzle change menu to FARM mode under Settings
Fix cherry-pick issue
2022-12-06 11:28:21 +01:00
3d-gussner b2b8fee015
Merge pull request #3790 from 3d-gussner/MK3_3.12_Nozzle_change
Fix yes no for Nozzle change
2022-11-30 17:59:34 +01:00
3d-gussner 12fc82fc36 Fix yes no 2022-11-30 16:16:57 +01:00
3d-gussner b5b4e4d335
Merge pull request #3789 from 3d-gussner/MK3_3.12_Nozzle_change
Mk3 3.12 nozzle change
2022-11-30 15:51:17 +01:00
3d-gussner 6062a507d9
Merge pull request #3770 from 3d-gussner/MK3_3_12_Temp_model_cal_wizard
PFW-1434: MK3_3.12 Temp model calibration during wizard
2022-11-30 15:34:01 +01:00
3d-gussner 7a42af1ba6 Update internal translations
Fix G28 W
2022-11-30 15:23:31 +01:00
Alex Voinea ade8a87a3f fullscreen message: use \n to force the next word on the next line
Useful for printing short URLs since those contain punctuation characters, which get treated at the end of a word under usual circumstances
2022-11-30 15:23:07 +01:00
Alex Voinea 8261712635 Fix recursion 2022-11-30 15:22:42 +01:00
3d-gussner d87f499443 Nozzle change menu
Fix cherry pick
2022-11-30 15:20:44 +01:00
3d-gussner 7ca4d73d4a Updated community languages
Thanks to @ingbrzy @shatter136 @Hauzman
2022-11-30 08:09:33 +01:00
3d-gussner ac55c103a4 Update internal translations
Fix typo
2022-11-24 11:03:04 +01:00
D.R.racer a03183723c Fix & optimize FW version parsing and checking
PFW-1433
2022-11-23 13:58:55 +01:00
D.R.racer 2a7f75c2c3 Update CS translation 2022-11-22 08:42:00 +01:00
3d-gussner 6d7d5d4ef3 Fix typo
Add Norwegian translations thanks to @OS-kar
2022-11-22 08:31:12 +01:00
3d-gussner 696117e73b Fix cherry-pick 2022-11-20 11:14:06 +01:00
3d-gussner 6e330c11a7 Update Temp Model messages
Deepl translate cs,de,es,fr,it,nl,pl
2022-11-20 11:12:20 +01:00
3d-gussner f8edad2fba Unhack selftest hack during wizard 2022-11-20 11:05:45 +01:00
Alex Voinea 0f70665e44 XYZ calibration fixes 2022-11-20 11:05:26 +01:00
Alex Voinea 7e9d9ade5c Fix wizard serial messages 2022-11-20 11:03:06 +01:00
3d-gussner 7fe1a50899 Inital Temp Model cal wizard 2022-11-20 11:02:38 +01:00
DRracer 12f6f34cf4
Merge pull request #3752 from 3d-gussner/MK3_3.12_v3.12.0-RC1
Bump up build number to 5576
2022-11-14 14:35:19 +01:00
3d-gussner a8de9d5696 Bump up build number to 5576
+2 for https://github.com/prusa3d/Prusa-Firmware/pull/3745
+1 commit
+1 merge
2022-11-14 14:17:11 +01:00
3d-gussner 44763f71c0
Merge pull request #3747 from leptun/3.12_MK2.5_XYZ_Cal_fixes
MK2.5: unblock planner after plan_abort_hard()
2022-11-11 09:44:43 +01:00
Alex Voinea 478a9a6cec MK2.5: unblock planner after plan_abort_hard() 2022-11-11 09:17:17 +01:00
3d-gussner e109da4db9
Merge pull request #3741 from 3d-gussner/MK3_3.12_Pre-release_RC1
MK3 3.12.0-RC1 pre-release
2022-11-07 11:04:54 +01:00
3d-gussner de562800ca Fix Long-press cherry-pick from https://github.com/prusa3d/Prusa-Firmware/pull/3737
Fix eeprom documentation
Update pot and po files as pre-release task
Bump up to FW 3.12.0-RC1 and build number +2 (+1 commit + 1 merge)
2022-11-07 10:37:43 +01:00
Guðni Már Gilbert e9b7763af6 Fix long-press LCD inactivity timeout
Fixes #3715

When a long-press is triggered, the LCD inactivity timer
needs to be restarted. This is done with lcd_timeoutToStatus.start()

This also fixes situations where a long-press is triggered, and the timer
times out immediately (because it was not reset properly)

Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
2022-11-07 10:11:35 +01:00
DRracer 5355f51ba3
Merge pull request #3720 from 3d-gussner/MK3_312_Temp_Model_menu
MK3_3.12: Add Menu Calibration -> Temp Model cal.
2022-11-03 12:13:40 +01:00
3d-gussner be0f690116 Revert one message 2022-11-03 12:11:28 +01:00
3d-gussner b470e43233 Update Norwegian translation
All credits to @OS-kar
2022-11-03 12:11:28 +01:00
3d-gussner 4785eedc06 Fix typo
Add lcd_setatatus_serial to output lcd status message and serial at the same time
2022-11-02 10:19:16 +01:00
3d-gussner d42d6d94c4
Merge pull request #3721 from 3d-gussner/MK3_312_translations
Update trasnlations for MK3_3.12 branch
2022-11-02 06:52:48 +01:00
3d-gussner 615073560a Update trasnlations for MK3_3.12 branch 2022-10-28 08:41:55 +02:00
3d-gussner 67877acbf6 Fix MK25/S builds 2022-10-28 05:39:42 +02:00
3d-gussner 6d358187ff Temp Model cal. menu 2022-10-28 05:39:14 +02:00
3d-gussner 71c9213e3a
Update Firmware_sk.po for MK3_3.12 (#3662)
Update Firmware_sk.po

Co-authored-by: ingbrzy <ingbrzy@miuios.cz>
2022-10-24 08:18:34 +02:00
3d-gussner c0a5eac1a9 Update `Runouts` and `Gcode` translations 2022-10-24 08:16:01 +02:00
Hauzman ba66daded6 Fix typo, update missing translation
Fix again cherry-pick issues
2022-10-24 08:16:01 +02:00
Hauzman 121a7e8e15 Update MMU RO Language
Co-Authored-By: Alex Voinea <voinea.dragos.alexandru@gmail.com>

Fix cherry-pick issues
2022-10-24 08:16:01 +02:00
3d-gussner cb5e6d700b Rename Sheets
- `Satin 1` to `Satin  `
- `Satin 2` to `NylonPA`
2022-10-24 08:07:18 +02:00
AttilaSVK e9f5dc7ac5 Updated Hungarian translation for MK3_3.12
Fix few cherry-pick issues
2022-10-24 08:06:15 +02:00
3d-gussner ac3ce856f9
Merge pull request #3702 from 3d-gussner/MK3_312_Hotend_fan
PFW-1415: Rename `Extruder fan` to `Hotend fan` MK3_3.12
2022-10-19 08:58:30 +02:00
3d-gussner fac6d42151
Merge pull request #3704 from 3d-gussner/MK3_312_Croatian
Update Croatian translation MK3_3.12
2022-10-19 08:49:24 +02:00
3d-gussner 8f542eca59
Merge pull request #3703 from 3d-gussner/MK3_312_diacritics
Update diacritics MK3_3.12
2022-10-19 08:49:08 +02:00
3d-gussner 933bd2b3f6 Update Croatian translation
All credits to @prime1910

Fix cherry-pick issues
2022-10-19 07:28:38 +02:00
3d-gussner 41df289102 Update diacritics 2022-10-19 07:05:59 +02:00
3d-gussner 1b08776873 Change fan RPM display to 5 digits
All credits to @ WarrenSchultz for initial PR https://github.com/prusa3d/Prusa-Firmware/pull/3656
2022-10-19 07:01:54 +02:00
3d-gussner 162ab4538f rename `Extruder fan` to `Hotend fan`
Fix cherry-pick issues
2022-10-19 07:01:07 +02:00
Alex Voinea b62dde7aa5
Merge pull request #3678 from leptun/3.12.0_fix_miniRambo_SD_init
3.12.0 Enable MISO pullup during SD CMD0
2022-10-10 15:11:41 +02:00
Alex Voinea 00de54adfb Enable MISO pullup during SD CMD0
fix typo
2022-10-10 09:43:07 +02:00
3d-gussner d9e8b18569
Merge pull request #3667 from 3d-gussner/MK3_3.12_fix_eeprom_documentation_part2
MK3_3.12 fix eeprom doxygen documentation
2022-10-07 08:25:46 +02:00
3d-gussner b2a4194525
Merge pull request #3666 from 3d-gussner/MK3_3.12_tm_cal_click
TM: Consume LCD click after calibration for MK3_3.12
2022-10-06 15:39:44 +02:00
3d-gussner a061f4ec32 Fix Typo 0X0 to 0x0 2022-10-06 15:34:59 +02:00
3d-gussner 76cc9b9c20 Add Temp Model eeprom documentation 2022-10-06 15:34:24 +02:00
3d-gussner 07ad255f7d replace tab with spaces
fix cherry-pick issues
2022-10-06 15:33:24 +02:00
Yuri D'Elia ae1c88823c Also consume longpress in lcd_consume_click() 2022-10-06 15:22:08 +02:00
Yuri D'Elia 8ae499c352 TM: Consume LCD click after calibration
Consume any pending LCD click after the temperature model calibration.
Since we're already in the status menu, the usual consume action is not
done automatically here.
2022-10-06 15:21:52 +02:00
3d-gussner d971944d1a
Merge pull request #3651 from 3d-gussner/MK3_312_Arduino_Boards_106
Update PF-build.sh to use Arduino_boards 1.6.0 which is same as devel…
2022-10-04 08:08:21 +02:00
3d-gussner 4b384f3694 Remove gawk 2022-10-03 16:41:03 +02:00
3d-gussner b62d36face Update PF-build.sh to use Arduino_boards 1.6.0 which is same as devel 1.0.5-2 2022-10-03 16:31:37 +02:00
3d-gussner fc614a6e76
Merge pull request #3635 from 3d-gussner/MK3_3.12
Version changed (3.12.0-BETA1 build 5536)
2022-09-29 20:04:21 +02:00
3d-gussner 350b2a6993 Version changed (3.12.0-BETA1 build 5536) 2022-09-29 19:57:46 +02:00
3d-gussner 784f1f77b6
Merge pull request #3634 from 3d-gussner/MK3_3.12
Cherry-pick from PR3633
2022-09-29 18:17:51 +02:00
3d-gussner 04396243a9 Update Firmware.pot and Firmware_xx.po files 2022-09-29 17:52:23 +02:00
3d-gussner 6c6f6abfc0 Rename EN_ONLY to EN_FARM
remove DEBUG/DEVEL/ALPHA/BETA lcd warning

Fix cherry-pick issues
2022-09-29 17:47:05 +02:00
3d-gussner ff85e8e100 BETA firmware message only in English
Rephrase BETA firmware message to fit on two screens
ALPHA message same as DEVEL
Fix ALPHA DEVEL message

Fix cherry-pick and use MSG_AUTODEPLETE
2022-09-29 17:25:41 +02:00
Yuri D'Elia aa721cafd9 lcd_print_pad: do not overflow len when truncating the string 2022-09-26 12:18:47 +02:00
Yuri D'Elia 6bee4fec8d Remove unneeded lcd_finishstatus() 2022-09-23 14:55:03 +02:00
Yuri D'Elia b710ca0e58 Improve warning behavior during thermal anomaly
The current code forces any warning to return the user to the status
screen in order to show the message.

Thermal anomaly warnings can repeat at very short intervals, making menu
navigation (to pause/tune the print) impossible.

We now check if the message to be displayed is the same and only force a
kickback for new messages.

This partially reverts https://github.com/prusa3d/Prusa-Firmware/pull/3600
since we need the string to be null terminated for ease of comparison.

We pad the status line at display time instead using the new
lcd_print_pad() function which achieves the same effect.
2022-09-23 14:55:03 +02:00
Yuri D'Elia d4aeddf90d
Merge pull request #3619 from wavexx/fixes_round2
Do not hang during startup
2022-09-21 16:27:34 +02:00
Yuri D'Elia bb0489cba6 Do not hang during startup
In ultralcd_init() do not use lcd_setstatuspgm() to initialize the
welcome message.

The internal call to lcd_finishstatus() requires the serial to be
already available. Split the function into lcd_padstatus() to pre-pad
the string and save some space.
2022-09-21 16:19:08 +02:00
Yuri D'Elia 081501f832
Merge pull request #3617 from wavexx/merge_mk3_fixes
Merge important bugfixes for the next 3.12 release
2022-09-21 15:18:13 +02:00
Alex Voinea 7bd9e5e06e Move strings to progmem 2022-09-21 15:09:27 +02:00
Yuri D'Elia 140961290d Do not reset line on serial commands without N
Fix regression introduced in fc10ca3146.

Accept incoming serial commands without line numbers (assumed to be
injected by the host), but do not reset the last line count when doing
so.
2022-09-21 15:05:21 +02:00
Yuri D'Elia 2bd4aef23e Temperature model: update R0 estimate
Update the default R0 estimate thanks to a larger dataset.
This improves the error margin during self-check.
2022-09-21 15:05:05 +02:00
Guðni Már Gilbert 9bff10add5 Don't inline the function
Change in memory:
Flash: -44 bytes
SRAM: 0 bytes
2022-09-21 15:04:40 +02:00
Guðni Már Gilbert b1bee597aa Remove atomic_update parameter
Change in memory:
Flash: +24 bytes
SRAM: -0 byte
2022-09-21 15:04:40 +02:00
Guðni Már Gilbert b2530eeb13 Optimisation: Remove duplicated code in cmdqueue_could_enqueue_back()
Code is 28 lines shorter :)

Change in memory:
Flash: -42 bytes
SRAM: 0 bytes
2022-09-21 15:04:40 +02:00
Guðni Már Gilbert 33495d7516 Remove redundant for-loop
Now that lcd_status_message is now initialised correctly at boot-up,
this for-loop is no longer required. Now lcd_status_message is
only set in lcd_updatestatus() which always calls lcd_finishstatus()

lcd_finishstatus() makes sure the message does not exceed 20 characters

Saves 34 bytes of flash
2022-09-21 15:02:26 +02:00
Guðni Már Gilbert 540ce31082 Don't initialise lcd status message in definition
static variables are automatically zero initialised. Now that the
status line message is initialised in ultralcd_init(), we don't
need to set the variable in global scope.

Saves 22 bytes of flash and 1 byte of SRAM
2022-09-21 15:02:26 +02:00
Guðni Már Gilbert 336c41ffe3 Initialise status line message in setup()
Fixes #3581
2022-09-21 15:02:26 +02:00
Alex Voinea 9225c5e28b Show firmware version on splash screen 2022-09-21 14:59:36 +02:00
Yuri D'Elia 8cfd48cb08
Merge pull request #3608 from wavexx/set_312_version
Update FW version for 3.12 branch
2022-09-21 14:37:02 +02:00
Yuri D'Elia 178b3e1db4 Update current FW version 2022-09-19 18:11:19 +02:00
60 changed files with 9673 additions and 17052 deletions

View File

@ -11,11 +11,11 @@ before_install:
script:
- cp Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h Firmware/Configuration_prusa.h
- bash -x build.sh || { echo "1_75mm_MK3S-EINSy10a-E3Dv6full variant failed" && false; }
- bash -x build.sh EN_ONLY || { echo "1_75mm_MK3S-EINSy10a-E3Dv6full EN_ONLY failed" && false; }
- bash -x build.sh EN_FARM || { echo "1_75mm_MK3S-EINSy10a-E3Dv6full EN_FARM failed" && false; }
- rm Firmware/Configuration_prusa.h
- cp Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h Firmware/Configuration_prusa.h
- bash -x build.sh || { echo "1_75mm_MK3-EINSy10a-E3Dv6full variant failed" && false; }
- bash -x build.sh EN_ONLY || { echo "1_75mm_MK3-EINSy10a-E3Dv6full EN_ONLY failed" && false; }
- bash -x build.sh EN_FARM || { echo "1_75mm_MK3-EINSy10a-E3Dv6full EN_FARM failed" && false; }
- rm Firmware/Configuration_prusa.h
- cp Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h Firmware/Configuration_prusa.h
- bash -x build.sh || { echo "1_75mm_MK25S-RAMBo13a-E3Dv6full variant failed" && false; }

View File

@ -17,17 +17,17 @@ extern PGM_P sPrinterName;
// Firmware version
#define FW_MAJOR 3
#define FW_MINOR 11
#define FW_REVISION 1
#define FW_MINOR 12
#define FW_REVISION 2
//#define FW_FLAVOR RC //uncomment if DEBUG, DEVEL, ALPHA, BETA or RC
//#define FW_FLAVERSION 1 //uncomment if FW_FLAVOR is defined and versioning is needed.
//#define FW_FLAVERSION 1 //uncomment if FW_FLAVOR is defined and versioning is needed. Limited to max 8.
#ifndef FW_FLAVOR
#define FW_VERSION STR(FW_MAJOR) "." STR(FW_MINOR) "." STR(FW_REVISION)
#else
#define FW_VERSION STR(FW_MAJOR) "." STR(FW_MINOR) "." STR(FW_REVISION) "-" STR(FW_FLAVOR) "" STR(FW_FLAVERSION)
#endif
#define FW_COMMIT_NR 4987
#define FW_COMMIT_NR 5713
// FW_VERSION_UNKNOWN means this is an unofficial build.
// The firmware should only be checked into github with this symbol.
@ -532,31 +532,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
#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.
// Calibration status of the machine, to be stored into the EEPROM,
// (unsigned char*)EEPROM_CALIBRATION_STATUS
enum CalibrationStatus
{
// Freshly assembled, needs to peform a self-test and the XYZ calibration.
CALIBRATION_STATUS_ASSEMBLED = 255,
// For the wizard: self test has been performed, now the XYZ calibration is needed.
CALIBRATION_STATUS_XYZ_CALIBRATION = 250,
// For the wizard: factory assembled, needs to run Z calibration.
CALIBRATION_STATUS_Z_CALIBRATION = 240,
// The XYZ calibration has been performed, now it remains to run the V2Calibration.gcode.
CALIBRATION_STATUS_LIVE_ADJUST = 230,
// Calibrated, ready to print.
CALIBRATION_STATUS_CALIBRATED = 1,
// Legacy: resetted by issuing a G86 G-code.
// This value can only be expected after an upgrade from the initial MK2 firmware releases.
// Currently the G86 sets the calibration status to
CALIBRATION_STATUS_UNKNOWN = 0,
};
// 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

View File

@ -65,7 +65,4 @@ FORCE_INLINE void Config_StoreSettings() {}
FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
#endif
inline uint8_t calibration_status() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS); }
inline void calibration_status_store(uint8_t status) { eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS, status); }
inline bool calibration_status_pinda() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA); }
#endif//CONFIG_STORE_H

View File

@ -598,7 +598,7 @@ void dcode_9()
void dcode_10()
{//Tell the printer that XYZ calibration went OK
LOG("D10 - XYZ calibration = OK\n");
calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
calibration_status_set(CALIBRATION_STATUS_XYZ);
}
/*!

View File

@ -385,7 +385,9 @@ 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

View File

@ -84,6 +84,7 @@
#include "Prusa_farm.h"
#include <avr/wdt.h>
#include <util/atomic.h>
#include <avr/pgmspace.h>
#include "Dcodes.h"
@ -678,7 +679,7 @@ void crashdet_cancel()
saved_printing = false;
tmc2130_sg_stop_on_crash = true;
if (saved_printing_type == PRINTING_TYPE_SD) {
lcd_print_stop();
print_stop();
}else if(saved_printing_type == PRINTING_TYPE_USB){
SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL); //for Octoprint: works the same as clicking "Abort" button in Octoprint GUI
cmdqueue_reset();
@ -700,10 +701,40 @@ void failstats_reset_print()
#endif
}
void softReset()
{
void watchdogEarlyDisable(void) {
// Regardless if the watchdog support is enabled or not, disable the watchdog very early
// after the program starts since there's no danger in doing this.
// The reason for this is because old bootloaders might not handle the watchdog timer at all,
// leaving it enabled when jumping to the program. This could cause another watchdog reset
// during setup() if not handled properly. So to avoid any issue of this kind, stop the
// watchdog timer manually.
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
wdt_reset();
MCUSR &= ~_BV(WDRF);
wdt_disable();
}
}
void softReset(void) {
cli();
wdt_enable(WDTO_15MS);
#ifdef WATCHDOG
// If the watchdog support is enabled, use that for resetting. The timeout value is customized
// for each board since the miniRambo ships with a bootloader which doesn't properly handle the
// WDT. In order to avoid bootlooping, the watchdog is set to a value large enough for the
// usual timeout of the bootloader to pass.
wdt_enable(WATCHDOG_SOFT_RESET_VALUE);
#else
#warning WATCHDOG not defined. See the following comment for more details about the implications
// In case the watchdog is not enabled, the reset is acomplished by jumping to the bootloader
// vector manually. This however is somewhat dangerous since the peripherals don't get reset
// by this operation. Considering this is not going to be used in any production firmware,
// it can be left as is and just be cautious with it. The only way to accomplish a peripheral
// reset is by an external reset, by a watchdog reset or by a power cycle. All of these options
// can't be accomplished just from software. One way to minimize the dangers of this is by
// setting all dangerous pins to INPUT before jumping to the bootloader, but that still doesn't
// reset other peripherals such as UART, timers, INT, PCINT, etc...
asm volatile("jmp 0x3E000");
#endif
while(1);
}
@ -758,9 +789,10 @@ static void factory_reset(char level)
case 3: // Level 3: Preparation after being serviced
// Force language selection at the next boot up.
lang_reset();
// Force the "Follow calibration flow" message at the next boot up.
calibration_status_store(CALIBRATION_STATUS_Z_CALIBRATION);
eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); //run wizard
// Force the wizard in "Follow calibration flow" mode at the next boot up
calibration_status_clear(CALIBRATION_FORCE_PREP);
eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 2);
farm_disable();
#ifdef FILAMENT_SENSOR
@ -798,7 +830,7 @@ int uart_putchar(char c, FILE *)
void lcd_splash()
{
lcd_clear(); // clears display and homes screen
lcd_puts_P(PSTR("\n Original Prusa i3\n Prusa Research"));
lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION));
}
@ -839,30 +871,31 @@ void factory_reset()
}
KEEPALIVE_STATE(IN_HANDLER);
}
#if 0
void show_fw_version_warnings() {
if (FW_DEV_VERSION == FW_VERSION_GOLD || FW_DEV_VERSION == FW_VERSION_RC) return;
switch (FW_DEV_VERSION) {
case(FW_VERSION_ALPHA): lcd_show_fullscreen_message_and_wait_P(_i("You are using firmware alpha version. This is development version. Using this version is not recommended and may cause printer damage.")); break;////MSG_FW_VERSION_ALPHA c=20 r=8
case(FW_VERSION_BETA): lcd_show_fullscreen_message_and_wait_P(_i("You are using firmware beta version. This is development version. Using this version is not recommended and may cause printer damage.")); break;////MSG_FW_VERSION_BETA c=20 r=8
case(FW_VERSION_BETA): lcd_show_fullscreen_message_and_wait_P(MSG_FW_VERSION_BETA); break;
case(FW_VERSION_ALPHA):
case(FW_VERSION_DEVEL):
case(FW_VERSION_DEBUG):
lcd_update_enable(false);
lcd_clear();
#if FW_DEV_VERSION == FW_VERSION_DEVEL
#if (FW_DEV_VERSION == FW_VERSION_DEVEL || FW_DEV_VERSION == FW_VERSION_ALPHA)
lcd_puts_at_P(0, 0, PSTR("Development build !!"));
#else
lcd_puts_at_P(0, 0, PSTR("Debbugging build !!!"));
#endif
lcd_puts_at_P(0, 1, PSTR("May destroy printer!"));
lcd_puts_at_P(0, 2, PSTR("ver ")); lcd_puts_P(PSTR(FW_VERSION_FULL));
lcd_puts_at_P(0, 3, PSTR(FW_REPOSITORY));
lcd_puts_at_P(0, 2, PSTR("FW")); lcd_puts_P(PSTR(FW_VERSION_FULL));
lcd_puts_at_P(0, 3, PSTR("Repo: ")); lcd_puts_P(PSTR(FW_REPOSITORY));
lcd_wait_for_click();
break;
// default: lcd_show_fullscreen_message_and_wait_P(_i("WARNING: This is an unofficial, unsupported build. Use at your own risk!")); break;////MSG_FW_VERSION_UNKNOWN c=20 r=8
}
lcd_update_enable(true);
}
#endif
//! @brief try to check if firmware is on right type of printer
static void check_if_fw_is_on_right_printer(){
@ -1059,6 +1092,8 @@ static void xflash_err_msg()
// are initialized by the main() routine provided by the Arduino framework.
void setup()
{
watchdogEarlyDisable();
timer2_init(); // enables functional millis
mmu_init();
@ -1265,11 +1300,14 @@ void setup()
temp_mgr_init();
#ifdef EXTRUDER_ALTFAN_DETECT
SERIAL_ECHORPGM(_n("Extruder fan type: "));
if (extruder_altfan_detect())
SERIAL_ECHOLNRPGM(PSTR("ALTFAN"));
else
SERIAL_ECHOLNRPGM(PSTR("NOCTUA"));
if (eeprom_read_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE) == EEPROM_EMPTY_VALUE) {
eeprom_update_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE, 0);
SERIAL_ECHORPGM(_n("Hotend fan type: "));
if (extruder_altfan_detect())
SERIAL_ECHOLNRPGM(PSTR("ALTFAN"));
else
SERIAL_ECHOLNRPGM(PSTR("NOCTUA"));
}
#endif //EXTRUDER_ALTFAN_DETECT
plan_init(); // Initialize planner;
@ -1506,7 +1544,9 @@ void setup()
if (!farm_mode) {
check_if_fw_is_on_right_printer();
#if 0
show_fw_version_warnings();
#endif
}
switch (hw_changed) {
@ -1532,49 +1572,64 @@ void setup()
lcd_show_fullscreen_message_and_wait_P(_i("Old settings found. Default PID, Esteps etc. will be set.")); //if EEPROM version or printer type was changed, inform user that default setting were loaded////MSG_DEFAULT_SETTINGS_LOADED c=20 r=6
Config_StoreSettings();
}
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) >= 1) {
lcd_wizard(WizState::Run);
}
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 0) { //dont show calibration status messages if wizard is currently active
if (calibration_status() == CALIBRATION_STATUS_ASSEMBLED ||
calibration_status() == CALIBRATION_STATUS_UNKNOWN ||
calibration_status() == CALIBRATION_STATUS_XYZ_CALIBRATION) {
// Reset the babystepping values, so the printer will not move the Z axis up when the babystepping is enabled.
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
// Show the message.
lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW));
}
else if (calibration_status() == CALIBRATION_STATUS_LIVE_ADJUST) {
// Show the message.
lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET));
lcd_update_enable(true);
}
else if (calibration_status() == CALIBRATION_STATUS_CALIBRATED && eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() == false) {
//lcd_show_fullscreen_message_and_wait_P(_i("Temperature calibration has not been run yet"));////MSG_PINDA_NOT_CALIBRATED c=20 r=4
lcd_update_enable(true);
}
else if (calibration_status() == CALIBRATION_STATUS_Z_CALIBRATION) {
// Show the message.
lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW));
}
}
#if !defined (DEBUG_DISABLE_FORCE_SELFTEST) && defined (TMC2130)
if (force_selftest_if_fw_version() && calibration_status() < CALIBRATION_STATUS_ASSEMBLED) {
lcd_show_fullscreen_message_and_wait_P(_i("Selftest will be run to calibrate accurate sensorless rehoming."));////MSG_FORCE_SELFTEST c=20 r=8
update_current_firmware_version_to_eeprom();
lcd_selftest();
// handle FW and calibration status upgrade
bool run_wizard = false;
if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) {
CalibrationStatus calibration_status = 0;
if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) {
// calibrated printer upgraded from FW<3.12
calibration_status |= (CALIBRATION_STATUS_SELFTEST | CALIBRATION_STATUS_XYZ | CALIBRATION_STATUS_Z | CALIBRATION_STATUS_LIVE_ADJUST);
static const uint16_t v3_2_0_4[] PROGMEM = {3, 2, 0, 4};
if (eeprom_fw_version_older_than_p(v3_2_0_4)) {
// printer upgraded from FW<3.2.0.4 and requires re-running selftest
lcd_show_fullscreen_message_and_wait_P(_i("Selftest will be run to calibrate accurate sensorless rehoming."));////MSG_FORCE_SELFTEST c=20 r=8
calibration_status &= ~CALIBRATION_STATUS_SELFTEST;
}
}
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status);
}
if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) {
if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) {
// we just did a FW upgrade and some (new) wizard step is missing: resume the wizard
run_wizard = true;
}
}
update_current_firmware_version_to_eeprom();
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) {
// first time run of wizard or service prep
lcd_wizard(WizState::Run);
}
else if (run_wizard) {
// some wizard steps required by the upgrade checks
lcd_wizard(WizState::Restore);
}
else {
if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) {
// aborted or missing wizard: show a single warning
lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW));
}
else if (!calibration_status_get(CALIBRATION_STATUS_Z)) {
// wizard reset after service prep
lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW));
} else {
// warn about other important steps individually
if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST))
lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET));
#ifdef TEMP_MODEL
if (!calibration_status_get(CALIBRATION_STATUS_TEMP_MODEL) && temp_model_enabled())
lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL));
#endif //TEMP_MODEL
}
}
#endif //TMC2130 && !DEBUG_DISABLE_FORCE_SELFTEST
KEEPALIVE_STATE(IN_PROCESS);
#endif //DEBUG_DISABLE_STARTMSGS
lcd_update_enable(true);
lcd_clear();
lcd_update(2);
// Store the currently running firmware into an eeprom,
// so the next time the firmware gets updated, it will know from which version it has been updated.
update_current_firmware_version_to_eeprom();
#ifdef TMC2130
tmc2130_home_origin[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN);
@ -1612,11 +1667,11 @@ void setup()
manage_heater(); // Update temperatures
#ifdef DEBUG_UVLO_AUTOMATIC_RECOVER
printf_P(_N("Power panic detected!\nCurrent bed temp:%d\nSaved bed temp:%d\n"), (int)degBed(), eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED));
#endif
#endif
if ( degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET) ){
#ifdef DEBUG_UVLO_AUTOMATIC_RECOVER
puts_P(_N("Automatic recovery!"));
#endif
#endif
recover_print(1);
}
else{
@ -2864,7 +2919,7 @@ static void gcode_G80()
run = true;
repeatcommand_front(); // repeat G80 with all its parameters
enquecommand_front_P(G28W0);
break;
return;
}
run = false;
#endif //PINDA_THERMISTOR
@ -3351,20 +3406,16 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
bool result = sample_mesh_and_store_reference();
if (result)
{
if (calibration_status() == CALIBRATION_STATUS_Z_CALIBRATION)
{
// Shipped, the nozzle height has been set already. The user can start printing now.
calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
}
final_result = true;
// babystep_apply();
calibration_status_set(CALIBRATION_STATUS_Z);
final_result = true;
}
}
else
{
// Reset the baby step value and the baby step applied flag.
calibration_status_store(CALIBRATION_STATUS_XYZ_CALIBRATION);
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST);
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
// Complete XYZ calibration.
uint8_t point_too_far_mask = 0;
BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask);
@ -3404,8 +3455,9 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
if (result >= 0)
{
// Calibration valid, the machine should be able to print. Advise the user to run the V2Calibration.gcode.
calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) != 1) lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET));
calibration_status_set(CALIBRATION_STATUS_XYZ | CALIBRATION_STATUS_Z);
if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE))
lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET));
final_result = true;
}
}
@ -4263,18 +4315,14 @@ void process_commands()
mmu_reset();
}
else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET
#ifdef WATCHDOG
#if defined(XFLASH) && defined(BOOTAPP)
boot_app_magic = BOOT_APP_MAGIC;
boot_app_flags = BOOT_APP_FLG_RUN;
#endif //defined(XFLASH) && defined(BOOTAPP)
softReset();
#elif defined(BOOTAPP) //this is a safety precaution. This is because the new bootloader turns off the heaters, but the old one doesn't. The watchdog should be used most of the time.
asm volatile("jmp 0x3E000");
#endif
}
}
#ifdef PRUSA_SN_SUPPORT
else if (code_seen_P(PSTR("SN"))) { // PRUSA SN
else if (code_seen_P(PSTR("SN"))) { // PRUSA SN
char SN[20];
eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20);
if (SN[19])
@ -4285,11 +4333,11 @@ void process_commands()
#endif //PRUSA_SN_SUPPORT
else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir
SERIAL_PROTOCOLLN(FW_VERSION_FULL);
SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL);
} else if(code_seen_P(PSTR("Rev"))){ // PRUSA Rev
SERIAL_PROTOCOLLN(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE );
SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE );
} else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang
lang_reset();
@ -4542,7 +4590,7 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
retract(false,retracted_swap[active_extruder]);
#else
retract(false);
#endif
#endif
break;
#endif //FWRETRACT
@ -4863,7 +4911,7 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
break;
}
if (calibration_status() >= CALIBRATION_STATUS_XYZ_CALIBRATION) {
if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) {
//we need to know accurate position of first calibration point
//if xyz calibration was not performed yet, interrupt temperature calibration and inform user that xyz cal. is needed
lcd_show_fullscreen_message_and_wait_P(_i("Please run XYZ calibration first.")); ////MSG_RUN_XYZ c=20 r=4
@ -5244,7 +5292,7 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
(Prusa3D specific)
*/
case 86:
calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST);
break;
@ -5255,7 +5303,7 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
(Prusa3D specific)
*/
case 87:
calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST);
break;
/*!
@ -5659,12 +5707,14 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
*/
case 44: // M44: Prusa3D: Reset the bed skew and offset calibration.
// Reset the baby step value and the baby step applied flag.
calibration_status_store(CALIBRATION_STATUS_ASSEMBLED);
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
// Reset the baby step value and the baby step applied flag.
calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST);
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
// Reset the skew and offset in both RAM and EEPROM.
calibration_status_clear(CALIBRATION_STATUS_XYZ);
reset_bed_offset_and_skew();
// Reset world2machine_rotation_and_skew and world2machine_shift, therefore
// the planner will not perform any adjustments in the XY plane.
// Wait for the motors to stop and update the current position with the absolute values.
@ -7345,8 +7395,7 @@ Sigma_Exit:
break;
#endif // NUM_SERVOS > 0
#if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)))
#if (LARGE_FLASH == true && BEEPER > 0 )
/*!
### M300 - Play tone <a href="https://reprap.org/wiki/G-code#M300:_Play_beep_sound">M300: Play beep sound</a>
In Prusa Firmware the defaults are `100Hz` and `1000ms`, so that `M300` without parameters will beep for a second.
@ -7360,12 +7409,19 @@ Sigma_Exit:
*/
case 300: // M300
{
uint16_t beepS = code_seen('S') ? code_value() : 0;
uint16_t beepP = code_seen('P') ? code_value() : 1000;
#if BEEPER > 0
if (beepP > 0)
Sound_MakeCustom(beepP,beepS,false);
#endif
uint16_t beepS;
if (!code_seen('S'))
beepS = 0;
else {
beepS = code_value();
if (!beepS) {
// handle S0 as a pause
_delay(beepP);
break;
}
}
Sound_MakeCustom(beepP, beepS, false);
}
break;
#endif // M300
@ -7530,7 +7586,8 @@ Sigma_Exit:
M310 [ A ] [ F ] ; autotune
M310 [ S ] ; set 0=disable 1=enable
M310 [ I ] [ R ] ; set resistance at index
M310 [ P | C ] ; set power, capacitance
M310 [ P | U | V | C ] ; set power, temperature coefficient, intercept, capacitance
M310 [ D | L ] ; set simulation filter, lag
M310 [ B | E | W ] ; set beeper, warning and error threshold
M310 [ T ] ; set ambient temperature correction
@ -7538,7 +7595,11 @@ Sigma_Exit:
- `I` - resistance index position (0-15)
- `R` - resistance value at index (K/W; requires `I`)
- `P` - power (W)
- `U` - linear temperature coefficient (W/K/power)
- `V` - linear temperature intercept (W/power)
- `C` - capacitance (J/K)
- `D` - sim. 1st order IIR filter factor (f=100/27)
- `L` - sim. response lag (ms, 0-2160)
- `S` - set 0=disable 1=enable
- `B` - beep and warn when reaching warning threshold 0=disable 1=enable (default: 1)
- `E` - error threshold (K/s; default in variant)
@ -7550,30 +7611,39 @@ Sigma_Exit:
case 310:
{
// parse all parameters
float P = NAN, C = NAN, R = NAN, E = NAN, W = NAN, T = NAN;
int8_t I = -1, S = -1, B = -1, A = -1, F = -1;
if(code_seen('C')) C = code_value();
if(code_seen('P')) P = code_value();
float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN;
int8_t I = -1, S = -1, B = -1, F = -1;
int16_t A = -1, L = -1;
if(code_seen('I')) I = code_value_short();
if(code_seen('R')) R = code_value();
if(code_seen('P')) P = code_value();
if(code_seen('U')) U = code_value();
if(code_seen('V')) V = code_value();
if(code_seen('C')) C = code_value();
if(code_seen('D')) D = code_value();
if(code_seen('L')) L = code_value_short();
if(code_seen('S')) S = code_value_short();
if(code_seen('B')) B = code_value_short();
if(code_seen('T')) T = code_value();
if(code_seen('E')) E = code_value();
if(code_seen('W')) W = code_value();
if(code_seen('T')) T = code_value();
if(code_seen('A')) A = code_value_short();
if(code_seen('F')) F = code_value_short();
// report values if nothing has been requested
if(isnan(C) && isnan(P) && isnan(R) && isnan(E) && isnan(W) && isnan(T) && I < 0 && S < 0 && B < 0 && A < 0) {
if(isnan(R) && isnan(P) && isnan(U) && isnan(V) && isnan(C) && isnan(D) && isnan(T) && isnan(W) && isnan(E)
&& I < 0 && S < 0 && B < 0 && A < 0 && L < 0) {
temp_model_report_settings();
break;
}
// update all parameters
if(B >= 0) temp_model_set_warn_beep(B);
if(!isnan(C) || !isnan(P) || !isnan(T) || !isnan(W) || !isnan(E)) temp_model_set_params(C, P, T, W, E);
if(I >= 0 && !isnan(R)) temp_model_set_resistance(I, R);
if(B >= 0)
temp_model_set_warn_beep(B);
if(!isnan(P) || !isnan(U) || !isnan(V) || !isnan(C) || !isnan(D) || (L >= 0) || !isnan(T) || !isnan(W) || !isnan(E))
temp_model_set_params(P, U, V, C, D, L, T, W, E);
if(I >= 0 && !isnan(R))
temp_model_set_resistance(I, R);
// enable the model last, if requested
if(S >= 0) temp_model_set_enabled(S);
@ -7899,7 +7969,7 @@ Sigma_Exit:
### M603 - Stop print <a href="https://reprap.org/wiki/G-code#M603:_Stop_print">M603: Stop print</a>
*/
case 603: {
lcd_print_stop();
print_stop();
}
break;
@ -9703,14 +9773,16 @@ void UnconditionalStop()
// WARNING: This function is called *continuously* during a thermal failure.
//
// This either pauses (for thermal model errors) or stops *without recovery* depending on
// "allow_pause". If pause is allowed, this forces a printer-initiated instantanenous pause (just
// like an LCD pause) that bypasses the host pausing functionality. In this state the printer is
// kept in busy state and *must* be recovered from the LCD.
void ThermalStop(bool allow_pause)
// "allow_recovery". If recovery is allowed, this forces a printer-initiated instantanenous pause
// (just like an LCD pause) that bypasses the host pausing functionality. In this state the printer
// is kept in busy state and *must* be recovered from the LCD.
void ThermalStop(bool allow_recovery)
{
if(Stopped == false) {
Stopped = true;
if(allow_pause && (IS_SD_PRINTING || usb_timer.running())) {
// Either pause or stop the print
if(allow_recovery && (IS_SD_PRINTING || usb_timer.running())) {
if (!isPrintPaused) {
lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL);
@ -9729,14 +9801,11 @@ void ThermalStop(bool allow_pause)
}
} else {
// We got a hard thermal error and/or there is no print going on. Just stop.
lcd_print_stop();
// Also prevent further menu entry
menu_set_block(MENU_BLOCK_THERMAL_ERROR);
print_stop();
}
// Report the status on the serial, switch to a busy state
SERIAL_ERROR_START;
// Report the error on the serial
serialprintPGM(allow_recovery ? echomagic : errormagic);
SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED);
// Eventually report the stopped status on the lcd (though this is usually overridden by a
@ -9746,13 +9815,15 @@ void ThermalStop(bool allow_pause)
// Make a warning sound! We cannot use Sound_MakeCustom as this would stop further moves.
// Turn on the speaker here (if not already), and turn it off when back in the main loop.
WRITE(BEEPER, HIGH);
}
// Return to the status screen to stop any pending menu action which could have been
// started by the user while stuck in the Stopped state. This also ensures the NEW
// error is immediately shown.
if (menu_menu != lcd_status_screen)
// Always return to the status screen to ensure the NEW error is immediately shown.
lcd_return_to_status();
if(!allow_recovery) {
// prevent menu access for all fatal errors
menu_set_block(MENU_BLOCK_THERMAL_ERROR);
}
}
}
bool IsStopped() { return Stopped; };
@ -10452,12 +10523,12 @@ static void temp_compensation_start() {
if ((int)degHotend(active_extruder) > extrude_min_temp) {
current_position[E_AXIS] -= default_retraction;
}
plan_buffer_line_curposXYZE(400, active_extruder);
plan_buffer_line_curposXYZE(400);
current_position[X_AXIS] = PINDA_PREHEAT_X;
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
plan_buffer_line_curposXYZE(3000 / 60);
st_synchronize();
while (fabs(degBed() - target_temperature_bed) > 1) delay_keep_alive(1000);
@ -10476,7 +10547,7 @@ static void temp_compensation_apply() {
int z_shift = 0;
float z_shift_mm;
if (calibration_status() == CALIBRATION_STATUS_CALIBRATED) {
if (calibration_status_pinda()) {
if (target_temperature_bed % 10 == 0 && target_temperature_bed >= 60 && target_temperature_bed <= 100) {
i_add = (target_temperature_bed - 60) / 10;
z_shift = eeprom_read_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i_add);

View File

@ -311,13 +311,16 @@ bool Sd2Card::init(uint8_t sckRateID) {
// must supply min of 74 clock cycles with CS high.
for (uint8_t i = 0; i < 10; i++) spiSend(0XFF);
WRITE(MISO, 1); // temporarily enable the MISO line pullup
// command to go idle in SPI mode
while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) {
if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) {
WRITE(MISO, 0); // disable the MISO line pullup
error(SD_CARD_ERROR_CMD0);
goto fail;
}
}
WRITE(MISO, 0); // disable the MISO line pullup
// send 0xFF until 0xFF received to give card some clock cycles
t0 = (uint16_t)_millis();

View File

@ -273,7 +273,6 @@ void CardReader::startFileprint()
if(cardOK)
{
sdprinting = true;
Stopped = false;
#ifdef SDCARD_SORT_ALPHA
//flush_presort();
#endif

View File

@ -1,3 +1,4 @@
#include <util/atomic.h>
#include "cmdqueue.h"
#include "cardreader.h"
#include "ultralcd.h"
@ -26,10 +27,7 @@ bool comment_mode = false;
char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc
ShortTimer serialTimeoutTimer;
long gcode_N = 0;
long gcode_LastN = 0;
uint32_t sdpos_atomic = 0;
@ -155,7 +153,7 @@ static bool cmdqueue_could_enqueue_front(size_t len_asked)
// len_asked does not contain the zero terminator size.
// This function may update bufindw, therefore for the power panic to work, this function must be called
// with the interrupts disabled!
static bool cmdqueue_could_enqueue_back(size_t len_asked, bool atomic_update = false)
static bool __attribute__((noinline)) cmdqueue_could_enqueue_back(size_t len_asked)
{
// MAX_CMD_SIZE has to accommodate the zero terminator.
if (len_asked >= MAX_CMD_SIZE)
@ -165,61 +163,29 @@ static bool cmdqueue_could_enqueue_back(size_t len_asked, bool atomic_update = f
// Full buffer.
return false;
if (serial_count > 0) {
// If there is some data stored starting at bufindw, len_asked is certainly smaller than
// the allocated data buffer. Try to reserve a new buffer and to move the already received
// serial data.
// How much memory to reserve for the commands pushed to the front?
// End of the queue, when pushing to the end.
size_t endw = bufindw + len_asked + (1 + CMDHDRSIZE);
if (bufindw < bufindr)
// Simple case. There is a contiguous space between the write buffer and the read buffer.
return endw + CMDBUFFER_RESERVE_FRONT <= bufindr;
// Otherwise the free space is split between the start and end.
if (// Could one fit to the end, including the reserve?
endw + CMDBUFFER_RESERVE_FRONT <= sizeof(cmdbuffer) ||
// Could one fit to the end, and the reserve to the start?
(endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr))
return true;
// Could one fit both to the start?
if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) {
// Mark the rest of the buffer as used.
memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw);
// and point to the start.
// Be careful! The bufindw needs to be changed atomically for the power panic & filament panic to work.
if (atomic_update)
cli();
bufindw = 0;
if (atomic_update)
sei();
return true;
}
} else {
// How much memory to reserve for the commands pushed to the front?
// End of the queue, when pushing to the end.
size_t endw = bufindw + len_asked + (1 + CMDHDRSIZE);
if (bufindw < bufindr)
// Simple case. There is a contiguous space between the write buffer and the read buffer.
return endw + CMDBUFFER_RESERVE_FRONT <= bufindr;
// Otherwise the free space is split between the start and end.
if (// Could one fit to the end, including the reserve?
endw + CMDBUFFER_RESERVE_FRONT <= sizeof(cmdbuffer) ||
// Could one fit to the end, and the reserve to the start?
(endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr))
return true;
// Could one fit both to the start?
if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) {
// Mark the rest of the buffer as used.
memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw);
// and point to the start.
// Be careful! The bufindw needs to be changed atomically for the power panic & filament panic to work.
if (atomic_update)
cli();
bufindw = 0;
if (atomic_update)
sei();
return true;
}
// If there is some data stored starting at bufindw, len_asked is certainly smaller than
// the allocated data buffer. Try to reserve a new buffer and to move the already received
// serial data.
// How much memory to reserve for the commands pushed to the front?
// End of the queue, when pushing to the end.
size_t endw = bufindw + len_asked + (1 + CMDHDRSIZE);
if (bufindw < bufindr)
// Simple case. There is a contiguous space between the write buffer and the read buffer.
return endw + CMDBUFFER_RESERVE_FRONT <= bufindr;
// Otherwise the free space is split between the start and end.
if (// Could one fit to the end, including the reserve?
endw + CMDBUFFER_RESERVE_FRONT <= sizeof(cmdbuffer) ||
// Could one fit to the end, and the reserve to the start?
(endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr))
return true;
// Could one fit both to the start?
if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) {
// Mark the rest of the buffer as used.
memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw);
// and point to the start.
// Be careful! The bufindw needs to be changed atomically for the power panic & filament panic to work.
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { bufindw = 0; }
return true;
}
return false;
}
@ -371,7 +337,7 @@ void repeatcommand_front()
void get_command()
{
// Test and reserve space for the new command string.
if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1, true))
if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1))
return;
if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size
@ -400,22 +366,24 @@ void get_command()
comment_mode = false; //for new command
return;
}
cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string
cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string
char* cmd_head = cmdbuffer+bufindw+CMDHDRSIZE; // current command pointer
char* cmd_start = cmd_head; // pointer past the line number (if any)
if(!comment_mode){
gcode_N = 0;
long gcode_N = -1; // seen line number
// Line numbers must be first in buffer
if ((strstr_P(cmdbuffer+bufindw+CMDHDRSIZE, PSTR("PRUSA")) == NULL) &&
(cmdbuffer[bufindw+CMDHDRSIZE] == 'N')) {
(*cmd_head == 'N')) {
// Line number met. When sending a G-code over a serial line, each line may be stamped with its index,
// and Marlin tests, whether the successive lines are stamped with an increasing line number ID
gcode_N = (strtol(cmdbuffer+bufindw+CMDHDRSIZE+1, NULL, 10));
if(gcode_N != gcode_LastN+1 && (strstr_P(cmdbuffer+bufindw+CMDHDRSIZE, PSTR("M110")) == NULL) ) {
// M110 - set current line number.
// Line numbers not sent in succession.
// Line number met: decode the number, then move cmd_start past all spaces.
gcode_N = (strtol(cmd_head+1, &cmd_start, 10));
while (*cmd_start == ' ') ++cmd_start;
// Test whether the successive lines are stamped with an increasing line number ID.
if(gcode_N != gcode_LastN+1 && strncmp_P(cmd_start, PSTR("M110"), 4)) {
// Line numbers not sent in succession and M110 not seen.
SERIAL_ERROR_START;
SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO
SERIAL_ERRORLN(gcode_LastN);
@ -425,10 +393,10 @@ void get_command()
return;
}
if((strchr_pointer = strchr(cmdbuffer+bufindw+CMDHDRSIZE, '*')) != NULL)
if((strchr_pointer = strchr(cmd_start, '*')) != NULL)
{
byte checksum = 0;
char *p = cmdbuffer+bufindw+CMDHDRSIZE;
char *p = cmd_head;
while (p != strchr_pointer)
checksum = checksum^(*p++);
if (code_value_short() != (int16_t)checksum) {
@ -453,12 +421,11 @@ void get_command()
}
// Don't parse N again with code_seen('N')
cmdbuffer[bufindw + CMDHDRSIZE] = '$';
*cmd_head = '$';
}
// if we don't receive 'N' but still see '*'
if ((cmdbuffer[bufindw + CMDHDRSIZE] != 'N') && (cmdbuffer[bufindw + CMDHDRSIZE] != '$') && (strchr(cmdbuffer+bufindw+CMDHDRSIZE, '*') != NULL))
if ((*cmd_head != 'N') && (*cmd_head != '$') && (strchr(cmd_start, '*') != NULL))
{
SERIAL_ERROR_START;
SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM
SERIAL_ERRORLN(gcode_LastN);
@ -466,16 +433,21 @@ void get_command()
serial_count = 0;
return;
}
// Handle KILL early, even when Stopped
if(strcmp(cmdbuffer+bufindw+CMDHDRSIZE, "M112") == 0)
if(strcmp_P(cmd_start, PSTR("M112")) == 0)
kill(MSG_M112_KILL, 2);
// Bypass Stopped for some commands
bool allow_when_stopped = false;
if(strncmp_P(cmd_start, PSTR("M310"), 4) == 0)
allow_when_stopped = true;
// Handle the USB timer
if ((strchr_pointer = strchr(cmdbuffer+bufindw+CMDHDRSIZE, 'G')) != NULL) {
if (!IS_SD_PRINTING) {
usb_timer.start();
}
}
if (Stopped == true) {
if ((*cmd_start == 'G') && !(IS_SD_PRINTING))
usb_timer.start();
if (allow_when_stopped == false && Stopped == true) {
// Stopped can be set either during error states (thermal error: cannot continue), or
// when a printer-initiated action is processed. In such case the printer will send to
// the host an action, but cannot know if the action has been processed while new
@ -490,7 +462,7 @@ void get_command()
// Command is complete: store the current line into buffer, move to the next line.
// Store type of entry
cmdbuffer[bufindw] = gcode_N ? CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR : CMDBUFFER_CURRENT_TYPE_USB;
cmdbuffer[bufindw] = gcode_N >= 0 ? CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR : CMDBUFFER_CURRENT_TYPE_USB;
#ifdef CMDBUFFER_DEBUG
SERIAL_ECHO_START;
@ -506,7 +478,8 @@ void get_command()
++ buflen;
// Update the processed gcode line
gcode_LastN = gcode_N;
if (gcode_N >= 0)
gcode_LastN = gcode_N;
#ifdef CMDBUFFER_DEBUG
SERIAL_ECHOPGM("Number of commands in the buffer: ");
@ -517,7 +490,7 @@ void get_command()
serial_count = 0; //clear buffer
// Don't call cmdqueue_could_enqueue_back if there are no characters waiting
// in the queue, as this function will reserve the memory.
if (MYSERIAL.available() == 0 || ! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1, true))
if (MYSERIAL.available() == 0 || ! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1))
return;
} // end of "end of line" processing
else {
@ -615,7 +588,7 @@ void get_command()
if(card.eof()) break;
// The following line will reserve buffer space if available.
if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1, true))
if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1))
return;
}
else

View File

@ -52,7 +52,6 @@ extern int serial_count;
extern bool comment_mode;
extern char *strchr_pointer;
extern long gcode_N;
extern long gcode_LastN;
extern bool cmdqueue_pop_front();

View File

@ -11,57 +11,22 @@
#include "language.h"
#if 0
template <typename T>
static T eeprom_read(T *address);
template<>
char eeprom_read<char>(char *address)
{
return eeprom_read_byte(reinterpret_cast<uint8_t*>(address));
}
#endif
template <typename T>
static void eeprom_write(T *address, T value);
template<>
void eeprom_write<char>(char *addres, char value)
{
eeprom_write_byte(reinterpret_cast<uint8_t*>(addres), static_cast<uint8_t>(value));
}
template <typename T>
static bool eeprom_is_uninitialized(T *address);
template <>
bool eeprom_is_uninitialized<char>(char *address)
{
return (0xff == eeprom_read_byte(reinterpret_cast<uint8_t*>(address)));
}
bool eeprom_is_sheet_initialized(uint8_t sheet_num)
{
return (0xffff != eeprom_read_word(reinterpret_cast<uint16_t*>(&(EEPROM_Sheets_base->
s[sheet_num].z_offset))));
}
void eeprom_init()
{
if (eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT) == 0xff) eeprom_write_byte((uint8_t*)EEPROM_POWER_COUNT, 0);
if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X) == 0xff) eeprom_write_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0);
if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y) == 0xff) eeprom_write_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0);
if (eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT) == 0xff) eeprom_write_byte((uint8_t*)EEPROM_FERROR_COUNT, 0);
if (eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT) == 0xffff) eeprom_write_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0);
if (eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT) == 0xffff) eeprom_write_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0);
if (eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT) == 0xffff) eeprom_write_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0);
if (eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) == 0xffff) eeprom_write_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0);
eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0);
eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0);
eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0);
eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0);
eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0);
eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0);
eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0);
eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0);
if (eeprom_read_word((uint16_t*)EEPROM_MMU_FAIL_TOT) == 0xffff) eeprom_update_word((uint16_t *)EEPROM_MMU_FAIL_TOT, 0);
if (eeprom_read_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT) == 0xffff) eeprom_update_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT, 0);
if (eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL) == 0xff) eeprom_update_byte((uint8_t *)EEPROM_MMU_FAIL, 0);
if (eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL) == 0xff) eeprom_update_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL, 0);
eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0);
eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0);
eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0);
eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0);
eeprom_init_default_dword((uint32_t*)EEPROM_TOTAL_TOOLCHANGE_COUNT, 0);
if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE)
{
eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), 0);
@ -71,23 +36,13 @@ void eeprom_init()
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep);
}
for (uint_least8_t i = 0; i < (sizeof(Sheets::s)/sizeof(Sheets::s[0])); ++i)
{
bool is_uninitialized = true;
for (uint_least8_t j = 0; j < (sizeof(Sheet::name)/sizeof(Sheet::name[0])); ++j)
{
if (!eeprom_is_uninitialized(&(EEPROM_Sheets_base->s[i].name[j]))) is_uninitialized = false;
}
if(is_uninitialized)
{
SheetName sheetName;
eeprom_default_sheet_name(i,sheetName);
for (uint_least8_t a = 0; a < sizeof(Sheet::name); ++a){
eeprom_write(&(EEPROM_Sheets_base->s[i].name[a]), sheetName.c[a]);
}
}
// initialize the sheet names in eeprom
for (uint_least8_t i = 0; i < (sizeof(Sheets::s)/sizeof(Sheets::s[0])); i++) {
SheetName sheetName;
eeprom_default_sheet_name(i, sheetName);
eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c);
}
if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))))
{
eeprom_switch_to_next_sheet();
@ -95,16 +50,16 @@ void eeprom_init()
check_babystep();
#ifdef PINDA_TEMP_COMP
if (eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION) == 0xff) eeprom_update_byte((uint8_t *)EEPROM_PINDA_TEMP_COMPENSATION, 0);
eeprom_init_default_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, 0);
#endif //PINDA_TEMP_COMP
if (eeprom_read_dword((uint32_t*)EEPROM_JOB_ID) == EEPROM_EMPTY_VALUE32)
eeprom_update_dword((uint32_t*)EEPROM_JOB_ID, 0);
eeprom_init_default_dword((uint32_t*)EEPROM_JOB_ID, 0);
eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0);
eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0);
eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0);
eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1);
if (eeprom_read_byte((uint8_t *)EEPROM_TOTALTIME) == 255 && eeprom_read_byte((uint8_t *)EEPROM_TOTALTIME + 1) == 255 && eeprom_read_byte((uint8_t *)EEPROM_TOTALTIME + 2) == 255 && eeprom_read_byte((uint8_t *)EEPROM_TOTALTIME + 3) == 255) {
eeprom_update_dword((uint32_t *)EEPROM_TOTALTIME, 0);
eeprom_update_dword((uint32_t *)EEPROM_FILAMENTUSED, 0);
}
}
//! @brief Get default sheet name for index
@ -115,8 +70,8 @@ if (eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION) == 0xff) eeprom_u
//! | 1 | Smooth2 |
//! | 2 | Textur1 |
//! | 3 | Textur2 |
//! | 4 | Satin 1 |
//! | 5 | Satin 2 |
//! | 4 | Satin |
//! | 5 | NylonPA |
//! | 6 | Custom1 |
//! | 7 | Custom2 |
//!
@ -134,17 +89,23 @@ void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName)
{
strcpy_P(sheetName.c, PSTR("Textur"));
}
else if (index < 5)
{
strcpy_P(sheetName.c, PSTR("Satin "));
}
else if (index < 6)
{
strcpy_P(sheetName.c, PSTR("Satin "));
strcpy_P(sheetName.c, PSTR("NylonPA"));
}
else
{
strcpy_P(sheetName.c, PSTR("Custom"));
}
sheetName.c[6] = '0' + ((index % 2)+1);
sheetName.c[7] = '\0';
if (index <4 || index >5)
{
sheetName.c[6] = '0' + ((index % 2)+1);
sheetName.c[7] = '\0';
}
}
//! @brief Get next initialized sheet
@ -172,3 +133,97 @@ void eeprom_switch_to_next_sheet()
sheet = eeprom_next_initialized_sheet(sheet);
if (sheet >= 0) eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), sheet);
}
bool __attribute__((noinline)) eeprom_is_sheet_initialized(uint8_t sheet_num) {
return (eeprom_read_word(reinterpret_cast<uint16_t*>(&(EEPROM_Sheets_base->s[sheet_num].z_offset))) != EEPROM_EMPTY_VALUE16);
}
bool __attribute__((noinline)) eeprom_is_initialized_block(const void *__p, size_t __n) {
const uint8_t *p = (const uint8_t*)__p;
while (__n--) {
if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE)
return true;
}
return false;
}
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++));
}
}
void eeprom_toggle(uint8_t *__p) {
eeprom_write_byte(__p, !eeprom_read_byte(__p));
}
void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) {
eeprom_write_byte(__p, eeprom_read_byte(__p) + 1);
}
void __attribute__((noinline)) eeprom_increment_word(uint16_t *__p) {
eeprom_write_word(__p, eeprom_read_word(__p) + 1);
}
void __attribute__((noinline)) eeprom_increment_dword(uint32_t *__p) {
eeprom_write_dword(__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);
}
void __attribute__((noinline)) eeprom_add_word(uint16_t *__p, uint16_t add) {
eeprom_write_word(__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);
}
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);
return def;
}
return val;
}
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);
return def;
}
return val;
}
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);
return def;
}
return val;
}
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);
}
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);
}
void __attribute__((noinline)) eeprom_init_default_block_P(void *__p, size_t __n, const void *def) {
if (!eeprom_is_initialized_block(__p, __n))
eeprom_update_block_P(def, __p, __n);
}

View File

@ -4,7 +4,7 @@
* @author 3d-gussner
*/
/** \ingroup eeprom_table */
//! _This is a EEPROM table of currently implemented in Prusa firmware (dynamically generated from doxygen)._
@ -37,29 +37,29 @@ typedef struct
static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEPROM_SHEETS_SIZEOF.");
#endif
/** @defgroup eeprom_table EEPROM Table
*
*
---------------------------------------------------------------------------------
EEPROM 8-bit Empty value = 0xFFh 255
EEPROM 16-bit Empty value = 0xFFFFh 65535
_Italic = unused or default_
__Bold = Status__
In Default/FactoryReset column the
- __L__ Language
- __S__ Statistics
- __P__ Shipping prep
- __M__ Service/Maintenance prep
- __S/P__ Statistics and Shipping prep
In Default/FactoryReset column the
- __L__ Language
- __S__ Statistics
- __P__ Shipping prep
- __M__ Service/Maintenance prep
- __S/P__ Statistics and Shipping prep
will overwrite existing values to 0 or default.
A FactoryReset All Data will overwrite the whole EEPROM with ffh and some values will be initialized automatically,
others need a reset / reboot.
---------------------------------------------------------------------------------
How can you use the debug codes?
- Serial terminal like Putty.
@ -67,281 +67,309 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
- _Pronterface_ does __not__ support D-codes
### !!! D-codes are case sensitive so please don't use upper case A,C or X in the address you want to read !!!
#### Useful tools/links:
To convert hex to ascii https://www.rapidtables.com/convert/number/hex-to-ascii.html
To convert hex to dec https://www.rapidtables.com/convert/number/hex-to-decimal.html
Version: 1.0.1
---------------------------------------------------------------------------------
| Address begin | Bit/Type | Name | Valid values | Default/FactoryReset | Description | Gcode/Function| Debug code
| :-- | :-- | :-- | :--: | :--: | :-- | :--: | :--:
| 0x0FFFh 4095 | uchar | EEPROM_SILENT | 00h 0 | ffh 255 | TMC Stealth mode: __off__ / miniRambo Power mode | LCD menu | D3 Ax0fff C1
| ^ | ^ | ^ | 01h 1 | ^ | TMC Stealth mode: __on__ / miniRambo Silent mode | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | miniRambo Auto mode | ^ | ^
| 0x0FFEh 4094 | uchar | EEPROM_LANG | 00h 0 | ffh 255 __L__ | English / LANG_ID_PRI | LCD menu | D3 Ax0ffe C1
| ^ | ^ | ^ | 01h 1 | ^ | Other language LANG_ID_SEC | ^ | ^
| 0x0FFCh 4092 | uint16 | EEPROM_BABYSTEP_X | ??? | ff ffh 65535 | Babystep for X axis _unsued_ | ??? | D3 Ax0ffc C2
| 0x0FFAh 4090 | uint16 | EEPROM_BABYSTEP_Y | ??? | ff ffh 65535 | Babystep for Y axis _unsued_ | ^ | D3 Ax0ffa C2
| 0x0FF8h 4088 | uint16 | EEPROM_BABYSTEP_Z | ??? | ff ffh 65535 | Babystep for Z axis _lagacy_ | ^ | D3 Ax0ff8 C2
| ^ | ^ | ^ | ^ | ^ | multiple values stored now in EEPROM_Sheets_base | ^ | ^
| 0x0FF7h 4087 | uint8 | EEPROM_CALIBRATION_STATUS | ffh 255 | ffh 255 | Assembled _default_ | ??? | D3 Ax0ff7 C1
| ^ | ^ | ^ | 01h 1 | ^ | Calibrated | ^ | ^
| ^ | ^ | ^ | e6h 230 | ^ | needs Live Z adjustment | ^ | ^
| ^ | ^ | ^ | f0h 240 | ^ __P__ | needs Z calibration | ^ | ^
| ^ | ^ | ^ | fah 250 | ^ | needs XYZ calibration | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Unknown | ^ | ^
| 0x0FF5h 4085 | uint16 | EEPROM_BABYSTEP_Z0 | ??? | ff ffh 65535 | Babystep for Z ??? | ??? | D3 Ax0ff5 C2
| 0x0FF1h 4081 | uint32 | EEPROM_FILAMENTUSED | ??? | 00 00 00 00h 0 __S/P__| Filament used in meters | ??? | D3 Ax0ff1 C4
| 0x0FEDh 4077 | uint32 | EEPROM_TOTALTIME | ??? | 00 00 00 00h 0 __S/P__| Total print time | ??? | D3 Ax0fed C4
| 0x0FE5h 4069 | float | EEPROM_BED_CALIBRATION_CENTER | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fe5 C8
| 0x0FDDh 4061 | float | EEPROM_BED_CALIBRATION_VEC_X | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fdd C8
| 0x0FD5h 4053 | float | EEPROM_BED_CALIBRATION_VEC_Y | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fd5 C8
| 0x0FC5h 4037 | int16 | EEPROM_BED_CALIBRATION_Z_JITTER | ??? | ff ffh 65535 | ??? | ??? | D3 Ax0fc5 C16
| 0x0FC4h 4036 | bool | EEPROM_FARM_MODE | 00h 0 | ffh 255 __P__ | Prusa farm mode: __off__ | G99 | D3 Ax0fc4 C1
| ^ | ^ | ^ | 01h 1 | ^ | Prusa farm mode: __on__ | G98 | ^
| 0x0FC3h 4035 | free | _EEPROM_FREE_NR1_ | ??? | ffh 255 | _Free EEPROM space_ | _free space_ | D3 Ax0fc3 C1
| 0x0FC1h 4033 | ??? | EEPROM_FARM_NUMBER | 000-999 | ff ffh / 000 __P__ | Prusa farm number _only 0-9 are allowed: 000-999_ | LCD menu | D3 Ax0fc1 C2
| 0x0FC0h 4032 | bool | EEPROM_BED_CORRECTION_VALID | 00h 0 | 00h 0 | Bed correction invalid | ??? | D3 Ax0fc0 C1
| ^ | ^ | ^ | ffh 255 | | Bed correction valid | ??? | ^
| 0x0FBFh 4031 | char | EEPROM_BED_CORRECTION_LEFT | 00h ffh | 00h 0 | Bed manual correction left | LCD menu | D3 Ax0fbf C1
| ^ | ^ | ^ | ^ | ^ | At this moment limited to +-100um | G80 Lxxx | ^
| 0x0FBEh 4030 | char | EEPROM_BED_CORRECTION_RIGHT | 00h ffh | 00h 0 | Bed manual correction right | LCD menu | D3 Ax0fbe C1
| ^ | ^ | ^ | ^ | ^ | At this moment limited to +-100um | G80 Rxxx | ^
| 0x0FBDh 4029 | char | EEPROM_BED_CORRECTION_FRONT | 00h ffh | 00h 0 | Bed manual correction front | LCD menu | D3 Ax0fbd C1
| ^ | ^ | ^ | ^ | ^ | At this moment limited to +-100um | G80 Fxxx | ^
| 0x0FBCh 4028 | char | EEPROM_BED_CORRECTION_BACK | 00h ffh | 00h 0 | Bed manual correction back | LCD menu | D3 Ax0fbc C1
| ^ | ^ | ^ | ^ | ^ | At this moment limited to +-100um | G80 Bxxx | ^
| 0x0FBBh 4027 | bool | EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY | 00h 0 | ffh 255 | Toshiba Air: __off__ | LCD menu | D3 Ax0fbb C1
| ^ | ^ | ^ | 01h 1 | ^ | Toshiba Air: __on__ | ^ | ^
| 0x0FBAh 4026 | uchar | EEPROM_PRINT_FLAG | ??? | ??? | _unsued_ | ??? | D3 Ax0fba C1
| 0x0FB0h 4016 | int16 | EEPROM_PROBE_TEMP_SHIFT | ??? | ??? | ??? | ??? | D3 Ax0fb0 C10
| 0x0FAFh 4015 | bool | EEPROM_TEMP_CAL_ACTIVE | 00h 0 | 00h 0 | PINDA Temp cal.: __inactive__ | LCD menu | D3 Ax0faf C1
| ^ | ^ | ^ | ffh 255 | ^ | PINDA Temp cal.: __active__ | ^ | ^
| 0x0FA7h 4007 | ??? | _EEPROM_FREE_NR6_ | ??? | | _Free EEPROM space_ | ??? | D3 Ax0fae C8
| ^ | ^ | ^ | ^ | 00 00 00 00h | ^ | ^ | ^
| 0x0FA6h 4006 | uint8 | EEPROM_CALIBRATION_STATUS_PINDA | 00h 0 | ffh 255 | PINDA Temp: __not calibrated__ | ??? | D3 Ax0fa6 C1
| ^ | ^ | ^ | 01h 1 | ^ | PINDA Temp: __calibrated__ | ^ | ^
| 0x0FA5h 4005 | uint8 | EEPROM_UVLO | 00h 0 | ffh 255 | Power Panic flag: __inactive__ | ??? | D3 Ax0fa5 C1
| ^ | ^ | ^ | 01h 1 | ^ | Power Panic flag: __active__ | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | Power Panic flag: __???__ | ^ | ^
| 0x0F9Dh 3997 | float | EEPROM_UVLO_CURRENT_POSITION | ??? | ffh 255 | Power Panic position | ??? | D3 Ax0f9d C8
| 0x0F95h 3989 | char | EEPROM_FILENAME | ??? | ffh 255 | Power Panic Filename | ??? | D3 Ax0f95 C8
| 0x0F91h 3985 | uint32 | EEPROM_FILE_POSITION | ??? | ff ff ff ffh | Power Panic File Position | ??? | D3 Ax0f91 C4
| 0x0F8Dh 3981 | float | EEPROM_UVLO_CURRENT_POSITION_Z | ??? | ff ff ff ffh | Power Panic Z Position | ^ | D3 Ax0f8d C4
| 0x0F8Ch 3980 | ??? | EEPROM_UVLO_UNUSED_001 | ??? | ffh 255 | Power Panic _unused_ | ^ | D3 Ax0f8c C1
| 0x0F8Bh 3979 | uint8 | EEPROM_UVLO_TARGET_BED | ??? | ffh 255 | Power Panic Bed temperature | ^ | D3 Ax0f8b C1
| 0x0F89h 3977 | uint16 | EEPROM_UVLO_FEEDRATE | ??? | ff ffh 65535 | Power Panic Feedrate | ^ | D3 Ax0f89 C2
| 0x0F88h 3976 | uint8 | EEPROM_UVLO_FAN_SPEED | ??? | ffh 255 | Power Panic Fan speed | ^ | D3 Ax0f88 C1
| 0x0F87h 3975 | uint8 | EEPROM_FAN_CHECK_ENABLED | 00h 0 | ??? | Fan Check __disabled__ | LCD menu | D3 Ax0f87 C1
| ^ | ^ | ^ | 01h 1 | ffh 255 | Fan Check __enabled__ | ^ | ^
| 0x0F75h 3957 | uint16 | EEPROM_UVLO_MESH_BED_LEVELING | ??? | ff ffh 65535 | Power Panic Mesh Bed Leveling | ??? | D3 Ax0f75 C18
| 0x0F73h 3955 | uint16 | EEPROM_UVLO_Z_MICROSTEPS | ??? | ff ffh 65535 | Power Panic Z microsteps | ??? | D3 Ax0f73 C2
| 0x0F72h 3954 | uint8 | EEPROM_UVLO_E_ABS | ??? | ffh 255 | Power Panic ??? position | ??? | D3 Ax0f72 C1
| 0x0F6Eh 3950 | float | EEPROM_UVLO_CURRENT_POSITION_E | ??? | ff ff ff ffh | Power Panic E position | ??? | D3 Ax0f6e C4
| 0x0F6Ch 3948 | uint16_t | EEPROM_UVLO_SAVED_SEGMENT_IDX | all | ff ffh 65535 | Power Panic index of multi-segment move | ??? | D3 Ax0f6c C2
| 0x0F6Bh 3947 | ??? | _EEPROM_FREE_NR4_ | ??? | ffh 255 | _Free EEPROM space_ | _free space_ | D3 Ax0f6b C1
| 0x0F6Ah 3946 | ??? | _EEPROM_FREE_NR5_ | ??? | ffh 255 | _Free EEPROM space_ | _free space_ | D3 Ax0f6a C1
| 0x0F69h 3945 | uint8 | EEPROM_CRASH_DET | ffh 255 | ffh 255 | Crash detection: __enabled__ | LCD menu | D3 Ax0f69 C1
| ^ | ^ | ^ | 00h 0 | ^ | Crash detection: __disabled__ | LCD menu | ^
| 0x0F68h 3944 | uint8 | EEPROM_CRASH_COUNT_Y | 00h-ffh 0-255 | ffh 255 __S/P__ | Crashes detected on y axis | ??? | D3 Ax0f68 C1
| 0x0F67h 3943 | uint8 | EEPROM_FSENSOR | 01h 1 | ffh 255 __P__ | Filament sensor: __enabled__ | LCD menu | D3 Ax0f67 C1
| ^ | ^ | ^ | 00h 0 | ^ | Filament sensor: __disabled__ | LCD menu | ^
| 0x0F65h 3942 | uint8 | EEPROM_CRASH_COUNT_X | 00h-ffh 0-255 | ffh 255 __S/P__ | Crashes detected on x axis | ??? | D3 Ax0f66 C1
| 0x0F65h 3941 | uint8 | EEPROM_FERROR_COUNT | 00h-ffh 0-255 | ffh 255 __S/P__ | Filament sensor error counter | ??? | D3 Ax0f65 C1
| 0x0F64h 3940 | uint8 | EEPROM_POWER_COUNT | 00h-ffh 0-255 | ffh 255 __S/P__ | Power failure counter | ??? | D3 Ax0f64 C1
| 0x0F60h 3936 | float | EEPROM_XYZ_CAL_SKEW | ??? | ff ff ff ffh | XYZ skew value | ??? | D3 Ax0f60 C4
| 0x0F5Fh 3935 | uint8 | EEPROM_WIZARD_ACTIVE | 01h 1 | 01h 1 __P__ | Wizard __active__ | ??? | D3 Ax0f5f C1
| ^ | ^ | ^ | 00h 0 | ^ | Wizard __inactive__ | ^ | ^
| ^ | ^ | ^ | 02h 2 | 02h 2 __M__ | Wizard active - Z cal after shipping/service prep | ^ | ^
| 0x0F5Dh 3933 | uint16 | EEPROM_BELTSTATUS_X | ??? | ff ffh | X Beltstatus | ??? | D3 Ax0f5d C2
| 0x0F5Bh 3931 | uint16 | EEPROM_BELTSTATUS_Y | ??? | ff ffh | Y Beltstatus | ??? | D3 Ax0f5b C2
| 0x0F5Ah 3930 | uint8 | EEPROM_DIR_DEPTH | 00h-ffh 0-255 | ffh 255 | Directory depth | ??? | D3 Ax0f5a C1
| 0x0F0Ah 3850 | uint8 | EEPROM_DIRS | ??? | ffh 255 | Directories ??? | ??? | D3 Ax0f0a C80
| 0x0F09h 3849 | uint8 | EEPROM_SD_SORT | 00h 0 | ffh 255 | SD card sort by: __time__ | LCD menu | D3 Ax0f09 C1
| ^ | ^ | ^ | 01h 1 | ^ | SD card sort by: __alphabet__ | LCD menu | ^
| ^ | ^ | ^ | 02h 1 | ^ | SD card: __not sorted__ | LCD menu | ^
| 0x0F08h 3848 | uint8 | EEPROM_SECOND_SERIAL_ACTIVE | 00h 0 | ffh 255 | RPi Port: __disabled__ | LCD menu | D3 Ax0f08 C1
| ^ | ^ | ^ | 01h 1 | ^ | RPi Port: __enabled__ | LCD menu | ^
| 0x0F07h 3847 | uint8 | EEPROM_FSENS_AUTOLOAD_ENABLED | 01h 1 | ffh 255 __P__ | Filament autoload: __enabled__ | LCD menu | D3 Ax0f07 C1
| ^ | ^ | ^ | 00h 0 | ^ | Filament autoload: __disabled__ | LCD menu | ^
| 0x0F05h 3845 | uint16 | EEPROM_CRASH_COUNT_X_TOT | 0000-fffe | ff ffh __S/P__ | Total crashes on x axis | ??? | D3 Ax0f05 C2
| 0x0F03h 3843 | uint16 | EEPROM_CRASH_COUNT_Y_TOT | 0000-fffe | ff ffh __S/P__ | Total crashes on y axis | ??? | D3 Ax0f03 C2
| 0x0F01h 3841 | uint16 | EEPROM_FERROR_COUNT_TOT | 0000-fffe | ff ffh __S/P__ | Total filament sensor errors | ??? | D3 Ax0f01 C2
| 0x0EFFh 3839 | uint16 | EEPROM_POWER_COUNT_TOT | 0000-fffe | ff ffh __S/P__ | Total power failures | ??? | D3 Ax0eff C2
| 0x0EFEh 3838 | uint8 | EEPROM_TMC2130_HOME_X_ORIGIN | ??? | ffh 255 | ??? | ??? | D3 Ax0efe C1
| 0x0EFDh 3837 | uint8 | EEPROM MC2130_HOME_X_BSTEPS | ??? | ffh 255 | ??? | ??? | D3 Ax0efd C1
| 0x0EFCh 3836 | uint8 | EEPROM_TMC2130_HOME_X_FSTEPS | ??? | ffh 255 | ??? | ??? | D3 Ax0efc C1
| 0x0EFBh 3835 | uint8 | EEPROM_TMC2130_HOME_Y_ORIGIN | ??? | ffh 255 | ??? | ??? | D3 Ax0efb C1
| 0x0EFAh 3834 | uint8 | EEPROM_TMC2130_HOME_Y_BSTEPS | ??? | ffh 255 | ??? | ??? | D3 Ax0efa C1
| 0x0EF9h 3833 | uint8 | EEPROM_TMC2130_HOME_Y_FSTEPS | ??? | ffh 255 | ??? | ??? | D3 Ax0ef9 C1
| 0x0EF8h 3832 | uint8 | EEPROM_TMC2130_HOME_ENABLED | ??? | ffh 255 | ??? | ??? | D3 Ax0ef8 C1
| 0x0EF7h 3831 | uint8 | EEPROM_TMC2130_WAVE_X_FAC | ??? | ffh 255 | ??? | ??? | D3 Ax0ef7 C1
| 0x0EF6h 3830 | uint8 | EEPROM_TMC2130_WAVE_Y_FAC | ??? | ffh 255 | ??? | ??? | D3 Ax0ef6 C1
| 0x0EF5h 3829 | uint8 | EEPROM_TMC2130_WAVE_Z_FAC | ??? | ffh 255 | ??? | ??? | D3 Ax0ef5 C1
| 0x0EF4h 3828 | uint8 | EEPROM_TMC2130_WAVE_E_FAC | ??? | ffh 255 | ??? | ??? | D3 Ax0ef4 C1
| 0x0EF3h 3827 | uint8 | EEPROM_TMC2130_X_MRES | ??? | ffh 255 | ??? | ??? | D3 Ax0ef3 C1
| 0x0EF2h 3826 | uint8 | EEPROM_TMC2130_Y_MRES | ??? | ffh 255 | ??? | ??? | D3 Ax0ef2 C1
| 0x0EF1h 3825 | uint8 | EEPROM_TMC2130_Z_MRES | ??? | ffh 255 | ??? | ??? | D3 Ax0ef1 C1
| 0x0EF0h 3824 | uint8 | EEPROM_TMC2130_E_MRES | ??? | ffh 255 | ??? | ??? | D3 Ax0ef0 C1
| 0x0EEE 3822 | uint16 | EEPROM_PRINTER_TYPE | ??? | ff ffh 65535 | Printer Type | ??? | D3 Ax0eee C2
| ^ | ^ | ^ | 64 00h 100 | ^ | PRINTER_MK1 | ??? | ^
| ^ | ^ | ^ | c8 00h 200 | ^ | PRINTER_MK2 | ??? | ^
| ^ | ^ | ^ | c9 00h 201 | ^ | PRINTER_MK2 with MMU1 | ??? | ^
| ^ | ^ | ^ | ca 00h 202 | ^ | PRINTER_MK2S | ??? | ^
| ^ | ^ | ^ | cb 00h 203 | ^ | PRINTER_MK2S with MMU1 | ??? | ^
| ^ | ^ | ^ | fa 00h 250 | ^ | PRINTER_MK2.5 | ??? | ^
| ^ | ^ | ^ | 1a 4fh 20250 | ^ | PRINTER_MK2.5 with MMU2 | ??? | ^
| ^ | ^ | ^ | fc 00h 252 | ^ | PRINTER_MK2.5S | ??? | ^
| ^ | ^ | ^ | 1c 4fh 20252 | ^ | PRINTER_MK2.5S with MMU2S | ??? | ^
| ^ | ^ | ^ | 2c 01h 300 | ^ | PRINTER_MK3 | ??? | ^
| ^ | ^ | ^ | 4c 4fh 20300 | ^ | PRINTER_MK3 with MMU2 | ??? | ^
| ^ | ^ | ^ | 2e 01h 302 | ^ | PRINTER_MK3S | ??? | ^
| ^ | ^ | ^ | 4e 4fh 20302 | ^ | PRINTER_MK3S with MMU2S | ??? | ^
| 0x0EEC 3820 | uint16 | EEPROM_BOARD_TYPE | ??? | ff ffh 65535 | Board Type | ??? | D3 Ax0eec C2
| ^ | ^ | ^ | c8 00h 200 | ^ | BOARD_RAMBO_MINI_1_0 | ??? | ^
| ^ | ^ | ^ | cb 00h 203 | ^ | BOARD_RAMBO_MINI_1_3 | ??? | ^
| ^ | ^ | ^ | 36 01h 310 | ^ | BOARD_EINSY_1_0a | ??? | ^
| 0x0EE8 3816 | float | EEPROM_EXTRUDER_MULTIPLIER_0 | ??? | ff ff ff ffh | Power panic Extruder 0 multiplier | ??? | D3 Ax0ee8 C4
| 0x0EE4 3812 | float | EEPROM_EXTRUDER_MULTIPLIER_1 | ??? | ff ff ff ffh | Power panic Extruder 1 multiplier | ??? | D3 Ax0ee4 C4
| 0x0EE0 3808 | float | EEPROM_EXTRUDER_MULTIPLIER_2 | ??? | ff ff ff ffh | Power panic Extruder 2 multiplier | ??? | D3 Ax0ee0 C4
| 0x0EDE 3806 | uint16 | EEPROM_EXTRUDEMULTIPLY | ??? | ff ffh 65535 | Power panic Extruder multiplier | ??? | D3 Ax0ede C2
| 0x0EDA 3802 | float | EEPROM_UVLO_TINY_CURRENT_POSITION_Z | ??? | ff ff ff ffh | Power panic Z position | ??? | D3 Ax0eda C4
| 0x0ED8 3800 | uint16 | EEPROM_UVLO_TARGET_HOTEND | ??? | ff ffh 65535 | Power panic target Hotend temperature | ??? | D3 Ax0ed8 C2
| 0x0ED7 3799 | uint8 | EEPROM_SOUND_MODE | 00h 0 | ffh 255 | Sound mode: __loud__ | ??? | D3 Ax0ed7 C1
| ^ | ^ | ^ | 01h 1 | ^ | Sound mode: __once__ | ^ | ^
| ^ | ^ | ^ | 02h 1 | ^ | Sound mode: __silent__ | ^ | ^
| ^ | ^ | ^ | 03h 1 | ^ | Sound mode: __assist__ | ^ | ^
| 0x0ED6 3798 | bool | EEPROM_AUTO_DEPLETE | 01h 1 | ffh 255 | MMU2/s autodeplete: __on__ | ??? | D3 Ax0ed6 C1
| ^ | ^ | ^ | 00h 0 | ^ | MMU2/s autodeplete: __off__ | ^ | ^
| 0x0ED5 3797 | bool | EEPROM_FSENS_OQ_MEASS_ENABLED | ??? | ffh 255 | PAT1925 ??? | ??? | D3 Ax0ed5 C1
| ^ | ^ | ^ | ??? | ^ | PAT1925 ??? | ^ | ^
| 0x0ED3 3795 | uint16 | EEPROM_MMU_FAIL_TOT | ??? | ff ffh 65535 __S/P__ | MMU2/s total failures | ??? | D3 Ax0ed3 C2
| 0x0ED2 3794 | uint8 | EEPROM_MMU_FAIL | ??? | ffh 255 __S/P__ | MMU2/s fails during print | ??? | D3 Ax0ed2 C1
| 0x0ED0 3792 | uint16 | EEPROM_MMU_LOAD_FAIL_TOT | ??? | ff ffh 65535 __S/P__ | MMU2/s total load failures | ??? | D3 Ax0ed0 C2
| 0x0ECF 3791 | uint8 | EEPROM_MMU_LOAD_FAIL | ??? | ffh 255 __S/P__ | MMU2/s load failures during print | ??? | D3 Ax0ecf C1
| 0x0ECE 3790 | uint8 | EEPROM_MMU_CUTTER_ENABLED | 00h 0 | ffh 255 | MMU2/s cutter: __disabled__ | LCD menu | D3 Ax0ece C1
| ^ | ^ | ^ | 01h 1 | ^ | MMU2/s cutter: __enabled__ | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | MMU2/s cutter: __always__ | ^ | ^
| 0x0DAE 3502 | uint16 | EEPROM_UVLO_MESH_BED_LEVELING_FULL | ??? | ff ffh 65535 | Power panic Mesh bed leveling points | ??? | D3 Ax0dae C288
| 0x0DAD 3501 | uint8 | EEPROM_MBL_TYPE | ??? | ffh 255 | Mesh bed leveling precision _unused atm_ | ??? | D3 Ax0dad C1
| 0x0DAC 3500 | bool | EEPROM_MBL_MAGNET_ELIMINATION | 01h 1 | ffh 255 | Mesh bed leveling does: __ignores__ magnets | LCD menu | D3 Ax0dac C1
| ^ | ^ | ^ | 00h 0 | ^ | Mesh bed leveling does: __NOT ignores__ magnets | ^ | ^
| 0x0DAB 3499 | uint8 | EEPROM_MBL_POINTS_NR | 03h 3 | ffh 255 | Mesh bed leveling points: __3x3__ | LCD menu | D3 Ax0dab C1
| ^ | ^ | ^ | 07h 7 | ^ | Mesh bed leveling points: __7x7__ | ^ | ^
| 0x0DAA 3498 | uint8 | EEPROM_MBL_PROBE_NR | 03h 3 | ffh 255 | MBL times measurements for each point: __3__ | LCD menu | D3 Ax0daa C1
| ^ | ^ | ^ | 05h 5 | ^ | MBL times measurements for each point: __5__ | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | MBL times measurements for each point: __1__ | ^ | ^
| 0x0DA9 3497 | uint8 | EEPROM_MMU_STEALTH | 01h 1 | ffh 255 | MMU2/s Silent mode: __on__ | ??? | D3 Ax0da9 C1
| ^ | ^ | ^ | 00h 0 | ^ | MMU2/s Silent mode: __off__ | ^ | ^
| 0x0DA8 3496 | uint8 | EEPROM_CHECK_MODE | 01h 1 | ffh 255 | Check mode for nozzle is: __warn__ | LCD menu | D3 Ax0da8 C1
| ^ | ^ | ^ | 02h 0 | ^ | Check mode for nozzle is: __strict__ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for nozzle is: __none__ | ^ | ^
| 0x0DA7 3495 | uint8 | EEPROM_NOZZLE_DIAMETER | 28h 40 | ffh 255 | Nozzle diameter is: __40 or 0.40mm__ | LCD menu | D3 Ax0da7 C1
| ^ | ^ | ^ | 3ch 60 | ^ | Nozzle diameter is: __60 or 0.60mm__ | ^ | ^
| ^ | ^ | ^ | 3ch 80 | ^ | Nozzle diameter is: __80 or 0.80mm__ | ^ | ^
| ^ | ^ | ^ | 19h 25 | ^ | Nozzle diameter is: __25 or 0.25mm__ | ^ | ^
| 0x0DA5 3493 | uint16 | EEPROM_NOZZLE_DIAMETER_uM | 9001h | ff ffh 65535 | Nozzle diameter is: __400um__ | LCD menu | D3 Ax0da5 C2
| ^ | ^ | ^ | 5802h | ^ | Nozzle diameter is: __600um__ | ^ | ^
| ^ | ^ | ^ | 2003h | ^ | Nozzle diameter is: __800um__ | ^ | ^
| ^ | ^ | ^ | fa00h | ^ | Nozzle diameter is: __250um__ | ^ | ^
| 0x0DA4 3492 | uint8 | EEPROM_CHECK_MODEL | 01h 1 | ffh 255 | Check mode for printer model is: __warn__ | LCD menu | D3 Ax0da4 C1
| ^ | ^ | ^ | 02h 0 | ^ | Check mode for printer model is: __strict__ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for printer model is: __none__ | ^ | ^
| 0x0DA3 3491 | uint8 | EEPROM_CHECK_VERSION | 01h 1 | ffh 255 | Check mode for firmware is: __warn__ | LCD menu | D3 Ax0da3 C1
| ^ | ^ | ^ | 02h 0 | ^ | Check mode for firmware is: __strict__ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for firmware is: __none__ | ^ | ^
| 0x0DA2 3490 | uint8 | EEPROM_CHECK_GCODE | 01h 1 | ffh 255 | Check mode for gcode is: __warn__ _unused atm_ | LCD menu | D3 Ax0da2 C1
| ^ | ^ | ^ | 02h 0 | ^ | Check mode for gcode is: __strict__ _unused atm_ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for gcode is: __none__ _unused atm_ | ^ | ^
| 0x0D49 3401 | uint16 | EEPROM_SHEETS_BASE | ??? | ffh 255 | ??? | LCD menu | D3 Ax0d49 C89
| 0x0D49 3401 | char | _1st Sheet block_ | 536d6f6f746831| ffffffffffffff | 1st sheet - Name: _Smooth1_ | ^ | D3 Ax0d49 C7
| 0x0D50 3408 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 1st sheet - Z offset | ^ | D3 Ax0d50 C2
| 0x0D52 3410 | uint8 | ^ | 00h 0 | ffh 255 | 1st sheet - bed temp | ^ | D3 Ax0d52 C1
| 0x0D53 3411 | uint8 | ^ | 00h 0 | ffh 255 | 1st sheet - PINDA temp | ^ | D3 Ax0d53 C1
| 0x0D54 3412 | char | _2nd Sheet block_ | 536d6f6f746832| ffffffffffffff | 2nd sheet - Name: _Smooth2_ | ^ | D3 Ax0d54 C7
| 0x0D5B 3419 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 2nd sheet - Z offset | ^ | D3 Ax0d5b C2
| 0x0D5D 3421 | uint8 | ^ | 00h 0 | ffh 255 | 2nd sheet - bed temp | ^ | D3 Ax0d5d C1
| 0x0D5E 3422 | uint8 | ^ | 00h 0 | ffh 255 | 2nd sheet - PINDA temp | ^ | D3 Ax0d5e C1
| 0x0D5F 3423 | char | _3rd Sheet block_ | 54657874757231| ffffffffffffff | 3rd sheet - Name: _Textur1_ | ^ | D3 Ax0d5f C7
| 0x0D66 3430 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 3rd sheet - Z offset | ^ | D3 Ax0d66 C2
| 0x0D68 3432 | uint8 | ^ | 00h 0 | ffh 255 | 3rd sheet - bed temp | ^ | D3 Ax0d68 C1
| 0x0D69 3433 | uint8 | ^ | 00h 0 | ffh 255 | 3rd sheet - PINDA temp | ^ | D3 Ax0d69 C1
| 0x0D6A 3434 | char | _4th Sheet block_ | 54657874757232| ffffffffffffff | 4th sheet - Name: _Textur2_ | ^ | D3 Ax0d6a C7
| 0x0D71 3441 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 4th sheet - Z offset | ^ | D3 Ax0d71 C2
| 0x0D73 3443 | uint8 | ^ | 00h 0 | ffh 255 | 4th sheet - bed temp | ^ | D3 Ax0d73 C1
| 0x0D74 3444 | uint8 | ^ | 00h 0 | ffh 255 | 4th sheet - PINDA temp | ^ | D3 Ax0d74 C1
| 0x0D75 3445 | char | _5th Sheet block_ | 536174696e2031| ffffffffffffff | 5th sheet - Name: _Satin 1_ | ^ | D3 Ax0d75 C7
| 0x0D7C 3452 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 5th sheet - Z offset | ^ | D3 Ax0d7c C2
| 0x0D7E 3454 | uint8 | ^ | 00h 0 | ffh 255 | 5th sheet - bed temp | ^ | D3 Ax0d7e C1
| 0x0D7F 3455 | uint8 | ^ | 00h 0 | ffh 255 | 5th sheet - PINDA temp | ^ | D3 Ax0d7f C1
| 0x0D80 3456 | char | _6th Sheet block_ | 536174696e2032| ffffffffffffff | 6th sheet - Name: _Satin 2_ | ^ | D3 Ax0d80 C7
| 0x0D87 3463 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 6th sheet - Z offset | ^ | D3 Ax0d87 C2
| 0x0D89 3465 | uint8 | ^ | 00h 0 | ffh 255 | 6th sheet - bed temp | ^ | D3 Ax0d89 C1
| 0x0D8A 3466 | uint8 | ^ | 00h 0 | ffh 255 | 6th sheet - PINDA temp | ^ | D3 Ax0d8a C1
| 0x0D8B 3467 | char | _7th Sheet block_ | 437573746f6d31| ffffffffffffff | 7th sheet - Name: _Custom1_ | ^ | D3 Ax0d8b C7
| 0x0D92 3474 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 7th sheet - Z offset | ^ | D3 Ax0d92 C2
| 0x0D94 3476 | uint8 | ^ | 00h 0 | ffh 255 | 7th sheet - bed temp | ^ | D3 Ax0d94 C1
| 0x0D95 3477 | uint8 | ^ | 00h 0 | ffh 255 | 7th sheet - PINDA temp | ^ | D3 Ax0d95 C1
| 0x0D96 3478 | char | _8th Sheet block_ | 437573746f6d32| ffffffffffffff | 8th sheet - Name: _Custom2_ | ^ | D3 Ax0d96 C7
| 0x0D9D 3485 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 8th sheet - Z offset | ^ | D3 Ax0d9d C2
| 0x0D9F 3487 | uint8 | ^ | 00h 0 | ffh 255 | 8th sheet - bed temp | ^ | D3 Ax0d9f C1
| 0x0DA0 3488 | uint8 | ^ | 00h 0 | ffh 255 | 8th sheet - PINDA temp | ^ | D3 Ax0da0 C1
| 0x0DA1 3489 | uint8 | ??? | 00h 0 | ffh 255 | ??? | ??? | D3 Ax0da1 C1
| 0x0D48 3400 | uint8 | EEPROM_FSENSOR_PCB | ffh 255 | ffh 255 | Filament Sensor type IR unknown | LCD Support | D3 Ax0d48 C1
| ^ | ^ | ^ | 00h 0 | ^ | Filament Sensor type IR 0.3 or older | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | Filament Sensor type IR 0.4 or newer | ^ | ^
| 0x0D47 3399 | uint8 | EEPROM_FSENSOR_ACTION_NA | 00h 0 | ffh 255 | Filament Sensor action: __Continue__ | LCD menu | D3 Ax0d47 C1
| ^ | ^ | ^ | 01h 1 | ^ | Filament Sensor action: __Pause__ | ^ | ^
| 0x0D37 3383 | float | EEPROM_UVLO_SAVED_START_POSITION | ??? | ff ff ff ffh | Power panic saved start position all-axis | ??? | D3 Ax0d37 C16
| ^ | ^ | ^ | ??? | ^ | Power panic saved start position e-axis | ^ | D3 Ax0d43 C4
| ^ | ^ | ^ | ??? | ^ | Power panic saved start position z-axis | ^ | D3 Ax0d3f C4
| ^ | ^ | ^ | ??? | ^ | Power panic saved start position y-axis | ^ | D3 Ax0d3b C4
| ^ | ^ | ^ | ??? | ^ | Power panic saved start position x-axis | ^ | D3 Ax0d37 C4
| 0x0D35 3381 | uint16 | EEPROM_UVLO_FEEDMULTIPLY | ??? | ff ffh 65355 | Power panic saved feed multiplier | ??? | D3 Ax0d35 C2
| 0x0D34 3380 | uint8 | EEPROM_BACKLIGHT_LEVEL_HIGH | 00h - ffh | 82h 130 | LCD backlight bright: __128__ Dim value to 255 | LCD menu | D3 Ax0d34 C1
| 0x0D33 3379 | uint8 | EEPROM_BACKLIGHT_LEVEL_LOW | 00h - ffh | 32h 50 | LCD backlight dim: __50__ 0 to Bright value | LCD menu | D3 Ax0d33 C1
| 0x0D32 3378 | uint8 | EEPROM_BACKLIGHT_MODE | 02h 2 | ffh 255 | LCD backlight mode: __Auto__ | LCD menu | D3 Ax0d32 C1
| ^ | ^ | ^ | 01h 1 | ^ | LCD backlight mode: __Bright__ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | LCD backlight mode: __Dim__ | ^ | ^
| 0x0D30 3376 | uint16 | EEPROM_BACKLIGHT_TIMEOUT | 01 00 - ff ff | 0a 00h 65535 | LCD backlight timeout: __10__ seconds | LCD menu | D3 Ax0d30 C2
| 0x0D2C 3372 | float | EEPROM_UVLO_LA_K | ??? | ff ff ff ffh | Power panic saved Linear Advanced K value | ??? | D3 Ax0d2c C4
| 0x0D2B 3371 | uint8 | EEPROM_ALTFAN_OVERRIDE | ffh 255 | ffh 255 | ALTFAN override unknown state | LCD menu | D3 Ax0d2b C1
| ^ | ^ | ^ | 00h 0 | ^ | ALTFAN override deactivated | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | ALTFAN override activated | ^ | ^
| 0x0D2A 3370 | uint8 | EEPROM_EXPERIMENTAL_VISIBILITY | ffh 255 | ffh 255 | Experimental menu visibility unknown state | LCD menu | D3 Ax0d2a C1
| ^ | ^ | ^ | 00h 0 | ^ | Experimental menu visibility hidden | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | Experimental menu visibility visible | ^ | ^
| 0x0D29 3369 | uint8 | EEPROM_PINDA_TEMP_COMPENSATION | ffh 255 | ffh 255 | PINDA temp compensation unknown state | LCD menu | D3 Ax0d29 C1
| ^ | ^ | ^ | 00h 0 | ^ | PINDA has no temp compensation PINDA v1/2 | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | PINDA has temp compensation aka SuperPINDA | ^ | ^
| 0x0D15 3349 | char[20] | EEPROM_PRUSA_SN | SN[19] == 0 | ffffffffffffffff... | PRUSA Serial number string | PRUSA SN | D3 Ax0d15 C20
| 0x0D11 3345 | float | EEPROM_UVLO_ACCELL | ??? | ff ff ff ffh | Power panic saved normal acceleration | ??? | D3 Ax0d11 C4
| 0x0D0D 3341 | float | EEPROM_UVLO_RETRACT_ACCELL | ??? | ff ff ff ffh | Power panic saved retract acceleration | ??? | D3 Ax0d0d C4
| 0x0D09 3337 | float | EEPROM_UVLO_TRAVEL_ACCELL | ??? | ff ff ff ffh | Power panic saved travel acceleration | ??? | D3 Ax0d09 C4
| 0x0D05 3333 | uint32_t | EEPROM_JOB_ID | ??? | 00 00 00 00h | Job ID used by host software | D3 only | D3 Ax0d05 C4
| 0x0D04 3332 | uint8_t | EEPROM_ECOOL_ENABLE | ffh 255 | ^ | Disable extruder motor scaling for non-farm print | LCD menu | D3 Ax0d04 C1
| ^ | ^ | ^ | 2ah 42 | ^ | Enable extruder motor scaling for non-farm print | ^ | D3 Ax0d04 C1
| 0x0D03 3321 | uint8_t | EEPROM_FW_CRASH_FLAG | ffh 255 | ffh 255 | Last FW crash reason (dump_crash_reason) | D21/D22 | D3 Ax0d03 C1
| ^ | ^ | ^ | 00h 0 | ^ | manual | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | stack_error | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | watchdog | ^ | ^
| ^ | ^ | ^ | 03h 3 | ^ | bad_isr | ^ | ^
| ^ | ^ | ^ | 04h 4 | ^ | bad_pullup_temp_isr | ^ | ^
| ^ | ^ | ^ | 05h 5 | ^ | bad_pullup_step_isr | ^ | ^
| Address begin | Bit/Type | Name | Valid values | Default/FactoryReset | Description | Gcode/Function| Debug code
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--:
| 0x0012 18 | uint16 | EEPROM_FIRMWARE_VERSION_END | ??? | ff ffh 65535 | ??? | ??? | D3 Ax0012 C2
| 0x0010 16 | uint16 | EEPROM_FIRMWARE_VERSION_FLAVOR | ??? | ff ffh 65535 | ??? | ??? | D3 Ax0010 C2
| 0x000E 14 | uint16 | EEPROM_FIRMWARE_VERSION_REVISION | ??? | ff ffh 65535 | Firmware version revision number DEV/ALPHA/BETA/RC| ??? | D3 Ax000e C2
| 0x000C 12 | uint16 | EEPROM_FIRMWARE_VERSION_MINOR | ??? | ff ffh 65535 | Firmware version minor number | ??? | D3 Ax000c C2
| 0x000A 10 | uint16 | EEPROM_FIRMWARE_VERSION_MAJOR | ??? | ff ffh 65535 | Firmware version major number | ??? | D3 Ax000a C2
| 0x0000 0 | char | FW_PRUSA3D_MAGIC | ??? | ffffffffffffffffffff | __`PRUSA3DFW`__ | ??? | D3 Ax0000 C10
#### Useful tools/links:
To convert hex to ascii https://www.rapidtables.com/convert/number/hex-to-ascii.html
To convert hex to dec https://www.rapidtables.com/convert/number/hex-to-decimal.html
Version: 1.0.2
---------------------------------------------------------------------------------
|Address begin|Bit/Type | Name | Valid values | Default/FactoryReset | Description |Gcode/Function| Debug code
| :-- | :-- | :-- | :--: | :--: | :-- | :--: | :--:
| 0x0FFF 4095 | uchar | EEPROM_SILENT | 00h 0 | ffh 255 | TMC Stealth mode: __off__ / miniRambo Power mode | LCD menu | D3 Ax0fff C1
| ^ | ^ | ^ | 01h 1 | ^ | TMC Stealth mode: __on__ / miniRambo Silent mode | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | miniRambo Auto mode | ^ | ^
| 0x0FFE 4094 | uchar | EEPROM_LANG | 00h 0 | ffh 255 __L__ | English / LANG_ID_PRI | LCD menu | D3 Ax0ffe C1
| ^ | ^ | ^ | 01h 1 | ^ | Other language LANG_ID_SEC | ^ | ^
| 0x0FFC 4092 | uint16 | EEPROM_BABYSTEP_X | ??? | ff ffh 65535 | Babystep for X axis _unsued_ | ??? | D3 Ax0ffc C2
| 0x0FFA 4090 | uint16 | EEPROM_BABYSTEP_Y | ??? | ff ffh 65535 | Babystep for Y axis _unsued_ | ^ | D3 Ax0ffa C2
| 0x0FF8 4088 | uint16 | EEPROM_BABYSTEP_Z | ??? | ff ffh 65535 | Babystep for Z axis _lagacy_ | ^ | D3 Ax0ff8 C2
| ^ | ^ | ^ | ^ | ^ | multiple values stored now in EEPROM_Sheets_base | ^ | ^
| 0x0FF7 4087 | uint8 | EEPROM_CALIBRATION_STATUS_V1 | ffh 255 | ffh 255 | Calibration status (<v3.12) | ??? | D3 Ax0ff7 C1
| ^ | ^ | ^ | 01h 1 | ^ | Calibrated | ^ | ^
| ^ | ^ | ^ | e6h 230 | ^ | needs Live Z adjustment | ^ | ^
| ^ | ^ | ^ | ebh 235 | ^ | needs Temp Model calibration | ^ | ^
| ^ | ^ | ^ | 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 | unint32 | EEPROM_FILAMENTUSED | ??? | 00 00 00 00h 0 __S/P__| Filament used in meters | ??? | D3 Ax0ff1 C4
| 0x0FED 4077 | unint32 | EEPROM_TOTALTIME | ??? | 00 00 00 00h 0 __S/P__| Total print time | ??? | 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
| 0x0FD5 4053 | float | EEPROM_BED_CALIBRATION_VEC_Y | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fd5 C8
| 0x0FC5 4037 | int16 | EEPROM_BED_CALIBRATION_Z_JITTER | ??? | ff ffh 65535 | ??? | ??? | D3 Ax0fc5 C16
| 0x0FC4 4036 | bool | EEPROM_FARM_MODE | 00h 0 | ffh 255 __P__ | Prusa farm mode: __off__ | G99 | D3 Ax0fc4 C1
| ^ | ^ | ^ | 01h 1 | ^ | Prusa farm mode: __on__ | G98 | ^
| 0x0FC3 4035 | free | _EEPROM_FREE_NR1_ | ??? | ffh 255 | _Free EEPROM space_ | _free space_ | D3 Ax0fc3 C1
| 0x0FC1 4033 | ??? | EEPROM_FARM_NUMBER | 000-999 | ff ffh / 000 __P__ | Prusa farm number _only 0-9 are allowed: 000-999_ | LCD menu | D3 Ax0fc1 C2
| 0x0FC0 4032 | bool | EEPROM_BED_CORRECTION_VALID | 00h 0 | 00h 0 | Bed correction invalid | ??? | D3 Ax0fc0 C1
| ^ | ^ | ^ | ffh 255 | ^ | Bed correction valid | ??? | ^
| 0x0FBF 4031 | char | EEPROM_BED_CORRECTION_LEFT | 00h ffh | 00h 0 | Bed manual correction left | LCD menu | D3 Ax0fbf C1
| ^ | ^ | ^ | ^ | ^ | At this moment limited to +-100um | G80 Lxxx | ^
| 0x0FBE 4030 | char | EEPROM_BED_CORRECTION_RIGHT | 00h ffh | 00h 0 | Bed manual correction right | LCD menu | D3 Ax0fbe C1
| ^ | ^ | ^ | ^ | ^ | At this moment limited to +-100um | G80 Rxxx | ^
| 0x0FBD 4029 | char | EEPROM_BED_CORRECTION_FRONT | 00h ffh | 00h 0 | Bed manual correction front | LCD menu | D3 Ax0fbd C1
| ^ | ^ | ^ | ^ | ^ | At this moment limited to +-100um | G80 Fxxx | ^
| 0x0FBC 4028 | char | EEPROM_BED_CORRECTION_BACK | 00h ffh | 00h 0 | Bed manual correction back | LCD menu | D3 Ax0fbc C1
| ^ | ^ | ^ | ^ | ^ | At this moment limited to +-100um | G80 Bxxx | ^
| 0x0FBB 4027 | bool | EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY | 00h 0 | ffh 255 | Toshiba Air: __off__ | LCD menu | D3 Ax0fbb C1
| ^ | ^ | ^ | 01h 1 | ^ | Toshiba Air: __on__ | ^ | ^
| 0x0FBA 4026 | uchar | EEPROM_PRINT_FLAG | ??? | ??? | _unsued_ | ??? | D3 Ax0fba C1
| 0x0FB0 4016 | int16 | EEPROM_PROBE_TEMP_SHIFT | ??? | ??? | ??? | ??? | D3 Ax0fb0 C10
| 0x0FAF 4015 | bool | EEPROM_TEMP_CAL_ACTIVE | 00h 0 | 00h 0 | PINDA Temp cal.: __inactive__ | LCD menu | D3 Ax0faf C1
| ^ | ^ | ^ | ffh 255 | ^ | PINDA Temp cal.: __active__ | ^ | ^
| 0x0FA7 4007 | ??? | _EEPROM_FREE_NR6_ | ??? | ffh 255 | _Free EEPROM space_ | ??? | D3 Ax0fae C8
| ^ | ^ | ^ | ^ | 00 00 00 00h | ^ | ^ | ^
| 0x0FA6 4006 | uint8 | EEPROM_CALIBRATION_STATUS_PINDA | 00h 0 | ffh 255 | PINDA Temp: __not calibrated__ | ??? | D3 Ax0fa6 C1
| ^ | ^ | ^ | 01h 1 | ^ | PINDA Temp: __calibrated__ | ^ | ^
| 0x0FA5 4005 | uint8 | EEPROM_UVLO | 00h 0 | ffh 255 | Power Panic flag: __inactive__ | ??? | D3 Ax0fa5 C1
| ^ | ^ | ^ | 01h 1 | ^ | Power Panic flag: __active__ | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | Power Panic flag: __???__ | ^ | ^
| 0x0F9D 3997 | float | EEPROM_UVLO_CURRENT_POSITION | ??? | ffh 255 | Power Panic position | ??? | D3 Ax0f9d C8
| 0x0F95 3989 | char | EEPROM_FILENAME | ??? | ffh 255 | Power Panic Filename | ??? | D3 Ax0f95 C8
| 0x0F91 3985 | unint32 | EEPROM_FILE_POSITION | ??? | ff ff ff ffh | Power Panic File Position | ??? | D3 Ax0f91 C4
| 0x0F8D 3981 | float | EEPROM_UVLO_CURRENT_POSITION_Z | ??? | ff ff ff ffh | Power Panic Z Position | ^ | D3 Ax0f8d C4
| 0x0F8C 3980 | ??? | EEPROM_UVLO_UNUSED_001 | ??? | ffh 255 | Power Panic _unused_ | ^ | D3 Ax0f8c C1
| 0x0F8B 3979 | uint8 | EEPROM_UVLO_TARGET_BED | ??? | ffh 255 | Power Panic Bed temperature | ^ | D3 Ax0f8b C1
| 0x0F89 3977 | uint16 | EEPROM_UVLO_FEEDRATE | ??? | ff ffh 65535 | Power Panic Feedrate | ^ | D3 Ax0f89 C2
| 0x0F88 3976 | uint8 | EEPROM_UVLO_FAN_SPEED | ??? | ffh 255 | Power Panic Fan speed | ^ | D3 Ax0f88 C1
| 0x0F87 3975 | uint8 | EEPROM_FAN_CHECK_ENABLED | 00h 0 | ??? | Fan Check __disabled__ | LCD menu | D3 Ax0f87 C1
| ^ | ^ | ^ | 01h 1 | ffh 255 | Fan Check __enabled__ | ^ | ^
| 0x0F75 3957 | uint16 | EEPROM_UVLO_MESH_BED_LEVELING | ??? | ff ffh 65535 | Power Panic Mesh Bed Leveling | ??? | D3 Ax0f75 C18
| 0x0F73 3955 | uint16 | EEPROM_UVLO_Z_MICROSTEPS | ??? | ff ffh 65535 | Power Panic Z microsteps | ??? | D3 Ax0f73 C2
| 0x0F72 3954 | uint8 | EEPROM_UVLO_E_ABS | ??? | ffh 255 | Power Panic ??? position | ??? | D3 Ax0f72 C1
| 0x0F6E 3950 | float | EEPROM_UVLO_CURRENT_POSITION_E | ??? | ff ff ff ffh | Power Panic E position | ??? | D3 Ax0f6e C4
| 0x0F6C 3948 | uint16 | EEPROM_UVLO_SAVED_SEGMENT_IDX | all | ff ffh 65535 | Power Panic index of multi-segment move | ??? | D3 Ax0f6c C2
| 0x0F6B 3947 | ??? | _EEPROM_FREE_NR4_ | ??? | ffh 255 | _Free EEPROM space_ | _free space_ | D3 Ax0f6b C1
| 0x0F6A 3946 | ??? | _EEPROM_FREE_NR5_ | ??? | ffh 255 | _Free EEPROM space_ | _free space_ | D3 Ax0f6a C1
| 0x0F69 3945 | uint8 | EEPROM_CRASH_DET | ffh 255 | ffh 255 | Crash detection: __enabled__ | LCD menu | D3 Ax0f69 C1
| ^ | ^ | ^ | 00h 0 | ^ | Crash detection: __disabled__ | LCD menu | ^
| 0x0F68 3944 | uint8 | EEPROM_CRASH_COUNT_Y | 00h-ffh 0-255| ffh 255 __S/P__ | Crashes detected on y axis | ??? | D3 Ax0f68 C1
| 0x0F67 3943 | uint8 | EEPROM_FSENSOR | 01h 1 | ffh 255 __P__ | Filament sensor: __enabled__ | LCD menu | D3 Ax0f67 C1
| ^ | ^ | ^ | 00h 0 | ^ | Filament sensor: __disabled__ | LCD menu | ^
| 0x0F65 3942 | uint8 | EEPROM_CRASH_COUNT_X | 00h-ffh 0-255| ffh 255 __S/P__ | Crashes detected on x axis | ??? | D3 Ax0f66 C1
| 0x0F65 3941 | uint8 | EEPROM_FERROR_COUNT | 00h-ffh 0-255| ffh 255 __S/P__ | Filament sensor error counter | ??? | D3 Ax0f65 C1
| 0x0F64 3940 | uint8 | EEPROM_POWER_COUNT | 00h-ffh 0-255| ffh 255 __S/P__ | Power failure counter | ??? | D3 Ax0f64 C1
| 0x0F60 3936 | float | EEPROM_XYZ_CAL_SKEW | ??? | ff ff ff ffh | XYZ skew value | ??? | D3 Ax0f60 C4
| 0x0F5F 3935 | uint8 | EEPROM_WIZARD_ACTIVE | 01h 1 | 01h 1 __P__ | Wizard __active__ | ??? | D3 Ax0f5f C1
| ^ | ^ | ^ | 00h 0 | ^ | Wizard __inactive__ | ^ | ^
| ^ | ^ | ^ | 02h 2 | 02h 2 __M__ | Wizard active - Z cal after shipping/service prep | ^ | ^
| 0x0F5D 3933 | uint16 | EEPROM_BELTSTATUS_X | ??? | ff ffh | X Beltstatus | ??? | D3 Ax0f5d C2
| 0x0F5B 3931 | uint16 | EEPROM_BELTSTATUS_Y | ??? | ff ffh | Y Beltstatus | ??? | D3 Ax0f5b C2
| 0x0F5A 3930 | uint8 | EEPROM_DIR_DEPTH | 00h-ffh 0-255| ffh 255 | Directory depth | ??? | D3 Ax0f5a C1
| 0x0F0A 3850 | uint8 | EEPROM_DIRS | ??? | ffh 255 | Directories ??? | ??? | D3 Ax0f0a C80
| 0x0F09 3849 | uint8 | EEPROM_SD_SORT | 00h 0 | ffh 255 | SD card sort by: __time__ | LCD menu | D3 Ax0f09 C1
| ^ | ^ | ^ | 01h 1 | ^ | SD card sort by: __alphabet__ | LCD menu | ^
| ^ | ^ | ^ | 02h 2 | ^ | SD card: __not sorted__ | LCD menu | ^
| 0x0F08 3848 | uint8 | EEPROM_SECOND_SERIAL_ACTIVE | 00h 0 | ffh 255 | RPi Port: __disabled__ | LCD menu | D3 Ax0f08 C1
| ^ | ^ | ^ | 01h 1 | ^ | RPi Port: __enabled__ | LCD menu | ^
| 0x0F07 3847 | uint8 | EEPROM_FSENS_AUTOLOAD_ENABLED | 01h 1 | ffh 255 __P__ | Filament autoload: __enabled__ | LCD menu | D3 Ax0f07 C1
| ^ | ^ | ^ | 00h 0 | ^ | Filament autoload: __disabled__ | LCD menu | ^
| 0x0F05 3845 | uint16 | EEPROM_CRASH_COUNT_X_TOT | 0000-fffe | ff ffh __S/P__ | Total crashes on x axis | ??? | D3 Ax0f05 C2
| 0x0F03 3843 | uint16 | EEPROM_CRASH_COUNT_Y_TOT | 0000-fffe | ff ffh __S/P__ | Total crashes on y axis | ??? | D3 Ax0f03 C2
| 0x0F01 3841 | uint16 | EEPROM_FERROR_COUNT_TOT | 0000-fffe | ff ffh __S/P__ | Total filament sensor errors | ??? | D3 Ax0f01 C2
| 0x0EFF 3839 | uint16 | EEPROM_POWER_COUNT_TOT | 0000-fffe | ff ffh __S/P__ | Total power failures | ??? | D3 Ax0eff C2
| 0x0EFE 3838 | uint8 | EEPROM_TMC2130_HOME_X_ORIGIN | ??? | ffh 255 | ??? | ??? | D3 Ax0efe C1
| 0x0EFD 3837 | uint8 | EEPROM_TMC2130_HOME_X_BSTEPS | ??? | ffh 255 | ??? | ??? | D3 Ax0efd C1
| 0x0EFC 3836 | uint8 | EEPROM_TMC2130_HOME_X_FSTEPS | ??? | ffh 255 | ??? | ??? | D3 Ax0efc C1
| 0x0EFB 3835 | uint8 | EEPROM_TMC2130_HOME_Y_ORIGIN | ??? | ffh 255 | ??? | ??? | D3 Ax0efb C1
| 0x0EFA 3834 | uint8 | EEPROM_TMC2130_HOME_Y_BSTEPS | ??? | ffh 255 | ??? | ??? | D3 Ax0efa C1
| 0x0EF9 3833 | uint8 | EEPROM_TMC2130_HOME_Y_FSTEPS | ??? | ffh 255 | ??? | ??? | D3 Ax0ef9 C1
| 0x0EF8 3832 | uint8 | EEPROM_TMC2130_HOME_ENABLED | ??? | ffh 255 | ??? | ??? | D3 Ax0ef8 C1
| 0x0EF7 3831 | uint8 | EEPROM_TMC2130_WAVE_X_FAC | ??? | ffh 255 | ??? | ??? | D3 Ax0ef7 C1
| 0x0EF6 3830 | uint8 | EEPROM_TMC2130_WAVE_Y_FAC | ??? | ffh 255 | ??? | ??? | D3 Ax0ef6 C1
| 0x0EF5 3829 | uint8 | EEPROM_TMC2130_WAVE_Z_FAC | ??? | ffh 255 | ??? | ??? | D3 Ax0ef5 C1
| 0x0EF4 3828 | uint8 | EEPROM_TMC2130_WAVE_E_FAC | ??? | ffh 255 | ??? | ??? | D3 Ax0ef4 C1
| 0x0EF3 3827 | uint8 | EEPROM_TMC2130_X_MRES | ??? | ffh 255 | ??? | ??? | D3 Ax0ef3 C1
| 0x0EF2 3826 | uint8 | EEPROM_TMC2130_Y_MRES | ??? | ffh 255 | ??? | ??? | D3 Ax0ef2 C1
| 0x0EF1 3825 | uint8 | EEPROM_TMC2130_Z_MRES | ??? | ffh 255 | ??? | ??? | D3 Ax0ef1 C1
| 0x0EF0 3824 | uint8 | EEPROM_TMC2130_E_MRES | ??? | ffh 255 | ??? | ??? | D3 Ax0ef0 C1
| 0x0EEE 3822 | uint16 | EEPROM_PRINTER_TYPE | ??? | ff ffh 65535 | Printer Type | ??? | D3 Ax0eee C2
| ^ | ^ | ^ | 64 00h 100 | ^ | PRINTER_MK1 | ??? | ^
| ^ | ^ | ^ | c8 00h 200 | ^ | PRINTER_MK2 | ??? | ^
| ^ | ^ | ^ | c9 00h 201 | ^ | PRINTER_MK2 with MMU1 | ??? | ^
| ^ | ^ | ^ | ca 00h 202 | ^ | PRINTER_MK2S | ??? | ^
| ^ | ^ | ^ | cb 00h 203 | ^ | PRINTER_MK2S with MMU1 | ??? | ^
| ^ | ^ | ^ | fa 00h 250 | ^ | PRINTER_MK2.5 | ??? | ^
| ^ | ^ | ^ | 1a 4fh 20250 | ^ | PRINTER_MK2.5 with MMU2 | ??? | ^
| ^ | ^ | ^ | fc 00h 252 | ^ | PRINTER_MK2.5S | ??? | ^
| ^ | ^ | ^ | 1c 4fh 20252 | ^ | PRINTER_MK2.5S with MMU2S | ??? | ^
| ^ | ^ | ^ | 2c 01h 300 | ^ | PRINTER_MK3 | ??? | ^
| ^ | ^ | ^ | 4c 4fh 20300 | ^ | PRINTER_MK3 with MMU2 | ??? | ^
| ^ | ^ | ^ | 2e 01h 302 | ^ | PRINTER_MK3S | ??? | ^
| ^ | ^ | ^ | 4e 4fh 20302 | ^ | PRINTER_MK3S with MMU2S | ??? | ^
| 0x0EEC 3820 | uint16 | EEPROM_BOARD_TYPE | ??? | ff ffh 65535 | Board Type | ??? | D3 Ax0eec C2
| ^ | ^ | ^ | c8 00h 200 | ^ | BOARD_RAMBO_MINI_1_0 | ??? | ^
| ^ | ^ | ^ | cb 00h 203 | ^ | BOARD_RAMBO_MINI_1_3 | ??? | ^
| ^ | ^ | ^ | 36 01h 310 | ^ | BOARD_EINSY_1_0a | ??? | ^
| 0x0EE8 3816 | float | EEPROM_EXTRUDER_MULTIPLIER_0 | ??? | ff ff ff ffh | Power panic Extruder 0 multiplier | ??? | D3 Ax0ee8 C4
| 0x0EE4 3812 | float | EEPROM_EXTRUDER_MULTIPLIER_1 | ??? | ff ff ff ffh | Power panic Extruder 1 multiplier | ??? | D3 Ax0ee4 C4
| 0x0EE0 3808 | float | EEPROM_EXTRUDER_MULTIPLIER_2 | ??? | ff ff ff ffh | Power panic Extruder 2 multiplier | ??? | D3 Ax0ee0 C4
| 0x0EDE 3806 | uint16 | EEPROM_EXTRUDEMULTIPLY | ??? | ff ffh 65535 | Power panic Extruder multiplier | ??? | D3 Ax0ede C2
| 0x0EDA 3802 | float | EEPROM_UVLO_TINY_CURRENT_POSITION_Z | ??? | ff ff ff ffh | Power panic Z position | ??? | D3 Ax0eda C4
| 0x0ED8 3800 | uint16 | EEPROM_UVLO_TARGET_HOTEND | ??? | ff ffh 65535 | Power panic target Hotend temperature | ??? | D3 Ax0ed8 C2
| 0x0ED7 3799 | uint8 | EEPROM_SOUND_MODE | 00h 0 | ffh 255 | Sound mode: __loud__ | ??? | D3 Ax0ed7 C1
| ^ | ^ | ^ | 01h 1 | ^ | Sound mode: __once__ | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | Sound mode: __silent__ | ^ | ^
| ^ | ^ | ^ | 03h 3 | ^ | Sound mode: __assist__ | ^ | ^
| 0x0ED6 3798 | bool | EEPROM_SPOOL_JOIN | 01h 1 | ffh 255 | MMU2/s autodeplete: __on__ | ??? | D3 Ax0ed6 C1
| ^ | ^ | ^ | 00h 0 | ^ | MMU2/s autodeplete: __off__ | ^ | ^
| 0x0ED5 3797 | bool | EEPROM_FSENS_RUNOUT_ENABLED | 01h 1 | ffh 255 __P__ | Filament runout: __enabled__ | LCD menu | D3 Ax0ed5 C1
| ^ | ^ | ^ | 00h 0 | ^ | Filament runout: __disabled__ | LCD menu | ^
| 0x0ED3 3795 | uint16 | EEPROM_MMU_FAIL_TOT | ??? | ff ffh 65535 __S/P__ | MMU2/s total failures | ??? | D3 Ax0ed3 C2
| 0x0ED2 3794 | uint8 | EEPROM_MMU_FAIL | ??? | ffh 255 __S/P__ | MMU2/s fails during print | ??? | D3 Ax0ed2 C1
| 0x0ED0 3792 | uint16 | EEPROM_MMU_LOAD_FAIL_TOT | ??? | ff ffh 65535 __S/P__ | MMU2/s total load failures | ??? | D3 Ax0ed0 C2
| 0x0ECF 3791 | uint8 | EEPROM_MMU_LOAD_FAIL | ??? | ffh 255 __S/P__ | MMU2/s load failures during print | ??? | D3 Ax0ecf C1
| 0x0ECE 3790 | uint8 | EEPROM_MMU_CUTTER_ENABLED | 00h 0 | ffh 255 | MMU2/s cutter: __disabled__ | LCD menu | D3 Ax0ece C1
| ^ | ^ | ^ | 01h 1 | ^ | MMU2/s cutter: __enabled__ | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | MMU2/s cutter: __always__ | ^ | ^
| 0x0DAE 3502 | uint16 | EEPROM_UVLO_MESH_BED_LEVELING_FULL | ??? | ff ffh 65535 | Power panic Mesh bed leveling points | ??? | D3 Ax0dae C288
| 0x0DAD 3501 | uint8 | EEPROM_MBL_TYPE | ??? | ffh 255 | Mesh bed leveling precision _unused atm_ | ??? | D3 Ax0dad C1
| 0x0DAC 3500 | bool | EEPROM_MBL_MAGNET_ELIMINATION | 01h 1 | ffh 255 | Mesh bed leveling does: __ignores__ magnets | LCD menu | D3 Ax0dac C1
| ^ | ^ | ^ | 00h 0 | ^ | Mesh bed leveling does: __NOT ignores__ magnets | ^ | ^
| 0x0DAB 3499 | uint8 | EEPROM_MBL_POINTS_NR | 03h 3 | ffh 255 | Mesh bed leveling points: __3x3__ | LCD menu | D3 Ax0dab C1
| ^ | ^ | ^ | 07h 7 | ^ | Mesh bed leveling points: __7x7__ | ^ | ^
| 0x0DAA 3498 | uint8 | EEPROM_MBL_PROBE_NR | 03h 3 | ffh 255 | MBL times measurements for each point: __3__ | LCD menu | D3 Ax0daa C1
| ^ | ^ | ^ | 05h 5 | ^ | MBL times measurements for each point: __5__ | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | MBL times measurements for each point: __1__ | ^ | ^
| 0x0DA9 3497 | uint8 | EEPROM_MMU_STEALTH | 01h 1 | ffh 255 | MMU2/s Silent mode: __on__ | ??? | D3 Ax0da9 C1
| ^ | ^ | ^ | 00h 0 | ^ | MMU2/s Silent mode: __off__ | ^ | ^
| 0x0DA8 3496 | uint8 | EEPROM_CHECK_MODE | 01h 1 | ffh 255 | Check mode for nozzle is: __warn__ | LCD menu | D3 Ax0da8 C1
| ^ | ^ | ^ | 02h 2 | ^ | Check mode for nozzle is: __strict__ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for nozzle is: __none__ | ^ | ^
| 0x0DA7 3495 | uint8 | EEPROM_NOZZLE_DIAMETER | 28h 40 | ffh 255 | Nozzle diameter is: __40 or 0.40mm__ | LCD menu | D3 Ax0da7 C1
| ^ | ^ | ^ | 3ch 60 | ^ | Nozzle diameter is: __60 or 0.60mm__ | ^ | ^
| ^ | ^ | ^ | 3ch 80 | ^ | Nozzle diameter is: __80 or 0.80mm__ | ^ | ^
| ^ | ^ | ^ | 19h 25 | ^ | Nozzle diameter is: __25 or 0.25mm__ | ^ | ^
| 0x0DA5 3493 | uint16 | EEPROM_NOZZLE_DIAMETER_uM | 9001h | ff ffh 65535 | Nozzle diameter is: __400um__ | LCD menu | D3 Ax0da5 C2
| ^ | ^ | ^ | 5802h | ^ | Nozzle diameter is: __600um__ | ^ | ^
| ^ | ^ | ^ | 2003h | ^ | Nozzle diameter is: __800um__ | ^ | ^
| ^ | ^ | ^ | fa00h | ^ | Nozzle diameter is: __250um__ | ^ | ^
| 0x0DA4 3492 | uint8 | EEPROM_CHECK_MODEL | 01h 1 | ffh 255 | Check mode for printer model is: __warn__ | LCD menu | D3 Ax0da4 C1
| ^ | ^ | ^ | 02h 2 | ^ | Check mode for printer model is: __strict__ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for printer model is: __none__ | ^ | ^
| 0x0DA3 3491 | uint8 | EEPROM_CHECK_VERSION | 01h 1 | ffh 255 | Check mode for firmware is: __warn__ | LCD menu | D3 Ax0da3 C1
| ^ | ^ | ^ | 02h 2 | ^ | Check mode for firmware is: __strict__ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for firmware is: __none__ | ^ | ^
| 0x0DA2 3490 | uint8 | EEPROM_CHECK_GCODE | 01h 1 | ffh 255 | Check mode for gcode is: __warn__ _unused atm_ | LCD menu | D3 Ax0da2 C1
| ^ | ^ | ^ | 02h 2 | ^ | Check mode for gcode is: __strict__ _unused atm_ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for gcode is: __none__ _unused atm_ | ^ | ^
| 0x0D49 3401 | uint16 | EEPROM_SHEETS_BASE | ??? | ffh 255 | ??? | LCD menu | D3 Ax0d49 C89
| 0x0D49 3401 | char | _1st Sheet block_ |536d6f6f746831| ffffffffffffff | 1st sheet - Name: _Smooth1_ | ^ | D3 Ax0d49 C7
| 0x0D50 3408 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 1st sheet - Z offset | ^ | D3 Ax0d50 C2
| 0x0D52 3410 | uint8 | ^ | 00h 0 | ffh 255 | 1st sheet - bed temp | ^ | D3 Ax0d52 C1
| 0x0D53 3411 | uint8 | ^ | 00h 0 | ffh 255 | 1st sheet - PINDA temp | ^ | D3 Ax0d53 C1
| 0x0D54 3412 | char | _2nd Sheet block_ |536d6f6f746832| ffffffffffffff | 2nd sheet - Name: _Smooth2_ | ^ | D3 Ax0d54 C7
| 0x0D5B 3419 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 2nd sheet - Z offset | ^ | D3 Ax0d5b C2
| 0x0D5D 3421 | uint8 | ^ | 00h 0 | ffh 255 | 2nd sheet - bed temp | ^ | D3 Ax0d5d C1
| 0x0D5E 3422 | uint8 | ^ | 00h 0 | ffh 255 | 2nd sheet - PINDA temp | ^ | D3 Ax0d5e C1
| 0x0D5F 3423 | char | _3rd Sheet block_ |54657874757231| ffffffffffffff | 3rd sheet - Name: _Textur1_ | ^ | D3 Ax0d5f C7
| 0x0D66 3430 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 3rd sheet - Z offset | ^ | D3 Ax0d66 C2
| 0x0D68 3432 | uint8 | ^ | 00h 0 | ffh 255 | 3rd sheet - bed temp | ^ | D3 Ax0d68 C1
| 0x0D69 3433 | uint8 | ^ | 00h 0 | ffh 255 | 3rd sheet - PINDA temp | ^ | D3 Ax0d69 C1
| 0x0D6A 3434 | char | _4th Sheet block_ |54657874757232| ffffffffffffff | 4th sheet - Name: _Textur2_ | ^ | D3 Ax0d6a C7
| 0x0D71 3441 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 4th sheet - Z offset | ^ | D3 Ax0d71 C2
| 0x0D73 3443 | uint8 | ^ | 00h 0 | ffh 255 | 4th sheet - bed temp | ^ | D3 Ax0d73 C1
| 0x0D74 3444 | uint8 | ^ | 00h 0 | ffh 255 | 4th sheet - PINDA temp | ^ | D3 Ax0d74 C1
| 0x0D75 3445 | char | _5th Sheet block_ |536174696e2020| ffffffffffffff | 5th sheet - Name: _Satin _ | ^ | D3 Ax0d75 C7
| 0x0D7C 3452 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 5th sheet - Z offset | ^ | D3 Ax0d7c C2
| 0x0D7E 3454 | uint8 | ^ | 00h 0 | ffh 255 | 5th sheet - bed temp | ^ | D3 Ax0d7e C1
| 0x0D7F 3455 | uint8 | ^ | 00h 0 | ffh 255 | 5th sheet - PINDA temp | ^ | D3 Ax0d7f C1
| 0x0D80 3456 | char | _6th Sheet block_ |4e796c6f6e5041| ffffffffffffff | 6th sheet - Name: _NylonPA_ | ^ | D3 Ax0d80 C7
| 0x0D87 3463 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 6th sheet - Z offset | ^ | D3 Ax0d87 C2
| 0x0D89 3465 | uint8 | ^ | 00h 0 | ffh 255 | 6th sheet - bed temp | ^ | D3 Ax0d89 C1
| 0x0D8A 3466 | uint8 | ^ | 00h 0 | ffh 255 | 6th sheet - PINDA temp | ^ | D3 Ax0d8a C1
| 0x0D8B 3467 | char | _7th Sheet block_ |437573746f6d31| ffffffffffffff | 7th sheet - Name: _Custom1_ | ^ | D3 Ax0d8b C7
| 0x0D92 3474 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 7th sheet - Z offset | ^ | D3 Ax0d92 C2
| 0x0D94 3476 | uint8 | ^ | 00h 0 | ffh 255 | 7th sheet - bed temp | ^ | D3 Ax0d94 C1
| 0x0D95 3477 | uint8 | ^ | 00h 0 | ffh 255 | 7th sheet - PINDA temp | ^ | D3 Ax0d95 C1
| 0x0D96 3478 | char | _8th Sheet block_ |437573746f6d32| ffffffffffffff | 8th sheet - Name: _Custom2_ | ^ | D3 Ax0d96 C7
| 0x0D9D 3485 | uint16 | ^ | 00 00h 0 | ff ffh 65535 | 8th sheet - Z offset | ^ | D3 Ax0d9d C2
| 0x0D9F 3487 | uint8 | ^ | 00h 0 | ffh 255 | 8th sheet - bed temp | ^ | D3 Ax0d9f C1
| 0x0DA0 3488 | uint8 | ^ | 00h 0 | ffh 255 | 8th sheet - PINDA temp | ^ | D3 Ax0da0 C1
| 0x0DA1 3489 | uint8 | active_sheet | 00h 0 | ffh 255 | Active sheet index | ^ | D3 Ax0da1 C1
| 0x0D48 3400 | uint8 | EEPROM_FSENSOR_PCB | ffh 255 | ffh 255 | Filament Sensor type IR unknown | LCD Support | D3 Ax0d48 C1
| ^ | ^ | ^ | 00h 0 | ^ | Filament Sensor type IR 0.3 or older | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | Filament Sensor type IR 0.4 or newer | ^ | ^
| 0x0D47 3399 | uint8 | EEPROM_FSENSOR_ACTION_NA | 00h 0 | ffh 255 | Filament Sensor action: __Continue__ | LCD menu | D3 Ax0d47 C1
| ^ | ^ | ^ | 01h 1 | ^ | Filament Sensor action: __Pause__ | ^ | ^
| 0x0D37 3383 | float | EEPROM_UVLO_SAVED_START_POSITION | ??? | ff ff ff ffh | Power panic saved start position all-axis | ??? | D3 Ax0d37 C16
| ^ | ^ | ^ | ??? | ^ | Power panic saved start position e-axis | ^ | D3 Ax0d43 C4
| ^ | ^ | ^ | ??? | ^ | Power panic saved start position z-axis | ^ | D3 Ax0d3f C4
| ^ | ^ | ^ | ??? | ^ | Power panic saved start position y-axis | ^ | D3 Ax0d3b C4
| ^ | ^ | ^ | ??? | ^ | Power panic saved start position x-axis | ^ | D3 Ax0d37 C4
| 0x0D35 3381 | uint16 | EEPROM_UVLO_FEEDMULTIPLY | ??? | ff ffh 65355 | Power panic saved feed multiplier | ??? | D3 Ax0d35 C2
| 0x0D34 3380 | uint8 | EEPROM_BACKLIGHT_LEVEL_HIGH | 00h - ffh | 82h 130 | LCD backlight bright: __128__ Dim value to 255 | LCD menu | D3 Ax0d34 C1
| 0x0D33 3379 | uint8 | EEPROM_BACKLIGHT_LEVEL_LOW | 00h - ffh | 32h 50 | LCD backlight dim: __50__ 0 to Bright value | LCD menu | D3 Ax0d33 C1
| 0x0D32 3378 | uint8 | EEPROM_BACKLIGHT_MODE | 02h 2 | ffh 255 | LCD backlight mode: __Auto__ | LCD menu | D3 Ax0d32 C1
| ^ | ^ | ^ | 01h 1 | ^ | LCD backlight mode: __Bright__ | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | LCD backlight mode: __Dim__ | ^ | ^
| 0x0D30 3376 | uint16 | EEPROM_BACKLIGHT_TIMEOUT | 01 00 - ff ff| 0a 00h 65535 | LCD backlight timeout: __10__ seconds | LCD menu | D3 Ax0d30 C2
| 0x0D2C 3372 | float | EEPROM_UVLO_LA_K | ??? | ff ff ff ffh | Power panic saved Linear Advanced K value | ??? | D3 Ax0d2c C4
| 0x0D2B 3371 | uint8 | EEPROM_ALTFAN_OVERRIDE | ffh 255 | ffh 255 | ALTFAN override unknown state | LCD menu | D3 Ax0d2b C1
| ^ | ^ | ^ | 00h 0 | ^ | ALTFAN override deactivated | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | ALTFAN override activated | ^ | ^
| 0x0D2A 3370 | uint8 | EEPROM_EXPERIMENTAL_VISIBILITY | ffh 255 | ffh 255 | Experimental menu visibility unknown state | LCD menu | D3 Ax0d2a C1
| ^ | ^ | ^ | 00h 0 | ^ | Experimental menu visibility hidden | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | Experimental menu visibility visible | ^ | ^
| 0x0D29 3369 | uint8 | EEPROM_PINDA_TEMP_COMPENSATION | ffh 255 | ffh 255 | PINDA temp compensation unknown state | LCD menu | D3 Ax0d29 C1
| ^ | ^ | ^ | 00h 0 | ^ | PINDA has no temp compensation PINDA v1/2 | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | PINDA has temp compensation aka SuperPINDA | ^ | ^
| 0x0D15 3349 | char[20]| EEPROM_PRUSA_SN | SN[19] == 0 | ffffffffffffffff... | PRUSA Serial number string | PRUSA SN | D3 Ax0d15 C20
| 0x0D11 3345 | float | EEPROM_UVLO_ACCELL | ??? | ff ff ff ffh | Power panic saved normal acceleration | ??? | D3 Ax0d11 C4
| 0x0D0D 3341 | float | EEPROM_UVLO_RETRACT_ACCELL | ??? | ff ff ff ffh | Power panic saved retract acceleration | ??? | D3 Ax0d0d C4
| 0x0D09 3337 | float | EEPROM_UVLO_TRAVEL_ACCELL | ??? | ff ff ff ffh | Power panic saved travel acceleration | ??? | D3 Ax0d09 C4
| 0x0D05 3333 | unint32 | EEPROM_JOB_ID | ??? | 00 00 00 00h | Job ID used by host software | D3 only | D3 Ax0d05 C4
| 0x0D04 3332 | uint8 | EEPROM_ECOOL_ENABLE | ffh 255 | ^ | Disable extruder motor scaling for non-farm print | LCD menu | D3 Ax0d04 C1
| ^ | ^ | ^ | 2ah 42 | ^ | Enable extruder motor scaling for non-farm print | ^ | D3 Ax0d04 C1
| 0x0D03 3331 | uint8 | EEPROM_FW_CRASH_FLAG | ffh 255 | ffh 255 | Last FW crash reason (dump_crash_reason) | D21/D22 | D3 Ax0d03 C1
| ^ | ^ | ^ | 00h 0 | ^ | manual | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | stack_error | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | watchdog | ^ | ^
| ^ | ^ | ^ | 03h 3 | ^ | bad_isr | ^ | ^
| ^ | ^ | ^ | 04h 4 | ^ | bad_pullup_temp_isr | ^ | ^
| ^ | ^ | ^ | 05h 5 | ^ | bad_pullup_step_isr | ^ | ^
| 0x0D02 3330 | uint8 | EEPROM_TEMP_MODEL_ENABLE | 00h 0 | ff/00 | Temp model deactivated | Temp model | D3 Ax0d02 C1
| ^ | ^ | ^ | 01h 1 | ^ | Temp model activated | ^ | ^
| 0x0CFE 3326 | float | EEPROM_TEMP_MODEL_P | ??? | ff ff ff ffh | Temp model power (W) | Temp model | D3 Ax0cfe C4
| 0x0CFA 3322 | float | EEPROM_TEMP_MODEL_C | ??? | ff ff ff ffh | Temp model capacitance (J/K) | Temp model | D3 Ax0cfa C4
| 0x0CBA 3258 |float[16]| EEPROM_TEMP_MODEL_R | ??? | ff ff ff ffh | Temp model resistance (K/W) | Temp model | D3 Ax0cba C64
| 0x0CB6 3254 | float | EEPROM_TEMP_MODEL_Ta_corr | ??? | ff ff ff ffh | Temp model ambient temperature correction (K) | Temp model | D3 Ax0cb6 C4
| 0x0CB2 3250 | float | EEPROM_TEMP_MODEL_W | ??? | ff ff ff ffh | Temp model warning threshold (K/s) | Temp model | D3 Ax0cb2 C4
| 0x0CAE 3246 | float | EEPROM_TEMP_MODEL_E | ??? | ff ff ff ffh | Temp model error threshold (K/s) | Temp model | D3 Ax0cae C4
| 0x0CAD 3245 | uint8 | EEPROM_FSENSOR_JAM_DETECTION | 01h 1 | ff/01 | fsensor pat9125 jam detection feature | LCD menu | D3 Ax0cad C1
| 0x0CAC 3244 | uint8 | EEPROM_MMU_ENABLED | 01h 1 | ff/01 | MMU enabled | LCD menu | D3 Ax0cac C1
| 0x0CA8 3240 | uint32 | EEPROM_TOTAL_TOOLCHANGE_COUNT | ??? | ff ff ff ffh | MMU toolchange counter over printers lifetime | LCD statistic| D3 Ax0ca8 C4
| 0x0CA7 3239 | uint8 | EEPROM_HEAT_BED_ON_LOAD_FILAMENT | ffh 255 | ffh 255 | Heat bed on load filament unknown state | LCD menu | D3 Ax0ca7 C1
| ^ | ^ | ^ | 00h 0 | ^ | Do not heat bed on load filament | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | Heat bed on load filament | ^ | ^
| 0x0CA6 3238 | uint8 | EEPROM_CALIBRATION_STATUS_V2 | ffh 255 | ffh 255 | Calibration status (>=v3.12) | ??? | D3 Ax0ca6 C1
| ^ | ^ | ^ | 01h 1 | ^ | Selftest passed | ^ | ^
| ^ | ^ | ^ | 02h 2 | ^ | XYZ cal passed | ^ | ^
| ^ | ^ | ^ | 04h 4 | ^ | Z cal passed | ^ | ^
| ^ | ^ | ^ | 08h 8 | ^ | Temp model cal passed | ^ | ^
| ^ | ^ | ^ | 10h 16 | ^ | Live Adjust set | ^ | ^
| ^ | ^ | ^ | 20h 32 | ^ | Free bit | ^ | ^
| ^ | ^ | ^ | 40h 64 | ^ | Free bit | ^ | ^
| ^ | ^ | ^ | 80h 128 | ^ | Unknown | ^ | ^
| 0x0CA5 3237 | float | EEPROM_TEMP_MODEL_U | ??? | ff ff ff ffh | Temp model linear temperature coefficient (W/K/W) | Temp model | D3 Ax0ca5 C4
| 0x0CA1 3233 | float | EEPROM_TEMP_MODEL_V | ??? | ff ff ff ffh | Temp model linear temperature intercept (W/W) | Temp model | D3 Ax0ca1 C4
| 0x0C9D 3229 | float | EEPROM_TEMP_MODEL_D | ??? | ff ff ff ffh | Temp model sim. 1st order IIR filter factor | Temp model | D3 Ax0c9d C4
| 0x0C99 3225 | uint16 | EEPROM_TEMP_MODEL_L | 0-2160 | ff ffh | Temp model sim. response lag (ms) | Temp model | D3 Ax0c99 C2
|Address begin|Bit/Type | Name | Valid values | Default/FactoryReset | Description |Gcode/Function| Debug code
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--:
| 0x0012 18 | uint16 | EEPROM_FIRMWARE_VERSION_END | ??? | ff ffh 65535 | ??? | ??? | D3 Ax0012 C2
| 0x0010 16 | uint16 | EEPROM_FIRMWARE_VERSION_FLAVOR | ??? | ff ffh 65535 | ??? | ??? | D3 Ax0010 C2
| 0x000E 14 | uint16 | EEPROM_FIRMWARE_VERSION_REVISION | ??? | ff ffh 65535 | Firmware version revision number DEV/ALPHA/BETA/RC| ??? | D3 Ax000e C2
| 0x000C 12 | uint16 | EEPROM_FIRMWARE_VERSION_MINOR | ??? | ff ffh 65535 | Firmware version minor number | ??? | D3 Ax000c C2
| 0x000A 10 | uint16 | EEPROM_FIRMWARE_VERSION_MAJOR | ??? | ff ffh 65535 | Firmware version major number | ??? | D3 Ax000a C2
| 0x0000 0 | char | FW_PRUSA3D_MAGIC | ??? | ffffffffffffffffffff | __`PRUSA3DFW`__ | ??? | D3 Ax0000 C10
*/
#define EEPROM_EMPTY_VALUE 0xFF
@ -355,7 +383,7 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
#define EEPROM_BABYSTEP_X 4092 //unused
#define EEPROM_BABYSTEP_Y 4090 //unused
#define EEPROM_BABYSTEP_Z 4088 //legacy, multiple values stored now in EEPROM_Sheets_base
#define EEPROM_CALIBRATION_STATUS 4087
#define EEPROM_CALIBRATION_STATUS_V1 4087 // legacy, used up to v3.11
#define EEPROM_BABYSTEP_Z0 4085
#define EEPROM_FILAMENTUSED 4081
// uint32_t
@ -382,19 +410,19 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
#define EEPROM_BED_CORRECTION_REAR (EEPROM_BED_CORRECTION_FRONT-1)
#define EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY (EEPROM_BED_CORRECTION_REAR-1)
#define EEPROM_PRINT_FLAG (EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY-1)
#define EEPROM_PROBE_TEMP_SHIFT (EEPROM_PRINT_FLAG - 2*5) //5 x int for storing pinda probe temp shift relative to 50 C; unit: motor steps
#define EEPROM_PROBE_TEMP_SHIFT (EEPROM_PRINT_FLAG - 2*5) //5 x int for storing pinda probe temp shift relative to 50 C; unit: motor steps
#define EEPROM_TEMP_CAL_ACTIVE (EEPROM_PROBE_TEMP_SHIFT - 1)
#define _EEPROM_FREE_NR6_ (EEPROM_TEMP_CAL_ACTIVE - 2*4) //4 x int (used to be for bowden lengths for SNMM)
#define EEPROM_CALIBRATION_STATUS_PINDA (_EEPROM_FREE_NR6_ - 1) //0 - not calibrated; 1 - calibrated
#define EEPROM_UVLO (EEPROM_CALIBRATION_STATUS_PINDA - 1) //1 - uvlo during print
#define EEPROM_UVLO_CURRENT_POSITION (EEPROM_UVLO-2*4) // 2 x float for current_position in X and Y axes
#define EEPROM_FILENAME (EEPROM_UVLO_CURRENT_POSITION - 8) //8chars to store filename without extension
#define EEPROM_FILE_POSITION (EEPROM_FILENAME - 4) //32 bit for uint32_t file position
#define EEPROM_FILE_POSITION (EEPROM_FILENAME - 4) //32 bit for uint32_t file position
#define EEPROM_UVLO_CURRENT_POSITION_Z (EEPROM_FILE_POSITION - 4) //float for current position in Z
#define EEPROM_UVLO_UNUSED_001 (EEPROM_UVLO_CURRENT_POSITION_Z - 1) // uint8_t (unused)
#define EEPROM_UVLO_TARGET_BED (EEPROM_UVLO_UNUSED_001 - 1)
#define EEPROM_UVLO_FEEDRATE (EEPROM_UVLO_TARGET_BED - 2) //uint16_t
#define EEPROM_UVLO_FAN_SPEED (EEPROM_UVLO_FEEDRATE - 1)
#define EEPROM_UVLO_FAN_SPEED (EEPROM_UVLO_FEEDRATE - 1)
#define EEPROM_FAN_CHECK_ENABLED (EEPROM_UVLO_FAN_SPEED - 1)
#define EEPROM_UVLO_MESH_BED_LEVELING (EEPROM_FAN_CHECK_ENABLED - 9*2)
#define EEPROM_UVLO_Z_MICROSTEPS (EEPROM_UVLO_MESH_BED_LEVELING - 2) // uint16_t (could be removed)
@ -405,12 +433,12 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
#define EEPROM_FREE_NR4 (EEPROM_UVLO_SAVED_SEGMENT_IDX - 1) // FREE EEPROM SPACE
#define EEPROM_FREE_NR5 (EEPROM_FREE_NR4 - 1) // FREE EEPROM SPACE
// Crash detection mode EEPROM setting
#define EEPROM_CRASH_DET (EEPROM_FREE_NR5 - 1) // uint8 (orig EEPROM_UVLO_MESH_BED_LEVELING-12)
// Crash detection mode EEPROM setting
#define EEPROM_CRASH_DET (EEPROM_FREE_NR5 - 1) // uint8 (orig EEPROM_UVLO_MESH_BED_LEVELING-12)
// Crash detection counter Y (last print)
#define EEPROM_CRASH_COUNT_Y (EEPROM_CRASH_DET - 1) // uint8 (orig EEPROM_UVLO_MESH_BED_LEVELING-15)
// Filament sensor on/off EEPROM setting
#define EEPROM_FSENSOR (EEPROM_CRASH_COUNT_Y - 1) // uint8 (orig EEPROM_UVLO_MESH_BED_LEVELING-14)
// Filament sensor on/off EEPROM setting
#define EEPROM_FSENSOR (EEPROM_CRASH_COUNT_Y - 1) // uint8 (orig EEPROM_UVLO_MESH_BED_LEVELING-14)
// Crash detection counter X (last print)
#define EEPROM_CRASH_COUNT_X (EEPROM_FSENSOR - 1) // uint8 (orig EEPROM_UVLO_MESH_BED_LEVELING-15)
// Filament runout/error coutner (last print)
@ -440,7 +468,7 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
#define EEPROM_POWER_COUNT_TOT (EEPROM_FERROR_COUNT_TOT - 2) // uint16
////////////////////////////////////////
// TMC2130 Accurate sensorless homing
// TMC2130 Accurate sensorless homing
// X-axis home origin (stepper phase in microsteps, 0..63 for 16ustep resolution)
#define EEPROM_TMC2130_HOME_X_ORIGIN (EEPROM_POWER_COUNT_TOT - 1) // uint8
@ -505,7 +533,7 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
#define EEPROM_UVLO_MESH_BED_LEVELING_FULL (EEPROM_MMU_CUTTER_ENABLED - 12*12*2) //allow 12 calibration points for future expansion
#define EEPROM_MBL_TYPE (EEPROM_UVLO_MESH_BED_LEVELING_FULL-1) //uint8_t for mesh bed leveling precision
#define EEPROM_MBL_MAGNET_ELIMINATION (EEPROM_MBL_TYPE -1)
#define EEPROM_MBL_MAGNET_ELIMINATION (EEPROM_MBL_TYPE -1)
#define EEPROM_MBL_POINTS_NR (EEPROM_MBL_MAGNET_ELIMINATION -1) //uint8_t number of points in one exis for mesh bed leveling
#define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) //number of measurements for each point
@ -556,8 +584,20 @@ static Sheets * const EEPROM_Sheets_base = (Sheets*)(EEPROM_SHEETS_BASE);
#define EEPROM_TEMP_MODEL_W (EEPROM_TEMP_MODEL_Ta_corr-4) // float
#define EEPROM_TEMP_MODEL_E (EEPROM_TEMP_MODEL_W-4) // float
#define EEPROM_FSENSOR_JAM_DETECTION (EEPROM_TEMP_MODEL_E-1) // uint8_t
#define EEPROM_MMU_ENABLED (EEPROM_FSENSOR_JAM_DETECTION-1) // uint8_t
#define EEPROM_TOTAL_TOOLCHANGE_COUNT (EEPROM_MMU_ENABLED-4)
#define EEPROM_HEAT_BED_ON_LOAD_FILAMENT (EEPROM_TOTAL_TOOLCHANGE_COUNT-1) //uint8
#define EEPROM_CALIBRATION_STATUS_V2 (EEPROM_HEAT_BED_ON_LOAD_FILAMENT-1) //uint8
#define EEPROM_TEMP_MODEL_U (EEPROM_CALIBRATION_STATUS_V2-4) //float
#define EEPROM_TEMP_MODEL_V (EEPROM_TEMP_MODEL_U-4) //float
#define EEPROM_TEMP_MODEL_D (EEPROM_TEMP_MODEL_V-4) //float
#define EEPROM_TEMP_MODEL_L (EEPROM_TEMP_MODEL_D-2) //uint16_t
#define EEPROM_TEMP_MODEL_VER (EEPROM_TEMP_MODEL_L-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_TEMP_MODEL_E
#define EEPROM_LAST_ITEM EEPROM_TEMP_MODEL_VER
// !!!!!
// !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!!
// !!!!!
@ -590,7 +630,6 @@ enum
#ifdef __cplusplus
void eeprom_init();
bool eeprom_is_sheet_initialized(uint8_t sheet_num);
struct SheetName
{
char c[sizeof(Sheet::name) + 1];
@ -598,6 +637,26 @@ struct SheetName
void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName);
int8_t eeprom_next_initialized_sheet(int8_t sheet);
void eeprom_switch_to_next_sheet();
bool eeprom_is_sheet_initialized(uint8_t sheet_num);
bool eeprom_is_initialized_block(const void *__p, size_t __n);
void eeprom_update_block_P(const void *__src, void *__dst, size_t __n);
void eeprom_toggle(uint8_t *__p);
void eeprom_increment_byte(uint8_t *__p);
void eeprom_increment_word(uint16_t *__p);
void eeprom_increment_dword(uint32_t *__p);
void eeprom_add_byte(uint8_t *__p, uint8_t add);
void eeprom_add_word(uint16_t *__p, uint16_t add);
void eeprom_add_dword(uint32_t *__p, uint32_t add);
uint8_t eeprom_init_default_byte(uint8_t *__p, uint8_t def);
uint16_t eeprom_init_default_word(uint16_t *__p, uint16_t def);
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);
#endif
#endif // EEPROM_H

View File

@ -37,7 +37,7 @@ volatile uint8_t fan_check_error = EFCE_OK;
void setExtruderAutoFanState(uint8_t state)
{
//If bit 1 is set (0x02), then the extruder fan speed won't be adjusted according to temperature. Useful for forcing
//If bit 1 is set (0x02), then the hotend fan speed won't be adjusted according to temperature. Useful for forcing
//the fan to either On or Off during certain tests/errors.
fanState = state;
@ -62,7 +62,7 @@ void countFanSpeed()
fan_speed[0] = (fan_edge_counter[0] * (float(250) / (_millis() - extruder_autofan_last_check)));
fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check)));
/*SERIAL_ECHOPGM("time interval: "); MYSERIAL.println(_millis() - extruder_autofan_last_check);
SERIAL_ECHOPGM("extruder fan speed:"); MYSERIAL.print(fan_speed[0]); SERIAL_ECHOPGM("; edge counter:"); MYSERIAL.println(fan_edge_counter[0]);
SERIAL_ECHOPGM("hotend fan speed:"); MYSERIAL.print(fan_speed[0]); SERIAL_ECHOPGM("; edge counter:"); MYSERIAL.println(fan_edge_counter[0]);
SERIAL_ECHOPGM("print fan speed:"); MYSERIAL.print(fan_speed[1]); SERIAL_ECHOPGM("; edge counter:"); MYSERIAL.println(fan_edge_counter[1]);
SERIAL_ECHOLNPGM(" ");*/
fan_edge_counter[0] = 0;
@ -101,7 +101,7 @@ void fanSpeedError(unsigned char _fan) {
}
switch (_fan) {
case 0: // extracting the same code from case 0 and case 1 into a function saves 72B
fanSpeedErrorBeep(PSTR("Extruder fan speed is lower than expected"), MSG_FANCHECK_EXTRUDER);
fanSpeedErrorBeep(PSTR("Hotend fan speed is lower than expected"), MSG_FANCHECK_HOTEND);
break;
case 1:
fanSpeedErrorBeep(PSTR("Print fan speed is lower than expected"), MSG_FANCHECK_PRINT);
@ -114,10 +114,10 @@ void checkFanSpeed()
uint8_t max_fan_errors[2];
#ifdef FAN_SOFT_PWM
max_fan_errors[1] = 3; // 15 seconds (Print fan)
max_fan_errors[0] = 2; // 10 seconds (Extruder fan)
max_fan_errors[0] = 2; // 10 seconds (Hotend fan)
#else //FAN_SOFT_PWM
max_fan_errors[1] = 15; // 15 seconds (Print fan)
max_fan_errors[0] = 5; // 5 seconds (Extruder fan)
max_fan_errors[0] = 5; // 5 seconds (Hotend fan)
#endif //FAN_SOFT_PWM
if(fans_check_enabled)
@ -162,18 +162,11 @@ ISR(INT6_vect) {
bool extruder_altfan_detect()
{
// override isAltFan setting for detection
altfanStatus.isAltfan = 0;
setExtruderAutoFanState(3);
SET_INPUT(TACH_0);
uint8_t overrideVal = eeprom_read_byte((uint8_t *)EEPROM_ALTFAN_OVERRIDE);
if (overrideVal == EEPROM_EMPTY_VALUE)
{
overrideVal = (calibration_status() == CALIBRATION_STATUS_CALIBRATED) ? 1 : 0;
eeprom_update_byte((uint8_t *)EEPROM_ALTFAN_OVERRIDE, overrideVal);
}
altfanStatus.altfanOverride = overrideVal;
CRITICAL_SECTION_START;
EICRB &= ~(1 << ISC61);
EICRB |= (1 << ISC60);
@ -187,8 +180,11 @@ bool extruder_altfan_detect()
EIMSK &= ~(1 << INT6);
countFanSpeed();
// restore fan state
altfanStatus.isAltfan = fan_speed[0] > 100;
setExtruderAutoFanState(1);
return altfanStatus.isAltfan;
}
@ -284,11 +280,18 @@ void checkFans()
#endif //DEBUG_DISABLE_FANCHECK
}
void resetFanCheck() {
fan_measuring = false;
extruder_autofan_last_check = _millis();
}
void hotendFanSetFullSpeed()
{
#ifdef EXTRUDER_ALTFAN_DETECT
altfanStatus.altfanOverride = 1; //full speed
#endif //EXTRUDER_ALTFAN_DETECT
resetFanCheck();
setExtruderAutoFanState(3);
SET_OUTPUT(FAN_PIN);
#ifdef FAN_SOFT_PWM
@ -298,3 +301,14 @@ void hotendFanSetFullSpeed()
#endif //FAN_SOFT_PWM
fanSpeed = 255;
}
void hotendDefaultAutoFanState()
{
#if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1)
#ifdef EXTRUDER_ALTFAN_DETECT
altfanStatus.altfanOverride = eeprom_read_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE);
#endif
resetFanCheck();
setExtruderAutoFanState(1);
#endif
}

View File

@ -32,4 +32,7 @@ void checkExtruderAutoFans();
#endif
void checkFans();
void resetFanCheck(); // resets the fan measuring state
void hotendFanSetFullSpeed();
void hotendDefaultAutoFanState();

View File

@ -528,6 +528,15 @@ void lcd_print(const char* s)
while (*s) lcd_write(*(s++));
}
void lcd_print_pad(const char* s, uint8_t len)
{
while (len && *s) {
lcd_write(*(s++));
--len;
}
lcd_space(len);
}
void lcd_print(char c, int base)
{
lcd_print((long) c, base);

View File

@ -53,6 +53,7 @@ extern void lcd_printNumber(unsigned long n, uint8_t base);
extern void lcd_printFloat(double number, uint8_t digits);
extern void lcd_print(const char*);
extern void lcd_print_pad(const char*, uint8_t len);
extern void lcd_print(char, int = 0);
extern void lcd_print(unsigned char, int = 0);
extern void lcd_print(int, int = 10);
@ -203,11 +204,12 @@ private:
extern void lcd_set_custom_characters(void);
extern void lcd_set_custom_characters_nextpage(void);
//! @brief Consume click event
//! @brief Consume click and longpress event
inline void lcd_consume_click()
{
lcd_button_pressed = 0;
lcd_buttons &= 0xff^EN_C;
lcd_longpress_trigger = 0;
}

View File

@ -1,5 +1,6 @@
#include "Configuration.h"
#include "ConfigurationStore.h"
#include "util.h"
#include "language.h"
#include "mesh_bed_calibration.h"
#include "mesh_bed_leveling.h"
@ -3044,7 +3045,7 @@ void babystep_load()
{
babystepLoadZ = 0;
// Apply Z height correction aka baby stepping before mesh bed leveling gets activated.
if (calibration_status() < CALIBRATION_STATUS_LIVE_ADJUST)
if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST))
{
check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0

View File

@ -32,8 +32,8 @@ const char MSG_FANS_CHECK[] PROGMEM_I1 = ISTR("Fans check"); ////MSG_FANS_CHECK
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_EXTRUDER_FAN_SPEED[] PROGMEM_I1 = ISTR("Extruder fan:");////MSG_EXTRUDER_FAN_SPEED c=16
const char MSG_PRINT_FAN_SPEED[] PROGMEM_I1 = ISTR("Print fan:"); ////MSG_PRINT_FAN_SPEED c=16
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
const char MSG_FILAMENT_CLEAN[] PROGMEM_I1 = ISTR("Filament extruding & with correct color?"); ////MSG_FILAMENT_CLEAN c=20 r=2
const char MSG_FILAMENT_LOADED[] PROGMEM_I1 = ISTR("Is filament loaded?"); ////MSG_FILAMENT_LOADED c=20 r=2
const char MSG_FILAMENTCHANGE[] PROGMEM_I1 = ISTR("Change filament"); ////MSG_FILAMENTCHANGE c=18
@ -81,7 +81,7 @@ const char MSG_RESET[] PROGMEM_I1 = ISTR("Reset"); ////MSG_RESET c=14
const char MSG_RESUME_PRINT[] PROGMEM_I1 = ISTR("Resume print"); ////MSG_RESUME_PRINT c=18
const char MSG_RESUMING_PRINT[] PROGMEM_I1 = ISTR("Resuming print"); ////MSG_RESUMING_PRINT c=20
const char MSG_SELFTEST_PART_FAN[] PROGMEM_I1 = ISTR("Front print fan?"); ////MSG_SELFTEST_PART_FAN c=20
const char MSG_SELFTEST_EXTRUDER_FAN[] PROGMEM_I1 = ISTR("Left hotend fan?"); ////MSG_SELFTEST_EXTRUDER_FAN c=20
const char MSG_SELFTEST_HOTEND_FAN[] PROGMEM_I1 = ISTR("Left hotend fan?"); ////MSG_SELFTEST_HOTEND_FAN c=20
const char MSG_SELFTEST_FAILED[] PROGMEM_I1 = ISTR("Selftest failed"); ////MSG_SELFTEST_FAILED c=20
const char MSG_SELFTEST_FAN[] PROGMEM_I1 = ISTR("Fan test"); ////MSG_SELFTEST_FAN c=20
const char MSG_SELFTEST_FAN_NO[] PROGMEM_I1 = ISTR("Not spinning"); ////MSG_SELFTEST_FAN_NO c=19
@ -164,9 +164,17 @@ const char MSG_IR_UNKNOWN[] PROGMEM_I1 = ISTR("unknown state");////MSG_IR_UNKNOW
extern const char MSG_PAUSED_THERMAL_ERROR[] PROGMEM_I1 = ISTR("PAUSED THERMAL ERROR");////MSG_PAUSED_THERMAL_ERROR c=20
#ifdef TEMP_MODEL
extern const char MSG_THERMAL_ANOMALY[] PROGMEM_I1 = ISTR("THERMAL ANOMALY");////MSG_THERMAL_ANOMALY c=20
extern const char MSG_TM_NOT_CAL[] PROGMEM_I1 = ISTR("Thermal model not calibrated yet.");////MSG_TM_NOT_CAL c=20 r=4
extern const char MSG_TM_ACK_ERROR[] PROGMEM_I1 = ISTR("Clear TM error");////MSG_TM_ACK_ERROR c=18
#endif
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
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
//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_AUTO_DEPLETE[] PROGMEM_N1 = "SpoolJoin"; ////MSG_AUTO_DEPLETE c=13
const char MSG_FIRMWARE[] PROGMEM_N1 = "Firmware"; ////MSG_FIRMWARE c=8
const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[] PROGMEM_N1 = "FlashAir"; ////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY c=8
@ -201,8 +209,8 @@ 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_FANCHECK_EXTRUDER[] PROGMEM_N1 = "Err: EXTR. FAN ERROR"; ////c=20
const char MSG_FANCHECK_PRINT[] PROGMEM_N1 = "Err: PRINT FAN ERROR"; ////c=20
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
const char MSG_ADVANCE_K[] PROGMEM_N1 = "Advance K:"; ////c=13
const char MSG_POWERPANIC_DETECTED[] PROGMEM_N1 = "POWER PANIC DETECTED"; ////c=20

View File

@ -38,7 +38,7 @@ 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_EXTRUDER_FAN_SPEED[];
extern const char MSG_HOTEND_FAN_SPEED[];
extern const char MSG_PRINT_FAN_SPEED[];
extern const char MSG_FILAMENT_CLEAN[];
extern const char MSG_FILAMENT_LOADED[];
@ -72,7 +72,6 @@ extern const char MSG_NO[];
extern const char MSG_NOZZLE[];
extern const char MSG_PAPER[];
extern const char MSG_PAUSE_PRINT[];
extern const char MSG_PINDA[];
extern const char MSG_PLACE_STEEL_SHEET[];
extern const char MSG_PLEASE_WAIT[];
extern const char MSG_POWER_FAILURES[];
@ -86,9 +85,8 @@ extern const char MSG_REMOVE_STEEL_SHEET[];
extern const char MSG_RESET[];
extern const char MSG_RESUME_PRINT[];
extern const char MSG_RESUMING_PRINT[];
extern const char MSG_SD_WORKDIR_FAIL[];
extern const char MSG_SELFTEST_PART_FAN[];
extern const char MSG_SELFTEST_EXTRUDER_FAN[];
extern const char MSG_SELFTEST_HOTEND_FAN[];
extern const char MSG_SELFTEST_FAILED[];
extern const char MSG_SELFTEST_FAN[];
extern const char MSG_SELFTEST_FAN_NO[];
@ -126,24 +124,20 @@ extern const char MSG_WIZARD_WELCOME[];
extern const char MSG_WIZARD_WELCOME_SHIPPING[];
extern const char MSG_YES[];
extern const char MSG_V2_CALIBRATION[];
extern const char MSG_WELCOME[];
extern const char MSG_OFF[];
extern const char MSG_ON[];
extern const char MSG_NA[];
extern const char MSG_AUTO_DEPLETE[];
extern const char MSG_CUTTER[];
extern const char MSG_NONE[];
extern const char MSG_WARN[];
extern const char MSG_STRICT[];
extern const char MSG_MODEL[];
extern const char MSG_FIRMWARE[];
extern const char MSG_GCODE[];
extern const char MSG_GCODE_DIFF_PRINTER_CONTINUE[];
extern const char MSG_GCODE_DIFF_PRINTER_CANCELLED[];
extern const char MSG_NOZZLE_DIAMETER[];
extern const char MSG_MMU_MODE[];
extern const char MSG_SD_CARD[];
extern const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[];
extern const char MSG_SORT[];
extern const char MSG_SORT_TIME[];
extern const char MSG_SORT_ALPHA[];
@ -174,9 +168,23 @@ extern const char MSG_IR_UNKNOWN[];
extern const char MSG_PAUSED_THERMAL_ERROR[];
#ifdef TEMP_MODEL
extern const char MSG_THERMAL_ANOMALY[];
extern const char MSG_TM_NOT_CAL[];
extern const char MSG_TM_ACK_ERROR[];
#endif
extern const char MSG_NOZZLE_CNG_MENU [];
extern const char MSG_NOZZLE_CNG_READ_HELP [];
extern const char MSG_NOZZLE_CNG_CHANGED [];
//not internationalized messages
#if 0
extern const char MSG_FW_VERSION_BETA[];
#endif
extern const char MSG_AUTO_DEPLETE[];
extern const char MSG_FIRMWARE[];
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[];
@ -207,7 +215,7 @@ 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_FANCHECK_EXTRUDER[];
extern const char MSG_FANCHECK_HOTEND[];
extern const char MSG_FANCHECK_PRINT[];
extern const char MSG_M112_KILL[];
extern const char MSG_ADVANCE_K[];

View File

@ -76,9 +76,12 @@ int16_t mmu_version = -1;
int16_t mmu_buildnr = -1;
LongTimer mmu_last_request;
LongTimer mmu_last_response;
LongTimer mmu_last_finda_response;
uint32_t mmu_last_request;
uint32_t mmu_last_response;
uint32_t mmu_last_finda_response;
//LongTimer mmu_last_request;
//LongTimer mmu_last_response;
//LongTimer mmu_last_finda_response;
MmuCmd mmu_last_cmd = MmuCmd::None;
uint16_t mmu_power_failures = 0;
@ -114,7 +117,8 @@ int mmu_puts_P(const char* str)
{
mmu_clr_rx_buf(); //clear rx buffer
int r = fputs_P(str, uart2io); //send command
mmu_last_request.start();
mmu_last_request = _millis();
//mmu_last_request.start();
return r;
}
@ -126,7 +130,8 @@ int mmu_printf_P(const char* format, ...)
mmu_clr_rx_buf(); //clear rx buffer
int r = vfprintf_P(uart2io, format, args); //send command
va_end(args);
mmu_last_request.start();
mmu_last_request = _millis();
//mmu_last_request.start();
return r;
}
@ -134,7 +139,8 @@ int mmu_printf_P(const char* format, ...)
int8_t mmu_rx_ok(void)
{
int8_t res = uart2_rx_str_P(PSTR("ok\n"));
if (res == 1) mmu_last_response.start();
if (res == 1) mmu_last_response = _millis();
//if (res == 1) mmu_last_response.start();
return res;
}
@ -142,7 +148,8 @@ int8_t mmu_rx_ok(void)
int8_t mmu_rx_start(void)
{
int8_t res = uart2_rx_str_P(PSTR("start\n"));
if (res == 1) mmu_last_response.start();
if (res == 1) mmu_last_response = _millis();
//if (res == 1) mmu_last_response.start();
return res;
}
@ -201,12 +208,12 @@ static bool activate_stealth_mode()
void mmu_loop(void)
{
static uint8_t mmu_attempt_nr = 0;
// printf_P(PSTR("MMU loop, state=%d\n"), mmu_state);
// printf_P(PSTR("MMU loop, state=%d\n"), (int)mmu_state);
switch (mmu_state)
{
case S::Disabled:
case S::Disabled: //state 0
return;
case S::Init:
case S::Init: //state 1
if (mmu_rx_start() > 0)
{
DEBUG_PUTS_P(PSTR("MMU => 'start'"));
@ -220,7 +227,7 @@ void mmu_loop(void)
mmu_state = S::Disabled;
}
return;
case S::GetVersion:
case S::GetVersion: //state 2
if (mmu_rx_ok() > 0)
{
fscanf_P(uart2io, PSTR("%u"), &mmu_version); //scan version from buffer
@ -230,7 +237,7 @@ void mmu_loop(void)
mmu_state = S::GetBuildNr;
}
return;
case S::GetBuildNr:
case S::GetBuildNr: //state 3
if (mmu_rx_ok() > 0)
{
fscanf_P(uart2io, PSTR("%u"), &mmu_buildnr); //scan buildnr from buffer
@ -254,7 +261,7 @@ void mmu_loop(void)
}
return;
case S::WaitStealthMode:
case S::WaitStealthMode: //state 4
if (mmu_rx_ok() > 0)
{
FDEBUG_PUTS_P(PSTR("MMU <= 'P0'"));
@ -262,11 +269,12 @@ void mmu_loop(void)
mmu_state = S::GetFindaInit;
}
return;
case S::GetFindaInit:
case S::GetFindaInit: //state 5
if (mmu_rx_ok() > 0)
{
fscanf_P(uart2io, PSTR("%hhu"), &mmu_finda); //scan finda from buffer. MUST BE %hhu!!!
mmu_last_finda_response.start();
mmu_last_finda_response = _millis();
//mmu_last_finda_response.start();
FDEBUG_PRINTF_P(PSTR("MMU => '%dok'\n"), mmu_finda);
puts_P(PSTR("MMU - ENABLED"));
mmu_enabled = true;
@ -276,7 +284,7 @@ void mmu_loop(void)
mmu_state = S::Idle;
}
return;
case S::Idle:
case S::Idle: //state 6
if (mmu_cmd != MmuCmd::None) //command request ?
{
if ((mmu_cmd >= MmuCmd::T0) && (mmu_cmd <= MmuCmd::T4))
@ -351,7 +359,8 @@ void mmu_loop(void)
mmu_printf_P(PSTR("M%d\n"), SilentModeMenu_MMU);
mmu_state = S::SwitchMode;
}
else if (mmu_last_response.expired(300)) //request every 300ms
else if ((mmu_last_response + 300) < _millis()) //request every 300ms
//else if (mmu_last_response.expired(300)) //request every 300ms
{
#ifndef IR_SENSOR
if(check_for_ir_sensor()) ir_sensor_detected = true;
@ -360,8 +369,11 @@ void mmu_loop(void)
mmu_puts_P(PSTR("P0\n")); //send 'read finda' request
mmu_state = S::GetFinda;
}
//printf_P(PSTR("MMU loop, state %d\n"), (int)mmu_state);
//printf_P(PSTR("mmu_last_response %lu\n"), mmu_last_response.elapsed());
//printf_P(PSTR("mmu_last_finda_response %lu\n"), mmu_last_finda_response.elapsed());
return;
case S::GetFinda: //response to command P0
case S::GetFinda: //response to command P0 state 7
if (mmu_idl_sens)
{
if (READ(IR_SENSOR_PIN) == 0 && mmu_loading_flag)
@ -379,7 +391,8 @@ void mmu_loop(void)
if (mmu_rx_ok() > 0)
{
fscanf_P(uart2io, PSTR("%hhu"), &mmu_finda); //scan finda from buffer. MUST BE %hhu!!!
mmu_last_finda_response.start();
mmu_last_finda_response = _millis();
//mmu_last_finda_response.start();
FDEBUG_PRINTF_P(PSTR("MMU => '%dok'\n"), mmu_finda);
//printf_P(PSTR("Eact: %d\n"), int(e_active()));
if (!mmu_finda && CHECK_FSENSOR && fsensor_enabled) {
@ -399,12 +412,13 @@ void mmu_loop(void)
if (mmu_cmd == MmuCmd::None)
mmu_ready = true;
}
else if (mmu_last_request.expired(MMU_P0_TIMEOUT))
else if ((mmu_last_request + MMU_P0_TIMEOUT) < _millis())
//else if (mmu_last_request.expired(MMU_P0_TIMEOUT))
{ //resend request after timeout (30s)
mmu_state = S::Idle;
}
return;
case S::WaitCmd: //response to mmu commands
case S::WaitCmd: //response to mmu commands state 8
if (mmu_idl_sens)
{
if (READ(IR_SENSOR_PIN) == 0 && mmu_loading_flag)
@ -425,7 +439,8 @@ void mmu_loop(void)
mmu_ready = true;
mmu_state = S::Idle;
}
else if (mmu_last_request.expired(MMU_CMD_TIMEOUT))
else if ((mmu_last_request + MMU_CMD_TIMEOUT) < _millis())
//else if (mmu_last_request.expired(MMU_CMD_TIMEOUT))
{ //resend request after timeout (5 min)
if (mmu_last_cmd != MmuCmd::None)
{
@ -444,7 +459,7 @@ void mmu_loop(void)
mmu_state = S::Idle;
}
return;
case S::Pause:
case S::Pause: //state 9
if (mmu_rx_ok() > 0)
{
DEBUG_PRINTF_P(PSTR("MMU => 'ok', resume print\n"));
@ -459,7 +474,7 @@ void mmu_loop(void)
mmu_state = S::Idle;
}
return;
case S::GetDrvError:
case S::GetDrvError: //state 10
if (mmu_rx_ok() > 0)
{
fscanf_P(uart2io, PSTR("%d"), &mmu_power_failures); //scan power failures
@ -468,19 +483,21 @@ void mmu_loop(void)
mmu_ready = true;
mmu_state = S::Idle;
}
else if (mmu_last_request.expired(MMU_CMD_TIMEOUT))
else if ((mmu_last_request + MMU_CMD_TIMEOUT) < _millis())
//else if (mmu_last_request.expired(MMU_CMD_TIMEOUT))
{ //timeout 45 s
mmu_state = S::Idle;
}
return;
case S::SwitchMode:
case S::SwitchMode: //state 11
if (mmu_rx_ok() > 0)
{
DEBUG_PRINTF_P(PSTR("MMU => 'ok'\n"));
eeprom_update_byte((uint8_t*)EEPROM_MMU_STEALTH, SilentModeMenu_MMU);
mmu_state = S::Idle;
}
else if (mmu_last_request.expired(MMU_CMD_TIMEOUT))
else if ((mmu_last_request + MMU_CMD_TIMEOUT) < _millis())
//else if (mmu_last_request.expired(MMU_CMD_TIMEOUT))
{ //timeout 45 s
mmu_state = S::Idle;
}
@ -724,6 +741,7 @@ void manage_response(bool move_axes, bool turn_off_nozzle, uint8_t move)
screen++;
}
else { //screen 1
//printf_P(PSTR("active ex: %d deg: %d turn_off_nozzle: %d\n"),active_extruder ,degTargetHotend(active_extruder), (int)turn_off_nozzle);
if((degTargetHotend(active_extruder) == 0) && turn_off_nozzle) lcd_display_message_fullscreen_P(_i("Press the knob to resume nozzle temperature."));////MSG_RESUME_NOZZLE_TEMP c=20 r=4
else lcd_display_message_fullscreen_P(_i("Fix the issue and then press button on MMU unit."));////MSG_MMU_FIX_ISSUE c=20 r=4
screen=0;

View File

@ -15,7 +15,8 @@ extern uint8_t mmu_extruder;
extern uint8_t tmp_extruder;
extern int8_t mmu_finda;
extern LongTimer mmu_last_finda_response;
extern uint32_t mmu_last_finda_response;
//extern LongTimer mmu_last_finda_response;
extern bool ir_sensor_detected;
extern int16_t mmu_version;

View File

@ -55,9 +55,7 @@ static void putch(char ch) {
static void verifySpace() {
if (getch() != CRC_EOP) {
putch(STK_FAILED);
wdt_enable(WDTO_15MS); // shorten WD timeout
while (1) // and busy-loop so that WD causes
; // a reset and app start.
softReset();
}
putch(STK_INSYNC);
}
@ -300,7 +298,7 @@ uint8_t optiboot_xflash_enter()
}
else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */
// Adaboot no-wait mod
wdt_enable(WDTO_15MS);
wdt_enable(WATCHDOG_SOFT_RESET_VALUE);
verifySpace();
}
else {

View File

@ -19,6 +19,7 @@
#define XFLASH // external 256kB flash
#define BOOTAPP // bootloader support
#define WATCHDOG_SOFT_RESET_VALUE WDTO_15MS
#define XFLASH_PIN_CS 32

View File

@ -14,6 +14,8 @@
#define SWI2C_SDA 20 //SDA on P3
#define SWI2C_SCL 84 //PH2 on P3, sensor cable must be rewired
// This should be long enough to safely exit the bootloader when it uses the default timeout (~1-2s)
#define WATCHDOG_SOFT_RESET_VALUE WDTO_2S
#define X_STEP_PIN 37
@ -78,7 +80,7 @@
#define PS_ON_PIN -1
#define KILL_PIN -1 // 80 with Smart Controller LCD
#define SUICIDE_PIN -1 // PIN that has to be turned on right after start, to keep power flowing.
#define TACH_0 30 // noctua extruder fan
#define TACH_0 30 // noctua hotend fan
//#define KILL_PIN 32

View File

@ -17,6 +17,8 @@
#define D_REQUIRE 23 //Z_MAX (white)
#endif //MICROMETER_LOGGING
// This should be long enough to safely exit the bootloader when it uses the default timeout (~1-2s)
#define WATCHDOG_SOFT_RESET_VALUE WDTO_2S
#define X_STEP_PIN 37
@ -81,7 +83,7 @@
#define PS_ON_PIN -1
#define KILL_PIN -1 // 80 with Smart Controller LCD
#define SUICIDE_PIN -1 // PIN that has to be turned on right after start, to keep power flowing.
#define TACH_0 30 // noctua extruder fan
#define TACH_0 30 // noctua hotend fan
//#define KILL_PIN 32

View File

@ -84,7 +84,6 @@ void Sound_MakeCustom(uint16_t ms,uint16_t tone_,bool critical){
WRITE(BEEPER, HIGH);
_delay(ms);
WRITE(BEEPER, LOW);
_delay(ms);
}
else{
_tone(BEEPER, tone_);

View File

@ -5,30 +5,40 @@
#include "planner.h"
constexpr uint8_t TEMP_MODEL_CAL_S = 60; // Maximum recording lenght during calibration (s)
// shortcuts to get model defaults
#define __TEMP_MODEL_DEF(MODEL, VAR) TEMP_MODEL_##MODEL##_##VAR
#define _TEMP_MODEL_DEF(MODEL, VAR) __TEMP_MODEL_DEF(MODEL, VAR)
#define TEMP_MODEL_DEF(VAR) _TEMP_MODEL_DEF(TEMP_MODEL_DEFAULT, VAR)
constexpr uint8_t TEMP_MODEL_CAL_S = 60; // Maximum recording length during calibration (s)
constexpr uint8_t TEMP_MODEL_CAL_R_STEP = 4; // Fan interpolation steps during calibration
constexpr float TEMP_MODEL_fS = 0.065; // simulation filter (1st-order IIR factor)
constexpr float TEMP_MODEL_fE = 0.05; // error filter (1st-order IIR factor)
// transport delay buffer size (samples)
constexpr uint8_t TEMP_MODEL_LAG_SIZE = (TEMP_MODEL_LAG / TEMP_MGR_INTV + 0.5);
constexpr uint8_t TEMP_MODEL_MAX_LAG_SIZE = 8; // * TEMP_MGR_INTV = 2160
// resistance values for all fan levels
constexpr uint8_t TEMP_MODEL_R_SIZE = (1 << FAN_SOFT_PWM_BITS);
static const float TEMP_MODEL_R_DEFAULT[TEMP_MODEL_R_SIZE] PROGMEM = TEMP_MODEL_DEF(Rv);
namespace temp_model {
struct model_data
{
// temporary buffers
float dT_lag_buf[TEMP_MODEL_LAG_SIZE]; // transport delay buffer
uint8_t dT_lag_idx = 0; // transport delay buffer index
float dT_err_prev = 0; // previous temperature delta error
float T_prev = 0; // last temperature extruder
float dT_lag_buf[TEMP_MODEL_MAX_LAG_SIZE]; // transport delay buffer
uint8_t dT_lag_size = 0; // transport delay buffer size
uint8_t dT_lag_idx = 0; // transport delay buffer index
float dT_err_prev = 0; // previous temperature delta error
float T_prev = 0; // last temperature extruder
// configurable parameters
float P; // heater power (W)
float U; // linear temperature coefficient (W/K/W)
float V; // linear temperature intercept (W/W)
float C; // heatblock capacitance (J/K)
float fS; // sim. 1st order IIR filter factor (f=100/27)
uint16_t L; // sim. response lag (ms)
float R[TEMP_MODEL_R_SIZE]; // heatblock resistance for all fan levels (K/W)
float Ta_corr; // ambient temperature correction (K)

View File

@ -0,0 +1,19 @@
#pragma once
#define TEMP_MODEL_E3D_V6_VER 1 // model parameters version
#define TEMP_MODEL_E3D_V6_P 38. // heater power (W)
#define TEMP_MODEL_E3D_V6_U 0. // linear temperature coefficient (W/K/power)
#define TEMP_MODEL_E3D_V6_V 1. // linear temperature intercept (W/power)
#define TEMP_MODEL_E3D_V6_C 12.1 // initial guess for heatblock capacitance (J/K)
#define TEMP_MODEL_E3D_V6_R 20.5 // initial guess for heatblock resistance (K/W)
#define TEMP_MODEL_E3D_V6_fS 0.065 // sim. 1st order IIR filter factor (f=100/27)
#define TEMP_MODEL_E3D_V6_LAG 2100 // sim. response lag (ms, 0-2160)
#define TEMP_MODEL_E3D_V6_W 1.2 // Default warning threshold (K/s)
#define TEMP_MODEL_E3D_V6_E 1.74 // Default error threshold (K/s)
// fall-back resistance vector (R0-15)
#define TEMP_MODEL_E3D_V6_Rv {TEMP_MODEL_E3D_V6_R, 18.4, 16.7, 15.2, 14.1, 13.3, 12.7, 12.1, 11.7, 11.3, 11., 10.8, 10.6, 10.4, 10.2, 10.1}

View File

@ -32,7 +32,7 @@
#include "stepper.h"
#include "ultralcd.h"
#include "menu.h"
#include "sound.h"
#include "util.h"
#include "fancheck.h"
#include "messages.h"
#include "language.h"
@ -886,7 +886,7 @@ void soft_pwm_init()
OCR2B = 128;
ENABLE_SOFT_PWM_INTERRUPT();
timer4_init(); //for tone and Extruder fan PWM
timer4_init(); //for tone and Hotend fan PWM
}
#if (defined (TEMP_RUNAWAY_BED_HYSTERESIS) && TEMP_RUNAWAY_BED_TIMEOUT > 0) || (defined (TEMP_RUNAWAY_EXTRUDER_HYSTERESIS) && TEMP_RUNAWAY_EXTRUDER_TIMEOUT > 0)
@ -1212,27 +1212,27 @@ FORCE_INLINE static void soft_pwm_core()
static unsigned char slow_pwm_count = 0;
static unsigned char state_heater_0 = 0;
static unsigned char state_timer_heater_0 = 0;
#endif
#endif
#if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL)
static unsigned char soft_pwm_1;
#ifdef SLOW_PWM_HEATERS
static unsigned char state_heater_1 = 0;
static unsigned char state_timer_heater_1 = 0;
#endif
#endif
#endif
#if EXTRUDERS > 2
static unsigned char soft_pwm_2;
#ifdef SLOW_PWM_HEATERS
static unsigned char state_heater_2 = 0;
static unsigned char state_timer_heater_2 = 0;
#endif
#endif
#endif
#if HEATER_BED_PIN > -1
// @@DR static unsigned char soft_pwm_b;
#ifdef SLOW_PWM_HEATERS
static unsigned char state_heater_b = 0;
static unsigned char state_timer_heater_b = 0;
#endif
#endif
#endif
#if defined(FILWIDTH_PIN) &&(FILWIDTH_PIN > -1)
@ -1766,7 +1766,6 @@ void handle_temp_error()
} else {
temp_error_state.v = 0;
WRITE(BEEPER, LOW);
menu_unset_block(MENU_BLOCK_THERMAL_ERROR);
// hotend error was transitory and disappeared, re-enable bed
if (!target_temperature_bed)
@ -2321,9 +2320,10 @@ void model_data::reset(uint8_t heater_pwm _UNUSED, uint8_t fan_pwm _UNUSED,
C_i = (TEMP_MGR_INTV / C);
warn_s = warn * TEMP_MGR_INTV;
err_s = err * TEMP_MGR_INTV;
dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000);
// initial values
for(uint8_t i = 0; i != TEMP_MODEL_LAG_SIZE; ++i)
for(uint8_t i = 0; i != TEMP_MODEL_MAX_LAG_SIZE; ++i)
dT_lag_buf[i] = NAN;
dT_lag_idx = 0;
dT_err_prev = 0;
@ -2350,14 +2350,15 @@ void model_data::step(uint8_t heater_pwm, uint8_t fan_pwm, float heater_temp, fl
const float cur_R = R[fan_pwm]; // resistance at current fan power (K/W)
float dP = P * heater_scale; // current power [W]
dP *= (cur_heater_temp * U) + V; // linear temp. correction
float dPl = (cur_heater_temp - cur_ambient_temp) / cur_R; // [W] leakage power
float dT = (dP - dPl) * C_i; // expected temperature difference (K)
// filter and lag dT
uint8_t dT_next_idx = (dT_lag_idx == (TEMP_MODEL_LAG_SIZE - 1) ? 0: dT_lag_idx + 1);
uint8_t dT_next_idx = (dT_lag_idx == (dT_lag_size - 1) ? 0: dT_lag_idx + 1);
float dT_lag = dT_lag_buf[dT_next_idx];
float dT_lag_prev = dT_lag_buf[dT_lag_idx];
float dT_f = iir_mul(dT_lag_prev, dT, TEMP_MODEL_fS, dT);
float dT_f = iir_mul(dT_lag_prev, dT, fS, dT);
dT_lag_buf[dT_next_idx] = dT_f;
dT_lag_idx = dT_next_idx;
@ -2372,17 +2373,28 @@ void model_data::step(uint8_t heater_pwm, uint8_t fan_pwm, float heater_temp, fl
flag_bits.warning = (fabsf(dT_err_f) > warn_s);
}
// verify calibration status and trigger a model reset if valid
void setup()
// clear error flags and mark as uninitialized
static void reinitialize()
{
if(!calibrated()) enabled = false;
data.flag_bits.uninitialized = true;
data.flags = 1; // shorcut to reset all error flags
warning_state.assert = false; // explicitly clear assertions
}
bool calibrated()
// verify calibration status and trigger a model reset if valid
static void setup()
{
if(!(data.P >= 0)) return false;
if(!(data.C >= 0)) return false;
if(!calibrated()) enabled = false;
reinitialize();
}
static bool calibrated()
{
if(!(data.P > 0)) return false;
if(isnan(data.U)) return false;
if(isnan(data.V)) return false;
if(!(data.C > 0)) return false;
if(isnan(data.fS)) return false;
if(!(data.L > 0)) return false;
if(!(data.Ta_corr != NAN)) return false;
for(uint8_t i = 0; i != TEMP_MODEL_R_SIZE; ++i) {
if(!(temp_model::data.R[i] >= 0))
@ -2393,7 +2405,7 @@ bool calibrated()
return true;
}
void check()
static void check()
{
if(!enabled) return;
@ -2422,7 +2434,7 @@ void check()
}
}
void handle_warning()
static void handle_warning()
{
// update values
float warn = data.warn;
@ -2442,6 +2454,7 @@ void handle_warning()
lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO);
WRITE(BEEPER, HIGH);
}
first = false;
} else {
if(warn_beep) TOGGLE(BEEPER);
}
@ -2454,7 +2467,7 @@ void handle_warning()
}
#ifdef TEMP_MODEL_DEBUG
void log_usr()
static void log_usr()
{
if(!log_buf.enabled) return;
@ -2484,7 +2497,7 @@ void log_usr()
(int)cur_pwm, (unsigned long)cur_temp_b, (unsigned long)cur_amb_b);
}
void log_isr()
static void log_isr()
{
if(!log_buf.enabled) return;
@ -2506,7 +2519,12 @@ static void temp_model_reset_enabled(bool enabled)
{
TempMgrGuard temp_mgr_guard;
temp_model::enabled = enabled;
temp_model::data.flag_bits.uninitialized = true;
temp_model::reinitialize();
}
bool temp_model_enabled()
{
return temp_model::enabled;
}
void temp_model_set_enabled(bool enabled)
@ -2528,15 +2546,36 @@ void temp_model_set_warn_beep(bool enabled)
temp_model::warn_beep = enabled;
}
void temp_model_set_params(float C, float P, float Ta_corr, float warn, float err)
// set the model lag rounding to the effective sample resolution, ensuring the reported/stored lag
// matches the current model constraints (future-proofing for model changes)
static void temp_model_set_lag(uint16_t ms)
{
static const uint16_t intv_ms = (uint16_t)(TEMP_MGR_INTV * 1000);
uint16_t samples = ((ms + intv_ms/2) / intv_ms);
// ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering
if(samples < 1)
samples = 1;
else if(samples > TEMP_MODEL_MAX_LAG_SIZE)
samples = TEMP_MODEL_MAX_LAG_SIZE;
// round back to ms
temp_model::data.L = samples * intv_ms;
}
void temp_model_set_params(float P, float U, float V, float C, float D, int16_t L, float Ta_corr, float warn, float err)
{
TempMgrGuard temp_mgr_guard;
if(!isnan(C) && C > 0) temp_model::data.C = C;
if(!isnan(P) && P > 0) temp_model::data.P = P;
if(!isnan(U)) temp_model::data.U = U;
if(!isnan(V)) temp_model::data.V = V;
if(!isnan(C) && C > 0) temp_model::data.C = C;
if(!isnan(D)) temp_model::data.fS = D;
if(L >= 0) temp_model_set_lag(L);
if(!isnan(Ta_corr)) temp_model::data.Ta_corr = Ta_corr;
if(!isnan(err) && err > 0) temp_model::data.err = err;
if(!isnan(warn) && warn > 0) temp_model::data.warn = warn;
if(!isnan(err) && err > 0) temp_model::data.err = err;
// ensure warn <= err
if (temp_model::data.warn > temp_model::data.err)
@ -2561,8 +2600,9 @@ void temp_model_report_settings()
SERIAL_ECHOLNPGM("Temperature Model settings:");
for(uint8_t i = 0; i != TEMP_MODEL_R_SIZE; ++i)
printf_P(PSTR("%S M310 I%u R%.2f\n"), echomagic, (unsigned)i, (double)temp_model::data.R[i]);
printf_P(PSTR("%S M310 P%.2f C%.2f S%u B%u E%.2f W%.2f T%.2f\n"),
echomagic, (double)temp_model::data.P, (double)temp_model::data.C,
printf_P(PSTR("%S M310 P%.2f U%.4f V%.2f C%.2f D%.4f L%u S%u B%u E%.2f W%.2f T%.2f\n"),
echomagic, (double)temp_model::data.P, (double)temp_model::data.U, (double)temp_model::data.V,
(double)temp_model::data.C, (double)temp_model::data.fS, (unsigned)temp_model::data.L,
(unsigned)temp_model::enabled, (unsigned)temp_model::warn_beep,
(double)temp_model::data.err, (double)temp_model::data.warn,
(double)temp_model::data.Ta_corr);
@ -2572,16 +2612,20 @@ void temp_model_reset_settings()
{
TempMgrGuard temp_mgr_guard;
temp_model::data.P = TEMP_MODEL_P;
temp_model::data.C = TEMP_MODEL_C;
temp_model::data.R[0] = TEMP_MODEL_R;
for(uint8_t i = 1; i != TEMP_MODEL_R_SIZE; ++i)
temp_model::data.R[i] = NAN;
temp_model::data.P = TEMP_MODEL_DEF(P);
temp_model::data.U = TEMP_MODEL_DEF(U);
temp_model::data.V = TEMP_MODEL_DEF(V);
temp_model::data.C = TEMP_MODEL_DEF(C);
temp_model::data.fS = TEMP_MODEL_DEF(fS);
temp_model::data.L = (uint16_t)(TEMP_MODEL_DEF(LAG) / (TEMP_MGR_INTV * 1000) + 0.5) * (uint16_t)(TEMP_MGR_INTV * 1000);
for(uint8_t i = 0; i != TEMP_MODEL_R_SIZE; ++i)
temp_model::data.R[i] = pgm_read_float(TEMP_MODEL_R_DEFAULT + i);
temp_model::data.Ta_corr = TEMP_MODEL_Ta_corr;
temp_model::data.warn = TEMP_MODEL_W;
temp_model::data.err = TEMP_MODEL_E;
temp_model::data.warn = TEMP_MODEL_DEF(W);
temp_model::data.err = TEMP_MODEL_DEF(E);
temp_model::warn_beep = true;
temp_model::enabled = false;
temp_model::enabled = true;
temp_model::reinitialize();
}
void temp_model_load_settings()
@ -2589,9 +2633,21 @@ void temp_model_load_settings()
static_assert(TEMP_MODEL_R_SIZE == 16); // ensure we don't desync with the eeprom table
TempMgrGuard temp_mgr_guard;
// handle upgrade from a model without UVDL (FW<3.13, TM VER<1): model is retro-compatible,
// reset UV to an identity without doing any special handling
eeprom_init_default_float((float*)EEPROM_TEMP_MODEL_U, TEMP_MODEL_DEF(U));
eeprom_init_default_float((float*)EEPROM_TEMP_MODEL_V, TEMP_MODEL_DEF(V));
eeprom_init_default_float((float*)EEPROM_TEMP_MODEL_D, TEMP_MODEL_DEF(fS));
eeprom_init_default_word((uint16_t*)EEPROM_TEMP_MODEL_L, TEMP_MODEL_DEF(LAG));
eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_MODEL_VER, TEMP_MODEL_DEF(VER));
temp_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_TEMP_MODEL_ENABLE);
temp_model::data.P = eeprom_read_float((float*)EEPROM_TEMP_MODEL_P);
temp_model::data.U = eeprom_read_float((float*)EEPROM_TEMP_MODEL_U);
temp_model::data.V = eeprom_read_float((float*)EEPROM_TEMP_MODEL_V);
temp_model::data.C = eeprom_read_float((float*)EEPROM_TEMP_MODEL_C);
temp_model::data.fS = eeprom_read_float((float*)EEPROM_TEMP_MODEL_D);
temp_model_set_lag(eeprom_read_word((uint16_t*)EEPROM_TEMP_MODEL_L));
for(uint8_t i = 0; i != TEMP_MODEL_R_SIZE; ++i)
temp_model::data.R[i] = eeprom_read_float((float*)EEPROM_TEMP_MODEL_R + i);
temp_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_TEMP_MODEL_Ta_corr);
@ -2609,7 +2665,11 @@ void temp_model_save_settings()
{
eeprom_update_byte((uint8_t*)EEPROM_TEMP_MODEL_ENABLE, temp_model::enabled);
eeprom_update_float((float*)EEPROM_TEMP_MODEL_P, temp_model::data.P);
eeprom_update_float((float*)EEPROM_TEMP_MODEL_U, temp_model::data.U);
eeprom_update_float((float*)EEPROM_TEMP_MODEL_V, temp_model::data.V);
eeprom_update_float((float*)EEPROM_TEMP_MODEL_C, temp_model::data.C);
eeprom_update_float((float*)EEPROM_TEMP_MODEL_D, temp_model::data.fS);
eeprom_update_word((uint16_t*)EEPROM_TEMP_MODEL_L, temp_model::data.L);
for(uint8_t i = 0; i != TEMP_MODEL_R_SIZE; ++i)
eeprom_update_float((float*)EEPROM_TEMP_MODEL_R + i, temp_model::data.R[i]);
eeprom_update_float((float*)EEPROM_TEMP_MODEL_Ta_corr, temp_model::data.Ta_corr);
@ -2622,6 +2682,9 @@ namespace temp_model_cal {
// set current fan speed for both front/backend
static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed)
{
// reset the fan measuring state due to missing hysteresis handling on the checking side
resetFanCheck();
fanSpeed = fan_speed;
#ifdef FAN_SOFT_PWM
fanSpeedSoftPwm = fan_speed;
@ -2779,21 +2842,23 @@ static bool autotune(int16_t cal_temp)
{
uint16_t samples;
float e;
char tm_message[LCD_WIDTH+1];
// bootstrap C/R values without fan
set_fan_speed(0);
for(uint8_t i = 0; i != 2; ++i) {
const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refining"));
const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine"));
target_temperature[0] = 0;
if(current_temperature[0] >= TEMP_MODEL_CAL_Tl) {
printf_P(PSTR("TM: cooling down to %dC\n"), TEMP_MODEL_CAL_Tl);
cooldown(TEMP_MODEL_CAL_Tl);
if(current_temperature[0] >= TEMP_MODEL_CAL_T_low) {
sprintf_P(tm_message, PSTR("TM: cool down <%dC"), TEMP_MODEL_CAL_T_low);
lcd_setstatus_serial(tm_message);
cooldown(TEMP_MODEL_CAL_T_low);
wait(10000);
}
printf_P(PSTR("TM: %S C estimation\n"), verb);
sprintf_P(tm_message, PSTR("TM: %S C est."), verb);
lcd_setstatus_serial(tm_message);
target_temperature[0] = cal_temp;
samples = record();
if(temp_error_state.v || !samples)
@ -2801,10 +2866,11 @@ static bool autotune(int16_t cal_temp)
// we need a high R value for the initial C guess
if(isnan(temp_model::data.R[0]))
temp_model::data.R[0] = TEMP_MODEL_Rh;
temp_model::data.R[0] = TEMP_MODEL_CAL_R_high;
e = estimate(samples, &temp_model::data.C,
TEMP_MODEL_Cl, TEMP_MODEL_Ch, TEMP_MODEL_C_thr, TEMP_MODEL_C_itr,
TEMP_MODEL_CAL_C_low, TEMP_MODEL_CAL_C_high,
TEMP_MODEL_CAL_C_thr, TEMP_MODEL_CAL_C_itr,
0, current_temperature_ambient);
if(isnan(e))
return true;
@ -2813,13 +2879,15 @@ static bool autotune(int16_t cal_temp)
if(i) break; // we don't need to refine R
wait(30000); // settle PID regulation
printf_P(PSTR("TM: %S R estimation @ %dC\n"), verb, cal_temp);
sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp);
lcd_setstatus_serial(tm_message);
samples = record();
if(temp_error_state.v || !samples)
return true;
e = estimate(samples, &temp_model::data.R[0],
TEMP_MODEL_Rl, TEMP_MODEL_Rh, TEMP_MODEL_R_thr, TEMP_MODEL_R_itr,
TEMP_MODEL_CAL_R_low, TEMP_MODEL_CAL_R_high,
TEMP_MODEL_CAL_R_thr, TEMP_MODEL_CAL_R_itr,
0, current_temperature_ambient);
if(isnan(e))
return true;
@ -2833,11 +2901,16 @@ static bool autotune(int16_t cal_temp)
wait(30000);
for(int8_t i = TEMP_MODEL_R_SIZE - 1; i > 0; i -= TEMP_MODEL_CAL_R_STEP) {
// always disable the checker while estimating fan resistance as the difference
// (esp with 3rd-party blowers) can be massive
temp_model::data.R[i] = NAN;
uint8_t speed = 256 / TEMP_MODEL_R_SIZE * (i + 1) - 1;
set_fan_speed(speed);
wait(10000);
printf_P(PSTR("TM: R[%u] estimation\n"), (unsigned)i);
sprintf_P(tm_message, PSTR("TM: R[%u] estimat."), (unsigned)i);
lcd_setstatus_serial(tm_message);
samples = record();
if(temp_error_state.v || !samples)
return true;
@ -2845,7 +2918,7 @@ static bool autotune(int16_t cal_temp)
// a fixed fan pwm (the norminal value) is used here, as soft_pwm_fan will be modified
// during fan measurements and we'd like to include that skew during normal operation.
e = estimate(samples, &temp_model::data.R[i],
TEMP_MODEL_Rl, temp_model::data.R[0], TEMP_MODEL_R_thr, TEMP_MODEL_R_itr,
TEMP_MODEL_CAL_R_low, temp_model::data.R[0], TEMP_MODEL_CAL_R_thr, TEMP_MODEL_CAL_R_itr,
i, current_temperature_ambient);
if(isnan(e))
return true;
@ -2871,44 +2944,72 @@ static bool autotune(int16_t cal_temp)
} // namespace temp_model_cal
static bool temp_model_autotune_err = true;
void temp_model_autotune(int16_t temp, bool selftest)
{
float orig_C, orig_R[TEMP_MODEL_R_SIZE];
bool orig_enabled;
static_assert(sizeof(orig_R) == sizeof(temp_model::data.R));
// fail-safe error state
temp_model_autotune_err = true;
char tm_message[LCD_WIDTH+1];
if(moves_planned() || printer_active()) {
SERIAL_ECHOLNPGM("TM: printer needs to be idle for calibration");
sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE"));
lcd_setstatus_serial(tm_message);
return;
}
// lockout the printer during calibration
KEEPALIVE_STATE(IN_PROCESS);
menu_set_block(MENU_BLOCK_TEMP_MODEL_AUTOTUNE);
lcd_setstatuspgm(_i("Temp. model autotune")); ////MSG_TEMP_MODEL_AUTOTUNE c=20
lcd_return_to_status();
// set the model checking state during self-calibration
bool was_enabled = temp_model::enabled;
// save the original model data and set the model checking state during self-calibration
orig_C = temp_model::data.C;
memcpy(orig_R, temp_model::data.R, sizeof(temp_model::data.R));
orig_enabled = temp_model::enabled;
temp_model_reset_enabled(selftest);
SERIAL_ECHOLNPGM("TM: autotune start");
bool err = temp_model_cal::autotune(temp > 0 ? temp : TEMP_MODEL_CAL_Th);
// autotune
SERIAL_ECHOLNPGM("TM: calibration start");
temp_model_autotune_err = temp_model_cal::autotune(temp > 0 ? temp : TEMP_MODEL_CAL_T_high);
// always reset temperature
disable_heater();
if(err) {
SERIAL_ECHOLNPGM("TM: autotune failed");
lcd_setstatuspgm(_i("TM autotune failed")); ////MSG_TM_AUTOTUNE_FAILED c=20
if(temp_model_autotune_err) {
sprintf_P(tm_message, PSTR("TM: calibr. failed!"));
lcd_setstatus_serial(tm_message);
if(temp_error_state.v)
temp_model_cal::set_fan_speed(255);
// show calibrated values before overwriting them
temp_model_report_settings();
// restore original state
temp_model::data.C = orig_C;
memcpy(temp_model::data.R, orig_R, sizeof(temp_model::data.R));
temp_model_set_enabled(orig_enabled);
} else {
calibration_status_set(CALIBRATION_STATUS_TEMP_MODEL);
lcd_setstatuspgm(MSG_WELCOME);
temp_model_cal::set_fan_speed(0);
temp_model_set_enabled(was_enabled);
temp_model_set_enabled(orig_enabled);
temp_model_report_settings();
}
lcd_consume_click();
menu_unset_block(MENU_BLOCK_TEMP_MODEL_AUTOTUNE);
}
bool temp_model_autotune_result()
{
return !temp_model_autotune_err;
}
#ifdef TEMP_MODEL_DEBUG
void temp_model_log_enable(bool enable)
{

View File

@ -217,9 +217,11 @@ FORCE_INLINE void autotempShutdown(){
void PID_autotune(float temp, int extruder, int ncycles);
#ifdef TEMP_MODEL
bool temp_model_enabled(); // return temperature model state
void temp_model_set_enabled(bool enabled);
void temp_model_set_warn_beep(bool enabled);
void temp_model_set_params(float C = NAN, float P = NAN, float Ta_corr = NAN, float warn = NAN, float err = NAN);
void temp_model_set_params(float P=NAN, float U=NAN, float V=NAN, float C=NAN, float D=NAN,
int16_t L=-1, float Ta_corr=NAN, float warn=NAN, float err=NAN);
void temp_model_set_resistance(uint8_t index, float R);
void temp_model_report_settings();
@ -228,6 +230,7 @@ void temp_model_load_settings();
void temp_model_save_settings();
void temp_model_autotune(int16_t temp = 0, bool selftest = false);
bool temp_model_autotune_result(); // return true if the last autotune was complete and successful
#ifdef TEMP_MODEL_DEBUG
void temp_model_log_enable(bool enable);

View File

@ -94,7 +94,7 @@ static float manual_feedrate[] = MANUAL_FEEDRATE;
/* LCD message status */
static LongTimer lcd_status_message_timeout;
static uint8_t lcd_status_message_level;
static char lcd_status_message[LCD_WIDTH + 1] = WELCOME_MSG;
static char lcd_status_message[LCD_WIDTH + 1];
/* !Configuration settings */
@ -214,7 +214,7 @@ enum class FanCheck : uint_least8_t {
/**
* Try to check fan working and wiring.
*
* @param _fan i fan number 0 means extruder fan, 1 means print fan.
* @param _fan i fan number 0 means hotend fan, 1 means print fan.
*
* @returns a TestError noerror, extruderFan, printFan or swappedFan.
*/
@ -242,9 +242,6 @@ static void lcd_cutter_enabled();
#endif
static void lcd_babystep_z();
//! Beware: has side effects - forces lcd_draw_update to 2, which means clear the display
void lcd_finishstatus();
static void lcd_sdcard_menu();
static void lcd_sheet_menu();
@ -617,7 +614,7 @@ void lcdui_print_status_line(void)
case CustomMsg::M117: // M117 Set the status line message on the LCD
case CustomMsg::Status: // Nothing special, print status message normally
case CustomMsg::M0Wait: // M0/M1 Wait command working even from SD
lcd_print(lcd_status_message);
lcd_print_pad(lcd_status_message, LCD_WIDTH);
break;
case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status
if (custom_message_state > 10) {
@ -641,10 +638,10 @@ void lcdui_print_status_line(void)
}
break;
case CustomMsg::FilamentLoading: // If loading filament, print status
lcd_print(lcd_status_message);
lcd_print_pad(lcd_status_message, LCD_WIDTH);
break;
case CustomMsg::PidCal: // PID tuning in progress
lcd_print(lcd_status_message);
lcd_print_pad(lcd_status_message, LCD_WIDTH);
if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) {
lcd_set_cursor(10, 3);
lcd_print(itostr3(pid_cycle));
@ -669,11 +666,6 @@ void lcdui_print_status_line(void)
break;
}
}
// Fill the rest of line to have nice and clean output
for(uint8_t fillspace = 0; fillspace < LCD_WIDTH; fillspace++)
if ((lcd_status_message[fillspace] <= 31 ))
lcd_print(' ');
}
//! @brief Show Status Screen
@ -843,10 +835,11 @@ void lcd_status_screen() // NOT static due to using ins
}
}
void print_stop();
void lcd_print_stop_finish();
void lcd_commands()
{
// printf_P(PSTR("lcd_commands begin, lcd_commands_type=%u, lcd_commands_step=%u\n"), (uint8_t)lcd_commands_type, lcd_commands_step);
if (planner_aborted) {
// we are still within an aborted command. do not process any LCD command until we return
return;
@ -860,7 +853,7 @@ void lcd_commands()
lcd_setstatuspgm(_T(MSG_PRINT_ABORTED));
lcd_commands_type = LcdCommands::Idle;
lcd_commands_step = 0;
print_stop();
lcd_print_stop_finish();
}
}
@ -959,10 +952,8 @@ void lcd_commands()
lcd_setstatuspgm(MSG_WELCOME);
lcd_commands_step = 0;
lcd_commands_type = LcdCommands::Idle;
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1)
{
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE))
lcd_wizard(WizState::RepeatLay1Cal);
}
break;
}
}
@ -1049,7 +1040,92 @@ void lcd_commands()
}
}
#ifdef TEMP_MODEL
if (lcd_commands_type == LcdCommands::TempModel && cmd_buffer_empty())
{
switch (lcd_commands_step)
{
case 0:
lcd_commands_step = 3;
[[fallthrough]];
case 3:
temp_model_set_warn_beep(false);
enquecommand_P(PSTR("M310 A F1"));
lcd_commands_step = 2;
break;
case 2:
if (temp_model_autotune_result())
enquecommand_P(PSTR("M500"));
lcd_commands_step = 1;
break;
case 1:
lcd_commands_step = 0;
lcd_commands_type = LcdCommands::Idle;
temp_model_set_warn_beep(true);
bool res = temp_model_autotune_result();
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) {
// resume the wizard
lcd_wizard(res ? WizState::Restore : WizState::Failed);
}
break;
}
}
#endif //TEMP_MODEL
if (lcd_commands_type == LcdCommands::NozzleCNG)
{
if (!blocks_queued() && cmd_buffer_empty() && !saved_printing)
{
#ifdef TEMP_MODEL
static bool was_enabled;
#endif //TEMP_MODEL
switch(lcd_commands_step)
{
case 0:
lcd_commands_step = 3;
break;
case 3:
lcd_update_enabled = false; //hack to avoid lcd_update recursion.
lcd_show_fullscreen_message_and_wait_P(_T(MSG_NOZZLE_CNG_READ_HELP));
lcd_update_enabled = true;
lcd_draw_update = 2; //force lcd clear and update after the stack unwinds.
enquecommand_P(PSTR("G28 W"));
enquecommand_P(PSTR("G1 X125 Z200 F1000"));
enquecommand_P(PSTR("M109 S280"));
#ifdef TEMP_MODEL
was_enabled = temp_model_enabled();
temp_model_set_enabled(false);
#endif //TEMP_MODEL
lcd_commands_step = 2;
break;
case 2:
//|0123456789012456789|
//|Hotend at 280C!
//|Nozzle changed and
//|tightend to specs?
//| Yes No
enquecommand_P(PSTR("M84 XY"));
lcd_update_enabled = false; //hack to avoid lcd_update recursion.
if (lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false, true)) {
setAllTargetHotends(0);
#ifdef TEMP_MODEL
temp_model_set_enabled(was_enabled);
#endif //TEMP_MODEL
lcd_commands_step = 1;
}
lcd_update_enabled = true;
break;
case 1:
lcd_setstatuspgm(MSG_WELCOME);
lcd_commands_step = 0;
lcd_commands_type = LcdCommands::Idle;
break;
}
}
}
}
void lcd_return_to_status()
@ -1119,8 +1195,8 @@ static void pgmtext_with_colon(const char *ipgmLabel, char *dst, uint8_t dstSize
//!
//! @code{.unparsed}
//! |01234567890123456789|
//! |Extruder fan: 0000| MSG_EXTRUDER_FAN_SPEED c=16
//! |Print fan: 0000| MSG_PRINT_FAN_SPEED c=16
//! |Hotend fan: 0000| MSG_HOTEND_FAN_SPEED c=15
//! |Print fan: 0000| MSG_PRINT_FAN_SPEED c=15
//! | |
//! | |
//! ----------------------
@ -1131,7 +1207,7 @@ void lcd_menu_extruder_info() // NOT static due to using ins
lcd_timeoutToStatus.stop(); //infinite timeout
lcd_home();
lcd_printf_P(PSTR("%-16.16S%-4d\n" "%-16.16S%-4d\n"), _T(MSG_EXTRUDER_FAN_SPEED), 60*fan_speed[0], _T(MSG_PRINT_FAN_SPEED), 60*fan_speed[1] );
lcd_printf_P(PSTR("%-15.15S%-5d\n" "%-15.15S%-5d\n"), _T(MSG_HOTEND_FAN_SPEED), 60*fan_speed[0], _T(MSG_PRINT_FAN_SPEED), 60*fan_speed[1] );
menu_back_if_clicked();
}
@ -2646,7 +2722,7 @@ static void lcd_babystep_z()
}
// same logic as in babystep_load
if (calibration_status() >= CALIBRATION_STATUS_LIVE_ADJUST)
if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST))
_md->babystepMemZ = 0;
_md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_unit[Z_AXIS];
@ -2688,7 +2764,7 @@ static void lcd_babystep_z()
#ifdef PINDA_THERMISTOR
eeprom_update_byte(&(EEPROM_Sheets_base->s[active_sheet].pinda_temp),current_temperature_pinda);
#endif //PINDA_THERMISTOR
calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST);
}
if (LCD_CLICKED) menu_back();
}
@ -2721,10 +2797,10 @@ void lcd_adjust_bed_reset(void)
//! @code{.unparsed}
//! |01234567890123456789|
//! |Settings: | MSG_SETTINGS
//! |Left side [μm]: | MSG_BED_CORRECTION_LEFT
//! |Right side[μm]: | MSG_BED_CORRECTION_RIGHT
//! |Front side[μm]: | MSG_BED_CORRECTION_FRONT
//! |Rear side [μm]: | MSG_BED_CORRECTION_REAR
//! |Left side [µm]: | MSG_BED_CORRECTION_LEFT
//! |Right side[µm]: | MSG_BED_CORRECTION_RIGHT
//! |Front side[µm]: | MSG_BED_CORRECTION_FRONT
//! |Rear side [µm]: | MSG_BED_CORRECTION_REAR
//! |Reset | MSG_BED_CORRECTION_RESET
//! ----------------------
//! @endcode
@ -2975,6 +3051,7 @@ bool lcd_calibrate_z_end_stop_manual(bool only_z)
if (lcd_clicked()) {
// Abort a move if in progress.
planner_abort_hard();
planner_aborted = false;
while (lcd_clicked()) ;
_delay(10);
while (lcd_clicked()) ;
@ -3071,6 +3148,11 @@ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg,
char c = char(pgm_read_byte(msg));
if (c == '~')
c = ' ';
else if (c == '\n') {
// Abort early if '\n' is encontered.
// This character is used to force the following words to be printed on the next line.
break;
}
lcd_print(c);
}
}
@ -3310,7 +3392,7 @@ void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, ui
msg = _i("XYZ calibration failed. Right front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR c=20 r=6
else
// The left and maybe the center point out of reach.
msg = _i("XYZ calibration failed. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR c=20 r=8
msg = _n("XYZ calibration failed. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR c=20 r=8
lcd_show_fullscreen_message_and_wait_P(msg);
} else {
if (point_too_far_mask != 0) {
@ -3322,7 +3404,7 @@ void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, ui
msg = _i("XYZ calibration compromised. Right front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR c=20 r=8
else
// The left and maybe the center point out of reach.
msg = _i("XYZ calibration compromised. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR c=20 r=8
msg = _n("XYZ calibration compromised. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR c=20 r=8
lcd_show_fullscreen_message_and_wait_P(msg);
}
if (point_too_far_mask == 0 || result > 0) {
@ -3439,7 +3521,8 @@ static void lcd_show_sensors_state()
uint8_t idler_state = STATE_NA;
pinda_state = READ(Z_MIN_PIN);
if (mmu_enabled && !mmu_last_finda_response.expired(1000))
if (mmu_enabled && ((_millis() - mmu_last_finda_response) < 1000ul))
//if (mmu_enabled && !mmu_last_finda_response.expired(1000))
{
finda_state = mmu_finda;
}
@ -3803,7 +3886,7 @@ void lcd_first_layer_calibration_reset()
MenuData* menuData = (MenuData*)&(menu_data[0]);
if(LCD_CLICKED || !eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) ||
(calibration_status() >= CALIBRATION_STATUS_LIVE_ADJUST) ||
(!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) ||
(0 == static_cast<int16_t>(eeprom_read_word(reinterpret_cast<uint16_t*>
(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)))))
{
@ -3860,7 +3943,7 @@ void lcd_v2_calibration()
}
else
{
loaded = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, true);
loaded = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, false);
lcd_update_enabled = true;
}
@ -3888,14 +3971,14 @@ void lcd_v2_calibration()
void lcd_wizard() {
bool result = true;
if (calibration_status() != CALIBRATION_STATUS_ASSEMBLED) {
result = lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Running Wizard will delete current calibration results and start from the beginning. Continue?"), false, false);////MSG_WIZARD_RERUN c=20 r=7
if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) {
// calibration already performed: ask before clearing the previous status
result = lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Running Wizard will delete current calibration results and start from the beginning. Continue?"), false);////MSG_WIZARD_RERUN c=20 r=7
}
if (result) {
calibration_status_store(CALIBRATION_STATUS_ASSEMBLED);
calibration_status_clear(CALIBRATION_WIZARD_STEPS);
lcd_wizard(WizState::Run);
}
else {
} else {
lcd_return_to_status();
lcd_update_enable(true);
lcd_update(2);
@ -4022,8 +4105,7 @@ void lcd_wizard(WizState state)
{
using S = WizState;
bool end = false;
int8_t wizard_event;
const char *msg = NULL;
uint8_t wizard_event;
// Make sure EEPROM_WIZARD_ACTIVE is true if entering using different entry point
// other than WizState::Run - it is useful for debugging wizard.
if (state != S::Run) eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
@ -4031,7 +4113,7 @@ void lcd_wizard(WizState state)
FORCE_BL_ON_START;
while (!end) {
printf_P(PSTR("Wizard state: %d\n"), state);
printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state);
switch (state) {
case S::Run: //Run wizard?
@ -4047,52 +4129,69 @@ void lcd_wizard(WizState state)
saved_printing = false;
if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){
// printer pre-assembled: finish remaining steps
lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING));
state = S::Restore;
} else {
wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_WIZARD_WELCOME), false, true);
if (wizard_event) {
// new printer, factory reset or manual invocation
wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_WIZARD_WELCOME), false, LCD_LEFT_BUTTON_CHOICE);
if (wizard_event == LCD_LEFT_BUTTON_CHOICE) {
state = S::Restore;
eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
} else {
// user interrupted
eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0);
end = true;
}
}
break;
case S::Restore:
switch (calibration_status()) {
case CALIBRATION_STATUS_ASSEMBLED: state = S::Selftest; break; //run selftest
case CALIBRATION_STATUS_XYZ_CALIBRATION: state = S::Xyz; break; //run xyz cal.
case CALIBRATION_STATUS_Z_CALIBRATION: state = S::Z; break; //run z cal.
case CALIBRATION_STATUS_LIVE_ADJUST: state = S::IsFil; break; //run live adjust
case CALIBRATION_STATUS_CALIBRATED: end = true; eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0); break;
default: state = S::Selftest; break; //if calibration status is unknown, run wizard from the beginning
// clear any previous error for make _new_ errors visible
lcd_reset_alert_level();
// determine the next step in the required order
if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) {
state = S::Selftest;
} else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) {
// S::Xyz *includes* S::Z so it needs to come before
// to avoid repeating Z alignment
state = S::Xyz;
} else if (!calibration_status_get(CALIBRATION_STATUS_Z)) {
state = S::Z;
#ifdef TEMP_MODEL
} else if (!calibration_status_get(CALIBRATION_STATUS_TEMP_MODEL)) {
state = S::TempModel;
#endif //TEMP_MODEL
} else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) {
state = S::IsFil;
} else {
// all required steps completed, finish successfully
state = S::Finish;
}
break;
break;
case S::Selftest:
lcd_show_fullscreen_message_and_wait_P(_i("First, I will run the selftest to check most common assembly problems."));////MSG_WIZARD_SELFTEST c=20 r=8
wizard_event = lcd_selftest();
if (wizard_event) {
calibration_status_store(CALIBRATION_STATUS_XYZ_CALIBRATION);
state = S::Xyz;
}
else end = true;
state = (wizard_event ? S::Restore : S::Failed);
break;
case S::Xyz:
lcd_show_fullscreen_message_and_wait_P(_i("I will run xyz calibration now. It will take approx. 12 mins."));////MSG_WIZARD_XYZ_CAL c=20 r=8
lcd_show_fullscreen_message_and_wait_P(_i("I will run xyz calibration now. It will take up to 24 mins."));////MSG_WIZARD_XYZ_CAL c=20 r=8
wizard_event = gcode_M45(false, 0);
if (wizard_event) state = S::IsFil;
else end = true;
state = (wizard_event ? S::Restore : S::Failed);
break;
case S::Z:
lcd_show_fullscreen_message_and_wait_P(_i("Please remove shipping helpers first."));////MSG_REMOVE_SHIPPING_HELPERS c=20 r=3
lcd_show_fullscreen_message_and_wait_P(_i("Now remove the test print from steel sheet."));////MSG_REMOVE_TEST_PRINT c=20 r=4
wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false);
if (wizard_event == LCD_MIDDLE_BUTTON_CHOICE) {
lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET));
}
lcd_show_fullscreen_message_and_wait_P(_i("I will run z calibration now."));////MSG_WIZARD_Z_CAL c=20 r=8
wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false, false);
if (!wizard_event) lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET));
wizard_event = gcode_M45(true, 0);
if (wizard_event) {
if (!wizard_event) {
state = S::Failed;
} else {
raise_z_above(MIN_Z_FOR_SWAP);
//current filament needs to be unloaded and then new filament should be loaded
//start to preheat nozzle for unloading remaining PLA filament
setTargetHotend(PLA_PREHEAT_HOTEND_TEMP, 0);
@ -4103,20 +4202,26 @@ void lcd_wizard(WizState state)
//load filament
lcd_wizard_load();
setTargetHotend(0, 0); //we are finished, cooldown nozzle
state = S::Finish; //shipped, no need to set first layer, go to final message directly
state = S::Restore;
}
else end = true;
break;
#ifdef TEMP_MODEL
case S::TempModel:
lcd_show_fullscreen_message_and_wait_P(_i("Thermal model cal. takes approx. 12 mins. See\nprusa.io/tm-cal"));////MSG_TM_CAL c=20 r=4
lcd_commands_type = LcdCommands::TempModel;
end = true; // Leave wizard temporarily for TM cal.
break;
#endif //TEMP_MODEL
case S::IsFil:
//start to preheat nozzle and bed to save some time later
setTargetHotend(PLA_PREHEAT_HOTEND_TEMP, 0);
setTargetBed(PLA_PREHEAT_HPB_TEMP);
if (mmu_enabled)
{
wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), true);
wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, false);
} else
{
wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), true);
wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, false);
}
if (wizard_event) state = S::Lay1CalCold;
else
@ -4158,46 +4263,46 @@ void lcd_wizard(WizState state)
}
else
{
lcd_show_fullscreen_message_and_wait_P(_i("If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets."));////MSG_ADDITIONAL_SHEETS c=20 r=9
state = S::Finish;
lcd_show_fullscreen_message_and_wait_P(_i("If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets."));////MSG_ADDITIONAL_SHEETS c=20 r=9
state = S::Restore;
}
break;
case S::Finish:
case S::Failed:
eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0);
end = true;
break;
default: break;
}
}
FORCE_BL_ON_END;
printf_P(_N("Wizard end state: %d\n"), state);
switch (state) { //final message
case S::Restore: //printer was already calibrated
msg = _T(MSG_WIZARD_DONE);
break;
case S::Selftest: //selftest
case S::Xyz: //xyz cal.
case S::Z: //z cal.
msg = _T(MSG_WIZARD_CALIBRATION_FAILED);
break;
case S::Finish: //we are finished
msg = _T(MSG_WIZARD_DONE);
lcd_reset_alert_level();
lcd_setstatuspgm(MSG_WELCOME);
lcd_return_to_status();
break;
default:
const char *msg = NULL;
printf_P(_N("Wizard end state: %d\n"), (uint8_t)state);
switch (state) {
case S::Run:
// user interrupted
msg = _T(MSG_WIZARD_QUIT);
break;
case S::Finish:
// we are successfully finished
msg = _T(MSG_WIZARD_DONE);
lcd_reset_alert_level();
lcd_setstatuspgm(MSG_WELCOME);
lcd_return_to_status();
break;
case S::Failed:
// aborted due to failure
msg = _T(MSG_WIZARD_CALIBRATION_FAILED);
break;
default:
// exiting for later re-entry
break;
}
if (!((S::Lay1CalCold == state) || (S::Lay1CalHot == state) || (S::Preheat == state)))
{
if (msg) {
lcd_show_fullscreen_message_and_wait_P(msg);
}
lcd_update_enable(true);
@ -4743,6 +4848,12 @@ static void sheets_menu()
MENU_END();
}
static void nozzle_change()
{
lcd_commands_type = LcdCommands::NozzleCNG;
lcd_return_to_status();
}
void lcd_hw_setup_menu(void) // can not be "static"
{
typedef struct
@ -4770,6 +4881,7 @@ void lcd_hw_setup_menu(void) // can not be "static"
MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu);
SETTINGS_NOZZLE;
MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change);
MENU_ITEM_SUBMENU_P(_i("Checks"), lcd_checking_menu); ////MSG_CHECKS c=18
#ifdef IR_SENSOR_ANALOG
@ -4824,7 +4936,7 @@ static void lcd_settings_menu()
{
bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function
MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu);
}
} else MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change);
SETTINGS_MMU_MODE;
@ -4833,11 +4945,10 @@ static void lcd_settings_menu()
#if defined (TMC2130) && defined (LINEARITY_CORRECTION)
MENU_ITEM_SUBMENU_P(_i("Lin. correction"), lcd_settings_linearity_correction_menu);////MSG_LIN_CORRECTION c=18
#endif //LINEARITY_CORRECTION && TMC2130
#ifdef PINDA_THERMISTOR
if(has_temperature_compensation())
{
MENU_ITEM_TOGGLE_P(_T(MSG_PINDA_CALIBRATION), eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) ? _T(MSG_ON) : _T(MSG_OFF), lcd_temp_calibration_set);
}
#endif
#ifdef HAS_SECOND_SERIAL_PORT
MENU_ITEM_TOGGLE_P(_T(MSG_RPI_PORT), (selectedSerialPort == 0) ? _T(MSG_OFF) : _T(MSG_ON), lcd_second_serial_set);
#endif //HAS_SECOND_SERIAL
@ -4923,11 +5034,14 @@ static void lcd_calibration_menu()
MENU_ITEM_SUBMENU_P(_i("Show end stops"), menu_show_end_stops);////MSG_SHOW_END_STOPS c=18
#endif
MENU_ITEM_GCODE_P(_i("Reset XYZ calibr."), PSTR("M44"));////MSG_CALIBRATE_BED_RESET c=18
#ifdef PINDA_THERMISTOR
if(has_temperature_compensation())
{
MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda);
}
#endif
}
#ifdef TEMP_MODEL
MENU_ITEM_SUBMENU_P(_n("Thermal Model cal."), lcd_temp_model_cal);
#endif //TEMP_MODEL
MENU_END();
}
@ -5264,22 +5378,22 @@ static bool fan_error_selftest()
fanSpeedSoftPwm = 255;
#endif //FAN_SOFT_PWM
manage_heater(); //enables print fan
setExtruderAutoFanState(3); //force enables the extruder fan
setExtruderAutoFanState(3); //force enables the hotend fan
#ifdef FAN_SOFT_PWM
extruder_autofan_last_check = _millis();
fan_measuring = true;
#endif //FAN_SOFT_PWM
_delay(1000); //delay_keep_alive would turn off extruder fan, because temerature is too low (maybe)
_delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe)
manage_heater();
fanSpeed = 0;
setExtruderAutoFanState(1); //releases lock on the extruder fan
setExtruderAutoFanState(1); //releases lock on the hotend fan
#ifdef FAN_SOFT_PWM
fanSpeedSoftPwm = 0;
#endif //FAN_SOFT_PWM
manage_heater();
#ifdef TACH_0
if (fan_speed[0] <= 20) { //extruder fan error
LCD_ALERTMESSAGERPGM(MSG_FANCHECK_EXTRUDER);
if (fan_speed[0] <= 20) { //hotend fan error
LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND);
return 1;
}
#endif
@ -5323,7 +5437,12 @@ void lcd_resume_print()
st_synchronize();
custom_message_type = CustomMsg::Resuming;
isPrintPaused = false;
Stopped = false; // resume processing USB commands again
// resume processing USB commands again and restore hotend fan state (in case the print was
// stopped due to a thermal error)
hotendDefaultAutoFanState();
Stopped = false;
restore_print_from_ram_and_continue(default_retraction);
pause_time += (_millis() - start_pause_print); //accumulate time when print is paused for correct statistics calculation
refresh_cmd_timeout();
@ -5402,10 +5521,8 @@ static void lcd_reset_sheet()
if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))
{
eeprom_switch_to_next_sheet();
if((-1 == eeprom_next_initialized_sheet(0)) && (CALIBRATION_STATUS_CALIBRATED == calibration_status()))
{
calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
}
if (-1 == eeprom_next_initialized_sheet(0))
calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST);
}
menu_back();
@ -5506,7 +5623,7 @@ static void lcd_main_menu()
if ( moves_planned() || printer_active() ) {
MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE c=18
} else {
} else if (!Stopped) {
MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT c=18
}
@ -5535,6 +5652,11 @@ static void lcd_main_menu()
if((IS_SD_PRINTING || usb_timer.running() || isPrintPaused) && (custom_message_type != CustomMsg::MeshBedLeveling)) {
MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
}
#ifdef TEMP_MODEL
else if(Stopped) {
MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop);
}
#endif
#ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code
if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) {
if (!card.isFileOpen()) {
@ -5565,7 +5687,7 @@ static void lcd_main_menu()
}
}
if ( ! ( IS_SD_PRINTING || usb_timer.running() || (lcd_commands_type == LcdCommands::Layer1Cal) ) ) {
if ( ! ( IS_SD_PRINTING || usb_timer.running() || (lcd_commands_type == LcdCommands::Layer1Cal || Stopped) ) ) {
if (mmu_enabled) {
MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), mmu_load_filament_menu);
MENU_ITEM_SUBMENU_P(_i("Load to nozzle"), mmu_load_to_nozzle_menu);////MSG_LOAD_TO_NOZZLE c=18
@ -5933,7 +6055,7 @@ static void lcd_sd_updir()
}
// continue stopping the print from the main loop after lcd_print_stop() is called
void print_stop()
void lcd_print_stop_finish()
{
// save printing time
stoptime = _millis();
@ -5958,6 +6080,9 @@ void print_stop()
} else {
// Turn off the print fan
fanSpeed = 0;
// restore the auto hotend state
hotendDefaultAutoFanState();
}
if (mmu_enabled) extr_unload(); //M702 C
@ -5965,11 +6090,11 @@ void print_stop()
axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative
}
void lcd_print_stop()
void print_stop(bool interactive)
{
// UnconditionalStop() will internally cause planner_abort_hard(), meaning we _cannot_ plan
// any more move in this call! Any further move must happen inside print_stop(), which is called
// by the main loop one iteration later.
// UnconditionalStop() will internally cause planner_abort_hard(), meaning we _cannot_ plan any
// more move in this call! Any further move must happen inside lcd_print_stop_finish(), which is
// called by the main loop one iteration later.
UnconditionalStop();
if (!card.sdprinting) {
@ -5984,11 +6109,29 @@ void lcd_print_stop()
pause_time = 0;
isPrintPaused = false;
if (interactive) {
// acknowledged by the user from the LCD: resume processing USB commands again
Stopped = false;
}
// return to status is required to continue processing in the main loop!
lcd_commands_type = LcdCommands::StopPrint;
lcd_return_to_status();
}
void lcd_print_stop()
{
print_stop(true);
}
#ifdef TEMP_MODEL
void lcd_temp_model_cal()
{
lcd_commands_type = LcdCommands::TempModel;
lcd_return_to_status();
}
#endif //TEMP_MODEL
void lcd_sdcard_stop()
{
@ -6305,7 +6448,7 @@ bool lcd_selftest()
_progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000);
#if (defined(FANCHECK) && defined(TACH_0))
switch (lcd_selftest_fan_auto(0)){ // check extruder Fan
switch (lcd_selftest_fan_auto(0)){ // check hotend fan
case FanCheck::SwappedFan:
_swapped_fan = true; // swapped is merely a hint (checked later)
// FALLTHRU
@ -6349,7 +6492,7 @@ bool lcd_selftest()
}
if (_swapped_fan) {
//turn on print fan and check that left extruder fan is not spinning
//turn on print fan and check that left hotend fan is not spinning
_result = lcd_selftest_manual_fan_check(1, true);
if (_result) {
//print fan is stil turned on; check that it is spinning
@ -6527,7 +6670,9 @@ bool lcd_selftest()
if (_result)
{
LCD_ALERTMESSAGERPGM(_i("Self test OK"));////MSG_SELFTEST_OK c=20
calibration_status_set(CALIBRATION_STATUS_SELFTEST);
lcd_setstatuspgm(_i("Self test OK"));////MSG_SELFTEST_OK c=20
lcd_return_to_status();
}
else
{
@ -6886,27 +7031,27 @@ static bool lcd_selfcheck_endstops()
static bool lcd_selfcheck_check_heater(bool _isbed)
{
uint8_t _counter = 0;
uint8_t _progress = 0;
bool _stepresult = false;
bool _docycle = true;
int _checked_snapshot = (_isbed) ? degBed() : degHotend(0);
int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed();
uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s
target_temperature[0] = (_isbed) ? 0 : 200;
target_temperature_bed = (_isbed) ? 100 : 0;
#ifdef TEMP_MODEL
bool tm_was_enabled = temp_model_enabled();
temp_model_set_enabled(false);
#endif //TEMP_MODEL
manage_heater();
manage_inactivity(true);
do {
_counter++;
_docycle = (_counter < _cycles) ? true : false;
for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter)
{
manage_heater();
manage_inactivity(true);
_progress = (_isbed) ? lcd_selftest_screen(TestScreen::Bed, _progress, 2, false, 400) : lcd_selftest_screen(TestScreen::Hotend, _progress, 2, false, 400);
_progress = (_isbed?
lcd_selftest_screen(TestScreen::Bed, _progress, 2, false, 400) :
lcd_selftest_screen(TestScreen::Hotend, _progress, 2, false, 400));
/*if (_isbed) {
MYSERIAL.print("Bed temp:");
MYSERIAL.println(degBed());
@ -6916,8 +7061,7 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
MYSERIAL.println(degHotend(0));
}*/
if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds
} while (_docycle);
}
target_temperature[0] = 0;
target_temperature_bed = 0;
@ -6933,22 +7077,22 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
MYSERIAL.println(_opposite_result);
*/
if (_opposite_result < ((_isbed) ? 30 : 9))
{
if (_checked_result >= ((_isbed) ? 9 : 30))
{
_stepresult = true;
}
else
{
lcd_selftest_error(TestError::Heater, "", "");
}
}
else
{
lcd_selftest_error(TestError::Bed, "", "");
}
bool _stepresult = false;
if (Stopped || _opposite_result < ((_isbed) ? 30 : 9))
{
if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30))
_stepresult = true;
else
lcd_selftest_error(TestError::Heater, "", "");
}
else
{
lcd_selftest_error(TestError::Bed, "", "");
}
#ifdef TEMP_MODEL
temp_model_set_enabled(tm_was_enabled);
#endif //TEMP_MODEL
manage_heater();
manage_inactivity(true);
return _stepresult;
@ -7007,7 +7151,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
lcd_print(_error_1);
break;
case TestError::ExtruderFan:
lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_EXTRUDER_FAN));
lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HOTEND_FAN));
lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR));
lcd_set_cursor(18, 3);
lcd_print(_error_1);
@ -7154,12 +7298,12 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite,
{
case 0:
// extruder cooling fan
lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_PART_FAN) : _T(MSG_SELFTEST_EXTRUDER_FAN));
lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_PART_FAN) : _T(MSG_SELFTEST_HOTEND_FAN));
setExtruderAutoFanState(3);
break;
case 1:
// object cooling fan
lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_EXTRUDER_FAN) : _T(MSG_SELFTEST_PART_FAN));
lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_HOTEND_FAN) : _T(MSG_SELFTEST_PART_FAN));
SET_OUTPUT(FAN_PIN);
#ifdef FAN_SOFT_PWM
fanSpeedSoftPwm = 255;
@ -7266,10 +7410,10 @@ static FanCheck lcd_selftest_fan_auto(uint8_t _fan)
switch (_fan) {
case 0:
setExtruderAutoFanState(3); // extruder fan
setExtruderAutoFanState(3); // hotend fan
lcd_selftest_setfan(0); // print fan off
lcd_selftest_measure_fans(2, 18, 2);
setExtruderAutoFanState(0); // extruder fan off
setExtruderAutoFanState(0); // hotend fan off
if (fan_speed[0] < failThr) {
return FanCheck::ExtruderFan;
}
@ -7326,7 +7470,7 @@ static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t
if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk))
{
//SERIAL_ECHOLNPGM("Fan test");
lcd_puts_at_P(0, 2, _T(MSG_EXTRUDER_FAN_SPEED));
lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED));
lcd_set_cursor(18, 2);
(screen < TestScreen::PrintFan) ? lcd_print(_indicator) : lcd_print("OK");
lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED));
@ -7427,7 +7571,6 @@ static bool check_file(const char* filename) {
card.printingHasFinished();
lcd_setstatuspgm(MSG_WELCOME);
lcd_finishstatus();
return result;
}
@ -7518,6 +7661,9 @@ void ultralcd_init()
lcd_oldcardstatus = IS_SD_INSERTED;
#endif//(SDCARDDETECT > 0)
lcd_encoder_diff = 0;
// Initialise status line
strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH);
}
void lcd_ignore_click(bool b)
@ -7526,19 +7672,6 @@ void lcd_ignore_click(bool b)
wait_for_unclick = false;
}
void lcd_finishstatus() {
SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED);
int len = strlen(lcd_status_message);
if (len > 0) {
while (len < LCD_WIDTH) {
lcd_status_message[len++] = ' ';
}
}
lcd_status_message[LCD_WIDTH] = '\0';
lcd_draw_update = 2;
}
static bool lcd_message_check(uint8_t priority)
{
// regular priority check
@ -7561,7 +7694,9 @@ static void lcd_updatestatus(const char *message, bool progmem = false)
strncpy(lcd_status_message, message, LCD_WIDTH);
lcd_status_message[LCD_WIDTH] = 0;
lcd_finishstatus();
SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED);
// hack lcd_draw_update to 1, i.e. without clear
lcd_draw_update = 1;
}
@ -7578,15 +7713,28 @@ void lcd_setstatuspgm(const char* message)
lcd_updatestatus(message, true);
}
void lcd_setstatus_serial(const char* message)
{
if (lcd_message_check(LCD_STATUS_NONE))
lcd_updatestatus(message);
SERIAL_ECHOLN(message);
}
void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem)
{
if (lcd_message_check(severity)) {
lcd_updatestatus(message, progmem);
bool same = !(progmem?
strcmp_P(lcd_status_message, message):
strcmp(lcd_status_message, message));
lcd_status_message_timeout.start();
lcd_status_message_level = severity;
custom_message_type = CustomMsg::Status;
custom_message_state = 0;
lcd_return_to_status();
if (!same) {
// do not kick the user out of the menus if the message is unchanged
lcd_updatestatus(message, progmem);
lcd_return_to_status();
}
}
}
@ -7612,8 +7760,11 @@ uint8_t get_message_level()
void menu_lcd_longpress_func(void)
{
backlight_wake();
if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_block_mask != MENU_BLOCK_NONE)
// Wake up the LCD backlight and,
// start LCD inactivity timer
lcd_timeoutToStatus.start();
backlight_wake();
if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_block_mask != MENU_BLOCK_NONE || Stopped)
{
// disable longpress during re-entry, while homing, calibration or if a serious error
lcd_quick_feedback();

View File

@ -21,6 +21,7 @@ void ultralcd_init();
// Set the current status message (equivalent to LCD_STATUS_NONE)
void lcd_setstatus(const char* message);
void lcd_setstatuspgm(const char* message);
void lcd_setstatus_serial(const char* message);
//! return to the main status screen and display the alert message
//! Beware - it has sideeffects:
@ -46,7 +47,11 @@ void lcd_sdcard_stop();
void lcd_pause_print();
void lcd_pause_usb_print();
void lcd_resume_print();
void lcd_print_stop();
void lcd_print_stop(); // interactive print stop
void print_stop(bool interactive=false);
#ifdef TEMP_MODEL
void lcd_temp_model_cal();
#endif //TEMP_MODEL
void lcd_load_filament_color_check();
extern void lcd_belttest();
@ -64,7 +69,12 @@ void lcd_crash_detect_enable();
void lcd_crash_detect_disable();
#endif
extern const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines);
enum LCDButtonChoice : int_fast8_t {
LCD_LEFT_BUTTON_CHOICE = 1,
LCD_MIDDLE_BUTTON_CHOICE = 0,
LCD_BUTTON_TIMEOUT = -1,
};
extern const char* lcd_display_message_fullscreen_P(const char *msg);
extern void lcd_return_to_status();
@ -107,6 +117,10 @@ enum class LcdCommands : uint_least8_t
LongPause,
PidExtruder,
Layer1Cal,
#ifdef TEMP_MODEL
TempModel,
#endif //TEMP_MODEL
NozzleCNG,
};
extern LcdCommands lcd_commands_type;
@ -217,16 +231,18 @@ enum class WizState : uint8_t
Selftest, //!< self test
Xyz, //!< xyz calibration
Z, //!< z calibration
#ifdef TEMP_MODEL
TempModel, //!< Temp model calibration
#endif //TEMP_MODEL
IsFil, //!< Is filament loaded? First step of 1st layer calibration
PreheatPla, //!< waiting for preheat nozzle for PLA
Preheat, //!< Preheat for any material
LoadFilCold, //!< Load filament for MMU
LoadFilHot, //!< Load filament without MMU
IsPla, //!< Is PLA filament?
Lay1CalCold, //!< First layer calibration, temperature not selected yet
Lay1CalHot, //!< First layer calibration, temperature already selected
RepeatLay1Cal, //!< Repeat first layer calibration?
Finish, //!< Deactivate wizard
Finish, //!< Deactivate wizard (success)
Failed, //!< Deactivate wizard (failure)
};
void lcd_wizard(WizState state);

View File

@ -10,7 +10,24 @@
// 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;
static const uint16_t FW_VERSION_NR[4] PROGMEM = { FW_MAJOR, FW_MINOR, FW_REVISION, FW_COMMIT_NR };
const uint16_t FW_VERSION_NR[4] PROGMEM = {
FW_MAJOR,
FW_MINOR,
FW_REVISION,
#ifndef FW_FLAVOR
FW_COMMIT_NR
#else
# if FW_DEV_VERSION == FW_VERSION_ALPHA
FIRMWARE_REVISION_ALPHA + FW_FLAVERSION
# elif FW_DEV_VERSION == FW_VERSION_BETA
FIRMWARE_REVISION_BETA + FW_FLAVERSION
# elif FW_DEV_VERSION == FW_VERSION_RC
FIRMWARE_REVISION_RC + FW_FLAVERSION
# elif FW_DEV_VERSION == FW_VERSION_GOLD
0
# endif
#endif
};
const char* FW_VERSION_STR_P()
{
@ -24,10 +41,10 @@ const char* FW_PRUSA3D_MAGIC_STR_P()
return FW_PRUSA3D_MAGIC_STR;
}
const char STR_REVISION_DEV [] PROGMEM = "dev";
const char STR_REVISION_ALPHA[] PROGMEM = "alpha";
const char STR_REVISION_BETA [] PROGMEM = "beta";
const char STR_REVISION_RC [] PROGMEM = "rc";
const char STR_REVISION_DEV [] PROGMEM = "DEV";
const char STR_REVISION_ALPHA[] PROGMEM = "ALPHA";
const char STR_REVISION_BETA [] PROGMEM = "BETA";
const char STR_REVISION_RC [] PROGMEM = "RC";
inline bool is_whitespace_or_nl(char c)
{
@ -44,78 +61,84 @@ inline bool is_digit(char c)
return c >= '0' && c <= '9';
}
char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){
*v = 0;
while(is_digit(*str)){
*v *= 10;
*v += *str - '0';
++str;
}
return str;
}
bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){
if( ! strncmp_P(str, tag_P, tagSize) ){
Number(str + tagSize, v);
*v |= tagMask;
return true;
}
return false;
}
// Parse a major.minor.revision version number.
// Return true if valid.
inline bool parse_version(const char *str, uint16_t version[4])
{
#if 0
SERIAL_ECHOPGM("Parsing version string ");
SERIAL_ECHO(str);
SERIAL_ECHOLNPGM("");
#endif
const char *major = str;
const char *p = str;
while (is_digit(*p)) ++ p;
if (*p != '.')
return false;
const char *minor = ++ p;
while (is_digit(*p)) ++ p;
if (*p != '.')
return false;
const char *rev = ++ p;
while (is_digit(*p)) ++ p;
if (! is_whitespace_or_nl_or_eol(*p) && *p != '-')
return false;
char *endptr = NULL;
version[0] = strtol(major, &endptr, 10);
if (endptr != minor - 1)
return false;
version[1] = strtol(minor, &endptr, 10);
if (endptr != rev - 1)
return false;
version[2] = strtol(rev, &endptr, 10);
if (endptr != p)
return false;
bool parse_version(const char *str, uint16_t version[4]) {
for(uint8_t i = 0; i < 2; ++i){
str = Number(str, version + i);
if (*str != '.')
return false;
++str;
}
str = Number(str, version + 2);
version[3] = FIRMWARE_REVISION_RELEASED;
if (*p ++ == '-') {
const char *q = p;
while (! is_whitespace_or_nl_or_eol(*q))
++ q;
uint8_t n = q - p;
if (n == strlen_P(STR_REVISION_DEV) && strncmp_P(p, STR_REVISION_DEV, n) == 0)
version[3] = FIRMWARE_REVISION_DEV;
else if (n == strlen_P(STR_REVISION_ALPHA) && strncmp_P(p, STR_REVISION_ALPHA, n) == 0)
version[3] = FIRMWARE_REVISION_ALPHA;
else if (n == strlen_P(STR_REVISION_BETA) && strncmp_P(p, STR_REVISION_BETA, n) == 0)
version[3] = FIRMWARE_REVISION_BETA;
else if ((n == 2 || n == 3) && (p[0] == 'r' || p[0] == 'R') && (p[1] == 'c' || p[1] == 'C')) {
if (n == 2)
version[3] = FIRMWARE_REVISION_RC;
else {
if (is_digit(p[2]))
version[3] = FIRMWARE_REVISION_RC + p[2] - '1';
else
return false;
}
} else
return false;
// skip everything else until eol or '-'
for(;;){
if(is_whitespace_or_nl_or_eol(*str)){
// speculatively reached the end of line, silently ignoring anything which is not a '-'
return true;
}
if( *str == '-'){
break; // tag expected
}
++str;
}
#if 0
SERIAL_ECHOPGM("Version parsed, major: ");
SERIAL_ECHO(version[0]);
SERIAL_ECHOPGM(", minor: ");
SERIAL_ECHO(version[1]);
SERIAL_ECHOPGM(", revision: ");
SERIAL_ECHO(version[2]);
SERIAL_ECHOPGM(", flavor: ");
SERIAL_ECHO(version[3]);
SERIAL_ECHOLNPGM("");
#endif
return true;
// SERIAL_ECHOPGM("parse_version: ");
// SERIAL_ECHO(version[0]);
// SERIAL_ECHO('.');
// SERIAL_ECHO(version[1]);
// SERIAL_ECHO('.');
// SERIAL_ECHO(version[2]);
// SERIAL_ECHO('.');
// SERIAL_ECHOLN(version[3]);
if (*str++ == '-') {
switch(*str){
case 'A': // expect ALPHA
static_assert(sizeof(STR_REVISION_ALPHA) == 6);
return Tag( str, STR_REVISION_ALPHA, sizeof(STR_REVISION_ALPHA) - 1, FIRMWARE_REVISION_ALPHA, version + 3);
case 'B': // expect BETA
static_assert(sizeof(STR_REVISION_BETA) == 5);
return Tag( str, STR_REVISION_BETA, sizeof(STR_REVISION_BETA) - 1, FIRMWARE_REVISION_BETA, version + 3);
case 'D': // expect DEV
static_assert(sizeof(STR_REVISION_DEV) == 4);
return Tag( str, STR_REVISION_DEV, sizeof(STR_REVISION_DEV) - 1, FIRMWARE_REVISION_DEV, version + 3);
case 'R': // expect RC
static_assert(sizeof(STR_REVISION_RC) == 3);
return Tag( str, STR_REVISION_RC, sizeof(STR_REVISION_RC) - 1, FIRMWARE_REVISION_RC, version + 3);
default: return false; // fail everything else
}
}
// SERIAL_ECHOPGM("parse_version with tag: ");
// SERIAL_ECHO(version[0]);
// SERIAL_ECHO('.');
// SERIAL_ECHO(version[1]);
// SERIAL_ECHO('.');
// SERIAL_ECHO(version[2]);
// SERIAL_ECHO('.');
// SERIAL_ECHOLN(version[3]);
return false;
}
inline bool strncmp_PP(const char *p1, const char *p2, uint8_t n)
@ -158,32 +181,23 @@ inline int8_t is_provided_version_newer(const char *version_string)
return 0;
}
bool force_selftest_if_fw_version()
bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4])
{
//if fw version used before flashing new firmware (fw version currently stored in eeprom) is lower then 3.1.2-RC2, function returns true to force selftest
uint16_t ver_eeprom[4];
ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR);
ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR);
ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION);
ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR);
uint16_t ver_eeprom[4];
uint16_t ver_with_calibration[4] = {3, 1, 2, 4}; //hardcoded 3.1.2-RC2 version
bool force_selftest = false;
for (uint8_t i = 0; i < 4; ++i) {
uint16_t v = pgm_read_word(&ver_req[i]);
if (v > ver_eeprom[i])
return true;
else if (v < ver_eeprom[i])
break;
}
ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR);
ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR);
ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION);
ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR);
for (uint8_t i = 0; i < 4; ++i) {
if (ver_with_calibration[i] > ver_eeprom[i]) {
force_selftest = true;
break;
}
else if (ver_with_calibration[i] < ver_eeprom[i])
break;
}
//force selftest also in case that version used before flashing new firmware was 3.2.0-RC1
if ((ver_eeprom[0] == 3) && (ver_eeprom[1] == 2) && (ver_eeprom[2] == 0) && (ver_eeprom[3] == 3)) force_selftest = true;
return force_selftest;
return false;
}
bool show_upgrade_dialog_if_version_newer(const char *version_string)
@ -227,7 +241,6 @@ void update_current_firmware_version_to_eeprom()
}
//-//
#define MSG_PRINT_CHECKING_FAILED_TIMEOUT 30
ClNozzleDiameter oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
@ -347,8 +360,7 @@ lcd_update_enable(true); // display / status-line recovery
}
}
uint8_t mCompareValue(uint16_t nX,uint16_t nY)
{
uint8_t mCompareValue(uint16_t nX, uint16_t nY) {
if(nX>nY)
return((uint8_t)ClCompareValue::_Greater);
if(nX<nY)
@ -356,78 +368,88 @@ if(nX<nY)
return((uint8_t)ClCompareValue::_Equal);
}
void fw_version_check(const char *pVersion)
{
uint16_t aVersion[4];
uint8_t nCompareValueResult;
void fw_version_check(const char *pVersion) {
if (oCheckVersion == ClCheckVersion::_None)
return;
if(oCheckVersion==ClCheckVersion::_None)
return;
parse_version(pVersion,aVersion);
nCompareValueResult=mCompareValue(aVersion[0],eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR))<<6;
nCompareValueResult+=mCompareValue(aVersion[1],eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR))<<4;
nCompareValueResult+=mCompareValue(aVersion[2],eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION))<<2;
nCompareValueResult+=mCompareValue(aVersion[3],eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR));
if(nCompareValueResult==COMPARE_VALUE_EQUAL)
return;
if((nCompareValueResult<COMPARE_VALUE_EQUAL)&&oCheckVersion==ClCheckVersion::_Warn)
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Printer FW version differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN(FW_VERSION);
//SERIAL_ECHOPGM("expected: ");
//SERIAL_ECHOLN(pVersion);
switch(oCheckVersion)
{
case ClCheckVersion::_Warn:
// lcd_show_fullscreen_message_and_wait_P(_i("Printer FW version differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("G-code sliced for a newer firmware. Continue?"));////MSG_GCODE_NEWER_FIRMWARE_CONTINUE c=20 r=5
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckVersion::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("G-code sliced for a newer firmware. Please update the firmware. Print cancelled."));////MSG_GCODE_NEWER_FIRMWARE_CANCELLED c=20 r=8
lcd_print_stop();
break;
case ClCheckVersion::_None:
case ClCheckVersion::_Undef:
break;
}
uint16_t aVersion[4];
uint8_t nCompareValueResult;
parse_version(pVersion, aVersion);
nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6;
nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4;
nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2;
nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR));
if (nCompareValueResult <= COMPARE_VALUE_EQUAL)
return;
/*
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Printer FW version differs from the G-code ...");
SERIAL_ECHOPGM("actual : ");
SERIAL_ECHO(eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR));
SERIAL_ECHO('.');
SERIAL_ECHO(eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR));
SERIAL_ECHO('.');
SERIAL_ECHO(eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION));
SERIAL_ECHO('.');
SERIAL_ECHO(eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR));
SERIAL_ECHOPGM("\nexpected: ");
SERIAL_ECHO(aVersion[0]);
SERIAL_ECHO('.');
SERIAL_ECHO(aVersion[1]);
SERIAL_ECHO('.');
SERIAL_ECHO(aVersion[2]);
SERIAL_ECHO('.');
SERIAL_ECHOLN(aVersion[3]);
*/
switch (oCheckVersion) {
case ClCheckVersion::_Warn:
// lcd_show_fullscreen_message_and_wait_P(_i("Printer FW version differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("G-code sliced for a newer firmware. Continue?")); ////MSG_GCODE_NEWER_FIRMWARE_CONTINUE c=20 r=5
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckVersion::_Strict:
lcd_show_fullscreen_message_and_wait_P(
_i("G-code sliced for a newer firmware. Please update the firmware. Print cancelled.")); ////MSG_GCODE_NEWER_FIRMWARE_CANCELLED c=20 r=8
lcd_print_stop();
break;
case ClCheckVersion::_None:
case ClCheckVersion::_Undef:
break;
}
}
void gcode_level_check(uint16_t nGcodeLevel)
{
if(oCheckGcode==ClCheckGcode::_None)
return;
if(nGcodeLevel==(uint16_t)GCODE_LEVEL)
return;
if((nGcodeLevel<(uint16_t)GCODE_LEVEL)&&(oCheckGcode==ClCheckGcode::_Warn))
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Printer G-code level differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN(GCODE_LEVEL);
//SERIAL_ECHOPGM("expected: ");
//SERIAL_ECHOLN(nGcodeLevel);
switch(oCheckGcode)
{
case ClCheckGcode::_Warn:
// lcd_show_fullscreen_message_and_wait_P(_i("Printer G-code level differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("G-code sliced for a different level. Continue?"));////MSG_GCODE_DIFF_CONTINUE c=20 r=4
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckGcode::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("G-code sliced for a different level. Please re-slice the model again. Print cancelled."));////MSG_GCODE_DIFF_CANCELLED c=20 r=7
lcd_print_stop();
break;
case ClCheckGcode::_None:
case ClCheckGcode::_Undef:
break;
}
void gcode_level_check(uint16_t nGcodeLevel) {
if (oCheckGcode == ClCheckGcode::_None)
return;
if (nGcodeLevel <= (uint16_t)GCODE_LEVEL)
return;
// SERIAL_ECHO_START;
// SERIAL_ECHOLNPGM("Printer G-code level differs from the G-code ...");
// SERIAL_ECHOPGM("actual : ");
// SERIAL_ECHOLN(GCODE_LEVEL);
// SERIAL_ECHOPGM("expected: ");
// SERIAL_ECHOLN(nGcodeLevel);
switch (oCheckGcode) {
case ClCheckGcode::_Warn:
// lcd_show_fullscreen_message_and_wait_P(_i("Printer G-code level differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("G-code sliced for a different level. Continue?")); ////MSG_GCODE_DIFF_CONTINUE c=20 r=4
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckGcode::_Strict:
lcd_show_fullscreen_message_and_wait_P(
_i("G-code sliced for a different level. Please re-slice the model again. Print cancelled.")); ////MSG_GCODE_DIFF_CANCELLED c=20 r=7
lcd_print_stop();
break;
case ClCheckGcode::_None:
case ClCheckGcode::_Undef:
break;
}
}
//-// -> cmdqueue ???
@ -496,8 +518,28 @@ else {
}
}
void ip4_to_str(char* dest, uint8_t* IP)
{
sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]);
}
bool calibration_status_get(CalibrationStatus components)
{
CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2);
return ((status & components) == components);
}
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);
}
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);
}

View File

@ -1,26 +1,25 @@
#ifndef UTIL_H
#define UTIL_H
#pragma once
#include <stdint.h>
extern const uint16_t FW_VERSION_NR[4];
extern const char* FW_VERSION_STR_P();
// Definition of a firmware flavor numerical values.
enum FirmwareRevisionFlavorType
{
FIRMWARE_REVISION_DEV = 0,
FIRMWARE_REVISION_ALPHA = 1,
FIRMWARE_REVISION_BETA = 2,
FIRMWARE_REVISION_RC,
FIRMWARE_REVISION_RC2,
FIRMWARE_REVISION_RC3,
FIRMWARE_REVISION_RC4,
FIRMWARE_REVISION_RC5,
FIRMWARE_REVISION_RELEASED = 127
// To keep it short as possible
// DEVs/ALPHAs/BETAs limited to max 8 flavor versions
// RCs limited to 32 flavor versions
// Final Release always 64 as highest
enum FirmwareRevisionFlavorType : uint16_t {
FIRMWARE_REVISION_RELEASED = 0x0040,
FIRMWARE_REVISION_DEV = 0x0000,
FIRMWARE_REVISION_ALPHA = 0x008,
FIRMWARE_REVISION_BETA = 0x0010,
FIRMWARE_REVISION_RC = 0x0020
};
extern bool show_upgrade_dialog_if_version_newer(const char *version_string);
extern bool force_selftest_if_fw_version();
extern void update_current_firmware_version_to_eeprom();
bool show_upgrade_dialog_if_version_newer(const char *version_string);
bool eeprom_fw_version_older_than_p(const uint16_t (&req_ver)[4]);
void update_current_firmware_version_to_eeprom();
@ -113,4 +112,34 @@ void fSetMmuMode(bool bMMu);
#define IP4_STR_SIZE 16
extern void ip4_to_str(char* dest, uint8_t* IP);
#endif /* UTIL_H */
// Calibration status of the machine
// (unsigned char*)EEPROM_CALIBRATION_STATUS_V2
typedef uint8_t CalibrationStatus;
const CalibrationStatus CALIBRATION_STATUS_SELFTEST = 0b00000001; // Selftest
const CalibrationStatus CALIBRATION_STATUS_XYZ = 0b00000010; // XYZ calibration
const CalibrationStatus CALIBRATION_STATUS_Z = 0b00000100; // Z calibration
#ifdef TEMP_MODEL
const CalibrationStatus CALIBRATION_STATUS_TEMP_MODEL = 0b00001000; // Temperature model calibration
#endif
const CalibrationStatus CALIBRATION_STATUS_LIVE_ADJUST = 0b00010000; // 1st layer calibration
const CalibrationStatus CALIBRATION_STATUS_UNKNOWN = 0b10000000; // Freshly assembled or unknown status
// Calibration steps performed by the wizard
const CalibrationStatus CALIBRATION_WIZARD_STEPS =
CALIBRATION_STATUS_SELFTEST |
CALIBRATION_STATUS_XYZ |
CALIBRATION_STATUS_Z |
#ifdef TEMP_MODEL
CALIBRATION_STATUS_TEMP_MODEL |
#endif
CALIBRATION_STATUS_LIVE_ADJUST;
// Calibration steps enforced after service prep
const CalibrationStatus CALIBRATION_FORCE_PREP = CALIBRATION_STATUS_Z;
bool calibration_status_get(CalibrationStatus components);
void calibration_status_set(CalibrationStatus components);
void calibration_status_clear(CalibrationStatus components);
// PINDA has an independent calibration flag
inline bool calibration_status_pinda() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA); }

View File

@ -411,31 +411,26 @@
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45
// model-based temperature check
#define TEMP_MODEL 1 // enable model-based temperature checks
#define TEMP_MODEL_DEBUG 1 // extended runtime logging
#define TEMP_MODEL 1 // enable model-based temperature checks
#define TEMP_MODEL_DEBUG 1 // extended runtime logging
#define TEMP_MODEL_P 38. // heater power (W)
#define TEMP_MODEL_CAL_C_low 5 // C estimation lower limit
#define TEMP_MODEL_CAL_C_high 20 // C estimation upper limit
#define TEMP_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define TEMP_MODEL_CAL_C_itr 30 // C estimation iteration limit
#define TEMP_MODEL_C 12.1 // initial guess for heatblock capacitance (J/K)
#define TEMP_MODEL_Cl 5 // C estimation lower limit
#define TEMP_MODEL_Ch 20 // C estimation upper limit
#define TEMP_MODEL_C_thr 0.01 // C estimation iteration threshold
#define TEMP_MODEL_C_itr 30 // C estimation iteration limit
#define TEMP_MODEL_CAL_R_low 5 // R estimation lower limit
#define TEMP_MODEL_CAL_R_high 50 // R estimation upper limit
#define TEMP_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define TEMP_MODEL_CAL_R_itr 30 // R estimation iteration limit
#define TEMP_MODEL_R 29.7 // initial guess for heatblock resistance (K/W)
#define TEMP_MODEL_Rl 5 // R estimation lower limit
#define TEMP_MODEL_Rh 50 // R estimation upper limit
#define TEMP_MODEL_R_thr 0.01 // R estimation iteration threshold
#define TEMP_MODEL_R_itr 30 // R estimation iteration limit
#define TEMP_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define TEMP_MODEL_CAL_T_high 230 // Default calibration working temperature (C)
#define TEMP_MODEL_Ta_corr -7 // Default ambient temperature correction
#define TEMP_MODEL_LAG 2.1 // Temperature transport delay (s)
#define TEMP_MODEL_Ta_corr -7 // Default ambient temperature correction
#define TEMP_MODEL_W 1.2 // Default warning threshold (K/s)
#define TEMP_MODEL_E 1.74 // Default error threshold (K/s)
#define TEMP_MODEL_CAL_Th 230 // Default calibration working temperature (C)
#define TEMP_MODEL_CAL_Tl 50 // Default calibration cooling temperature (C)
#include "temp_model/e3d_v6.h"
#define TEMP_MODEL_DEFAULT E3D_V6 // Default model parameters
/*------------------------------------

View File

@ -415,31 +415,26 @@
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45
// model-based temperature check
#define TEMP_MODEL 1 // enable model-based temperature checks
#define TEMP_MODEL_DEBUG 1 // extended runtime logging
#define TEMP_MODEL 1 // enable model-based temperature checks
#define TEMP_MODEL_DEBUG 1 // extended runtime logging
#define TEMP_MODEL_P 38. // heater power (W)
#define TEMP_MODEL_CAL_C_low 5 // C estimation lower limit
#define TEMP_MODEL_CAL_C_high 20 // C estimation upper limit
#define TEMP_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define TEMP_MODEL_CAL_C_itr 30 // C estimation iteration limit
#define TEMP_MODEL_C 12.1 // initial guess for heatblock capacitance (J/K)
#define TEMP_MODEL_Cl 5 // C estimation lower limit
#define TEMP_MODEL_Ch 20 // C estimation upper limit
#define TEMP_MODEL_C_thr 0.01 // C estimation iteration threshold
#define TEMP_MODEL_C_itr 30 // C estimation iteration limit
#define TEMP_MODEL_CAL_R_low 5 // R estimation lower limit
#define TEMP_MODEL_CAL_R_high 50 // R estimation upper limit
#define TEMP_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define TEMP_MODEL_CAL_R_itr 30 // R estimation iteration limit
#define TEMP_MODEL_R 29.7 // initial guess for heatblock resistance (K/W)
#define TEMP_MODEL_Rl 5 // R estimation lower limit
#define TEMP_MODEL_Rh 50 // R estimation upper limit
#define TEMP_MODEL_R_thr 0.01 // R estimation iteration threshold
#define TEMP_MODEL_R_itr 30 // R estimation iteration limit
#define TEMP_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define TEMP_MODEL_CAL_T_high 230 // Default calibration working temperature (C)
#define TEMP_MODEL_Ta_corr -7 // Default ambient temperature correction
#define TEMP_MODEL_LAG 2.1 // Temperature transport delay (s)
#define TEMP_MODEL_Ta_corr -7 // Default ambient temperature correction
#define TEMP_MODEL_W 1.2 // Default warning threshold (K/s)
#define TEMP_MODEL_E 1.74 // Default error threshold (K/s)
#define TEMP_MODEL_CAL_Th 230 // Default calibration working temperature (C)
#define TEMP_MODEL_CAL_Tl 50 // Default calibration cooling temperature (C)
#include "temp_model/e3d_v6.h"
#define TEMP_MODEL_DEFAULT E3D_V6 // Default model parameters
/*------------------------------------

View File

@ -135,10 +135,10 @@ pos_mm_t pos_2_mm(float pos){
return pos * 0.01f;
}
void xyzcal_meassure_enter(void)
void xyzcal_meassure_center(void)
{
DBG(_n("xyzcal_meassure_enter\n"));
DBG(_n("xyzcal_meassure_center\n"));
lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16
// disable heaters and stop motion before we initialize sm4
disable_heater();
st_synchronize();
@ -158,6 +158,8 @@ void xyzcal_meassure_enter(void)
void xyzcal_meassure_leave(void)
{
DBG(_n("xyzcal_meassure_leave\n"));
lcd_set_cursor(4,3);
lcd_space(16);
// resync planner position from counters (changed by xyzcal_update_pos)
planner_reset_position();
@ -569,6 +571,8 @@ void xyzcal_scan_pixels_32x32_Zhop(int16_t cx, int16_t cy, int16_t min_z, int16_
sm4_set_dir(X_AXIS, d);
//@size=242
DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep OctoPrint connection alive
lcd_set_cursor(4,3);
lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12
for (uint8_t c = 0; c < 32; c++){ ///< X axis
/// move to the next point and move Z up diagonally (if needed)
@ -1002,7 +1006,7 @@ BedSkewOffsetDetectionResultType xyzcal_scan_and_process(){
BedSkewOffsetDetectionResultType xyzcal_find_bed_induction_sensor_point_xy(void) {
// DBG(_n("xyzcal_find_bed_induction_sensor_point_xy x=%ld y=%ld z=%ld\n"), count_position[X_AXIS], count_position[Y_AXIS], count_position[Z_AXIS]);
BedSkewOffsetDetectionResultType ret = BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND;
xyzcal_meassure_enter();
xyzcal_meassure_center();
if (xyzcal_searchZ())
ret = xyzcal_scan_and_process();
xyzcal_meassure_leave();

View File

@ -5,7 +5,7 @@
#include "mesh_bed_calibration.h"
extern void xyzcal_meassure_enter(void);
extern void xyzcal_meassure_center(void);
extern void xyzcal_meassure_leave(void);

View File

@ -85,7 +85,7 @@
# 15 Feb 2019, 3d-gussner, troubleshooting and minor fixes
# 16 Feb 2019, 3d-gussner, Script can be run using arguments
# $1 = variant, example "1_75mm_MK3-EINSy10a-E3Dv6full.h" at this moment it is not possible to use ALL
# $2 = multi language OR English only [ALL/EN_ONLY]
# $2 = multi language OR English only [ALL/EN_FARM]
# $3 = development status [GOLD/RC/BETA/ALPHA/DEVEL/DEBUG]
# If one argument is wrong a list of valid one will be shown
# 13 Mar 2019, 3d-gussner, MKbel updated the Linux build environment to version 1.0.2 with an Fix maximum firmware flash size.
@ -124,7 +124,7 @@
# After compiling All multi-language variants it makes it easier to find missing or unused translations.
# 12 May 2020, DRracer , Cleanup double MK2/s MK25/s `not_tran` and `not_used` files
# 13 May 2020, leptun , If cleanup files do not exist don't try to.
# 01 Oct 2020, 3d-gussner, Bug fix if using argument EN_ONLY. Thank to @leptun for pointing out.
# 01 Oct 2020, 3d-gussner, Bug fix if using argument EN_FARM. Thank to @leptun for pointing out.
# Change Build number to script commits 'git rev-list --count HEAD PF-build.sh'
# 02 Oct 2020, 3d-gussner, Add UNKNOWN as argument option
# 05 Oct 2020, 3d-gussner, Disable pause and warnings using command line with all needed arguments
@ -268,7 +268,7 @@ echo " -d : '$(tput setaf 2)GOLD$(tput sgr0)', '$(tput setaf 2)RC$(tput sgr0)',
echo " -g : '$(tput setaf 2)0$(tput sgr0)' no '$(tput setaf 2)1$(tput sgr0)' lite '$(tput setaf 2)2$(tput sgr0)' fancy '$(tput setaf 2)3$(tput sgr0)' lite with Quad_HR '$(tput setaf 2)4$(tput sgr0)' fancy with Quad_HR"
echo " -i : '$(tput setaf 2)1.8.5$(tput sgr0)', '$(tput setaf 2)1.8.19$(tput sgr0)'"
echo " -j : '$(tput setaf 2)0$(tput sgr0)' no, '$(tput setaf 2)1$(tput sgr0)' yes"
echo " -l : '$(tput setaf 2)ALL$(tput sgr0)' for multi language or '$(tput setaf 2)EN_ONLY$(tput sgr0)' for English only"
echo " -l : '$(tput setaf 2)ALL$(tput sgr0)' for multi language or '$(tput setaf 2)EN_FARM$(tput sgr0)' for English only"
echo " -m : '$(tput setaf 2)0$(tput sgr0)' no, '$(tput setaf 2)1$(tput sgr0)' yes '$(tput setaf 2)2$(tput sgr0)' with MMU2"
echo " -n : '$(tput setaf 2)0$(tput sgr0)' no, '$(tput setaf 2)1$(tput sgr0)' yes"
echo " -o : '$(tput setaf 2)1$(tput sgr0)' force or '$(tput setaf 2)0$(tput sgr0)' block output and delays"
@ -530,19 +530,6 @@ fi
}
# End: Check python ... needed during language build
#Start: Check gawk ... needed during language build
check_gawk()
{
if ! type gawk > /dev/null; then
if [ $TARGET_OS == "linux" ]; then
echo "$(tput setaf 1)Missing 'gawk' which is important to run this script"
echo "install it with the command $(tput setaf 2)'sudo apt-get install gawk'."
#sudo apt-get update && apt-get install gawk
failures 4
fi
fi
}
#End: Check gawk ... needed during language build
#### Start: Set build environment
set_build_env_variables()
@ -551,20 +538,20 @@ BUILD_ENV="1.0.8"
BOARD="prusa_einsy_rambo"
BOARD_PACKAGE_NAME="PrusaResearch"
if [ "$ARDUINO_ENV" == "1.8.19" ]; then
BOARD_VERSION="1.0.5-2"
BOARD_VERSION="1.0.6"
else
BOARD_VERSION="1.0.4"
fi
if [ "$ARDUINO_ENV" == "1.8.19" ]; then
BOARD_URL="https://raw.githubusercontent.com/prusa3d/Arduino_Boards/devel/IDE_Board_Manager/package_prusa3d_index.json"
#BOARD_URL="https://raw.githubusercontent.com/3d-gussner/Arduino_Boards/devel/IDE_Board_Manager/package_prusa3d_index.json"
BOARD_URL="https://raw.githubusercontent.com/prusa3d/Arduino_Boards/master/IDE_Board_Manager/package_prusa3d_index.json"
#BOARD_URL="https://raw.githubusercontent.com/3d-gussner/Arduino_Boards/master/IDE_Board_Manager/package_prusa3d_index.json"
else
BOARD_URL="https://raw.githubusercontent.com/prusa3d/Arduino_Boards/master/IDE_Board_Manager/package_prusa3d_index.json"
fi
BOARD_FILENAME="prusa3dboards"
if [ "$ARDUINO_ENV" == "1.8.19" ]; then
BOARD_FILE_URL="https://raw.githubusercontent.com/prusa3d/Arduino_Boards/devel/IDE_Board_Manager/prusa3dboards-$BOARD_VERSION.tar.bz2"
#BOARD_FILE_URL="https://raw.githubusercontent.com/3d-gussner/Arduino_Boards/devel/IDE_Board_Manager/prusa3dboards-$BOARD_VERSION.tar.bz2"
BOARD_FILE_URL="https://raw.githubusercontent.com/prusa3d/Arduino_Boards/master/IDE_Board_Manager/prusa3dboards-$BOARD_VERSION.tar.bz2"
#BOARD_FILE_URL="https://raw.githubusercontent.com/3d-gussner/Arduino_Boards/master/IDE_Board_Manager/prusa3dboards-$BOARD_VERSION.tar.bz2"
else
BOARD_FILE_URL="https://raw.githubusercontent.com/prusa3d/Arduino_Boards/master/IDE_Board_Manager/prusa3dboards-$BOARD_VERSION.tar.bz2"
fi
@ -882,7 +869,7 @@ else
fi
fi
#'-l' argument defines if it is an English only version. Known values EN_ONLY / ALL
#'-l' argument defines if it is an English only version. Known values EN_FARM / ALL
#Check default language mode
MULTI_LANGUAGE_CHECK=$(grep --max-count=1 "^#define LANG_MODE *" $SCRIPT_PATH/Firmware/config.h|sed -e's/ */ /g'|cut -d ' ' -f3)
@ -897,7 +884,7 @@ if [ -z "$language_flag" ] ; then
break
;;
"English only")
LANGUAGES="EN_ONLY"
LANGUAGES="EN_FARM"
break
;;
*)
@ -906,11 +893,11 @@ if [ -z "$language_flag" ] ; then
esac
done
else
if [[ "$language_flag" == "ALL" || "$language_flag" == "EN_ONLY" ]] ; then
if [[ "$language_flag" == "ALL" || "$language_flag" == "EN_FARM" ]] ; then
LANGUAGES=$language_flag
else
echo "$(tput setaf 1)Language argument is wrong!$(tput sgr0)"
echo "Only $(tput setaf 2)'ALL'$(tput sgr0) or $(tput setaf 2)'EN_ONLY'$(tput sgr0) are allowed as language '-l' argument!"
echo "Only $(tput setaf 2)'ALL'$(tput sgr0) or $(tput setaf 2)'EN_FARM'$(tput sgr0) are allowed as language '-l' argument!"
failures 5
fi
fi
@ -1110,9 +1097,9 @@ prepare_hex_folders()
if [ $OUTPUT == "1" ] ; then
read -t 10 -p "Press Enter to continue..."
fi
elif [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_ONLY.hex" && "$LANGUAGES" == "EN_ONLY" ]]; then
elif [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_FARM.hex" && "$LANGUAGES" == "EN_FARM" ]]; then
echo ""
ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_ONLY.hex | xargs -n1 basename
ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_FARM.hex | xargs -n1 basename
echo "$(tput setaf 6)This hex file to be compiled already exists! To cancel this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
if [ $OUTPUT == "1" ] ; then
read -t 10 -p "Press Enter to continue..."
@ -1171,7 +1158,7 @@ prepare_variant_for_compiling()
sed -i -- 's/#define FW_REPOSITORY "Unknown"/#define FW_REPOSITORY "Prusa3d"/g' $SCRIPT_PATH/Firmware/Configuration.h
#Prepare English only or multi-language version to be build
if [ $LANGUAGES == "EN_ONLY" ]; then
if [ $LANGUAGES == "EN_FARM" ]; then
echo " "
echo "English only language firmware will be built"
sed -i -- "s/^#define LANG_MODE *1/#define LANG_MODE 0/g" $SCRIPT_PATH/Firmware/config.h
@ -1379,17 +1366,17 @@ create_multi_firmware()
}
#### End: Create and save Multi Language Prusa Firmware
#### Start: Save EN_ONLY language Prusa Firmware
#### Start: Save EN_FARM language Prusa Firmware
save_en_firmware()
{
#else
echo "$(tput setaf 2)Copying English only firmware to PF-build-hex folder$(tput sgr 0)"
cp -f $BUILD_PATH/Firmware.ino.hex $SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_ONLY.hex || failures 12
cp -f $BUILD_PATH/Firmware.ino.hex $SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_FARM.hex || failures 12
echo "$(tput setaf 2)Copying English only elf file to PF-build-hex folder$(tput sgr 0)"
cp -f $BUILD_PATH/Firmware.ino.elf $SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_ONLY.elf || failures 12
cp -f $BUILD_PATH/Firmware.ino.elf $SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_FARM.elf || failures 12
#fi
}
#### End: Save EN_ONLY language Prusa Firmware
#### End: Save EN_FARM language Prusa Firmware
#### Start: Cleanup Firmware
cleanup_firmware()
@ -1562,7 +1549,7 @@ if [[ ! -z "$mk404_flag" && "$variant_flag" != "All " ]]; then
#cd ../MK404/master/build
#Decide which hex file to use EN_ONLY or Multi language
#Decide which hex file to use EN_FARM or Multi language
if [ "$LANGUAGES" == "ALL" ]; then
if [[ "$MK404_PRINTER" == "MK3" || "$MK404_PRINTER" == "MK3S" ]]; then
MK404_firmware_file=$SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME.hex
@ -1575,7 +1562,7 @@ if [[ ! -z "$mk404_flag" && "$variant_flag" != "All " ]]; then
done
fi
else
MK404_firmware_file=$SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_ONLY.hex
MK404_firmware_file=$SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-EN_FARM.hex
fi
# Start MK404
@ -1601,7 +1588,6 @@ check_OS
check_wget
check_zip
check_python
check_gawk
#### Check for options/flags
echo "Check for options"

View File

@ -32,7 +32,7 @@ if [ ! -f "$SCRIPT_PATH/Firmware/Configuration_prusa.h" ]; then
cp $SCRIPT_PATH/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h $SCRIPT_PATH/Firmware/Configuration_prusa.h || exit 8
fi
if [[ ! -z $LANGUAGES && $LANGUAGES == "EN_ONLY" ]]; then
if [[ ! -z $LANGUAGES && $LANGUAGES == "EN_FARM" ]]; then
echo "English only language firmware will be built"
sed -i -- "s/^#define LANG_MODE *1/#define LANG_MODE 0/g" $SCRIPT_PATH/Firmware/config.h
else

View File

@ -43,7 +43,7 @@
- [X] **Maintained** since January 2022
- **Norwegian / Norsk**
- Maintainers: **@pkg2000**
- Maintainers: **@OS-kar** and **@pkg2000**
- Co-maintainers: **@trondkla**
- Contributors:
- [X] **Active** since May 2022

View File

@ -1,10 +1,9 @@
# Mapping from LCD source encoding to unicode characters
CUSTOM_CHARS = {
'\x04': '🔃',
'\xe4': 'µ',
'\xdf': '°',
'\xe1': 'ä',
'\xe4': 'μ',
'\xe4': 'µ', #on keyboard AltGr+m it is \xC2\xB5
'\xef': 'ö',
'\xf5': 'ü',
}
@ -13,15 +12,118 @@ CUSTOM_CHARS = {
# This transformation is applied to the translation prior to being converted to the final encoding,
# and maps UTF8 to UTF8. It replaces unavailable symbols in the translation to a close
# representation in the source encoding.
# sources
# https://en.wikipedia.org/wiki/Czech_orthography
# https://en.wikipedia.org/wiki/German_orthography
# https://en.wikipedia.org/wiki/French_orthography
# https://en.wikipedia.org/wiki/Spanish_orthography
# https://en.wikipedia.org/wiki/Italian_orthography
# https://en.wikipedia.org/wiki/Polish_alphabet
# https://en.wikipedia.org/wiki/Dutch_orthography
# https://en.wikipedia.org/wiki/Romanian_alphabet
# https://en.wikipedia.org/wiki/Hungarian_alphabet
# https://en.wikipedia.org/wiki/Gaj%27s_Latin_alphabet
# https://en.wikipedia.org/wiki/Slovak_orthography
# https://en.wikipedia.org/wiki/Swedish_alphabet
# https://en.wikipedia.org/wiki/Norwegian_orthography
TRANS_CHARS = {
'Ä': 'ä',
'Å': 'A',
'Ö': 'ö',
'Ü': 'ü',
'å': 'a',
'æ': 'ä',
'ø': 'ö',
'ß': 'ss',
'á': 'a', #cz,fr,es,hu,sk
'Á': 'A', #cz,fr,hu,sk
'à': 'a', #fr,it
'À': 'A', #fr,it
'â': 'a', #fr,ro
'Â': 'A', #ro
'Ä': 'ä', #de,sv,no,sk
'å': 'a', #sv,no
'Å': 'A', #sv,no
'æ': 'ä', #sv,no
'ą': 'a', #pl
'Ą': 'A', #pl
'ă': 'a', #ro
'Ă': 'A', #ro
'ć': 'c', #pl,hr
'Ć': 'C', #pl,hr
'ç': 'c', #fr,nl
'č': 'c', #cz,hr,sk
'Č': 'C', #cz,hr,sk
'ď': 'd', #cz,sk
'Ď': 'D', #cz,sk
'đ': 'd', #hr
'Đ': 'D', #hr
'é': 'e', #cz,fr,es,it,nl,hu,sk
'É': 'E', #cz,fr,it,hu,sk
'è': 'e', #fr,it,nl
'È': 'E', #fr,it
'ê': 'e', #fr,nl
'ě': 'e', #cz
'ë': 'e', #fr
'Ě': 'E', #cz
'ę': 'e', #pl
'Ę': 'E', #pl
'í': 'i', #cz,es,it,sk
'Í': 'I', #cz,it,sk
'î': 'i', #fr,ro
'Î': 'I', #ro
'ĺ': 'l', #sk
'Ĺ': 'L', #sk
'ł': 'l', #pl
'Ł': 'L', #pl
'ľ': 'l', #sk
'Ľ': 'L', #sk
'ń': 'n', #pl
'Ń': 'N', #pl
'ň': 'n', #cz,sk
'Ň': 'N', #cz,sk
'ñ': 'n', #es,nl
'ó': 'o', #cz,es,pl,hu,sk
'Ó': 'O', #cz,pl,hu,sk
'ò': 'o', #it
'Ò': 'O', #it
'ô': 'o', #fr,nl,sk
'Ô': 'O', #sk
'œ': 'o', #fr
'ø': 'ö', #sv,no
'Ø': 'ö', #sv,no
'Ö': 'ö', #de,sv,no,hu
'ő': 'o', #hu
'Ő': 'O', #hu
'ŕ': 'r', #sk
'Ŕ': 'R', #sk
'ř': 'r', #cz
'Ř': 'R', #cz
'ś': 's', #pl
'Ś': 's', #pl
'š': 's', #cz,hr,sk
'Š': 'S', #cz,hr,sk
'ș': 's', #ro
'Ș': 'S', #ro
'ß': 'ss',#de
'ť': 't', #cz,sk
'Ť': 'T', #cz,sk
'ț': 't', #ro
'Ț': 'T', #ro
'ú': 'u', #cz,es,hu,sk
'Ú': 'U', #cz,hu,sk
'ù': 'u', #it
'Ù': 'U', #it
'û': 'u', #fr
'Ü': 'ü', #de,hu
'ů': 'u', #cz
'Ů': 'U', #cz
'ű': 'u', #hu
'Ű': 'U', #hu
'ý': 'y', #cz,sk
'Ý': 'Y', #cz,sk
'ÿ': 'y', #fr
'ź': 'z', #pl
'Ź': 'Z', #pl
'ž': 'z', #cz,hr,sk
'Ž': 'z', #cz,hr,sk
'ż': 'z', #pl
'Ż': 'Z', #pl
'¿': '', #es
'¡': '', #es
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff