mirror of
https://github.com/egzumer/uv-k5-firmware-custom
synced 2024-11-22 01:32:43 +00:00
PTT release denoise update
This commit is contained in:
parent
2f907f82f8
commit
e3e2409854
@ -80,7 +80,7 @@ static void ACTION_Monitor(void)
|
|||||||
|
|
||||||
if (gScanState != SCAN_OFF)
|
if (gScanState != SCAN_OFF)
|
||||||
{
|
{
|
||||||
ScanPauseDelayIn10msec = 500;
|
ScanPauseDelayIn10msec = 500; // 5 seconds
|
||||||
gScheduleScanListen = false;
|
gScheduleScanListen = false;
|
||||||
gScanPauseMode = true;
|
gScanPauseMode = true;
|
||||||
}
|
}
|
||||||
|
136
app/app.c
136
app/app.c
@ -102,7 +102,7 @@ static void APP_CheckForIncoming(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScanPauseDelayIn10msec = 20;
|
ScanPauseDelayIn10msec = 20; // 200ms
|
||||||
gScheduleScanListen = false;
|
gScheduleScanListen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,9 @@ static void APP_HandleIncoming(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (g_CDCSS_Lost && gCDCSSCodeType == CDCSS_POSITIVE_CODE && (gCurrentCodeType == CODE_TYPE_DIGITAL || gCurrentCodeType == CODE_TYPE_REVERSE_DIGITAL))
|
if (g_CDCSS_Lost && gCDCSSCodeType == CDCSS_POSITIVE_CODE && (gCurrentCodeType == CODE_TYPE_DIGITAL || gCurrentCodeType == CODE_TYPE_REVERSE_DIGITAL))
|
||||||
|
{
|
||||||
gFoundCDCSS = false;
|
gFoundCDCSS = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (!bFlag)
|
if (!bFlag)
|
||||||
return;
|
return;
|
||||||
@ -168,13 +170,11 @@ static void APP_HandleIncoming(void)
|
|||||||
|
|
||||||
static void APP_HandleReceive(void)
|
static void APP_HandleReceive(void)
|
||||||
{
|
{
|
||||||
uint8_t Mode;
|
|
||||||
|
|
||||||
#define END_OF_RX_MODE_SKIP 0
|
#define END_OF_RX_MODE_SKIP 0
|
||||||
#define END_OF_RX_MODE_END 1
|
#define END_OF_RX_MODE_END 1
|
||||||
#define END_OF_RX_MODE_TTE 2
|
#define END_OF_RX_MODE_TTE 2
|
||||||
|
|
||||||
Mode = END_OF_RX_MODE_SKIP;
|
uint8_t Mode = END_OF_RX_MODE_SKIP;
|
||||||
|
|
||||||
if (gFlagTteComplete)
|
if (gFlagTteComplete)
|
||||||
{
|
{
|
||||||
@ -193,6 +193,10 @@ static void APP_HandleReceive(void)
|
|||||||
|
|
||||||
switch (gCurrentCodeType)
|
switch (gCurrentCodeType)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
case CODE_TYPE_OFF:
|
||||||
|
break;
|
||||||
|
|
||||||
case CODE_TYPE_CONTINUOUS_TONE:
|
case CODE_TYPE_CONTINUOUS_TONE:
|
||||||
if (gFoundCTCSS && gFoundCTCSSCountdown == 0)
|
if (gFoundCTCSS && gFoundCTCSSCountdown == 0)
|
||||||
{
|
{
|
||||||
@ -202,6 +206,7 @@ static void APP_HandleReceive(void)
|
|||||||
goto Skip;
|
goto Skip;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CODE_TYPE_DIGITAL:
|
case CODE_TYPE_DIGITAL:
|
||||||
case CODE_TYPE_REVERSE_DIGITAL:
|
case CODE_TYPE_REVERSE_DIGITAL:
|
||||||
if (gFoundCDCSS && gFoundCDCSSCountdown == 0)
|
if (gFoundCDCSS && gFoundCDCSSCountdown == 0)
|
||||||
@ -212,8 +217,6 @@ static void APP_HandleReceive(void)
|
|||||||
goto Skip;
|
goto Skip;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_SquelchLost)
|
if (g_SquelchLost)
|
||||||
@ -259,7 +262,9 @@ static void APP_HandleReceive(void)
|
|||||||
case CODE_TYPE_DIGITAL:
|
case CODE_TYPE_DIGITAL:
|
||||||
case CODE_TYPE_REVERSE_DIGITAL:
|
case CODE_TYPE_REVERSE_DIGITAL:
|
||||||
if (g_CDCSS_Lost && gCDCSSCodeType == CDCSS_POSITIVE_CODE)
|
if (g_CDCSS_Lost && gCDCSSCodeType == CDCSS_POSITIVE_CODE)
|
||||||
|
{
|
||||||
gFoundCDCSS = false;
|
gFoundCDCSS = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (!gFoundCDCSS)
|
if (!gFoundCDCSS)
|
||||||
{
|
{
|
||||||
@ -276,16 +281,18 @@ static void APP_HandleReceive(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Mode = END_OF_RX_MODE_END;
|
Mode = END_OF_RX_MODE_END;
|
||||||
|
|
||||||
if (!gEndOfRxDetectedMaybe && Mode == END_OF_RX_MODE_SKIP && gNextTimeslice40ms && gEeprom.TAIL_NOTE_ELIMINATION && (gCurrentCodeType == CODE_TYPE_DIGITAL || gCurrentCodeType == CODE_TYPE_REVERSE_DIGITAL) && BK4819_GetCTCType() == 1)
|
if (!gEndOfRxDetectedMaybe &&
|
||||||
|
Mode == END_OF_RX_MODE_SKIP &&
|
||||||
|
gNextTimeslice40ms &&
|
||||||
|
gEeprom.TAIL_NOTE_ELIMINATION &&
|
||||||
|
(gCurrentCodeType == CODE_TYPE_DIGITAL || gCurrentCodeType == CODE_TYPE_REVERSE_DIGITAL) &&
|
||||||
|
BK4819_GetCTCType() == 1)
|
||||||
Mode = END_OF_RX_MODE_TTE;
|
Mode = END_OF_RX_MODE_TTE;
|
||||||
else
|
else
|
||||||
gNextTimeslice40ms = false;
|
gNextTimeslice40ms = false;
|
||||||
@ -293,6 +300,9 @@ static void APP_HandleReceive(void)
|
|||||||
Skip:
|
Skip:
|
||||||
switch (Mode)
|
switch (Mode)
|
||||||
{
|
{
|
||||||
|
case END_OF_RX_MODE_SKIP:
|
||||||
|
break;
|
||||||
|
|
||||||
case END_OF_RX_MODE_END:
|
case END_OF_RX_MODE_END:
|
||||||
RADIO_SetupRegisters(true);
|
RADIO_SetupRegisters(true);
|
||||||
|
|
||||||
@ -307,21 +317,27 @@ Skip:
|
|||||||
{
|
{
|
||||||
switch (gEeprom.SCAN_RESUME_MODE)
|
switch (gEeprom.SCAN_RESUME_MODE)
|
||||||
{
|
{
|
||||||
|
case SCAN_RESUME_TO:
|
||||||
|
break;
|
||||||
|
|
||||||
case SCAN_RESUME_CO:
|
case SCAN_RESUME_CO:
|
||||||
ScanPauseDelayIn10msec = 360;
|
ScanPauseDelayIn10msec = 360;
|
||||||
gScheduleScanListen = false;
|
gScheduleScanListen = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCAN_RESUME_SE:
|
case SCAN_RESUME_SE:
|
||||||
SCANNER_Stop();
|
SCANNER_Stop();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case END_OF_RX_MODE_TTE:
|
case END_OF_RX_MODE_TTE:
|
||||||
if (gEeprom.TAIL_NOTE_ELIMINATION)
|
if (gEeprom.TAIL_NOTE_ELIMINATION)
|
||||||
{
|
{
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||||
|
|
||||||
gTailNoteEliminationCountdown = 20;
|
gTailNoteEliminationCountdown = 20;
|
||||||
gFlagTteComplete = false;
|
gFlagTteComplete = false;
|
||||||
gEnableSpeaker = false;
|
gEnableSpeaker = false;
|
||||||
@ -338,17 +354,24 @@ static void APP_HandleFunction(void)
|
|||||||
case FUNCTION_FOREGROUND:
|
case FUNCTION_FOREGROUND:
|
||||||
APP_CheckForIncoming();
|
APP_CheckForIncoming();
|
||||||
break;
|
break;
|
||||||
case FUNCTION_POWER_SAVE:
|
|
||||||
if (!gRxIdleMode)
|
case FUNCTION_TRANSMIT:
|
||||||
APP_CheckForIncoming();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FUNCTION_MONITOR:
|
||||||
|
break;
|
||||||
|
|
||||||
case FUNCTION_INCOMING:
|
case FUNCTION_INCOMING:
|
||||||
APP_HandleIncoming();
|
APP_HandleIncoming();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FUNCTION_RECEIVE:
|
case FUNCTION_RECEIVE:
|
||||||
APP_HandleReceive();
|
APP_HandleReceive();
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
|
case FUNCTION_POWER_SAVE:
|
||||||
|
if (!gRxIdleMode)
|
||||||
|
APP_CheckForIncoming();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -363,6 +386,7 @@ void APP_StartListening(FUNCTION_Type_t Function)
|
|||||||
gVFO_RSSI_Level[gEeprom.RX_CHANNEL == 0] = 0;
|
gVFO_RSSI_Level[gEeprom.RX_CHANNEL == 0] = 0;
|
||||||
|
|
||||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||||
|
|
||||||
gEnableSpeaker = true;
|
gEnableSpeaker = true;
|
||||||
|
|
||||||
BACKLIGHT_TurnOn();
|
BACKLIGHT_TurnOn();
|
||||||
@ -379,6 +403,7 @@ void APP_StartListening(FUNCTION_Type_t Function)
|
|||||||
gScanPauseMode = true;
|
gScanPauseMode = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCAN_RESUME_CO:
|
case SCAN_RESUME_CO:
|
||||||
case SCAN_RESUME_SE:
|
case SCAN_RESUME_SE:
|
||||||
ScanPauseDelayIn10msec = 0;
|
ScanPauseDelayIn10msec = 0;
|
||||||
@ -851,8 +876,8 @@ void APP_Update(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gFM_ScanState != FM_SCAN_OFF &&
|
if (gScheduleFM &&
|
||||||
gScheduleFM &&
|
gFM_ScanState != FM_SCAN_OFF &&
|
||||||
gCurrentFunction != FUNCTION_MONITOR &&
|
gCurrentFunction != FUNCTION_MONITOR &&
|
||||||
gCurrentFunction != FUNCTION_RECEIVE &&
|
gCurrentFunction != FUNCTION_RECEIVE &&
|
||||||
gCurrentFunction != FUNCTION_TRANSMIT)
|
gCurrentFunction != FUNCTION_TRANSMIT)
|
||||||
@ -867,13 +892,13 @@ void APP_Update(void)
|
|||||||
if (gSchedulePowerSave)
|
if (gSchedulePowerSave)
|
||||||
{
|
{
|
||||||
#ifndef DISABLE_NOAA
|
#ifndef DISABLE_NOAA
|
||||||
if (gEeprom.BATTERY_SAVE == 0 ||
|
if (gFmRadioMode ||
|
||||||
|
gPttIsPressed ||
|
||||||
|
gKeyBeingHeld ||
|
||||||
|
gEeprom.BATTERY_SAVE == 0 ||
|
||||||
gScanState != SCAN_OFF ||
|
gScanState != SCAN_OFF ||
|
||||||
gCssScanMode != CSS_SCAN_MODE_OFF ||
|
gCssScanMode != CSS_SCAN_MODE_OFF ||
|
||||||
gFmRadioMode ||
|
|
||||||
gPttIsPressed ||
|
|
||||||
gScreenToDisplay != DISPLAY_MAIN ||
|
gScreenToDisplay != DISPLAY_MAIN ||
|
||||||
gKeyBeingHeld ||
|
|
||||||
gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
||||||
gBatterySaveCountdown = 1000;
|
gBatterySaveCountdown = 1000;
|
||||||
else
|
else
|
||||||
@ -882,13 +907,13 @@ void APP_Update(void)
|
|||||||
else
|
else
|
||||||
gBatterySaveCountdown = 1000;
|
gBatterySaveCountdown = 1000;
|
||||||
#else
|
#else
|
||||||
if (gEeprom.BATTERY_SAVE == 0 ||
|
if (gFmRadioMode ||
|
||||||
|
gPttIsPressed ||
|
||||||
|
gKeyBeingHeld ||
|
||||||
|
gEeprom.BATTERY_SAVE == 0 ||
|
||||||
gScanState != SCAN_OFF ||
|
gScanState != SCAN_OFF ||
|
||||||
gCssScanMode != CSS_SCAN_MODE_OFF ||
|
gCssScanMode != CSS_SCAN_MODE_OFF ||
|
||||||
gFmRadioMode ||
|
|
||||||
gPttIsPressed ||
|
|
||||||
gScreenToDisplay != DISPLAY_MAIN ||
|
gScreenToDisplay != DISPLAY_MAIN ||
|
||||||
gKeyBeingHeld ||
|
|
||||||
gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
||||||
gBatterySaveCountdown = 1000;
|
gBatterySaveCountdown = 1000;
|
||||||
else
|
else
|
||||||
@ -968,34 +993,47 @@ void APP_CheckKeys(void)
|
|||||||
{
|
{
|
||||||
if (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
if (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
||||||
{ // PTT released
|
{ // PTT released
|
||||||
|
#if 0
|
||||||
// denoise the PTT
|
// denoise the PTT
|
||||||
unsigned int i = 6; // test the PTT button for 6ms
|
unsigned int i = 6; // test the PTT button for 6ms
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
while (i-- > 0)
|
while (i-- > 0)
|
||||||
{
|
{
|
||||||
SYSTEM_DelayMs(1);
|
SYSTEM_DelayMs(1);
|
||||||
if (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
||||||
count++; // PTT still released
|
{ // PTT pressed
|
||||||
else
|
if (count > 0)
|
||||||
if (count > 0)
|
count--;
|
||||||
count--; // no it's not
|
continue;
|
||||||
}
|
}
|
||||||
|
if (++count < 3)
|
||||||
if (count >= 3)
|
continue;
|
||||||
{ // good enough to end transmission
|
// stop transmitting
|
||||||
APP_ProcessKey(KEY_PTT, false, false);
|
APP_ProcessKey(KEY_PTT, false, false);
|
||||||
gPttIsPressed = false;
|
gPttIsPressed = false;
|
||||||
if (gKeyReading1 != KEY_INVALID)
|
if (gKeyReading1 != KEY_INVALID)
|
||||||
gPttWasReleased = true;
|
gPttWasReleased = true;
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (++gPttDebounceCounter >= 3) // 30ms
|
||||||
|
{ // stop transmitting
|
||||||
|
APP_ProcessKey(KEY_PTT, false, false);
|
||||||
|
gPttIsPressed = false;
|
||||||
|
if (gKeyReading1 != KEY_INVALID)
|
||||||
|
gPttWasReleased = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
gPttDebounceCounter = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
||||||
{ // PTT pressed
|
{ // PTT pressed
|
||||||
if (++gPttDebounceCounter >= 4) // 40ms
|
if (++gPttDebounceCounter >= 3) // 30ms
|
||||||
{ // lets start transmitting
|
{ // start transmitting
|
||||||
|
gPttDebounceCounter = 0;
|
||||||
gPttIsPressed = true;
|
gPttIsPressed = true;
|
||||||
APP_ProcessKey(KEY_PTT, true, false);
|
APP_ProcessKey(KEY_PTT, true, false);
|
||||||
}
|
}
|
||||||
@ -1184,7 +1222,7 @@ void APP_TimeSlice10ms(void)
|
|||||||
BK4819_CssScanResult_t ScanResult;
|
BK4819_CssScanResult_t ScanResult;
|
||||||
uint16_t CtcssFreq;
|
uint16_t CtcssFreq;
|
||||||
|
|
||||||
if (gScanDelay)
|
if (gScanDelay > 0)
|
||||||
{
|
{
|
||||||
gScanDelay--;
|
gScanDelay--;
|
||||||
APP_CheckKeys();
|
APP_CheckKeys();
|
||||||
@ -1203,7 +1241,7 @@ void APP_TimeSlice10ms(void)
|
|||||||
if (!BK4819_GetFrequencyScanResult(&Result))
|
if (!BK4819_GetFrequencyScanResult(&Result))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Delta = Result - gScanFrequency;
|
Delta = Result - gScanFrequency;
|
||||||
gScanFrequency = Result;
|
gScanFrequency = Result;
|
||||||
|
|
||||||
if (Delta < 0)
|
if (Delta < 0)
|
||||||
|
2
audio.c
2
audio.c
@ -195,7 +195,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
|
|||||||
|
|
||||||
VoiceID = gVoiceID[0];
|
VoiceID = gVoiceID[0];
|
||||||
|
|
||||||
if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF && gVoiceWriteIndex)
|
if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF && gVoiceWriteIndex > 0)
|
||||||
{
|
{
|
||||||
if (gEeprom.VOICE_PROMPT == VOICE_PROMPT_CHINESE)
|
if (gEeprom.VOICE_PROMPT == VOICE_PROMPT_CHINESE)
|
||||||
{ // Chinese
|
{ // Chinese
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
19
main.c
19
main.c
@ -35,14 +35,7 @@
|
|||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "ui/lock.h"
|
#include "ui/lock.h"
|
||||||
#include "ui/welcome.h"
|
#include "ui/welcome.h"
|
||||||
|
#include "version.h"
|
||||||
#ifdef GIT_HASH
|
|
||||||
static const char Version[] = "UV-K5 Firmware, Open Edition, OEFW-"GIT_HASH"\r\n";
|
|
||||||
#else
|
|
||||||
#include "version.h"
|
|
||||||
static const char Version1[] = "UV-K5 Firmware, Open Edition, ";
|
|
||||||
static const char Version2[] = "\r\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void _putchar(char c)
|
void _putchar(char c)
|
||||||
{
|
{
|
||||||
@ -66,15 +59,7 @@ void Main(void)
|
|||||||
BOARD_Init();
|
BOARD_Init();
|
||||||
UART_Init();
|
UART_Init();
|
||||||
|
|
||||||
#ifdef GIT_HASH
|
UART_Send(UART_Version, strlen(UART_Version));
|
||||||
UART_Send(Version, sizeof(Version));
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
UART_Send(Version1, sizeof(Version1));
|
|
||||||
UART_Send(Version, strlen(Version));
|
|
||||||
UART_Send(Version2, sizeof(Version2));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Not implementing authentic device checks
|
// Not implementing authentic device checks
|
||||||
|
|
||||||
|
3
misc.c
3
misc.c
@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
const uint8_t g_scan_delay = 21; // 21
|
const uint8_t g_scan_delay = 21; // 210ms
|
||||||
|
//const uint8_t g_scan_delay = 2; // 20ms
|
||||||
|
|
||||||
const uint8_t g_menu_timeout = 2 * 30; // 30 seconds
|
const uint8_t g_menu_timeout = 2 * 30; // 30 seconds
|
||||||
|
|
||||||
|
249
misc.h
249
misc.h
@ -24,10 +24,8 @@
|
|||||||
#define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
|
#define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
|
||||||
#define IS_VALID_CHANNEL(x) ((x) <= NOAA_CHANNEL_LAST)
|
#define IS_VALID_CHANNEL(x) ((x) <= NOAA_CHANNEL_LAST)
|
||||||
|
|
||||||
#ifndef DISABLE_NOAA
|
#define IS_NOAA_CHANNEL(x) ((x) >= NOAA_CHANNEL_FIRST && (x) <= NOAA_CHANNEL_LAST)
|
||||||
#define IS_NOAA_CHANNEL(x) ((x) >= NOAA_CHANNEL_FIRST && (x) <= NOAA_CHANNEL_LAST)
|
#define IS_NOT_NOAA_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
|
||||||
#define IS_NOT_NOAA_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MR_CHANNEL_FIRST = 0,
|
MR_CHANNEL_FIRST = 0,
|
||||||
@ -67,155 +65,150 @@ enum ReceptionMode_t {
|
|||||||
|
|
||||||
typedef enum ReceptionMode_t ReceptionMode_t;
|
typedef enum ReceptionMode_t ReceptionMode_t;
|
||||||
|
|
||||||
enum CssScanMode_t {
|
enum CssScanMode_t
|
||||||
|
{
|
||||||
CSS_SCAN_MODE_OFF = 0,
|
CSS_SCAN_MODE_OFF = 0,
|
||||||
CSS_SCAN_MODE_SCANNING,
|
CSS_SCAN_MODE_SCANNING,
|
||||||
CSS_SCAN_MODE_FOUND,
|
CSS_SCAN_MODE_FOUND,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum CssScanMode_t CssScanMode_t;
|
typedef enum CssScanMode_t CssScanMode_t;
|
||||||
|
|
||||||
extern const uint8_t g_scan_delay;
|
extern const uint8_t g_scan_delay;
|
||||||
|
|
||||||
extern const uint8_t g_menu_timeout;
|
extern const uint8_t g_menu_timeout;
|
||||||
|
|
||||||
extern const uint16_t gMax_bat_v;
|
extern const uint16_t gMax_bat_v;
|
||||||
extern const uint16_t gMin_bat_v;
|
extern const uint16_t gMin_bat_v;
|
||||||
|
|
||||||
extern const uint8_t gMicGain_dB2[5];
|
extern const uint8_t gMicGain_dB2[5];
|
||||||
|
|
||||||
extern bool gSetting_350TX;
|
extern bool gSetting_350TX;
|
||||||
extern bool gSetting_KILLED;
|
extern bool gSetting_KILLED;
|
||||||
extern bool gSetting_200TX;
|
extern bool gSetting_200TX;
|
||||||
extern bool gSetting_500TX;
|
extern bool gSetting_500TX;
|
||||||
extern bool gSetting_350EN;
|
extern bool gSetting_350EN;
|
||||||
extern uint8_t gSetting_F_LOCK;
|
extern uint8_t gSetting_F_LOCK;
|
||||||
extern bool gSetting_ScrambleEnable;
|
extern bool gSetting_ScrambleEnable;
|
||||||
extern uint8_t gSetting_F_LOCK;
|
|
||||||
|
|
||||||
extern const uint32_t gDefaultAesKey[4];
|
extern const uint32_t gDefaultAesKey[4];
|
||||||
extern uint32_t gCustomAesKey[4];
|
extern uint32_t gCustomAesKey[4];
|
||||||
extern bool bHasCustomAesKey;
|
extern bool bHasCustomAesKey;
|
||||||
extern uint32_t gChallenge[4];
|
extern uint32_t gChallenge[4];
|
||||||
extern uint8_t gTryCount;
|
extern uint8_t gTryCount;
|
||||||
|
|
||||||
extern uint8_t gEEPROM_1EC0_0[8];
|
extern uint8_t gEEPROM_1EC0_0[8];
|
||||||
extern uint8_t gEEPROM_1EC0_1[8];
|
extern uint8_t gEEPROM_1EC0_1[8];
|
||||||
extern uint8_t gEEPROM_1EC0_2[8];
|
extern uint8_t gEEPROM_1EC0_2[8];
|
||||||
extern uint8_t gEEPROM_1EC0_3[8];
|
extern uint8_t gEEPROM_1EC0_3[8];
|
||||||
|
|
||||||
extern uint16_t gEEPROM_RSSI_CALIB[3][4];
|
extern uint16_t gEEPROM_RSSI_CALIB[3][4];
|
||||||
|
|
||||||
extern uint16_t gEEPROM_1F8A;
|
extern uint16_t gEEPROM_1F8A;
|
||||||
extern uint16_t gEEPROM_1F8C;
|
extern uint16_t gEEPROM_1F8C;
|
||||||
|
|
||||||
extern uint8_t gMR_ChannelAttributes[207];
|
extern uint8_t gMR_ChannelAttributes[207];
|
||||||
|
|
||||||
extern volatile bool gNextTimeslice500ms;
|
extern volatile bool gNextTimeslice500ms;
|
||||||
extern volatile uint16_t gBatterySaveCountdown;
|
extern volatile uint16_t gBatterySaveCountdown;
|
||||||
extern volatile uint16_t gDualWatchCountdown;
|
extern volatile uint16_t gDualWatchCountdown;
|
||||||
extern volatile uint16_t gTxTimerCountdown;
|
extern volatile uint16_t gTxTimerCountdown;
|
||||||
extern volatile uint16_t gTailNoteEliminationCountdown;
|
extern volatile uint16_t gTailNoteEliminationCountdown;
|
||||||
extern volatile uint16_t gFmPlayCountdown;
|
extern volatile uint16_t gFmPlayCountdown;
|
||||||
#ifndef DISABLE_NOAA
|
#ifndef DISABLE_NOAA
|
||||||
extern volatile uint16_t gNOAA_Countdown;
|
extern volatile uint16_t gNOAA_Countdown;
|
||||||
#endif
|
#endif
|
||||||
extern bool gEnableSpeaker;
|
extern bool gEnableSpeaker;
|
||||||
extern uint8_t gKeyLockCountdown;
|
extern uint8_t gKeyLockCountdown;
|
||||||
extern uint8_t gRTTECountdown;
|
extern uint8_t gRTTECountdown;
|
||||||
extern bool bIsInLockScreen;
|
extern bool bIsInLockScreen;
|
||||||
extern uint8_t gUpdateStatus;
|
extern uint8_t gUpdateStatus;
|
||||||
extern uint8_t gFoundCTCSS;
|
extern uint8_t gFoundCTCSS;
|
||||||
extern uint8_t gFoundCDCSS;
|
extern uint8_t gFoundCDCSS;
|
||||||
extern bool gEndOfRxDetectedMaybe;
|
extern bool gEndOfRxDetectedMaybe;
|
||||||
extern uint8_t gVFO_RSSI_Level[2];
|
extern uint8_t gVFO_RSSI_Level[2];
|
||||||
extern uint8_t gReducedService;
|
extern uint8_t gReducedService;
|
||||||
extern uint8_t gBatteryVoltageIndex;
|
extern uint8_t gBatteryVoltageIndex;
|
||||||
extern CssScanMode_t gCssScanMode;
|
extern CssScanMode_t gCssScanMode;
|
||||||
extern bool gUpdateRSSI;
|
extern bool gUpdateRSSI;
|
||||||
extern AlarmState_t gAlarmState;
|
extern AlarmState_t gAlarmState;
|
||||||
extern uint8_t gVoltageMenuCountdown;
|
extern uint8_t gVoltageMenuCountdown;
|
||||||
extern bool gPttWasReleased;
|
extern bool gPttWasReleased;
|
||||||
extern bool gPttWasPressed;
|
extern bool gPttWasPressed;
|
||||||
extern bool gFlagReconfigureVfos;
|
extern bool gFlagReconfigureVfos;
|
||||||
extern uint8_t gVfoConfigureMode;
|
extern uint8_t gVfoConfigureMode;
|
||||||
extern bool gFlagResetVfos;
|
extern bool gFlagResetVfos;
|
||||||
extern bool gRequestSaveVFO;
|
extern bool gRequestSaveVFO;
|
||||||
extern uint8_t gRequestSaveChannel;
|
extern uint8_t gRequestSaveChannel;
|
||||||
extern bool gRequestSaveSettings;
|
extern bool gRequestSaveSettings;
|
||||||
extern bool gRequestSaveFM;
|
extern bool gRequestSaveFM;
|
||||||
extern uint8_t gKeypadLocked;
|
extern uint8_t gKeypadLocked;
|
||||||
extern bool gFlagPrepareTX;
|
extern bool gFlagPrepareTX;
|
||||||
extern bool gFlagAcceptSetting;
|
extern bool gFlagAcceptSetting;
|
||||||
extern bool gFlagRefreshSetting;
|
extern bool gFlagRefreshSetting;
|
||||||
extern bool gFlagSaveVfo;
|
extern bool gFlagSaveVfo;
|
||||||
extern bool gFlagSaveSettings;
|
extern bool gFlagSaveSettings;
|
||||||
extern bool gFlagSaveChannel;
|
extern bool gFlagSaveChannel;
|
||||||
extern bool gFlagSaveFM;
|
extern bool gFlagSaveFM;
|
||||||
extern uint8_t gDTMF_RequestPending;
|
extern uint8_t gDTMF_RequestPending;
|
||||||
extern bool g_CDCSS_Lost;
|
extern bool g_CDCSS_Lost;
|
||||||
extern uint8_t gCDCSSCodeType;
|
extern uint8_t gCDCSSCodeType;
|
||||||
extern bool g_CTCSS_Lost;
|
extern bool g_CTCSS_Lost;
|
||||||
extern bool g_CxCSS_TAIL_Found;
|
extern bool g_CxCSS_TAIL_Found;
|
||||||
extern bool g_VOX_Lost;
|
extern bool g_VOX_Lost;
|
||||||
extern bool g_SquelchLost;
|
extern bool g_SquelchLost;
|
||||||
extern uint8_t gFlashLightState;
|
extern uint8_t gFlashLightState;
|
||||||
extern bool gVOX_NoiseDetected;
|
extern bool gVOX_NoiseDetected;
|
||||||
extern uint16_t gVoxResumeCountdown;
|
extern uint16_t gVoxResumeCountdown;
|
||||||
extern uint16_t gVoxPauseCountdown;
|
extern uint16_t gVoxPauseCountdown;
|
||||||
extern volatile uint16_t gFlashLightBlinkCounter;
|
extern volatile uint16_t gFlashLightBlinkCounter;
|
||||||
extern bool gFlagEndTransmission;
|
extern bool gFlagEndTransmission;
|
||||||
extern uint16_t gLowBatteryCountdown;
|
extern uint16_t gLowBatteryCountdown;
|
||||||
extern uint8_t gNextMrChannel;
|
extern uint8_t gNextMrChannel;
|
||||||
extern ReceptionMode_t gRxReceptionMode;
|
extern ReceptionMode_t gRxReceptionMode;
|
||||||
extern uint8_t gRestoreMrChannel;
|
extern uint8_t gRestoreMrChannel;
|
||||||
extern uint8_t gCurrentScanList;
|
extern uint8_t gCurrentScanList;
|
||||||
extern uint8_t gPreviousMrChannel;
|
extern uint8_t gPreviousMrChannel;
|
||||||
extern uint32_t gRestoreFrequency;
|
extern uint32_t gRestoreFrequency;
|
||||||
extern uint8_t gRxVfoIsActive;
|
extern uint8_t gRxVfoIsActive;
|
||||||
extern uint8_t gAlarmToneCounter;
|
extern uint8_t gAlarmToneCounter;
|
||||||
extern uint16_t gAlarmRunningCounter;
|
extern uint16_t gAlarmRunningCounter;
|
||||||
extern bool gKeyBeingHeld;
|
extern bool gKeyBeingHeld;
|
||||||
extern bool gPttIsPressed;
|
extern bool gPttIsPressed;
|
||||||
extern uint8_t gPttDebounceCounter;
|
extern uint8_t gPttDebounceCounter;
|
||||||
extern uint8_t gMenuListCount;
|
extern uint8_t gMenuListCount;
|
||||||
extern uint8_t gBackupCROSS_BAND_RX_TX;
|
extern uint8_t gBackupCROSS_BAND_RX_TX;
|
||||||
extern uint8_t gScanDelay;
|
extern uint8_t gScanDelay;
|
||||||
#ifndef DISABLE_AIRCOPY
|
#ifndef DISABLE_AIRCOPY
|
||||||
extern uint8_t gAircopySendCountdown;
|
extern uint8_t gAircopySendCountdown;
|
||||||
#endif
|
#endif
|
||||||
extern uint8_t gFSKWriteIndex;
|
extern uint8_t gFSKWriteIndex;
|
||||||
extern uint8_t gNeverUsed;
|
extern uint8_t gNeverUsed;
|
||||||
|
|
||||||
#ifndef DISABLE_NOAA
|
#ifndef DISABLE_NOAA
|
||||||
extern bool gIsNoaaMode;
|
extern bool gIsNoaaMode;
|
||||||
extern uint8_t gNoaaChannel;
|
extern uint8_t gNoaaChannel;
|
||||||
#endif
|
#endif
|
||||||
extern volatile bool gNextTimeslice;
|
extern volatile bool gNextTimeslice;
|
||||||
extern bool gUpdateDisplay;
|
extern bool gUpdateDisplay;
|
||||||
extern uint8_t gFM_ChannelPosition;
|
extern uint8_t gFM_ChannelPosition;
|
||||||
extern bool gF_LOCK;
|
extern bool gF_LOCK;
|
||||||
extern uint8_t gShowChPrefix;
|
extern uint8_t gShowChPrefix;
|
||||||
extern volatile uint16_t gSystickCountdown2;
|
extern volatile uint16_t gSystickCountdown2;
|
||||||
extern volatile uint8_t gFoundCDCSSCountdown;
|
extern volatile uint8_t gFoundCDCSSCountdown;
|
||||||
extern volatile uint8_t gFoundCTCSSCountdown;
|
extern volatile uint8_t gFoundCTCSSCountdown;
|
||||||
extern volatile uint16_t gVoxStopCountdown;
|
extern volatile uint16_t gVoxStopCountdown;
|
||||||
extern volatile bool gTxTimeoutReached;
|
extern volatile bool gTxTimeoutReached;
|
||||||
extern volatile bool gNextTimeslice40ms;
|
extern volatile bool gNextTimeslice40ms;
|
||||||
extern volatile bool gSchedulePowerSave;
|
extern volatile bool gSchedulePowerSave;
|
||||||
extern volatile bool gBatterySaveCountdownExpired;
|
extern volatile bool gBatterySaveCountdownExpired;
|
||||||
extern volatile bool gScheduleDualWatch;
|
extern volatile bool gScheduleDualWatch;
|
||||||
#ifndef DISABLE_NOAA
|
#ifndef DISABLE_NOAA
|
||||||
extern volatile bool gScheduleNOAA;
|
extern volatile bool gScheduleNOAA;
|
||||||
#endif
|
#endif
|
||||||
extern volatile bool gFlagTteComplete;
|
extern volatile bool gFlagTteComplete;
|
||||||
extern volatile bool gScheduleFM;
|
extern volatile bool gScheduleFM;
|
||||||
|
extern uint16_t gCurrentRSSI;
|
||||||
extern uint16_t gCurrentRSSI;
|
extern uint8_t gIsLocked;
|
||||||
|
|
||||||
extern uint8_t gIsLocked;
|
|
||||||
|
|
||||||
// --------
|
|
||||||
|
|
||||||
void NUMBER_Get(char *pDigits, uint32_t *pInteger);
|
void NUMBER_Get(char *pDigits, uint32_t *pInteger);
|
||||||
void NUMBER_ToDigits(uint32_t Value, char *pDigits);
|
void NUMBER_ToDigits(uint32_t Value, char *pDigits);
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
|
||||||
#ifdef GIT_HASH
|
#ifdef GIT_HASH
|
||||||
const char Version[] = "OEFW-" GIT_HASH;
|
#define VER GIT_HASH
|
||||||
const char UART_Version[45] = "UV-K5 Firmware, Open Edition, OEFW-"GIT_HASH"\r\n";
|
|
||||||
#else
|
#else
|
||||||
const char Version[] = "OEFW-230913";
|
#define VER "230913"
|
||||||
const char UART_Version[45] = "UV-K5 Firmware, Open Edition, OEFW-230913\r\n";
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char Version[] = "OEFW-"VER;
|
||||||
|
const char UART_Version[] = "UV-K5 Firmware, Open Edition, OEFW-"VER"\r\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user