mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
1750 compile option + maybe DW AM TX fix
This commit is contained in:
parent
de174d072c
commit
c644b30b2f
6
Makefile
6
Makefile
@ -12,7 +12,7 @@ ENABLE_FMRADIO := 1
|
||||
ENABLE_NOAA := 0
|
||||
ENABLE_VOICE := 0
|
||||
ENABLE_ALARM := 0
|
||||
#ENABLE_1750HZ := 0
|
||||
ENABLE_TX1750 := 0
|
||||
ENABLE_BIG_FREQ := 0
|
||||
ENABLE_SMALL_BOLD := 1
|
||||
ENABLE_KEEP_MEM_NAME := 1
|
||||
@ -198,8 +198,8 @@ endif
|
||||
ifeq ($(ENABLE_ALARM),1)
|
||||
CFLAGS += -DENABLE_ALARM
|
||||
endif
|
||||
ifeq ($(ENABLE_1750HZ),1)
|
||||
CFLAGS += -DENABLE_1750HZ
|
||||
ifeq ($(ENABLE_TX1750),1)
|
||||
CFLAGS += -DENABLE_TX1750
|
||||
endif
|
||||
ifeq ($(ENABLE_KEEP_MEM_NAME),1)
|
||||
CFLAGS += -DKEEP_MEM_NAME
|
||||
|
@ -33,7 +33,7 @@ ENABLE_FMRADIO := 1 WBFM VHF band 2 RX
|
||||
ENABLE_NOAA := 0 everything NOAA
|
||||
ENABLE_VOICE := 0 want to hear voices ?
|
||||
ENABLE_ALARM := 0 TX alarms
|
||||
#ENABLE_1750HZ := 0 not not implemented .. side key 1750Hz TX tone
|
||||
ENABLE_1750HZ := 0 side key 1750Hz TX tone
|
||||
ENABLE_BIG_FREQ := 0 big font frequencies
|
||||
ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode)
|
||||
ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel
|
||||
|
22
app/action.c
22
app/action.c
@ -235,17 +235,27 @@ void ACTION_Vox(void)
|
||||
gUpdateStatus = true;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
static void ACTION_AlarmOr1750(bool b1750)
|
||||
{
|
||||
gInputBoxIndex = 0;
|
||||
gAlarmState = b1750 ? ALARM_STATE_TX1750 : ALARM_STATE_TXALARM;
|
||||
gAlarmRunningCounter = 0;
|
||||
gFlagPrepareTX = true;
|
||||
gInputBoxIndex = 0;
|
||||
|
||||
#if defined(ENABLE_ALARM) && defined(ENABLE_TX1750)
|
||||
gAlarmState = b1750 ? ALARM_STATE_TX1750 : ALARM_STATE_TXALARM;
|
||||
gAlarmRunningCounter = 0;
|
||||
#elif defined(ENABLE_ALARM)
|
||||
gAlarmState = ALARM_STATE_TXALARM;
|
||||
gAlarmRunningCounter = 0;
|
||||
#else
|
||||
gAlarmState = ALARM_STATE_TX1750;
|
||||
#endif
|
||||
|
||||
gFlagPrepareTX = true;
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
void ACTION_FM(void)
|
||||
{
|
||||
@ -368,7 +378,7 @@ void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
break;
|
||||
#endif
|
||||
case ACTION_OPT_1750:
|
||||
#ifdef ENABLE_ALARM
|
||||
#ifdef ENABLE_TX1750
|
||||
ACTION_AlarmOr1750(true);
|
||||
#endif
|
||||
break;
|
||||
|
@ -1968,7 +1968,7 @@ void APP_TimeSlice500ms(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
static void ALARM_Off(void)
|
||||
{
|
||||
gAlarmState = ALARM_STATE_OFF;
|
||||
@ -2186,7 +2186,7 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
||||
{ // transmitting
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
if (gAlarmState == ALARM_STATE_OFF)
|
||||
#endif
|
||||
{
|
||||
@ -2242,7 +2242,7 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
else
|
||||
if (!bKeyHeld && bKeyPressed)
|
||||
{
|
||||
|
@ -729,7 +729,7 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||
{ // step/down in frequency
|
||||
const uint32_t frequency = APP_SetFrequencyByStep(gTxVfo, Direction);
|
||||
|
||||
if (RX_FREQUENCY_Check(frequency) < 0)
|
||||
if (RX_freq_check(frequency) < 0)
|
||||
{ // frequency not allowed
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -157,7 +157,7 @@ uint32_t FREQUENCY_FloorToStep(uint32_t Upper, uint32_t Step, uint32_t Lower)
|
||||
return Lower + (Step * Index);
|
||||
}
|
||||
/*
|
||||
int TX_FREQUENCY_Check(VFO_Info_t *pInfo)
|
||||
int TX_freq_check(VFO_Info_t *pInfo)
|
||||
{ // return '0' if TX frequency is allowed
|
||||
// otherwise return '-1'
|
||||
|
||||
@ -168,7 +168,7 @@ int TX_FREQUENCY_Check(VFO_Info_t *pInfo)
|
||||
return -1;
|
||||
#endif
|
||||
*/
|
||||
int TX_FREQUENCY_Check(const uint32_t Frequency)
|
||||
int TX_freq_check(const uint32_t Frequency)
|
||||
{ // return '0' if TX frequency is allowed
|
||||
// otherwise return '-1'
|
||||
|
||||
@ -235,7 +235,7 @@ int TX_FREQUENCY_Check(const uint32_t Frequency)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int RX_FREQUENCY_Check(const uint32_t Frequency)
|
||||
int RX_freq_check(const uint32_t Frequency)
|
||||
{ // return '0' if RX frequency is allowed
|
||||
// otherwise return '-1'
|
||||
|
||||
|
@ -55,9 +55,9 @@ 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);
|
||||
uint32_t FREQUENCY_FloorToStep(uint32_t Upper, uint32_t Step, uint32_t Lower);
|
||||
|
||||
//int TX_FREQUENCY_Check(VFO_Info_t *pInfo);
|
||||
int TX_FREQUENCY_Check(const uint32_t Frequency);
|
||||
int RX_FREQUENCY_Check(const uint32_t Frequency);
|
||||
//int TX_freq_check(VFO_Info_t *pInfo);
|
||||
int TX_freq_check(const uint32_t Frequency);
|
||||
int RX_freq_check(const uint32_t Frequency);
|
||||
|
||||
#endif
|
||||
|
||||
|
17
functions.c
17
functions.c
@ -192,14 +192,23 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
|
||||
|
||||
DTMF_Reply();
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
if (gAlarmState != ALARM_STATE_OFF)
|
||||
{
|
||||
BK4819_TransmitTone(true, (gAlarmState == ALARM_STATE_TX1750) ? 1750 : 500);
|
||||
#ifdef ENABLE_TX1750
|
||||
if (gAlarmState == ALARM_STATE_TX1750)
|
||||
BK4819_TransmitTone(true, 1750);
|
||||
#endif
|
||||
#ifdef ENABLE_ALARM
|
||||
if (gAlarmState == ALARM_STATE_TXALARM)
|
||||
BK4819_TransmitTone(true, 500);
|
||||
#endif
|
||||
SYSTEM_DelayMs(2);
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||
gAlarmToneCounter = 0;
|
||||
gEnableSpeaker = true;
|
||||
#ifdef ENABLE_ALARM
|
||||
gAlarmToneCounter = 0;
|
||||
#endif
|
||||
gEnableSpeaker = true;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
2
misc.c
2
misc.c
@ -149,7 +149,7 @@ uint8_t gReducedService;
|
||||
uint8_t gBatteryVoltageIndex;
|
||||
CssScanMode_t gCssScanMode;
|
||||
bool gUpdateRSSI;
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
AlarmState_t gAlarmState;
|
||||
#endif
|
||||
uint8_t gVoltageMenuCountdown;
|
||||
|
23
radio.c
23
radio.c
@ -892,8 +892,9 @@ void RADIO_SetVfoState(VfoState_t State)
|
||||
}
|
||||
else
|
||||
{
|
||||
const uint8_t Channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_CHANNEL : gEeprom.TX_CHANNEL;
|
||||
VfoState[Channel] = State;
|
||||
unsigned int chan = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && gRxVfoIsActive) ? (gEeprom.RX_CHANNEL + 1) & 1 : gEeprom.RX_CHANNEL; // 1of11
|
||||
chan = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.TX_CHANNEL : chan;
|
||||
VfoState[chan] = State;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
@ -928,10 +929,16 @@ void RADIO_PrepareTX(void)
|
||||
|
||||
RADIO_SelectCurrentVfo();
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) && defined(ENABLE_TX1750)
|
||||
if (gAlarmState == ALARM_STATE_OFF ||
|
||||
gAlarmState == ALARM_STATE_TX1750 ||
|
||||
(gAlarmState == ALARM_STATE_ALARM && gEeprom.ALARM_MODE == ALARM_MODE_TONE))
|
||||
#elif defined(ENABLE_ALARM)
|
||||
if (gAlarmState == ALARM_STATE_OFF ||
|
||||
(gAlarmState == ALARM_STATE_ALARM && gEeprom.ALARM_MODE == ALARM_MODE_TONE))
|
||||
#elif defined(ENABLE_TX1750)
|
||||
if (gAlarmState == ALARM_STATE_OFF ||
|
||||
gAlarmState == ALARM_STATE_TX1750)
|
||||
#endif
|
||||
{
|
||||
#ifndef ENABLE_TX_WHEN_AM
|
||||
@ -946,8 +953,9 @@ void RADIO_PrepareTX(void)
|
||||
State = VFO_STATE_TX_DISABLE;
|
||||
}
|
||||
else
|
||||
//if (TX_FREQUENCY_Check(gCurrentVfo->pTX->Frequency) == 0 || gCurrentVfo->CHANNEL_SAVE <= FREQ_CHANNEL_LAST)
|
||||
if (TX_FREQUENCY_Check(gCurrentVfo->pTX->Frequency) == 0)
|
||||
//if (TX_freq_check(gCurrentVfo->pTX->Frequency) == 0 || gCurrentVfo->CHANNEL_SAVE <= FREQ_CHANNEL_LAST)
|
||||
//if (TX_freq_check(gCurrentVfo->pTX->Frequency) == 0)
|
||||
if (TX_freq_check(gEeprom.VfoInfo[gEeprom.TX_CHANNEL].pTX->Frequency) == 0)
|
||||
{ // TX frequency is allowed
|
||||
if (gCurrentVfo->BUSY_CHANNEL_LOCK && gCurrentFunction == FUNCTION_RECEIVE)
|
||||
State = VFO_STATE_BUSY; // busy RX'ing a station
|
||||
@ -966,7 +974,7 @@ void RADIO_PrepareTX(void)
|
||||
if (State != VFO_STATE_NORMAL)
|
||||
{ // TX not allowed
|
||||
RADIO_SetVfoState(State);
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
gAlarmState = ALARM_STATE_OFF;
|
||||
#endif
|
||||
gDTMF_ReplyState = DTMF_REPLY_NONE;
|
||||
@ -994,7 +1002,8 @@ void RADIO_PrepareTX(void)
|
||||
FUNCTION_Select(FUNCTION_TRANSMIT);
|
||||
|
||||
gTxTimerCountdown_500ms = 0; // no timeout
|
||||
#ifdef ENABLE_ALARM
|
||||
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
if (gAlarmState == ALARM_STATE_OFF)
|
||||
#endif
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ void SETTINGS_SaveSettings(void)
|
||||
EEPROM_WriteBuffer(0x0EA0, State);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
State[0] = gEeprom.ALARM_MODE;
|
||||
#else
|
||||
State[0] = false;
|
||||
|
@ -176,7 +176,7 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
bool AUTO_KEYPAD_LOCK;
|
||||
#ifdef ENABLE_ALARM
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
ALARM_Mode_t ALARM_MODE;
|
||||
#endif
|
||||
POWER_OnDisplayMode_t POWER_ON_DISPLAY_MODE;
|
||||
|
21
ui/main.c
21
ui/main.c
@ -318,13 +318,14 @@ void UI_DisplayMain(void)
|
||||
|
||||
for (vfo_num = 0; vfo_num < 2; vfo_num++)
|
||||
{
|
||||
const unsigned int rx_line = (gEeprom.RX_CHANNEL == 0) ? line0 : line1;
|
||||
// const unsigned int tx_line = (gEeprom.TX_CHANNEL == 0) ? line0 : line1;
|
||||
const unsigned int line = (vfo_num == 0) ? line0 : line1;
|
||||
uint8_t channel = gEeprom.TX_CHANNEL;
|
||||
const bool same_vfo = (channel == vfo_num) ? true : false;
|
||||
uint8_t *p_line0 = gFrameBuffer[line + 0];
|
||||
uint8_t *p_line1 = gFrameBuffer[line + 1];
|
||||
const unsigned int line = (vfo_num == 0) ? line0 : line1;
|
||||
uint8_t channel = gEeprom.TX_CHANNEL;
|
||||
// uint8_t tx_channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_CHANNEL : gEeprom.TX_CHANNEL;
|
||||
const bool same_vfo = (channel == vfo_num) ? true : false;
|
||||
uint8_t *p_line0 = gFrameBuffer[line + 0];
|
||||
uint8_t *p_line1 = gFrameBuffer[line + 1];
|
||||
uint32_t duff_beer = 0;
|
||||
uint8_t state;
|
||||
|
||||
if (single_vfo)
|
||||
{ // we're in single VFO mode - screen is dedicated to just one VFO
|
||||
@ -405,8 +406,6 @@ void UI_DisplayMain(void)
|
||||
memmove(p_line0 + 0, BITMAP_VFO_NotDefault, sizeof(BITMAP_VFO_NotDefault));
|
||||
}
|
||||
|
||||
uint32_t duff_beer = 0;
|
||||
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
||||
{ // transmitting
|
||||
|
||||
@ -428,7 +427,7 @@ void UI_DisplayMain(void)
|
||||
{ // receiving .. show the RX symbol
|
||||
duff_beer = 2;
|
||||
if ((gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR) && gEeprom.RX_CHANNEL == vfo_num)
|
||||
UI_PrintStringSmall("RX", 14, 0, rx_line);
|
||||
UI_PrintStringSmall("RX", 14, 0, line);
|
||||
}
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]))
|
||||
@ -468,7 +467,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
// ************
|
||||
|
||||
uint8_t state = VfoState[vfo_num];
|
||||
state = VfoState[vfo_num];
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT && gAlarmState == ALARM_STATE_ALARM)
|
||||
|
Loading…
x
Reference in New Issue
Block a user