Skip to content

Commit

Permalink
Merge pull request #18 from lvlhead/fmradio
Browse files Browse the repository at this point in the history
Feature and improvement
  • Loading branch information
prokrypt authored Jul 26, 2024
2 parents 94a591d + 00713f1 commit 0b6cf2a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
7 changes: 6 additions & 1 deletion app/chFrScanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ void CHFRSCANNER_Stop(void)
dualscan=1;

RADIO_SetupRegisters(true);
gBoldBothVFO = false;
gUpdateDisplay = true;
}

Expand Down Expand Up @@ -261,11 +262,15 @@ static void NextMemChannel(void)
case SCAN_NEXT_CHAN_DUAL_WATCH:
// dual watch is enabled - include the other VFO in the scan
if (dwchan && !gMonitor){
if (dualscan%2==0)
gBoldBothVFO = false;
if (++dualscan%4==0) {
dualscan=0;
currentScanList = SCAN_NEXT_CHAN_DUAL_WATCH;
if (!gMR_ChannelExclude[dwchan-1])
if (!gMR_ChannelExclude[dwchan-1]) {
gNextMrChannel = dwchan-1;
gBoldBothVFO = true;
}
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/chFrScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ void CHFRSCANNER_ContinueScanning(void);
extern uint32_t lastFoundFrqOrChanOld;
#endif

#endif
#endif
2 changes: 1 addition & 1 deletion frequencies.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ uint32_t FREQUENCY_RoundToStep(uint32_t freq, uint16_t step)
if(step == 833) {
uint32_t base = freq/2500*2500;
int chno = (freq - base) / 700; // convert entered aviation 8.33Khz channel number scheme to actual frequency.
return base + (chno * 833) + (chno == 3);
return base + (chno * step) + (chno == 3);
}

if(step == 1)
Expand Down
1 change: 1 addition & 0 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ uint8_t gIsLocked = 0xFF;
#ifdef ENABLE_FEAT_F4HWN
bool gK5startup = true;
bool gBackLight = false;
bool gBoldBothVFO = false;
uint8_t gBacklightTimeOriginal;
uint8_t gBacklightBrightnessOld;
uint8_t gPttOnePushCounter = 0;
Expand Down
1 change: 1 addition & 0 deletions misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ extern volatile uint8_t boot_counter_10ms;
#ifdef ENABLE_FEAT_F4HWN
extern bool gK5startup;
extern bool gBackLight;
extern bool gBoldBothVFO;
extern uint8_t gBacklightTimeOriginal;
extern uint8_t gBacklightBrightnessOld;
extern uint8_t gPttOnePushCounter;
Expand Down
6 changes: 3 additions & 3 deletions ui/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ void UI_DrawPixelBuffer(uint8_t (*buffer)[128], uint8_t x, uint8_t y, bool black
static void sort(int16_t *a, int16_t *b)
{
if(*a > *b) {
int16_t t = *a;
*a = *b;
*b = t;
*a ^= *b;
*b ^= *a;
*a ^= *b;
}
}

Expand Down
2 changes: 1 addition & 1 deletion ui/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ void UI_DisplayMain(void)
}
else
{
if(activeTxVFO == vfo_num) {
if((activeTxVFO == vfo_num) || gBoldBothVFO) {
UI_PrintStringSmallBold(String, 32 + 4, 0, line);
}
else
Expand Down

0 comments on commit 0b6cf2a

Please sign in to comment.