Merge pull request #305 from armel/feature_update_v3

Feature update v3
This commit is contained in:
Armel FAUVEAU
2024-11-14 19:41:41 +01:00
committed by GitHub
32 changed files with 428 additions and 110 deletions

View File

@@ -6,7 +6,7 @@
# ---- STOCK QUANSHENG FERATURES ----
ENABLE_FMRADIO ?= 0
ENABLE_UART ?= 1
ENABLE_AIRCOPY ?= 1
ENABLE_AIRCOPY ?= 0
ENABLE_NOAA ?= 0
ENABLE_VOICE ?= 0
ENABLE_VOX ?= 1
@@ -17,7 +17,7 @@ ENABLE_DTMF_CALLING ?= 0
ENABLE_FLASHLIGHT ?= 1
# ---- CUSTOM MODS ----
ENABLE_SPECTRUM ?= 1
ENABLE_SPECTRUM ?= 0
ENABLE_BIG_FREQ ?= 1
ENABLE_SMALL_BOLD ?= 1
ENABLE_CUSTOM_MENU_LAYOUT ?= 1
@@ -48,6 +48,8 @@ ENABLE_FEAT_F4HWN_CHARGING_C ?= 1
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_VOL ?= 0
ENABLE_FEAT_F4HWN_RESET_CHANNEL ?= 0
ENABLE_FEAT_F4HWN_PMR ?= 0
@@ -222,7 +224,9 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
VERSION_STRING_1 ?= v0.22
AUTHOR_STRING_2 ?= F4HWN
VERSION_STRING_2 ?= v3.6
VERSION_STRING_2 ?= v3.7
EDITION_STRING ?= Custom
AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2)
VERSION_STRING ?= $(VERSION_STRING_2)
@@ -411,6 +415,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
CFLAGS += -DSQL_TONE=550 # For SA818, use 600 and python3 sa818.py --port /dev/ttyS2 radio --frequency 434.975 --ctcss 71.9 --tail Open
CFLAGS += -DAUTHOR_STRING_1=\"$(AUTHOR_STRING_1)\" -DVERSION_STRING_1=\"$(VERSION_STRING_1)\"
CFLAGS += -DAUTHOR_STRING_2=\"$(AUTHOR_STRING_2)\" -DVERSION_STRING_2=\"$(VERSION_STRING_2)\"
CFLAGS += -DEDITION_STRING=\"$(EDITION_STRING)\"
else
CFLAGS += -DSQL_TONE=550
endif
@@ -435,6 +440,12 @@ endif
ifeq ($(ENABLE_FEAT_F4HWN_NARROWER),1)
CFLAGS += -DENABLE_FEAT_F4HWN_NARROWER
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)
endif
ifeq ($(ENABLE_FEAT_F4HWN_VOL),1)
CFLAGS += -DENABLE_FEAT_F4HWN_VOL
endif

View File

@@ -216,9 +216,14 @@ This is the least demanding option as you don't have to install enything on your
<img src="images/Code_Space_1.png" width=700 />
5. Open `Makefile`
1. Edit build options, save `Makefile` changes
1. Run `./compile-with-docker.sh` in terminal window
5. Open `Makefile`, edit build options and save changes
1. If necessary, open `compile-with-docker.sh`, edit build versions and save changes
1. Run in terminal window
- `./compile-with-docker.sh bandscope` to compile bandscope version
- `./compile-with-docker.sh broadcast` to compile broadcast version
- `./compile-with-docker.sh voxless` to compile voxless version
- `./compile-with-docker.sh all` to compile all versions
- `./compile-with-docker.sh custom` to compile only with Makefile build options
1. Open folder `compiled-firmware`
1. Right click `firmware.packed.bin`
1. Click `Download`, now you should have a firmware on your computer that you can proceed to flash on your radio. You can use [online flasher](https://egzumer.github.io/uvtools)

View File

@@ -229,6 +229,10 @@ void ACTION_Scan(bool bRestart)
gScanPauseDelayIn_10ms = 1;
gScheduleScanListen = false;
} else {
#ifdef ENABLE_FEAT_F4HWN_RESTORE_SCAN
gEeprom.CURRENT_STATE = 1;
SETTINGS_WriteCurrentState();
#endif
// start scanning
CHFRSCANNER_Start(true, SCAN_FWD);

View File

@@ -1398,7 +1398,7 @@ void APP_TimeSlice10ms(void)
return;
#endif
#ifndef ENABLE_FEAT_F4HWN
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
#ifdef ENABLE_FLASHLIGHT
FlashlightTimeSlice();
#endif

View File

@@ -5,7 +5,7 @@
#include "flashlight.h"
#ifndef ENABLE_FEAT_F4HWN
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
enum FlashlightMode_t gFlashLightState;
void FlashlightTimeSlice()

View File

@@ -5,7 +5,7 @@
#include <stdint.h>
#ifndef ENABLE_FEAT_F4HWN
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
enum FlashlightMode_t {
FLASHLIGHT_OFF = 0,
FLASHLIGHT_ON,

View File

@@ -84,6 +84,12 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
{
uint8_t Vfo = gEeprom.TX_VFO;
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
if(gEeprom.MENU_LOCK == true) {
return; // prevent F function if MENU LOCK is true
}
#endif
if (gScreenToDisplay == DISPLAY_MENU) {
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
return;
@@ -427,7 +433,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) { // user is entering channel number
gKeyInputCountdown = (key_input_timeout_500ms / 5); // short time...
gKeyInputCountdown = (key_input_timeout_500ms / 4); // short time...
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
@@ -455,7 +461,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
return;
}
gKeyInputCountdown = (key_input_timeout_500ms / 5); // short time...
gKeyInputCountdown = (gInputBoxIndex == totalDigits) ? (key_input_timeout_500ms / 16) : (key_input_timeout_500ms / 3);
const char *inputStr = INPUTBOX_GetAscii();
uint8_t inputLength = gInputBoxIndex;
@@ -680,11 +686,19 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
return;
}
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
if(gEeprom.MENU_LOCK == false) {
#endif
gFlagRefreshSetting = true;
gRequestDisplayScreen = DISPLAY_MENU;
#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_MENU;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
}
#endif
}
else {
gRequestDisplayScreen = DISPLAY_MAIN;
@@ -694,6 +708,13 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
{
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
if(gEeprom.MENU_LOCK == true) {
return; // prevent F function if MENU LOCK is true
}
#endif
if (gCurrentFunction == FUNCTION_TRANSMIT)
return;
@@ -927,7 +948,13 @@ 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
break;
case KEY_PTT:
GENERIC_Key_PTT(bKeyPressed);

View File

@@ -400,10 +400,12 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
//*pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_SET_TOT) - 1;
break;
#ifdef ENABLE_FEAT_F4HWN_CONTRAST
case MENU_SET_CTR:
*pMin = 1;
*pMax = 15;
break;
#endif
case MENU_TX_LOCK:
case MENU_SET_INV:
//*pMin = 0;
@@ -430,6 +432,12 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
*pMax = 63;
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
case MENU_SET_KEY:
//*pMin = 0;
*pMax = 4;
break;
#endif
#endif
default:
@@ -914,9 +922,11 @@ void MENU_AcceptSetting(void)
case MENU_SET_EOT:
gSetting_set_eot = gSubMenuSelection;
break;
#ifdef ENABLE_FEAT_F4HWN_CONTRAST
case MENU_SET_CTR:
gSetting_set_ctr = gSubMenuSelection;
break;
#endif
case MENU_SET_INV:
gSetting_set_inv = gSubMenuSelection;
break;
@@ -941,6 +951,11 @@ void MENU_AcceptSetting(void)
gEeprom.VOLUME_GAIN = gSubMenuSelection;
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
case MENU_SET_KEY:
gEeprom.SET_KEY = gSubMenuSelection;
break;
#endif
case MENU_SET_TMR:
gSetting_set_tmr = gSubMenuSelection;
break;
@@ -1360,9 +1375,11 @@ void MENU_ShowCurrentSetting(void)
case MENU_SET_EOT:
gSubMenuSelection = gSetting_set_eot;
break;
#ifdef ENABLE_FEAT_F4HWN_CONTRAST
case MENU_SET_CTR:
gSubMenuSelection = gSetting_set_ctr;
break;
#endif
case MENU_SET_INV:
gSubMenuSelection = gSetting_set_inv;
break;
@@ -1385,6 +1402,11 @@ void MENU_ShowCurrentSetting(void)
gSubMenuSelection = gEeprom.VOLUME_GAIN;
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
case MENU_SET_KEY:
gSubMenuSelection = gEeprom.SET_KEY;
break;
#endif
case MENU_SET_TMR:
gSubMenuSelection = gSetting_set_tmr;
break;

View File

@@ -867,6 +867,25 @@ uint8_t Rssi2Y(uint16_t rssi)
return DrawingEndY - Rssi2PX(rssi, 0, DrawingEndY);
}
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
static void DrawSpectrum()
{
uint8_t ox = 0;
for (uint8_t i = 0; i < 128; ++i)
{
uint16_t rssi = rssiHistory[i >> settings.stepsCount];
if (rssi != RSSI_MAX_VALUE)
{
uint8_t x = i * 128 / GetStepsCount();
for (uint8_t xx = ox; xx < x; xx++)
{
DrawVLine(Rssi2Y(rssi), DrawingEndY, xx, true);
}
ox = x;
}
}
}
#else
static void DrawSpectrum()
{
for (uint8_t x = 0; x < 128; ++x)
@@ -878,6 +897,7 @@ static void DrawSpectrum()
}
}
}
#endif
static void DrawStatus()
{

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -22,19 +22,40 @@ const uint8_t gFontPttClassic[2][6] =
{0x00, 0x7f, 0x40, 0x40, 0x40, 0x40},
};
const uint8_t gFontF[1][8] =
const uint8_t gFontF[8] =
{
{0x7f, 0x00, 0x76, 0x76, 0x76, 0x76, 0x7e, 0x7f}, // 'F'
0b01111111,
0b00000000,
0b01110110,
0b01110110,
0b01110110,
0b01110110,
0b01111110,
0b01111111
};
const uint8_t gFontS[1][6] =
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
const uint8_t gFontR[8] =
{
{0x26, 0x49, 0x49, 0x49, 0x49, 0x32}, // 'S'
0b01111111,
0b00000000,
0b01110110,
0b01110110,
0b01100110,
0b01010110,
0b00111001,
0b01111111
};
#endif
const uint8_t gFontS[6] =
{
0x26, 0x49, 0x49, 0x49, 0x49, 0x32 // 'S'
};
const uint8_t gFontKeyLock[1][9] =
const uint8_t gFontKeyLock[9] =
{
{0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c}
0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c
};
const uint8_t gFontLight[9] =
@@ -280,6 +301,7 @@ const uint8_t BITMAP_compand[6] =
0b00100100
};
/*
const uint8_t BITMAP_Ready[7] =
{
0b00001000,
@@ -291,6 +313,18 @@ const uint8_t BITMAP_Ready[7] =
0b00000010,
};
const uint8_t BITMAP_NotReady[7] =
{
0b00000000,
0b01000010,
0b00100100,
0b00011000,
0b00100100,
0b01000010,
0b00000000,
};
*/
const uint8_t BITMAP_PowerUser[3] =
{ // 'arrow' symbol
0b00111110,

View File

@@ -7,10 +7,15 @@
extern const uint8_t gFontPowerSave[2][6];
extern const uint8_t gFontPttOnePush[2][6];
extern const uint8_t gFontPttClassic[2][6];
extern const uint8_t gFontF[1][8];
extern const uint8_t gFontS[1][6];
extern const uint8_t gFontF[8];
extern const uint8_t gFontKeyLock[1][9];
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
extern const uint8_t gFontR[8];
#endif
extern const uint8_t gFontS[6];
extern const uint8_t gFontKeyLock[9];
extern const uint8_t gFontLight[9];
extern const uint8_t gFontXB[2][6];
@@ -21,7 +26,11 @@ extern const uint8_t gFontHold[2][5];
extern const uint8_t BITMAP_BatteryLevel[2];
extern const uint8_t BITMAP_BatteryLevel1[17];
extern const uint8_t BITMAP_USB_C[9];
/*
extern const uint8_t BITMAP_Ready[7];
extern const uint8_t BITMAP_NotReady[7];
*/
#ifdef ENABLE_VOX
extern const uint8_t gFontVox[2][6];

View File

@@ -1,65 +0,0 @@
#!/bin/sh
#export DOCKER_DEFAULT_PLATFORM=linux/amd64
IMAGE_NAME="uvk5"
rm "${PWD}/compiled-firmware/*"
docker build -t $IMAGE_NAME .
bandscope() {
echo "Bandscope compilation..."
docker run --rm -v "${PWD}/compiled-firmware/:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
ENABLE_SPECTRUM=1 \
ENABLE_FMRADIO=0 \
ENABLE_AIRCOPY=1 \
ENABLE_NOAA=0 \
TARGET=f4hwn.bandscope \
&& cp f4hwn.bandscope* compiled-firmware/"
}
broadcast() {
echo "Broadcast compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
ENABLE_SPECTRUM=0 \
ENABLE_FMRADIO=1 \
ENABLE_AIRCOPY=1 \
ENABLE_NOAA=0 \
TARGET=f4hwn.broadcast \
&& cp f4hwn.broadcast* compiled-firmware/"
}
voxless() {
echo "Voxless compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
ENABLE_SPECTRUM=1 \
ENABLE_FMRADIO=1 \
ENABLE_VOX=0 \
ENABLE_AIRCOPY=0 \
ENABLE_AUDIO_BAR=0 \
ENABLE_FEAT_F4HWN_SPECTRUM=0 \
ENABLE_NOAA=0 \
ENABLE_FEAT_F4HWN_RESTORE_SCAN=0 \
ENABLE_FEAT_F4HWN_CHARGING_C=0 \
ENABLE_FEAT_F4HWN_NARROWER=0 \
TARGET=f4hwn.voxless \
&& cp f4hwn.voxless* compiled-firmware/"
}
case "$1" in
bandscope)
bandscope
;;
broadcast)
broadcast
;;
voxless)
voxless
;;
all)
bandscope
broadcast
voxless
;;
*)
echo "Usage: $0 {bandscope|broadcast|voxless|all}"
exit 1
;;
esac

View File

@@ -1,5 +1,114 @@
#!/bin/sh
#export DOCKER_DEFAULT_PLATFORM=linux/amd64
IMAGE_NAME="uvk5"
rm "${PWD}/compiled-firmware/*"
docker build -t $IMAGE_NAME .
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make && cp f4hwn* compiled-firmware/"
custom() {
echo "Custom compilation..."
docker run --rm -v "${PWD}/compiled-firmware/:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
EDITION_STRING=Custom \
TARGET=f4hwn.custom \
&& cp f4hwn.custom* compiled-firmware/"
}
standard() {
echo "Standard compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
ENABLE_SPECTRUM=0 \
ENABLE_FMRADIO=0 \
ENABLE_AIRCOPY=0 \
ENABLE_NOAA=0 \
EDITION_STRING=Standard \
TARGET=f4hwn.standard \
&& cp f4hwn.standard* compiled-firmware/"
}
bandscope() {
echo "Bandscope compilation..."
docker run --rm -v "${PWD}/compiled-firmware/:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
ENABLE_SPECTRUM=1 \
ENABLE_FMRADIO=0 \
ENABLE_AIRCOPY=1 \
ENABLE_NOAA=0 \
ENABLE_FEAT_F4HWN_MENU_LOCK=0 \
EDITION_STRING=Bandscope \
TARGET=f4hwn.bandscope \
&& cp f4hwn.bandscope* compiled-firmware/"
}
broadcast() {
echo "Broadcast compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
ENABLE_SPECTRUM=0 \
ENABLE_FMRADIO=1 \
ENABLE_AIRCOPY=1 \
ENABLE_NOAA=0 \
EDITION_STRING=Broadcast \
ENABLE_FEAT_F4HWN_MENU_LOCK=0 \
TARGET=f4hwn.broadcast \
&& cp f4hwn.broadcast* compiled-firmware/"
}
voxless() {
echo "Voxless compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
ENABLE_SPECTRUM=1 \
ENABLE_FMRADIO=1 \
ENABLE_VOX=0 \
ENABLE_AIRCOPY=0 \
ENABLE_AUDIO_BAR=0 \
ENABLE_FEAT_F4HWN_SPECTRUM=0 \
ENABLE_NOAA=0 \
ENABLE_FEAT_F4HWN_RESTORE_SCAN=0 \
ENABLE_FEAT_F4HWN_CHARGING_C=0 \
ENABLE_FEAT_F4HWN_NARROWER=0 \
ENABLE_FEAT_F4HWN_MENU_LOCK=0 \
EDITION_STRING=Voxless \
TARGET=f4hwn.voxless \
&& cp f4hwn.voxless* compiled-firmware/"
}
rescueops() {
echo "RescueOps compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
ENABLE_SPECTRUM=0 \
ENABLE_FMRADIO=0 \
ENABLE_AIRCOPY=1 \
ENABLE_NOAA=1 \
ENABLE_FEAT_F4HWN_MENU_LOCK=1 \
EDITION_STRING=RescueOps \
TARGET=f4hwn.rescueops \
&& cp f4hwn.rescueops* compiled-firmware/"
}
case "$1" in
custom)
custom
;;
standard)
standard
;;
bandscope)
bandscope
;;
broadcast)
broadcast
;;
voxless)
voxless
;;
rescueops)
rescueops
;;
all)
bandscope
broadcast
voxless
rescueops
;;
*)
echo "Usage: $0 {custom|bandscope|broadcast|voxless|standard|all}"
exit 1
;;
esac

View File

@@ -44,6 +44,13 @@ BOOT_Mode_t BOOT_GetMode(void)
SYSTEM_DelayMs(20);
}
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
if (Keys[0] == (10 + gEeprom.SET_KEY))
{
return BOOT_MODE_MENU_LOCK; // Secret KEY pressed
}
#endif
if (Keys[0] == Keys[1])
{
gKeyReading0 = Keys[0];

View File

@@ -24,6 +24,9 @@ enum BOOT_Mode_t
{
BOOT_MODE_NORMAL = 0,
BOOT_MODE_F_LOCK,
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
BOOT_MODE_MENU_LOCK,
#endif
#ifdef ENABLE_AIRCOPY
BOOT_MODE_AIRCOPY
#endif

38
main.c
View File

@@ -129,7 +129,30 @@ void Main(void)
AM_fix_init();
#endif
const BOOT_Mode_t BootMode = BOOT_GetMode();
BOOT_Mode_t BootMode = BOOT_GetMode();
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
if (BootMode == BOOT_MODE_MENU_LOCK)
{
gEeprom.MENU_LOCK = !gEeprom.MENU_LOCK;
SETTINGS_SaveSettings();
}
if(gEeprom.MENU_LOCK == true) // Force Main Only
{
gEeprom.DUAL_WATCH = 0;
gEeprom.CROSS_BAND_RX_TX = 0;
//gFlagReconfigureVfos = true;
//gUpdateStatus = true;
}
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
if (BootMode == BOOT_MODE_F_LOCK && gEeprom.MENU_LOCK == true)
{
BootMode = BOOT_MODE_NORMAL;
}
#endif
if (BootMode == BOOT_MODE_F_LOCK)
{
@@ -139,13 +162,16 @@ void Main(void)
gEeprom.KEY_LOCK = 0;
SETTINGS_SaveSettings();
#ifndef ENABLE_VOX
gMenuCursor = 64; // move to hidden section, fix me if change... !!! Remove VOX and Mic Bar
gMenuCursor = 65; // move to hidden section, fix me if change... !!! Remove VOX and Mic Bar
#else
#ifdef ENABLE_FEAT_F4HWN_SLEEP
gMenuCursor = 67; // move to hidden section, fix me if change... !!!
#else
gMenuCursor = 66; // move to hidden section, fix me if change... !!!
gMenuCursor = 68; // move to hidden section, fix me if change... !!!
#endif
#ifdef ENABLE_NOAA
gMenuCursor += 1; // move to hidden section, fix me if change... !!!
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
gMenuCursor += 1; // move to hidden section, fix me if change... !!!
#endif
gSubMenuSelection = gSetting_F_LOCK;
#endif

View File

@@ -51,7 +51,13 @@ void SETTINGS_InitEEPROM(void)
#ifdef ENABLE_NOAA
gEeprom.NOAA_AUTO_SCAN = (Data[3] < 2) ? Data[3] : false;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
gEeprom.KEY_LOCK = (Data[4] & 0x01) != 0;
gEeprom.MENU_LOCK = (Data[4] & 0x02) != 0;
gEeprom.SET_KEY = ((Data[4] >> 2) & 0x0F) > 4 ? 0 : (Data[4] >> 2) & 0x0F;
#else
gEeprom.KEY_LOCK = (Data[4] < 2) ? Data[4] : false;
#endif
#ifdef ENABLE_VOX
gEeprom.VOX_SWITCH = (Data[5] < 2) ? Data[5] : false;
gEeprom.VOX_LEVEL = (Data[6] < 10) ? Data[6] : 1;
@@ -590,7 +596,13 @@ void SETTINGS_SaveSettings(void)
#else
State[3] = false;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
State[4] = (gEeprom.KEY_LOCK ? 0x01 : 0) | (gEeprom.MENU_LOCK ? 0x02 :0) | ((gEeprom.SET_KEY & 0x0F) << 2);
#else
State[4] = gEeprom.KEY_LOCK;
#endif
#ifdef ENABLE_VOX
State[5] = gEeprom.VOX_SWITCH;
State[6] = gEeprom.VOX_LEVEL;
@@ -987,6 +999,9 @@ State[1] = 0
#ifdef ENABLE_SPECTRUM
| (1 << 5)
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
| (1 << 6)
#endif
;
EEPROM_WriteBuffer(0x1FF0, State);
}

View File

@@ -185,6 +185,10 @@ typedef struct {
bool KEY_LOCK;
#ifdef ENABLE_FEAT_F4HWN
bool KEY_LOCK_PTT;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
bool MENU_LOCK;
uint8_t SET_KEY;
#endif
bool VOX_SWITCH;
uint8_t VOX_LEVEL;

View File

@@ -141,7 +141,9 @@ const t_menu_item MenuList[] =
{"SetPTT", MENU_SET_PTT },
{"SetTOT", MENU_SET_TOT },
{"SetEOT", MENU_SET_EOT },
#ifdef ENABLE_FEAT_F4HWN_CONTRAST
{"SetCtr", MENU_SET_CTR },
#endif
{"SetInv", MENU_SET_INV },
{"SetLck", MENU_SET_LCK },
{"SetMet", MENU_SET_MET },
@@ -156,6 +158,9 @@ const t_menu_item MenuList[] =
#ifdef ENABLE_FEAT_F4HWN_VOL
{"SetVol", MENU_SET_VOL },
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
{"SetKey", MENU_SET_KEY },
#endif
#endif
// hidden menu items from here on
// enabled if pressing both the PTT and upper side button at power-on
@@ -395,6 +400,17 @@ const char gSubMenu_SCRAMBLER[][7] =
"NARROWER"
};
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
const char gSubMenu_SET_KEY[][9] =
{
"KEY_MENU",
"KEY_UP",
"KEY_DOWN",
"KEY_EXIT",
"KEY_STAR"
};
#endif
#endif
const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
@@ -1013,11 +1029,13 @@ void UI_DisplayMenu(void)
strcpy(String, gSubMenu_SET_TOT[gSubMenuSelection]); // Same as SET_TOT
break;
#ifdef ENABLE_FEAT_F4HWN_CONTRAST
case MENU_SET_CTR:
sprintf(String, "%d", gSubMenuSelection);
gSetting_set_ctr = gSubMenuSelection;
ST7565_ContrastAndInv();
break;
#endif
case MENU_SET_INV:
strcpy(String, gSubMenu_OFF_ON[gSubMenuSelection]);
@@ -1061,6 +1079,12 @@ void UI_DisplayMenu(void)
(gEeprom.DAC_GAIN << 0)); // AF DAC Gain (after Gain-1 and Gain-2)
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
case MENU_SET_KEY:
strcpy(String, gSubMenu_SET_KEY[gSubMenuSelection]);
break;
#endif
#endif
}

View File

@@ -147,6 +147,9 @@ enum
#ifdef ENABLE_FEAT_F4HWN_VOL
MENU_SET_VOL,
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
MENU_SET_KEY,
#endif
#endif
MENU_BATCAL, // battery voltage calibration
MENU_F1SHRT,
@@ -187,6 +190,9 @@ extern const char gSubMenu_D_RSP[4][11];
#ifdef ENABLE_FEAT_F4HWN_NARROWER
extern const char gSubMenu_SET_NFM[2][9];
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
extern const char gSubMenu_SET_KEY[][9];
#endif
#endif
extern const char* const gSubMenu_PTT_ID[5];

View File

@@ -213,6 +213,11 @@ void UI_DisplayStatus()
}
*/
}
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
else if(gEeprom.MENU_LOCK == true) {
memcpy(line + x + 1, gFontR, sizeof(gFontR));
}
#endif
else if (gBackLight)
{
memcpy(line + x + 1, gFontLight, sizeof(gFontLight));

View File

@@ -48,6 +48,7 @@ void UI_DisplayWelcome(void)
char WelcomeString0[16];
char WelcomeString1[16];
char WelcomeString2[16];
char WelcomeString3[20];
memset(gStatusLine, 0, sizeof(gStatusLine));
@@ -128,6 +129,43 @@ void UI_DisplayWelcome(void)
gFrameBuffer[4][i] ^= 0xFF;
}
sprintf(WelcomeString3, "%s Edition", Edition);
UI_PrintStringSmallNormal(WelcomeString3, 0, 127, 6);
/*
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
#if ENABLE_FEAT_F4HWN_MENU_LOCK > 1
UI_PrintStringSmallNormal(Edition, 18, 0, 6);
if(gEeprom.MENU_LOCK == true) {
memcpy(gFrameBuffer[6] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
}
else
{
memcpy(gFrameBuffer[6] + 103, BITMAP_NotReady, sizeof(BITMAP_NotReady));
}
#else
UI_PrintStringSmallNormal(Edition, 18, 0, 5);
memcpy(gFrameBuffer[5] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
UI_PrintStringSmallNormal("RescueOps", 18, 0, 6);
if(gEeprom.MENU_LOCK == true) {
memcpy(gFrameBuffer[6] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
}
else
{
memcpy(gFrameBuffer[6] + 103, BITMAP_NotReady, sizeof(BITMAP_NotReady));
}
#endif
#endif
#else
UI_PrintStringSmallNormal(Edition, 18, 0, 6);
memcpy(gFrameBuffer[6] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
#endif
*/
/*
#ifdef ENABLE_SPECTRUM
#ifdef ENABLE_FMRADIO
UI_PrintStringSmallNormal(Based, 0, 127, 5);
@@ -135,13 +173,29 @@ void UI_DisplayWelcome(void)
#else
UI_PrintStringSmallNormal("Bandscope ", 0, 127, 5);
memcpy(gFrameBuffer[5] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
UI_PrintStringSmallNormal("RescueOps ", 0, 127, 6);
if(gEeprom.MENU_LOCK == true) {
memcpy(gFrameBuffer[6] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
}
#else
UI_PrintStringSmallNormal("Broadcast ", 0, 127, 6);
#endif
#endif
#else
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
UI_PrintStringSmallNormal("RescueOps ", 0, 127, 5);
if(gEeprom.MENU_LOCK == true) {
memcpy(gFrameBuffer[5] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
}
#else
UI_PrintStringSmallNormal("Bandscope ", 0, 127, 5);
#endif
UI_PrintStringSmallNormal("Broadcast ", 0, 127, 6);
memcpy(gFrameBuffer[6] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
#endif
*/
#else
UI_PrintStringSmallNormal(Version, 0, 127, 6);
#endif

View File

@@ -7,8 +7,7 @@
#ifdef ENABLE_FEAT_F4HWN
const char Version[] = AUTHOR_STRING_2 " " VERSION_STRING_2;
const char Based[] = "based on";
const char Credits[] = AUTHOR_STRING_1 " " VERSION_STRING_1;
const char Edition[] = EDITION_STRING;
#else
const char Version[] = AUTHOR_STRING VER;
#endif

View File

@@ -23,6 +23,5 @@ extern const char UART_Version[];
#endif
#ifdef ENABLE_FEAT_F4HWN
extern const char Credits[];
extern const char Based[];
extern const char Edition[];
#endif