mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-29 06:41:25 +03:00
Added TX timeout bar compile option when TX'ing
This commit is contained in:
parent
0547452589
commit
83c3c8ce1c
12
Makefile
12
Makefile
@ -11,10 +11,10 @@ ENABLE_UART := 1
|
|||||||
ENABLE_AIRCOPY := 0
|
ENABLE_AIRCOPY := 0
|
||||||
ENABLE_FMRADIO := 1
|
ENABLE_FMRADIO := 1
|
||||||
ENABLE_NOAA := 0
|
ENABLE_NOAA := 0
|
||||||
ENABLE_VOICE := 0
|
ENABLE_VOICE := 1
|
||||||
ENABLE_VOX := 0
|
ENABLE_VOX := 1
|
||||||
ENABLE_ALARM := 0
|
ENABLE_ALARM := 0
|
||||||
ENABLE_TX1750 := 0
|
ENABLE_TX1750 := 1
|
||||||
ENABLE_PWRON_PASSWORD := 0
|
ENABLE_PWRON_PASSWORD := 0
|
||||||
ENABLE_BIG_FREQ := 0
|
ENABLE_BIG_FREQ := 0
|
||||||
ENABLE_SMALL_BOLD := 1
|
ENABLE_SMALL_BOLD := 1
|
||||||
@ -34,9 +34,10 @@ ENABLE_SQUELCH_MORE_SENSITIVE := 1
|
|||||||
ENABLE_FASTER_CHANNEL_SCAN := 1
|
ENABLE_FASTER_CHANNEL_SCAN := 1
|
||||||
ENABLE_RSSI_BAR := 1
|
ENABLE_RSSI_BAR := 1
|
||||||
ENABLE_AUDIO_BAR := 0
|
ENABLE_AUDIO_BAR := 0
|
||||||
|
ENABLE_SHOW_TX_TIMEOUT := 1
|
||||||
ENABLE_COPY_CHAN_TO_VFO := 1
|
ENABLE_COPY_CHAN_TO_VFO := 1
|
||||||
#ENABLE_SINGLE_VFO_CHAN := 1
|
|
||||||
#ENABLE_PANADAPTER := 1
|
#ENABLE_PANADAPTER := 1
|
||||||
|
#ENABLE_SINGLE_VFO_CHAN := 1
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
@ -303,6 +304,9 @@ endif
|
|||||||
ifeq ($(ENABLE_AUDIO_BAR),1)
|
ifeq ($(ENABLE_AUDIO_BAR),1)
|
||||||
CFLAGS += -DENABLE_AUDIO_BAR
|
CFLAGS += -DENABLE_AUDIO_BAR
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(ENABLE_SHOW_TX_TIMEOUT),1)
|
||||||
|
CFLAGS += -DENABLE_SHOW_TX_TIMEOUT
|
||||||
|
endif
|
||||||
ifeq ($(ENABLE_COPY_CHAN_TO_VFO),1)
|
ifeq ($(ENABLE_COPY_CHAN_TO_VFO),1)
|
||||||
CFLAGS += -DENABLE_COPY_CHAN_TO_VFO
|
CFLAGS += -DENABLE_COPY_CHAN_TO_VFO
|
||||||
endif
|
endif
|
||||||
|
@ -61,6 +61,7 @@ ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit more s
|
|||||||
ENABLE_FASTER_CHANNEL_SCAN := 0 increases the channel scan speed, but the squelch is also made more twitchy
|
ENABLE_FASTER_CHANNEL_SCAN := 0 increases the channel scan speed, but the squelch is also made more twitchy
|
||||||
ENABLE_RSSI_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols
|
ENABLE_RSSI_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols
|
||||||
ENABLE_AUDIO_BAR := 0 experimental, display an audo bar level when TX'ing
|
ENABLE_AUDIO_BAR := 0 experimental, display an audo bar level when TX'ing
|
||||||
|
ENABLE_SHOW_TX_TIMEOUT := 1 show the TX time left (TX timeout)
|
||||||
ENABLE_COPY_CHAN_TO_VFO := 1 copy current channel into the other VFO. Long press Menu key ('M')
|
ENABLE_COPY_CHAN_TO_VFO := 1 copy current channel into the other VFO. Long press Menu key ('M')
|
||||||
#ENABLE_SINGLE_VFO_CHAN := 1 not yet implemented - single VFO on display when possible
|
#ENABLE_SINGLE_VFO_CHAN := 1 not yet implemented - single VFO on display when possible
|
||||||
#ENABLE_BAND_SCOPE := 1 not yet implemented - spectrum/pan-adapter
|
#ENABLE_BAND_SCOPE := 1 not yet implemented - spectrum/pan-adapter
|
||||||
|
@ -2039,6 +2039,11 @@ void APP_TimeSlice500ms(void)
|
|||||||
gUpdateDisplay = true;
|
gUpdateDisplay = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_SHOW_TX_TIMEOUT
|
||||||
|
if (gCurrentFunction == FUNCTION_TRANSMIT && (gTxTimerCountdown_500ms & 1))
|
||||||
|
UI_DisplayTXCountdown(true);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
76
ui/main.c
76
ui/main.c
@ -38,12 +38,72 @@
|
|||||||
#include "ui/helper.h"
|
#include "ui/helper.h"
|
||||||
#include "ui/inputbox.h"
|
#include "ui/inputbox.h"
|
||||||
#include "ui/main.h"
|
#include "ui/main.h"
|
||||||
|
#include "ui/menu.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
|
||||||
center_line_t center_line = CENTER_LINE_NONE;
|
center_line_t center_line = CENTER_LINE_NONE;
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
|
||||||
|
#ifdef ENABLE_SHOW_TX_TIMEOUT
|
||||||
|
bool UI_DisplayTXCountdown(const bool now)
|
||||||
|
{
|
||||||
|
unsigned int timeout_secs = 0;
|
||||||
|
|
||||||
|
if (gCurrentFunction != FUNCTION_TRANSMIT)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (center_line != CENTER_LINE_NONE && center_line != CENTER_LINE_TX_TIMEOUT)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (gEeprom.TX_TIMEOUT_TIMER == 0)
|
||||||
|
timeout_secs = 30; // 30 sec
|
||||||
|
else
|
||||||
|
if (gEeprom.TX_TIMEOUT_TIMER < (ARRAY_SIZE(gSubMenu_TOT) - 1))
|
||||||
|
timeout_secs = 60 * gEeprom.TX_TIMEOUT_TIMER; // minutes
|
||||||
|
else
|
||||||
|
timeout_secs = 60 * 15; // 15 minutes
|
||||||
|
|
||||||
|
if (timeout_secs == 0 || gTxTimerCountdown_500ms == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
{
|
||||||
|
const unsigned int line = 3;
|
||||||
|
const unsigned int txt_width = 7 * 6; // 6 text chars
|
||||||
|
const unsigned int bar_x = 2 + txt_width + 4; // X coord of bar graph
|
||||||
|
const unsigned int bar_width = LCD_WIDTH - 1 - bar_x;
|
||||||
|
const unsigned int secs = gTxTimerCountdown_500ms / 2;
|
||||||
|
const unsigned int level = ((secs * bar_width) + (timeout_secs / 2)) / timeout_secs; // with rounding
|
||||||
|
// const unsigned int level = (((timeout_secs - secs) * bar_width) + (timeout_secs / 2)) / timeout_secs; // with rounding
|
||||||
|
const unsigned int len = (level <= bar_width) ? level : bar_width;
|
||||||
|
uint8_t *p_line = gFrameBuffer[line];
|
||||||
|
unsigned int i;
|
||||||
|
char s[16];
|
||||||
|
|
||||||
|
if (now)
|
||||||
|
memset(p_line, 0, LCD_WIDTH);
|
||||||
|
|
||||||
|
sprintf(s, "TX %u", secs);
|
||||||
|
UI_PrintStringSmall(s, 2, 0, line);
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
// solid bar
|
||||||
|
for (i = 0; i < bar_width; i++)
|
||||||
|
p_line[bar_x + i] = (i > len) ? ((i & 1) == 0) ? 0x41 : 0x00 : ((i & 1) == 0) ? 0x7f : 0x3e;
|
||||||
|
#else
|
||||||
|
// knuled bar
|
||||||
|
for (i = 0; i < bar_width; i += 2)
|
||||||
|
p_line[bar_x + i] = (i <= len) ? 0x7f : 0x41;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (now)
|
||||||
|
ST7565_BlitFullScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void UI_drawBars(uint8_t *p, const unsigned int level)
|
void UI_drawBars(uint8_t *p, const unsigned int level)
|
||||||
{
|
{
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
@ -152,7 +212,7 @@ void UI_drawBars(uint8_t *p, const unsigned int level)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_RSSI_BAR)
|
#ifdef ENABLE_RSSI_BAR
|
||||||
void UI_DisplayRSSIBar(const int16_t rssi, const bool now)
|
void UI_DisplayRSSIBar(const int16_t rssi, const bool now)
|
||||||
{
|
{
|
||||||
// const int16_t s0_dBm = -127; // S0 .. base level
|
// const int16_t s0_dBm = -127; // S0 .. base level
|
||||||
@ -723,7 +783,17 @@ void UI_DisplayMain(void)
|
|||||||
gCurrentFunction == FUNCTION_MONITOR ||
|
gCurrentFunction == FUNCTION_MONITOR ||
|
||||||
gCurrentFunction == FUNCTION_INCOMING);
|
gCurrentFunction == FUNCTION_INCOMING);
|
||||||
|
|
||||||
|
#ifdef ENABLE_SHOW_TX_TIMEOUT
|
||||||
|
// show the TX timeout count down
|
||||||
|
if (UI_DisplayTXCountdown(false))
|
||||||
|
{
|
||||||
|
center_line = CENTER_LINE_TX_TIMEOUT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_AUDIO_BAR
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
// show the TX audio level
|
||||||
if (gSetting_mic_bar && gCurrentFunction == FUNCTION_TRANSMIT)
|
if (gSetting_mic_bar && gCurrentFunction == FUNCTION_TRANSMIT)
|
||||||
{
|
{
|
||||||
center_line = CENTER_LINE_AUDIO_BAR;
|
center_line = CENTER_LINE_AUDIO_BAR;
|
||||||
@ -733,6 +803,7 @@ void UI_DisplayMain(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_AM_FIX) && defined(ENABLE_AM_FIX_SHOW_DATA)
|
#if defined(ENABLE_AM_FIX) && defined(ENABLE_AM_FIX_SHOW_DATA)
|
||||||
|
// show the AM-FIX debug data
|
||||||
if (rx && gEeprom.VfoInfo[gEeprom.RX_VFO].AM_mode && gSetting_AM_fix)
|
if (rx && gEeprom.VfoInfo[gEeprom.RX_VFO].AM_mode && gSetting_AM_fix)
|
||||||
{
|
{
|
||||||
if (gScreenToDisplay != DISPLAY_MAIN || gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
if (gScreenToDisplay != DISPLAY_MAIN || gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
||||||
@ -746,6 +817,7 @@ void UI_DisplayMain(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_RSSI_BAR
|
#ifdef ENABLE_RSSI_BAR
|
||||||
|
// show the RX RSSI dBm, S-point and signal strength bar graph
|
||||||
if (rx)
|
if (rx)
|
||||||
{
|
{
|
||||||
center_line = CENTER_LINE_RSSI;
|
center_line = CENTER_LINE_RSSI;
|
||||||
@ -791,7 +863,7 @@ void UI_DisplayMain(void)
|
|||||||
#ifdef ENABLE_SHOW_CHARGE_LEVEL
|
#ifdef ENABLE_SHOW_CHARGE_LEVEL
|
||||||
else
|
else
|
||||||
if (gChargingWithTypeC)
|
if (gChargingWithTypeC)
|
||||||
{ // charging .. show the battery state
|
{ // show the battery charge state
|
||||||
if (gScreenToDisplay != DISPLAY_MAIN || gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
if (gScreenToDisplay != DISPLAY_MAIN || gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
enum center_line_t {
|
enum center_line_t {
|
||||||
CENTER_LINE_NONE = 0,
|
CENTER_LINE_NONE = 0,
|
||||||
CENTER_LINE_IN_USE,
|
CENTER_LINE_IN_USE,
|
||||||
|
CENTER_LINE_TX_TIMEOUT,
|
||||||
CENTER_LINE_AUDIO_BAR,
|
CENTER_LINE_AUDIO_BAR,
|
||||||
CENTER_LINE_RSSI,
|
CENTER_LINE_RSSI,
|
||||||
CENTER_LINE_AM_FIX_DATA,
|
CENTER_LINE_AM_FIX_DATA,
|
||||||
@ -30,8 +31,15 @@ typedef enum center_line_t center_line_t;
|
|||||||
|
|
||||||
extern center_line_t center_line;
|
extern center_line_t center_line;
|
||||||
|
|
||||||
|
#ifdef ENABLE_SHOW_TX_TIMEOUT
|
||||||
|
bool UI_DisplayTXCountdown(const bool now);
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
void UI_DisplayAudioBar(void);
|
void UI_DisplayAudioBar(void);
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_RSSI_BAR
|
||||||
void UI_UpdateRSSI(const int16_t rssi, const int vfo);
|
void UI_UpdateRSSI(const int16_t rssi, const int vfo);
|
||||||
|
#endif
|
||||||
void UI_DisplayMain(void);
|
void UI_DisplayMain(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user