Skip to content

Commit fbcf26d

Browse files
authored
Merge pull request #517 from armel/feature_update_v4
Feature update v4
2 parents beec11d + 657d39d commit fbcf26d

23 files changed

+269
-150
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ compile_commands.json
99
.vscode
1010
/docs
1111
k5_eeprom.raw
12+
f4hwn
13+
f4hwn.*
14+
!archive/f4hwn*

Dockerfile

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
ARG BUILDPLATFORM
2-
FROM --platform=${BUILDPLATFORM} archlinux:latest
3-
RUN pacman -Syyu base-devel --noconfirm
4-
RUN pacman -Syyu arm-none-eabi-gcc --noconfirm
5-
RUN pacman -Syyu arm-none-eabi-newlib --noconfirm
6-
RUN pacman -Syyu git --noconfirm
7-
RUN pacman -Syyu python-pip --noconfirm
8-
RUN pacman -Syyu python-crcmod --noconfirm
1+
# syntax=docker/dockerfile:1.6
2+
3+
# Parametric Alpine tag. Override at build time with:
4+
# docker build --build-arg ALPINE_TAG=3.21 -t uvk5 .
5+
# Examples: 3.22, 3.21, 3.19, edge
6+
ARG ALPINE_TAG=3.21
7+
FROM alpine:${ALPINE_TAG}
8+
9+
# Toolchain and utilities needed to build the firmware
10+
RUN apk add --no-cache \
11+
bash \
12+
build-base \
13+
gcc-arm-none-eabi \
14+
newlib-arm-none-eabi \
15+
python3 \
16+
py3-crcmod \
17+
py3-pip \
18+
git
19+
20+
# Project workspace
921
WORKDIR /app
22+
23+
# Copy sources into the image (the script mounts the repo and runs builds)
1024
COPY . .
11-
RUN git submodule update --init --recursive

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ ENABLE_CLANG ?= 0
7979
ENABLE_SWD ?= 0
8080
ENABLE_OVERLAY ?= 0
8181
ENABLE_LTO ?= 1
82+
ENABLE_EXPERIMENTAL_CLFAGS ?= 1
8283

8384
#############################################################
8485

@@ -246,7 +247,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
246247
VERSION_STRING_1 ?= v0.22
247248

248249
AUTHOR_STRING_2 ?= F4HWN
249-
VERSION_STRING_2 ?= v4.2
250+
VERSION_STRING_2 ?= v4.3
250251

251252
EDITION_STRING ?= Custom
252253

@@ -290,6 +291,10 @@ else
290291
CFLAGS += -Oz -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c2x -MMD
291292
endif
292293

294+
ifeq ($(ENABLE_EXPERIMENTAL_CLFAGS),1)
295+
CFLAGS += -funroll-loops -ffat-lto-objects
296+
endif
297+
293298
ifeq ($(ENABLE_LTO),1)
294299
CFLAGS += -flto=auto
295300
else

README.md

Lines changed: 1 addition & 1 deletion
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 (2 times), Fabrice 14RC123, David F4BPP, Olivier 14RC206, Frédéric F4ESO, Stéphane F5LGW, Jorge Ornelas (4 times), Laurent F4AXK, Christophe Morel, Clayton W0LED, Pierre Antoine F6FWB, Jean-Claude 14FRS3306, Thierry F4GVO, Eric F1NOU, PricelessToolkit, Ady M6NYJ, Tom McGovern (3 times), 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 (3 times), Johan F4WAT, Robert Wörle, Rafael Sundorf, Paul Harker, Peter Fintl, Pascal F4ICR (2 times), Mike DL2MF, Eric KI1C (2 times), Phil G0ELM, Jérôme Lambert, Meinhard Frank Günther, Eliot Vedel, Alfonso EA7KDF, Jean-François F1EVM, Robert DC1RDB, Ian KE2CHJ, Daryl VK3AWA, Roberto Brunelli, Robert Boardman and Stephen Oliver 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 (2 times), Fabrice 14RC123, David F4BPP, Olivier 14RC206, Frédéric F4ESO, Stéphane F5LGW, Jorge Ornelas (4 times), Laurent F4AXK, Christophe Morel, Clayton W0LED, Pierre Antoine F6FWB, Jean-Claude 14FRS3306, Thierry F4GVO, Eric F1NOU, PricelessToolkit, Ady M6NYJ, Tom McGovern (4 times), 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 (3 times), Johan F4WAT, Robert Wörle, Rafael Sundorf, Paul Harker, Peter Fintl, Pascal F4ICR (2 times), Mike DL2MF, Eric KI1C (2 times), Phil G0ELM, Jérôme Lambert, Meinhard Frank Günther, Eliot Vedel, Alfonso EA7KDF, Jean-François F1EVM, Robert DC1RDB, Ian KE2CHJ, Daryl VK3AWA, Roberto Brunelli, Robert Boardman, Stephen Oliver, Nicolas F4INE and William Bruno 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/generic.c

Lines changed: 46 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -39,78 +39,61 @@
3939

4040
void GENERIC_Key_F(bool bKeyPressed, bool bKeyHeld)
4141
{
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;
42+
if (gInputBoxIndex > 0) {
43+
if (!bKeyHeld && bKeyPressed) // short pressed
44+
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
45+
return;
46+
}
4947

50-
if (!bKeyPressed) // won't ever pass
51-
return;
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;
5252

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;
53+
if (!bKeyPressed) // won't ever pass
54+
return;
55+
56+
COMMON_KeypadLockToggle();
6257
}
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
6366

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;
67+
gWasFKeyPressed = !gWasFKeyPressed; // toggle F function
6868

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

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-
}
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;
9486
}
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-
}
10387

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;
88+
#ifdef ENABLE_FMRADIO
89+
if (gFM_ScanState == FM_SCAN_OFF) { // not scanning
90+
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
91+
return;
11292
}
113-
#endif
93+
#endif
94+
gBeepToPlay = BEEP_440HZ_500MS;
95+
gPttWasReleased = true;
96+
}
11497
}
11598

11699
void GENERIC_Key_PTT(bool bKeyPressed)

0 commit comments

Comments
 (0)