Skip to content

Commit

Permalink
Merge pull request #323 from armel/feature_update_v3
Browse files Browse the repository at this point in the history
Feature update v3
  • Loading branch information
armel authored Dec 1, 2024
2 parents 1d08aea + 3150d67 commit 40b3312
Show file tree
Hide file tree
Showing 34 changed files with 326 additions and 196 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ENABLE_FEAT_F4HWN_SLEEP ?= 1
ENABLE_FEAT_F4HWN_RESTORE_SCAN ?= 1
ENABLE_FEAT_F4HWN_NARROWER ?= 1
ENABLE_FEAT_F4HWN_CONTRAST ?= 1
ENABLE_FEAT_F4HWN_MENU_LOCK ?= 0
ENABLE_FEAT_F4HWN_RESCUE_OPS ?= 0
ENABLE_FEAT_F4HWN_VOL ?= 0
ENABLE_FEAT_F4HWN_RESET_CHANNEL ?= 0
ENABLE_FEAT_F4HWN_PMR ?= 0
Expand Down Expand Up @@ -224,7 +224,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
VERSION_STRING_1 ?= v0.22

AUTHOR_STRING_2 ?= F4HWN
VERSION_STRING_2 ?= v3.7
VERSION_STRING_2 ?= v3.8

EDITION_STRING ?= Custom

Expand Down Expand Up @@ -443,8 +443,8 @@ endif
ifeq ($(ENABLE_FEAT_F4HWN_CONTRAST),1)
CFLAGS += -DENABLE_FEAT_F4HWN_CONTRAST
endif
ifneq ($(filter $(ENABLE_FEAT_F4HWN_MENU_LOCK),1 2),)
CFLAGS += -DENABLE_FEAT_F4HWN_MENU_LOCK=$(ENABLE_FEAT_F4HWN_MENU_LOCK)
ifneq ($(filter $(ENABLE_FEAT_F4HWN_RESCUE_OPS),1 2),)
CFLAGS += -DENABLE_FEAT_F4HWN_RESCUE_OPS=$(ENABLE_FEAT_F4HWN_RESCUE_OPS)
endif
ifeq ($(ENABLE_FEAT_F4HWN_VOL),1)
CFLAGS += -DENABLE_FEAT_F4HWN_VOL
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Anyway, have fun.
# Donations

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 🙏🏻
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 🙏🏻

## Table of Contents

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

## Main features and improvements from F4HWN:

* several firmware versions:
* Bandscope (with spectrum analyzer made by Fagci),
* Broadcast (with commercial FM radio support),
* RescueOps (specifically designed for first responders: firefighters, sea rescue, mountain rescue),
* improve default power settings level:
* Low1 to Low5 (<~20mW, ~125mW, ~250mW, ~500mW, ~1W),
* Mid ~2W,
Expand Down Expand Up @@ -119,6 +123,8 @@ Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC
* PTT,
* WIDE NARROW,
* 1750Hz,
* POWER HIGH (RescueOps),
* REMOVE OFFSET (RescueOps),
* new key combinations:
* add the F + UP or F + DOWN key combination to dynamically change the Squelch level,
* add the F + F1 or F + F2 key combination to dynamically change the Step,
Expand Down
18 changes: 18 additions & 0 deletions app/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ void (*action_opt_table[])(void) = {
[ACTION_OPT_PTT] = &ACTION_Ptt,
[ACTION_OPT_WN] = &ACTION_Wn,
[ACTION_OPT_BACKLIGHT] = &ACTION_BackLight,
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
[ACTION_OPT_POWER_HIGH] = &ACTION_Power_High,
[ACTION_OPT_REMOVE_OFFSET] = &ACTION_Remove_Offset,
#endif
#else
[ACTION_OPT_RXMODE] = &FUNCTION_NOP,
#endif
Expand Down Expand Up @@ -613,4 +617,18 @@ void ACTION_BackLightOnDemand(void)

BACKLIGHT_TurnOn();
}

#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
void ACTION_Power_High(void)
{
gPowerHigh = !gPowerHigh;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
}

void ACTION_Remove_Offset(void)
{
gRemoveOffset = !gRemoveOffset;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
}
#endif
#endif
4 changes: 4 additions & 0 deletions app/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ void ACTION_SwitchDemodul(void);
void ACTION_Wn(void);
void ACTION_BackLightOnDemand(void);
void ACTION_BackLight(void);
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
void ACTION_Power_High(void);
void ACTION_Remove_Offset(void);
#endif
#endif

void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
Expand Down
23 changes: 21 additions & 2 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ void APP_TimeSlice10ms(void)
return;
#endif

#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_RESCUE_OPS)
#ifdef ENABLE_FLASHLIGHT
FlashlightTimeSlice();
#endif
Expand Down Expand Up @@ -1618,7 +1618,7 @@ void APP_TimeSlice500ms(void)
PWM_PLUS0_CH0_COMP = 0;
ST7565_ShutDown();
}
else if(gSleepModeCountdown_500ms != 0 && gSleepModeCountdown_500ms < 61 && gSetting_set_off != 0)
else if(gSleepModeCountdown_500ms != 0 && gSleepModeCountdown_500ms < 21 && gSetting_set_off != 0)
{
if(gSleepModeCountdown_500ms % 4 == 0)
{
Expand Down Expand Up @@ -1825,6 +1825,25 @@ static void ALARM_Off(void)

static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
#ifdef ENABLE_FEAT_F4HWN_SLEEP
if(gWakeUp)
{
if(!bKeyPressed || Key == KEY_PTT)
{
BACKLIGHT_TurnOn();

if(Key != KEY_PTT)
{
Key = KEY_INVALID;
}
}
else
{
return;
}
}
#endif

if (Key == KEY_EXIT && !BACKLIGHT_IsOn() && gEeprom.BACKLIGHT_TIME > 0)
{ // just turn the light on for now so the user can see what's what
BACKLIGHT_TurnOn();
Expand Down
2 changes: 1 addition & 1 deletion app/flashlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "flashlight.h"

#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_RESCUE_OPS)
enum FlashlightMode_t gFlashLightState;

void FlashlightTimeSlice()
Expand Down
2 changes: 1 addition & 1 deletion app/flashlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <stdint.h>

#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_RESCUE_OPS)
enum FlashlightMode_t {
FLASHLIGHT_OFF = 0,
FLASHLIGHT_ON,
Expand Down
109 changes: 63 additions & 46 deletions app/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,61 +39,78 @@

void GENERIC_Key_F(bool bKeyPressed, bool bKeyHeld)
{
if (gInputBoxIndex > 0) {
if (!bKeyHeld && bKeyPressed) // short pressed
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
return;
}

if (bKeyHeld || !bKeyPressed) { // held or released
if (bKeyHeld || bKeyPressed) { // held or pressed (cannot be held and not pressed I guess, so it checks only if HELD?)
if (!bKeyHeld) // won't ever pass
return;
#ifdef ENABLE_F4HWN_FEAT_MENU_LOCK
if(gEeprom.MENU_LOCK == true)
{
if (bKeyHeld || !bKeyPressed) { // held or released
if (bKeyHeld || bKeyPressed) { // held or pressed (cannot be held and not pressed I guess, so it checks only if HELD?)
if (!bKeyHeld) // won't ever pass
return;

if (!bKeyPressed) // won't ever pass
return;
if (!bKeyPressed) // won't ever pass
return;

COMMON_KeypadLockToggle();
COMMON_KeypadLockToggle();
}
}
}
#else
if (gInputBoxIndex > 0) {
if (!bKeyHeld && bKeyPressed) // short pressed
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
return;
}
else { // released
#ifdef ENABLE_FMRADIO
if ((gFmRadioMode || gScreenToDisplay != DISPLAY_MAIN) && gScreenToDisplay != DISPLAY_FM)
return;
#else
if (gScreenToDisplay != DISPLAY_MAIN)
return;
#endif

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

if (gWasFKeyPressed)
gKeyInputCountdown = key_input_timeout_500ms;
if (!bKeyPressed) // won't ever pass
return;

#ifdef ENABLE_VOICE
if (!gWasFKeyPressed)
gAnotherVoiceID = VOICE_ID_CANCEL;
#endif
gUpdateStatus = true;
}
}
else { // short pressed
#ifdef ENABLE_FMRADIO
if (gScreenToDisplay != DISPLAY_FM)
#endif
{
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
return;
COMMON_KeypadLockToggle();
}
else { // released
#ifdef ENABLE_FMRADIO
if ((gFmRadioMode || gScreenToDisplay != DISPLAY_MAIN) && gScreenToDisplay != DISPLAY_FM)
return;
#else
if (gScreenToDisplay != DISPLAY_MAIN)
return;
#endif

gWasFKeyPressed = !gWasFKeyPressed; // toggle F function

if (gWasFKeyPressed)
gKeyInputCountdown = key_input_timeout_500ms;

#ifdef ENABLE_VOICE
if (!gWasFKeyPressed)
gAnotherVoiceID = VOICE_ID_CANCEL;
#endif
gUpdateStatus = true;
}
}
else { // short pressed
#ifdef ENABLE_FMRADIO
if (gScreenToDisplay != DISPLAY_FM)
#endif
{
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
return;
}

#ifdef ENABLE_FMRADIO
if (gFM_ScanState == FM_SCAN_OFF) { // not scanning
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
return;
#ifdef ENABLE_FMRADIO
if (gFM_ScanState == FM_SCAN_OFF) { // not scanning
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
return;
}
#endif
gBeepToPlay = BEEP_440HZ_500MS;
gPttWasReleased = true;
}
#endif
gBeepToPlay = BEEP_440HZ_500MS;
gPttWasReleased = true;
}
#endif
}

void GENERIC_Key_PTT(bool bKeyPressed)
Expand Down
23 changes: 12 additions & 11 deletions app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,15 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
{
uint8_t Vfo = gEeprom.TX_VFO;

#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
if(gEeprom.MENU_LOCK == true) {
if(Key == 2) { // Enable A/B only
gVfoConfigureMode = VFO_CONFIGURE;
COMMON_SwitchVFOs();
if (beep)
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
}

return; // prevent F function if MENU LOCK is true
}
#endif
Expand Down Expand Up @@ -686,7 +693,7 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
return;
}

#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
if(gEeprom.MENU_LOCK == false) {
#endif

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

#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
}
#endif
}
Expand All @@ -709,7 +716,7 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
{

#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
if(gEeprom.MENU_LOCK == true) {
return; // prevent F function if MENU LOCK is true
}
Expand Down Expand Up @@ -948,13 +955,7 @@ void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
MAIN_Key_STAR(bKeyPressed, bKeyHeld);
break;
case KEY_F:
#ifndef ENABLE_FEAT_F4HWN_MENU_LOCK
GENERIC_Key_F(bKeyPressed, bKeyHeld);
#else
if(gEeprom.MENU_LOCK == false) {
GENERIC_Key_F(bKeyPressed, bKeyHeld);
}
#endif
GENERIC_Key_F(bKeyPressed, bKeyHeld);
break;
case KEY_PTT:
GENERIC_Key_PTT(bKeyPressed);
Expand Down
6 changes: 3 additions & 3 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
*pMax = 63;
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
case MENU_SET_KEY:
//*pMin = 0;
*pMax = 4;
Expand Down Expand Up @@ -951,7 +951,7 @@ void MENU_AcceptSetting(void)
gEeprom.VOLUME_GAIN = gSubMenuSelection;
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
case MENU_SET_KEY:
gEeprom.SET_KEY = gSubMenuSelection;
break;
Expand Down Expand Up @@ -1402,7 +1402,7 @@ void MENU_ShowCurrentSetting(void)
gSubMenuSelection = gEeprom.VOLUME_GAIN;
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
case MENU_SET_KEY:
gSubMenuSelection = gEeprom.SET_KEY;
break;
Expand Down
Binary file added archive/f4hwn.bandscope.packed.v3.8.bin
Binary file not shown.
Binary file added archive/f4hwn.bandscope.packed.v3.8.sa818.bin
Binary file not shown.
Binary file added archive/f4hwn.broadcast.packed.v3.8.bin
Binary file not shown.
Binary file added archive/f4hwn.broadcast.packed.v3.8.sa818.bin
Binary file not shown.
Binary file added archive/f4hwn.rescueops.packed.v3.8.bin
Binary file not shown.
Binary file added archive/f4hwn.rescueops.packed.v3.8.sa818.bin
Binary file not shown.
Loading

0 comments on commit 40b3312

Please sign in to comment.