Skip to content

Commit 0a7e836

Browse files
authored
Merge pull request #274 from armel/feature_update_v3
Feature update v3
2 parents cec4ca6 + 06b6a89 commit 0a7e836

19 files changed

+119
-49
lines changed

Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ RUN pacman -Syyu python-pip --noconfirm
77
RUN pacman -Syyu python-crcmod --noconfirm
88
WORKDIR /app
99
COPY . .
10-
11-
RUN git submodule update --init --recursive
12-
#RUN make && cp firmware* compiled-firmware/
10+
RUN git submodule update --init --recursive

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
218218
VERSION_STRING_1 ?= v0.22
219219

220220
AUTHOR_STRING_2 ?= F4HWN
221-
VERSION_STRING_2 ?= v3.4
221+
VERSION_STRING_2 ?= v3.5
222222

223223
AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2)
224224
VERSION_STRING ?= $(VERSION_STRING_2)

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, Paolo Bussola, Dirk DL8DF, Szőke Levente, Bernard-Michel Herrera, Jérôme Saintespes and Paul Davies 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 and Johan F4WAT 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

+29-9
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,20 @@ static void HandleReceive(void)
401401
}
402402
*/
403403

404+
if(gEeprom.SCAN_RESUME_MODE < 81)
405+
{
406+
if(gEeprom.SCAN_RESUME_MODE == 0)
407+
{
408+
CHFRSCANNER_Stop();
409+
}
410+
else
411+
{
412+
gScanPauseDelayIn_10ms = gEeprom.SCAN_RESUME_MODE * (250 / 10); // 250ms
413+
gScheduleScanListen = false;
414+
}
415+
}
416+
417+
/*
404418
if(gEeprom.SCAN_RESUME_MODE < 2)
405419
{
406420
gScanPauseDelayIn_10ms = scan_pause_delay_in_6_10ms + (scan_pause_delay_in_6_10ms * 24 * gEeprom.SCAN_RESUME_MODE);
@@ -411,6 +425,7 @@ static void HandleReceive(void)
411425
{
412426
CHFRSCANNER_Stop();
413427
}
428+
*/
414429

415430
/*
416431
switch (gEeprom.SCAN_RESUME_MODE)
@@ -1583,13 +1598,18 @@ void APP_TimeSlice500ms(void)
15831598

15841599
#ifdef ENABLE_FEAT_F4HWN_SLEEP
15851600
if (gSleepModeCountdown_500ms == gSetting_set_off * 120 && gWakeUp) {
1586-
ST7565_Init();
1601+
//ST7565_Init();
1602+
ST7565_FixInterfGlitch();
15871603
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, false);
15881604
gPowerSave_10ms = gEeprom.BATTERY_SAVE * 10;
15891605
gWakeUp = false;
15901606
}
15911607

1608+
#ifdef ENABLE_AIRCOPY
1609+
if(gCurrentFunction != FUNCTION_TRANSMIT && !FUNCTION_IsRx() && gScreenToDisplay != DISPLAY_AIRCOPY)
1610+
#else
15921611
if(gCurrentFunction != FUNCTION_TRANSMIT && !FUNCTION_IsRx())
1612+
#endif
15931613
{
15941614
if (gSleepModeCountdown_500ms > 0 && --gSleepModeCountdown_500ms == 0) {
15951615
gBacklightCountdown_500ms = 0;
@@ -1598,15 +1618,15 @@ void APP_TimeSlice500ms(void)
15981618
PWM_PLUS0_CH0_COMP = 0;
15991619
ST7565_ShutDown();
16001620
}
1601-
else if(gSleepModeCountdown_500ms < 60 && gSetting_set_off != 0)
1621+
else if(gSleepModeCountdown_500ms != 0 && gSleepModeCountdown_500ms < 61 && gSetting_set_off != 0)
16021622
{
1603-
if(gSleepModeCountdown_500ms % 2 == 0)
1623+
if(gSleepModeCountdown_500ms % 4 == 0)
16041624
{
1605-
PWM_PLUS0_CH0_COMP = 0;
1625+
PWM_PLUS0_CH0_COMP = value[gEeprom.BACKLIGHT_MAX] * 4; // Max brightness
16061626
}
16071627
else
16081628
{
1609-
PWM_PLUS0_CH0_COMP = value[gEeprom.BACKLIGHT_MAX] * 4; // Max brightness
1629+
PWM_PLUS0_CH0_COMP = 0;
16101630
}
16111631
}
16121632
}
@@ -1616,9 +1636,9 @@ void APP_TimeSlice500ms(void)
16161636
}
16171637

16181638
if (gWakeUp) {
1619-
static bool swap = true;
1620-
swap = !swap; // Alterne l'état à chaque exécution
1621-
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, swap);
1639+
static uint8_t counter = 0;
1640+
counter = (counter + 1) % 4;
1641+
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, (counter == 0));
16221642
}
16231643
#endif
16241644

@@ -1818,7 +1838,7 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
18181838
gBatterySaveCountdown_10ms = battery_save_count_10ms;
18191839

18201840
if (gEeprom.AUTO_KEYPAD_LOCK)
1821-
gKeyLockCountdown = 30; // 15 seconds
1841+
gKeyLockCountdown = gEeprom.AUTO_KEYPAD_LOCK * 30; // 15 seconds step
18221842

18231843
if (!bKeyPressed) { // key released
18241844
if (flagSaveVfo) {

app/chFrScanner.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ void CHFRSCANNER_ContinueScanning(void)
102102

103103
void CHFRSCANNER_Found(void)
104104
{
105-
if (gEeprom.SCAN_RESUME_MODE > 2) {
105+
if (gEeprom.SCAN_RESUME_MODE > 80) {
106106
if (!gScanPauseMode) {
107-
gScanPauseDelayIn_10ms = scan_pause_delay_in_5_10ms * (gEeprom.SCAN_RESUME_MODE - 2) * 5;
107+
gScanPauseDelayIn_10ms = scan_pause_delay_in_5_10ms * (gEeprom.SCAN_RESUME_MODE - 80) * 5;
108108
gScanPauseMode = true;
109109
}
110110
} else {

app/main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
210210
gEeprom.ScreenChannel[Vfo] = gEeprom.NoaaChannel[gEeprom.TX_VFO];
211211
}
212212
else {
213-
gEeprom.ScreenChannel[Vfo] = gEeprom.FreqChannel[gEeprom.TX_VFO];
213+
gEeprom.ScreenChannel[Vfo] = gEeprom.MrChannel[gEeprom.TX_VFO];
214214
#ifdef ENABLE_VOICE
215-
gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE;
215+
gAnotherVoiceID = VOICE_ID_CHANNEL_MODE;
216216
#endif
217217
}
218218
gRequestSaveVFO = true;

app/menu.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
176176

177177
case MENU_SC_REV:
178178
//*pMin = 0;
179-
*pMax = 26;
179+
*pMax = 104;
180180
break;
181181

182182
case MENU_ROGER:
@@ -235,7 +235,6 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
235235
#endif
236236
case MENU_BCL:
237237
case MENU_BEEP:
238-
case MENU_AUTOLK:
239238
case MENU_S_ADD1:
240239
case MENU_S_ADD2:
241240
case MENU_S_ADD3:
@@ -275,6 +274,10 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
275274
break;
276275
#endif
277276

277+
case MENU_AUTOLK:
278+
*pMax = 40;
279+
break;
280+
278281
case MENU_TOT:
279282
//*pMin = 0;
280283
*pMin = 5;
@@ -634,7 +637,7 @@ void MENU_AcceptSetting(void)
634637

635638
case MENU_AUTOLK:
636639
gEeprom.AUTO_KEYPAD_LOCK = gSubMenuSelection;
637-
gKeyLockCountdown = 30;
640+
gKeyLockCountdown = gEeprom.AUTO_KEYPAD_LOCK * 30; // 15 seconds step
638641
break;
639642

640643
case MENU_S_ADD1:
59.5 KB
Binary file not shown.
57.5 KB
Binary file not shown.

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

59.7 KB
Binary file not shown.

bitmaps.c

+17
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,23 @@ const uint8_t BITMAP_PowerUser[3] =
298298
0b00001000,
299299
};
300300

301+
#ifdef ENABLE_NOAA
302+
const uint8_t BITMAP_NOAA[12] =
303+
{ // "WX"
304+
0b00000000,
305+
0b01111111,
306+
0b00100000,
307+
0b00011000,
308+
0b00100000,
309+
0b01111111,
310+
0b00000000,
311+
0b01100011,
312+
0b00010100,
313+
0b00001000,
314+
0b00010100,
315+
0b01100011
316+
};
317+
#endif
301318

302319
#ifndef ENABLE_CUSTOM_MENU_LAYOUT
303320
const uint8_t BITMAP_CurrentIndicator[8] = {

bitmaps.h

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ extern const uint8_t BITMAP_ScanListE[7];
4141
extern const uint8_t BITMAP_PowerUser[3];
4242
extern const uint8_t BITMAP_compand[6];
4343

44+
extern const uint8_t BITMAP_NOAA[12];
45+
4446
#ifndef ENABLE_CUSTOM_MENU_LAYOUT
4547
extern const uint8_t BITMAP_CurrentIndicator[8];
4648
#endif

compile-with-docker-all.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
#export DOCKER_DEFAULT_PLATFORM=linux/amd64
3+
IMAGE_NAME="uvk5"
4+
rm "${PWD}/compiled-firmware/*"
5+
docker build -t $IMAGE_NAME .
6+
docker run --rm -v "${PWD}/compiled-firmware/:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
7+
ENABLE_SPECTRUM=1 \
8+
ENABLE_FMRADIO=0 \
9+
ENABLE_AIRCOPY=1 \
10+
ENABLE_NOAA=0 \
11+
TARGET=f4hwn.bandscope \
12+
&& cp f4hwn.bandscope* compiled-firmware/"
13+
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
14+
ENABLE_SPECTRUM=0 \
15+
ENABLE_FMRADIO=1 \
16+
ENABLE_AIRCOPY=1 \
17+
ENABLE_NOAA=0 \
18+
TARGET=f4hwn.broadcast \
19+
&& cp f4hwn.broadcast* compiled-firmware/"
20+
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
21+
ENABLE_SPECTRUM=1 \
22+
ENABLE_FMRADIO=1 \
23+
ENABLE_VOX=0 \
24+
ENABLE_AIRCOPY=0 \
25+
ENABLE_AUDIO_BAR=0 \
26+
ENABLE_FEAT_F4HWN_SPECTRUM=0 \
27+
ENABLE_FEAT_F4HWN_SLEEP=0 \
28+
ENABLE_NOAA=0 \
29+
TARGET=f4hwn.voxless \
30+
&& cp f4hwn.voxless* compiled-firmware/"

compile-with-docker.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/sh
2-
2+
#export DOCKER_DEFAULT_PLATFORM=linux/amd64
33
IMAGE_NAME="uvk5"
4-
54
docker build -t $IMAGE_NAME .
6-
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make && cp f4hwn* compiled-firmware/"
5+
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/"

functions.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void FUNCTION_Init(void)
7979
gNOAACountdown_10ms = 0;
8080

8181
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE)) {
82-
gCurrentCodeType = CODE_TYPE_CONTINUOUS_TONE;
82+
gCurrentCodeType = CODE_TYPE_OFF;
8383
}
8484
#endif
8585

settings.c

+12-10
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ void SETTINGS_InitEEPROM(void)
119119
gEeprom.KEY_1_LONG_PRESS_ACTION = (Data[2] < ACTION_OPT_LEN) ? Data[2] : ACTION_OPT_NONE;
120120
gEeprom.KEY_2_SHORT_PRESS_ACTION = (Data[3] < ACTION_OPT_LEN) ? Data[3] : ACTION_OPT_SCAN;
121121
gEeprom.KEY_2_LONG_PRESS_ACTION = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_NONE;
122-
gEeprom.SCAN_RESUME_MODE = (Data[5] < 27) ? Data[5] : 1;
123-
gEeprom.AUTO_KEYPAD_LOCK = (Data[6] < 2) ? Data[6] : false;
122+
gEeprom.SCAN_RESUME_MODE = (Data[5] < 105) ? Data[5] : 14;
123+
gEeprom.AUTO_KEYPAD_LOCK = (Data[6] < 41) ? Data[6] : 0;
124124
#ifdef ENABLE_FEAT_F4HWN
125125
gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 6) ? Data[7] : POWER_ON_DISPLAY_MODE_VOLTAGE;
126126
#else
@@ -350,8 +350,8 @@ void SETTINGS_InitEEPROM(void)
350350
gSetting_set_ctr = (ctr_value > 0 && ctr_value < 16) ? ctr_value : 10;
351351

352352
gSetting_set_tmr = Data[4] & 0x01;
353-
#ifdef ENABLE_FEAT_F4HWN_SLEEP
354-
gSetting_set_off = Data[4] >> 1;
353+
#ifdef ENABLE_FEAT_F4HWN_SLEEP
354+
gSetting_set_off = (Data[4] >> 1) > 120 ? 60 : (Data[4] >> 1);
355355
#endif
356356

357357
// Warning
@@ -727,7 +727,9 @@ void SETTINGS_SaveSettings(void)
727727
EEPROM_WriteBuffer(0x0F40, State);
728728

729729
#ifdef ENABLE_FEAT_F4HWN
730-
memset(State, 0xFF, sizeof(State));
730+
EEPROM_ReadBuffer(0x1FF0, State, sizeof(State));
731+
732+
//memset(State, 0xFF, sizeof(State));
731733

732734
/*
733735
tmp = 0;
@@ -904,13 +906,13 @@ void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep,
904906

905907
void SETTINGS_WriteBuildOptions(void)
906908
{
907-
uint8_t buf[8] = {0};
909+
uint8_t State[8];
908910

909911
#ifdef ENABLE_FEAT_F4HWN
910-
EEPROM_ReadBuffer(0x1FF0, buf, 8);
912+
EEPROM_ReadBuffer(0x1FF0, State, sizeof(State));
911913
#endif
912914

913-
buf[0] = 0
915+
State[0] = 0
914916
#ifdef ENABLE_FMRADIO
915917
| (1 << 0)
916918
#endif
@@ -937,7 +939,7 @@ buf[0] = 0
937939
#endif
938940
;
939941

940-
buf[1] = 0
942+
State[1] = 0
941943
#ifdef ENABLE_FLASHLIGHT
942944
| (1 << 0)
943945
#endif
@@ -957,5 +959,5 @@ buf[1] = 0
957959
| (1 << 5)
958960
#endif
959961
;
960-
EEPROM_WriteBuffer(0x1FF0, buf);
962+
EEPROM_WriteBuffer(0x1FF0, State);
961963
}

settings.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ typedef struct {
211211
uint8_t field37_0x32;
212212
uint8_t field38_0x33;
213213

214-
bool AUTO_KEYPAD_LOCK;
214+
uint8_t AUTO_KEYPAD_LOCK;
215215
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
216216
ALARM_Mode_t ALARM_MODE;
217217
#endif

ui/menu.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,6 @@ const char* const gSubMenu_RXMode[] =
232232
};
233233
#endif
234234

235-
const char gSubMenu_SC_REV[][13] =
236-
{
237-
"CARRIER\nFAST",
238-
"CARRIER\nSLOW",
239-
"STOP"
240-
};
241-
242235
const char* const gSubMenu_MDF[] =
243236
{
244237
"FREQ",
@@ -712,7 +705,10 @@ void UI_DisplayMenu(void)
712705
break;
713706

714707
case MENU_AUTOLK:
715-
strcpy(String, (gSubMenuSelection == 0) ? "OFF" : "AUTO");
708+
if (gSubMenuSelection == 0)
709+
strcpy(String, "OFF");
710+
else
711+
sprintf(String, "%02dm:%02ds", ((gSubMenuSelection * 15) / 60), ((gSubMenuSelection * 15) % 60));
716712
break;
717713

718714
case MENU_COMPAND:
@@ -835,13 +831,17 @@ void UI_DisplayMenu(void)
835831
#endif
836832

837833
case MENU_SC_REV:
838-
if(gSubMenuSelection < 3)
834+
if(gSubMenuSelection == 0)
835+
{
836+
strcpy(String, "STOP");
837+
}
838+
else if(gSubMenuSelection < 81)
839839
{
840-
strcpy(String, gSubMenu_SC_REV[gSubMenuSelection]);
840+
sprintf(String, "CARRIER\n%02ds:%03dms", ((gSubMenuSelection * 250) / 1000), ((gSubMenuSelection * 250) % 1000));
841841
}
842842
else
843843
{
844-
sprintf(String, "TIMEOUT\n%02dm:%02ds", (((gSubMenuSelection - 2) * 5) / 60), (((gSubMenuSelection - 2) * 5) % 60));
844+
sprintf(String, "TIMEOUT\n%02dm:%02ds", (((gSubMenuSelection - 80) * 5) / 60), (((gSubMenuSelection - 80) * 5) % 60));
845845
}
846846
break;
847847

@@ -995,7 +995,7 @@ void UI_DisplayMenu(void)
995995
}
996996
else if(gSubMenuSelection < 121)
997997
{
998-
sprintf(String, "%02dh:%02dm", (gSubMenuSelection / 60), (gSubMenuSelection % 60));
998+
sprintf(String, "%dh:%02dm", (gSubMenuSelection / 60), (gSubMenuSelection % 60));
999999
}
10001000
break;
10011001
#endif

0 commit comments

Comments
 (0)