feat: add tip profiles system with flash storage and menu UI#157
Merged
Conversation
- Add pluggable StorageDriver abstraction (flash backend, build-time selection) - Add dedicated PROFILES/SETTINGS flash sections in linker script (2 KB each) - Add TipProfile CRUD with per-handle active profile tracking - Add profiles menu UI: list, editor, name editor, quick-select popup - Refactor settings menu: MI_ enum with step-100 ranges, remove flash.c/h - Move calibration and power limits into per-profile settings - Add PROFILES.md documentation with screenshots Fixes applied: - Fix off-by-one in flash page erase calculation (could corrupt adjacent page) - Protect CRC peripheral access with __disable_irq in flash_read/flash_verify - Use slot_to_handle() reverse mapping in tip_profiles_delete (decouple from enum order) - Add bounds check in tip_profiles_set_active - Add SW_2 cancel to profiles_popup (was an infinite loop with no exit) - Guard enc_sel against max_items == 0 - Use designated initializers for handle_str[] (safe against enum reorder) - Show kp/ki/kd with one decimal place in profile editor - Replace compound literal with shared identity_cal[] - Fix linker PROFILES/SETTINGS sections: (rx) → (rw)
- storage_flash: add erase.Banks = FLASH_BANK_1 to prevent undefined erase behavior on STM32G4 - storage_flash: protect CRC calculation in flash_write with __disable_irq/__enable_irq to match flash_read/flash_verify - menu_profiles: disable heater (requested_power = 0) while popup blocks the main loop to prevent uncontrolled heating - menu_profiles: add 5-second timeout to profiles_popup to prevent indefinite main loop blockage; resets on user interaction - menu_profiles: skip redundant flash write in single-match popup when the profile is already active - menu_profiles: only save profile on Back if actually modified (memcmp check) to reduce flash wear - menu_settings: mark deprecated calibration and power limit entries in mi_table and enum with explanatory comments - menu_settings: document count==0 sentinel for profiles group delegation
- Move MI_PROFILE_ON_TIP_CHG into the Mode group so the toggle is reachable in Settings (the Profiles group delegates to profiles_menu and never rendered the item). - Suppress the profile popup during boot by gating it on startup_done, so the filter warm-up loop can't trigger a popup with an uninitialized attached_handle. - Show the popup even when only one profile matches the handle, and pre-select the currently active profile for that handle. - Repaint the main screen after the popup closes to clear overlay residue.
Owner
|
It works pretty good.
|
…e for profile name
Contributor
Author
Yes, the idea is that you can select a profile only for a compatible handle.
Fixed this, now default profiles cannot be deleted.
Fixed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ATTENTION, NOT YET TESTED!
Summary
Key implementation details
Test plan
AxxSolder.zip