My plan is to re-use this function in M79
in a later commit. The firmware doesn't
have a dedicated parser like Marlin 2.1
so this is my attempt to not duplicate the parsing of a quoted string in G-codes
Change in memory (MK3S+ Multilang):
Flash: -50 bytes
SRAM: 0 bytes
On my end, the default length for the abbreviated commit hash is 9 characters.
This won't fit into uint32_t (4 bytes).
Instead change FW_COMMIT_HASH into a string
and create preprocessor symbol for the string length
such that it's known at compile time.
If the string should be longer or shorter
then only FW_COMMIT_HASH_LENGTH needs to be configured on the CMake side
Drop the ALPHA/BETA/custom version handling. Set the version string and
firmware date based on the current tree description which has all the
required details.
Allow to override the repository information via cmake.
Use a truncated commit hash to set the internal commit number for
compatibility.
Rebase and fix issues
Fixed printer_smodel_check for non MMU machines
Commit 136ef96 broke the compatibility check for MK3S without MMU.
May have fixed bug for older MMU machines.
Only comparing up to the length of the value from the g-code, would return equal on older MMU machines trying to run g-code sliced without the MMU.
Unfortunately if that is a feature, it will cause the different printer warning.
Initialise EEPROM_CHECK_MODE always
But if farm mode is detected, update the Check mode to Strict
Initialise EEPROM_NOZZLE_DIAMETER on farm mode.
When opening the menus this value is set automatically to
_Diameter_400 anyway so this should be fine.
No change in memory on Multilang build
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.
- 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
- 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).
printer_smodel_check was incorrectly substituting the final " with a
null in the command to simplify the model string comparison, but in
doing so was also corrupting the next pop from the cmdqueue.
We can modify the current strchr_pointer as long as we *don't* change
it's length. This can cause an incorrect extra read from the queue,
resulting in the last command to be completely ignored.
In PR #3093 the progmem array FW_VERSION_NR was introduced to store the
version components, however the code didn't read it properly using the
pgm_read_* functions, making version comparisons fail.
Fix the existing/unused is_provided_version_newer() and reuse it in
show_upgrade_dialog_if_version_newer().
Similarly also read/update correctly the version in the eeprom.