Skip to content

Commit 930c775

Browse files
authored
Merge pull request #224 from armel/feature_update_v3
Feature update v3
2 parents 1355af5 + b402cf3 commit 930c775

26 files changed

+167
-81
lines changed

Makefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ ENABLE_SCAN_RANGES ?= 1
4343
ENABLE_FEAT_F4HWN ?= 1
4444
ENABLE_FEAT_F4HWN_SCREENSHOT ?= 0
4545
ENABLE_FEAT_F4HWN_SPECTRUM ?= 1
46+
ENABLE_FEAT_F4HWN_RX_TX_TIMER ?= 1
4647
ENABLE_FEAT_F4HWN_CHARGING_C ?= 1
47-
ENABLE_FEAT_F4HWN_PMR ?= 1
48-
ENABLE_FEAT_F4HWN_GMRS_FRS_MURS ?= 1
48+
ENABLE_FEAT_F4HWN_PMR ?= 0
49+
ENABLE_FEAT_F4HWN_GMRS_FRS_MURS ?= 0
4950
ENABLE_FEAT_F4HWN_CA ?= 1
5051

5152
# ---- DEBUGGING ----
@@ -216,7 +217,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
216217
VERSION_STRING_1 ?= v0.22
217218

218219
AUTHOR_STRING_2 ?= F4HWN
219-
VERSION_STRING_2 ?= v3.1
220+
VERSION_STRING_2 ?= v3.2
220221

221222
AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2)
222223
VERSION_STRING ?= $(VERSION_STRING_2)
@@ -411,6 +412,9 @@ endif
411412
ifeq ($(ENABLE_FEAT_F4HWN_SPECTRUM),1)
412413
CFLAGS += -DENABLE_FEAT_F4HWN_SPECTRUM
413414
endif
415+
ifeq ($(ENABLE_FEAT_F4HWN_RX_TX_TIMER),1)
416+
CFLAGS += -DENABLE_FEAT_F4HWN_RX_TX_TIMER
417+
endif
414418
ifeq ($(ENABLE_FEAT_F4HWN_CHARGING_C),1)
415419
CFLAGS += -DENABLE_FEAT_F4HWN_CHARGING_C
416420
endif

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Anyway, have fun.
2626
2727
# Donations
2828

29-
Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC206, Frédéric F4ESO, Stéphane F5LGW, Jorge Ornelas, Laurent F4AXK, Christophe Morel, Clayton W0LED, Pierre Antoine F6FWB, Jean-Claude 14FRS3306, Thierry F4GVO, Eric F1NOU, PricelessToolkit, Ady M6NYJ, Tom McGovern, Joseph Roth, Pierre-Yves Colin, Frank DJ7FG, Marcel Testaz, Brian Frobisher, Yannick F4JFO and Paolo Bussola for their [donations](https://www.paypal.com/paypalme/F4HWN). That’s so kind of them. Thanks so much 🙏🏻
29+
Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC206, Frédéric F4ESO, Stéphane F5LGW, Jorge Ornelas, Laurent F4AXK, Christophe Morel, Clayton W0LED, Pierre Antoine F6FWB, Jean-Claude 14FRS3306, Thierry F4GVO, Eric F1NOU, PricelessToolkit, Ady M6NYJ, Tom McGovern, Joseph Roth, Pierre-Yves Colin, Frank DJ7FG, Marcel Testaz, Brian Frobisher, Yannick F4JFO, Paolo Bussola and Dirk DL8DF for their [donations](https://www.paypal.com/paypalme/F4HWN). That’s so kind of them. Thanks so much 🙏🏻
3030

3131
## Table of Contents
3232

app/app.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ void APP_StartListening(FUNCTION_Type_t function)
439439
{
440440
const unsigned int vfo = gEeprom.RX_VFO;
441441

442-
#ifdef ENABLE_FEAT_F4HWN
442+
#ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER
443443
gRxTimerCountdown_500ms = 7200;
444444
#endif
445445

@@ -714,7 +714,7 @@ static void CheckRadioInterrupts(void)
714714
if (interrupts.sqlLost) {
715715
g_SquelchLost = true;
716716
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2_GREEN, true);
717-
#ifdef ENABLE_FEAT_F4HWN
717+
#ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER
718718
gRxTimerCountdown_500ms = 7200;
719719
#endif
720720
}

app/chFrScanner.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ static void NextMemChannel(void)
278278
}
279279

280280
if (!enabled || chan == 0xff)
281-
{
282-
chan = RADIO_FindNextChannel(gNextMrChannel + gScanStateDir, gScanStateDir, (gEeprom.SCAN_LIST_DEFAULT < 5) ? true : false, gEeprom.SCAN_LIST_DEFAULT);
281+
{
282+
chan = RADIO_FindNextChannel(gNextMrChannel + gScanStateDir, gScanStateDir, true, gEeprom.SCAN_LIST_DEFAULT);
283283
if (chan == 0xFF)
284284
{ // no valid channel found
285285
chan = MR_CHANNEL_FIRST;

app/main.c

+7-12
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ static void toggle_chan_scanlist(void)
5959
return;
6060
}
6161

62-
/*
63-
if (gTxVfo->SCANLIST1_PARTICIPATION ^ gTxVfo->SCANLIST2_PARTICIPATION){
64-
gTxVfo->SCANLIST2_PARTICIPATION = gTxVfo->SCANLIST1_PARTICIPATION;
65-
} else {
66-
gTxVfo->SCANLIST1_PARTICIPATION = !gTxVfo->SCANLIST1_PARTICIPATION;
62+
// Remove exclude
63+
if(gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] == true)
64+
{
65+
gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] = false;
66+
return;
6767
}
68-
*/
6968

7069
uint8_t scanTmp = gTxVfo->SCANLIST1_PARTICIPATION | (gTxVfo->SCANLIST2_PARTICIPATION << 1) | (gTxVfo->SCANLIST3_PARTICIPATION << 2);
7170

@@ -627,15 +626,11 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
627626

628627
#ifdef ENABLE_FEAT_F4HWN
629628
// Exclude work with list 1, 2, 3 or all list
630-
if(gScanStateDir != SCAN_OFF && (gEeprom.SCAN_LIST_DEFAULT > 0 && gEeprom.SCAN_LIST_DEFAULT < 5))
629+
if(gScanStateDir != SCAN_OFF)
631630
{
632631
if(FUNCTION_IsRx())
633632
{
634-
gTxVfo->SCANLIST1_PARTICIPATION = 0;
635-
gTxVfo->SCANLIST2_PARTICIPATION = 0;
636-
gTxVfo->SCANLIST3_PARTICIPATION = 0;
637-
638-
SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true, false);
633+
gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] = true;
639634

640635
gVfoConfigureMode = VFO_CONFIGURE;
641636
gFlagResetVfos = true;

app/menu.c

+8
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
390390
*pMin = 1;
391391
*pMax = 15;
392392
break;
393+
case MENU_TX_LOCK:
393394
case MENU_SET_INV:
394395
//*pMin = 0;
395396
*pMax = ARRAY_SIZE(gSubMenu_OFF_ON) - 1;
@@ -894,6 +895,10 @@ void MENU_AcceptSetting(void)
894895
case MENU_SET_GUI:
895896
gSetting_set_gui = gSubMenuSelection;
896897
break;
898+
case MENU_TX_LOCK:
899+
gTxVfo->TX_LOCK = gSubMenuSelection;
900+
gRequestSaveChannel = 1;
901+
return;
897902
#endif
898903
}
899904

@@ -1311,6 +1316,9 @@ void MENU_ShowCurrentSetting(void)
13111316
case MENU_SET_GUI:
13121317
gSubMenuSelection = gSetting_set_gui;
13131318
break;
1319+
case MENU_TX_LOCK:
1320+
gSubMenuSelection = gTxVfo->TX_LOCK;
1321+
break;
13141322
#endif
13151323

13161324
default:

app/spectrum.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ static void DrawStatus() {
786786
}
787787
}
788788

789-
#ifndef ENABLE_FMRADIO
789+
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
790790
static void ShowChannelName(uint32_t f) {
791791
unsigned int i;
792792
char s[12];
@@ -827,7 +827,7 @@ static void DrawF(uint32_t f) {
827827
sprintf(String, "%4sk", bwOptions[settings.listenBw]);
828828
GUI_DisplaySmallest(String, 108, 7, false, true);
829829

830-
#ifndef ENABLE_FMRADIO
830+
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
831831
ShowChannelName(f);
832832
#endif
833833
}
59.3 KB
Binary file not shown.
57.3 KB
Binary file not shown.

archive/f4hwn.voxless.packed.v3.2.bin

60 KB
Binary file not shown.

audio.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
4040
if (Beep != BEEP_880HZ_60MS_DOUBLE_BEEP &&
4141
Beep != BEEP_500HZ_60MS_DOUBLE_BEEP &&
4242
Beep != BEEP_440HZ_500MS &&
43-
#ifndef ENABLE_FEAT_F4HWN
43+
#ifdef ENABLE_DTMF_CALLING
4444
Beep != BEEP_880HZ_200MS &&
4545
Beep != BEEP_880HZ_500MS &&
4646
#endif

audio.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ enum BEEP_Type_t
2929
BEEP_1KHZ_60MS_OPTIONAL,
3030
BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL,
3131
BEEP_440HZ_500MS,
32-
#ifndef ENABLE_FEAT_F4HWN
32+
#ifdef ENABLE_DTMF_CALLING
3333
BEEP_880HZ_200MS,
3434
BEEP_880HZ_500MS,
3535
#endif

bitmaps.c

+24-4
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,19 @@ const uint8_t BITMAP_Antenna[5] =
135135
0b00000011
136136
};
137137

138-
const uint8_t BITMAP_VFO_Default[8] =
138+
const uint8_t BITMAP_VFO_Lock[7] =
139+
{
140+
0b01111100,
141+
0b01000110,
142+
0b01000101,
143+
0b01000101,
144+
0b01000101,
145+
0b01000110,
146+
0b01111100,
147+
};
148+
149+
const uint8_t BITMAP_VFO_Default[7] =
139150
{
140-
0b00000000,
141151
0b01111111,
142152
0b01111111,
143153
0b00111110,
@@ -147,9 +157,8 @@ const uint8_t BITMAP_VFO_Default[8] =
147157
0b00001000
148158
};
149159

150-
const uint8_t BITMAP_VFO_NotDefault[8] =
160+
const uint8_t BITMAP_VFO_NotDefault[7] =
151161
{
152-
0b00000000,
153162
0b01000001,
154163
0b01000001,
155164
0b00100010,
@@ -203,6 +212,17 @@ const uint8_t BITMAP_ScanList3[7] =
203212
0b01111111
204213
};
205214

215+
const uint8_t BITMAP_ScanListE[7] =
216+
{ // 'E' symbol
217+
0b01111111,
218+
0b01111111,
219+
0b01000001,
220+
0b01010101,
221+
0b01010101,
222+
0b01111111,
223+
0b01111111
224+
};
225+
206226
const uint8_t BITMAP_ScanList123[19] =
207227
{
208228
// 'All' symbol

bitmaps.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ extern const uint8_t BITMAP_Ready[7];
2828
#endif
2929

3030
extern const uint8_t BITMAP_Antenna[5];
31-
extern const uint8_t BITMAP_VFO_Default[8];
32-
extern const uint8_t BITMAP_VFO_NotDefault[8];
31+
extern const uint8_t BITMAP_VFO_Default[7];
32+
extern const uint8_t BITMAP_VFO_NotDefault[7];
33+
extern const uint8_t BITMAP_VFO_Lock[7];
3334
extern const uint8_t BITMAP_ScanList0[7];
3435
extern const uint8_t BITMAP_ScanList1[7];
3536
extern const uint8_t BITMAP_ScanList2[7];
3637
extern const uint8_t BITMAP_ScanList3[7];
3738
extern const uint8_t BITMAP_ScanList123[19];
3839
extern const uint8_t BITMAP_ScanListAll[19];
40+
extern const uint8_t BITMAP_ScanListE[7];
3941
extern const uint8_t BITMAP_PowerUser[3];
4042
extern const uint8_t BITMAP_compand[6];
4143

helper/boot.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
8686
gEeprom.KEY_2_LONG_PRESS_ACTION = ACTION_OPT_NONE;
8787
gEeprom.KEY_M_LONG_PRESS_ACTION = ACTION_OPT_NONE;
8888

89-
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_LAST - 1, 41002500);
89+
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_LAST - 1, 43400000); // LPD
9090

91-
gRxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_WIDE;
92-
gRxVfo->OUTPUT_POWER = OUTPUT_POWER_LOW;
91+
gRxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_NARROW;
92+
gRxVfo->OUTPUT_POWER = OUTPUT_POWER_LOW1;
9393

9494
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
9595

main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ void Main(void)
129129
gEeprom.KEY_LOCK = 0;
130130
SETTINGS_SaveSettings();
131131
#ifndef ENABLE_VOX
132-
gMenuCursor = 62; // move to hidden section, fix me if change... !!! Remove VOX and Mic Bar
132+
gMenuCursor = 63; // move to hidden section, fix me if change... !!! Remove VOX and Mic Bar
133133
#else
134-
gMenuCursor = 64; // move to hidden section, fix me if change... !!!
134+
gMenuCursor = 65; // move to hidden section, fix me if change... !!!
135135
#endif
136136
gSubMenuSelection = gSetting_F_LOCK;
137137
#endif

misc.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ uint16_t gEEPROM_1F8A;
140140
uint16_t gEEPROM_1F8C;
141141

142142
ChannelAttributes_t gMR_ChannelAttributes[FREQ_CHANNEL_LAST + 1];
143+
bool gMR_ChannelExclude[FREQ_CHANNEL_LAST + 1];
143144

144145
volatile uint16_t gBatterySaveCountdown_10ms = battery_save_count_10ms;
145146

@@ -162,7 +163,9 @@ volatile bool gTxTimeoutReached;
162163
volatile uint16_t gTxTimerCountdownAlert_500ms;
163164
volatile bool gTxTimeoutReachedAlert;
164165
volatile uint16_t gTxTimeoutToneAlert = 800;
165-
volatile uint16_t gRxTimerCountdown_500ms;
166+
#ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER
167+
volatile uint16_t gRxTimerCountdown_500ms;
168+
#endif
166169
#endif
167170

168171
volatile uint16_t gTailNoteEliminationCountdown_10ms;

misc.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ typedef union {
205205
} ChannelAttributes_t;
206206

207207
extern ChannelAttributes_t gMR_ChannelAttributes[207];
208+
extern bool gMR_ChannelExclude[207];
208209

209210
extern volatile uint16_t gBatterySaveCountdown_10ms;
210211

@@ -227,7 +228,9 @@ extern volatile bool gTxTimeoutReached;
227228
extern volatile uint16_t gTxTimerCountdownAlert_500ms;
228229
extern volatile bool gTxTimeoutReachedAlert;
229230
extern volatile uint16_t gTxTimeoutToneAlert;
230-
extern volatile uint16_t gRxTimerCountdown_500ms;
231+
#ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER
232+
extern volatile uint16_t gRxTimerCountdown_500ms;
233+
#endif
231234
#endif
232235

233236
extern volatile uint16_t gTailNoteEliminationCountdown_10ms;

radio.c

+17-4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanL
6262

6363
const ChannelAttributes_t att = gMR_ChannelAttributes[channel];
6464

65+
if (checkScanList && gMR_ChannelExclude[channel] == true)
66+
return false;
67+
6568
if (att.band > BAND7_470MHz)
6669
return false;
6770

@@ -138,6 +141,7 @@ void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const uint32_t
138141
pInfo->StepFrequency = gStepFrequencyTable[pInfo->STEP_SETTING];
139142
pInfo->CHANNEL_SAVE = ChannelSave;
140143
pInfo->FrequencyReverse = false;
144+
pInfo->TX_LOCK = true;
141145
pInfo->OUTPUT_POWER = OUTPUT_POWER_LOW1;
142146
pInfo->freq_config_RX.Frequency = Frequency;
143147
pInfo->freq_config_TX.Frequency = Frequency;
@@ -247,7 +251,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
247251
{
248252
uint8_t tmp;
249253
uint8_t data[8];
250-
254+
251255
// ***************
252256

253257
EEPROM_ReadBuffer(base + 8, data, sizeof(data));
@@ -329,6 +333,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
329333
pVfo->CHANNEL_BANDWIDTH = BK4819_FILTER_BW_WIDE;
330334
pVfo->OUTPUT_POWER = OUTPUT_POWER_LOW1;
331335
pVfo->BUSY_CHANNEL_LOCK = false;
336+
pVfo->TX_LOCK = true;
332337
}
333338
else
334339
{
@@ -337,6 +342,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
337342
pVfo->CHANNEL_BANDWIDTH = !!((d4 >> 1) & 1u);
338343
pVfo->OUTPUT_POWER = ((d4 >> 2) & 7u);
339344
pVfo->BUSY_CHANNEL_LOCK = !!((d4 >> 5) & 1u);
345+
pVfo->TX_LOCK = !!((d4 >> 6) & 1u);
340346
}
341347

342348
if (data[5] == 0xFF)
@@ -1050,9 +1056,16 @@ void RADIO_PrepareTX(void)
10501056

10511057
RADIO_SelectCurrentVfo();
10521058

1053-
if(TX_freq_check(gCurrentVfo->pTX->Frequency) != 0
1054-
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
1055-
&& gAlarmState != ALARM_STATE_SITE_ALARM
1059+
#ifdef ENABLE_FEAT_F4HWN
1060+
if(TX_freq_check(gCurrentVfo->pTX->Frequency) != 0 && gCurrentVfo->TX_LOCK == true
1061+
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
1062+
&& gAlarmState != ALARM_STATE_SITE_ALARM
1063+
#endif
1064+
#else
1065+
if(TX_freq_check(gCurrentVfo->pTX->Frequency) != 0
1066+
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
1067+
&& gAlarmState != ALARM_STATE_SITE_ALARM
1068+
#endif
10561069
#endif
10571070
){
10581071
// TX frequency not allowed

radio.h

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ typedef struct VFO_Info_t
107107
uint8_t SquelchOpenGlitchThresh;
108108

109109
STEP_Setting_t STEP_SETTING;
110+
uint8_t TX_LOCK;
110111
uint8_t OUTPUT_POWER;
111112
uint8_t TXP_CalculatedSetting;
112113
bool FrequencyReverse;

scheduler.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ void SystickHandler(void)
5858

5959
#ifdef ENABLE_FEAT_F4HWN
6060
DECREMENT_AND_TRIGGER(gTxTimerCountdownAlert_500ms - ALERT_TOT * 2, gTxTimeoutReachedAlert);
61-
DECREMENT(gRxTimerCountdown_500ms);
61+
#ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER
62+
DECREMENT(gRxTimerCountdown_500ms);
63+
#endif
6264
#endif
6365

6466
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);

0 commit comments

Comments
 (0)