Merge pull request #17 from armel/feature_update

Feature update
This commit is contained in:
Armel FAUVEAU
2024-04-23 02:59:01 +02:00
committed by GitHub
14 changed files with 105 additions and 91 deletions

View File

@@ -211,7 +211,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
VERSION_STRING_1 ?= v0.22
AUTHOR_STRING_2 ?= F4HWN
VERSION_STRING_2 ?= v2.5
VERSION_STRING_2 ?= v2.6
AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2)
VERSION_STRING ?= $(VERSION_STRING_2)

View File

@@ -22,7 +22,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 and Jean-Claude 14FRS3306 for their [donations](https://www.paypal.com/paypalme/F4HWN). Thats 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 and Thierry F4GVO for their [donations](https://www.paypal.com/paypalme/F4HWN). Thats so kind of them. Thanks so much 🙏🏻
## Table of Contents
@@ -42,8 +42,8 @@ Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC
* improve default power settings level (Low ~125mW, Mid ~2W and High ~5W),
* improve s-meter (IARU recommandations),
* improve UI:
* menu index,
* s-meter design,
* menu index is always visible, even if a menu is selected,
* s-meter new design (Classic or Tiny),
* MAIN ONLY screen mode,
* DUAL and CROSS screen mode,
* RX blink on VFO RX,
@@ -53,6 +53,9 @@ Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC
* CTCSS or DCS value,
* KeyLock message,
* last RX,
* move BatTxt menu from 34/63 to 30/63 (just after BatSave menu 29/63),
* rename BackLt to BLTime,
* rename BltTRX to BLTxRx,
* and more...
* new menu entries:
* add SetLow menu to set low power (<20mW, 125mW, 250mW, 500mW and 1W),
@@ -71,12 +74,14 @@ Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC
* improve status bar,
* add SetPtt mode in status bar,
* change font and bitmaps,
* move USB icon to left of battery information,
* add RX and TX timers,
* new actions:
* SWITCH RxMode,
* SWITCH PTT,
* SWITCH WIDE NARROW,
* 1750Hz,
* BlMin Tmp Pff,
* BlMin Tmp Off,
* 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,

View File

@@ -125,6 +125,8 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
//SETTINGS_SaveChannel(channel, gEeprom.RX_VFO, gRxVfo, 1);
gRequestSaveChannel = 1;
gUpdateDisplay = true;
}
#endif

Binary file not shown.

Binary file not shown.

View File

@@ -11,16 +11,6 @@ const uint8_t gFontPowerSave[2][6] =
{0x00, 0x26, 0x49, 0x49, 0x49, 0x32},
};
const uint8_t gFontTx[1][5] =
{
{0x3, 0x1, 0x7f, 0x1, 0x3},
};
const uint8_t gFontRx[1][5] =
{
{0x7f, 0x9, 0x19, 0x29, 0x46},
};
const uint8_t gFontPttOnePush[2][6] =
{
{0x00, 0x3e, 0x41, 0x41, 0x41, 0x3e},
@@ -39,9 +29,9 @@ const uint8_t gFontFM[2][6] =
{0x00, 0x7f, 0x2, 0x1c, 0x2, 0x7f},
};
const uint8_t gFontKeyLock[1][8] =
const uint8_t gFontKeyLock[1][9] =
{
{0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c}
{0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c}
};
const uint8_t gFontScanAll[9] =

View File

@@ -5,12 +5,10 @@
#include <stdint.h>
extern const uint8_t gFontPowerSave[2][6];
extern const uint8_t gFontTx[1][5];
extern const uint8_t gFontRx[1][5];
extern const uint8_t gFontPttOnePush[2][6];
extern const uint8_t gFontPttClassic[2][6];
extern const uint8_t gFontFM[2][6];
extern const uint8_t gFontKeyLock[1][8];
extern const uint8_t gFontKeyLock[1][9];
extern const uint8_t gFontScanAll[9];
extern const uint8_t gFontLight[9];

View File

@@ -210,6 +210,7 @@ void FUNCTION_Transmit()
AUDIO_AudioPathOn();
gEnableSpeaker = true;
gVfoConfigureMode = VFO_CONFIGURE;
return;
}
#endif

1
misc.c
View File

@@ -159,6 +159,7 @@ volatile bool gTxTimeoutReached;
volatile uint16_t gTxTimerCountdownAlert_500ms;
volatile bool gTxTimeoutReachedAlert;
volatile uint16_t gTxTimeoutToneAlert = 800;
volatile uint16_t gRxTimerCountdown_500ms;
#endif
volatile uint16_t gTailNoteEliminationCountdown_10ms;

1
misc.h
View File

@@ -222,6 +222,7 @@ extern volatile bool gTxTimeoutReached;
extern volatile uint16_t gTxTimerCountdownAlert_500ms;
extern volatile bool gTxTimeoutReachedAlert;
extern volatile uint16_t gTxTimeoutToneAlert;
extern volatile uint16_t gRxTimerCountdown_500ms;
#endif
extern volatile uint16_t gTailNoteEliminationCountdown_10ms;

View File

@@ -58,6 +58,7 @@ void SystickHandler(void)
#ifdef ENABLE_FEAT_F4HWN
DECREMENT_AND_TRIGGER(gTxTimerCountdownAlert_500ms - ALERT_TOT * 2, gTxTimeoutReachedAlert);
DECREMENT(gRxTimerCountdown_500ms);
#endif
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);

View File

@@ -53,6 +53,10 @@ center_line_t center_line = CENTER_LINE_NONE;
bool isMainOnlyInputDTMF = false;
static int16_t map(int16_t x, int16_t in_min, int16_t in_max, int16_t out_min, int16_t out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
static bool isMainOnly(bool checkGui)
{
if(checkGui)
@@ -252,12 +256,6 @@ void UI_DisplayAudioBar(void)
}
#endif
#ifdef ENABLE_FEAT_F4HWN
static int16_t map(int16_t x, int16_t in_min, int16_t in_max, int16_t out_min, int16_t out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
#endif
void DisplayRSSIBar(const bool now)
{
#if defined(ENABLE_RSSI_BAR)
@@ -800,6 +798,8 @@ void UI_DisplayMain(void)
#ifdef ENABLE_FEAT_F4HWN
else
{
gRxTimerCountdown_500ms = 7200;
if(RxOnVfofrequency == frequency && !isMainOnly(false))
{
UI_PrintStringSmallNormal(">>", 14, 0, line);

View File

@@ -77,17 +77,17 @@ const t_menu_item MenuList[] =
{"KeyLck", MENU_AUTOLK }, // was "AUTOLk"
{"TxTOut", MENU_TOT }, // was "TOT"
{"BatSav", MENU_SAVE }, // was "SAVE"
{"BatTxt", MENU_BAT_TXT },
{"Mic", MENU_MIC },
#ifdef ENABLE_AUDIO_BAR
{"MicBar", MENU_MIC_BAR },
#endif
{"ChDisp", MENU_MDF }, // was "MDF"
{"POnMsg", MENU_PONMSG },
{"BatTxt", MENU_BAT_TXT },
{"BackLt", MENU_ABR }, // was "ABR"
{"BLTime", MENU_ABR }, // was "ABR"
{"BLMin", MENU_ABR_MIN },
{"BLMax", MENU_ABR_MAX },
{"BltTRX", MENU_ABR_ON_TX_RX },
{"BLTxRx", MENU_ABR_ON_TX_RX },
{"Beep", MENU_BEEP },
#ifdef ENABLE_VOICE
{"Voice", MENU_VOICE },
@@ -516,10 +516,7 @@ void UI_DisplayMenu(void)
}
// draw the menu index number/count
#ifdef ENABLE_FEAT_F4HWN
sprintf(String, "%02u/%u", 1 + gMenuCursor, gMenuListCount);
UI_PrintStringSmallNormal(String, 6, 0, 6);
#else
#ifndef ENABLE_FEAT_F4HWN
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
UI_PrintStringSmallNormal(String, 2, 0, 6);
#endif
@@ -530,6 +527,11 @@ void UI_DisplayMenu(void)
UI_PrintString(MenuList[menu_index].name, 0, 0, 0, 8);
// UI_PrintStringSmallNormal(String, 0, 0, 0);
}
#ifdef ENABLE_FEAT_F4HWN
sprintf(String, "%02u/%u", 1 + gMenuCursor, gMenuListCount);
UI_PrintStringSmallNormal(String, 6, 0, 6);
#endif
}
#endif

View File

@@ -34,8 +34,33 @@
#include "ui/ui.h"
#include "ui/status.h"
static void convertTime(uint8_t *line, uint8_t type)
{
char str[8] = "";
uint8_t m, s; // Declare variables for seconds, hours, minutes, and seconds
uint16_t t;
if(type == 0) // Tx timer
t = (gTxTimerCountdown_500ms / 2);
//t = ((gEeprom.TX_TIMEOUT_TIMER + 1) * 5) - (gTxTimerCountdown_500ms / 2);
else // Rx timer
t = 3600 - (gRxTimerCountdown_500ms / 2);
m = t / 60;
s = t - (m * 60);
sprintf(str, "%02d:%02d", m, s);
UI_PrintStringSmallBufferNormal(str, line + 0);
gUpdateStatus = true;
}
void UI_DisplayStatus()
{
char str[8] = "";
gUpdateStatus = false;
memset(gStatusLine, 0, sizeof(gStatusLine));
@@ -44,13 +69,7 @@ void UI_DisplayStatus()
// **************
// POWER-SAVE indicator
if (gCurrentFunction == FUNCTION_TRANSMIT) {
memcpy(line + x, gFontTx, sizeof(gFontTx));
}
else if (FUNCTION_IsRx()) {
memcpy(line + x, gFontRx, sizeof(gFontRx));
}
else if (gCurrentFunction == FUNCTION_POWER_SAVE) {
if (gCurrentFunction == FUNCTION_POWER_SAVE) {
memcpy(line + x, gFontPowerSave, sizeof(gFontPowerSave));
}
x += 8;
@@ -108,9 +127,8 @@ void UI_DisplayStatus()
bool debug = false;
if(debug)
{
char sDebug[8] = "";
sprintf(sDebug, "%d", gDebug);
UI_PrintStringSmallBufferNormal(sDebug, line + x + 1);
sprintf(str, "%d", gDebug);
UI_PrintStringSmallBufferNormal(str, line + x + 1);
x += 16;
}
else
@@ -126,6 +144,16 @@ void UI_DisplayStatus()
#endif
if(!SCANNER_IsScanning()) {
if(gCurrentFunction == FUNCTION_TRANSMIT)
{
convertTime(line, 0);
}
else if(FUNCTION_IsRx())
{
convertTime(line, 1);
}
else
{
uint8_t dw = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2;
if(dw == 1 || dw == 3) { // DWR - dual watch + respond
if(gDualWatchActive)
@@ -141,6 +169,7 @@ void UI_DisplayStatus()
memcpy(line + x + 2, gFontMO, sizeof(gFontMO));
}
}
}
x += sizeof(gFontDWR) + 3;
}
@@ -172,31 +201,28 @@ void UI_DisplayStatus()
// KEY-LOCK indicator
if (gEeprom.KEY_LOCK) {
memcpy(line + x + 1, gFontKeyLock, sizeof(gFontKeyLock));
x += sizeof(gFontKeyLock);
x1 = x;
}
else if (gWasFKeyPressed) {
UI_PrintStringSmallBufferNormal("F", line + x + 1);
x += sizeof(gFontKeyLock);
for (uint8_t i = 71; i < 79; i++)
{
gStatusLine[i] ^= 0x7F;
}
x1 = x;
}
else if(gBackLight)
else if (gBackLight)
{
memcpy(line + x + 1, gFontLight, sizeof(gFontLight));
x += sizeof(gFontLight);
x1 = x;
}
else if (gChargingWithTypeC)
{
memcpy(line + x + 1, BITMAP_USB_C, sizeof(BITMAP_USB_C));
}
{ // battery voltage or percentage
char s[8] = "";
// Battery
unsigned int x2 = LCD_WIDTH - sizeof(BITMAP_BatteryLevel1) - 0;
if (gChargingWithTypeC)
x2 -= sizeof(BITMAP_USB_C); // the radio is on charge
UI_DrawBattery(line + x2, gBatteryDisplayLevel, gLowBatteryBlink);
switch (gSetting_battery_text) {
default:
@@ -206,33 +232,20 @@ void UI_DisplayStatus()
case 1: { // voltage
const uint16_t voltage = (gBatteryVoltageAverage <= 999) ? gBatteryVoltageAverage : 999; // limit to 9.99V
#ifdef ENABLE_FEAT_F4HWN
sprintf(s, "%u.%02u", voltage / 100, voltage % 100);
sprintf(str, "%u.%02u", voltage / 100, voltage % 100);
#else
sprintf(s, "%u.%02uV", voltage / 100, voltage % 100);
sprintf(str, "%u.%02uV", voltage / 100, voltage % 100);
#endif
break;
}
case 2: // percentage
sprintf(s, "%u%%", BATTERY_VoltsToPercent(gBatteryVoltageAverage));
sprintf(str, "%u%%", BATTERY_VoltsToPercent(gBatteryVoltageAverage));
break;
}
unsigned int space_needed = (7 * strlen(s));
if (x2 >= (x1 + space_needed))
UI_PrintStringSmallBufferNormal(s, line + x2 - space_needed);
}
// move to right side of the screen
x = LCD_WIDTH - sizeof(BITMAP_BatteryLevel1) - sizeof(BITMAP_USB_C);
// USB-C charge indicator
if (gChargingWithTypeC)
memcpy(line + x, BITMAP_USB_C, sizeof(BITMAP_USB_C));
x += sizeof(BITMAP_USB_C);
// BATTERY LEVEL indicator
UI_DrawBattery(line + x, gBatteryDisplayLevel, gLowBatteryBlink);
x2 -= (7 * strlen(str));
UI_PrintStringSmallBufferNormal(str, line + x2);
// **************