Skip to content

Commit 1d08aea

Browse files
authored
Merge pull request #305 from armel/feature_update_v3
Feature update v3
2 parents a847a3e + 1ff9e11 commit 1d08aea

32 files changed

+428
-110
lines changed

Makefile

+14-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# ---- STOCK QUANSHENG FERATURES ----
77
ENABLE_FMRADIO ?= 0
88
ENABLE_UART ?= 1
9-
ENABLE_AIRCOPY ?= 1
9+
ENABLE_AIRCOPY ?= 0
1010
ENABLE_NOAA ?= 0
1111
ENABLE_VOICE ?= 0
1212
ENABLE_VOX ?= 1
@@ -17,7 +17,7 @@ ENABLE_DTMF_CALLING ?= 0
1717
ENABLE_FLASHLIGHT ?= 1
1818

1919
# ---- CUSTOM MODS ----
20-
ENABLE_SPECTRUM ?= 1
20+
ENABLE_SPECTRUM ?= 0
2121
ENABLE_BIG_FREQ ?= 1
2222
ENABLE_SMALL_BOLD ?= 1
2323
ENABLE_CUSTOM_MENU_LAYOUT ?= 1
@@ -48,6 +48,8 @@ ENABLE_FEAT_F4HWN_CHARGING_C ?= 1
4848
ENABLE_FEAT_F4HWN_SLEEP ?= 1
4949
ENABLE_FEAT_F4HWN_RESTORE_SCAN ?= 1
5050
ENABLE_FEAT_F4HWN_NARROWER ?= 1
51+
ENABLE_FEAT_F4HWN_CONTRAST ?= 1
52+
ENABLE_FEAT_F4HWN_MENU_LOCK ?= 0
5153
ENABLE_FEAT_F4HWN_VOL ?= 0
5254
ENABLE_FEAT_F4HWN_RESET_CHANNEL ?= 0
5355
ENABLE_FEAT_F4HWN_PMR ?= 0
@@ -222,7 +224,9 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
222224
VERSION_STRING_1 ?= v0.22
223225

224226
AUTHOR_STRING_2 ?= F4HWN
225-
VERSION_STRING_2 ?= v3.6
227+
VERSION_STRING_2 ?= v3.7
228+
229+
EDITION_STRING ?= Custom
226230

227231
AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2)
228232
VERSION_STRING ?= $(VERSION_STRING_2)
@@ -411,6 +415,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
411415
CFLAGS += -DSQL_TONE=550 # For SA818, use 600 and python3 sa818.py --port /dev/ttyS2 radio --frequency 434.975 --ctcss 71.9 --tail Open
412416
CFLAGS += -DAUTHOR_STRING_1=\"$(AUTHOR_STRING_1)\" -DVERSION_STRING_1=\"$(VERSION_STRING_1)\"
413417
CFLAGS += -DAUTHOR_STRING_2=\"$(AUTHOR_STRING_2)\" -DVERSION_STRING_2=\"$(VERSION_STRING_2)\"
418+
CFLAGS += -DEDITION_STRING=\"$(EDITION_STRING)\"
414419
else
415420
CFLAGS += -DSQL_TONE=550
416421
endif
@@ -435,6 +440,12 @@ endif
435440
ifeq ($(ENABLE_FEAT_F4HWN_NARROWER),1)
436441
CFLAGS += -DENABLE_FEAT_F4HWN_NARROWER
437442
endif
443+
ifeq ($(ENABLE_FEAT_F4HWN_CONTRAST),1)
444+
CFLAGS += -DENABLE_FEAT_F4HWN_CONTRAST
445+
endif
446+
ifneq ($(filter $(ENABLE_FEAT_F4HWN_MENU_LOCK),1 2),)
447+
CFLAGS += -DENABLE_FEAT_F4HWN_MENU_LOCK=$(ENABLE_FEAT_F4HWN_MENU_LOCK)
448+
endif
438449
ifeq ($(ENABLE_FEAT_F4HWN_VOL),1)
439450
CFLAGS += -DENABLE_FEAT_F4HWN_VOL
440451
endif

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,14 @@ This is the least demanding option as you don't have to install enything on your
216216

217217
<img src="images/Code_Space_1.png" width=700 />
218218

219-
5. Open `Makefile`
220-
1. Edit build options, save `Makefile` changes
221-
1. Run `./compile-with-docker.sh` in terminal window
219+
5. Open `Makefile`, edit build options and save changes
220+
1. If necessary, open `compile-with-docker.sh`, edit build versions and save changes
221+
1. Run in terminal window
222+
- `./compile-with-docker.sh bandscope` to compile bandscope version
223+
- `./compile-with-docker.sh broadcast` to compile broadcast version
224+
- `./compile-with-docker.sh voxless` to compile voxless version
225+
- `./compile-with-docker.sh all` to compile all versions
226+
- `./compile-with-docker.sh custom` to compile only with Makefile build options
222227
1. Open folder `compiled-firmware`
223228
1. Right click `firmware.packed.bin`
224229
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)

app/action.c

+4
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ void ACTION_Scan(bool bRestart)
229229
gScanPauseDelayIn_10ms = 1;
230230
gScheduleScanListen = false;
231231
} else {
232+
#ifdef ENABLE_FEAT_F4HWN_RESTORE_SCAN
233+
gEeprom.CURRENT_STATE = 1;
234+
SETTINGS_WriteCurrentState();
235+
#endif
232236
// start scanning
233237
CHFRSCANNER_Start(true, SCAN_FWD);
234238

app/app.c

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

1401-
#ifndef ENABLE_FEAT_F4HWN
1401+
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
14021402
#ifdef ENABLE_FLASHLIGHT
14031403
FlashlightTimeSlice();
14041404
#endif

app/flashlight.c

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

66
#include "flashlight.h"
77

8-
#ifndef ENABLE_FEAT_F4HWN
8+
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
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-
#ifndef ENABLE_FEAT_F4HWN
8+
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_MENU_LOCK)
99
enum FlashlightMode_t {
1010
FLASHLIGHT_OFF = 0,
1111
FLASHLIGHT_ON,

app/main.c

+31-4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ 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
88+
if(gEeprom.MENU_LOCK == true) {
89+
return; // prevent F function if MENU LOCK is true
90+
}
91+
#endif
92+
8793
if (gScreenToDisplay == DISPLAY_MENU) {
8894
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
8995
return;
@@ -427,7 +433,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
427433

428434
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) { // user is entering channel number
429435

430-
gKeyInputCountdown = (key_input_timeout_500ms / 5); // short time...
436+
gKeyInputCountdown = (key_input_timeout_500ms / 4); // short time...
431437

432438
#ifdef ENABLE_VOICE
433439
gAnotherVoiceID = (VOICE_ID_t)Key;
@@ -454,8 +460,8 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
454460
// do nothing
455461
return;
456462
}
457-
458-
gKeyInputCountdown = (key_input_timeout_500ms / 5); // short time...
463+
464+
gKeyInputCountdown = (gInputBoxIndex == totalDigits) ? (key_input_timeout_500ms / 16) : (key_input_timeout_500ms / 3);
459465

460466
const char *inputStr = INPUTBOX_GetAscii();
461467
uint8_t inputLength = gInputBoxIndex;
@@ -680,11 +686,19 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
680686
return;
681687
}
682688

689+
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
690+
if(gEeprom.MENU_LOCK == false) {
691+
#endif
692+
683693
gFlagRefreshSetting = true;
684694
gRequestDisplayScreen = DISPLAY_MENU;
685695
#ifdef ENABLE_VOICE
686696
gAnotherVoiceID = VOICE_ID_MENU;
687697
#endif
698+
699+
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
700+
}
701+
#endif
688702
}
689703
else {
690704
gRequestDisplayScreen = DISPLAY_MAIN;
@@ -694,6 +708,13 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
694708

695709
static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
696710
{
711+
712+
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
713+
if(gEeprom.MENU_LOCK == true) {
714+
return; // prevent F function if MENU LOCK is true
715+
}
716+
#endif
717+
697718
if (gCurrentFunction == FUNCTION_TRANSMIT)
698719
return;
699720

@@ -927,7 +948,13 @@ void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
927948
MAIN_Key_STAR(bKeyPressed, bKeyHeld);
928949
break;
929950
case KEY_F:
930-
GENERIC_Key_F(bKeyPressed, bKeyHeld);
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
931958
break;
932959
case KEY_PTT:
933960
GENERIC_Key_PTT(bKeyPressed);

app/menu.c

+22
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,12 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
400400
//*pMin = 0;
401401
*pMax = ARRAY_SIZE(gSubMenu_SET_TOT) - 1;
402402
break;
403+
#ifdef ENABLE_FEAT_F4HWN_CONTRAST
403404
case MENU_SET_CTR:
404405
*pMin = 1;
405406
*pMax = 15;
406407
break;
408+
#endif
407409
case MENU_TX_LOCK:
408410
case MENU_SET_INV:
409411
//*pMin = 0;
@@ -430,6 +432,12 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
430432
*pMax = 63;
431433
break;
432434
#endif
435+
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
436+
case MENU_SET_KEY:
437+
//*pMin = 0;
438+
*pMax = 4;
439+
break;
440+
#endif
433441
#endif
434442

435443
default:
@@ -914,9 +922,11 @@ void MENU_AcceptSetting(void)
914922
case MENU_SET_EOT:
915923
gSetting_set_eot = gSubMenuSelection;
916924
break;
925+
#ifdef ENABLE_FEAT_F4HWN_CONTRAST
917926
case MENU_SET_CTR:
918927
gSetting_set_ctr = gSubMenuSelection;
919928
break;
929+
#endif
920930
case MENU_SET_INV:
921931
gSetting_set_inv = gSubMenuSelection;
922932
break;
@@ -941,6 +951,11 @@ void MENU_AcceptSetting(void)
941951
gEeprom.VOLUME_GAIN = gSubMenuSelection;
942952
break;
943953
#endif
954+
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
955+
case MENU_SET_KEY:
956+
gEeprom.SET_KEY = gSubMenuSelection;
957+
break;
958+
#endif
944959
case MENU_SET_TMR:
945960
gSetting_set_tmr = gSubMenuSelection;
946961
break;
@@ -1360,9 +1375,11 @@ void MENU_ShowCurrentSetting(void)
13601375
case MENU_SET_EOT:
13611376
gSubMenuSelection = gSetting_set_eot;
13621377
break;
1378+
#ifdef ENABLE_FEAT_F4HWN_CONTRAST
13631379
case MENU_SET_CTR:
13641380
gSubMenuSelection = gSetting_set_ctr;
13651381
break;
1382+
#endif
13661383
case MENU_SET_INV:
13671384
gSubMenuSelection = gSetting_set_inv;
13681385
break;
@@ -1385,6 +1402,11 @@ void MENU_ShowCurrentSetting(void)
13851402
gSubMenuSelection = gEeprom.VOLUME_GAIN;
13861403
break;
13871404
#endif
1405+
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
1406+
case MENU_SET_KEY:
1407+
gSubMenuSelection = gEeprom.SET_KEY;
1408+
break;
1409+
#endif
13881410
case MENU_SET_TMR:
13891411
gSubMenuSelection = gSetting_set_tmr;
13901412
break;

app/spectrum.c

+27-7
Original file line numberDiff line numberDiff line change
@@ -867,17 +867,37 @@ uint8_t Rssi2Y(uint16_t rssi)
867867
return DrawingEndY - Rssi2PX(rssi, 0, DrawingEndY);
868868
}
869869

870-
static void DrawSpectrum()
871-
{
872-
for (uint8_t x = 0; x < 128; ++x)
870+
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
871+
static void DrawSpectrum()
873872
{
874-
uint16_t rssi = rssiHistory[x >> settings.stepsCount];
875-
if (rssi != RSSI_MAX_VALUE)
873+
uint8_t ox = 0;
874+
for (uint8_t i = 0; i < 128; ++i)
876875
{
877-
DrawVLine(Rssi2Y(rssi), DrawingEndY, x, true);
876+
uint16_t rssi = rssiHistory[i >> settings.stepsCount];
877+
if (rssi != RSSI_MAX_VALUE)
878+
{
879+
uint8_t x = i * 128 / GetStepsCount();
880+
for (uint8_t xx = ox; xx < x; xx++)
881+
{
882+
DrawVLine(Rssi2Y(rssi), DrawingEndY, xx, true);
883+
}
884+
ox = x;
885+
}
878886
}
879887
}
880-
}
888+
#else
889+
static void DrawSpectrum()
890+
{
891+
for (uint8_t x = 0; x < 128; ++x)
892+
{
893+
uint16_t rssi = rssiHistory[x >> settings.stepsCount];
894+
if (rssi != RSSI_MAX_VALUE)
895+
{
896+
DrawVLine(Rssi2Y(rssi), DrawingEndY, x, true);
897+
}
898+
}
899+
}
900+
#endif
881901

882902
static void DrawStatus()
883903
{
59.8 KB
Binary file not shown.
59.8 KB
Binary file not shown.
58 KB
Binary file not shown.
58 KB
Binary file not shown.
56 KB
Binary file not shown.
56 KB
Binary file not shown.

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

60 KB
Binary file not shown.
60 KB
Binary file not shown.

bitmaps.c

+40-6
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,40 @@ const uint8_t gFontPttClassic[2][6] =
2222
{0x00, 0x7f, 0x40, 0x40, 0x40, 0x40},
2323
};
2424

25-
const uint8_t gFontF[1][8] =
25+
const uint8_t gFontF[8] =
2626
{
27-
{0x7f, 0x00, 0x76, 0x76, 0x76, 0x76, 0x7e, 0x7f}, // 'F'
27+
0b01111111,
28+
0b00000000,
29+
0b01110110,
30+
0b01110110,
31+
0b01110110,
32+
0b01110110,
33+
0b01111110,
34+
0b01111111
2835
};
2936

30-
const uint8_t gFontS[1][6] =
37+
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
38+
const uint8_t gFontR[8] =
39+
{
40+
0b01111111,
41+
0b00000000,
42+
0b01110110,
43+
0b01110110,
44+
0b01100110,
45+
0b01010110,
46+
0b00111001,
47+
0b01111111
48+
};
49+
#endif
50+
51+
const uint8_t gFontS[6] =
3152
{
32-
{0x26, 0x49, 0x49, 0x49, 0x49, 0x32}, // 'S'
53+
0x26, 0x49, 0x49, 0x49, 0x49, 0x32 // 'S'
3354
};
3455

35-
const uint8_t gFontKeyLock[1][9] =
56+
const uint8_t gFontKeyLock[9] =
3657
{
37-
{0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c}
58+
0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c
3859
};
3960

4061
const uint8_t gFontLight[9] =
@@ -280,6 +301,7 @@ const uint8_t BITMAP_compand[6] =
280301
0b00100100
281302
};
282303

304+
/*
283305
const uint8_t BITMAP_Ready[7] =
284306
{
285307
0b00001000,
@@ -291,6 +313,18 @@ const uint8_t BITMAP_Ready[7] =
291313
0b00000010,
292314
};
293315
316+
const uint8_t BITMAP_NotReady[7] =
317+
{
318+
0b00000000,
319+
0b01000010,
320+
0b00100100,
321+
0b00011000,
322+
0b00100100,
323+
0b01000010,
324+
0b00000000,
325+
};
326+
*/
327+
294328
const uint8_t BITMAP_PowerUser[3] =
295329
{ // 'arrow' symbol
296330
0b00111110,

0 commit comments

Comments
 (0)