mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Launch Broadcast FM overlay from FM action
This commit is contained in:
1 parent
bd049c0467
commit
4c3847ef34
3 files changed
+21
-7
No files matched your search
+5
-7
@@ -28,6 +28,9 @@
|
||||
#ifdef ENABLE_FMRADIO
|
||||
#include "app/fm.h"
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_OVERLAY_APPS
|
||||
#include "apps/app_overlay.h"
|
||||
#endif
|
||||
#include "app/scanner.h"
|
||||
#include "audio.h"
|
||||
#ifdef ENABLE_FMRADIO
|
||||
@@ -468,13 +471,8 @@ void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
void ACTION_FM(void)
|
||||
{
|
||||
#ifdef ENABLE_FEAT_F4HWN_OVERLAY_APPS
|
||||
/* Overlay apps replace the resident FM screen with the FM overlay app, so
|
||||
this launcher is inert. Every external entry point - the assignable
|
||||
side-key, the F+0 key, the boot-state resume - funnels through here, and
|
||||
gFmRadioMode is only ever set from inside this function, so returning
|
||||
early keeps the resident screen from ever opening. fm.c still links
|
||||
against ACTION_FM; its own EXIT-path calls are unreachable because the
|
||||
resident screen never opens. */
|
||||
if (APP_LaunchOverlayByName("Broadcast FM") != APP_OK)
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
#else
|
||||
if (gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_MONITOR)
|
||||
|
||||
@@ -633,6 +633,19 @@ uint8_t APP_ValidateSlot(uint8_t slot, app_header_t *out_header)
|
||||
return APP_OK;
|
||||
}
|
||||
|
||||
uint8_t APP_LaunchOverlayByName(const char *name)
|
||||
{
|
||||
app_header_t h;
|
||||
|
||||
for (uint8_t slot = 0; slot < APP_SLOT_COUNT; slot++) {
|
||||
if (APP_ValidateSlot(slot, &h) == APP_OK &&
|
||||
strncmp(h.name, name, APP_NAME_LEN) == 0)
|
||||
return APP_LaunchOverlay(slot);
|
||||
}
|
||||
|
||||
return APP_ERR_MAGIC;
|
||||
}
|
||||
|
||||
uint8_t APP_SlotInfo(uint8_t slot, app_header_t *out_header)
|
||||
{
|
||||
if (slot >= APP_SLOT_COUNT)
|
||||
|
||||
@@ -103,6 +103,9 @@ uint8_t APP_ValidateSlot(uint8_t slot, app_header_t *out_header);
|
||||
* Returns when the app exits; the internal flash is never touched. */
|
||||
uint8_t APP_LaunchOverlay(uint8_t slot);
|
||||
|
||||
/* Find the first valid app with this exact header name and launch it. */
|
||||
uint8_t APP_LaunchOverlayByName(const char *name);
|
||||
|
||||
/* Host-tool slot management (external flash only, never brick-critical). */
|
||||
uint8_t APP_SlotInfo(uint8_t slot, app_header_t *out_header);
|
||||
uint8_t APP_SlotErase(uint8_t slot);
|
||||
|
||||
Reference in new issue
Block a user