Skip to content

Commit

Permalink
Merge pull request #64 from kamilsss655/fm-radio
Browse files Browse the repository at this point in the history
Fm radio
  • Loading branch information
kamilsss655 authored Jan 12, 2024
2 parents 19b53ad + 811677f commit 60d0427
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 755 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENABLE_LTO := 1
# ---- STOCK QUANSHENG FERATURES ----
ENABLE_UART := 1
ENABLE_AIRCOPY := 0
ENABLE_FMRADIO := 0
ENABLE_FMRADIO := 1
ENABLE_NOAA := 0
ENABLE_VOICE := 0
ENABLE_VOX := 1
Expand Down
26 changes: 1 addition & 25 deletions app/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,34 +128,10 @@ void ACTION_Scan(bool bRestart)

if (gFM_ScanState != FM_SCAN_OFF)
{
FM_PlayAndUpdate();
FM_Start();

#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
#endif
}
else
{
uint16_t Frequency;

if (bRestart)
{
gFM_AutoScan = true;
gFM_ChannelPosition = 0;
FM_EraseChannels();
Frequency = gEeprom.FM_LowerLimit;
}
else
{
gFM_AutoScan = false;
gFM_ChannelPosition = 0;
Frequency = gEeprom.FM_FrequencyPlaying;
}

BK1080_GetFrequencyDeviation(Frequency);
FM_Tune(Frequency, 1, bRestart);
#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_SCANNING_BEGIN;
#endif
}
}
Expand Down
21 changes: 1 addition & 20 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ void APP_Update(void)
gCurrentFunction != FUNCTION_RECEIVE &&
gCurrentFunction != FUNCTION_TRANSMIT)
{ // switch to FM radio mode
FM_Play();
FM_Start();
gScheduleFM = false;
}
#endif
Expand Down Expand Up @@ -1674,14 +1674,6 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gFlagSaveSettings = false;
}

#ifdef ENABLE_FMRADIO
if (gFlagSaveFM)
{
SETTINGS_SaveFM();
gFlagSaveFM = false;
}
#endif

if (gFlagSaveChannel)
{
SETTINGS_SaveChannel(gTxVfo->CHANNEL_SAVE, gEeprom.TX_VFO, gTxVfo, gFlagSaveChannel);
Expand Down Expand Up @@ -1986,17 +1978,6 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gUpdateStatus = true;
}

#ifdef ENABLE_FMRADIO
if (gRequestSaveFM)
{
if (!bKeyHeld)
SETTINGS_SaveFM();
else
gFlagSaveFM = true;
gRequestSaveFM = false;
}
#endif

if (gRequestSaveVFO)
{
if (!bKeyHeld)
Expand Down
Loading

0 comments on commit 60d0427

Please sign in to comment.