Skip to content

Commit 40b3312

Browse files
authored
Merge pull request #323 from armel/feature_update_v3
Feature update v3
2 parents 1d08aea + 3150d67 commit 40b3312

34 files changed

+326
-196
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ENABLE_FEAT_F4HWN_SLEEP ?= 1
4949
ENABLE_FEAT_F4HWN_RESTORE_SCAN ?= 1
5050
ENABLE_FEAT_F4HWN_NARROWER ?= 1
5151
ENABLE_FEAT_F4HWN_CONTRAST ?= 1
52-
ENABLE_FEAT_F4HWN_MENU_LOCK ?= 0
52+
ENABLE_FEAT_F4HWN_RESCUE_OPS ?= 0
5353
ENABLE_FEAT_F4HWN_VOL ?= 0
5454
ENABLE_FEAT_F4HWN_RESET_CHANNEL ?= 0
5555
ENABLE_FEAT_F4HWN_PMR ?= 0
@@ -224,7 +224,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
224224
VERSION_STRING_1 ?= v0.22
225225

226226
AUTHOR_STRING_2 ?= F4HWN
227-
VERSION_STRING_2 ?= v3.7
227+
VERSION_STRING_2 ?= v3.8
228228

229229
EDITION_STRING ?= Custom
230230

@@ -443,8 +443,8 @@ endif
443443
ifeq ($(ENABLE_FEAT_F4HWN_CONTRAST),1)
444444
CFLAGS += -DENABLE_FEAT_F4HWN_CONTRAST
445445
endif
446-
ifneq ($(filter $(ENABLE_FEAT_F4HWN_MENU_LOCK),1 2),)
447-
CFLAGS += -DENABLE_FEAT_F4HWN_MENU_LOCK=$(ENABLE_FEAT_F4HWN_MENU_LOCK)
446+
ifneq ($(filter $(ENABLE_FEAT_F4HWN_RESCUE_OPS),1 2),)
447+
CFLAGS += -DENABLE_FEAT_F4HWN_RESCUE_OPS=$(ENABLE_FEAT_F4HWN_RESCUE_OPS)
448448
endif
449449
ifeq ($(ENABLE_FEAT_F4HWN_VOL),1)
450450
CFLAGS += -DENABLE_FEAT_F4HWN_VOL

README.md

+7-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, Paolo Bussola, Dirk DL8DF, Levente Szőke (2 times), Bernard-Michel Herrera, Jérôme Saintespes, Paul Davies, RS, Johan F4WAT, Robert Wörle and Rafael Sundorf 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, Dirk DL8DF, Levente Szőke (2 times), Bernard-Michel Herrera, Jérôme Saintespes, Paul Davies, RS, Johan F4WAT, Robert Wörle, Rafael Sundorf, Paul Harker, Peter Fintl, Pascal F4ICR (2 times) and Mike DL2MF for their [donations](https://www.paypal.com/paypalme/F4HWN). That’s so kind of them. Thanks so much 🙏🏻
3030

3131
## Table of Contents
3232

@@ -43,6 +43,10 @@ Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC
4343

4444
## Main features and improvements from F4HWN:
4545

46+
* several firmware versions:
47+
* Bandscope (with spectrum analyzer made by Fagci),
48+
* Broadcast (with commercial FM radio support),
49+
* RescueOps (specifically designed for first responders: firefighters, sea rescue, mountain rescue),
4650
* improve default power settings level:
4751
* Low1 to Low5 (<~20mW, ~125mW, ~250mW, ~500mW, ~1W),
4852
* Mid ~2W,
@@ -119,6 +123,8 @@ Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC
119123
* PTT,
120124
* WIDE NARROW,
121125
* 1750Hz,
126+
* POWER HIGH (RescueOps),
127+
* REMOVE OFFSET (RescueOps),
122128
* new key combinations:
123129
* add the F + UP or F + DOWN key combination to dynamically change the Squelch level,
124130
* add the F + F1 or F + F2 key combination to dynamically change the Step,

app/action.c

+18
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ void (*action_opt_table[])(void) = {
111111
[ACTION_OPT_PTT] = &ACTION_Ptt,
112112
[ACTION_OPT_WN] = &ACTION_Wn,
113113
[ACTION_OPT_BACKLIGHT] = &ACTION_BackLight,
114+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
115+
[ACTION_OPT_POWER_HIGH] = &ACTION_Power_High,
116+
[ACTION_OPT_REMOVE_OFFSET] = &ACTION_Remove_Offset,
117+
#endif
114118
#else
115119
[ACTION_OPT_RXMODE] = &FUNCTION_NOP,
116120
#endif
@@ -613,4 +617,18 @@ void ACTION_BackLightOnDemand(void)
613617

614618
BACKLIGHT_TurnOn();
615619
}
620+
621+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
622+
void ACTION_Power_High(void)
623+
{
624+
gPowerHigh = !gPowerHigh;
625+
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
626+
}
627+
628+
void ACTION_Remove_Offset(void)
629+
{
630+
gRemoveOffset = !gRemoveOffset;
631+
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
632+
}
633+
#endif
616634
#endif

app/action.h

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ void ACTION_SwitchDemodul(void);
4242
void ACTION_Wn(void);
4343
void ACTION_BackLightOnDemand(void);
4444
void ACTION_BackLight(void);
45+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
46+
void ACTION_Power_High(void);
47+
void ACTION_Remove_Offset(void);
48+
#endif
4549
#endif
4650

4751
void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);

app/app.c

+21-2
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ void APP_TimeSlice10ms(void)
13981398
return;
13991399
#endif
14001400

1401-
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
1401+
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_RESCUE_OPS)
14021402
#ifdef ENABLE_FLASHLIGHT
14031403
FlashlightTimeSlice();
14041404
#endif
@@ -1618,7 +1618,7 @@ void APP_TimeSlice500ms(void)
16181618
PWM_PLUS0_CH0_COMP = 0;
16191619
ST7565_ShutDown();
16201620
}
1621-
else if(gSleepModeCountdown_500ms != 0 && gSleepModeCountdown_500ms < 61 && gSetting_set_off != 0)
1621+
else if(gSleepModeCountdown_500ms != 0 && gSleepModeCountdown_500ms < 21 && gSetting_set_off != 0)
16221622
{
16231623
if(gSleepModeCountdown_500ms % 4 == 0)
16241624
{
@@ -1825,6 +1825,25 @@ static void ALARM_Off(void)
18251825

18261826
static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
18271827
{
1828+
#ifdef ENABLE_FEAT_F4HWN_SLEEP
1829+
if(gWakeUp)
1830+
{
1831+
if(!bKeyPressed || Key == KEY_PTT)
1832+
{
1833+
BACKLIGHT_TurnOn();
1834+
1835+
if(Key != KEY_PTT)
1836+
{
1837+
Key = KEY_INVALID;
1838+
}
1839+
}
1840+
else
1841+
{
1842+
return;
1843+
}
1844+
}
1845+
#endif
1846+
18281847
if (Key == KEY_EXIT && !BACKLIGHT_IsOn() && gEeprom.BACKLIGHT_TIME > 0)
18291848
{ // just turn the light on for now so the user can see what's what
18301849
BACKLIGHT_TurnOn();

app/flashlight.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "flashlight.h"
77

8-
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
8+
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_RESCUE_OPS)
99
enum FlashlightMode_t gFlashLightState;
1010

1111
void FlashlightTimeSlice()

app/flashlight.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <stdint.h>
77

8-
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
8+
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_RESCUE_OPS)
99
enum FlashlightMode_t {
1010
FLASHLIGHT_OFF = 0,
1111
FLASHLIGHT_ON,

app/generic.c

+63-46
Original file line numberDiff line numberDiff line change
@@ -39,61 +39,78 @@
3939

4040
void GENERIC_Key_F(bool bKeyPressed, bool bKeyHeld)
4141
{
42-
if (gInputBoxIndex > 0) {
43-
if (!bKeyHeld && bKeyPressed) // short pressed
44-
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
45-
return;
46-
}
47-
48-
if (bKeyHeld || !bKeyPressed) { // held or released
49-
if (bKeyHeld || bKeyPressed) { // held or pressed (cannot be held and not pressed I guess, so it checks only if HELD?)
50-
if (!bKeyHeld) // won't ever pass
51-
return;
42+
#ifdef ENABLE_F4HWN_FEAT_MENU_LOCK
43+
if(gEeprom.MENU_LOCK == true)
44+
{
45+
if (bKeyHeld || !bKeyPressed) { // held or released
46+
if (bKeyHeld || bKeyPressed) { // held or pressed (cannot be held and not pressed I guess, so it checks only if HELD?)
47+
if (!bKeyHeld) // won't ever pass
48+
return;
5249

53-
if (!bKeyPressed) // won't ever pass
54-
return;
50+
if (!bKeyPressed) // won't ever pass
51+
return;
5552

56-
COMMON_KeypadLockToggle();
53+
COMMON_KeypadLockToggle();
54+
}
55+
}
56+
}
57+
#else
58+
if (gInputBoxIndex > 0) {
59+
if (!bKeyHeld && bKeyPressed) // short pressed
60+
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
61+
return;
5762
}
58-
else { // released
59-
#ifdef ENABLE_FMRADIO
60-
if ((gFmRadioMode || gScreenToDisplay != DISPLAY_MAIN) && gScreenToDisplay != DISPLAY_FM)
61-
return;
62-
#else
63-
if (gScreenToDisplay != DISPLAY_MAIN)
64-
return;
65-
#endif
6663

67-
gWasFKeyPressed = !gWasFKeyPressed; // toggle F function
64+
if (bKeyHeld || !bKeyPressed) { // held or released
65+
if (bKeyHeld || bKeyPressed) { // held or pressed (cannot be held and not pressed I guess, so it checks only if HELD?)
66+
if (!bKeyHeld) // won't ever pass
67+
return;
6868

69-
if (gWasFKeyPressed)
70-
gKeyInputCountdown = key_input_timeout_500ms;
69+
if (!bKeyPressed) // won't ever pass
70+
return;
7171

72-
#ifdef ENABLE_VOICE
73-
if (!gWasFKeyPressed)
74-
gAnotherVoiceID = VOICE_ID_CANCEL;
75-
#endif
76-
gUpdateStatus = true;
77-
}
78-
}
79-
else { // short pressed
80-
#ifdef ENABLE_FMRADIO
81-
if (gScreenToDisplay != DISPLAY_FM)
82-
#endif
83-
{
84-
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
85-
return;
72+
COMMON_KeypadLockToggle();
73+
}
74+
else { // released
75+
#ifdef ENABLE_FMRADIO
76+
if ((gFmRadioMode || gScreenToDisplay != DISPLAY_MAIN) && gScreenToDisplay != DISPLAY_FM)
77+
return;
78+
#else
79+
if (gScreenToDisplay != DISPLAY_MAIN)
80+
return;
81+
#endif
82+
83+
gWasFKeyPressed = !gWasFKeyPressed; // toggle F function
84+
85+
if (gWasFKeyPressed)
86+
gKeyInputCountdown = key_input_timeout_500ms;
87+
88+
#ifdef ENABLE_VOICE
89+
if (!gWasFKeyPressed)
90+
gAnotherVoiceID = VOICE_ID_CANCEL;
91+
#endif
92+
gUpdateStatus = true;
93+
}
8694
}
95+
else { // short pressed
96+
#ifdef ENABLE_FMRADIO
97+
if (gScreenToDisplay != DISPLAY_FM)
98+
#endif
99+
{
100+
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
101+
return;
102+
}
87103

88-
#ifdef ENABLE_FMRADIO
89-
if (gFM_ScanState == FM_SCAN_OFF) { // not scanning
90-
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
91-
return;
104+
#ifdef ENABLE_FMRADIO
105+
if (gFM_ScanState == FM_SCAN_OFF) { // not scanning
106+
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
107+
return;
108+
}
109+
#endif
110+
gBeepToPlay = BEEP_440HZ_500MS;
111+
gPttWasReleased = true;
92112
}
93-
#endif
94-
gBeepToPlay = BEEP_440HZ_500MS;
95-
gPttWasReleased = true;
96-
}
113+
#endif
97114
}
98115

99116
void GENERIC_Key_PTT(bool bKeyPressed)

app/main.c

+12-11
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,15 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
8484
{
8585
uint8_t Vfo = gEeprom.TX_VFO;
8686

87-
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
87+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
8888
if(gEeprom.MENU_LOCK == true) {
89+
if(Key == 2) { // Enable A/B only
90+
gVfoConfigureMode = VFO_CONFIGURE;
91+
COMMON_SwitchVFOs();
92+
if (beep)
93+
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
94+
}
95+
8996
return; // prevent F function if MENU LOCK is true
9097
}
9198
#endif
@@ -686,7 +693,7 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
686693
return;
687694
}
688695

689-
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
696+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
690697
if(gEeprom.MENU_LOCK == false) {
691698
#endif
692699

@@ -696,7 +703,7 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
696703
gAnotherVoiceID = VOICE_ID_MENU;
697704
#endif
698705

699-
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
706+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
700707
}
701708
#endif
702709
}
@@ -709,7 +716,7 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
709716
static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
710717
{
711718

712-
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
719+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
713720
if(gEeprom.MENU_LOCK == true) {
714721
return; // prevent F function if MENU LOCK is true
715722
}
@@ -948,13 +955,7 @@ void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
948955
MAIN_Key_STAR(bKeyPressed, bKeyHeld);
949956
break;
950957
case KEY_F:
951-
#ifndef ENABLE_FEAT_F4HWN_MENU_LOCK
952-
GENERIC_Key_F(bKeyPressed, bKeyHeld);
953-
#else
954-
if(gEeprom.MENU_LOCK == false) {
955-
GENERIC_Key_F(bKeyPressed, bKeyHeld);
956-
}
957-
#endif
958+
GENERIC_Key_F(bKeyPressed, bKeyHeld);
958959
break;
959960
case KEY_PTT:
960961
GENERIC_Key_PTT(bKeyPressed);

app/menu.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
432432
*pMax = 63;
433433
break;
434434
#endif
435-
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
435+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
436436
case MENU_SET_KEY:
437437
//*pMin = 0;
438438
*pMax = 4;
@@ -951,7 +951,7 @@ void MENU_AcceptSetting(void)
951951
gEeprom.VOLUME_GAIN = gSubMenuSelection;
952952
break;
953953
#endif
954-
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
954+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
955955
case MENU_SET_KEY:
956956
gEeprom.SET_KEY = gSubMenuSelection;
957957
break;
@@ -1402,7 +1402,7 @@ void MENU_ShowCurrentSetting(void)
14021402
gSubMenuSelection = gEeprom.VOLUME_GAIN;
14031403
break;
14041404
#endif
1405-
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
1405+
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
14061406
case MENU_SET_KEY:
14071407
gSubMenuSelection = gEeprom.SET_KEY;
14081408
break;
59.8 KB
Binary file not shown.
59.8 KB
Binary file not shown.
58.1 KB
Binary file not shown.
58.1 KB
Binary file not shown.
56.3 KB
Binary file not shown.
56.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)