Skip to content

Spectrum Analyzer: hold last peak, persist settings; Freq Analyzer [Ext]: radio parked-state fix - #235

Merged
mishamyte merged 4 commits into
devfrom
spectrum-analyzer-99-100
Jul 23, 2026
Merged

Spectrum Analyzer: hold last peak, persist settings; Freq Analyzer [Ext]: radio parked-state fix#235
mishamyte merged 4 commits into
devfrom
spectrum-analyzer-99-100

Conversation

@mishamyte

Copy link
Copy Markdown
Collaborator

Spectrum Analyzer (v1.5)

Closes #100 - the peak label vanished with the next sweep (~0.5 s), making short bursts impossible to read:

  • The last detected peak is now latched and stays on screen until a new peak replaces it: Peak: while the signal is live, Last: once it is gone
  • The peak frequency is captured in the worker at measurement time and passed through the callback, so a retune mid-sweep cannot latch a mislabeled frequency (the label survives retunes/zoom by design - it stores the absolute frequency in Hz)
  • The label is suppressed while the 1 s Mode/Modulation overlay occupies the top-right corner (they used to overlap)

Closes #99 (stage 1) - nothing was persisted across launches:

  • Center frequency, spectrum width, modulation and vertical scale are saved on exit via saved_struct to the app data folder and restored on launch, with all-or-nothing range validation (the modulation bound doubles as memory safety - it indexes a 2-element preset array in the worker)
  • Restored modulation is now actually pushed to the worker at startup (previously only applied when toggled)
  • Stage 2 of Spectrum Analyzer [save current state] #99 (multiple named presets) is left for a follow-up - it needs menu UI in what is currently a raw ViewPort app

Reviewed by the pr-review-toolkit agents (code / comments / silent-failures); all findings addressed. Built and flashed on hardware: Target 7, API 88.0.

Freq Analyzer [Ext]

Port of DarkFlippers/unleashed-firmware#1045: the worker parked the active radio (internal or external CC1101) with its custom near-field AGC/BW registers retained through SPWD sleep and the internal RF switch isolated - the same "sticky sensitivity loss" mechanism fixed in firmware. The worker now resets the radio and re-parks the RF path on exit, leaving the chip in its boot state.

Note: this app is not buildable under the standalone ufbt SDK (it depends on firmware-internal headers - pre-existing, verified against the pristine tree); the touched functions are all already used in the same file.

🤖 Generated with Claude Code

mishamyte and others added 3 commits July 23, 2026 18:49
- Keep the last detected peak label on screen (prefixed "Last:" once the
  signal is gone) until a new peak replaces it, so short bursts can be
  read after the fact (#100)
- Save frequency, spectrum width, modulation and vscroll on exit and
  restore them on the next launch, with range validation on load (#99)
- Apply restored modulation to the worker on startup
- Bump fap_version to 1.5

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Latch the peak frequency measured by the worker at sweep time and pass
  it through the callback, so a retune during a sweep cannot latch a
  mislabeled "Last:" frequency
- Log a warning when out-of-range saved settings are discarded
- Document the long-press OK modulation toggle in the README and clarify
  when the "Last:" prefix appears
- Fix stale/imprecise comments from the previous commit

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Port of DarkFlippers/unleashed-firmware#1045: the worker parked the
active radio (internal or external CC1101) with its custom near-field
AGC/BW registers retained through SPWD sleep, and the internal RF
switch left isolated. Reset the radio and re-park the RF path on exit
so the chip is left in the same state as after boot.

Note: this app is not buildable under the standalone ufbt SDK (it
depends on firmware-internal headers); verified the failure predates
this change against the pristine tree. The touched functions are all
already used in this file, so no new API surface is introduced.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added pack/base App bundled in base_pack pack/non-catalog App in non_catalog_apps category/sub-ghz App category: sub-ghz labels Jul 23, 2026
@mishamyte mishamyte removed the pack/non-catalog App in non_catalog_apps label Jul 23, 2026
@mishamyte mishamyte added this to the unlshd-090 milestone Jul 23, 2026
@mishamyte mishamyte added the pack/non-catalog App in non_catalog_apps label Jul 23, 2026
Backfilled from git history following the repo convention (see
tetris_game, calculator). Freq Analyzer [Ext] never had a fap_version;
set it to 1.2, retroactively labeling the 2FSK preset support as 1.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mishamyte
mishamyte merged commit 619c27b into dev Jul 23, 2026
2 checks passed
@mishamyte
mishamyte deleted the spectrum-analyzer-99-100 branch July 23, 2026 16:45
Repository owner locked as resolved and limited conversation to collaborators Jul 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

category/sub-ghz App category: sub-ghz pack/base App bundled in base_pack pack/non-catalog App in non_catalog_apps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spectrum Analyzer [last frequency lock freeze] Spectrum Analyzer [save current state]

1 participant