0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

RX can now be set from 18MHz to 1300MHz, though TX is still restricted.

This commit is contained in:
OneOfEleven 2023-09-12 19:53:54 +01:00
parent f436a84bd5
commit b93aa24c40
19 changed files with 183 additions and 107 deletions

View File

@ -100,6 +100,7 @@ CFLAGS += -DDISABLE_AIRCOPY
CFLAGS += -DDISABLE_ALARM CFLAGS += -DDISABLE_ALARM
CFLAGS += -DKEEP_MEM_NAME CFLAGS += -DKEEP_MEM_NAME
CFLAGS += -DCHAN_NAME_FREQ CFLAGS += -DCHAN_NAME_FREQ
CFLAGS += -DRX_ANY_FREQ
#CFLAGS += -DENABLE_TX_WHEN_AM #CFLAGS += -DENABLE_TX_WHEN_AM
#CFLAGS += -DSINGLE_VFO_CHAN #CFLAGS += -DSINGLE_VFO_CHAN
#CFLAGS += -DBAND_SCOPE #CFLAGS += -DBAND_SCOPE

View File

@ -18,6 +18,7 @@ You can edit those changes by (currently) editing the MakeFile, look for these l
* CFLAGS += -DDISABLE_ALARM .. remove the ALARM transmit option from the firmware * CFLAGS += -DDISABLE_ALARM .. remove the ALARM transmit option from the firmware
* CFLAGS += -DKEEP_MEM_NAME .. keep the memory channels name when re-saving a channel * CFLAGS += -DKEEP_MEM_NAME .. keep the memory channels name when re-saving a channel
* CFLAGS += -DCHAN_NAME_FREQ .. show the channel frequency (as well as channel number/name) * CFLAGS += -DCHAN_NAME_FREQ .. show the channel frequency (as well as channel number/name)
* CFLAGS += -DRX_ANY_FREQ .. allow RX on any frequency from 18MHz to 1300MHz
* #CFLAGS += -DENABLE_TX_WHEN_AM .. enable TX when radio set to AM (radio does NOT do AM, the adverts are false) * #CFLAGS += -DENABLE_TX_WHEN_AM .. enable TX when radio set to AM (radio does NOT do AM, the adverts are false)
* #CFLAGS += -DSINGLE_VFO_CHAN .. (not yet implemented) show a single VFO/CHANNEL if dual-watch/cross-band are disabled * #CFLAGS += -DSINGLE_VFO_CHAN .. (not yet implemented) show a single VFO/CHANNEL if dual-watch/cross-band are disabled
* #CFLAGS += -DBAND_SCOPE .. (not yet implemented) add a band scope/spectrum/panadapter option * #CFLAGS += -DBAND_SCOPE .. (not yet implemented) add a band scope/spectrum/panadapter option

View File

@ -440,11 +440,11 @@ void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
{ {
uint32_t Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency); uint32_t Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency);
if (Frequency > gUpperLimitFrequencyBandTable[pInfo->Band])
Frequency = gLowerLimitFrequencyBandTable[pInfo->Band];
else
if (Frequency < gLowerLimitFrequencyBandTable[pInfo->Band]) if (Frequency < gLowerLimitFrequencyBandTable[pInfo->Band])
Frequency = FREQUENCY_FloorToStep(gUpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, gLowerLimitFrequencyBandTable[pInfo->Band]); Frequency = FREQUENCY_FloorToStep(gUpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, gLowerLimitFrequencyBandTable[pInfo->Band]);
else
if (Frequency > gUpperLimitFrequencyBandTable[pInfo->Band])
Frequency = gLowerLimitFrequencyBandTable[pInfo->Band];
pInfo->ConfigRX.Frequency = Frequency; pInfo->ConfigRX.Frequency = Frequency;
} }

View File

@ -104,7 +104,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
unsigned int i; unsigned int i;
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
{ {
if (Frequency <= gUpperLimitFrequencyBandTable[i] && (gLowerLimitFrequencyBandTable[i] <= Frequency)) if (Frequency >= gLowerLimitFrequencyBandTable[i] && Frequency <= gUpperLimitFrequencyBandTable[i])
{ {
#ifndef DISABLE_VOICE #ifndef DISABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key; gAnotherVoiceID = (VOICE_ID_t)Key;
@ -129,6 +129,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
return; return;
} }
} }
} }
} }
#ifndef DISABLE_NOAA #ifndef DISABLE_NOAA

View File

@ -160,7 +160,7 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax)
case MENU_TXP: case MENU_TXP:
case MENU_SFT_D: case MENU_SFT_D:
case MENU_TDR: case MENU_TDR:
case MENU_WX: case MENU_XB:
#ifndef DISABLE_VOICE #ifndef DISABLE_VOICE
case MENU_VOICE: case MENU_VOICE:
#endif #endif
@ -419,7 +419,7 @@ void MENU_AcceptSetting(void)
gUpdateStatus = true; gUpdateStatus = true;
return; return;
case MENU_WX: case MENU_XB:
#ifndef DISABLE_NOAA #ifndef DISABLE_NOAA
if (IS_NOAA_CHANNEL(gEeprom.ScreenChannel[0])) if (IS_NOAA_CHANNEL(gEeprom.ScreenChannel[0]))
return; return;
@ -767,7 +767,7 @@ void MENU_ShowCurrentSetting(void)
gSubMenuSelection = gEeprom.DUAL_WATCH; gSubMenuSelection = gEeprom.DUAL_WATCH;
break; break;
case MENU_WX: case MENU_XB:
gSubMenuSelection = gEeprom.CROSS_BAND_RX_TX; gSubMenuSelection = gEeprom.CROSS_BAND_RX_TX;
break; break;

View File

@ -20,36 +20,38 @@
#include "dcs.h" #include "dcs.h"
#include "driver/keyboard.h" #include "driver/keyboard.h"
enum SCAN_CssState_t { enum SCAN_CssState_t
SCAN_CSS_STATE_OFF = 0U, {
SCAN_CSS_STATE_SCANNING = 1U, SCAN_CSS_STATE_OFF = 0,
SCAN_CSS_STATE_FOUND = 2U, SCAN_CSS_STATE_SCANNING,
SCAN_CSS_STATE_FAILED = 3U, SCAN_CSS_STATE_FOUND,
SCAN_CSS_STATE_FAILED
}; };
typedef enum SCAN_CssState_t SCAN_CssState_t; typedef enum SCAN_CssState_t SCAN_CssState_t;
enum { enum
SCAN_OFF = 0U, {
SCAN_OFF = 0,
}; };
extern DCS_CodeType_t gScanCssResultType; extern DCS_CodeType_t gScanCssResultType;
extern uint8_t gScanCssResultCode; extern uint8_t gScanCssResultCode;
extern bool gFlagStartScan; extern bool gFlagStartScan;
extern bool gFlagStopScan; extern bool gFlagStopScan;
extern bool gScanSingleFrequency; extern bool gScanSingleFrequency;
extern uint8_t gScannerEditState; extern uint8_t gScannerEditState;
extern uint8_t gScanChannel; extern uint8_t gScanChannel;
extern uint32_t gScanFrequency; extern uint32_t gScanFrequency;
extern bool gScanPauseMode; extern bool gScanPauseMode;
extern SCAN_CssState_t gScanCssState; extern SCAN_CssState_t gScanCssState;
extern volatile bool gScheduleScanListen; extern volatile bool gScheduleScanListen;
extern volatile uint16_t ScanPauseDelayIn10msec; extern volatile uint16_t ScanPauseDelayIn10msec;
extern uint8_t gScanProgressIndicator; extern uint8_t gScanProgressIndicator;
extern uint8_t gScanHitCount; extern uint8_t gScanHitCount;
extern bool gScanUseCssResult; extern bool gScanUseCssResult;
extern uint8_t gScanState; extern uint8_t gScanState;
extern bool bScanKeepFrequency; extern bool bScanKeepFrequency;
void SCANNER_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld); void SCANNER_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
void SCANNER_Start(void); void SCANNER_Start(void);

View File

@ -174,12 +174,14 @@ const uint8_t BITMAP_VOX[] =
0b01000000, 0b01000000,
0b00100000, 0b00100000,
0b00011111, 0b00011111,
0b00000000, 0b00000000,
0b00111110, 0b00111110,
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b00111110, 0b00111110,
0b00000000, 0b00000000,
0b01100011, 0b01100011,
0b00010100, 0b00010100,
@ -188,21 +190,42 @@ const uint8_t BITMAP_VOX[] =
0b01100011 0b01100011
}; };
const uint8_t BITMAP_WX[] = #if 0
{ const uint8_t BITMAP_WX[] =
0b00000000, {
0b01111111, 0b00000000,
0b00100000, 0b01111111,
0b00011000, 0b00100000,
0b00100000, 0b00011000,
0b01111111, 0b00100000,
0b00000000, 0b01111111,
0b01100011,
0b00010100, 0b00000000,
0b00001000, 0b01100011,
0b00010100, 0b00010100,
0b01100011 0b00001000,
}; 0b00010100,
0b01100011
};
#else
// 'XB' (cross-band)
const uint8_t BITMAP_XB[] =
{
0b00000000,
0b01100011,
0b00010100,
0b00001000,
0b00010100,
0b01100011,
0b00000000,
0b01111111,
0b01001001,
0b01001001,
0b01001001,
0b00110110
};
#endif
const uint8_t BITMAP_TDR[] = const uint8_t BITMAP_TDR[] =
{ {
@ -212,6 +235,7 @@ const uint8_t BITMAP_TDR[] =
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b00111110, 0b00111110,
0b00000000, 0b00000000,
0b01111111, 0b01111111,
0b00100000, 0b00100000,
@ -243,6 +267,7 @@ const uint8_t BITMAP_FM[] =
0b00001001, 0b00001001,
0b00001001, 0b00001001,
0b00000001, 0b00000001,
0b00000000, 0b00000000,
0b01111111, 0b01111111,
0b00000010, 0b00000010,
@ -260,6 +285,7 @@ const uint8_t BITMAP_FM[] =
0b00001000, 0b00001000,
0b00010000, 0b00010000,
0b01111111, 0b01111111,
0b00000000, 0b00000000,
0b01000110, 0b01000110,
0b01001001, 0b01001001,
@ -366,6 +392,7 @@ const uint8_t BITMAP_TX[] =
0b00000001, 0b00000001,
0b00000001, 0b00000001,
0b00000001, 0b00000001,
0b00000000, 0b00000000,
0b01100011, 0b01100011,
0b00100010, 0b00100010,
@ -386,6 +413,7 @@ const uint8_t BITMAP_RX[] =
0b00011001, 0b00011001,
0b00101001, 0b00101001,
0b01000110, 0b01000110,
0b00000000, 0b00000000,
0b01100011, 0b01100011,
0b00100010, 0b00100010,
@ -461,18 +489,21 @@ const uint8_t BITMAP_DTMF[] =
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b00111110, 0b00111110,
0b00000000, 0b00000000,
0b00000001, 0b00000001,
0b00000001, 0b00000001,
0b01111111, 0b01111111,
0b00000001, 0b00000001,
0b00000001, 0b00000001,
0b00000000, 0b00000000,
0b01111111, 0b01111111,
0b00000010, 0b00000010,
0b00001100, 0b00001100,
0b00000010, 0b00000010,
0b01111111, 0b01111111,
0b00000000, 0b00000000,
0b01111111, 0b01111111,
0b00001001, 0b00001001,
@ -489,12 +520,14 @@ const uint8_t BITMAP_Scramble[] =
0b01001001, 0b01001001,
0b01001001, 0b01001001,
0b00110010, 0b00110010,
0b00000000, 0b00000000,
0b00111110, 0b00111110,
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b00100010, 0b00100010,
0b00000000, 0b00000000,
0b01111111, 0b01111111,
0b00001001, 0b00001001,
@ -571,6 +604,7 @@ const uint8_t BITMAP_AM[] =
0b00010001, 0b00010001,
0b00010010, 0b00010010,
0b01111100, 0b01111100,
0b00000000, 0b00000000,
0b01111111, 0b01111111,
0b00000010, 0b00000010,
@ -587,6 +621,7 @@ const uint8_t BITMAP_CT[] =
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b00100010, 0b00100010,
0b00000000, 0b00000000,
0b00000001, 0b00000001,
0b00000001, 0b00000001,
@ -603,12 +638,14 @@ const uint8_t BITMAP_DCS[] =
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b00111110, 0b00111110,
0b00000000, 0b00000000,
0b00111110, 0b00111110,
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b01000001, 0b01000001,
0b00100010, 0b00100010,
0b00000000, 0b00000000,
0b00100110, 0b00100110,
0b01001001, 0b01001001,

View File

@ -13,19 +13,27 @@ extern const uint8_t BITMAP_BatteryLevel4[18];
extern const uint8_t BITMAP_BatteryLevel5[18]; extern const uint8_t BITMAP_BatteryLevel5[18];
extern const uint8_t BITMAP_USB_C[9]; extern const uint8_t BITMAP_USB_C[9];
extern const uint8_t BITMAP_KeyLock[9]; extern const uint8_t BITMAP_KeyLock[9];
extern const uint8_t BITMAP_F_Key[10]; extern const uint8_t BITMAP_F_Key[10];
extern const uint8_t BITMAP_VOX[18]; extern const uint8_t BITMAP_VOX[18];
extern const uint8_t BITMAP_WX[12]; #if 0
extern const uint8_t BITMAP_WX[12];
#else
extern const uint8_t BITMAP_XB[12];
#endif
extern const uint8_t BITMAP_TDR[12]; extern const uint8_t BITMAP_TDR[12];
#ifndef DISABLE_VOICE #ifndef DISABLE_VOICE
extern const uint8_t BITMAP_VoicePrompt[9]; extern const uint8_t BITMAP_VoicePrompt[9];
#endif #endif
extern const uint8_t BITMAP_FM[12]; extern const uint8_t BITMAP_FM[12];
#ifndef DISABLE_NOAA #ifndef DISABLE_NOAA
extern const uint8_t BITMAP_NOAA[12]; extern const uint8_t BITMAP_NOAA[12];
#endif #endif
@ -54,6 +62,7 @@ extern const uint8_t BITMAP_ReverseMode[8];
extern const uint8_t BITMAP_NarrowBand[8]; extern const uint8_t BITMAP_NarrowBand[8];
extern const uint8_t BITMAP_DTMF[24]; extern const uint8_t BITMAP_DTMF[24];
extern const uint8_t BITMAP_Scramble[18]; extern const uint8_t BITMAP_Scramble[18];
extern const uint8_t BITMAP_Add[8]; extern const uint8_t BITMAP_Add[8];

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -18,9 +18,16 @@
#include "misc.h" #include "misc.h"
#include "settings.h" #include "settings.h"
const uint32_t bx_min_Hz = 1800000; // 18MHz
const uint32_t bx_max_Hz = 130000000; // 1300MHz
const uint32_t LowerLimitFrequencyBandTable[7] = const uint32_t LowerLimitFrequencyBandTable[7] =
{ {
5000000, #ifndef RX_ANY_FREQ
5000000,
#else
1800000,
#endif
10800000, 10800000,
13600000, 13600000,
17400000, 17400000,
@ -48,7 +55,11 @@ const uint32_t UpperLimitFrequencyBandTable[7] =
34999990, 34999990,
39999990, 39999990,
46999990, 46999990,
60000000 #ifndef RX_ANY_FREQ
60000000
#else
130000000
#endif
}; };
#ifndef DISABLE_NOAA #ifndef DISABLE_NOAA
@ -91,23 +102,27 @@ const uint32_t UpperLimitFrequencyBandTable[7] =
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency) FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency)
{ {
if (Frequency >= 5000000 && Frequency < 10800000) // if (Frequency >= 60000000 && Frequency <= bx_max_Hz)
return BAND1_50MHz; // return BAND7_470MHz;
if (Frequency >= 10800000 && Frequency < 13600000) if (Frequency >= 47000000)
return BAND2_108MHz;
if (Frequency >= 13600000 && Frequency < 17400000)
return BAND3_136MHz;
if (Frequency >= 17400000 && Frequency < 35000000)
return BAND4_174MHz;
if (Frequency >= 35000000 && Frequency < 40000000)
return BAND5_350MHz;
if (Frequency >= 40000000 && Frequency < 47000000)
return BAND6_400MHz;
if (Frequency >= 47000000 && Frequency < 60000000)
return BAND7_470MHz; return BAND7_470MHz;
if (Frequency >= 40000000)
return BAND6_400MHz;
if (Frequency >= 35000000)
return BAND5_350MHz;
if (Frequency >= 17400000)
return BAND4_174MHz;
if (Frequency >= 13600000)
return BAND3_136MHz;
if (Frequency >= 10800000)
return BAND2_108MHz;
// if (Frequency >= 5000000)
// return BAND1_50MHz;
// if (Frequency >= bx_min_Hz)
return BAND1_50MHz;
// TODO: Double check the assembly // TODO: Double check the assembly
return BAND6_400MHz; // return BAND6_400MHz;
} }
uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency) uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency)

View File

@ -21,6 +21,9 @@
#include "radio.h" #include "radio.h"
extern const uint32_t bx_min_Hz;
extern const uint32_t bx_max_Hz;
enum FREQUENCY_Band_t enum FREQUENCY_Band_t
{ {
BAND1_50MHz = 0, BAND1_50MHz = 0,
@ -34,13 +37,15 @@ enum FREQUENCY_Band_t
typedef enum FREQUENCY_Band_t FREQUENCY_Band_t; typedef enum FREQUENCY_Band_t FREQUENCY_Band_t;
extern const uint32_t LowerLimitFrequencyBandTable[7]; extern const uint32_t LowerLimitFrequencyBandTable[7];
extern const uint32_t MiddleFrequencyBandTable[7]; extern const uint32_t MiddleFrequencyBandTable[7];
extern const uint32_t UpperLimitFrequencyBandTable[7]; extern const uint32_t UpperLimitFrequencyBandTable[7];
#ifndef DISABLE_NOAA #ifndef DISABLE_NOAA
extern const uint32_t NoaaFrequencyTable[10]; extern const uint32_t NoaaFrequencyTable[10];
#endif #endif
extern const uint16_t StepFrequencyTable[6];
extern const uint16_t StepFrequencyTable[6];
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency); FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency);
uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency); uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency);

18
radio.c
View File

@ -351,6 +351,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
else else
if (Channel >= FREQ_CHANNEL_FIRST) if (Channel >= FREQ_CHANNEL_FIRST)
Frequency = FREQUENCY_FloorToStep(Frequency, gEeprom.VfoInfo[VFO].StepFrequency, gLowerLimitFrequencyBandTable[Band]); Frequency = FREQUENCY_FloorToStep(Frequency, gEeprom.VfoInfo[VFO].StepFrequency, gLowerLimitFrequencyBandTable[Band]);
pRadio->ConfigRX.Frequency = Frequency; pRadio->ConfigRX.Frequency = Frequency;
if (Frequency >= 10800000 && Frequency < 13600000) if (Frequency >= 10800000 && Frequency < 13600000)
@ -438,15 +439,14 @@ void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo)
EEPROM_ReadBuffer(0x1ED0 + (Band * 16) + (pInfo->OUTPUT_POWER * 3), Txp, 3); EEPROM_ReadBuffer(0x1ED0 + (Band * 16) + (pInfo->OUTPUT_POWER * 3), Txp, 3);
pInfo->TXP_CalculatedSetting = pInfo->TXP_CalculatedSetting = FREQUENCY_CalculateOutputPower(
FREQUENCY_CalculateOutputPower( Txp[0],
Txp[0], Txp[1],
Txp[1], Txp[2],
Txp[2], LowerLimitFrequencyBandTable[Band],
LowerLimitFrequencyBandTable[Band], MiddleFrequencyBandTable[Band],
MiddleFrequencyBandTable[Band], UpperLimitFrequencyBandTable[Band],
UpperLimitFrequencyBandTable[Band], pInfo->pTX->Frequency);
pInfo->pTX->Frequency);
} }
void RADIO_ApplyOffset(VFO_Info_t *pInfo) void RADIO_ApplyOffset(VFO_Info_t *pInfo)

View File

@ -126,6 +126,7 @@ void UI_DisplayMain(void)
if (bIsSameVfo) if (bIsSameVfo)
memcpy(pLine0 + 2, BITMAP_VFO_Default, sizeof(BITMAP_VFO_Default)); memcpy(pLine0 + 2, BITMAP_VFO_Default, sizeof(BITMAP_VFO_Default));
else else
//if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF)
memcpy(pLine0 + 2, BITMAP_VFO_NotDefault, sizeof(BITMAP_VFO_NotDefault)); memcpy(pLine0 + 2, BITMAP_VFO_NotDefault, sizeof(BITMAP_VFO_NotDefault));
} }

View File

@ -438,7 +438,7 @@ void UI_DisplayMenu(void)
break; break;
case MENU_TDR: case MENU_TDR:
case MENU_WX: case MENU_XB:
strcpy(String, gSubMenu_CHAN[gSubMenuSelection]); strcpy(String, gSubMenu_CHAN[gSubMenuSelection]);
break; break;

View File

@ -39,7 +39,7 @@ enum
MENU_VOX, MENU_VOX,
MENU_ABR, MENU_ABR,
MENU_TDR, MENU_TDR,
MENU_WX, MENU_XB,
MENU_BEEP, MENU_BEEP,
MENU_TOT, MENU_TOT,
#ifndef DISABLE_VOICE #ifndef DISABLE_VOICE

View File

@ -26,56 +26,60 @@
void UI_DisplayScanner(void) void UI_DisplayScanner(void)
{ {
char String[16]; char String[16];
bool bCentered; bool bCentered;
uint8_t Start; uint8_t Start;
memset(gFrameBuffer, 0, sizeof(gFrameBuffer)); memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
memset(String, 0, sizeof(String));
if (gScanSingleFrequency || (gScanCssState != SCAN_CSS_STATE_OFF && gScanCssState != SCAN_CSS_STATE_FAILED)) { memset(String, 0, sizeof(String));
if (gScanSingleFrequency || (gScanCssState != SCAN_CSS_STATE_OFF && gScanCssState != SCAN_CSS_STATE_FAILED))
sprintf(String, "FREQ:%.5f", gScanFrequency * 1e-05); sprintf(String, "FREQ:%.5f", gScanFrequency * 1e-05);
} else { else
sprintf(String, "FREQ:**.*****"); sprintf(String, "FREQ:**.*****");
}
UI_PrintString(String, 2, 0, 1, 8); UI_PrintString(String, 2, 0, 1, 8);
memset(String, 0, sizeof(String));
if (gScanCssState < SCAN_CSS_STATE_FOUND || !gScanUseCssResult) { memset(String, 0, sizeof(String));
if (gScanCssState < SCAN_CSS_STATE_FOUND || !gScanUseCssResult)
sprintf(String, "CTC:******"); sprintf(String, "CTC:******");
} else if (gScanCssResultType == CODE_TYPE_CONTINUOUS_TONE) { else
if (gScanCssResultType == CODE_TYPE_CONTINUOUS_TONE)
sprintf(String, "CTC:%.1fHz", CTCSS_Options[gScanCssResultCode] * 0.1); sprintf(String, "CTC:%.1fHz", CTCSS_Options[gScanCssResultCode] * 0.1);
} else { else
sprintf(String, "DCS:D%03oN", DCS_Options[gScanCssResultCode]); sprintf(String, "DCS:D%03oN", DCS_Options[gScanCssResultCode]);
}
UI_PrintString(String, 2, 0, 3, 8); UI_PrintString(String, 2, 0, 3, 8);
memset(String, 0, sizeof(String));
if (gScannerEditState == 2) { memset(String, 0, sizeof(String));
if (gScannerEditState == 2)
{
strcpy(String, "SAVE?"); strcpy(String, "SAVE?");
Start = 0;
Start = 0;
bCentered = 1; bCentered = 1;
} else { }
if (gScannerEditState == 1) { else
{
if (gScannerEditState == 1)
{
strcpy(String, "SAVE:"); strcpy(String, "SAVE:");
UI_GenerateChannelStringEx(String + 5, gShowChPrefix, gScanChannel); UI_GenerateChannelStringEx(String + 5, gShowChPrefix, gScanChannel);
} else if (gScanCssState < SCAN_CSS_STATE_FOUND) { }
else
if (gScanCssState < SCAN_CSS_STATE_FOUND)
{
strcpy(String, "SCAN"); strcpy(String, "SCAN");
memset(String + 4, '.', (gScanProgressIndicator & 7) + 1); memset(String + 4, '.', (gScanProgressIndicator & 7) + 1);
} else {
if (gScanCssState == SCAN_CSS_STATE_FOUND) {
strcpy(String, "SCAN CMP.");
} else {
strcpy(String, "SCAN FAIL.");
}
} }
Start = 2; else
if (gScanCssState == SCAN_CSS_STATE_FOUND)
strcpy(String, "SCAN CMP.");
else
strcpy(String, "SCAN FAIL.");
Start = 2;
bCentered = 0; bCentered = 0;
} }
UI_PrintString(String, Start, bCentered ? 127 : 0, 5, 8); UI_PrintString(String, Start, bCentered ? 127 : 0, 5, 8);
ST7565_BlitFullScreen(); ST7565_BlitFullScreen();
} }

View File

@ -65,7 +65,7 @@ void UI_DisplayStatus(void)
memcpy(gStatusLine + 71, BITMAP_VOX, sizeof(BITMAP_VOX)); memcpy(gStatusLine + 71, BITMAP_VOX, sizeof(BITMAP_VOX));
if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF)
memcpy(gStatusLine + 58, BITMAP_WX, sizeof(BITMAP_WX)); memcpy(gStatusLine + 58, BITMAP_XB, sizeof(BITMAP_XB));
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
memcpy(gStatusLine + 45, BITMAP_TDR, sizeof(BITMAP_TDR)); memcpy(gStatusLine + 45, BITMAP_TDR, sizeof(BITMAP_TDR));