Add Rx/Tx timer
This commit is contained in:
10
bitmaps.c
10
bitmaps.c
@@ -11,16 +11,6 @@ const uint8_t gFontPowerSave[2][6] =
|
|||||||
{0x00, 0x26, 0x49, 0x49, 0x49, 0x32},
|
{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] =
|
const uint8_t gFontPttOnePush[2][6] =
|
||||||
{
|
{
|
||||||
{0x00, 0x3e, 0x41, 0x41, 0x41, 0x3e},
|
{0x00, 0x3e, 0x41, 0x41, 0x41, 0x3e},
|
||||||
|
@@ -5,8 +5,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
extern const uint8_t gFontPowerSave[2][6];
|
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 gFontPttOnePush[2][6];
|
||||||
extern const uint8_t gFontPttClassic[2][6];
|
extern const uint8_t gFontPttClassic[2][6];
|
||||||
extern const uint8_t gFontFM[2][6];
|
extern const uint8_t gFontFM[2][6];
|
||||||
|
1
misc.c
1
misc.c
@@ -159,6 +159,7 @@ volatile bool gTxTimeoutReached;
|
|||||||
volatile uint16_t gTxTimerCountdownAlert_500ms;
|
volatile uint16_t gTxTimerCountdownAlert_500ms;
|
||||||
volatile bool gTxTimeoutReachedAlert;
|
volatile bool gTxTimeoutReachedAlert;
|
||||||
volatile uint16_t gTxTimeoutToneAlert = 800;
|
volatile uint16_t gTxTimeoutToneAlert = 800;
|
||||||
|
volatile uint16_t gRxTimerCountdown_500ms;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
||||||
|
1
misc.h
1
misc.h
@@ -222,6 +222,7 @@ extern volatile bool gTxTimeoutReached;
|
|||||||
extern volatile uint16_t gTxTimerCountdownAlert_500ms;
|
extern volatile uint16_t gTxTimerCountdownAlert_500ms;
|
||||||
extern volatile bool gTxTimeoutReachedAlert;
|
extern volatile bool gTxTimeoutReachedAlert;
|
||||||
extern volatile uint16_t gTxTimeoutToneAlert;
|
extern volatile uint16_t gTxTimeoutToneAlert;
|
||||||
|
extern volatile uint16_t gRxTimerCountdown_500ms;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
extern volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
||||||
|
@@ -58,6 +58,7 @@ void SystickHandler(void)
|
|||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
DECREMENT_AND_TRIGGER(gTxTimerCountdownAlert_500ms - ALERT_TOT * 2, gTxTimeoutReachedAlert);
|
DECREMENT_AND_TRIGGER(gTxTimerCountdownAlert_500ms - ALERT_TOT * 2, gTxTimeoutReachedAlert);
|
||||||
|
DECREMENT(gRxTimerCountdown_500ms);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
||||||
|
14
ui/main.c
14
ui/main.c
@@ -53,6 +53,10 @@ center_line_t center_line = CENTER_LINE_NONE;
|
|||||||
|
|
||||||
bool isMainOnlyInputDTMF = false;
|
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)
|
static bool isMainOnly(bool checkGui)
|
||||||
{
|
{
|
||||||
if(checkGui)
|
if(checkGui)
|
||||||
@@ -246,18 +250,14 @@ void UI_DisplayAudioBar(void)
|
|||||||
|
|
||||||
DrawLevelBar(62, line, bars);
|
DrawLevelBar(62, line, bars);
|
||||||
|
|
||||||
|
gUpdateStatus = true;
|
||||||
|
|
||||||
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
||||||
ST7565_BlitFullScreen();
|
ST7565_BlitFullScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
void DisplayRSSIBar(const bool now)
|
||||||
{
|
{
|
||||||
#if defined(ENABLE_RSSI_BAR)
|
#if defined(ENABLE_RSSI_BAR)
|
||||||
@@ -800,6 +800,8 @@ void UI_DisplayMain(void)
|
|||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
gRxTimerCountdown_500ms = 7200;
|
||||||
|
|
||||||
if(RxOnVfofrequency == frequency && !isMainOnly(false))
|
if(RxOnVfofrequency == frequency && !isMainOnly(false))
|
||||||
{
|
{
|
||||||
UI_PrintStringSmallNormal(">>", 14, 0, line);
|
UI_PrintStringSmallNormal(">>", 14, 0, line);
|
||||||
|
45
ui/status.c
45
ui/status.c
@@ -34,6 +34,32 @@
|
|||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
#include "ui/status.h"
|
#include "ui/status.h"
|
||||||
|
|
||||||
|
static void convertTime(uint8_t *line, uint8_t type) {
|
||||||
|
uint8_t m, s; // Declare variables for seconds, hours, minutes, and seconds
|
||||||
|
uint16_t t;
|
||||||
|
char str[7];
|
||||||
|
|
||||||
|
if(type == 0)
|
||||||
|
t = ((gEeprom.TX_TIMEOUT_TIMER + 1) * 5) - (gTxTimerCountdown_500ms / 2);
|
||||||
|
else
|
||||||
|
t = (7200 - gRxTimerCountdown_500ms) / 2;
|
||||||
|
|
||||||
|
m = t / 60;
|
||||||
|
s = t - (m * 60);
|
||||||
|
|
||||||
|
sprintf(str, "%02d:%02d", m, s);
|
||||||
|
UI_PrintStringSmallBufferNormal(str, line + 0);
|
||||||
|
//GUI_DisplaySmallest(str, 2, 26, false, true);
|
||||||
|
/*
|
||||||
|
for (uint8_t i = 0; i < 27; i++)
|
||||||
|
{
|
||||||
|
gStatusLine[i] ^= 0x7F;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
gUpdateStatus = true;
|
||||||
|
}
|
||||||
|
|
||||||
void UI_DisplayStatus()
|
void UI_DisplayStatus()
|
||||||
{
|
{
|
||||||
gUpdateStatus = false;
|
gUpdateStatus = false;
|
||||||
@@ -44,13 +70,7 @@ void UI_DisplayStatus()
|
|||||||
// **************
|
// **************
|
||||||
|
|
||||||
// POWER-SAVE indicator
|
// POWER-SAVE indicator
|
||||||
if (gCurrentFunction == FUNCTION_TRANSMIT) {
|
if (gCurrentFunction == FUNCTION_POWER_SAVE) {
|
||||||
memcpy(line + x, gFontTx, sizeof(gFontTx));
|
|
||||||
}
|
|
||||||
else if (FUNCTION_IsRx()) {
|
|
||||||
memcpy(line + x, gFontRx, sizeof(gFontRx));
|
|
||||||
}
|
|
||||||
else if (gCurrentFunction == FUNCTION_POWER_SAVE) {
|
|
||||||
memcpy(line + x, gFontPowerSave, sizeof(gFontPowerSave));
|
memcpy(line + x, gFontPowerSave, sizeof(gFontPowerSave));
|
||||||
}
|
}
|
||||||
x += 8;
|
x += 8;
|
||||||
@@ -126,6 +146,16 @@ void UI_DisplayStatus()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!SCANNER_IsScanning()) {
|
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;
|
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(dw == 1 || dw == 3) { // DWR - dual watch + respond
|
||||||
if(gDualWatchActive)
|
if(gDualWatchActive)
|
||||||
@@ -141,6 +171,7 @@ void UI_DisplayStatus()
|
|||||||
memcpy(line + x + 2, gFontMO, sizeof(gFontMO));
|
memcpy(line + x + 2, gFontMO, sizeof(gFontMO));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
x += sizeof(gFontDWR) + 3;
|
x += sizeof(gFontDWR) + 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user