Repository navigation
Add a custom-size option for unrecognized infrared tags - #62
Merged
Merged
Conversation
A tag whose type code is not in the profile table gets a zeroed profile: kind Unknown, 0x0, Mono. NFC scan, targets.txt and web_job.txt (and the unreachable phone-sync code) all create such targets, and because only Segment was excluded they were offered Set Text, Set Image and WiFi Plugins. Set Text on a 0x0 job reaches malloc(0), which the firmware treats as a fatal error. - Offer Set Text, Set Image and WiFi Plugins only for dot-matrix profiles found in the table; the app has no display size for others. - Show Tag Info says the type is not in the profile table and which actions are hidden, instead of reporting "Size: 0x0" and "Color: Mono". - Refuse a 0x0 text job before either sized text path allocates. - Manual barcode entry with all 16 slots used now shows "Target List Full". It used to open Target Actions with selected_target -1, where Show Tag Info and LED Test index targets[-1]. - Widget buttons call back on press, short press and release, so the Back button went back twice. Act on the short press only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A tag whose type code is not in the profile table has no dimensions, so after the unknown-profile guard its Set Text / Set Image / WiFi Plugins actions are hidden. This adds a "Set Custom Size" action for those tags: enter width, height and colour, and the graphics actions become usable. The IR framing is identical to a table profile; only the screen geometry differs, so no protocol is guessed. Custom size is applied only when the barcode's type is not in the table, so a real profile is never overridden. - New scene (VariableItemList): Width and Height in 8 px steps from 8 to 800, Colour mono/red/yellow, and Save. - tagtinker_target_refresh_profile() synthesizes a "Custom" profile from the stored size for unknown-type targets, so Show Tag Info, Set Text and Set Image all see real dimensions. - targets.txt gains three optional fields (barcode|name|cw|ch|ccolor); older two-field lines still load, with no custom size. - "Set Custom Size" appears in Target Actions only for unknown-type targets (tagtinker_type_is_known()). Builds clean on release SDK 1.4.3 (API 87.1) and dev SDK; no new clang-format drift. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
A tag whose type code is not in the profile table has no dimensions, so after the unknown-profile guard in #57 its Set Text, Set Image and WiFi Plugins actions are hidden. That is correct (a 0x0 job cannot be sent) but it leaves owners of unlisted infrared tags with nothing to do.
This adds a Set Custom Size action for exactly those targets: enter width, height and colour, and the graphics actions become usable. The IR framing is identical to a table profile; only the screen geometry differs, so no protocol is guessed and nothing new is transmitted.
VariableItemList): Width and Height in 8 px steps from 8 to 800, Colour mono/red/yellow, and Save.tagtinker_target_refresh_profile()synthesizes a "Custom" profile from the stored size, so Show Tag Info, Set Text and Set Image all see real dimensions.targets.txtgains three optional fields (barcode|name|cw|ch|ccolor). Older two-field lines still load, with no custom size.tagtinker_type_is_known()helper.Based on #57, which adds the guard this complements. Merge that one first.
Verification
Builds with zero warnings against release SDK 1.4.3 (API 87.1) and dev SDK 7f0b6e1c (API 88.2). No new clang-format drift.
Host tests (gcc, AddressSanitizer + UndefinedBehaviorSanitizer) against the real
protocol/tagtinker_proto.c, 13 checks covering:tagtinker_type_is_known()for listed and unlisted codes; legacy two-field lines; five-field lines; a missing trailing colour field; an empty name; the serialize/parse round trip; and the safety property that a known type keeps its table size (208x112) rather than the custom one.Tested on hardware (Flipper Zero, Momentum mntm-012, API 87.1), driven over the CLI:
…|40|32|1totargets.txt, matching the 8 px step size exactly.…|48|32|1.🤖 Generated with Claude Code