Features: - VFO mode with direct frequency input - POCSAG decoder (512/1200 baud) with BCH(31,21) correction - Full-screen Spectrum analyzer - FM Radio receiver - RSSI signal indicator overlay - Custom boot splash (UA1ZBE / POCSAG pager / build date) Architecture: - app/mode.c — mode dispatcher (VFO/POCSAG/Spectrum/FM) - app/boot_splash.c — 2-second boot splash - app/pocsag/ — POCSAG decoder + BCH correction - app/display_rssi.c — RSSI indicator - main.c — entry point with custom init - syscalls.c — bare-metal _sbrk stub Build: arm-none-eabi-gcc -Os -flto -Wall -Werror -Wextra Size: 57.9KB Flash / 3.6KB RAM Controls: - 0-9: Direct frequency input (VFO) - SK2: POCSAG mode - SK1: Spectrum analyzer - 0: FM Radio - EXIT: Return to VFO - F/*: Toggle 512/1200 baud (in POCSAG)
77 lines
2.1 KiB
C
77 lines
2.1 KiB
C
#include "app/chFrScanner.h"
|
|
#include "audio.h"
|
|
#include "functions.h"
|
|
#include "misc.h"
|
|
#include "settings.h"
|
|
#include "ui/ui.h"
|
|
|
|
void COMMON_KeypadLockToggle()
|
|
{
|
|
|
|
if (gScreenToDisplay != DISPLAY_MENU &&
|
|
gCurrentFunction != FUNCTION_TRANSMIT)
|
|
{ // toggle the keyboad lock
|
|
|
|
#ifdef ENABLE_VOICE
|
|
gAnotherVoiceID = gEeprom.KEY_LOCK ? VOICE_ID_UNLOCK : VOICE_ID_LOCK;
|
|
#endif
|
|
|
|
gEeprom.KEY_LOCK = !gEeprom.KEY_LOCK;
|
|
|
|
gRequestSaveSettings = true;
|
|
}
|
|
}
|
|
|
|
void COMMON_SwitchVFOs()
|
|
{
|
|
#ifdef ENABLE_SCAN_RANGES
|
|
gScanRangeStart = 0;
|
|
#endif
|
|
gEeprom.TX_VFO ^= 1;
|
|
|
|
if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF)
|
|
gEeprom.CROSS_BAND_RX_TX = gEeprom.TX_VFO + 1;
|
|
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
|
|
gEeprom.DUAL_WATCH = gEeprom.TX_VFO + 1;
|
|
|
|
gRequestSaveSettings = 1;
|
|
gFlagReconfigureVfos = true;
|
|
gScheduleDualWatch = true;
|
|
|
|
gRequestDisplayScreen = DISPLAY_MAIN;
|
|
}
|
|
|
|
void COMMON_SwitchVFOMode()
|
|
{
|
|
#ifdef ENABLE_NOAA
|
|
if (gEeprom.VFO_OPEN && !IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
|
#else
|
|
if (gEeprom.VFO_OPEN)
|
|
#endif
|
|
{
|
|
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
|
{ // swap to frequency mode
|
|
gEeprom.ScreenChannel[gEeprom.TX_VFO] = gEeprom.FreqChannel[gEeprom.TX_VFO];
|
|
#ifdef ENABLE_VOICE
|
|
gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE;
|
|
#endif
|
|
gRequestSaveVFO = true;
|
|
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
|
return;
|
|
}
|
|
|
|
uint8_t Channel = RADIO_FindNextChannel(gEeprom.MrChannel[gEeprom.TX_VFO], 1, false, 0);
|
|
if (Channel != 0xFF)
|
|
{ // swap to channel mode
|
|
gEeprom.ScreenChannel[gEeprom.TX_VFO] = Channel;
|
|
#ifdef ENABLE_VOICE
|
|
AUDIO_SetVoiceID(0, VOICE_ID_CHANNEL_MODE);
|
|
AUDIO_SetDigitVoice(1, Channel + 1);
|
|
gAnotherVoiceID = (VOICE_ID_t)0xFE;
|
|
#endif
|
|
gRequestSaveVFO = true;
|
|
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
|
return;
|
|
}
|
|
}
|
|
} |