Compare commits
33 Commits
107d89c137
...
main
Author | SHA1 | Date | |
---|---|---|---|
1ec2e15de8
|
|||
23dbad1a53
|
|||
6d98e23202
|
|||
8e48a5f4c5
|
|||
bbeb1d8fab
|
|||
c0d3ba51a2
|
|||
7b1d31fdef | |||
0ea8767a8b
|
|||
f1904e03fe
|
|||
101bde7463 | |||
85fb527020
|
|||
4fe99744e1
|
|||
8dd68d74a6
|
|||
72558f93f3
|
|||
fabf38f1bc
|
|||
00786c683d
|
|||
c5464994ed
|
|||
f1b2d085d5
|
|||
ac6e59044d
|
|||
3850025e63
|
|||
dc5919ac6f
|
|||
3e1756697f
|
|||
62f73f8c6c
|
|||
f4ff2e6048
|
|||
|
ba5257f2f6 | ||
|
aee4406cff | ||
|
448a201308 | ||
|
9a312c3526 | ||
|
7f146a5857 | ||
|
710ff8fac1 | ||
|
08af06564c | ||
|
03f761348b | ||
|
96acae8014 |
28
.github/workflows/main.yml
vendored
28
.github/workflows/main.yml
vendored
@@ -9,16 +9,22 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Compile firmware
|
||||
run: |
|
||||
chmod +x compile-with-docker.sh
|
||||
./compile-with-docker.sh
|
||||
- name: Compile firmware
|
||||
run: |
|
||||
chmod +x compile-with-docker.sh
|
||||
./compile-with-docker.sh custom
|
||||
|
||||
- name: Upload firmware artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware-artifact
|
||||
path: compiled-firmware/f4hwn.packed.bin
|
||||
- name: Debug files
|
||||
run: ls -lah
|
||||
|
||||
- name: Debug compiled firmware
|
||||
run: ls -lah compiled-firmware
|
||||
|
||||
- name: Upload firmware artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware-artifact
|
||||
path: compiled-firmware/*
|
||||
|
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
7
.idea/discord.xml
generated
Normal file
7
.idea/discord.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="ASK" />
|
||||
<option name="description" value="" />
|
||||
</component>
|
||||
</project>
|
18
.idea/misc.xml
generated
Normal file
18
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MakefileSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<MakefileProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="version" value="2" />
|
||||
</MakefileProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="MakefileWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
37
Makefile
37
Makefile
@@ -4,28 +4,28 @@
|
||||
# 1 = enable
|
||||
|
||||
# ---- STOCK QUANSHENG FEATURES ----
|
||||
ENABLE_FMRADIO ?= 0
|
||||
ENABLE_FMRADIO ?= 1
|
||||
ENABLE_UART ?= 1
|
||||
ENABLE_AIRCOPY ?= 0
|
||||
ENABLE_NOAA ?= 0
|
||||
ENABLE_VOICE ?= 0
|
||||
ENABLE_VOX ?= 1
|
||||
ENABLE_VOX ?= 0
|
||||
ENABLE_ALARM ?= 0
|
||||
ENABLE_TX1750 ?= 1
|
||||
ENABLE_TX1750 ?= 0
|
||||
ENABLE_PWRON_PASSWORD ?= 0
|
||||
ENABLE_DTMF_CALLING ?= 0
|
||||
ENABLE_FLASHLIGHT ?= 1
|
||||
|
||||
# ---- CUSTOM MODS ----
|
||||
ENABLE_SPECTRUM ?= 0
|
||||
ENABLE_BIG_FREQ ?= 1
|
||||
ENABLE_SMALL_BOLD ?= 1
|
||||
ENABLE_SPECTRUM ?= 1
|
||||
ENABLE_BIG_FREQ ?= 0
|
||||
ENABLE_SMALL_BOLD ?= 0
|
||||
ENABLE_CUSTOM_MENU_LAYOUT ?= 1
|
||||
ENABLE_KEEP_MEM_NAME ?= 1
|
||||
ENABLE_WIDE_RX ?= 1
|
||||
ENABLE_TX_WHEN_AM ?= 0
|
||||
ENABLE_F_CAL_MENU ?= 0
|
||||
ENABLE_CTCSS_TAIL_PHASE_SHIFT ?= 0
|
||||
ENABLE_F_CAL_MENU ?= 1
|
||||
ENABLE_CTCSS_TAIL_PHASE_SHIFT ?= 1
|
||||
ENABLE_BOOT_BEEPS ?= 0
|
||||
ENABLE_SHOW_CHARGE_LEVEL ?= 0
|
||||
ENABLE_REVERSE_BAT_SYMBOL ?= 0
|
||||
@@ -36,26 +36,25 @@ ENABLE_FASTER_CHANNEL_SCAN ?= 1
|
||||
ENABLE_RSSI_BAR ?= 1
|
||||
ENABLE_AUDIO_BAR ?= 1
|
||||
ENABLE_COPY_CHAN_TO_VFO ?= 1
|
||||
ENABLE_REDUCE_LOW_MID_TX_POWER ?= 0
|
||||
ENABLE_BYP_RAW_DEMODULATORS ?= 0
|
||||
ENABLE_REDUCE_LOW_MID_TX_POWER ?= 1
|
||||
ENABLE_BYP_RAW_DEMODULATORS ?= 1
|
||||
ENABLE_BLMIN_TMP_OFF ?= 0
|
||||
ENABLE_SCAN_RANGES ?= 1
|
||||
ENABLE_FEAT_F4HWN ?= 1
|
||||
ENABLE_FEAT_F4HWN_SCREENSHOT ?= 0
|
||||
ENABLE_FEAT_F4HWN_SPECTRUM ?= 1
|
||||
ENABLE_FEAT_F4HWN_RX_TX_TIMER ?= 1
|
||||
ENABLE_FEAT_F4HWN_RX_TX_TIMER ?= 0
|
||||
ENABLE_FEAT_F4HWN_CHARGING_C ?= 0
|
||||
ENABLE_FEAT_F4HWN_SLEEP ?= 1
|
||||
ENABLE_FEAT_F4HWN_RESUME_STATE ?= 1
|
||||
ENABLE_FEAT_F4HWN_NARROWER ?= 1
|
||||
ENABLE_FEAT_F4HWN_INV ?= 1
|
||||
ENABLE_FEAT_F4HWN_CTR ?= 1
|
||||
ENABLE_FEAT_F4HWN_CTR ?= 0
|
||||
ENABLE_FEAT_F4HWN_RESCUE_OPS ?= 0
|
||||
ENABLE_FEAT_F4HWN_VOL ?= 0
|
||||
ENABLE_FEAT_F4HWN_VOL ?= 1
|
||||
ENABLE_FEAT_F4HWN_RESET_CHANNEL ?= 0
|
||||
ENABLE_FEAT_F4HWN_PMR ?= 0
|
||||
ENABLE_FEAT_F4HWN_GMRS_FRS_MURS ?= 0
|
||||
ENABLE_FEAT_F4HWN_CA ?= 1
|
||||
ENABLE_FEAT_F4HWN_CA ?= 0
|
||||
ENABLE_FEAT_F4HWN_DEBUG ?= 0
|
||||
ENABLE_REGA ?= 0
|
||||
|
||||
@@ -67,7 +66,7 @@ ENABLE_UART_RW_BK_REGS ?= 0
|
||||
# ---- COMPILER/LINKER OPTIONS ----
|
||||
ENABLE_CLANG ?= 0
|
||||
ENABLE_SWD ?= 0
|
||||
ENABLE_OVERLAY ?= 0
|
||||
ENABLE_OVERLAY ?= 1
|
||||
ENABLE_LTO ?= 1
|
||||
|
||||
#############################################################
|
||||
@@ -138,6 +137,8 @@ OBJS += app/app.o
|
||||
OBJS += app/chFrScanner.o
|
||||
OBJS += app/common.o
|
||||
OBJS += app/dtmf.o
|
||||
OBJS += app/fskmodem.o
|
||||
OBJS += app/messages.o
|
||||
ifeq ($(ENABLE_REGA),1)
|
||||
OBJS += app/rega.o
|
||||
endif
|
||||
@@ -176,6 +177,7 @@ OBJS += settings.o
|
||||
ifeq ($(ENABLE_AIRCOPY),1)
|
||||
OBJS += ui/aircopy.o
|
||||
endif
|
||||
OBJS += ui/messages.o
|
||||
OBJS += ui/battery.o
|
||||
ifeq ($(ENABLE_FMRADIO),1)
|
||||
OBJS += ui/fmradio.o
|
||||
@@ -448,9 +450,6 @@ endif
|
||||
ifeq ($(ENABLE_FEAT_F4HWN_RESUME_STATE),1)
|
||||
CFLAGS += -DENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
endif
|
||||
ifeq ($(ENABLE_FEAT_F4HWN_NARROWER),1)
|
||||
CFLAGS += -DENABLE_FEAT_F4HWN_NARROWER
|
||||
endif
|
||||
ifeq ($(ENABLE_FEAT_F4HWN_INV),1)
|
||||
CFLAGS += -DENABLE_FEAT_F4HWN_INV
|
||||
endif
|
||||
|
@@ -97,6 +97,8 @@ Special thanks to Jean-Cyrille F6IWW (2 times), Fabrice 14RC123, David F4BPP, Ol
|
||||
* improve ScnRev menu (CARRIER from 250ms to 20s, STOP, TIMEOUT from 5s to 2m)
|
||||
* improve KeyLck menu (OFF, delay from 15s to 10m)
|
||||
* add HAM CA F Lock band (for Canadian zone),
|
||||
* add PMR 446 F Lock band,
|
||||
* add FRS/GMRS/MURS F Lock band,
|
||||
* remove blink and SOS functionality,
|
||||
* remove AM Fix menu (AM Fix is ENABLED by default),
|
||||
* add support of 3500mAh battery,
|
||||
@@ -116,13 +118,14 @@ Special thanks to Jean-Cyrille F6IWW (2 times), Fabrice 14RC123, David F4BPP, Ol
|
||||
* scan lists [1, 2, 3],
|
||||
* scan all (all channels with ou without list),
|
||||
* add scan list shortcuts,
|
||||
* add scan resume mode on startup,
|
||||
* add resume mode on startup (scan, bandscope and broadcast FM),
|
||||
* new actions:
|
||||
* RX MODE,
|
||||
* MAIN ONLY,
|
||||
* PTT,
|
||||
* WIDE NARROW,
|
||||
* 1750Hz,
|
||||
* MUTE,
|
||||
* POWER HIGH (RescueOps),
|
||||
* REMOVE OFFSET (RescueOps),
|
||||
* new key combinations:
|
||||
|
69
app/action.c
69
app/action.c
@@ -42,6 +42,9 @@
|
||||
#include "settings.h"
|
||||
#include "ui/inputbox.h"
|
||||
#include "ui/ui.h"
|
||||
#include "driver/st7565.h"
|
||||
#include "ui/menu.h"
|
||||
|
||||
#ifdef ENABLE_REGA
|
||||
#include "app/rega.h"
|
||||
#endif
|
||||
@@ -110,7 +113,6 @@ void (*action_opt_table[])(void) = {
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
[ACTION_OPT_RXMODE] = &ACTION_RxMode,
|
||||
[ACTION_OPT_MAINONLY] = &ACTION_MainOnly,
|
||||
[ACTION_OPT_PTT] = &ACTION_Ptt,
|
||||
[ACTION_OPT_WN] = &ACTION_Wn,
|
||||
[ACTION_OPT_BACKLIGHT] = &ACTION_BackLight,
|
||||
@@ -119,10 +121,6 @@ void (*action_opt_table[])(void) = {
|
||||
#else
|
||||
[ACTION_OPT_MUTE] = &FUNCTION_NOP,
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
[ACTION_OPT_POWER_HIGH] = &ACTION_Power_High,
|
||||
[ACTION_OPT_REMOVE_OFFSET] = &ACTION_Remove_Offset,
|
||||
#endif
|
||||
#else
|
||||
[ACTION_OPT_RXMODE] = &FUNCTION_NOP,
|
||||
#endif
|
||||
@@ -136,8 +134,9 @@ static_assert(ARRAY_SIZE(action_opt_table) == ACTION_OPT_LEN);
|
||||
|
||||
void ACTION_Power(void)
|
||||
{
|
||||
if (++gTxVfo->OUTPUT_POWER > OUTPUT_POWER_HIGH)
|
||||
gTxVfo->OUTPUT_POWER = OUTPUT_POWER_LOW1;
|
||||
gTxVfo->OUTPUT_POWER++;
|
||||
if (gTxVfo->OUTPUT_POWER >= ARRAY_SIZE(gSubMenu_TXP))
|
||||
gTxVfo->OUTPUT_POWER = 0;
|
||||
|
||||
gRequestSaveChannel = 1;
|
||||
|
||||
@@ -440,7 +439,7 @@ static void ACTION_Scan_FM(bool bRestart)
|
||||
static void ACTION_AlarmOr1750(const bool b1750)
|
||||
{
|
||||
|
||||
if(gEeprom.KEY_LOCK && gEeprom.KEY_LOCK_PTT)
|
||||
if(gEeprom.KEY_LOCK)
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_ALARM)
|
||||
@@ -552,40 +551,12 @@ void ACTION_Ptt(void)
|
||||
|
||||
void ACTION_Wn(void)
|
||||
{
|
||||
#ifdef ENABLE_FEAT_F4HWN_NARROWER
|
||||
bool narrower = 0;
|
||||
if (FUNCTION_IsRx())
|
||||
{
|
||||
gRxVfo->CHANNEL_BANDWIDTH = (gRxVfo->CHANNEL_BANDWIDTH == 0) ? 1: 0;
|
||||
if(gRxVfo->CHANNEL_BANDWIDTH == BANDWIDTH_NARROW && gSetting_set_nfm == 1)
|
||||
{
|
||||
narrower = 1;
|
||||
gRxVfo->CHANNEL_BANDWIDTH++;
|
||||
if (gRxVfo->CHANNEL_BANDWIDTH > BK4819_FILTER_BW_NARROWER) {
|
||||
gRxVfo->CHANNEL_BANDWIDTH = BK4819_FILTER_BW_WIDE;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AM_FIX
|
||||
BK4819_SetFilterBandwidth(gRxVfo->CHANNEL_BANDWIDTH + narrower, true);
|
||||
#else
|
||||
BK4819_SetFilterBandwidth(gRxVfo->CHANNEL_BANDWIDTH + narrower, false);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
gTxVfo->CHANNEL_BANDWIDTH = (gTxVfo->CHANNEL_BANDWIDTH == 0) ? 1: 0;
|
||||
if(gTxVfo->CHANNEL_BANDWIDTH == BANDWIDTH_NARROW && gSetting_set_nfm == 1)
|
||||
{
|
||||
narrower = 1;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AM_FIX
|
||||
BK4819_SetFilterBandwidth(gTxVfo->CHANNEL_BANDWIDTH, true);
|
||||
#else
|
||||
BK4819_SetFilterBandwidth(gTxVfo->CHANNEL_BANDWIDTH, false);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
if (FUNCTION_IsRx())
|
||||
{
|
||||
gRxVfo->CHANNEL_BANDWIDTH = (gRxVfo->CHANNEL_BANDWIDTH == 0) ? 1: 0;
|
||||
#ifdef ENABLE_AM_FIX
|
||||
BK4819_SetFilterBandwidth(gRxVfo->CHANNEL_BANDWIDTH, true);
|
||||
#else
|
||||
@@ -594,14 +565,16 @@ void ACTION_Wn(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gTxVfo->CHANNEL_BANDWIDTH = (gTxVfo->CHANNEL_BANDWIDTH == 0) ? 1: 0;
|
||||
gRxVfo->CHANNEL_BANDWIDTH++;
|
||||
if (gRxVfo->CHANNEL_BANDWIDTH > BK4819_FILTER_BW_NARROWER) {
|
||||
gRxVfo->CHANNEL_BANDWIDTH = BK4819_FILTER_BW_WIDE;
|
||||
}
|
||||
#ifdef ENABLE_AM_FIX
|
||||
BK4819_SetFilterBandwidth(gTxVfo->CHANNEL_BANDWIDTH, true);
|
||||
#else
|
||||
BK4819_SetFilterBandwidth(gTxVfo->CHANNEL_BANDWIDTH, false);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ACTION_BackLight(void)
|
||||
@@ -657,18 +630,4 @@ void ACTION_BackLightOnDemand(void)
|
||||
gUpdateStatus = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
void ACTION_Power_High(void)
|
||||
{
|
||||
gPowerHigh = !gPowerHigh;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
}
|
||||
|
||||
void ACTION_Remove_Offset(void)
|
||||
{
|
||||
gRemoveOffset = !gRemoveOffset;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
}
|
||||
#endif
|
||||
#endif
|
@@ -45,10 +45,6 @@ void ACTION_SwitchDemodul(void);
|
||||
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
|
||||
void ACTION_Mute(void);
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
void ACTION_Power_High(void);
|
||||
void ACTION_Remove_Offset(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include "screenshot.h"
|
||||
#endif
|
||||
|
||||
static const uint16_t Obfuscation[8] = { 0x6C16, 0xE614, 0x912E, 0x400D, 0x3521, 0x40D5, 0x0313, 0x80E9 };
|
||||
static const uint16_t Obfuscation[8] = {0x6C16, 0xE614, 0x912E, 0x400D, 0x3521, 0x40D5, 0x0313, 0x80E9};
|
||||
|
||||
AIRCOPY_State_t gAircopyState;
|
||||
uint16_t gAirCopyBlockNumber;
|
||||
@@ -45,16 +45,13 @@ uint8_t gAirCopyIsSendMode;
|
||||
|
||||
uint16_t g_FSK_Buffer[36];
|
||||
|
||||
static void AIRCOPY_clear()
|
||||
{
|
||||
for (uint8_t i = 0; i < 15; i++)
|
||||
{
|
||||
static void AIRCOPY_clear() {
|
||||
for (uint8_t i = 0; i < 15; i++) {
|
||||
crc[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool AIRCOPY_SendMessage(void)
|
||||
{
|
||||
bool AIRCOPY_SendMessage(void) {
|
||||
static uint8_t gAircopySendCountdown = 1;
|
||||
|
||||
if (gAircopyState != AIRCOPY_TRANSFER) {
|
||||
@@ -77,9 +74,9 @@ bool AIRCOPY_SendMessage(void)
|
||||
|
||||
if (++gAirCopyBlockNumber >= 0x78) {
|
||||
gAircopyState = AIRCOPY_COMPLETE;
|
||||
#ifdef ENABLE_FEAT_F4HWN_SCREENSHOT
|
||||
getScreenShot();
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_SCREENSHOT
|
||||
getScreenShot();
|
||||
#endif
|
||||
//NVIC_SystemReset();
|
||||
}
|
||||
|
||||
@@ -94,8 +91,7 @@ bool AIRCOPY_SendMessage(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AIRCOPY_StorePacket(void)
|
||||
{
|
||||
void AIRCOPY_StorePacket(void) {
|
||||
if (gFSKWriteIndex < 36) {
|
||||
return;
|
||||
}
|
||||
@@ -138,16 +134,15 @@ void AIRCOPY_StorePacket(void)
|
||||
|
||||
if (Offset == 0x1E00) {
|
||||
gAircopyState = AIRCOPY_COMPLETE;
|
||||
#ifdef ENABLE_FEAT_F4HWN_SCREENSHOT
|
||||
getScreenShot();
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_SCREENSHOT
|
||||
getScreenShot();
|
||||
#endif
|
||||
}
|
||||
|
||||
gAirCopyBlockNumber++;
|
||||
}
|
||||
|
||||
static void AIRCOPY_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
static void AIRCOPY_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
|
||||
if (bKeyHeld || !bKeyPressed) {
|
||||
return;
|
||||
}
|
||||
@@ -194,8 +189,7 @@ static void AIRCOPY_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
gRequestDisplayScreen = DISPLAY_AIRCOPY;
|
||||
}
|
||||
|
||||
static void AIRCOPY_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
static void AIRCOPY_Key_EXIT(bool bKeyPressed, bool bKeyHeld) {
|
||||
if (bKeyHeld || !bKeyPressed) {
|
||||
return;
|
||||
}
|
||||
@@ -220,8 +214,7 @@ static void AIRCOPY_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
||||
gRequestDisplayScreen = DISPLAY_AIRCOPY;
|
||||
}
|
||||
|
||||
static void AIRCOPY_Key_MENU(bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
static void AIRCOPY_Key_MENU(bool bKeyPressed, bool bKeyHeld) {
|
||||
if (bKeyHeld || !bKeyPressed) {
|
||||
return;
|
||||
}
|
||||
@@ -242,29 +235,28 @@ static void AIRCOPY_Key_MENU(bool bKeyPressed, bool bKeyHeld)
|
||||
gAircopyState = AIRCOPY_TRANSFER;
|
||||
}
|
||||
|
||||
void AIRCOPY_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
void AIRCOPY_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
|
||||
switch (Key) {
|
||||
case KEY_0:
|
||||
case KEY_1:
|
||||
case KEY_2:
|
||||
case KEY_3:
|
||||
case KEY_4:
|
||||
case KEY_5:
|
||||
case KEY_6:
|
||||
case KEY_7:
|
||||
case KEY_8:
|
||||
case KEY_9:
|
||||
AIRCOPY_Key_DIGITS(Key, bKeyPressed, bKeyHeld);
|
||||
break;
|
||||
case KEY_MENU:
|
||||
AIRCOPY_Key_MENU(bKeyPressed, bKeyHeld);
|
||||
break;
|
||||
case KEY_EXIT:
|
||||
AIRCOPY_Key_EXIT(bKeyPressed, bKeyHeld);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case KEY_0:
|
||||
case KEY_1:
|
||||
case KEY_2:
|
||||
case KEY_3:
|
||||
case KEY_4:
|
||||
case KEY_5:
|
||||
case KEY_6:
|
||||
case KEY_7:
|
||||
case KEY_8:
|
||||
case KEY_9:
|
||||
AIRCOPY_Key_DIGITS(Key, bKeyPressed, bKeyHeld);
|
||||
break;
|
||||
case KEY_MENU:
|
||||
AIRCOPY_Key_MENU(bKeyPressed, bKeyHeld);
|
||||
break;
|
||||
case KEY_EXIT:
|
||||
AIRCOPY_Key_EXIT(bKeyPressed, bKeyHeld);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
18
app/app.h
18
app/app.h
@@ -23,13 +23,21 @@
|
||||
#include "frequencies.h"
|
||||
#include "radio.h"
|
||||
|
||||
void APP_EndTransmission(void);
|
||||
void APP_StartListening(FUNCTION_Type_t function);
|
||||
void APP_EndTransmission(void);
|
||||
|
||||
void APP_StartListening(FUNCTION_Type_t function);
|
||||
|
||||
uint32_t APP_SetFreqByStepAndLimits(VFO_Info_t *pInfo, int8_t direction, uint32_t lower, uint32_t upper);
|
||||
|
||||
uint32_t APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t direction);
|
||||
void APP_Update(void);
|
||||
void APP_TimeSlice10ms(void);
|
||||
void APP_TimeSlice500ms(void);
|
||||
|
||||
void APP_Update(void);
|
||||
|
||||
void APP_TimeSlice10ms(void);
|
||||
|
||||
void APP_TimeSlice500ms(void);
|
||||
|
||||
void APP_EndTransmission(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
94
app/dtmf.c
94
app/dtmf.c
@@ -248,7 +248,7 @@ void DTMF_HandleRequest(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gRxVfo->DTMF_DECODING_ENABLE && !gSetting_KILLED)
|
||||
if (!gRxVfo->DTMF_DECODING_ENABLE)
|
||||
{ // D-DCD is disabled or we're alive
|
||||
DTMF_clear_RX();
|
||||
return;
|
||||
@@ -266,28 +266,28 @@ void DTMF_HandleRequest(void)
|
||||
if (CompareMessage(gDTMF_RX + Offset, String, strlen(String), true))
|
||||
{ // bugger
|
||||
|
||||
if (gEeprom.PERMIT_REMOTE_KILL)
|
||||
{
|
||||
gSetting_KILLED = true; // oooerr !
|
||||
|
||||
DTMF_clear_RX();
|
||||
|
||||
SETTINGS_SaveSettings();
|
||||
|
||||
gDTMF_ReplyState = DTMF_REPLY_AB;
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
if (gFmRadioMode)
|
||||
{
|
||||
FM_TurnOff();
|
||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// if (gEeprom.PERMIT_REMOTE_KILL)
|
||||
// {
|
||||
// gSetting_KILLED = true; // oooerr !
|
||||
//
|
||||
// DTMF_clear_RX();
|
||||
//
|
||||
// SETTINGS_SaveSettings();
|
||||
//
|
||||
// gDTMF_ReplyState = DTMF_REPLY_AB;
|
||||
//
|
||||
// #ifdef ENABLE_FMRADIO
|
||||
// if (gFmRadioMode)
|
||||
// {
|
||||
// FM_TurnOff();
|
||||
// GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||
// }
|
||||
// #endif
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
gDTMF_ReplyState = DTMF_REPLY_NONE;
|
||||
}
|
||||
// }
|
||||
|
||||
gDTMF_CallState = DTMF_CALL_STATE_NONE;
|
||||
|
||||
@@ -297,30 +297,30 @@ void DTMF_HandleRequest(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (gDTMF_RX_index >= 9)
|
||||
{ // look for the REVIVE code
|
||||
|
||||
sprintf(String, "%s%c%s", gEeprom.ANI_DTMF_ID, gEeprom.DTMF_SEPARATE_CODE, gEeprom.REVIVE_CODE);
|
||||
|
||||
Offset = gDTMF_RX_index - strlen(String);
|
||||
|
||||
if (CompareMessage(gDTMF_RX + Offset, String, strlen(String), true))
|
||||
{ // shit, we're back !
|
||||
|
||||
gSetting_KILLED = false;
|
||||
|
||||
DTMF_clear_RX();
|
||||
|
||||
SETTINGS_SaveSettings();
|
||||
|
||||
gDTMF_ReplyState = DTMF_REPLY_AB;
|
||||
gDTMF_CallState = DTMF_CALL_STATE_NONE;
|
||||
|
||||
gUpdateDisplay = true;
|
||||
gUpdateStatus = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// if (gDTMF_RX_index >= 9)
|
||||
// { // look for the REVIVE code
|
||||
//
|
||||
// sprintf(String, "%s%c%s", gEeprom.ANI_DTMF_ID, gEeprom.DTMF_SEPARATE_CODE, gEeprom.REVIVE_CODE);
|
||||
//
|
||||
// Offset = gDTMF_RX_index - strlen(String);
|
||||
//
|
||||
// if (CompareMessage(gDTMF_RX + Offset, String, strlen(String), true))
|
||||
// { // shit, we're back !
|
||||
//
|
||||
// gSetting_KILLED = false;
|
||||
//
|
||||
// DTMF_clear_RX();
|
||||
//
|
||||
// SETTINGS_SaveSettings();
|
||||
//
|
||||
// gDTMF_ReplyState = DTMF_REPLY_AB;
|
||||
// gDTMF_CallState = DTMF_CALL_STATE_NONE;
|
||||
//
|
||||
// gUpdateDisplay = true;
|
||||
// gUpdateStatus = true;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
if (gDTMF_RX_index >= 2)
|
||||
{ // look for ACK reply
|
||||
@@ -360,7 +360,7 @@ void DTMF_HandleRequest(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (gSetting_KILLED || gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
||||
if (gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
||||
{ // we've been killed or expecting a reply
|
||||
return;
|
||||
}
|
||||
|
113
app/flashlight.c
113
app/flashlight.c
@@ -5,79 +5,60 @@
|
||||
|
||||
#include "flashlight.h"
|
||||
|
||||
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_RESCUE_OPS)
|
||||
enum FlashlightMode_t gFlashLightState;
|
||||
enum FlashlightMode_t gFlashLightState;
|
||||
|
||||
void FlashlightTimeSlice()
|
||||
{
|
||||
if (gFlashLightState == FLASHLIGHT_BLINK && (gFlashLightBlinkCounter & 15u) == 0) {
|
||||
GPIO_FlipBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
void FlashlightTimeSlice() {
|
||||
if (gFlashLightState == FLASHLIGHT_BLINK && (gFlashLightBlinkCounter & 15u) == 0) {
|
||||
GPIO_FlipBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gFlashLightState == FLASHLIGHT_SOS) {
|
||||
const uint16_t u = 15;
|
||||
static uint8_t c;
|
||||
static uint16_t next;
|
||||
|
||||
if (gFlashLightBlinkCounter - next > 7 * u) {
|
||||
c = 0;
|
||||
next = gFlashLightBlinkCounter + 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gFlashLightState == FLASHLIGHT_SOS) {
|
||||
const uint16_t u = 15;
|
||||
static uint8_t c;
|
||||
static uint16_t next;
|
||||
|
||||
if (gFlashLightBlinkCounter - next > 7 * u) {
|
||||
c = 0;
|
||||
next = gFlashLightBlinkCounter + 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gFlashLightBlinkCounter == next) {
|
||||
if (c==0) {
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
} else {
|
||||
GPIO_FlipBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
}
|
||||
|
||||
if (c >= 18) {
|
||||
next = gFlashLightBlinkCounter + 7 * u;
|
||||
c = 0;
|
||||
} else if(c==7 || c==9 || c==11) {
|
||||
next = gFlashLightBlinkCounter + 3 * u;
|
||||
} else {
|
||||
next = gFlashLightBlinkCounter + u;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ACTION_FlashLight(void)
|
||||
{
|
||||
switch (gFlashLightState) {
|
||||
case FLASHLIGHT_OFF:
|
||||
gFlashLightState++;
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
break;
|
||||
case FLASHLIGHT_ON:
|
||||
case FLASHLIGHT_BLINK:
|
||||
gFlashLightState++;
|
||||
break;
|
||||
case FLASHLIGHT_SOS:
|
||||
default:
|
||||
gFlashLightState = 0;
|
||||
if (gFlashLightBlinkCounter == next) {
|
||||
if (c == 0) {
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
} else {
|
||||
GPIO_FlipBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
}
|
||||
|
||||
if (c >= 18) {
|
||||
next = gFlashLightBlinkCounter + 7 * u;
|
||||
c = 0;
|
||||
} else if (c == 7 || c == 9 || c == 11) {
|
||||
next = gFlashLightBlinkCounter + 3 * u;
|
||||
} else {
|
||||
next = gFlashLightBlinkCounter + u;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
}
|
||||
#else
|
||||
void ACTION_FlashLight(void)
|
||||
{
|
||||
static bool gFlashLightState = false;
|
||||
}
|
||||
|
||||
if(gFlashLightState)
|
||||
{
|
||||
void ACTION_FlashLight(void) {
|
||||
switch (gFlashLightState) {
|
||||
case FLASHLIGHT_OFF:
|
||||
gFlashLightState++;
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
break;
|
||||
case FLASHLIGHT_ON:
|
||||
case FLASHLIGHT_BLINK:
|
||||
gFlashLightState++;
|
||||
break;
|
||||
case FLASHLIGHT_SOS:
|
||||
default:
|
||||
gFlashLightState = 0;
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
}
|
||||
else
|
||||
{
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
}
|
||||
|
||||
gFlashLightState = (gFlashLightState) ? false : true;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
@@ -5,7 +5,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if !defined(ENABLE_FEAT_F4HWN) || defined(ENABLE_FEAT_F4HWN_RESCUE_OPS)
|
||||
enum FlashlightMode_t {
|
||||
FLASHLIGHT_OFF = 0,
|
||||
FLASHLIGHT_ON,
|
||||
@@ -17,7 +16,6 @@
|
||||
extern volatile uint16_t gFlashLightBlinkCounter;
|
||||
|
||||
void FlashlightTimeSlice(void);
|
||||
#endif
|
||||
void ACTION_FlashLight(void);
|
||||
|
||||
#endif
|
||||
|
263
app/fm.c
263
app/fm.c
@@ -31,22 +31,22 @@
|
||||
#include "settings.h"
|
||||
#include "ui/inputbox.h"
|
||||
#include "ui/ui.h"
|
||||
#include "driver/systick.h"
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
||||
#endif
|
||||
|
||||
uint16_t gFM_Channels[20];
|
||||
bool gFmRadioMode;
|
||||
uint8_t gFmRadioCountdown_500ms;
|
||||
uint16_t gFM_Channels[20];
|
||||
bool gFmRadioMode;
|
||||
uint8_t gFmRadioCountdown_500ms;
|
||||
volatile uint16_t gFmPlayCountdown_10ms;
|
||||
volatile int8_t gFM_ScanState;
|
||||
bool gFM_AutoScan;
|
||||
uint8_t gFM_ChannelPosition;
|
||||
bool gFM_FoundFrequency;
|
||||
bool gFM_AutoScan;
|
||||
uint16_t gFM_RestoreCountdown_10ms;
|
||||
|
||||
volatile int8_t gFM_ScanState;
|
||||
bool gFM_AutoScan;
|
||||
uint8_t gFM_ChannelPosition;
|
||||
bool gFM_FoundFrequency;
|
||||
bool gFM_AutoScan;
|
||||
uint16_t gFM_RestoreCountdown_10ms;
|
||||
|
||||
|
||||
const uint8_t BUTTON_STATE_PRESSED = 1 << 0;
|
||||
@@ -54,21 +54,19 @@ const uint8_t BUTTON_STATE_HELD = 1 << 1;
|
||||
|
||||
const uint8_t BUTTON_EVENT_PRESSED = BUTTON_STATE_PRESSED;
|
||||
const uint8_t BUTTON_EVENT_HELD = BUTTON_STATE_PRESSED | BUTTON_STATE_HELD;
|
||||
const uint8_t BUTTON_EVENT_SHORT = 0;
|
||||
const uint8_t BUTTON_EVENT_LONG = BUTTON_STATE_HELD;
|
||||
const uint8_t BUTTON_EVENT_SHORT = 0;
|
||||
const uint8_t BUTTON_EVENT_LONG = BUTTON_STATE_HELD;
|
||||
|
||||
|
||||
static void Key_FUNC(KEY_Code_t Key, uint8_t state);
|
||||
|
||||
bool FM_CheckValidChannel(uint8_t Channel)
|
||||
{
|
||||
return Channel < ARRAY_SIZE(gFM_Channels) &&
|
||||
gFM_Channels[Channel] >= BK1080_GetFreqLoLimit(gEeprom.FM_Band) &&
|
||||
gFM_Channels[Channel] < BK1080_GetFreqHiLimit(gEeprom.FM_Band);
|
||||
bool FM_CheckValidChannel(uint8_t Channel) {
|
||||
return Channel < ARRAY_SIZE(gFM_Channels) &&
|
||||
gFM_Channels[Channel] >= BK1080_GetFreqLoLimit(gEeprom.FM_Band) &&
|
||||
gFM_Channels[Channel] < BK1080_GetFreqHiLimit(gEeprom.FM_Band);
|
||||
}
|
||||
|
||||
uint8_t FM_FindNextChannel(uint8_t Channel, uint8_t Direction)
|
||||
{
|
||||
uint8_t FM_FindNextChannel(uint8_t Channel, uint8_t Direction) {
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(gFM_Channels); i++) {
|
||||
if (Channel == 0xFF)
|
||||
Channel = ARRAY_SIZE(gFM_Channels) - 1;
|
||||
@@ -82,8 +80,7 @@ uint8_t FM_FindNextChannel(uint8_t Channel, uint8_t Direction)
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
int FM_ConfigureChannelState(void)
|
||||
{
|
||||
int FM_ConfigureChannelState(void) {
|
||||
gEeprom.FM_FrequencyPlaying = gEeprom.FM_SelectedFrequency;
|
||||
|
||||
if (gEeprom.FM_IsMrMode) {
|
||||
@@ -92,17 +89,16 @@ int FM_ConfigureChannelState(void)
|
||||
gEeprom.FM_IsMrMode = false;
|
||||
return -1;
|
||||
}
|
||||
gEeprom.FM_SelectedChannel = Channel;
|
||||
gEeprom.FM_SelectedChannel = Channel;
|
||||
gEeprom.FM_FrequencyPlaying = gFM_Channels[Channel];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FM_TurnOff(void)
|
||||
{
|
||||
gFmRadioMode = false;
|
||||
gFM_ScanState = FM_SCAN_OFF;
|
||||
void FM_TurnOff(void) {
|
||||
gFmRadioMode = false;
|
||||
gFM_ScanState = FM_SCAN_OFF;
|
||||
gFM_RestoreCountdown_10ms = 0;
|
||||
|
||||
AUDIO_AudioPathOff();
|
||||
@@ -110,17 +106,16 @@ void FM_TurnOff(void)
|
||||
|
||||
BK1080_Init0();
|
||||
|
||||
gUpdateStatus = true;
|
||||
gUpdateStatus = true;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
gEeprom.CURRENT_STATE = 0;
|
||||
SETTINGS_WriteCurrentState();
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
gEeprom.CURRENT_STATE = 0;
|
||||
SETTINGS_WriteCurrentState();
|
||||
#endif
|
||||
}
|
||||
|
||||
void FM_EraseChannels(void)
|
||||
{
|
||||
uint8_t Template[8];
|
||||
void FM_EraseChannels(void) {
|
||||
uint8_t Template[8];
|
||||
memset(Template, 0xFF, sizeof(Template));
|
||||
|
||||
for (unsigned i = 0; i < 5; i++)
|
||||
@@ -129,18 +124,18 @@ void FM_EraseChannels(void)
|
||||
memset(gFM_Channels, 0xFF, sizeof(gFM_Channels));
|
||||
}
|
||||
|
||||
void FM_Tune(uint16_t Frequency, int8_t Step, bool bFlag)
|
||||
{
|
||||
void FM_Tune(uint16_t Frequency, int8_t Step, bool bFlag) {
|
||||
AUDIO_AudioPathOff();
|
||||
|
||||
gEnableSpeaker = false;
|
||||
|
||||
gFmPlayCountdown_10ms = (gFM_ScanState == FM_SCAN_OFF) ? fm_play_countdown_noscan_10ms : fm_play_countdown_scan_10ms;
|
||||
gFmPlayCountdown_10ms = (gFM_ScanState == FM_SCAN_OFF) ? fm_play_countdown_noscan_10ms
|
||||
: fm_play_countdown_scan_10ms;
|
||||
|
||||
gScheduleFM = false;
|
||||
gFM_FoundFrequency = false;
|
||||
gAskToSave = false;
|
||||
gAskToDelete = false;
|
||||
gScheduleFM = false;
|
||||
gFM_FoundFrequency = false;
|
||||
gAskToSave = false;
|
||||
gAskToDelete = false;
|
||||
gEeprom.FM_FrequencyPlaying = Frequency;
|
||||
|
||||
if (!bFlag) {
|
||||
@@ -158,12 +153,11 @@ void FM_Tune(uint16_t Frequency, int8_t Step, bool bFlag)
|
||||
BK1080_SetFrequency(gEeprom.FM_FrequencyPlaying, gEeprom.FM_Band/*, gEeprom.FM_Space*/);
|
||||
}
|
||||
|
||||
void FM_PlayAndUpdate(void)
|
||||
{
|
||||
void FM_PlayAndUpdate(void) {
|
||||
gFM_ScanState = FM_SCAN_OFF;
|
||||
|
||||
if (gFM_AutoScan) {
|
||||
gEeprom.FM_IsMrMode = true;
|
||||
gEeprom.FM_IsMrMode = true;
|
||||
gEeprom.FM_SelectedChannel = 0;
|
||||
}
|
||||
|
||||
@@ -172,35 +166,34 @@ void FM_PlayAndUpdate(void)
|
||||
SETTINGS_SaveFM();
|
||||
|
||||
gFmPlayCountdown_10ms = 0;
|
||||
gScheduleFM = false;
|
||||
gAskToSave = false;
|
||||
gScheduleFM = false;
|
||||
gAskToSave = false;
|
||||
|
||||
AUDIO_AudioPathOn();
|
||||
|
||||
gEnableSpeaker = true;
|
||||
gEnableSpeaker = true;
|
||||
}
|
||||
|
||||
int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit)
|
||||
{
|
||||
int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit) {
|
||||
int ret = -1;
|
||||
|
||||
const uint16_t Test2 = BK1080_ReadRegister(BK1080_REG_07);
|
||||
const uint16_t Test2 = BK1080_ReadRegister(BK1080_REG_07_TEST1);
|
||||
|
||||
// This is supposed to be a signed value, but above function is unsigned
|
||||
const uint16_t Deviation = BK1080_REG_07_GET_FREQD(Test2);
|
||||
|
||||
if (BK1080_REG_07_GET_SNR(Test2) <= 2) {
|
||||
BK1080_FrequencyDeviation = Deviation;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const uint16_t Status = BK1080_ReadRegister(BK1080_REG_10);
|
||||
const uint16_t Status = BK1080_ReadRegister(BK1080_REG_10_RSSI_STATUS);
|
||||
|
||||
if ((Status & BK1080_REG_10_MASK_AFCRL) != BK1080_REG_10_AFCRL_NOT_RAILED || BK1080_REG_10_GET_RSSI(Status) < 10) {
|
||||
BK1080_FrequencyDeviation = Deviation;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -208,17 +201,16 @@ int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit)
|
||||
//if (Deviation > -281 && Deviation < 280)
|
||||
if (Deviation >= 280 && Deviation <= 3815) {
|
||||
BK1080_FrequencyDeviation = Deviation;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// not BLE(less than or equal)
|
||||
if (Frequency > LowerLimit && (Frequency - BK1080_BaseFrequency) == 1) {
|
||||
if (BK1080_FrequencyDeviation & 0x800 || (BK1080_FrequencyDeviation < 20))
|
||||
{
|
||||
if (BK1080_FrequencyDeviation & 0x800 || (BK1080_FrequencyDeviation < 20)) {
|
||||
BK1080_FrequencyDeviation = Deviation;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -227,10 +219,9 @@ int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit)
|
||||
// not BLT(less than)
|
||||
|
||||
if (Frequency >= LowerLimit && (BK1080_BaseFrequency - Frequency) == 1) {
|
||||
if ((BK1080_FrequencyDeviation & 0x800) == 0 || (BK1080_FrequencyDeviation > 4075))
|
||||
{
|
||||
if ((BK1080_FrequencyDeviation & 0x800) == 0 || (BK1080_FrequencyDeviation > 4075)) {
|
||||
BK1080_FrequencyDeviation = Deviation;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -238,14 +229,15 @@ int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit)
|
||||
|
||||
ret = 0;
|
||||
BK1080_FrequencyDeviation = Deviation;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void Key_DIGITS(KEY_Code_t Key, uint8_t state)
|
||||
{
|
||||
enum { STATE_FREQ_MODE, STATE_MR_MODE, STATE_SAVE };
|
||||
static void Key_DIGITS(KEY_Code_t Key, uint8_t state) {
|
||||
enum {
|
||||
STATE_FREQ_MODE, STATE_MR_MODE, STATE_SAVE
|
||||
};
|
||||
|
||||
if (state == BUTTON_EVENT_SHORT && !gWasFKeyPressed) {
|
||||
uint8_t State;
|
||||
@@ -257,8 +249,7 @@ static void Key_DIGITS(KEY_Code_t Key, uint8_t state)
|
||||
|
||||
if (gAskToSave) {
|
||||
State = STATE_SAVE;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (gFM_ScanState != FM_SCAN_OFF) {
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
@@ -278,20 +269,20 @@ static void Key_DIGITS(KEY_Code_t Key, uint8_t state)
|
||||
gInputBox[0] = 0;
|
||||
gInputBoxIndex = 2;
|
||||
}
|
||||
}
|
||||
else if (gInputBoxIndex > 3) {
|
||||
} else if (gInputBoxIndex > 3) {
|
||||
uint32_t Frequency;
|
||||
|
||||
gInputBoxIndex = 0;
|
||||
Frequency = StrToUL(INPUTBOX_GetAscii());
|
||||
|
||||
if (Frequency < BK1080_GetFreqLoLimit(gEeprom.FM_Band) || BK1080_GetFreqHiLimit(gEeprom.FM_Band) < Frequency) {
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
if (Frequency < BK1080_GetFreqLoLimit(gEeprom.FM_Band) ||
|
||||
BK1080_GetFreqHiLimit(gEeprom.FM_Band) < Frequency) {
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
gRequestDisplayScreen = DISPLAY_FM;
|
||||
return;
|
||||
}
|
||||
|
||||
gEeprom.FM_SelectedFrequency = (uint16_t)Frequency;
|
||||
gEeprom.FM_SelectedFrequency = (uint16_t) Frequency;
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
@@ -300,8 +291,7 @@ static void Key_DIGITS(KEY_Code_t Key, uint8_t state)
|
||||
gRequestSaveFM = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (gInputBoxIndex == 2) {
|
||||
} else if (gInputBoxIndex == 2) {
|
||||
uint8_t Channel;
|
||||
|
||||
gInputBoxIndex = 0;
|
||||
@@ -318,8 +308,7 @@ static void Key_DIGITS(KEY_Code_t Key, uint8_t state)
|
||||
gRequestSaveFM = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (Channel < 20) {
|
||||
} else if (Channel < 20) {
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
@@ -336,19 +325,17 @@ static void Key_DIGITS(KEY_Code_t Key, uint8_t state)
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
} else
|
||||
Key_FUNC(Key, state);
|
||||
}
|
||||
|
||||
static void Key_FUNC(KEY_Code_t Key, uint8_t state)
|
||||
{
|
||||
static void Key_FUNC(KEY_Code_t Key, uint8_t state) {
|
||||
if (state == BUTTON_EVENT_SHORT || state == BUTTON_EVENT_HELD) {
|
||||
bool autoScan = gWasFKeyPressed || (state == BUTTON_EVENT_HELD);
|
||||
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
gWasFKeyPressed = false;
|
||||
gUpdateStatus = true;
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
gWasFKeyPressed = false;
|
||||
gUpdateStatus = true;
|
||||
gRequestDisplayScreen = DISPLAY_FM;
|
||||
|
||||
switch (Key) {
|
||||
@@ -361,10 +348,10 @@ static void Key_FUNC(KEY_Code_t Key, uint8_t state)
|
||||
gRequestSaveFM = true;
|
||||
break;
|
||||
|
||||
// case KEY_2:
|
||||
// gEeprom.FM_Space = (gEeprom.FM_Space + 1) % 3;
|
||||
// gRequestSaveFM = true;
|
||||
// break;
|
||||
// case KEY_2:
|
||||
// gEeprom.FM_Space = (gEeprom.FM_Space + 1) % 3;
|
||||
// gRequestSaveFM = true;
|
||||
// break;
|
||||
|
||||
case KEY_3:
|
||||
gEeprom.FM_IsMrMode = !gEeprom.FM_IsMrMode;
|
||||
@@ -372,11 +359,30 @@ static void Key_FUNC(KEY_Code_t Key, uint8_t state)
|
||||
if (!FM_ConfigureChannelState()) {
|
||||
BK1080_SetFrequency(gEeprom.FM_FrequencyPlaying, gEeprom.FM_Band/*, gEeprom.FM_Space*/);
|
||||
gRequestSaveFM = true;
|
||||
}
|
||||
else
|
||||
} else
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
break;
|
||||
|
||||
case KEY_4:
|
||||
gEeprom.BK1080_AGC_ENABLED = !gEeprom.BK1080_AGC_ENABLED;
|
||||
BK1080_UpdateSysconf();
|
||||
gRequestSaveSettings = true;
|
||||
gRequestSaveFM = true;
|
||||
break;
|
||||
|
||||
case KEY_5:
|
||||
gEeprom.BK1080_DEEMPHASIS_CONFIG++;
|
||||
BK1080_UpdateSysconf();
|
||||
gRequestSaveSettings = true;
|
||||
gRequestSaveFM = true;
|
||||
break;
|
||||
|
||||
case KEY_6:
|
||||
gEeprom.BK1080_BLEND_CONFIG++;
|
||||
BK1080_UpdateSysconf();
|
||||
gRequestSaveSettings = true;
|
||||
gRequestSaveFM = true;
|
||||
break;
|
||||
case KEY_STAR:
|
||||
ACTION_Scan(autoScan);
|
||||
break;
|
||||
@@ -388,24 +394,23 @@ static void Key_FUNC(KEY_Code_t Key, uint8_t state)
|
||||
}
|
||||
}
|
||||
|
||||
static void Key_EXIT(uint8_t state)
|
||||
{
|
||||
if (state != BUTTON_EVENT_SHORT)
|
||||
return;
|
||||
|
||||
static void Key_EXIT(uint8_t state) {
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
if (gFM_ScanState == FM_SCAN_OFF) {
|
||||
if (state == BUTTON_EVENT_SHORT) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (gFM_ScanState == FM_SCAN_OFF || state == BUTTON_EVENT_LONG) {
|
||||
if (gInputBoxIndex == 0) {
|
||||
if (!gAskToSave && !gAskToDelete) {
|
||||
ACTION_FM();
|
||||
return;
|
||||
}
|
||||
|
||||
gAskToSave = false;
|
||||
gAskToSave = false;
|
||||
gAskToDelete = false;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
gInputBox[--gInputBoxIndex] = 10;
|
||||
|
||||
if (gInputBoxIndex) {
|
||||
@@ -425,8 +430,7 @@ static void Key_EXIT(uint8_t state)
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = VOICE_ID_CANCEL;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
FM_PlayAndUpdate();
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
|
||||
@@ -436,14 +440,13 @@ static void Key_EXIT(uint8_t state)
|
||||
gRequestDisplayScreen = DISPLAY_FM;
|
||||
}
|
||||
|
||||
static void Key_MENU(uint8_t state)
|
||||
{
|
||||
static void Key_MENU(uint8_t state) {
|
||||
if (state != BUTTON_EVENT_SHORT)
|
||||
return;
|
||||
|
||||
|
||||
gRequestDisplayScreen = DISPLAY_FM;
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
if (gFM_ScanState == FM_SCAN_OFF) {
|
||||
if (!gEeprom.FM_IsMrMode) {
|
||||
@@ -452,8 +455,7 @@ static void Key_MENU(uint8_t state)
|
||||
gRequestSaveFM = true;
|
||||
}
|
||||
gAskToSave = !gAskToSave;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (gAskToDelete) {
|
||||
gFM_Channels[gEeprom.FM_SelectedChannel] = 0xFFFF;
|
||||
|
||||
@@ -464,10 +466,9 @@ static void Key_MENU(uint8_t state)
|
||||
}
|
||||
gAskToDelete = !gAskToDelete;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (gFM_AutoScan || !gFM_FoundFrequency) {
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
gInputBoxIndex = 0;
|
||||
return;
|
||||
}
|
||||
@@ -480,8 +481,7 @@ static void Key_MENU(uint8_t state)
|
||||
}
|
||||
}
|
||||
|
||||
static void Key_UP_DOWN(uint8_t state, int8_t Step)
|
||||
{
|
||||
static void Key_UP_DOWN(uint8_t state, int8_t Step) {
|
||||
if (state == BUTTON_EVENT_PRESSED) {
|
||||
if (gInputBoxIndex) {
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
@@ -489,13 +489,13 @@ static void Key_UP_DOWN(uint8_t state, int8_t Step)
|
||||
}
|
||||
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
} else if (gInputBoxIndex || state!=BUTTON_EVENT_HELD) {
|
||||
} else if (gInputBoxIndex || state != BUTTON_EVENT_HELD) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (gAskToSave) {
|
||||
gRequestDisplayScreen = DISPLAY_FM;
|
||||
gFM_ChannelPosition = NUMBER_AddWithWraparound(gFM_ChannelPosition, Step, 0, 19);
|
||||
gFM_ChannelPosition = NUMBER_AddWithWraparound(gFM_ChannelPosition, Step, 0, 19);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -515,10 +515,9 @@ static void Key_UP_DOWN(uint8_t state, int8_t Step)
|
||||
if (Channel == 0xFF || gEeprom.FM_SelectedChannel == Channel)
|
||||
goto Bail;
|
||||
|
||||
gEeprom.FM_SelectedChannel = Channel;
|
||||
gEeprom.FM_SelectedChannel = Channel;
|
||||
gEeprom.FM_FrequencyPlaying = gFM_Channels[Channel];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uint16_t Frequency = gEeprom.FM_SelectedFrequency + Step;
|
||||
|
||||
if (Frequency < BK1080_GetFreqLoLimit(gEeprom.FM_Band))
|
||||
@@ -526,20 +525,19 @@ static void Key_UP_DOWN(uint8_t state, int8_t Step)
|
||||
else if (Frequency > BK1080_GetFreqHiLimit(gEeprom.FM_Band))
|
||||
Frequency = BK1080_GetFreqLoLimit(gEeprom.FM_Band);
|
||||
|
||||
gEeprom.FM_FrequencyPlaying = Frequency;
|
||||
gEeprom.FM_FrequencyPlaying = Frequency;
|
||||
gEeprom.FM_SelectedFrequency = gEeprom.FM_FrequencyPlaying;
|
||||
}
|
||||
|
||||
gRequestSaveFM = true;
|
||||
|
||||
Bail:
|
||||
Bail:
|
||||
BK1080_SetFrequency(gEeprom.FM_FrequencyPlaying, gEeprom.FM_Band/*, gEeprom.FM_Space*/);
|
||||
|
||||
gRequestDisplayScreen = DISPLAY_FM;
|
||||
}
|
||||
|
||||
void FM_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
void FM_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
|
||||
uint8_t state = bKeyPressed + 2 * bKeyHeld;
|
||||
|
||||
switch (Key) {
|
||||
@@ -572,14 +570,14 @@ void FM_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
break;
|
||||
}
|
||||
GUI_DisplayScreen();
|
||||
}
|
||||
|
||||
void FM_Play(void)
|
||||
{
|
||||
void FM_Play(void) {
|
||||
if (!FM_CheckFrequencyLock(gEeprom.FM_FrequencyPlaying, BK1080_GetFreqLoLimit(gEeprom.FM_Band))) {
|
||||
if (!gFM_AutoScan) {
|
||||
gFmPlayCountdown_10ms = 0;
|
||||
gFM_FoundFrequency = true;
|
||||
gFM_FoundFrequency = true;
|
||||
|
||||
if (!gEeprom.FM_IsMrMode)
|
||||
gEeprom.FM_SelectedFrequency = gEeprom.FM_FrequencyPlaying;
|
||||
@@ -609,24 +607,23 @@ void FM_Play(void)
|
||||
GUI_SelectNextDisplay(DISPLAY_FM);
|
||||
}
|
||||
|
||||
void FM_Start(void)
|
||||
{
|
||||
gDualWatchActive = false;
|
||||
gFmRadioMode = true;
|
||||
gFM_ScanState = FM_SCAN_OFF;
|
||||
void FM_Start(void) {
|
||||
gDualWatchActive = false;
|
||||
gFmRadioMode = true;
|
||||
gFM_ScanState = FM_SCAN_OFF;
|
||||
gFM_RestoreCountdown_10ms = 0;
|
||||
|
||||
BK1080_Init(gEeprom.FM_FrequencyPlaying, gEeprom.FM_Band/*, gEeprom.FM_Space*/);
|
||||
|
||||
AUDIO_AudioPathOn();
|
||||
|
||||
gEnableSpeaker = true;
|
||||
gUpdateStatus = true;
|
||||
gEnableSpeaker = true;
|
||||
gUpdateStatus = true;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
gEeprom.CURRENT_STATE = 3;
|
||||
SETTINGS_WriteCurrentState();
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
gEeprom.CURRENT_STATE = 3;
|
||||
SETTINGS_WriteCurrentState();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
427
app/fskmodem.c
Normal file
427
app/fskmodem.c
Normal file
@@ -0,0 +1,427 @@
|
||||
//
|
||||
// Created by bruno on 25.2.2025.
|
||||
//
|
||||
|
||||
#include "fskmodem.h"
|
||||
//#include "messages.h"
|
||||
#include "driver/uart.h"
|
||||
#include "../ui/messages.h"
|
||||
|
||||
uint16_t TONE2_FREQ;
|
||||
|
||||
DataPacket dataPacket;
|
||||
|
||||
DataPacket inBoundPacket;
|
||||
|
||||
uint8_t *dataPTR = dataPacket.data;
|
||||
|
||||
SMSEnteringState gEnteringSMS = SMS_NOT_ENTERING;
|
||||
|
||||
SMSResponseState gSMSResponseState = SMS_RESPONSE_IDLE;
|
||||
|
||||
bool gGotACK = false;
|
||||
|
||||
uint8_t SMSResponseCounter = 0;
|
||||
|
||||
typedef enum {
|
||||
Receiving,
|
||||
Ready
|
||||
} RXState;
|
||||
|
||||
RXState rxState = Ready;
|
||||
|
||||
uint8_t SMSResponseCounterTarget = 6;
|
||||
|
||||
void FSKModem_TimeSlice500ms(void) {
|
||||
if (SMSResponseCounter && FUNCTION_IsRx() && SMSResponseCounter++ > SMSResponseCounterTarget) {
|
||||
switch (gSMSResponseState) {
|
||||
case SMS_RESPONSE_ACK:
|
||||
MSG_FSKSendData(&inBoundPacket);
|
||||
gSMSResponseState = SMS_RESPONSE_IDLE;
|
||||
SMSResponseCounter = 0;
|
||||
break;
|
||||
case SMS_RESPONSE_RETRANSMIT:
|
||||
MSG_FSKSendData(&inBoundPacket);
|
||||
gSMSResponseState = SMS_RESPONSE_IDLE;
|
||||
SMSResponseCounter = 0;
|
||||
break;
|
||||
case SMS_RESPONSE_RESEND:
|
||||
MSG_FSKSendData(&dataPacket);
|
||||
gSMSResponseState = SMS_RESPONSE_IDLE;
|
||||
SMSResponseCounter = 0;
|
||||
break;
|
||||
case SMS_RESPONSE_ACK_LIGHT:
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, false);
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2_GREEN, false);
|
||||
gSMSResponseState = SMS_RESPONSE_IDLE;
|
||||
SMSResponseCounter = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MSG_ConfigureFSK(bool rx) {
|
||||
BK4819_WriteRegister(BK4819_REG_70, TONE2_ENABLE_BIT | (96U << 0));
|
||||
|
||||
switch (gEeprom.FSKMode) {
|
||||
case MOD_AFSK_2400:
|
||||
TONE2_FREQ = 24779U; // Estimated
|
||||
break;
|
||||
case MOD_AFSK_1200:
|
||||
TONE2_FREQ = 12389U;
|
||||
break;
|
||||
case MOD_FSK_700:
|
||||
TONE2_FREQ = 7227U;
|
||||
break;
|
||||
case MOD_FSK_450:
|
||||
TONE2_FREQ = 4646U;
|
||||
break;
|
||||
case MOD_FSK_1200_2400:
|
||||
TONE2_FREQ = 12389U; // Default to 1200Hz, dynamic switching may be required
|
||||
break;
|
||||
case MOD_NOAA_SAME:
|
||||
TONE2_FREQ = 2083U; // NOAA SAME uses 2083.3 Hz for mark and 1562.5 Hz for space
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_72, TONE2_FREQ);
|
||||
|
||||
// uint16_t fskConfig = FSK_ENABLE_BIT | FSK_RX_BW_1_2K | FSK_RX_GAIN_DEFAULT | FSK_PREAMBLE_TYPE_AA;
|
||||
// if (gEeprom.FSKMode == MOD_AFSK_1200) {
|
||||
// fskConfig = FSK_ENABLE_BIT | FSK_TX_MODE_FSK_1_2K_2_4K | FSK_RX_MODE_FSK_1_2K_2_4K_NOAA;
|
||||
// }
|
||||
|
||||
uint16_t fskConfig = FSK_ENABLE_BIT | FSK_PREAMBLE_TYPE_AA;
|
||||
|
||||
switch (gEeprom.FSKMode) {
|
||||
case MOD_FSK_700:
|
||||
case MOD_FSK_450:
|
||||
case MOD_FSK_1200_2400:
|
||||
fskConfig |= FSK_TX_MODE_FSK_1_2K_2_4K | FSK_RX_MODE_FSK_1_2K_2_4K_NOAA | FSK_RX_BW_1_2K;
|
||||
break;
|
||||
case MOD_AFSK_1200:
|
||||
fskConfig |= FSK_TX_MODE_FFSK_1200_1800 | FSK_RX_MODE_FFSK_1200_1800 | FSK_RX_BW_FFSK_1200_1800;
|
||||
break;
|
||||
case MOD_AFSK_2400:
|
||||
fskConfig |= FSK_TX_MODE_FFSK_1200_2400 | FSK_RX_MODE_FFSK_1200_2400 | FSK_RX_BW_2_4K_FFSK_1200_2400;
|
||||
break;
|
||||
case MOD_NOAA_SAME:
|
||||
fskConfig |= FSK_TX_MODE_NOAA_SAME | FSK_RX_MODE_FSK_1_2K_2_4K_NOAA | FSK_RX_BW_NOAA_SAME;
|
||||
break;
|
||||
default:
|
||||
// Unsupported mode; keep previous setting
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_58, fskConfig);
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_5A, FSK_SYNC_BYTE0 << 8 | FSK_SYNC_BYTE1);
|
||||
BK4819_WriteRegister(BK4819_REG_5B, FSK_SYNC_BYTE2 << 8 | FSK_SYNC_BYTE3);
|
||||
BK4819_WriteRegister(BK4819_REG_5C, FSK_CRC_ON);
|
||||
|
||||
if (rx) {
|
||||
BK4819_WriteRegister(BK4819_REG_5E, (64U << 3) | (1U << 0));
|
||||
}
|
||||
|
||||
size_t size = sizeof(dataPacket);
|
||||
if (rx) {
|
||||
size = (((size + 1) / 2) * 2) + 2;
|
||||
}
|
||||
BK4819_WriteRegister(BK4819_REG_5D, (size << 8));
|
||||
|
||||
BK4819_FskClearFifo();
|
||||
|
||||
uint16_t fskParams = FSK_SYNC_LEN_BIT | ((rx ? 0U : 15U) << 4);
|
||||
if (gCurrentVfo->SCRAMBLING_TYPE > 0) {
|
||||
fskParams |= FSK_SCRAMBLE_ENABLE;
|
||||
}
|
||||
BK4819_WriteRegister(BK4819_REG_59, fskParams);
|
||||
BK4819_WriteRegister(BK4819_REG_02, 0);
|
||||
}
|
||||
|
||||
|
||||
uint16_t calculateCRC(uint8_t *data, size_t length) {
|
||||
uint16_t crc = 0xFFFF; // Example CRC-16 initialization
|
||||
for (size_t i = 0; i < length; i++) {
|
||||
crc ^= data[i];
|
||||
for (uint8_t j = 0; j < 8; j++) {
|
||||
if (crc & 1) {
|
||||
crc = (crc >> 1) ^ 0xA001; // Example polynomial (CRC-16-IBM)
|
||||
} else {
|
||||
crc >>= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
|
||||
|
||||
void processReceivedPacket(DataPacket *packet) {
|
||||
char String[18];
|
||||
char numBuf[11]; // Enough for any 64-bit unsigned integer
|
||||
const unsigned int vfo = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO
|
||||
: gEeprom.TX_VFO;
|
||||
|
||||
UART_Send(packet, sizeof(DataPacket));
|
||||
if (packet->dest == gEeprom.FSKSRCAddress) {
|
||||
if ((packet->flags & 0x80)) {
|
||||
if (packet->flags & 0x40) {
|
||||
uint16_t crcSent = calculateCRC(dataPacket.data, 20);
|
||||
uint16_t crcGot = inBoundPacket.data[0] | (inBoundPacket.data[1] << 8);
|
||||
if (crcSent == crcGot) {
|
||||
gGotACK = true;
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, true);
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2_GREEN, true);
|
||||
SMSResponseCounter = 1;
|
||||
gSMSResponseState = SMS_RESPONSE_ACK_LIGHT;
|
||||
} else {
|
||||
if (--dataPacket.ttl) {
|
||||
gSMSResponseState = SMS_RESPONSE_RESEND;
|
||||
SMSResponseCounter = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP);
|
||||
BK4819_PlaySingleTone(1000, 250, 127, true);
|
||||
strcpy(String, "SMS by ");
|
||||
itoa(packet->src, numBuf); // Convert number to string
|
||||
strcat(String, numBuf);
|
||||
MESSAGES_SAVE();
|
||||
UI_DisplayPopup(String);
|
||||
inBoundPacket.flags |= 0x40;
|
||||
inBoundPacket.dest = inBoundPacket.src;
|
||||
inBoundPacket.src = gEeprom.FSKSRCAddress;
|
||||
uint16_t crcTest = calculateCRC(inBoundPacket.data, 20);
|
||||
memset(inBoundPacket.data, 0, DataPacketDataSize);
|
||||
inBoundPacket.data[0] = crcTest & 0xFF;
|
||||
inBoundPacket.data[1] = (crcTest >> 8) & 0xFF;
|
||||
gSMSResponseState = SMS_RESPONSE_ACK;
|
||||
SMSResponseCounter = 1;
|
||||
UI_PrintStringSmallNormal(String, 2, 0, 4);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (VfoState[vfo] == VFO_STATE_NORMAL && !TX_freq_check(gCurrentVfo->freq_config_TX.Frequency)) {
|
||||
if (packet->ttl--) {
|
||||
SMSResponseCounter = 1;
|
||||
gSMSResponseState = SMS_RESPONSE_RETRANSMIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MSG_EnableRX(const bool enable) {
|
||||
|
||||
if (enable) {
|
||||
MSG_ConfigureFSK(true);
|
||||
|
||||
//if(gEeprom.MESSENGER_CONFIG.data.receive)
|
||||
BK4819_FskEnableRx();
|
||||
} else {
|
||||
BK4819_WriteRegister(BK4819_REG_70, 0);
|
||||
BK4819_WriteRegister(BK4819_REG_58, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void MSG_FSKSendData(DataPacket *dataPacketIn) {
|
||||
const unsigned int vfo = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO
|
||||
: gEeprom.TX_VFO;
|
||||
if (VfoState[vfo] == VFO_STATE_NORMAL &&
|
||||
!TX_freq_check(gCurrentVfo->freq_config_TX.Frequency)) {
|
||||
|
||||
RADIO_PrepareTX();
|
||||
BK4819_SetScramble(gCurrentVfo->SCRAMBLING_TYPE);
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, true);
|
||||
|
||||
bool isAudioOn = gEnableSpeaker;
|
||||
if (gEnableSpeaker) {
|
||||
AUDIO_AudioPathOff();
|
||||
BK4819_EnterTxMute();
|
||||
gEnableSpeaker = false;
|
||||
}
|
||||
// turn off CTCSS/CDCSS during FFSK
|
||||
const uint16_t css_val = BK4819_ReadRegister(BK4819_REG_51);
|
||||
BK4819_WriteRegister(BK4819_REG_51, 0);
|
||||
|
||||
// set the FM deviation level
|
||||
const uint16_t dev_val = BK4819_ReadRegister(BK4819_REG_40);
|
||||
|
||||
{
|
||||
uint16_t deviation;
|
||||
switch (gEeprom.VfoInfo[gEeprom.TX_VFO].CHANNEL_BANDWIDTH) {
|
||||
case BK4819_FILTER_BW_WIDE:
|
||||
deviation = 1300;
|
||||
break; // 20k // measurements by kamilsss655
|
||||
case BK4819_FILTER_BW_NARROW:
|
||||
deviation = 1200;
|
||||
break; // 10k
|
||||
// case BK4819_FILTER_BW_NARROWAVIATION: deviation = 850; break; // 5k
|
||||
// case BK4819_FILTER_BW_NARROWER: deviation = 850; break; // 5k
|
||||
// case BK4819_FILTER_BW_NARROWEST: deviation = 850; break; // 5k
|
||||
default:
|
||||
deviation = 850;
|
||||
break; // 5k
|
||||
}
|
||||
|
||||
//BK4819_WriteRegister(0x40, (3u << 12) | (deviation & 0xfff));
|
||||
BK4819_WriteRegister(BK4819_REG_40, (dev_val & 0xf000) | (deviation & 0xfff));
|
||||
}
|
||||
|
||||
// REG_2B 0
|
||||
//
|
||||
// <15> 1 Enable CTCSS/CDCSS DC cancellation after FM Demodulation 1 = enable 0 = disable
|
||||
// <14> 1 Enable AF DC cancellation after FM Demodulation 1 = enable 0 = disable
|
||||
// <10> 0 AF RX HPF 300Hz filter 0 = enable 1 = disable
|
||||
// <9> 0 AF RX LPF 3kHz filter 0 = enable 1 = disable
|
||||
// <8> 0 AF RX de-emphasis filter 0 = enable 1 = disable
|
||||
// <2> 0 AF TX HPF 300Hz filter 0 = enable 1 = disable
|
||||
// <1> 0 AF TX LPF filter 0 = enable 1 = disable
|
||||
// <0> 0 AF TX pre-emphasis filter 0 = enable 1 = disable
|
||||
//
|
||||
// disable the 300Hz HPF and FM pre-emphasis filter
|
||||
//
|
||||
const uint16_t filt_val = BK4819_ReadRegister(BK4819_REG_2B);
|
||||
BK4819_WriteRegister(BK4819_REG_2B, (1u << 2) | (1u << 0));
|
||||
|
||||
MSG_ConfigureFSK(false);
|
||||
|
||||
|
||||
SYSTEM_DelayMs(100);
|
||||
|
||||
{ // load the entire packet data into the TX FIFO buffer
|
||||
uint16_t *ptr = (uint16_t *) dataPacketIn;
|
||||
size_t wordCount = sizeof(*dataPacketIn) / sizeof(uint16_t);
|
||||
|
||||
for (size_t i = 0; i < wordCount; i++) {
|
||||
BK4819_WriteRegister(BK4819_REG_5F, ptr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// enable FSK TX
|
||||
BK4819_FskEnableTx();
|
||||
|
||||
{
|
||||
// allow up to 310ms for the TX to complete
|
||||
// if it takes any longer then somethings gone wrong, we shut the TX down
|
||||
unsigned int timeout = 1000 / 5;
|
||||
|
||||
while (timeout-- > 0) {
|
||||
SYSTEM_DelayMs(5);
|
||||
if (BK4819_ReadRegister(BK4819_REG_0C) & (1u << 0)) { // we have interrupt flags
|
||||
BK4819_WriteRegister(BK4819_REG_02, 0);
|
||||
if (BK4819_ReadRegister(BK4819_REG_02) & BK4819_REG_02_FSK_TX_FINISHED)
|
||||
timeout = 0; // TX is complete
|
||||
}
|
||||
}
|
||||
}
|
||||
//BK4819_WriteRegister(BK4819_REG_02, 0);
|
||||
|
||||
SYSTEM_DelayMs(100);
|
||||
|
||||
// disable TX
|
||||
MSG_ConfigureFSK(true);
|
||||
|
||||
// restore FM deviation level
|
||||
BK4819_WriteRegister(BK4819_REG_40, dev_val);
|
||||
|
||||
// restore TX/RX filtering
|
||||
BK4819_WriteRegister(BK4819_REG_2B, filt_val);
|
||||
|
||||
// restore the CTCSS/CDCSS setting
|
||||
BK4819_WriteRegister(BK4819_REG_51, css_val);
|
||||
|
||||
SYSTEM_DelayMs(50);
|
||||
APP_EndTransmission();
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
gUpdateStatus = true;
|
||||
gUpdateDisplay = true;
|
||||
gFlagEndTransmission = false;
|
||||
|
||||
if (isAudioOn) {
|
||||
AUDIO_AudioPathOn();
|
||||
gEnableSpeaker = true;
|
||||
BK4819_ExitTxMute();
|
||||
}
|
||||
|
||||
if (!(dataPacketIn->flags & 0x64)) {
|
||||
gGotACK = false;
|
||||
}
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, false);
|
||||
MSG_EnableRX(true);
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
dataPTR = dataPacket.data;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void prepareDataPacket() {
|
||||
dataPacket.src = gEeprom.FSKSRCAddress;
|
||||
uint8_t Data[8];
|
||||
EEPROM_ReadBuffer(SEQParameterEEPROM, Data, 8);
|
||||
dataPacket.seq = Data[0];
|
||||
Data[0]++;
|
||||
EEPROM_WriteBuffer(SEQParameterEEPROM, Data);
|
||||
dataPacket.ttl = 20;
|
||||
}
|
||||
|
||||
void FSK_HANDLE_IRQ(unsigned short irq) {
|
||||
//const uint16_t rx_sync_flags = BK4819_ReadRegister(BK4819_REG_0B);
|
||||
|
||||
const bool rx_sync = (irq & BK4819_REG_02_FSK_RX_SYNC) != 0;
|
||||
const bool rx_fifo_almost_full = (irq & BK4819_REG_02_FSK_FIFO_ALMOST_FULL) != 0;
|
||||
const bool rx_finished = (irq & BK4819_REG_02_FSK_RX_FINISHED) != 0;
|
||||
|
||||
//UART_printf("\nMSG : S%i, F%i, E%i | %i", rx_sync, rx_fifo_almost_full, rx_finished, irq);
|
||||
|
||||
if (rx_sync) {
|
||||
// prevent listening to fsk data and squelch (kamilsss655)
|
||||
// CTCSS codes seem to false trigger the rx_sync
|
||||
if (gCurrentCodeType == CODE_TYPE_OFF)
|
||||
AUDIO_AudioPathOff();
|
||||
gFSKWriteIndex = 0;
|
||||
memset(&inBoundPacket, 0, sizeof(DataPacket));
|
||||
rxState = Receiving;
|
||||
}
|
||||
|
||||
if (rx_fifo_almost_full && rxState == Receiving) {
|
||||
const uint16_t count = BK4819_ReadRegister(BK4819_REG_5E) & (7u << 0); // Almost full threshold
|
||||
uint16_t *ptr = (uint16_t *) &inBoundPacket;
|
||||
size_t wordCount = sizeof(inBoundPacket) / sizeof(uint16_t);
|
||||
|
||||
for (uint16_t i = 0; i < count && gFSKWriteIndex < wordCount; i++) {
|
||||
ptr[gFSKWriteIndex++] = BK4819_ReadRegister(BK4819_REG_5F);
|
||||
UART_Send((const void *) &ptr[gFSKWriteIndex - 1], 2);
|
||||
}
|
||||
|
||||
SYSTEM_DelayMs(10);
|
||||
}
|
||||
|
||||
if (rx_finished) {
|
||||
// Turn off green LED
|
||||
BK4819_FskClearFifo();
|
||||
|
||||
rxState = Ready;
|
||||
|
||||
if (gFSKWriteIndex > 2) {
|
||||
// Validate checksum (assuming last 2 bytes are CRC-16)
|
||||
//size_t dataLength = sizeof(inBoundPacket.data) - 2;
|
||||
//uint16_t receivedCRC = (inBoundPacket.data[dataLength] << 8) | inBoundPacket.data[dataLength + 1];
|
||||
//uint16_t calculatedCRC = calculateCRC(inBoundPacket.data, dataLength);
|
||||
|
||||
//if (receivedCRC == calculatedCRC) {
|
||||
processReceivedPacket(&inBoundPacket);
|
||||
//}
|
||||
}
|
||||
|
||||
APP_EndTransmission();
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
gUpdateStatus = true;
|
||||
gUpdateDisplay = true;
|
||||
gFlagEndTransmission = false;
|
||||
|
||||
gFSKWriteIndex = 0;
|
||||
}
|
||||
}
|
135
app/fskmodem.h
Normal file
135
app/fskmodem.h
Normal file
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// Created by bruno on 25.2.2025.
|
||||
//
|
||||
|
||||
#ifndef UV_K5_FIRMWARE_CUSTOM_FSKMODEM_H
|
||||
#define UV_K5_FIRMWARE_CUSTOM_FSKMODEM_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "../driver/bk4819.h"
|
||||
#include "../driver/bk4819-regs.h"
|
||||
#include "../settings.h"
|
||||
#include "stddef.h"
|
||||
#include "../driver/system.h"
|
||||
#include "../misc.h"
|
||||
#include "../app/app.h"
|
||||
#include <string.h>
|
||||
#include "../audio.h"
|
||||
#include <stdio.h>
|
||||
#include "../ui/helper.h"
|
||||
#include "../ui/main.h"
|
||||
|
||||
// REG_70 bit definitions
|
||||
#define TONE1_ENABLE_BIT (1U << 15)
|
||||
#define TONE1_GAIN_MASK (0x7FU << 8)
|
||||
#define TONE2_ENABLE_BIT (1U << 7)
|
||||
#define TONE2_GAIN_MASK (0x7FU << 0)
|
||||
|
||||
// REG_58 bit definitions
|
||||
// FSK Tx Mode Selection (REG_58<15:13>)
|
||||
#define FSK_TX_MODE_FSK_1_2K_2_4K (0U << 13) // 000
|
||||
#define FSK_TX_MODE_FFSK_1200_1800 (1U << 13) // 001
|
||||
#define FSK_TX_MODE_FFSK_1200_2400 (3U << 13) // 011
|
||||
#define FSK_TX_MODE_NOAA_SAME (5U << 13) // 101
|
||||
|
||||
// FSK Rx Mode Selection (REG_58<12:10>)
|
||||
#define FSK_RX_MODE_FSK_1_2K_2_4K_NOAA (0U << 10) // 000
|
||||
#define FSK_RX_MODE_FFSK_1200_1800 (7U << 10) // 111
|
||||
#define FSK_RX_MODE_FFSK_1200_2400 (4U << 10) // 100
|
||||
|
||||
// FSK Rx Gain (REG_58<9:8>)
|
||||
#define FSK_RX_GAIN_DEFAULT (0U << 8) // 00
|
||||
#define FSK_RX_GAIN_TYPE_C (1U << 8) // 01
|
||||
#define FSK_RX_GAIN_TYPE_B (2U << 8) // 10
|
||||
#define FSK_UNKNOWN_MASK (3U << 6)
|
||||
// FSK Preamble Type Selection (REG_58<5:4>)
|
||||
#define FSK_PREAMBLE_TYPE_AA (3U << 4) // 11
|
||||
#define FSK_PREAMBLE_TYPE_55 (2U << 4) // 10
|
||||
#define FSK_PREAMBLE_TYPE_UNKNOWN (0U << 4) // 00
|
||||
// FSK Rx Bandwidth Setting (REG_58<3:1>)
|
||||
#define FSK_RX_BW_2_4K_FFSK_1200_2400 (4U << 1) // 100
|
||||
#define FSK_RX_BW_1_2K (0U << 1) // 000
|
||||
#define FSK_RX_BW_FFSK_1200_1800 (1U << 1) // 001
|
||||
#define FSK_RX_BW_NOAA_SAME (2U << 1) // 010
|
||||
#define FSK_ENABLE_BIT (1U << 0)
|
||||
|
||||
// REG_59 bit definitions
|
||||
#define FSK_CLEAR_TX_FIFO (1U << 15)
|
||||
#define FSK_CLEAR_RX_FIFO (1U << 14)
|
||||
#define FSK_SCRAMBLE_ENABLE (1U << 13)
|
||||
#define FSK_RX_ENABLE (1U << 12)
|
||||
#define FSK_TX_ENABLE (1U << 11)
|
||||
#define FSK_INVERT_RX (1U << 10)
|
||||
#define FSK_INVERT_TX (1U << 9)
|
||||
#define FSK_PREAMBLE_LEN_MASK (15U << 4)
|
||||
#define FSK_SYNC_LEN_BIT (1U << 3)
|
||||
|
||||
//#define FSK_SYNC_BYTE0 0x30
|
||||
//#define FSK_SYNC_BYTE1 0x72
|
||||
//#define FSK_SYNC_BYTE2 0x57
|
||||
//#define FSK_SYNC_BYTE3 0x6c
|
||||
|
||||
#define FSK_SYNC_BYTE0 0x42
|
||||
#define FSK_SYNC_BYTE1 0x52
|
||||
#define FSK_SYNC_BYTE2 0x4E
|
||||
#define FSK_SYNC_BYTE3 0x51
|
||||
|
||||
#define FSK_CRC_ON (1U << 6)
|
||||
#define FSK_CRC_OFF (0U << 6)
|
||||
|
||||
#define DataPacketDataSize (21)
|
||||
|
||||
#define SEQParameterEEPROM 0x1BD0
|
||||
|
||||
typedef struct {
|
||||
uint32_t dest; //4bytes
|
||||
uint32_t src; //4bytes
|
||||
uint8_t seq; //1bytes
|
||||
uint8_t ttl; //1bytes
|
||||
uint8_t flags; //1bytes
|
||||
uint8_t data[DataPacketDataSize];
|
||||
} DataPacket;
|
||||
|
||||
void prepareDataPacket();
|
||||
|
||||
void MSG_FSKSendData(DataPacket *dataPacketIn);
|
||||
|
||||
void MSG_EnableRX(bool enable);
|
||||
|
||||
void processReceivedPacket(DataPacket *packet);
|
||||
|
||||
uint16_t calculateCRC(uint8_t *data, size_t length);
|
||||
|
||||
extern DataPacket dataPacket;
|
||||
|
||||
extern DataPacket inBoundPacket;
|
||||
|
||||
typedef enum {
|
||||
SMS_NOT_ENTERING = 0,
|
||||
SMS_ENTERING_DEST,
|
||||
SMS_ENTERING_MESSAGE
|
||||
} SMSEnteringState;
|
||||
|
||||
typedef enum {
|
||||
SMS_RESPONSE_IDLE,
|
||||
SMS_RESPONSE_ACK,
|
||||
SMS_RESPONSE_ACK_LIGHT,
|
||||
SMS_RESPONSE_RETRANSMIT,
|
||||
SMS_RESPONSE_RESEND
|
||||
} SMSResponseState;
|
||||
|
||||
extern SMSEnteringState gEnteringSMS;
|
||||
extern SMSResponseState gSMSResponseState;
|
||||
|
||||
extern uint8_t *dataPTR;
|
||||
|
||||
extern bool gGotACK;
|
||||
|
||||
extern uint8_t SMSResponseCounter;
|
||||
|
||||
void FSK_HANDLE_IRQ(unsigned short irq);
|
||||
|
||||
void FSKModem_TimeSlice500ms(void);
|
||||
|
||||
#endif //UV_K5_FIRMWARE_CUSTOM_FSKMODEM_H
|
434
app/main.c
434
app/main.c
@@ -20,15 +20,21 @@
|
||||
#include "app/app.h"
|
||||
#include "app/chFrScanner.h"
|
||||
#include "app/common.h"
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
#include "app/fm.h"
|
||||
|
||||
#include "app/fm.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "app/generic.h"
|
||||
#include "app/main.h"
|
||||
#include "app/scanner.h"
|
||||
|
||||
#ifdef ENABLE_SPECTRUM
|
||||
|
||||
#include "app/spectrum.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "audio.h"
|
||||
@@ -43,32 +49,31 @@
|
||||
#include "ui/ui.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
static void toggle_chan_scanlist(void)
|
||||
{ // toggle the selected channels scanlist setting
|
||||
static void toggle_chan_scanlist(void) { // toggle the selected channels scanlist setting
|
||||
|
||||
if (SCANNER_IsScanning())
|
||||
return;
|
||||
|
||||
if(!IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
|
||||
if (!IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
|
||||
#ifdef ENABLE_SCAN_RANGES
|
||||
gScanRangeStart = gScanRangeStart ? 0 : gTxVfo->pRX->Frequency;
|
||||
gScanRangeStop = gEeprom.VfoInfo[!gEeprom.TX_VFO].freq_config_RX.Frequency;
|
||||
if(gScanRangeStart > gScanRangeStop)
|
||||
if (gScanRangeStart > gScanRangeStop)
|
||||
SWAP(gScanRangeStart, gScanRangeStop);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Remove exclude
|
||||
if(gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] == true)
|
||||
{
|
||||
if (gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] == true) {
|
||||
gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] = false;
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t scanTmp = gTxVfo->SCANLIST1_PARTICIPATION | (gTxVfo->SCANLIST2_PARTICIPATION << 1) | (gTxVfo->SCANLIST3_PARTICIPATION << 2);
|
||||
uint8_t scanTmp = gTxVfo->SCANLIST1_PARTICIPATION | (gTxVfo->SCANLIST2_PARTICIPATION << 1) |
|
||||
(gTxVfo->SCANLIST3_PARTICIPATION << 2);
|
||||
|
||||
scanTmp = (scanTmp++ < 7) ? scanTmp: 0;
|
||||
scanTmp = (scanTmp++ < 7) ? scanTmp : 0;
|
||||
|
||||
gTxVfo->SCANLIST1_PARTICIPATION = (scanTmp >> 0) & 0x01;
|
||||
gTxVfo->SCANLIST2_PARTICIPATION = (scanTmp >> 1) & 0x01;
|
||||
@@ -77,11 +82,10 @@ static void toggle_chan_scanlist(void)
|
||||
SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true, true);
|
||||
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gFlagResetVfos = true;
|
||||
gFlagResetVfos = true;
|
||||
}
|
||||
|
||||
static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
{
|
||||
static void processFKeyFunction(const KEY_Code_t Key, const bool beep) {
|
||||
uint8_t Vfo = gEeprom.TX_VFO;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
@@ -101,21 +105,21 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
switch (Key) {
|
||||
case KEY_0:
|
||||
#ifdef ENABLE_FMRADIO
|
||||
ACTION_FM();
|
||||
#endif
|
||||
#ifdef ENABLE_FMRADIO
|
||||
ACTION_FM();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case KEY_1:
|
||||
if (!IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
|
||||
gWasFKeyPressed = false;
|
||||
gUpdateStatus = true;
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
gUpdateStatus = true;
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
#ifdef ENABLE_COPY_CHAN_TO_VFO
|
||||
if (!gEeprom.VFO_OPEN || gCssBackgroundScan) {
|
||||
@@ -125,17 +129,15 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
|
||||
if (gScanStateDir != SCAN_OFF) {
|
||||
if (gCurrentFunction != FUNCTION_INCOMING ||
|
||||
gRxReceptionMode == RX_MODE_NONE ||
|
||||
gScanPauseDelayIn_10ms == 0)
|
||||
{ // scan is running (not paused)
|
||||
gRxReceptionMode == RX_MODE_NONE ||
|
||||
gScanPauseDelayIn_10ms == 0) { // scan is running (not paused)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const uint8_t vfo = gEeprom.TX_VFO;
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo]))
|
||||
{ // copy channel to VFO, then swap to the VFO
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo])) { // copy channel to VFO, then swap to the VFO
|
||||
|
||||
gEeprom.ScreenChannel[vfo] = FREQ_CHANNEL_FIRST + gEeprom.VfoInfo[vfo].Band;
|
||||
gEeprom.VfoInfo[vfo].CHANNEL_SAVE = gEeprom.ScreenChannel[vfo];
|
||||
@@ -156,28 +158,28 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WIDE_RX
|
||||
if(gTxVfo->Band == BAND7_470MHz && gTxVfo->pRX->Frequency < _1GHz_in_KHz) {
|
||||
gTxVfo->pRX->Frequency = _1GHz_in_KHz;
|
||||
return;
|
||||
if (gTxVfo->Band == BAND7_470MHz && gTxVfo->pRX->Frequency < _1GHz_in_KHz) {
|
||||
gTxVfo->pRX->Frequency = _1GHz_in_KHz;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
gTxVfo->Band += 1;
|
||||
|
||||
if (gTxVfo->Band == BAND5_350MHz && !gSetting_350EN) {
|
||||
if (gTxVfo->Band == BAND5_350MHz) {
|
||||
// skip if not enabled
|
||||
gTxVfo->Band += 1;
|
||||
} else if (gTxVfo->Band >= BAND_N_ELEM){
|
||||
} else if (gTxVfo->Band >= BAND_N_ELEM) {
|
||||
// go arround if overflowed
|
||||
gTxVfo->Band = BAND1_50MHz;
|
||||
}
|
||||
|
||||
gEeprom.ScreenChannel[Vfo] = FREQ_CHANNEL_FIRST + gTxVfo->Band;
|
||||
gEeprom.FreqChannel[Vfo] = FREQ_CHANNEL_FIRST + gTxVfo->Band;
|
||||
gEeprom.FreqChannel[Vfo] = FREQ_CHANNEL_FIRST + gTxVfo->Band;
|
||||
|
||||
gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
|
||||
if (beep)
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
@@ -185,18 +187,18 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
break;
|
||||
|
||||
case KEY_2:
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
#endif
|
||||
COMMON_SwitchVFOs();
|
||||
if (beep)
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
break;
|
||||
|
||||
case KEY_3:
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
#endif
|
||||
COMMON_SwitchVFOMode();
|
||||
if (beep)
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
@@ -204,11 +206,11 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
break;
|
||||
|
||||
case KEY_4:
|
||||
gWasFKeyPressed = false;
|
||||
gWasFKeyPressed = false;
|
||||
|
||||
gBackup_CROSS_BAND_RX_TX = gEeprom.CROSS_BAND_RX_TX;
|
||||
gBackup_CROSS_BAND_RX_TX = gEeprom.CROSS_BAND_RX_TX;
|
||||
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
|
||||
gUpdateStatus = true;
|
||||
gUpdateStatus = true;
|
||||
if (beep)
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
@@ -217,7 +219,7 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
break;
|
||||
|
||||
case KEY_5:
|
||||
if(beep) {
|
||||
if (beep) {
|
||||
#ifdef ENABLE_NOAA
|
||||
if (!IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
|
||||
gEeprom.ScreenChannel[Vfo] = gEeprom.NoaaChannel[gEeprom.TX_VFO];
|
||||
@@ -234,8 +236,7 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
APP_RunSpectrum();
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
toggle_chan_scanlist();
|
||||
}
|
||||
|
||||
@@ -254,21 +255,21 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
break;
|
||||
|
||||
case KEY_8:
|
||||
gTxVfo->FrequencyReverse = gTxVfo->FrequencyReverse == false;
|
||||
gTxVfo->FrequencyReverse = !gTxVfo->FrequencyReverse;
|
||||
gRequestSaveChannel = 1;
|
||||
break;
|
||||
|
||||
case KEY_9:
|
||||
if (RADIO_CheckValidChannel(gEeprom.CHAN_1_CALL, false, 0)) {
|
||||
gEeprom.MrChannel[Vfo] = gEeprom.CHAN_1_CALL;
|
||||
gEeprom.MrChannel[Vfo] = gEeprom.CHAN_1_CALL;
|
||||
gEeprom.ScreenChannel[Vfo] = gEeprom.CHAN_1_CALL;
|
||||
#ifdef ENABLE_VOICE
|
||||
AUDIO_SetVoiceID(0, VOICE_ID_CHANNEL_MODE);
|
||||
AUDIO_SetDigitVoice(1, gEeprom.CHAN_1_CALL + 1);
|
||||
gAnotherVoiceID = (VOICE_ID_t)0xFE;
|
||||
#endif
|
||||
gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -278,46 +279,42 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN // Set Squelch F + UP or Down and Step F + SIDE1 or F + SIDE2
|
||||
case KEY_UP:
|
||||
gEeprom.SQUELCH_LEVEL = (gEeprom.SQUELCH_LEVEL < 9) ? gEeprom.SQUELCH_LEVEL + 1: 9;
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gEeprom.SQUELCH_LEVEL = (gEeprom.SQUELCH_LEVEL < 9) ? gEeprom.SQUELCH_LEVEL + 1 : 9;
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gWasFKeyPressed = false;
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
gEeprom.SQUELCH_LEVEL = (gEeprom.SQUELCH_LEVEL > 0) ? gEeprom.SQUELCH_LEVEL - 1: 0;
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gEeprom.SQUELCH_LEVEL = (gEeprom.SQUELCH_LEVEL > 0) ? gEeprom.SQUELCH_LEVEL - 1 : 0;
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gWasFKeyPressed = false;
|
||||
break;
|
||||
|
||||
case KEY_SIDE1:
|
||||
uint8_t a = FREQUENCY_GetSortedIdxFromStepIdx(gTxVfo->STEP_SETTING);
|
||||
if (a < STEP_N_ELEM - 1)
|
||||
{
|
||||
if (a < STEP_N_ELEM - 1) {
|
||||
gTxVfo->STEP_SETTING = FREQUENCY_GetStepIdxFromSortedIdx(a + 1);
|
||||
}
|
||||
if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
{
|
||||
if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
|
||||
gRequestSaveChannel = 1;
|
||||
}
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gWasFKeyPressed = false;
|
||||
break;
|
||||
case KEY_SIDE2:
|
||||
uint8_t b = FREQUENCY_GetSortedIdxFromStepIdx(gTxVfo->STEP_SETTING);
|
||||
if (b > 0)
|
||||
{
|
||||
if (b > 0) {
|
||||
gTxVfo->STEP_SETTING = FREQUENCY_GetStepIdxFromSortedIdx(b - 1);
|
||||
}
|
||||
if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
{
|
||||
if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
|
||||
gRequestSaveChannel = 1;
|
||||
}
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gWasFKeyPressed = false;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
gUpdateStatus = true;
|
||||
gUpdateStatus = true;
|
||||
gWasFKeyPressed = false;
|
||||
|
||||
if (beep)
|
||||
@@ -326,8 +323,7 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
}
|
||||
}
|
||||
|
||||
void channelMove(uint16_t Channel)
|
||||
{
|
||||
void channelMove(uint16_t Channel) {
|
||||
const uint8_t Vfo = gEeprom.TX_VFO;
|
||||
|
||||
if (!RADIO_CheckValidChannel(Channel, false, 0)) {
|
||||
@@ -340,22 +336,20 @@ void channelMove(uint16_t Channel)
|
||||
|
||||
gBeepToPlay = BEEP_NONE;
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
|
||||
gEeprom.MrChannel[Vfo] = (uint8_t)Channel;
|
||||
gEeprom.ScreenChannel[Vfo] = (uint8_t)Channel;
|
||||
//gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
gRemoveOffset = false;
|
||||
gPowerHigh = false;
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
|
||||
gEeprom.MrChannel[Vfo] = (uint8_t) Channel;
|
||||
gEeprom.ScreenChannel[Vfo] = (uint8_t) Channel;
|
||||
//gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
|
||||
gRemoveOffset = false;
|
||||
gPowerHigh = false;
|
||||
|
||||
RADIO_ConfigureChannel(gEeprom.TX_VFO, gVfoConfigureMode);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -392,7 +386,7 @@ void channelMoveSwitch(void) {
|
||||
|
||||
channelMove(Channel - 1);
|
||||
SETTINGS_SaveVfoIndices();
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -400,18 +394,17 @@ void channelMoveSwitch(void) {
|
||||
}
|
||||
}
|
||||
|
||||
static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
|
||||
if (bKeyHeld) { // key held down
|
||||
if (bKeyPressed) {
|
||||
if (gScreenToDisplay == DISPLAY_MAIN) {
|
||||
if (gInputBoxIndex > 0) { // delete any inputted chars
|
||||
gInputBoxIndex = 0;
|
||||
gInputBoxIndex = 0;
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
}
|
||||
|
||||
gWasFKeyPressed = false;
|
||||
gUpdateStatus = true;
|
||||
gUpdateStatus = true;
|
||||
|
||||
processFKeyFunction(Key, false);
|
||||
}
|
||||
@@ -419,21 +412,20 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
return;
|
||||
}
|
||||
|
||||
if (bKeyPressed)
|
||||
{ // key is pressed
|
||||
if (bKeyPressed) { // key is pressed
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL; // beep when key is pressed
|
||||
return; // don't use the key till it's released
|
||||
}
|
||||
|
||||
if (!gWasFKeyPressed) { // F-key wasn't pressed
|
||||
|
||||
if (gScanStateDir != SCAN_OFF){
|
||||
switch(Key) {
|
||||
if (gScanStateDir != SCAN_OFF) {
|
||||
switch (Key) {
|
||||
case KEY_0...KEY_5:
|
||||
gEeprom.SCAN_LIST_DEFAULT = Key;
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
SETTINGS_WriteCurrentState();
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
SETTINGS_WriteCurrentState();
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -453,18 +445,17 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
|
||||
gKeyInputCountdown = (key_input_timeout_500ms / 4); // short time...
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// #ifdef ENABLE_NOAA
|
||||
// if (!IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
// #endif
|
||||
if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
{ // user is entering a frequency
|
||||
if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE)) { // user is entering a frequency
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
@@ -478,8 +469,9 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
gKeyInputCountdown = (gInputBoxIndex == totalDigits) ? (key_input_timeout_500ms / 16) : (key_input_timeout_500ms / 3);
|
||||
|
||||
gKeyInputCountdown = (gInputBoxIndex == totalDigits) ? (key_input_timeout_500ms / 16) : (
|
||||
key_input_timeout_500ms / 3);
|
||||
|
||||
const char *inputStr = INPUTBOX_GetAscii();
|
||||
uint8_t inputLength = gInputBoxIndex;
|
||||
@@ -500,21 +492,19 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
// clamp the frequency entered to some valid value
|
||||
if (Frequency < frequencyBandTable[0].lower) {
|
||||
Frequency = frequencyBandTable[0].lower;
|
||||
}
|
||||
else if (Frequency >= BX4819_band1.upper && Frequency < BX4819_band2.lower) {
|
||||
} else if (Frequency >= BX4819_band1.upper && Frequency < BX4819_band2.lower) {
|
||||
const uint32_t center = (BX4819_band1.upper + BX4819_band2.lower) / 2;
|
||||
Frequency = (Frequency < center) ? BX4819_band1.upper : BX4819_band2.lower;
|
||||
}
|
||||
else if (Frequency > frequencyBandTable[BAND_N_ELEM - 1].upper) {
|
||||
} else if (Frequency > frequencyBandTable[BAND_N_ELEM - 1].upper) {
|
||||
Frequency = frequencyBandTable[BAND_N_ELEM - 1].upper;
|
||||
}
|
||||
|
||||
const FREQUENCY_Band_t band = FREQUENCY_GetBand(Frequency);
|
||||
|
||||
if (gTxVfo->Band != band) {
|
||||
gTxVfo->Band = band;
|
||||
gTxVfo->Band = band;
|
||||
gEeprom.ScreenChannel[Vfo] = band + FREQ_CHANNEL_FIRST;
|
||||
gEeprom.FreqChannel[Vfo] = band + FREQ_CHANNEL_FIRST;
|
||||
gEeprom.FreqChannel[Vfo] = band + FREQ_CHANNEL_FIRST;
|
||||
|
||||
SETTINGS_SaveVfoIndices();
|
||||
|
||||
@@ -523,8 +513,8 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
|
||||
Frequency = FREQUENCY_RoundToStep(Frequency, gTxVfo->StepFrequency);
|
||||
|
||||
if (Frequency >= BX4819_band1.upper && Frequency < BX4819_band2.lower)
|
||||
{ // clamp the frequency to the limit
|
||||
if (Frequency >= BX4819_band1.upper &&
|
||||
Frequency < BX4819_band2.lower) { // clamp the frequency to the limit
|
||||
const uint32_t center = (BX4819_band1.upper + BX4819_band2.lower) / 2;
|
||||
Frequency = (Frequency < center) ? BX4819_band1.upper - gTxVfo->StepFrequency : BX4819_band2.lower;
|
||||
}
|
||||
@@ -535,50 +525,47 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
return;
|
||||
|
||||
}
|
||||
#ifdef ENABLE_NOAA
|
||||
else
|
||||
if (IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
{ // user is entering NOAA channel
|
||||
if (gInputBoxIndex != 2) {
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
return;
|
||||
}
|
||||
|
||||
gInputBoxIndex = 0;
|
||||
|
||||
uint8_t Channel = (gInputBox[0] * 10) + gInputBox[1];
|
||||
if (Channel >= 1 && Channel <= ARRAY_SIZE(NoaaFrequencyTable)) {
|
||||
Channel += NOAA_CHANNEL_FIRST;
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
gEeprom.NoaaChannel[Vfo] = Channel;
|
||||
gEeprom.ScreenChannel[Vfo] = Channel;
|
||||
gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
return;
|
||||
}
|
||||
#ifdef ENABLE_NOAA
|
||||
else
|
||||
if (IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
{ // user is entering NOAA channel
|
||||
if (gInputBoxIndex != 2) {
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
gInputBoxIndex = 0;
|
||||
|
||||
uint8_t Channel = (gInputBox[0] * 10) + gInputBox[1];
|
||||
if (Channel >= 1 && Channel <= ARRAY_SIZE(NoaaFrequencyTable)) {
|
||||
Channel += NOAA_CHANNEL_FIRST;
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
gEeprom.NoaaChannel[Vfo] = Channel;
|
||||
gEeprom.ScreenChannel[Vfo] = Channel;
|
||||
gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
}
|
||||
|
||||
gWasFKeyPressed = false;
|
||||
gUpdateStatus = true;
|
||||
gUpdateStatus = true;
|
||||
|
||||
if(Key == 8)
|
||||
{
|
||||
if (Key == 8) {
|
||||
ACTION_BackLightOnDemand();
|
||||
return;
|
||||
}
|
||||
else if(Key == 9)
|
||||
{
|
||||
} else if (Key == 9) {
|
||||
ACTION_BackLight();
|
||||
return;
|
||||
}
|
||||
@@ -586,8 +573,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
processFKeyFunction(Key, true);
|
||||
}
|
||||
|
||||
static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld) {
|
||||
if (!bKeyHeld && bKeyPressed) { // exit key pressed
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
@@ -615,8 +601,7 @@ static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
||||
if (gInputBoxIndex == 0)
|
||||
gAnotherVoiceID = VOICE_ID_CANCEL;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
gScanKeepResult = false;
|
||||
CHFRSCANNER_Stop();
|
||||
|
||||
@@ -636,36 +621,33 @@ static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
||||
}
|
||||
|
||||
if (bKeyHeld && bKeyPressed) { // exit key held down
|
||||
if (gInputBoxIndex > 0 || gDTMF_InputBox_Index > 0 || gDTMF_InputMode)
|
||||
{ // cancel key input mode (channel/frequency entry)
|
||||
gDTMF_InputMode = false;
|
||||
gDTMF_InputBox_Index = 0;
|
||||
if (gInputBoxIndex > 0 || gDTMF_InputBox_Index > 0 ||
|
||||
gDTMF_InputMode) { // cancel key input mode (channel/frequency entry)
|
||||
gDTMF_InputMode = false;
|
||||
gDTMF_InputBox_Index = 0;
|
||||
memset(gDTMF_String, 0, sizeof(gDTMF_String));
|
||||
gInputBoxIndex = 0;
|
||||
gInputBoxIndex = 0;
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld) {
|
||||
if (bKeyPressed && !bKeyHeld) // menu key pressed
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
if (bKeyHeld) { // menu key held down (long press)
|
||||
if (bKeyPressed) { // long press MENU key
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
// Exclude work with list 1, 2, 3 or all list
|
||||
if(gScanStateDir != SCAN_OFF)
|
||||
{
|
||||
if(FUNCTION_IsRx())
|
||||
{
|
||||
if (gScanStateDir != SCAN_OFF) {
|
||||
if (FUNCTION_IsRx() || gScanPauseDelayIn_10ms > 9) {
|
||||
gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] = true;
|
||||
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
gFlagResetVfos = true;
|
||||
gFlagResetVfos = true;
|
||||
|
||||
lastFoundFrqOrChan = lastFoundFrqOrChanOld;
|
||||
|
||||
@@ -674,18 +656,18 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
gWasFKeyPressed = false;
|
||||
|
||||
if (gScreenToDisplay == DISPLAY_MAIN) {
|
||||
if (gInputBoxIndex > 0) { // delete any inputted chars
|
||||
gInputBoxIndex = 0;
|
||||
gInputBoxIndex = 0;
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
}
|
||||
|
||||
gWasFKeyPressed = false;
|
||||
gUpdateStatus = true;
|
||||
gUpdateStatus = true;
|
||||
|
||||
ACTION_Handle(KEY_MENU, bKeyPressed, bKeyHeld);
|
||||
}
|
||||
@@ -694,9 +676,14 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
|
||||
return;
|
||||
}
|
||||
|
||||
if (gWasFKeyPressed && bKeyPressed) {
|
||||
gRequestDisplayScreen = DISPLAY_MESSAGES;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!bKeyPressed && !gDTMF_InputMode) { // menu key released
|
||||
const bool bFlag = !gInputBoxIndex;
|
||||
gInputBoxIndex = 0;
|
||||
gInputBoxIndex = 0;
|
||||
|
||||
if (bFlag) {
|
||||
if (gScanStateDir != SCAN_OFF) {
|
||||
@@ -704,28 +691,26 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
if(gEeprom.MENU_LOCK == false) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
gFlagRefreshSetting = true;
|
||||
gRequestDisplayScreen = DISPLAY_MENU;
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = VOICE_ID_MENU;
|
||||
#endif
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = VOICE_ID_MENU;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
} else {
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld) {
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
if(gEeprom.MENU_LOCK == true) {
|
||||
@@ -735,16 +720,16 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
|
||||
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
||||
return;
|
||||
|
||||
|
||||
if (gInputBoxIndex) {
|
||||
if (!bKeyHeld && bKeyPressed)
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (bKeyHeld && !gWasFKeyPressed){ // long press
|
||||
if (bKeyHeld && !gWasFKeyPressed) { // long press
|
||||
if (!bKeyPressed) // released
|
||||
return;
|
||||
return;
|
||||
|
||||
/*
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
@@ -768,61 +753,55 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
|
||||
if (bKeyPressed) { // just pressed
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// just released
|
||||
|
||||
|
||||
if (!gWasFKeyPressed) // pressed without the F-key
|
||||
{
|
||||
if (gScanStateDir == SCAN_OFF
|
||||
#ifdef ENABLE_NOAA
|
||||
{
|
||||
if (gScanStateDir == SCAN_OFF
|
||||
#ifdef ENABLE_NOAA
|
||||
&& !IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)
|
||||
#endif
|
||||
#ifdef ENABLE_SCAN_RANGES
|
||||
#endif
|
||||
#ifdef ENABLE_SCAN_RANGES
|
||||
&& gScanRangeStart == 0
|
||||
#endif
|
||||
)
|
||||
{ // start entering a DTMF string
|
||||
#endif
|
||||
) { // start entering a DTMF string
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
memcpy(gDTMF_InputBox, gDTMF_String, MIN(sizeof(gDTMF_InputBox), sizeof(gDTMF_String) - 1));
|
||||
gDTMF_InputBox_Index = 0;
|
||||
gDTMF_InputMode = true;
|
||||
gDTMF_InputBox_Index = 0;
|
||||
gDTMF_InputMode = true;
|
||||
|
||||
gKeyInputCountdown = key_input_timeout_500ms;
|
||||
gKeyInputCountdown = key_input_timeout_500ms;
|
||||
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
}
|
||||
else
|
||||
} else
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
}
|
||||
else
|
||||
{ // with the F-key
|
||||
} else { // with the F-key
|
||||
gWasFKeyPressed = false;
|
||||
|
||||
#ifdef ENABLE_NOAA
|
||||
if (IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// scan the CTCSS/DCS code
|
||||
gBackup_CROSS_BAND_RX_TX = gEeprom.CROSS_BAND_RX_TX;
|
||||
gBackup_CROSS_BAND_RX_TX = gEeprom.CROSS_BAND_RX_TX;
|
||||
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
|
||||
|
||||
SCANNER_Start(true);
|
||||
gRequestDisplayScreen = DISPLAY_SCANNER;
|
||||
}
|
||||
|
||||
|
||||
//gPttWasReleased = true; Fixed issue #138
|
||||
gUpdateStatus = true;
|
||||
gUpdateStatus = true;
|
||||
}
|
||||
|
||||
static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||
{
|
||||
static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction) {
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN // Set Squelch F + UP or Down
|
||||
if(gWasFKeyPressed) {
|
||||
switch(Direction)
|
||||
{
|
||||
if (gWasFKeyPressed) {
|
||||
switch (Direction) {
|
||||
case 1:
|
||||
processFKeyFunction(KEY_UP, false);
|
||||
break;
|
||||
@@ -834,10 +813,8 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
gRemoveOffset = false;
|
||||
gPowerHigh = false;
|
||||
#endif
|
||||
|
||||
uint8_t Channel = gEeprom.ScreenChannel[gEeprom.TX_VFO];
|
||||
|
||||
@@ -855,8 +832,7 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
}
|
||||
else { // short pressed
|
||||
} else { // short pressed
|
||||
if (gInputBoxIndex > 0) {
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
@@ -907,7 +883,7 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||
}
|
||||
#endif
|
||||
|
||||
gRequestSaveVFO = true;
|
||||
gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
return;
|
||||
}
|
||||
@@ -920,8 +896,8 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||
gPttWasReleased = true;
|
||||
}
|
||||
|
||||
void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
{
|
||||
|
||||
void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
|
||||
#ifdef ENABLE_FMRADIO
|
||||
if (gFmRadioMode && Key != KEY_PTT && Key != KEY_EXIT) {
|
||||
if (!bKeyHeld && bKeyPressed)
|
||||
@@ -932,13 +908,12 @@ void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
|
||||
if (gDTMF_InputMode && bKeyPressed && !bKeyHeld) {
|
||||
const char Character = DTMF_GetCharacter(Key);
|
||||
if (Character != 0xFF)
|
||||
{ // add key to DTMF string
|
||||
if (Character != 0xFF) { // add key to DTMF string
|
||||
DTMF_Append(Character);
|
||||
gKeyInputCountdown = key_input_timeout_500ms;
|
||||
gKeyInputCountdown = key_input_timeout_500ms;
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
gPttWasReleased = true;
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
gPttWasReleased = true;
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -954,26 +929,35 @@ void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
case KEY_SIDE1:
|
||||
case KEY_SIDE2:
|
||||
#endif
|
||||
case KEY_0...KEY_9:
|
||||
MAIN_Key_DIGITS(Key, bKeyPressed, bKeyHeld);
|
||||
case
|
||||
KEY_0...KEY_9
|
||||
:
|
||||
MAIN_Key_DIGITS(Key, bKeyPressed, bKeyHeld
|
||||
);
|
||||
break;
|
||||
case KEY_MENU:
|
||||
MAIN_Key_MENU(bKeyPressed, bKeyHeld);
|
||||
MAIN_Key_MENU(bKeyPressed, bKeyHeld
|
||||
);
|
||||
break;
|
||||
case KEY_UP:
|
||||
MAIN_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1);
|
||||
MAIN_Key_UP_DOWN(bKeyPressed, bKeyHeld,
|
||||
1);
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
MAIN_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1);
|
||||
MAIN_Key_UP_DOWN(bKeyPressed, bKeyHeld,
|
||||
-1);
|
||||
break;
|
||||
case KEY_EXIT:
|
||||
MAIN_Key_EXIT(bKeyPressed, bKeyHeld);
|
||||
MAIN_Key_EXIT(bKeyPressed, bKeyHeld
|
||||
);
|
||||
break;
|
||||
case KEY_STAR:
|
||||
MAIN_Key_STAR(bKeyPressed, bKeyHeld);
|
||||
MAIN_Key_STAR(bKeyPressed, bKeyHeld
|
||||
);
|
||||
break;
|
||||
case KEY_F:
|
||||
GENERIC_Key_F(bKeyPressed, bKeyHeld);
|
||||
GENERIC_Key_F(bKeyPressed, bKeyHeld
|
||||
);
|
||||
break;
|
||||
case KEY_PTT:
|
||||
GENERIC_Key_PTT(bKeyPressed);
|
||||
|
1079
app/menu.c
1079
app/menu.c
File diff suppressed because it is too large
Load Diff
264
app/messages.c
Normal file
264
app/messages.c
Normal file
@@ -0,0 +1,264 @@
|
||||
//
|
||||
// Created by bruno on 3/30/25.
|
||||
//
|
||||
|
||||
#include "messages.h"
|
||||
#include "ui/ui.h"
|
||||
#include "driver/uart.h"
|
||||
#include "driver/systick.h"
|
||||
|
||||
#define T9Count 9
|
||||
|
||||
const char T9Table[10][T9Count] = {
|
||||
{'#', '(', ')', ';', ':', '<', '>', '/', '0'},
|
||||
{',', '.', '?', '&', '!', ' ', '-', '_', '1'},
|
||||
{'a', 'b', 'c', 'A', 'B', 'C', '[', ']', '2'},
|
||||
{'d', 'e', 'f', 'D', 'E', 'F', '@', '%', '3'},
|
||||
{'g', 'h', 'i', 'G', 'H', 'I', '~', '$', '4'},
|
||||
{'j', 'k', 'l', 'J', 'K', 'L', '|', '*', '5'},
|
||||
{'m', 'n', 'o', 'M', 'N', 'O', '{', '}', '6'},
|
||||
{'p', 'q', 'r', 's', 'P', 'Q', 'R', 'S', '7'},
|
||||
{'t', 'u', 'v', 'T', 'U', 'V', '"', '\'', '8'},
|
||||
{'w', 'x', 'y', 'z', 'W', 'X', 'Y', 'Z', '9'}
|
||||
};
|
||||
|
||||
|
||||
uint8_t gActiveMessage = 0;
|
||||
|
||||
StoredPacket loadedPacket;
|
||||
|
||||
uint8_t gKeyTimeout = 0;
|
||||
|
||||
void MESSAGES_SAVE() {
|
||||
uint8_t Data[8];
|
||||
EEPROM_ReadBuffer(SEQParameterEEPROM, Data, 8);
|
||||
uint8_t msgIndex = Data[1];
|
||||
if (msgIndex >= MESSAGES_COUNT) {
|
||||
msgIndex = 0;
|
||||
}
|
||||
Data[1]++;
|
||||
EEPROM_WriteBuffer(SEQParameterEEPROM, Data);
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 0,
|
||||
(uint8_t *) &inBoundPacket + 4); // metadata
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 8,
|
||||
(uint8_t *) &inBoundPacket + 12); // message part 1
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 16,
|
||||
(uint8_t *) &inBoundPacket + 20); // message part 2
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 24,
|
||||
(uint8_t *) &inBoundPacket + 28); // message part 3
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 32,
|
||||
(uint8_t *) &inBoundPacket + 36); // message part 4
|
||||
|
||||
}
|
||||
|
||||
void MESSAGES_GET() {
|
||||
if (gActiveMessage == MESSAGES_COUNT) {
|
||||
memcpy(&loadedPacket, (uint8_t *) &dataPacket + (sizeof(DataPacket) - sizeof(StoredPacket)),
|
||||
sizeof(StoredPacket));
|
||||
} else {
|
||||
EEPROM_ReadBuffer(MESSAGES_START + (gActiveMessage * sizeof(StoredPacket)), &loadedPacket,
|
||||
sizeof(StoredPacket));
|
||||
}
|
||||
}
|
||||
|
||||
void MESSAGES_DELETE() {
|
||||
|
||||
}
|
||||
|
||||
void updatePrevChar(KEY_Code_t Key) {
|
||||
if (Key != prevKey) {
|
||||
prevKey = Key;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MESSAGES_TimeSlice500ms(void) {
|
||||
if (gKeyTimeout && gKeyTimeout++ > 2) {
|
||||
gKeyTimeout = 0;
|
||||
prevKey = KEY_EXIT;
|
||||
}
|
||||
}
|
||||
|
||||
void MESSAGES_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
|
||||
gKeyTimeout = 1;
|
||||
if (gEnteringSMS != SMS_NOT_ENTERING && !bKeyHeld && Key <= KEY_9) {
|
||||
if (!dataPTR || dataPTR < dataPacket.data) {
|
||||
dataPTR = dataPacket.data;
|
||||
}
|
||||
if (gEnteringSMS == SMS_ENTERING_MESSAGE) {
|
||||
if (bKeyPressed) {
|
||||
if (prevKey != Key) {
|
||||
dataPTR++;
|
||||
if (dataPTR - dataPacket.data >= DataPacketDataSize) {
|
||||
dataPTR = dataPacket.data;
|
||||
}
|
||||
prevLetter = 0;
|
||||
}
|
||||
*(dataPTR - 1) = T9Table[Key][(prevLetter++) % T9Count];
|
||||
updatePrevChar(Key);
|
||||
}
|
||||
return;
|
||||
} else if (gEnteringSMS == SMS_ENTERING_DEST) {
|
||||
if (bKeyPressed) {
|
||||
dataPacket.dest *= 10;
|
||||
dataPacket.dest += Key;
|
||||
prevLetter = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch (Key) {
|
||||
case KEY_PTT:
|
||||
case KEY_MENU:
|
||||
if (gEnteringSMS == SMS_NOT_ENTERING) {
|
||||
if (bKeyPressed) {
|
||||
gEnteringSMS = SMS_ENTERING_DEST;
|
||||
updatePrevChar(Key);
|
||||
}
|
||||
} else if (gEnteringSMS == SMS_ENTERING_DEST) {
|
||||
if (bKeyPressed) {
|
||||
memset(dataPacket.data, 0, DataPacketDataSize);
|
||||
prepareDataPacket();
|
||||
//dataPacket.flags = 0x80 | (gCurrentVfo->OUTPUT_POWER & 0x07);
|
||||
if (dataPacket.src == 665 || dataPacket.src == 664) {
|
||||
|
||||
uint8_t out[5];
|
||||
if (dataPacket.src == 665) {
|
||||
const uint32_t id24 = 0xFFFFFF & (dataPacket.dest >> 4);
|
||||
const uint8_t btn = 0x0F & (dataPacket.dest);
|
||||
// mask just in case
|
||||
// uint32_t id24 = 0x00A38C;
|
||||
// uint8_t btn = 0x04;
|
||||
|
||||
// 3-byte big-endian ID
|
||||
out[0] = (id24 >> 16) & 0xFF;
|
||||
out[1] = (id24 >> 8) & 0xFF;
|
||||
out[2] = (id24 >> 0) & 0xFF;
|
||||
|
||||
// first nibble redundancy copy: 0xBB if btn=0xB
|
||||
out[3] = (btn << 4) | 0x04;
|
||||
|
||||
// second copy with MSB flipped (btn ^ 0x8) in the high nibble
|
||||
out[4] = ((btn ^ 0x8) << 4);
|
||||
}
|
||||
else {
|
||||
out[0] = (dataPacket.dest >> 8) & 0xFF;
|
||||
out[1] = dataPacket.dest & 0xFF;
|
||||
}
|
||||
|
||||
BK4819_EnterTxMute();
|
||||
RADIO_SetTxParameters();
|
||||
|
||||
uint16_t datX = BK4819_REG_30_ENABLE_VCO_CALIB |
|
||||
BK4819_REG_30_ENABLE_UNKNOWN |
|
||||
BK4819_REG_30_DISABLE_RX_LINK |
|
||||
BK4819_REG_30_DISABLE_AF_DAC |
|
||||
BK4819_REG_30_ENABLE_DISC_MODE |
|
||||
BK4819_REG_30_ENABLE_PLL_VCO |
|
||||
BK4819_REG_30_ENABLE_PA_GAIN |
|
||||
BK4819_REG_30_DISABLE_MIC_ADC |
|
||||
BK4819_REG_30_ENABLE_TX_DSP |
|
||||
BK4819_REG_30_DISABLE_RX_DSP;
|
||||
BK4819_WriteRegister(BK4819_REG_30,
|
||||
datX);
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
SYSTEM_DelayMs(20);
|
||||
|
||||
for (unsigned int x = 0; x < 15; x++) {
|
||||
for (unsigned int y = 0; y < (dataPacket.src == 665 ? 5 : 2); y++) {
|
||||
for (unsigned char i = 7; i < 8; i--) {
|
||||
if ((out[y] >> i) & 1) {
|
||||
// datX |= BK4819_REG_30_ENABLE_PA_GAIN;
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, true);
|
||||
SYSTICK_DelayUs(400 * (dataPacket.src == 665 ? 3 : 2) - 325);
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
// datX &= ~BK4819_REG_30_ENABLE_PA_GAIN;
|
||||
SYSTICK_DelayUs(400 * 1 - 325);
|
||||
} else {
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, true);
|
||||
// datX |= BK4819_REG_30_ENABLE_PA_GAIN;
|
||||
SYSTICK_DelayUs(400 * 1 - 325);
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
// datX &= ~BK4819_REG_30_ENABLE_PA_GAIN;
|
||||
SYSTICK_DelayUs(400 * (dataPacket.src == 665 ? 3 : 2) - 325);
|
||||
}
|
||||
}
|
||||
}
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
SYSTEM_DelayMs((dataPacket.src == 665 ? 3 : 15));
|
||||
}
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
SYSTEM_DelayMs(100);
|
||||
BK4819_WriteRegister(BK4819_REG_30, 0xC1FE);
|
||||
gEnteringSMS = SMS_NOT_ENTERING;
|
||||
} else {
|
||||
gEnteringSMS = SMS_ENTERING_MESSAGE;
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else if (gEnteringSMS == SMS_ENTERING_MESSAGE) {
|
||||
if (bKeyPressed) {
|
||||
if (strlen((char *) dataPacket.data)) {
|
||||
MSG_FSKSendData(&dataPacket);
|
||||
gEnteringSMS = SMS_NOT_ENTERING;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case KEY_UP:
|
||||
if (bKeyPressed) {
|
||||
gActiveMessage++;
|
||||
if (gActiveMessage > MESSAGES_COUNT) {
|
||||
gActiveMessage = 0;
|
||||
}
|
||||
MESSAGES_GET();
|
||||
}
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
if (bKeyPressed) {
|
||||
gActiveMessage--;
|
||||
if (gActiveMessage > MESSAGES_COUNT) {
|
||||
gActiveMessage = MESSAGES_COUNT - 1;
|
||||
}
|
||||
MESSAGES_GET();
|
||||
}
|
||||
break;
|
||||
case KEY_EXIT:
|
||||
if (gEnteringSMS != SMS_NOT_ENTERING) {
|
||||
if (bKeyHeld) {
|
||||
if (bKeyPressed) {
|
||||
gEnteringSMS = SMS_NOT_ENTERING;
|
||||
dataPTR = dataPacket.data;
|
||||
memset(dataPacket.data, 0, DataPacketDataSize);
|
||||
}
|
||||
} else {
|
||||
if (bKeyPressed) {
|
||||
if (gEnteringSMS == SMS_ENTERING_MESSAGE) {
|
||||
if (dataPacket.data <= dataPTR) {
|
||||
*dataPTR = '\0';
|
||||
if (dataPacket.data < dataPTR) {
|
||||
dataPTR--;
|
||||
}
|
||||
*dataPTR = '\0';
|
||||
}
|
||||
} else if (gEnteringSMS == SMS_ENTERING_DEST) {
|
||||
dataPacket.dest /= 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (bKeyPressed) {
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
}
|
||||
}
|
||||
updatePrevChar(Key);
|
||||
break;
|
||||
default:
|
||||
if (!bKeyHeld && bKeyPressed)
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
break;
|
||||
}
|
||||
}
|
34
app/messages.h
Normal file
34
app/messages.h
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Created by bruno on 3/30/25.
|
||||
//
|
||||
|
||||
//#ifndef BRNQUANFW_MESSAGES_H
|
||||
//#define BRNQUANFW_MESSAGES_H
|
||||
#include "fskmodem.h"
|
||||
#include "../driver/keyboard.h"
|
||||
#include "../driver/eeprom.h"
|
||||
|
||||
#define MESSAGES_START (0x1D00)
|
||||
#define MESSAGES_COUNT (6)
|
||||
|
||||
typedef struct {
|
||||
uint32_t src;
|
||||
uint8_t seq;
|
||||
uint8_t ttl;
|
||||
uint8_t flags;
|
||||
uint8_t data[DataPacketDataSize];
|
||||
} StoredPacket;
|
||||
|
||||
extern uint8_t gActiveMessage;
|
||||
|
||||
extern StoredPacket loadedPacket;
|
||||
|
||||
extern uint8_t gKeyTimeout;
|
||||
|
||||
void MESSAGES_GET();
|
||||
void MESSAGES_DELETE();
|
||||
void MESSAGES_SAVE();
|
||||
void MESSAGES_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
||||
void MESSAGES_TimeSlice500ms(void);
|
||||
|
||||
//#endif //BRNQUANFW_MESSAGES_H
|
1158
app/spectrum.c
1158
app/spectrum.c
File diff suppressed because it is too large
Load Diff
@@ -180,8 +180,9 @@ typedef struct PeakInfo
|
||||
uint16_t i;
|
||||
} PeakInfo;
|
||||
|
||||
#ifdef ENABLE_SPECTRUM
|
||||
void APP_RunSpectrum(void);
|
||||
|
||||
#endif
|
||||
#endif /* ifndef SPECTRUM_H */
|
||||
|
||||
// vim: ft=c
|
||||
|
BIN
archive/f4hwn.bandscope.packed.v4.0.bin
Normal file
BIN
archive/f4hwn.bandscope.packed.v4.0.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.bandscope.packed.v4.0.sa818.bin
Normal file
BIN
archive/f4hwn.bandscope.packed.v4.0.sa818.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.basic.packed.v4.0.bin
Normal file
BIN
archive/f4hwn.basic.packed.v4.0.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.basic.packed.v4.0.sa818.bin
Normal file
BIN
archive/f4hwn.basic.packed.v4.0.sa818.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.broadcast.packed.v4.0.bin
Normal file
BIN
archive/f4hwn.broadcast.packed.v4.0.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.broadcast.packed.v4.0.sa818.bin
Normal file
BIN
archive/f4hwn.broadcast.packed.v4.0.sa818.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.rescueops.packed.v4.0.bin
Normal file
BIN
archive/f4hwn.rescueops.packed.v4.0.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.rescueops.packed.v4.0.sa818.bin
Normal file
BIN
archive/f4hwn.rescueops.packed.v4.0.sa818.bin
Normal file
Binary file not shown.
34
bitmaps.c
34
bitmaps.c
@@ -44,19 +44,6 @@ const uint8_t gFontKeyLock[9] =
|
||||
0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c
|
||||
};
|
||||
|
||||
const uint8_t gFontLight[9] =
|
||||
{
|
||||
0b00001100,
|
||||
0b00010010,
|
||||
0b00100001,
|
||||
0b01101101,
|
||||
0b01111001,
|
||||
0b01101101,
|
||||
0b00100001,
|
||||
0b00010010,
|
||||
0b00001100,
|
||||
};
|
||||
|
||||
const uint8_t gFontMute[12] =
|
||||
{
|
||||
0b00011100,
|
||||
@@ -166,17 +153,6 @@ const uint8_t BITMAP_Antenna[5] =
|
||||
0b00000011
|
||||
};
|
||||
|
||||
const uint8_t BITMAP_VFO_Lock[7] =
|
||||
{
|
||||
0b01111100,
|
||||
0b01000110,
|
||||
0b01000101,
|
||||
0b01000101,
|
||||
0b01000101,
|
||||
0b01000110,
|
||||
0b01111100,
|
||||
};
|
||||
|
||||
const uint8_t BITMAP_VFO_Default[7] =
|
||||
{
|
||||
0b01111111,
|
||||
@@ -302,16 +278,6 @@ const uint8_t BITMAP_ScanListAll[19] =
|
||||
0b01111111
|
||||
};
|
||||
|
||||
const uint8_t BITMAP_compand[6] =
|
||||
{
|
||||
0b00000000,
|
||||
0b00111100,
|
||||
0b01000010,
|
||||
0b01000010,
|
||||
0b01000010,
|
||||
0b00100100
|
||||
};
|
||||
|
||||
/*
|
||||
const uint8_t BITMAP_Ready[7] =
|
||||
{
|
||||
|
@@ -11,7 +11,6 @@ extern const uint8_t gFontF[8];
|
||||
extern const uint8_t gFontS[6];
|
||||
|
||||
extern const uint8_t gFontKeyLock[9];
|
||||
extern const uint8_t gFontLight[9];
|
||||
extern const uint8_t gFontMute[12];
|
||||
|
||||
extern const uint8_t gFontXB[2][6];
|
||||
@@ -38,7 +37,6 @@ extern const uint8_t BITMAP_NotReady[7];
|
||||
extern const uint8_t BITMAP_Antenna[5];
|
||||
extern const uint8_t BITMAP_VFO_Default[7];
|
||||
extern const uint8_t BITMAP_VFO_NotDefault[7];
|
||||
extern const uint8_t BITMAP_VFO_Lock[7];
|
||||
extern const uint8_t BITMAP_ScanList0[7];
|
||||
extern const uint8_t BITMAP_ScanList1[7];
|
||||
extern const uint8_t BITMAP_ScanList2[7];
|
||||
@@ -47,8 +45,6 @@ extern const uint8_t BITMAP_ScanList123[19];
|
||||
extern const uint8_t BITMAP_ScanListAll[19];
|
||||
extern const uint8_t BITMAP_ScanListE[7];
|
||||
extern const uint8_t BITMAP_PowerUser[3];
|
||||
extern const uint8_t BITMAP_compand[6];
|
||||
|
||||
extern const uint8_t BITMAP_NOAA[12];
|
||||
|
||||
#ifndef ENABLE_CUSTOM_MENU_LAYOUT
|
||||
|
@@ -2,7 +2,8 @@
|
||||
#export DOCKER_DEFAULT_PLATFORM=linux/amd64
|
||||
#export DOCKER_NETWORK="--network=host"
|
||||
IMAGE_NAME="uvk5"
|
||||
rm "${PWD}/compiled-firmware/*"
|
||||
rm -rf "${PWD}/compiled-firmware/*"
|
||||
mkdir -p "${PWD}/compiled-firmware"
|
||||
echo "Building docker image $IMAGE_NAME"
|
||||
if ! docker build -t $DOCKER_NETWORK $IMAGE_NAME .
|
||||
then
|
||||
@@ -10,121 +11,6 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
custom() {
|
||||
echo "Custom compilation..."
|
||||
docker run --rm -v "${PWD}/compiled-firmware/:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
|
||||
EDITION_STRING=Custom \
|
||||
TARGET=f4hwn.custom \
|
||||
&& cp f4hwn.custom* compiled-firmware/"
|
||||
}
|
||||
|
||||
standard() {
|
||||
echo "Standard compilation..."
|
||||
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
|
||||
ENABLE_SPECTRUM=0 \
|
||||
ENABLE_FMRADIO=0 \
|
||||
ENABLE_AIRCOPY=0 \
|
||||
ENABLE_NOAA=0 \
|
||||
EDITION_STRING=Standard \
|
||||
TARGET=f4hwn.standard \
|
||||
&& cp f4hwn.standard* compiled-firmware/"
|
||||
}
|
||||
|
||||
bandscope() {
|
||||
echo "Bandscope compilation..."
|
||||
docker run --rm -v "${PWD}/compiled-firmware/:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
|
||||
ENABLE_SPECTRUM=1 \
|
||||
ENABLE_FMRADIO=0 \
|
||||
ENABLE_AIRCOPY=1 \
|
||||
ENABLE_FEAT_F4HWN_PMR=1 \
|
||||
ENABLE_FEAT_F4HWN_GMRS_FRS_MURS=1 \
|
||||
ENABLE_NOAA=0 \
|
||||
ENABLE_FEAT_F4HWN_RESCUE_OPS=0 \
|
||||
EDITION_STRING=Bandscope \
|
||||
TARGET=f4hwn.bandscope \
|
||||
&& cp f4hwn.bandscope* compiled-firmware/"
|
||||
}
|
||||
|
||||
broadcast() {
|
||||
echo "Broadcast compilation..."
|
||||
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
|
||||
ENABLE_SPECTRUM=0 \
|
||||
ENABLE_FMRADIO=1 \
|
||||
ENABLE_AIRCOPY=1 \
|
||||
ENABLE_FEAT_F4HWN_PMR=1 \
|
||||
ENABLE_FEAT_F4HWN_GMRS_FRS_MURS=1 \
|
||||
ENABLE_NOAA=0 \
|
||||
EDITION_STRING=Broadcast \
|
||||
ENABLE_FEAT_F4HWN_RESCUE_OPS=0 \
|
||||
TARGET=f4hwn.broadcast \
|
||||
&& cp f4hwn.broadcast* compiled-firmware/"
|
||||
}
|
||||
|
||||
voxless() {
|
||||
echo "Voxless compilation..."
|
||||
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
|
||||
ENABLE_SPECTRUM=1 \
|
||||
ENABLE_FMRADIO=1 \
|
||||
ENABLE_VOX=0 \
|
||||
ENABLE_AIRCOPY=0 \
|
||||
ENABLE_AUDIO_BAR=0 \
|
||||
ENABLE_FEAT_F4HWN_SPECTRUM=0 \
|
||||
ENABLE_FEAT_F4HWN_PMR=1 \
|
||||
ENABLE_FEAT_F4HWN_GMRS_FRS_MURS=1 \
|
||||
ENABLE_NOAA=0 \
|
||||
ENABLE_FEAT_F4HWN_RESUME_STATE=0 \
|
||||
ENABLE_FEAT_F4HWN_CHARGING_C=0 \
|
||||
ENABLE_FEAT_F4HWN_INV=1 \
|
||||
ENABLE_FEAT_F4HWN_CTR=0 \
|
||||
ENABLE_FEAT_F4HWN_NARROWER=0 \
|
||||
ENABLE_FEAT_F4HWN_RESCUE_OPS=0 \
|
||||
EDITION_STRING=Voxless \
|
||||
TARGET=f4hwn.voxless \
|
||||
&& cp f4hwn.voxless* compiled-firmware/"
|
||||
}
|
||||
|
||||
rescueops() {
|
||||
echo "RescueOps compilation..."
|
||||
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
|
||||
ENABLE_SPECTRUM=0 \
|
||||
ENABLE_FMRADIO=0 \
|
||||
ENABLE_AIRCOPY=1 \
|
||||
ENABLE_FEAT_F4HWN_PMR=1 \
|
||||
ENABLE_FEAT_F4HWN_GMRS_FRS_MURS=1 \
|
||||
ENABLE_NOAA=1 \
|
||||
ENABLE_FEAT_F4HWN_RESCUE_OPS=1 \
|
||||
EDITION_STRING=RescueOps \
|
||||
TARGET=f4hwn.rescueops \
|
||||
&& cp f4hwn.rescueops* compiled-firmware/"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
custom)
|
||||
custom
|
||||
;;
|
||||
standard)
|
||||
standard
|
||||
;;
|
||||
bandscope)
|
||||
bandscope
|
||||
;;
|
||||
broadcast)
|
||||
broadcast
|
||||
;;
|
||||
voxless)
|
||||
voxless
|
||||
;;
|
||||
rescueops)
|
||||
rescueops
|
||||
;;
|
||||
all)
|
||||
bandscope
|
||||
broadcast
|
||||
rescueops
|
||||
voxless
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {custom|bandscope|broadcast|voxless|standard|all}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME \
|
||||
/bin/bash -c "cd /app && make -j && cp f4hwn* /app/compiled-firmware/ && ls -l /app/compiled-firmware/ || echo 'No files to copy'"
|
@@ -66,18 +66,6 @@ void BACKLIGHT_InitHardware()
|
||||
0;
|
||||
}
|
||||
|
||||
static void BACKLIGHT_Sound(void)
|
||||
{
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_ALL)
|
||||
{
|
||||
AUDIO_PlayBeep(BEEP_880HZ_60MS_DOUBLE_BEEP);
|
||||
AUDIO_PlayBeep(BEEP_880HZ_60MS_DOUBLE_BEEP);
|
||||
}
|
||||
|
||||
gK5startup = false;
|
||||
}
|
||||
|
||||
|
||||
void BACKLIGHT_TurnOn(void)
|
||||
{
|
||||
#ifdef ENABLE_FEAT_F4HWN_SLEEP
|
||||
@@ -90,38 +78,11 @@ void BACKLIGHT_TurnOn(void)
|
||||
|
||||
if (gEeprom.BACKLIGHT_TIME == 0) {
|
||||
BACKLIGHT_TurnOff();
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if(gK5startup == true)
|
||||
{
|
||||
BACKLIGHT_Sound();
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
backlightOn = true;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if(gK5startup == true) {
|
||||
#if defined(ENABLE_FMRADIO) && defined(ENABLE_SPECTRUM)
|
||||
BACKLIGHT_SetBrightness(gEeprom.BACKLIGHT_MAX);
|
||||
#else
|
||||
for(uint8_t i = 0; i <= gEeprom.BACKLIGHT_MAX; i++)
|
||||
{
|
||||
BACKLIGHT_SetBrightness(i);
|
||||
SYSTEM_DelayMs(50);
|
||||
}
|
||||
#endif
|
||||
|
||||
BACKLIGHT_Sound();
|
||||
}
|
||||
else
|
||||
{
|
||||
BACKLIGHT_SetBrightness(gEeprom.BACKLIGHT_MAX);
|
||||
}
|
||||
#else
|
||||
BACKLIGHT_SetBrightness(gEeprom.BACKLIGHT_MAX);
|
||||
#endif
|
||||
|
||||
switch (gEeprom.BACKLIGHT_TIME) {
|
||||
default:
|
||||
|
@@ -18,15 +18,43 @@
|
||||
#define BK1080_REGS_H
|
||||
|
||||
enum BK1080_Register_t {
|
||||
BK1080_REG_00 = 0x00U,
|
||||
BK1080_REG_02_POWER_CONFIGURATION = 0x02U,
|
||||
BK1080_REG_03_CHANNEL = 0x03U,
|
||||
BK1080_REG_00 = 0x00U,
|
||||
BK1080_REG_01_CHIP_ID = 0x01U,
|
||||
BK1080_REG_02_POWER_CONFIGURATION = 0x02U,
|
||||
BK1080_REG_03_CHANNEL = 0x03U,
|
||||
BK1080_REG_04_SYSTEM_CONFIGURATION1 = 0x04U,
|
||||
BK1080_REG_05_SYSTEM_CONFIGURATION2 = 0x05U,
|
||||
BK1080_REG_07 = 0x07U,
|
||||
BK1080_REG_10 = 0x0AU,
|
||||
BK1080_REG_25_INTERNAL = 0x19U,
|
||||
BK1080_REG_06_SYSTEM_CONFIGURATION3 = 0x06U,
|
||||
BK1080_REG_07_TEST1 = 0x07U,
|
||||
BK1080_REG_08_TEST2 = 0x08U,
|
||||
BK1080_REG_09_BOOT_CONFIGURATION = 0x09U,
|
||||
BK1080_REG_10_RSSI_STATUS = 0x0AU,
|
||||
BK1080_REG_11_RSSI_THRESHOLD = 0x0BU,
|
||||
BK1080_REG_12_INTERNAL = 0x0CU,
|
||||
BK1080_REG_13_INTERNAL = 0x0DU,
|
||||
BK1080_REG_14_INTERNAL = 0x0EU,
|
||||
BK1080_REG_15_INTERNAL = 0x0FU,
|
||||
BK1080_REG_16_INTERNAL = 0x10U,
|
||||
BK1080_REG_17_INTERNAL = 0x11U,
|
||||
BK1080_REG_18_INTERNAL = 0x12U,
|
||||
BK1080_REG_19_INTERNAL = 0x13U,
|
||||
BK1080_REG_20_INTERNAL = 0x14U,
|
||||
BK1080_REG_21_INTERNAL = 0x15U,
|
||||
BK1080_REG_22_INTERNAL = 0x16U,
|
||||
BK1080_REG_23_INTERNAL = 0x17U,
|
||||
BK1080_REG_24_INTERNAL = 0x18U,
|
||||
BK1080_REG_25_INTERNAL = 0x19U,
|
||||
BK1080_REG_26_INTERNAL = 0x1AU,
|
||||
BK1080_REG_27_INTERNAL = 0x1BU,
|
||||
BK1080_REG_28_INTERNAL = 0x1CU,
|
||||
BK1080_REG_29_INTERNAL = 0x1DU,
|
||||
BK1080_REG_30_INTERNAL = 0x1EU,
|
||||
BK1080_REG_31_INTERNAL = 0x1FU,
|
||||
BK1080_REG_32_INTERNAL = 0x20U,
|
||||
BK1080_REG_33_INTERNAL = 0x21U,
|
||||
};
|
||||
|
||||
|
||||
typedef enum BK1080_Register_t BK1080_Register_t;
|
||||
|
||||
// REG 07
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/i2c.h"
|
||||
#include "driver/system.h"
|
||||
#include "../settings.h"
|
||||
#include "misc.h"
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
@@ -69,10 +70,11 @@ void BK1080_Init(uint16_t freq, uint8_t band/*, uint8_t space*/)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
BK1080_WriteRegister(BK1080_REG_05_SYSTEM_CONFIGURATION2, gMute ? 0x0A10 : 0x0A1F);
|
||||
BK1080_WriteRegister(BK1080_REG_05_SYSTEM_CONFIGURATION2, 0x0A10 | (gEeprom.VOLUME_GAIN >> 2));
|
||||
#else
|
||||
BK1080_WriteRegister(BK1080_REG_05_SYSTEM_CONFIGURATION2, 0x0A1F);
|
||||
#endif
|
||||
BK1080_UpdateSysconf();
|
||||
BK1080_SetFrequency(freq, band/*, space*/);
|
||||
}
|
||||
else {
|
||||
@@ -104,6 +106,15 @@ void BK1080_WriteRegister(BK1080_Register_t Register, uint16_t Value)
|
||||
I2C_Stop();
|
||||
}
|
||||
|
||||
void BK1080_UpdateSysconf(void) {
|
||||
BK1080_WriteRegister(BK1080_REG_04_SYSTEM_CONFIGURATION1,
|
||||
(gEeprom.BK1080_DEEMPHASIS_CONFIG == DEEMPHASIS_OFF ? BK1080_DEEMPHASIS_OFF : BK1080_DEEMPHASIS_ON) |
|
||||
(gEeprom.BK1080_DEEMPHASIS_CONFIG == DEEMPHASIS_EUR ? BK1080_DEEMPHASIS_EUR : BK1080_DEEMPHASIS_USA) |
|
||||
(gEeprom.BK1080_AGC_ENABLED ? BK1080_AGC_ON : BK1080_AGC_OFF) |
|
||||
(gEeprom.BK1080_BLEND_CONFIG << 6)
|
||||
);
|
||||
}
|
||||
|
||||
void BK1080_Mute(bool Mute)
|
||||
{
|
||||
BK1080_WriteRegister(BK1080_REG_02_POWER_CONFIGURATION, Mute ? 0x4201 : 0x0201);
|
||||
@@ -130,7 +141,7 @@ void BK1080_SetFrequency(uint16_t frequency, uint8_t band/*, uint8_t space*/)
|
||||
void BK1080_GetFrequencyDeviation(uint16_t Frequency)
|
||||
{
|
||||
BK1080_BaseFrequency = Frequency;
|
||||
BK1080_FrequencyDeviation = BK1080_ReadRegister(BK1080_REG_07) / 16;
|
||||
BK1080_FrequencyDeviation = BK1080_ReadRegister(BK1080_REG_07_TEST1) / 16;
|
||||
}
|
||||
|
||||
uint16_t BK1080_GetFreqLoLimit(uint8_t band)
|
||||
|
@@ -24,10 +24,20 @@
|
||||
extern uint16_t BK1080_BaseFrequency;
|
||||
extern uint16_t BK1080_FrequencyDeviation;
|
||||
|
||||
#define BK1080_DEEMPHASIS_USA (0 << 11)
|
||||
#define BK1080_DEEMPHASIS_EUR (1 << 11)
|
||||
|
||||
#define BK1080_DEEMPHASIS_ON (0 << 13)
|
||||
#define BK1080_DEEMPHASIS_OFF (1 << 13)
|
||||
|
||||
#define BK1080_AGC_ON (0 << 10)
|
||||
#define BK1080_AGC_OFF (1 << 10)
|
||||
|
||||
void BK1080_Init0(void);
|
||||
void BK1080_Init(uint16_t Frequency, uint8_t band/*, uint8_t space*/);
|
||||
uint16_t BK1080_ReadRegister(BK1080_Register_t Register);
|
||||
void BK1080_WriteRegister(BK1080_Register_t Register, uint16_t Value);
|
||||
void BK1080_UpdateSysconf(void);
|
||||
void BK1080_Mute(bool Mute);
|
||||
uint16_t BK1080_GetFreqLoLimit(uint8_t band);
|
||||
uint16_t BK1080_GetFreqHiLimit(uint8_t band);
|
||||
|
@@ -74,6 +74,7 @@ enum BK4819_REGISTER_t {
|
||||
BK4819_REG_3D = 0x3DU,
|
||||
BK4819_REG_3E = 0x3EU,
|
||||
BK4819_REG_3F = 0x3FU,
|
||||
BK4819_REG_40 = 0x40U,
|
||||
BK4819_REG_43 = 0x43U,
|
||||
BK4819_REG_46 = 0x46U,
|
||||
BK4819_REG_47 = 0x47U,
|
||||
@@ -96,6 +97,7 @@ enum BK4819_REGISTER_t {
|
||||
BK4819_REG_5A = 0x5AU,
|
||||
BK4819_REG_5B = 0x5BU,
|
||||
BK4819_REG_5C = 0x5CU,
|
||||
BK4819_REG_5E = 0x5EU,
|
||||
BK4819_REG_5D = 0x5DU,
|
||||
BK4819_REG_5F = 0x5FU,
|
||||
BK4819_REG_63 = 0x63U,
|
||||
|
@@ -42,12 +42,33 @@ static uint16_t gBK4819_GpioOutState;
|
||||
|
||||
bool gRxIdleMode;
|
||||
|
||||
__inline uint16_t scale_freq(const uint16_t freq)
|
||||
__inline uint16_t scale_freq(uint16_t freq)
|
||||
{
|
||||
// return (((uint32_t)freq * 1032444u) + 50000u) / 100000u; // with rounding
|
||||
return (((uint32_t)freq * 1353245u) + (1u << 16)) >> 17; // with rounding
|
||||
}
|
||||
|
||||
__inline uint16_t inverse_scale_freq(uint16_t scaled_freq)
|
||||
{
|
||||
return (((uint32_t)scaled_freq << 17) - (1u << 16)) / 1353245u;
|
||||
}
|
||||
|
||||
|
||||
void BK4819_FskEnableTx(void){
|
||||
const uint16_t fsk_reg59 = BK4819_ReadRegister(BK4819_REG_59);
|
||||
BK4819_WriteRegister(BK4819_REG_59, (1u << 11) | fsk_reg59);
|
||||
}
|
||||
|
||||
void BK4819_FskClearFifo(void){
|
||||
const uint16_t fsk_reg59 = BK4819_ReadRegister(BK4819_REG_59);
|
||||
BK4819_WriteRegister(BK4819_REG_59, (1u << 15) | (1u << 14) | fsk_reg59);
|
||||
}
|
||||
|
||||
void BK4819_FskEnableRx(void){
|
||||
const uint16_t fsk_reg59 = BK4819_ReadRegister(BK4819_REG_59);
|
||||
BK4819_WriteRegister(BK4819_REG_59, (1u << 12) | fsk_reg59);
|
||||
}
|
||||
|
||||
void BK4819_Init(void)
|
||||
{
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_BK4819_SCN);
|
||||
@@ -839,18 +860,18 @@ void BK4819_PickRXFilterPathBasedOnFrequency(uint32_t Frequency)
|
||||
}
|
||||
}
|
||||
|
||||
void BK4819_DisableScramble(void)
|
||||
void BK4819_SetScramble(uint16_t Freq)
|
||||
{
|
||||
const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31);
|
||||
BK4819_WriteRegister(BK4819_REG_31, Value & ~(1u << 1));
|
||||
}
|
||||
uint16_t Value = BK4819_ReadRegister(BK4819_REG_31);
|
||||
if (Freq) {
|
||||
Value |= (1u << 1);
|
||||
} else {
|
||||
Value &= ~(1u << 1);
|
||||
}
|
||||
BK4819_WriteRegister(BK4819_REG_31, Value);
|
||||
|
||||
void BK4819_EnableScramble(uint8_t Type)
|
||||
{
|
||||
const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31);
|
||||
BK4819_WriteRegister(BK4819_REG_31, Value | (1u << 1));
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_71, 0x68DC + (Type * 1032)); // 0110 1000 1101 1100
|
||||
//BK4819_WriteRegister(BK4819_REG_71, 0x68DC + (Freq * 1032)); // 0110 1000 1101 1100
|
||||
BK4819_WriteRegister(BK4819_REG_71, Freq);
|
||||
}
|
||||
|
||||
bool BK4819_CompanderEnabled(void)
|
||||
|
@@ -65,6 +65,9 @@ typedef enum BK4819_CssScanResult_t BK4819_CssScanResult_t;
|
||||
// radio is asleep, not listening
|
||||
extern bool gRxIdleMode;
|
||||
|
||||
uint16_t inverse_scale_freq(uint16_t scaled_freq);
|
||||
uint16_t scale_freq(uint16_t freq);
|
||||
|
||||
void BK4819_Init(void);
|
||||
uint16_t BK4819_ReadRegister(BK4819_REGISTER_t Register);
|
||||
void BK4819_WriteRegister(BK4819_REGISTER_t Register, uint16_t Data);
|
||||
@@ -77,6 +80,11 @@ void BK4819_InitAGC(bool amModulation);
|
||||
|
||||
void BK4819_ToggleGpioOut(BK4819_GPIO_PIN_t Pin, bool bSet);
|
||||
|
||||
void BK4819_ResetFSK(void);
|
||||
void BK4819_FskClearFifo(void);
|
||||
void BK4819_FskEnableRx(void);
|
||||
void BK4819_FskEnableTx(void);
|
||||
|
||||
void BK4819_SetCDCSSCodeWord(uint32_t CodeWord);
|
||||
void BK4819_SetCTCSSFrequency(uint32_t BaudRate);
|
||||
void BK4819_SetTailDetection(const uint32_t freq_10Hz);
|
||||
@@ -95,8 +103,7 @@ void BK4819_SetupSquelch(
|
||||
void BK4819_SetAF(BK4819_AF_Type_t AF);
|
||||
void BK4819_RX_TurnOn(void);
|
||||
void BK4819_PickRXFilterPathBasedOnFrequency(uint32_t Frequency);
|
||||
void BK4819_DisableScramble(void);
|
||||
void BK4819_EnableScramble(uint8_t Type);
|
||||
void BK4819_SetScramble(uint16_t Freq);
|
||||
|
||||
bool BK4819_CompanderEnabled(void);
|
||||
void BK4819_SetCompander(const unsigned int mode);
|
||||
|
@@ -26,6 +26,8 @@ KEY_Code_t gKeyReading0 = KEY_INVALID;
|
||||
KEY_Code_t gKeyReading1 = KEY_INVALID;
|
||||
uint16_t gDebounceCounter = 0;
|
||||
bool gWasFKeyPressed = false;
|
||||
uint8_t prevLetter = 0;
|
||||
KEY_Code_t prevKey = KEY_INVALID;
|
||||
|
||||
static const struct {
|
||||
|
||||
|
@@ -47,8 +47,10 @@ typedef enum KEY_Code_e KEY_Code_t;
|
||||
|
||||
extern KEY_Code_t gKeyReading0;
|
||||
extern KEY_Code_t gKeyReading1;
|
||||
extern uint16_t gDebounceCounter;
|
||||
extern bool gWasFKeyPressed;
|
||||
extern uint16_t gDebounceCounter;
|
||||
extern bool gWasFKeyPressed;
|
||||
extern uint8_t prevLetter;
|
||||
extern KEY_Code_t prevKey;
|
||||
|
||||
KEY_Code_t KEYBOARD_Poll(void);
|
||||
|
||||
|
@@ -202,7 +202,7 @@ uint8_t cmds[] = {
|
||||
ST7565_WriteByte(ST7565_CMD_INVERSE_DISPLAY | gSetting_set_inv);
|
||||
break;
|
||||
case 7:
|
||||
ST7565_WriteByte(21 + gSetting_set_ctr);
|
||||
ST7565_WriteByte(21 + ST7565_CTR_SETTING_VAL);
|
||||
break;
|
||||
default:
|
||||
ST7565_WriteByte(cmds[i]);
|
||||
@@ -226,22 +226,22 @@ uint8_t cmds[] = {
|
||||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||
}
|
||||
|
||||
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
|
||||
void ST7565_Gauge(uint8_t line, uint8_t min, uint8_t max, uint8_t value)
|
||||
{
|
||||
gFrameBuffer[line][54] = 0x0c;
|
||||
gFrameBuffer[line][55] = 0x12;
|
||||
|
||||
gFrameBuffer[line][121] = 0x12;
|
||||
gFrameBuffer[line][122] = 0x0c;
|
||||
|
||||
uint8_t filled = map(value, min, max, 56, 120);
|
||||
|
||||
for (uint8_t i = 56; i <= 120; i++) {
|
||||
gFrameBuffer[line][i] = (i <= filled) ? 0x2d : 0x21;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// #if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
|
||||
// void ST7565_Gauge(uint8_t line, uint8_t min, uint8_t max, uint8_t value)
|
||||
// {
|
||||
// gFrameBuffer[line][54] = 0x0c;
|
||||
// gFrameBuffer[line][55] = 0x12;
|
||||
//
|
||||
// gFrameBuffer[line][121] = 0x12;
|
||||
// gFrameBuffer[line][122] = 0x0c;
|
||||
//
|
||||
// uint8_t filled = map(value, min, max, 56, 120);
|
||||
//
|
||||
// for (uint8_t i = 56; i <= 120; i++) {
|
||||
// gFrameBuffer[line][i] = (i <= filled) ? 0x2d : 0x21;
|
||||
// }
|
||||
// }
|
||||
// #endif
|
||||
#endif
|
||||
|
||||
void ST7565_Init(void)
|
||||
|
@@ -27,6 +27,8 @@
|
||||
extern uint8_t gStatusLine[LCD_WIDTH];
|
||||
extern uint8_t gFrameBuffer[FRAME_LINES][LCD_WIDTH];
|
||||
|
||||
#define ST7565_CTR_SETTING_VAL (15)
|
||||
|
||||
void ST7565_DrawLine(const unsigned int Column, const unsigned int Line, const uint8_t *pBitmap, const unsigned int Size);
|
||||
void ST7565_BlitFullScreen(void);
|
||||
void ST7565_BlitLine(unsigned line);
|
||||
|
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "bsp/dp32g030/dma.h"
|
||||
#include "bsp/dp32g030/syscon.h"
|
||||
#include "bsp/dp32g030/uart.h"
|
||||
@@ -23,8 +24,7 @@
|
||||
static bool UART_IsLogEnabled;
|
||||
uint8_t UART_DMA_Buffer[256];
|
||||
|
||||
void UART_Init(void)
|
||||
{
|
||||
void UART_Init(void) {
|
||||
uint32_t Delta;
|
||||
uint32_t Positive;
|
||||
uint32_t Frequency;
|
||||
@@ -48,35 +48,32 @@ void UART_Init(void)
|
||||
|
||||
DMA_CTR = (DMA_CTR & ~DMA_CTR_DMAEN_MASK) | DMA_CTR_DMAEN_BITS_DISABLE;
|
||||
|
||||
DMA_CH0->MSADDR = (uint32_t)(uintptr_t)&UART1->RDR;
|
||||
DMA_CH0->MDADDR = (uint32_t)(uintptr_t)UART_DMA_Buffer;
|
||||
DMA_CH0->MSADDR = (uint32_t) (uintptr_t) &UART1->RDR;
|
||||
DMA_CH0->MDADDR = (uint32_t) (uintptr_t) UART_DMA_Buffer;
|
||||
DMA_CH0->MOD = 0
|
||||
// Source
|
||||
| DMA_CH_MOD_MS_ADDMOD_BITS_NONE
|
||||
| DMA_CH_MOD_MS_SIZE_BITS_8BIT
|
||||
| DMA_CH_MOD_MS_SEL_BITS_HSREQ_MS1
|
||||
// Destination
|
||||
| DMA_CH_MOD_MD_ADDMOD_BITS_INCREMENT
|
||||
| DMA_CH_MOD_MD_SIZE_BITS_8BIT
|
||||
| DMA_CH_MOD_MD_SEL_BITS_SRAM
|
||||
;
|
||||
// Source
|
||||
| DMA_CH_MOD_MS_ADDMOD_BITS_NONE
|
||||
| DMA_CH_MOD_MS_SIZE_BITS_8BIT
|
||||
| DMA_CH_MOD_MS_SEL_BITS_HSREQ_MS1
|
||||
// Destination
|
||||
| DMA_CH_MOD_MD_ADDMOD_BITS_INCREMENT
|
||||
| DMA_CH_MOD_MD_SIZE_BITS_8BIT
|
||||
| DMA_CH_MOD_MD_SEL_BITS_SRAM;
|
||||
DMA_INTEN = 0;
|
||||
DMA_INTST = 0
|
||||
| DMA_INTST_CH0_TC_INTST_BITS_SET
|
||||
| DMA_INTST_CH1_TC_INTST_BITS_SET
|
||||
| DMA_INTST_CH2_TC_INTST_BITS_SET
|
||||
| DMA_INTST_CH3_TC_INTST_BITS_SET
|
||||
| DMA_INTST_CH0_THC_INTST_BITS_SET
|
||||
| DMA_INTST_CH1_THC_INTST_BITS_SET
|
||||
| DMA_INTST_CH2_THC_INTST_BITS_SET
|
||||
| DMA_INTST_CH3_THC_INTST_BITS_SET
|
||||
;
|
||||
| DMA_INTST_CH0_TC_INTST_BITS_SET
|
||||
| DMA_INTST_CH1_TC_INTST_BITS_SET
|
||||
| DMA_INTST_CH2_TC_INTST_BITS_SET
|
||||
| DMA_INTST_CH3_TC_INTST_BITS_SET
|
||||
| DMA_INTST_CH0_THC_INTST_BITS_SET
|
||||
| DMA_INTST_CH1_THC_INTST_BITS_SET
|
||||
| DMA_INTST_CH2_THC_INTST_BITS_SET
|
||||
| DMA_INTST_CH3_THC_INTST_BITS_SET;
|
||||
DMA_CH0->CTR = 0
|
||||
| DMA_CH_CTR_CH_EN_BITS_ENABLE
|
||||
| ((0xFF << DMA_CH_CTR_LENGTH_SHIFT) & DMA_CH_CTR_LENGTH_MASK)
|
||||
| DMA_CH_CTR_LOOP_BITS_ENABLE
|
||||
| DMA_CH_CTR_PRI_BITS_MEDIUM
|
||||
;
|
||||
| DMA_CH_CTR_CH_EN_BITS_ENABLE
|
||||
| ((0xFF << DMA_CH_CTR_LENGTH_SHIFT) & DMA_CH_CTR_LENGTH_MASK)
|
||||
| DMA_CH_CTR_LOOP_BITS_ENABLE
|
||||
| DMA_CH_CTR_PRI_BITS_MEDIUM;
|
||||
UART1->IF = UART_IF_RXTO_BITS_SET;
|
||||
|
||||
DMA_CTR = (DMA_CTR & ~DMA_CTR_DMAEN_MASK) | DMA_CTR_DMAEN_BITS_ENABLE;
|
||||
@@ -84,9 +81,8 @@ void UART_Init(void)
|
||||
UART1->CTRL |= UART_CTRL_UARTEN_BITS_ENABLE;
|
||||
}
|
||||
|
||||
void UART_Send(const void *pBuffer, uint32_t Size)
|
||||
{
|
||||
const uint8_t *pData = (const uint8_t *)pBuffer;
|
||||
void UART_Send(const void *pBuffer, uint32_t Size) {
|
||||
const uint8_t *pData = (const uint8_t *) pBuffer;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < Size; i++) {
|
||||
@@ -96,8 +92,11 @@ void UART_Send(const void *pBuffer, uint32_t Size)
|
||||
}
|
||||
}
|
||||
|
||||
void UART_LogSend(const void *pBuffer, uint32_t Size)
|
||||
{
|
||||
void UART_String(const char *str) {
|
||||
UART_Send(str, strlen(str));
|
||||
}
|
||||
|
||||
void UART_LogSend(const void *pBuffer, uint32_t Size) {
|
||||
if (UART_IsLogEnabled) {
|
||||
UART_Send(pBuffer, Size);
|
||||
}
|
||||
|
@@ -25,6 +25,7 @@ extern uint8_t UART_DMA_Buffer[256];
|
||||
void UART_Init(void);
|
||||
void UART_Send(const void *pBuffer, uint32_t Size);
|
||||
void UART_LogSend(const void *pBuffer, uint32_t Size);
|
||||
void UART_String(const char *str);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -4084,9 +4084,9 @@ called in the following order:
|
||||
a=>b [label="GetVersion ()", textcolor="gray", linecolor="gray"];
|
||||
--- [label="Obtain driver features"];
|
||||
a=>b [label="GetCapabilities (...)", textcolor="gray", linecolor="gray"];
|
||||
--- [label="Setup software resources"];
|
||||
--- [label="Sup software resources"];
|
||||
a=>b [label="Initialize (...)", textcolor="red", linecolor="red"];
|
||||
--- [label="Setup the peripheral"];
|
||||
--- [label="Sup the peripheral"];
|
||||
a=>b [label="PowerControl (ARM_POWER_FULL)", textcolor="red", linecolor="red"];
|
||||
--- [label="Operate with the peripheral"];
|
||||
a=>b [label="Data Transfer Functions"];
|
||||
|
827
external/printf/printf.c
vendored
827
external/printf/printf.c
vendored
@@ -40,7 +40,10 @@
|
||||
// printf_config.h header file
|
||||
// default: undefined
|
||||
#ifdef PRINTF_INCLUDE_CONFIG_H
|
||||
#include "printf_config.h"
|
||||
#define PRINTF_DISABLE_SUPPORT_LONG_LONG
|
||||
#define PRINTF_DISABLE_SUPPORT_EXPONENTIAL
|
||||
#define PRINTF_DISABLE_SUPPORT_PTRDIFF_T
|
||||
#define PRINTF_DISABLE_SUPPORT_FLOAT
|
||||
#endif
|
||||
|
||||
|
||||
@@ -119,185 +122,183 @@
|
||||
|
||||
|
||||
// output function type
|
||||
typedef void (*out_fct_type)(char character, void* buffer, size_t idx, size_t maxlen);
|
||||
typedef void (*out_fct_type)(char character, void *buffer, size_t idx, size_t maxlen);
|
||||
|
||||
|
||||
// wrapper (used as buffer) for output function type
|
||||
typedef struct {
|
||||
void (*fct)(char character, void* arg);
|
||||
void* arg;
|
||||
void (*fct)(char character, void *arg);
|
||||
|
||||
void *arg;
|
||||
} out_fct_wrap_type;
|
||||
|
||||
|
||||
// internal buffer output
|
||||
static inline void _out_buffer(char character, void* buffer, size_t idx, size_t maxlen)
|
||||
{
|
||||
if (idx < maxlen) {
|
||||
((char*)buffer)[idx] = character;
|
||||
}
|
||||
static inline void _out_buffer(char character, void *buffer, size_t idx, size_t maxlen) {
|
||||
if (idx < maxlen) {
|
||||
((char *) buffer)[idx] = character;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// internal null output
|
||||
static inline void _out_null(char character, void* buffer, size_t idx, size_t maxlen)
|
||||
{
|
||||
(void)character; (void)buffer; (void)idx; (void)maxlen;
|
||||
static inline void _out_null(char character, void *buffer, size_t idx, size_t maxlen) {
|
||||
(void) character;
|
||||
(void) buffer;
|
||||
(void) idx;
|
||||
(void) maxlen;
|
||||
}
|
||||
|
||||
|
||||
// internal _putchar wrapper
|
||||
static inline void _out_char(char character, void* buffer, size_t idx, size_t maxlen)
|
||||
{
|
||||
(void)buffer; (void)idx; (void)maxlen;
|
||||
if (character) {
|
||||
_putchar(character);
|
||||
}
|
||||
static inline void _out_char(char character, void *buffer, size_t idx, size_t maxlen) {
|
||||
(void) buffer;
|
||||
(void) idx;
|
||||
(void) maxlen;
|
||||
if (character) {
|
||||
_putchar(character);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// internal output function wrapper
|
||||
static inline void _out_fct(char character, void* buffer, size_t idx, size_t maxlen)
|
||||
{
|
||||
(void)idx; (void)maxlen;
|
||||
if (character) {
|
||||
// buffer is the output fct pointer
|
||||
((out_fct_wrap_type*)buffer)->fct(character, ((out_fct_wrap_type*)buffer)->arg);
|
||||
}
|
||||
static inline void _out_fct(char character, void *buffer, size_t idx, size_t maxlen) {
|
||||
(void) idx;
|
||||
(void) maxlen;
|
||||
if (character) {
|
||||
// buffer is the output fct pointer
|
||||
((out_fct_wrap_type *) buffer)->fct(character, ((out_fct_wrap_type *) buffer)->arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// internal secure strlen
|
||||
// \return The length of the string (excluding the terminating 0) limited by 'maxsize'
|
||||
static inline unsigned int _strnlen_s(const char* str, size_t maxsize)
|
||||
{
|
||||
const char* s;
|
||||
for (s = str; *s && maxsize--; ++s);
|
||||
return (unsigned int)(s - str);
|
||||
static inline unsigned int _strnlen_s(const char *str, size_t maxsize) {
|
||||
const char *s;
|
||||
for (s = str; *s && maxsize--; ++s);
|
||||
return (unsigned int) (s - str);
|
||||
}
|
||||
|
||||
|
||||
// internal test if char is a digit (0-9)
|
||||
// \return true if char is a digit
|
||||
static inline bool _is_digit(char ch)
|
||||
{
|
||||
return (ch >= '0') && (ch <= '9');
|
||||
static inline bool _is_digit(char ch) {
|
||||
return (ch >= '0') && (ch <= '9');
|
||||
}
|
||||
|
||||
|
||||
// internal ASCII string to unsigned int conversion
|
||||
static unsigned int _atoi(const char** str)
|
||||
{
|
||||
unsigned int i = 0U;
|
||||
while (_is_digit(**str)) {
|
||||
i = i * 10U + (unsigned int)(*((*str)++) - '0');
|
||||
}
|
||||
return i;
|
||||
static unsigned int _atoi(const char **str) {
|
||||
unsigned int i = 0U;
|
||||
while (_is_digit(**str)) {
|
||||
i = i * 10U + (unsigned int) (*((*str)++) - '0');
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
// output the specified string in reverse, taking care of any zero-padding
|
||||
static size_t _out_rev(out_fct_type out, char* buffer, size_t idx, size_t maxlen, const char* buf, size_t len, unsigned int width, unsigned int flags)
|
||||
{
|
||||
const size_t start_idx = idx;
|
||||
static size_t
|
||||
_out_rev(out_fct_type out, char *buffer, size_t idx, size_t maxlen, const char *buf, size_t len, unsigned int width,
|
||||
unsigned int flags) {
|
||||
const size_t start_idx = idx;
|
||||
|
||||
// pad spaces up to given width
|
||||
if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) {
|
||||
for (size_t i = len; i < width; i++) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
// pad spaces up to given width
|
||||
if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) {
|
||||
for (size_t i = len; i < width; i++) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reverse string
|
||||
while (len) {
|
||||
out(buf[--len], buffer, idx++, maxlen);
|
||||
}
|
||||
|
||||
// append pad spaces up to given width
|
||||
if (flags & FLAGS_LEFT) {
|
||||
while (idx - start_idx < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
// reverse string
|
||||
while (len) {
|
||||
out(buf[--len], buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
|
||||
return idx;
|
||||
// append pad spaces up to given width
|
||||
if (flags & FLAGS_LEFT) {
|
||||
while (idx - start_idx < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
||||
// internal itoa format
|
||||
static size_t _ntoa_format(out_fct_type out, char* buffer, size_t idx, size_t maxlen, char* buf, size_t len, bool negative, unsigned int base, unsigned int prec, unsigned int width, unsigned int flags)
|
||||
{
|
||||
// pad leading zeros
|
||||
if (!(flags & FLAGS_LEFT)) {
|
||||
if (width && (flags & FLAGS_ZEROPAD) && (negative || (flags & (FLAGS_PLUS | FLAGS_SPACE)))) {
|
||||
width--;
|
||||
static size_t
|
||||
_ntoa_format(out_fct_type out, char *buffer, size_t idx, size_t maxlen, char *buf, size_t len, bool negative,
|
||||
unsigned int base, unsigned int prec, unsigned int width, unsigned int flags) {
|
||||
// pad leading zeros
|
||||
if (!(flags & FLAGS_LEFT)) {
|
||||
if (width && (flags & FLAGS_ZEROPAD) && (negative || (flags & (FLAGS_PLUS | FLAGS_SPACE)))) {
|
||||
width--;
|
||||
}
|
||||
while ((len < prec) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = '0';
|
||||
}
|
||||
while ((flags & FLAGS_ZEROPAD) && (len < width) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = '0';
|
||||
}
|
||||
}
|
||||
while ((len < prec) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = '0';
|
||||
}
|
||||
while ((flags & FLAGS_ZEROPAD) && (len < width) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = '0';
|
||||
}
|
||||
}
|
||||
|
||||
// handle hash
|
||||
if (flags & FLAGS_HASH) {
|
||||
if (!(flags & FLAGS_PRECISION) && len && ((len == prec) || (len == width))) {
|
||||
len--;
|
||||
if (len && (base == 16U)) {
|
||||
len--;
|
||||
}
|
||||
}
|
||||
if ((base == 16U) && !(flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = 'x';
|
||||
}
|
||||
else if ((base == 16U) && (flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = 'X';
|
||||
}
|
||||
else if ((base == 2U) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = 'b';
|
||||
// handle hash
|
||||
if (flags & FLAGS_HASH) {
|
||||
if (!(flags & FLAGS_PRECISION) && len && ((len == prec) || (len == width))) {
|
||||
len--;
|
||||
if (len && (base == 16U)) {
|
||||
len--;
|
||||
}
|
||||
}
|
||||
if ((base == 16U) && !(flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = 'x';
|
||||
} else if ((base == 16U) && (flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = 'X';
|
||||
} else if ((base == 2U) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
|
||||
buf[len++] = 'b';
|
||||
}
|
||||
if (len < PRINTF_NTOA_BUFFER_SIZE) {
|
||||
buf[len++] = '0';
|
||||
}
|
||||
}
|
||||
|
||||
if (len < PRINTF_NTOA_BUFFER_SIZE) {
|
||||
buf[len++] = '0';
|
||||
if (negative) {
|
||||
buf[len++] = '-';
|
||||
} else if (flags & FLAGS_PLUS) {
|
||||
buf[len++] = '+'; // ignore the space if the '+' exists
|
||||
} else if (flags & FLAGS_SPACE) {
|
||||
buf[len++] = ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (len < PRINTF_NTOA_BUFFER_SIZE) {
|
||||
if (negative) {
|
||||
buf[len++] = '-';
|
||||
}
|
||||
else if (flags & FLAGS_PLUS) {
|
||||
buf[len++] = '+'; // ignore the space if the '+' exists
|
||||
}
|
||||
else if (flags & FLAGS_SPACE) {
|
||||
buf[len++] = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
return _out_rev(out, buffer, idx, maxlen, buf, len, width, flags);
|
||||
return _out_rev(out, buffer, idx, maxlen, buf, len, width, flags);
|
||||
}
|
||||
|
||||
|
||||
// internal itoa for 'long' type
|
||||
static size_t _ntoa_long(out_fct_type out, char* buffer, size_t idx, size_t maxlen, unsigned long value, bool negative, unsigned long base, unsigned int prec, unsigned int width, unsigned int flags)
|
||||
{
|
||||
char buf[PRINTF_NTOA_BUFFER_SIZE];
|
||||
size_t len = 0U;
|
||||
static size_t _ntoa_long(out_fct_type out, char *buffer, size_t idx, size_t maxlen, unsigned long value, bool negative,
|
||||
unsigned long base, unsigned int prec, unsigned int width, unsigned int flags) {
|
||||
char buf[PRINTF_NTOA_BUFFER_SIZE];
|
||||
size_t len = 0U;
|
||||
|
||||
// no hash for 0 values
|
||||
if (!value) {
|
||||
flags &= ~FLAGS_HASH;
|
||||
}
|
||||
// no hash for 0 values
|
||||
if (!value) {
|
||||
flags &= ~FLAGS_HASH;
|
||||
}
|
||||
|
||||
// write if precision != 0 and value is != 0
|
||||
if (!(flags & FLAGS_PRECISION) || value) {
|
||||
do {
|
||||
const char digit = (char)(value % base);
|
||||
buf[len++] = digit < 10 ? '0' + digit : (flags & FLAGS_UPPERCASE ? 'A' : 'a') + digit - 10;
|
||||
value /= base;
|
||||
} while (value && (len < PRINTF_NTOA_BUFFER_SIZE));
|
||||
}
|
||||
// write if precision != 0 and value is != 0
|
||||
if (!(flags & FLAGS_PRECISION) || value) {
|
||||
do {
|
||||
const char digit = (char) (value % base);
|
||||
buf[len++] = digit < 10 ? '0' + digit : (flags & FLAGS_UPPERCASE ? 'A' : 'a') + digit - 10;
|
||||
value /= base;
|
||||
} while (value && (len < PRINTF_NTOA_BUFFER_SIZE));
|
||||
}
|
||||
|
||||
return _ntoa_format(out, buffer, idx, maxlen, buf, len, negative, (unsigned int)base, prec, width, flags);
|
||||
return _ntoa_format(out, buffer, idx, maxlen, buf, len, negative, (unsigned int) base, prec, width, flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -574,341 +575,353 @@ static size_t _etoa(out_fct_type out, char* buffer, size_t idx, size_t maxlen, d
|
||||
|
||||
|
||||
// internal vsnprintf
|
||||
static int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen, const char* format, va_list va)
|
||||
{
|
||||
unsigned int flags, width, precision, n;
|
||||
size_t idx = 0U;
|
||||
static int _vsnprintf(out_fct_type out, char *buffer, const size_t maxlen, const char *format, va_list va) {
|
||||
unsigned int flags, width, precision, n;
|
||||
size_t idx = 0U;
|
||||
|
||||
if (!buffer) {
|
||||
// use null output function
|
||||
out = _out_null;
|
||||
}
|
||||
|
||||
while (*format)
|
||||
{
|
||||
// format specifier? %[flags][width][.precision][length]
|
||||
if (*format != '%') {
|
||||
// no
|
||||
out(*format, buffer, idx++, maxlen);
|
||||
format++;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
// yes, evaluate it
|
||||
format++;
|
||||
if (!buffer) {
|
||||
// use null output function
|
||||
out = _out_null;
|
||||
}
|
||||
|
||||
// evaluate flags
|
||||
flags = 0U;
|
||||
do {
|
||||
switch (*format) {
|
||||
case '0': flags |= FLAGS_ZEROPAD; format++; n = 1U; break;
|
||||
case '-': flags |= FLAGS_LEFT; format++; n = 1U; break;
|
||||
case '+': flags |= FLAGS_PLUS; format++; n = 1U; break;
|
||||
case ' ': flags |= FLAGS_SPACE; format++; n = 1U; break;
|
||||
case '#': flags |= FLAGS_HASH; format++; n = 1U; break;
|
||||
default : n = 0U; break;
|
||||
}
|
||||
} while (n);
|
||||
|
||||
// evaluate width field
|
||||
width = 0U;
|
||||
if (_is_digit(*format)) {
|
||||
width = _atoi(&format);
|
||||
}
|
||||
else if (*format == '*') {
|
||||
const int w = va_arg(va, int);
|
||||
if (w < 0) {
|
||||
flags |= FLAGS_LEFT; // reverse padding
|
||||
width = (unsigned int)-w;
|
||||
}
|
||||
else {
|
||||
width = (unsigned int)w;
|
||||
}
|
||||
format++;
|
||||
}
|
||||
|
||||
// evaluate precision field
|
||||
precision = 0U;
|
||||
if (*format == '.') {
|
||||
flags |= FLAGS_PRECISION;
|
||||
format++;
|
||||
if (_is_digit(*format)) {
|
||||
precision = _atoi(&format);
|
||||
}
|
||||
else if (*format == '*') {
|
||||
const int prec = (int)va_arg(va, int);
|
||||
precision = prec > 0 ? (unsigned int)prec : 0U;
|
||||
format++;
|
||||
}
|
||||
}
|
||||
|
||||
// evaluate length field
|
||||
switch (*format) {
|
||||
case 'l' :
|
||||
flags |= FLAGS_LONG;
|
||||
format++;
|
||||
if (*format == 'l') {
|
||||
flags |= FLAGS_LONG_LONG;
|
||||
format++;
|
||||
while (*format) {
|
||||
// format specifier? %[flags][width][.precision][length]
|
||||
if (*format != '%') {
|
||||
// no
|
||||
out(*format, buffer, idx++, maxlen);
|
||||
format++;
|
||||
continue;
|
||||
} else {
|
||||
// yes, evaluate it
|
||||
format++;
|
||||
}
|
||||
break;
|
||||
case 'h' :
|
||||
flags |= FLAGS_SHORT;
|
||||
format++;
|
||||
if (*format == 'h') {
|
||||
flags |= FLAGS_CHAR;
|
||||
format++;
|
||||
|
||||
// evaluate flags
|
||||
flags = 0U;
|
||||
do {
|
||||
switch (*format) {
|
||||
case '0':
|
||||
flags |= FLAGS_ZEROPAD;
|
||||
format++;
|
||||
n = 1U;
|
||||
break;
|
||||
case '-':
|
||||
flags |= FLAGS_LEFT;
|
||||
format++;
|
||||
n = 1U;
|
||||
break;
|
||||
case '+':
|
||||
flags |= FLAGS_PLUS;
|
||||
format++;
|
||||
n = 1U;
|
||||
break;
|
||||
case ' ':
|
||||
flags |= FLAGS_SPACE;
|
||||
format++;
|
||||
n = 1U;
|
||||
break;
|
||||
case '#':
|
||||
flags |= FLAGS_HASH;
|
||||
format++;
|
||||
n = 1U;
|
||||
break;
|
||||
default :
|
||||
n = 0U;
|
||||
break;
|
||||
}
|
||||
} while (n);
|
||||
|
||||
// evaluate width field
|
||||
width = 0U;
|
||||
if (_is_digit(*format)) {
|
||||
width = _atoi(&format);
|
||||
} else if (*format == '*') {
|
||||
const int w = va_arg(va, int);
|
||||
if (w < 0) {
|
||||
flags |= FLAGS_LEFT; // reverse padding
|
||||
width = (unsigned int) -w;
|
||||
} else {
|
||||
width = (unsigned int) w;
|
||||
}
|
||||
format++;
|
||||
}
|
||||
break;
|
||||
|
||||
// evaluate precision field
|
||||
precision = 0U;
|
||||
if (*format == '.') {
|
||||
flags |= FLAGS_PRECISION;
|
||||
format++;
|
||||
if (_is_digit(*format)) {
|
||||
precision = _atoi(&format);
|
||||
} else if (*format == '*') {
|
||||
const int prec = (int) va_arg(va, int);
|
||||
precision = prec > 0 ? (unsigned int) prec : 0U;
|
||||
format++;
|
||||
}
|
||||
}
|
||||
|
||||
// evaluate length field
|
||||
switch (*format) {
|
||||
case 'l' :
|
||||
flags |= FLAGS_LONG;
|
||||
format++;
|
||||
if (*format == 'l') {
|
||||
flags |= FLAGS_LONG_LONG;
|
||||
format++;
|
||||
}
|
||||
break;
|
||||
case 'h' :
|
||||
flags |= FLAGS_SHORT;
|
||||
format++;
|
||||
if (*format == 'h') {
|
||||
flags |= FLAGS_CHAR;
|
||||
format++;
|
||||
}
|
||||
break;
|
||||
#if defined(PRINTF_SUPPORT_PTRDIFF_T)
|
||||
case 't' :
|
||||
flags |= (sizeof(ptrdiff_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG);
|
||||
format++;
|
||||
break;
|
||||
case 't' :
|
||||
flags |= (sizeof(ptrdiff_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG);
|
||||
format++;
|
||||
break;
|
||||
#endif
|
||||
case 'j' :
|
||||
flags |= (sizeof(intmax_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG);
|
||||
format++;
|
||||
break;
|
||||
case 'z' :
|
||||
flags |= (sizeof(size_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG);
|
||||
format++;
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
// evaluate specifier
|
||||
switch (*format) {
|
||||
case 'd' :
|
||||
case 'i' :
|
||||
case 'u' :
|
||||
case 'x' :
|
||||
case 'X' :
|
||||
case 'o' :
|
||||
case 'b' : {
|
||||
// set the base
|
||||
unsigned int base;
|
||||
if (*format == 'x' || *format == 'X') {
|
||||
base = 16U;
|
||||
}
|
||||
else if (*format == 'o') {
|
||||
base = 8U;
|
||||
}
|
||||
else if (*format == 'b') {
|
||||
base = 2U;
|
||||
}
|
||||
else {
|
||||
base = 10U;
|
||||
flags &= ~FLAGS_HASH; // no hash for dec format
|
||||
}
|
||||
// uppercase
|
||||
if (*format == 'X') {
|
||||
flags |= FLAGS_UPPERCASE;
|
||||
case 'j' :
|
||||
flags |= (sizeof(intmax_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG);
|
||||
format++;
|
||||
break;
|
||||
case 'z' :
|
||||
flags |= (sizeof(size_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG);
|
||||
format++;
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
// no plus or space flag for u, x, X, o, b
|
||||
if ((*format != 'i') && (*format != 'd')) {
|
||||
flags &= ~(FLAGS_PLUS | FLAGS_SPACE);
|
||||
}
|
||||
// evaluate specifier
|
||||
switch (*format) {
|
||||
case 'd' :
|
||||
case 'i' :
|
||||
case 'u' :
|
||||
case 'x' :
|
||||
case 'X' :
|
||||
case 'o' :
|
||||
case 'b' : {
|
||||
// set the base
|
||||
unsigned int base;
|
||||
if (*format == 'x' || *format == 'X') {
|
||||
base = 16U;
|
||||
} else if (*format == 'o') {
|
||||
base = 8U;
|
||||
} else if (*format == 'b') {
|
||||
base = 2U;
|
||||
} else {
|
||||
base = 10U;
|
||||
flags &= ~FLAGS_HASH; // no hash for dec format
|
||||
}
|
||||
// uppercase
|
||||
if (*format == 'X') {
|
||||
flags |= FLAGS_UPPERCASE;
|
||||
}
|
||||
|
||||
// ignore '0' flag when precision is given
|
||||
if (flags & FLAGS_PRECISION) {
|
||||
flags &= ~FLAGS_ZEROPAD;
|
||||
}
|
||||
// no plus or space flag for u, x, X, o, b
|
||||
if ((*format != 'i') && (*format != 'd')) {
|
||||
flags &= ~(FLAGS_PLUS | FLAGS_SPACE);
|
||||
}
|
||||
|
||||
// convert the integer
|
||||
if ((*format == 'i') || (*format == 'd')) {
|
||||
// signed
|
||||
if (flags & FLAGS_LONG_LONG) {
|
||||
// ignore '0' flag when precision is given
|
||||
if (flags & FLAGS_PRECISION) {
|
||||
flags &= ~FLAGS_ZEROPAD;
|
||||
}
|
||||
|
||||
// convert the integer
|
||||
if ((*format == 'i') || (*format == 'd')) {
|
||||
// signed
|
||||
if (flags & FLAGS_LONG_LONG) {
|
||||
#if defined(PRINTF_SUPPORT_LONG_LONG)
|
||||
const long long value = va_arg(va, long long);
|
||||
idx = _ntoa_long_long(out, buffer, idx, maxlen, (unsigned long long)(value > 0 ? value : 0 - value), value < 0, base, precision, width, flags);
|
||||
const long long value = va_arg(va, long long);
|
||||
idx = _ntoa_long_long(out, buffer, idx, maxlen, (unsigned long long)(value > 0 ? value : 0 - value), value < 0, base, precision, width, flags);
|
||||
#endif
|
||||
}
|
||||
else if (flags & FLAGS_LONG) {
|
||||
const long value = va_arg(va, long);
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned long)(value > 0 ? value : 0 - value), value < 0, base, precision, width, flags);
|
||||
}
|
||||
else {
|
||||
const int value = (flags & FLAGS_CHAR) ? (char)va_arg(va, int) : (flags & FLAGS_SHORT) ? (short int)va_arg(va, int) : va_arg(va, int);
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned int)(value > 0 ? value : 0 - value), value < 0, base, precision, width, flags);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// unsigned
|
||||
if (flags & FLAGS_LONG_LONG) {
|
||||
} else if (flags & FLAGS_LONG) {
|
||||
const long value = va_arg(va, long);
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned long) (value > 0 ? value : 0 - value),
|
||||
value < 0, base, precision, width, flags);
|
||||
} else {
|
||||
const int value = (flags & FLAGS_CHAR) ? (char) va_arg(va, int) : (flags & FLAGS_SHORT)
|
||||
? (short int) va_arg(va, int)
|
||||
: va_arg(va, int);
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned int) (value > 0 ? value : 0 - value),
|
||||
value < 0, base, precision, width, flags);
|
||||
}
|
||||
} else {
|
||||
// unsigned
|
||||
if (flags & FLAGS_LONG_LONG) {
|
||||
#if defined(PRINTF_SUPPORT_LONG_LONG)
|
||||
idx = _ntoa_long_long(out, buffer, idx, maxlen, va_arg(va, unsigned long long), false, base, precision, width, flags);
|
||||
idx = _ntoa_long_long(out, buffer, idx, maxlen, va_arg(va, unsigned long long), false, base, precision, width, flags);
|
||||
#endif
|
||||
}
|
||||
else if (flags & FLAGS_LONG) {
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, va_arg(va, unsigned long), false, base, precision, width, flags);
|
||||
}
|
||||
else {
|
||||
const unsigned int value = (flags & FLAGS_CHAR) ? (unsigned char)va_arg(va, unsigned int) : (flags & FLAGS_SHORT) ? (unsigned short int)va_arg(va, unsigned int) : va_arg(va, unsigned int);
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, value, false, base, precision, width, flags);
|
||||
}
|
||||
}
|
||||
format++;
|
||||
break;
|
||||
}
|
||||
} else if (flags & FLAGS_LONG) {
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, va_arg(va, unsigned long), false, base, precision,
|
||||
width, flags);
|
||||
} else {
|
||||
const unsigned int value = (flags & FLAGS_CHAR) ? (unsigned char) va_arg(va, unsigned int)
|
||||
: (flags & FLAGS_SHORT)
|
||||
? (unsigned short int) va_arg(va,
|
||||
unsigned int)
|
||||
: va_arg(va, unsigned int);
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, value, false, base, precision, width, flags);
|
||||
}
|
||||
}
|
||||
format++;
|
||||
break;
|
||||
}
|
||||
#if defined(PRINTF_SUPPORT_FLOAT)
|
||||
case 'f' :
|
||||
case 'F' :
|
||||
if (*format == 'F') flags |= FLAGS_UPPERCASE;
|
||||
idx = _ftoa(out, buffer, idx, maxlen, va_arg(va, double), precision, width, flags);
|
||||
format++;
|
||||
break;
|
||||
case 'f' :
|
||||
case 'F' :
|
||||
if (*format == 'F') flags |= FLAGS_UPPERCASE;
|
||||
idx = _ftoa(out, buffer, idx, maxlen, va_arg(va, double), precision, width, flags);
|
||||
format++;
|
||||
break;
|
||||
#if defined(PRINTF_SUPPORT_EXPONENTIAL)
|
||||
case 'e':
|
||||
case 'E':
|
||||
case 'g':
|
||||
case 'G':
|
||||
if ((*format == 'g')||(*format == 'G')) flags |= FLAGS_ADAPT_EXP;
|
||||
if ((*format == 'E')||(*format == 'G')) flags |= FLAGS_UPPERCASE;
|
||||
idx = _etoa(out, buffer, idx, maxlen, va_arg(va, double), precision, width, flags);
|
||||
format++;
|
||||
break;
|
||||
case 'e':
|
||||
case 'E':
|
||||
case 'g':
|
||||
case 'G':
|
||||
if ((*format == 'g')||(*format == 'G')) flags |= FLAGS_ADAPT_EXP;
|
||||
if ((*format == 'E')||(*format == 'G')) flags |= FLAGS_UPPERCASE;
|
||||
idx = _etoa(out, buffer, idx, maxlen, va_arg(va, double), precision, width, flags);
|
||||
format++;
|
||||
break;
|
||||
#endif // PRINTF_SUPPORT_EXPONENTIAL
|
||||
#endif // PRINTF_SUPPORT_FLOAT
|
||||
case 'c' : {
|
||||
unsigned int l = 1U;
|
||||
// pre padding
|
||||
if (!(flags & FLAGS_LEFT)) {
|
||||
while (l++ < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
// char output
|
||||
out((char)va_arg(va, int), buffer, idx++, maxlen);
|
||||
// post padding
|
||||
if (flags & FLAGS_LEFT) {
|
||||
while (l++ < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
format++;
|
||||
break;
|
||||
}
|
||||
case 'c' : {
|
||||
unsigned int l = 1U;
|
||||
// pre padding
|
||||
if (!(flags & FLAGS_LEFT)) {
|
||||
while (l++ < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
// char output
|
||||
out((char) va_arg(va, int), buffer, idx++, maxlen);
|
||||
// post padding
|
||||
if (flags & FLAGS_LEFT) {
|
||||
while (l++ < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
format++;
|
||||
break;
|
||||
}
|
||||
|
||||
case 's' : {
|
||||
const char* p = va_arg(va, char*);
|
||||
unsigned int l = _strnlen_s(p, precision ? precision : (size_t)-1);
|
||||
// pre padding
|
||||
if (flags & FLAGS_PRECISION) {
|
||||
l = (l < precision ? l : precision);
|
||||
}
|
||||
if (!(flags & FLAGS_LEFT)) {
|
||||
while (l++ < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
// string output
|
||||
while ((*p != 0) && (!(flags & FLAGS_PRECISION) || precision--)) {
|
||||
out(*(p++), buffer, idx++, maxlen);
|
||||
}
|
||||
// post padding
|
||||
if (flags & FLAGS_LEFT) {
|
||||
while (l++ < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
format++;
|
||||
break;
|
||||
}
|
||||
case 's' : {
|
||||
const char *p = va_arg(va, char*);
|
||||
unsigned int l = _strnlen_s(p, precision ? precision : (size_t) -1);
|
||||
// pre padding
|
||||
if (flags & FLAGS_PRECISION) {
|
||||
l = (l < precision ? l : precision);
|
||||
}
|
||||
if (!(flags & FLAGS_LEFT)) {
|
||||
while (l++ < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
// string output
|
||||
while ((*p != 0) && (!(flags & FLAGS_PRECISION) || precision--)) {
|
||||
out(*(p++), buffer, idx++, maxlen);
|
||||
}
|
||||
// post padding
|
||||
if (flags & FLAGS_LEFT) {
|
||||
while (l++ < width) {
|
||||
out(' ', buffer, idx++, maxlen);
|
||||
}
|
||||
}
|
||||
format++;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'p' : {
|
||||
width = sizeof(void*) * 2U;
|
||||
flags |= FLAGS_ZEROPAD | FLAGS_UPPERCASE;
|
||||
case 'p' : {
|
||||
width = sizeof(void *) * 2U;
|
||||
flags |= FLAGS_ZEROPAD | FLAGS_UPPERCASE;
|
||||
#if defined(PRINTF_SUPPORT_LONG_LONG)
|
||||
const bool is_ll = sizeof(uintptr_t) == sizeof(long long);
|
||||
if (is_ll) {
|
||||
idx = _ntoa_long_long(out, buffer, idx, maxlen, (uintptr_t)va_arg(va, void*), false, 16U, precision, width, flags);
|
||||
}
|
||||
else {
|
||||
const bool is_ll = sizeof(uintptr_t) == sizeof(long long);
|
||||
if (is_ll) {
|
||||
idx = _ntoa_long_long(out, buffer, idx, maxlen, (uintptr_t)va_arg(va, void*), false, 16U, precision, width, flags);
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned long)((uintptr_t)va_arg(va, void*)), false, 16U, precision, width, flags);
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned long) ((uintptr_t) va_arg(va, void*)), false, 16U,
|
||||
precision, width, flags);
|
||||
#if defined(PRINTF_SUPPORT_LONG_LONG)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
format++;
|
||||
break;
|
||||
}
|
||||
format++;
|
||||
break;
|
||||
}
|
||||
|
||||
case '%' :
|
||||
out('%', buffer, idx++, maxlen);
|
||||
format++;
|
||||
break;
|
||||
case '%' :
|
||||
out('%', buffer, idx++, maxlen);
|
||||
format++;
|
||||
break;
|
||||
|
||||
default :
|
||||
out(*format, buffer, idx++, maxlen);
|
||||
format++;
|
||||
break;
|
||||
default :
|
||||
out(*format, buffer, idx++, maxlen);
|
||||
format++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// termination
|
||||
out((char)0, buffer, idx < maxlen ? idx : maxlen - 1U, maxlen);
|
||||
// termination
|
||||
out((char) 0, buffer, idx < maxlen ? idx : maxlen - 1U, maxlen);
|
||||
|
||||
// return written chars without terminating \0
|
||||
return (int)idx;
|
||||
// return written chars without terminating \0
|
||||
return (int) idx;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int printf_(const char* format, ...)
|
||||
{
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
char buffer[1];
|
||||
const int ret = _vsnprintf(_out_char, buffer, (size_t)-1, format, va);
|
||||
va_end(va);
|
||||
return ret;
|
||||
int printf_(const char *format, ...) {
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
char buffer[1];
|
||||
const int ret = _vsnprintf(_out_char, buffer, (size_t) -1, format, va);
|
||||
va_end(va);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int sprintf_(char* buffer, const char* format, ...)
|
||||
{
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
const int ret = _vsnprintf(_out_buffer, buffer, (size_t)-1, format, va);
|
||||
va_end(va);
|
||||
return ret;
|
||||
int sprintf_(char *buffer, const char *format, ...) {
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
const int ret = _vsnprintf(_out_buffer, buffer, (size_t) -1, format, va);
|
||||
va_end(va);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int snprintf_(char* buffer, size_t count, const char* format, ...)
|
||||
{
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
const int ret = _vsnprintf(_out_buffer, buffer, count, format, va);
|
||||
va_end(va);
|
||||
return ret;
|
||||
int snprintf_(char *buffer, size_t count, const char *format, ...) {
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
const int ret = _vsnprintf(_out_buffer, buffer, count, format, va);
|
||||
va_end(va);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int vprintf_(const char* format, va_list va)
|
||||
{
|
||||
char buffer[1];
|
||||
return _vsnprintf(_out_char, buffer, (size_t)-1, format, va);
|
||||
int vprintf_(const char *format, va_list va) {
|
||||
char buffer[1];
|
||||
return _vsnprintf(_out_char, buffer, (size_t) -1, format, va);
|
||||
}
|
||||
|
||||
|
||||
int vsnprintf_(char* buffer, size_t count, const char* format, va_list va)
|
||||
{
|
||||
return _vsnprintf(_out_buffer, buffer, count, format, va);
|
||||
int vsnprintf_(char *buffer, size_t count, const char *format, va_list va) {
|
||||
return _vsnprintf(_out_buffer, buffer, count, format, va);
|
||||
}
|
||||
|
||||
|
||||
int fctprintf(void (*out)(char character, void* arg), void* arg, const char* format, ...)
|
||||
{
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
const out_fct_wrap_type out_fct_wrap = { out, arg };
|
||||
const int ret = _vsnprintf(_out_fct, (char*)(uintptr_t)&out_fct_wrap, (size_t)-1, format, va);
|
||||
va_end(va);
|
||||
return ret;
|
||||
int fctprintf(void (*out)(char character, void *arg), void *arg, const char *format, ...) {
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
const out_fct_wrap_type out_fct_wrap = {out, arg};
|
||||
const int ret = _vsnprintf(_out_fct, (char *) (uintptr_t) &out_fct_wrap, (size_t) -1, format, va);
|
||||
va_end(va);
|
||||
return ret;
|
||||
}
|
||||
|
420
font.c
420
font.c
@@ -18,202 +18,202 @@
|
||||
|
||||
// removed last and middle column which was all 0x00
|
||||
// also the space char is not needed
|
||||
const uint8_t gFontBig[95 - 1][16 - 2] =
|
||||
{
|
||||
#if 0
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // ' '
|
||||
{0x00, 0x00, 0x70, 0xF8, 0xF8, 0x70, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x1B, 0x1B, 0x00, 0x00}, // , 0x00}, // '!'
|
||||
{0x00, 0x1E, 0x3E, 0x00, 0x00, 0x3E, 0x1E, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '"'
|
||||
{0x40, 0xF0, 0xF0, 0x40, 0xF0, 0xF0, 0x40, /*0x00,*/ 0x04, 0x1F, 0x1F, 0x04, 0x1F, 0x1F, 0x04}, // , 0x00}, // '#'
|
||||
{0x70, 0xF8, 0x88, 0x8F, 0x8F, 0x98, 0x30, /*0x00,*/ 0x06, 0x0C, 0x08, 0x38, 0x38, 0x0F, 0x07}, // , 0x00}, // '$'
|
||||
{0x60, 0x60, 0x00, 0x00, 0x80, 0xC0, 0x60, /*0x00,*/ 0x18, 0x0C, 0x06, 0x03, 0x01, 0x18, 0x18}, // , 0x00}, // '%'
|
||||
{0x00, 0xB0, 0xF8, 0xC8, 0x78, 0xB0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x11, 0x0F, 0x1F, 0x10}, // , 0x00}, // '&'
|
||||
{0x00, 0x20, 0x3E, 0x1E, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '''
|
||||
{0x00, 0x00, 0xE0, 0xF0, 0x18, 0x08, 0x00, /*0x00,*/ 0x00, 0x00, 0x07, 0x0F, 0x18, 0x10, 0x00}, // , 0x00}, // '('
|
||||
{0x00, 0x00, 0x08, 0x18, 0xF0, 0xE0, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x18, 0x0F, 0x07, 0x00}, // , 0x00}, // ')'
|
||||
{0x00, 0x40, 0xC0, 0x80, 0x80, 0xC0, 0x40, /*0x00,*/ 0x01, 0x05, 0x07, 0x03, 0x03, 0x07, 0x05}, // , 0x01}, // '*'
|
||||
{0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, /*0x00,*/ 0x00, 0x01, 0x01, 0x07, 0x07, 0x01, 0x01}, // , 0x00}, // '+'
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x20, 0x3C, 0x1C, 0x00, 0x00}, // , 0x00}, // ','
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, // , 0x00}, // '-'
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00}, // , 0x00}, // '.'
|
||||
{0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, /*0x00,*/ 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00, 0x00}, // , 0x00}, // '/'
|
||||
{0xF0, 0xF8, 0x08, 0x88, 0x48, 0xF8, 0xF0, /*0x00,*/ 0x0F, 0x1F, 0x12, 0x11, 0x10, 0x1F, 0x0F}, // , 0x00}, // '0'
|
||||
{0x00, 0x20, 0x30, 0xF8, 0xF8, 0x00, 0x00, /*0x00,*/ 0x00, 0x10, 0x10, 0x1F, 0x1F, 0x10, 0x10}, // , 0x00}, // '1'
|
||||
{0x10, 0x18, 0x08, 0x88, 0xC8, 0x78, 0x30, /*0x00,*/ 0x1C, 0x1E, 0x13, 0x11, 0x10, 0x18, 0x18}, // , 0x00}, // '2'
|
||||
{0x10, 0x18, 0x88, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x08, 0x18, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // '3'
|
||||
{0x80, 0xC0, 0x60, 0x30, 0xF8, 0xF8, 0x00, /*0x00,*/ 0x01, 0x01, 0x01, 0x11, 0x1F, 0x1F, 0x11}, // , 0x00}, // '4'
|
||||
{0xF8, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x08, /*0x00,*/ 0x08, 0x18, 0x10, 0x10, 0x11, 0x1F, 0x0F}, // , 0x00}, // '5'
|
||||
{0xE0, 0xF0, 0x98, 0x88, 0x88, 0x80, 0x00, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // '6'
|
||||
{0x18, 0x18, 0x08, 0x08, 0x88, 0xF8, 0x78, /*0x00,*/ 0x00, 0x00, 0x1E, 0x1F, 0x01, 0x00, 0x00}, // , 0x00}, // '7'
|
||||
{0x70, 0xF8, 0x88, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // '8'
|
||||
{0x70, 0xF8, 0x88, 0x88, 0x88, 0xF8, 0xF0, /*0x00,*/ 0x00, 0x10, 0x10, 0x10, 0x18, 0x0F, 0x07}, // , 0x00}, // '9'
|
||||
{0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00}, // , 0x00}, // ':'
|
||||
{0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1C, 0x0C, 0x00, 0x00}, // , 0x00}, // ';'
|
||||
{0x00, 0x00, 0x80, 0xC0, 0x60, 0x30, 0x10, /*0x00,*/ 0x00, 0x01, 0x03, 0x06, 0x0C, 0x18, 0x10}, // , 0x00}, // '<'
|
||||
{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, /*0x00,*/ 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04}, // , 0x00}, // '='
|
||||
{0x00, 0x10, 0x30, 0x60, 0xC0, 0x80, 0x00, /*0x00,*/ 0x00, 0x10, 0x18, 0x0C, 0x06, 0x03, 0x01}, // , 0x00}, // '>'
|
||||
{0x30, 0x38, 0x08, 0x88, 0xC8, 0x78, 0x30, /*0x00,*/ 0x00, 0x00, 0x00, 0x1B, 0x1B, 0x00, 0x00}, // , 0x00}, // '?'
|
||||
{0xE0, 0xF0, 0x10, 0x90, 0x90, 0xF0, 0xE0, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x17, 0x17, 0x17, 0x03}, // , 0x00}, // '@'
|
||||
{0xC0, 0xE0, 0x30, 0x18, 0x30, 0xE0, 0xC0, /*0x00,*/ 0x1F, 0x1F, 0x01, 0x01, 0x01, 0x1F, 0x1F}, // , 0x00}, // 'A'
|
||||
{0x08, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'B'
|
||||
{0xE0, 0xF0, 0x18, 0x08, 0x08, 0x18, 0x30, /*0x00,*/ 0x07, 0x0F, 0x18, 0x10, 0x10, 0x18, 0x0C}, // , 0x00}, // 'C'
|
||||
{0x08, 0xF8, 0xF8, 0x08, 0x18, 0xF0, 0xE0, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x18, 0x0F, 0x07}, // , 0x00}, // 'D'
|
||||
{0x08, 0xF8, 0xF8, 0x88, 0xC8, 0x18, 0x38, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x11, 0x18, 0x1C}, // , 0x00}, // 'E'
|
||||
{0x08, 0xF8, 0xF8, 0x88, 0xC8, 0x18, 0x38, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x01, 0x00, 0x00}, // , 0x00}, // 'F'
|
||||
{0xE0, 0xF0, 0x18, 0x08, 0x08, 0x18, 0x30, /*0x00,*/ 0x07, 0x0F, 0x18, 0x11, 0x11, 0x0F, 0x1F}, // , 0x00}, // 'G'
|
||||
{0xF8, 0xF8, 0x80, 0x80, 0x80, 0xF8, 0xF8, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'H'
|
||||
{0x00, 0x00, 0x08, 0xF8, 0xF8, 0x08, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'I'
|
||||
{0x00, 0x00, 0x00, 0x08, 0xF8, 0xF8, 0x08, /*0x00,*/ 0x0E, 0x1E, 0x10, 0x10, 0x1F, 0x0F, 0x00}, // , 0x00}, // 'J'
|
||||
{0x08, 0xF8, 0xF8, 0x80, 0xE0, 0x78, 0x18, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x01, 0x03, 0x1E, 0x1C}, // , 0x00}, // 'K'
|
||||
{0x08, 0xF8, 0xF8, 0x08, 0x00, 0x00, 0x00, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x10, 0x18, 0x1C}, // , 0x00}, // 'L'
|
||||
{0xF8, 0xF8, 0x70, 0xE0, 0x70, 0xF8, 0xF8, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'M'
|
||||
{0xF8, 0xF8, 0x70, 0xE0, 0xC0, 0xF8, 0xF8, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x00, 0x01, 0x1F, 0x1F}, // , 0x00}, // 'N'
|
||||
{0xE0, 0xF0, 0x18, 0x08, 0x18, 0xF0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x18, 0x10, 0x18, 0x0F, 0x07}, // , 0x00}, // 'O'
|
||||
{0x08, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x00, 0x00, 0x00}, // , 0x00}, // 'P'
|
||||
{0xF0, 0xF8, 0x08, 0x08, 0x08, 0xF8, 0xF0, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x1C, 0x78, 0x7F, 0x4F}, // , 0x00}, // 'Q'
|
||||
{0x08, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x00, 0x01, 0x1F, 0x1E}, // , 0x00}, // 'R'
|
||||
{0x30, 0x78, 0xC8, 0x88, 0x88, 0x38, 0x30, /*0x00,*/ 0x0C, 0x1C, 0x10, 0x10, 0x11, 0x1F, 0x0E}, // , 0x00}, // 'S'
|
||||
{0x00, 0x38, 0x18, 0xF8, 0xF8, 0x18, 0x38, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'T'
|
||||
{0xF8, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'U'
|
||||
{0xF8, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, /*0x00,*/ 0x03, 0x07, 0x0C, 0x18, 0x0C, 0x07, 0x03}, // , 0x00}, // 'V'
|
||||
{0xF8, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, /*0x00,*/ 0x07, 0x1F, 0x1C, 0x07, 0x1C, 0x1F, 0x07}, // , 0x00}, // 'W'
|
||||
{0x18, 0x78, 0xE0, 0x80, 0xE0, 0x78, 0x18, /*0x00,*/ 0x18, 0x1E, 0x07, 0x01, 0x07, 0x1E, 0x18}, // , 0x00}, // 'X'
|
||||
{0x00, 0x78, 0xF8, 0x80, 0x80, 0xF8, 0x78, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'Y'
|
||||
{0x38, 0x18, 0x08, 0x88, 0xC8, 0x78, 0x38, /*0x00,*/ 0x1C, 0x1E, 0x13, 0x11, 0x10, 0x18, 0x1C}, // , 0x00}, // 'Z'
|
||||
{0x00, 0x00, 0xF8, 0xF8, 0x08, 0x08, 0x00, /*0x00,*/ 0x00, 0x00, 0x1F, 0x1F, 0x10, 0x10, 0x00}, // , 0x00}, // '['
|
||||
{0x70, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x01, 0x03, 0x07, 0x0E, 0x1C}, // , 0x00}, // '"\'
|
||||
{0x00, 0x00, 0x08, 0x08, 0xF8, 0xF8, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x10, 0x1F, 0x1F, 0x00}, // , 0x00}, // ']'
|
||||
{0x10, 0x18, 0x0E, 0x07, 0x0E, 0x18, 0x10, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '^'
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40}, // , 0x40}, // '_'
|
||||
{0x00, 0x00, 0x07, 0x0F, 0x08, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '`'
|
||||
{0x00, 0x40, 0x40, 0x40, 0xC0, 0x80, 0x00, /*0x00,*/ 0x0E, 0x1F, 0x11, 0x11, 0x0F, 0x1F, 0x10}, // , 0x00}, // 'a'
|
||||
{0x08, 0xF8, 0xF8, 0x40, 0xC0, 0x80, 0x00, /*0x00,*/ 0x10, 0x1F, 0x0F, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'b'
|
||||
{0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x18, 0x08}, // , 0x00}, // 'c'
|
||||
{0x00, 0x80, 0xC0, 0x48, 0xF8, 0xF8, 0x00, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x0F, 0x1F, 0x10}, // , 0x00}, // 'd'
|
||||
{0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x11, 0x11, 0x11, 0x19, 0x09}, // , 0x00}, // 'e'
|
||||
{0x80, 0xF0, 0xF8, 0x88, 0x18, 0x30, 0x00, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x00, 0x00, 0x00}, // , 0x00}, // 'f'
|
||||
{0x80, 0xC0, 0x40, 0x40, 0x80, 0xC0, 0x40, /*0x00,*/ 0x4F, 0xDF, 0x90, 0x90, 0xFF, 0x7F, 0x00}, // , 0x00}, // 'g'
|
||||
{0x08, 0xF8, 0xF8, 0x80, 0x40, 0xC0, 0x80, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'h'
|
||||
{0x00, 0x00, 0x40, 0xD8, 0xD8, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'i'
|
||||
{0x00, 0x00, 0x00, 0x00, 0x40, 0xD8, 0xD8, /*0x00,*/ 0x00, 0x60, 0xE0, 0x80, 0x80, 0xFF, 0x7F}, // , 0x00}, // 'j'
|
||||
{0x08, 0xF8, 0xF8, 0x00, 0x80, 0xC0, 0x40, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x03, 0x07, 0x1C, 0x18}, // , 0x00}, // 'k'
|
||||
{0x00, 0x00, 0x08, 0xF8, 0xF8, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'l'
|
||||
{0xC0, 0xC0, 0xC0, 0x80, 0xC0, 0xC0, 0x80, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x1F, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'm'
|
||||
{0x40, 0xC0, 0x80, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x00, 0x1F, 0x1F, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'n'
|
||||
{0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'o'
|
||||
{0x40, 0xC0, 0x80, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x80, 0xFF, 0xFF, 0x90, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'p'
|
||||
{0x80, 0xC0, 0x40, 0x40, 0x80, 0xC0, 0x40, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x90, 0xFF, 0xFF, 0x80}, // , 0x00}, // 'q'
|
||||
{0x40, 0xC0, 0x80, 0xC0, 0x40, 0xC0, 0x80, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x00, 0x00, 0x01}, // , 0x00}, // 'r'
|
||||
{0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x08, 0x19, 0x13, 0x12, 0x16, 0x1C, 0x08}, // , 0x00}, // 's'
|
||||
{0x40, 0x40, 0xF0, 0xF8, 0x40, 0x40, 0x00, /*0x00,*/ 0x00, 0x00, 0x0F, 0x1F, 0x10, 0x18, 0x08}, // , 0x00}, // 't'
|
||||
{0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x0F, 0x1F, 0x10}, // , 0x00}, // 'u'
|
||||
{0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, /*0x00,*/ 0x00, 0x07, 0x0F, 0x18, 0x18, 0x0F, 0x07}, // , 0x00}, // 'v'
|
||||
{0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, /*0x00,*/ 0x0F, 0x1F, 0x18, 0x0E, 0x18, 0x1F, 0x0F}, // , 0x00}, // 'w'
|
||||
{0x40, 0xC0, 0x80, 0x00, 0x80, 0xC0, 0x40, /*0x00,*/ 0x10, 0x18, 0x0F, 0x07, 0x0F, 0x18, 0x10}, // , 0x00}, // 'x'
|
||||
{0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, /*0x00,*/ 0x8F, 0x9F, 0x90, 0x90, 0xD0, 0x7F, 0x3F}, // , 0x00}, // 'y'
|
||||
{0xC0, 0xC0, 0x40, 0x40, 0xC0, 0xC0, 0x40, /*0x00,*/ 0x18, 0x1C, 0x16, 0x13, 0x11, 0x18, 0x18}, // , 0x00}, // 'z'
|
||||
{0x00, 0x80, 0x80, 0xF0, 0x78, 0x08, 0x08, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x10, 0x10}, // , 0x00}, // '{'
|
||||
{0x00, 0x00, 0x00, 0x78, 0x78, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x00, 0x00}, // , 0x00}, // '|'
|
||||
{0x00, 0x08, 0x08, 0x78, 0xF0, 0x80, 0x80, /*0x00,*/ 0x00, 0x10, 0x10, 0x1F, 0x0F, 0x00, 0x00}, // , 0x00}, // '}'
|
||||
{0x10, 0x18, 0x08, 0x18, 0x10, 0x18, 0x08, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // , 0x00} // '->'
|
||||
#else
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // ' '
|
||||
{0x00, 0x00, 0x00, 0xFC, 0xFC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x00}, // '!'
|
||||
{0x00, 0x0F, 0x1F, 0x00, 0x00, 0x1F, 0x0F, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '"'
|
||||
{0x20, 0xF8, 0xF8, 0x20, 0xF8, 0xF8, 0x20, /*0x00,*/ 0x02, 0x0F, 0x0F, 0x02, 0x0F, 0x0F, 0x02}, // '#'
|
||||
{0x70, 0xF8, 0x88, 0x8E, 0x8E, 0x98, 0x10, /*0x00,*/ 0x04, 0x0C, 0x08, 0x38, 0x38, 0x0F, 0x07}, // '$'
|
||||
{0x30, 0x30, 0x00, 0x80, 0xC0, 0x60, 0x30, /*0x00,*/ 0x0C, 0x06, 0x03, 0x01, 0x00, 0x0C, 0x0C}, // '%'
|
||||
{0x80, 0xD8, 0x7C, 0xE4, 0xBC, 0xD8, 0x40, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x07, 0x0F, 0x08}, // '&'
|
||||
{0x00, 0x10, 0x1F, 0x0F, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '''
|
||||
{0x00, 0x00, 0xF0, 0xF8, 0x0C, 0x04, 0x00, /*0x00,*/ 0x00, 0x00, 0x03, 0x07, 0x0C, 0x08, 0x00}, // '('
|
||||
{0x00, 0x00, 0x04, 0x0C, 0xF8, 0xF0, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0C, 0x07, 0x03, 0x00}, // ')'
|
||||
{0x00, 0x80, 0xA0, 0xE0, 0xC0, 0xE0, 0xA0, /*0x80,*/ 0x00, 0x00, 0x02, 0x03, 0x01, 0x03, 0x02}, // '*'
|
||||
{0x00, 0x80, 0x80, 0xE0, 0xE0, 0x80, 0x80, /*0x00,*/ 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00}, // '+'
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1E, 0x0E, 0x00, 0x00}, // ','
|
||||
{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '-'
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00}, // '.'
|
||||
{0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x30, /*0x00,*/ 0x0C, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00}, // '/'
|
||||
{0xF8, 0xFC, 0x04, 0x04, 0x04, 0xFC, 0xF8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '0'
|
||||
{0x00, 0x10, 0x18, 0xFC, 0xFC, 0x00, 0x00, /*0x00,*/ 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08}, // '1'
|
||||
{0x18, 0x1C, 0x04, 0x84, 0xC4, 0x7C, 0x38, /*0x00,*/ 0x0C, 0x0E, 0x0B, 0x09, 0x08, 0x08, 0x08}, // '2'
|
||||
{0x18, 0x1C, 0x44, 0x44, 0x44, 0xFC, 0xB8, /*0x00,*/ 0x06, 0x0E, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '3'
|
||||
{0x80, 0xC0, 0x60, 0x30, 0x18, 0xFC, 0xFC, /*0x00,*/ 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x0F}, // '4'
|
||||
{0x7C, 0x7C, 0x44, 0x44, 0x44, 0xC4, 0x84, /*0x00,*/ 0x04, 0x0C, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '5'
|
||||
{0xF0, 0xF8, 0x4C, 0x44, 0x44, 0xC4, 0x80, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '6'
|
||||
{0x04, 0x04, 0x04, 0x84, 0xE4, 0x7C, 0x1C, /*0x00,*/ 0x00, 0x00, 0x0E, 0x0F, 0x01, 0x00, 0x00}, // '7'
|
||||
{0xB8, 0xFC, 0x44, 0x44, 0x44, 0xFC, 0xB8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '8'
|
||||
{0x78, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0xF8, /*0x00,*/ 0x00, 0x08, 0x08, 0x08, 0x0C, 0x07, 0x03}, // '9'
|
||||
{0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00}, // ':'
|
||||
{0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0E, 0x06, 0x00, 0x00}, // ';'
|
||||
{0x00, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x08, /*0x00,*/ 0x00, 0x00, 0x01, 0x03, 0x06, 0x0C, 0x08}, // '<'
|
||||
{0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /*0x00,*/ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}, // '='
|
||||
{0x00, 0x08, 0x18, 0x30, 0x60, 0xC0, 0x80, /*0x00,*/ 0x00, 0x08, 0x0C, 0x06, 0x03, 0x01, 0x00}, // '>'
|
||||
{0x38, 0x3C, 0x04, 0x84, 0xC4, 0x7C, 0x38, /*0x00,*/ 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x00}, // '?'
|
||||
{0xF0, 0xF8, 0x08, 0xC8, 0xC8, 0xF8, 0xF0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x0B, 0x0B, 0x0B, 0x01}, // '@'
|
||||
{0xF8, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0xF8, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'A'
|
||||
{0xFC, 0xFC, 0x44, 0x44, 0x44, 0xFC, 0xB8, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'B'
|
||||
{0xF8, 0xFC, 0x04, 0x04, 0x04, 0x1C, 0x18, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0E, 0x06}, // 'C'
|
||||
{0xFC, 0xFC, 0x04, 0x04, 0x0C, 0xF8, 0xF0, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x0C, 0x07, 0x03}, // 'D'
|
||||
{0xFC, 0xFC, 0x44, 0x44, 0x44, 0x04, 0x04, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x08}, // 'E'
|
||||
{0xFC, 0xFC, 0x44, 0x44, 0x44, 0x04, 0x04, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, // 'F'
|
||||
{0xF8, 0xFC, 0x04, 0x84, 0x84, 0x9C, 0x98, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'G'
|
||||
{0xFC, 0xFC, 0x40, 0x40, 0x40, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'H'
|
||||
{0x00, 0x00, 0x04, 0xFC, 0xFC, 0x04, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00}, // 'I'
|
||||
{0x00, 0x00, 0x00, 0x04, 0xFC, 0xFC, 0x04, /*0x00,*/ 0x06, 0x0E, 0x08, 0x08, 0x0F, 0x07, 0x00}, // 'J'
|
||||
{0xFC, 0xFC, 0xE0, 0x30, 0x18, 0x0C, 0x04, /*0x00,*/ 0x0F, 0x0F, 0x01, 0x03, 0x06, 0x0C, 0x08}, // 'K'
|
||||
{0xFC, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x08}, // 'L'
|
||||
{0xFC, 0xFC, 0x18, 0x70, 0x18, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'M'
|
||||
{0xFC, 0xFC, 0x60, 0xC0, 0x80, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x01, 0x0F, 0x0F}, // 'N'
|
||||
{0xF8, 0xFC, 0x04, 0x04, 0x04, 0xFC, 0xF8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'O'
|
||||
{0xFC, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0x78, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, // 'P'
|
||||
{0xF8, 0xFC, 0x04, 0x04, 0x04, 0xFC, 0xF8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x0C, 0x0C, 0x1F, 0x17}, // 'Q'
|
||||
{0xFC, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0x78, /*0x00,*/ 0x0F, 0x0F, 0x01, 0x03, 0x06, 0x0C, 0x08}, // 'R'
|
||||
{0x38, 0x7C, 0x44, 0x44, 0x44, 0xCC, 0x88, /*0x00,*/ 0x06, 0x0E, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'S'
|
||||
{0x00, 0x04, 0x04, 0xFC, 0xFC, 0x04, 0x04, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00}, // 'T'
|
||||
{0xFC, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0xFC, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'U'
|
||||
{0x7C, 0xFC, 0x80, 0x00, 0x80, 0xFC, 0x7C, /*0x00,*/ 0x00, 0x03, 0x0F, 0x0C, 0x0F, 0x03, 0x00}, // 'V'
|
||||
{0xFC, 0xFC, 0x00, 0x80, 0x00, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x06, 0x03, 0x06, 0x0F, 0x0F}, // 'W'
|
||||
{0x0C, 0x3C, 0xF0, 0xC0, 0xF0, 0x3C, 0x0C, /*0x00,*/ 0x0C, 0x0F, 0x03, 0x00, 0x03, 0x0F, 0x0C}, // 'X'
|
||||
{0x00, 0x3C, 0x7C, 0xC0, 0xC0, 0x7C, 0x3C, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00}, // 'Y'
|
||||
{0x04, 0x04, 0x84, 0xC4, 0x64, 0x3C, 0x1C, /*0x00,*/ 0x0E, 0x0F, 0x09, 0x08, 0x08, 0x08, 0x08}, // 'Z'
|
||||
{0x00, 0x00, 0xFC, 0xFC, 0x04, 0x04, 0x00, /*0x00,*/ 0x00, 0x00, 0x0F, 0x0F, 0x08, 0x08, 0x00}, // '['
|
||||
{0x38, 0x70, 0xE0, 0xC0, 0x80, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0E}, // '"\'
|
||||
{0x00, 0x00, 0x04, 0x04, 0xFC, 0xFC, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x00}, // ']'
|
||||
{0x08, 0x0C, 0x06, 0x03, 0x06, 0x0C, 0x08, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '^'
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20}, // '_'
|
||||
{0x00, 0x00, 0x03, 0x07, 0x04, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '`'
|
||||
{0x00, 0xA0, 0xA0, 0xA0, 0xA0, 0xE0, 0xC0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x0F}, // 'a'
|
||||
{0xFC, 0xFC, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'b'
|
||||
{0xC0, 0xE0, 0x20, 0x20, 0x20, 0x60, 0x40, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0C, 0x04}, // 'c'
|
||||
{0xC0, 0xE0, 0x20, 0x20, 0x20, 0xFC, 0xFC, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x0F}, // 'd'
|
||||
{0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x07, 0x0F, 0x09, 0x09, 0x09, 0x09, 0x01}, // 'e'
|
||||
{0x20, 0x20, 0xF8, 0xFC, 0x24, 0x24, 0x04, /*0x00,*/ 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00}, // 'f'
|
||||
{0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x4F, 0x48, 0x48, 0x48, 0x7F, 0x3F}, // 'g'
|
||||
{0xFC, 0xFC, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'h'
|
||||
{0x00, 0x00, 0x20, 0xEC, 0xEC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00}, // 'i'
|
||||
{0x00, 0x00, 0x00, 0x00, 0x20, 0xEC, 0xEC, /*0x00,*/ 0x00, 0x30, 0x70, 0x40, 0x40, 0x7F, 0x3F}, // 'j'
|
||||
{0xFC, 0xFC, 0x00, 0x80, 0xC0, 0x60, 0x20, /*0x00,*/ 0x0F, 0x0F, 0x01, 0x03, 0x06, 0x0C, 0x08}, // 'k'
|
||||
{0x00, 0x00, 0x04, 0xFC, 0xFC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00}, // 'l'
|
||||
{0xE0, 0xE0, 0x20, 0xE0, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x0F, 0x00, 0x0F, 0x0F}, // 'm'
|
||||
{0xE0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'n'
|
||||
{0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'o'
|
||||
{0xE0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x7F, 0x7F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'p'
|
||||
{0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x7F, 0x7F}, // 'q'
|
||||
{0xE0, 0xE0, 0x60, 0x20, 0x20, 0x20, 0x20, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, // 'r'
|
||||
{0xC0, 0xE0, 0x20, 0x20, 0x20, 0x20, 0x20, /*0x00,*/ 0x08, 0x09, 0x09, 0x09, 0x09, 0x0F, 0x06}, // 's'
|
||||
{0x20, 0x20, 0xFC, 0xFC, 0x20, 0x20, 0x00, /*0x00,*/ 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x08}, // 't'
|
||||
{0xE0, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x0F}, // 'u'
|
||||
{0xE0, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x00, 0x03, 0x0F, 0x0C, 0x0F, 0x03, 0x00}, // 'v'
|
||||
{0xE0, 0xE0, 0x00, 0x80, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x0F, 0x08, 0x0F, 0x07}, // 'w'
|
||||
{0x60, 0xE0, 0x80, 0x00, 0x80, 0xE0, 0x60, /*0x00,*/ 0x0C, 0x0E, 0x03, 0x01, 0x03, 0x0E, 0x0C}, // 'x'
|
||||
{0xE0, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x4F, 0x48, 0x48, 0x48, 0x7F, 0x3F}, // 'y'
|
||||
{0x20, 0x20, 0x20, 0xA0, 0xE0, 0x60, 0x20, /*0x00,*/ 0x0C, 0x0E, 0x0B, 0x09, 0x08, 0x08, 0x08}, // 'z'
|
||||
{0x00, 0x00, 0x40, 0xF8, 0xBC, 0x04, 0x04, /*0x00,*/ 0x00, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08}, // '{'
|
||||
{0x00, 0x00, 0x00, 0xBC, 0xBC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00}, // '|'
|
||||
{0x00, 0x04, 0x04, 0xBC, 0xF8, 0x40, 0x00, /*0x00,*/ 0x00, 0x08, 0x08, 0x0F, 0x07, 0x00, 0x00}, // '}'
|
||||
{0x08, 0x0C, 0x04, 0x0C, 0x08, 0x0C, 0x04, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // '->'
|
||||
#endif
|
||||
};
|
||||
//const uint8_t gFontBig[95 - 1][16 - 2] =
|
||||
//{
|
||||
//#if 0
|
||||
//// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // ' '
|
||||
// {0x00, 0x00, 0x70, 0xF8, 0xF8, 0x70, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x1B, 0x1B, 0x00, 0x00}, // , 0x00}, // '!'
|
||||
// {0x00, 0x1E, 0x3E, 0x00, 0x00, 0x3E, 0x1E, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '"'
|
||||
// {0x40, 0xF0, 0xF0, 0x40, 0xF0, 0xF0, 0x40, /*0x00,*/ 0x04, 0x1F, 0x1F, 0x04, 0x1F, 0x1F, 0x04}, // , 0x00}, // '#'
|
||||
// {0x70, 0xF8, 0x88, 0x8F, 0x8F, 0x98, 0x30, /*0x00,*/ 0x06, 0x0C, 0x08, 0x38, 0x38, 0x0F, 0x07}, // , 0x00}, // '$'
|
||||
// {0x60, 0x60, 0x00, 0x00, 0x80, 0xC0, 0x60, /*0x00,*/ 0x18, 0x0C, 0x06, 0x03, 0x01, 0x18, 0x18}, // , 0x00}, // '%'
|
||||
// {0x00, 0xB0, 0xF8, 0xC8, 0x78, 0xB0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x11, 0x0F, 0x1F, 0x10}, // , 0x00}, // '&'
|
||||
// {0x00, 0x20, 0x3E, 0x1E, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '''
|
||||
// {0x00, 0x00, 0xE0, 0xF0, 0x18, 0x08, 0x00, /*0x00,*/ 0x00, 0x00, 0x07, 0x0F, 0x18, 0x10, 0x00}, // , 0x00}, // '('
|
||||
// {0x00, 0x00, 0x08, 0x18, 0xF0, 0xE0, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x18, 0x0F, 0x07, 0x00}, // , 0x00}, // ')'
|
||||
// {0x00, 0x40, 0xC0, 0x80, 0x80, 0xC0, 0x40, /*0x00,*/ 0x01, 0x05, 0x07, 0x03, 0x03, 0x07, 0x05}, // , 0x01}, // '*'
|
||||
// {0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, /*0x00,*/ 0x00, 0x01, 0x01, 0x07, 0x07, 0x01, 0x01}, // , 0x00}, // '+'
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x20, 0x3C, 0x1C, 0x00, 0x00}, // , 0x00}, // ','
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, // , 0x00}, // '-'
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00}, // , 0x00}, // '.'
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, /*0x00,*/ 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00, 0x00}, // , 0x00}, // '/'
|
||||
// {0xF0, 0xF8, 0x08, 0x88, 0x48, 0xF8, 0xF0, /*0x00,*/ 0x0F, 0x1F, 0x12, 0x11, 0x10, 0x1F, 0x0F}, // , 0x00}, // '0'
|
||||
// {0x00, 0x20, 0x30, 0xF8, 0xF8, 0x00, 0x00, /*0x00,*/ 0x00, 0x10, 0x10, 0x1F, 0x1F, 0x10, 0x10}, // , 0x00}, // '1'
|
||||
// {0x10, 0x18, 0x08, 0x88, 0xC8, 0x78, 0x30, /*0x00,*/ 0x1C, 0x1E, 0x13, 0x11, 0x10, 0x18, 0x18}, // , 0x00}, // '2'
|
||||
// {0x10, 0x18, 0x88, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x08, 0x18, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // '3'
|
||||
// {0x80, 0xC0, 0x60, 0x30, 0xF8, 0xF8, 0x00, /*0x00,*/ 0x01, 0x01, 0x01, 0x11, 0x1F, 0x1F, 0x11}, // , 0x00}, // '4'
|
||||
// {0xF8, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x08, /*0x00,*/ 0x08, 0x18, 0x10, 0x10, 0x11, 0x1F, 0x0F}, // , 0x00}, // '5'
|
||||
// {0xE0, 0xF0, 0x98, 0x88, 0x88, 0x80, 0x00, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // '6'
|
||||
// {0x18, 0x18, 0x08, 0x08, 0x88, 0xF8, 0x78, /*0x00,*/ 0x00, 0x00, 0x1E, 0x1F, 0x01, 0x00, 0x00}, // , 0x00}, // '7'
|
||||
// {0x70, 0xF8, 0x88, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // '8'
|
||||
// {0x70, 0xF8, 0x88, 0x88, 0x88, 0xF8, 0xF0, /*0x00,*/ 0x00, 0x10, 0x10, 0x10, 0x18, 0x0F, 0x07}, // , 0x00}, // '9'
|
||||
// {0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00}, // , 0x00}, // ':'
|
||||
// {0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1C, 0x0C, 0x00, 0x00}, // , 0x00}, // ';'
|
||||
// {0x00, 0x00, 0x80, 0xC0, 0x60, 0x30, 0x10, /*0x00,*/ 0x00, 0x01, 0x03, 0x06, 0x0C, 0x18, 0x10}, // , 0x00}, // '<'
|
||||
// {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, /*0x00,*/ 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04}, // , 0x00}, // '='
|
||||
// {0x00, 0x10, 0x30, 0x60, 0xC0, 0x80, 0x00, /*0x00,*/ 0x00, 0x10, 0x18, 0x0C, 0x06, 0x03, 0x01}, // , 0x00}, // '>'
|
||||
// {0x30, 0x38, 0x08, 0x88, 0xC8, 0x78, 0x30, /*0x00,*/ 0x00, 0x00, 0x00, 0x1B, 0x1B, 0x00, 0x00}, // , 0x00}, // '?'
|
||||
// {0xE0, 0xF0, 0x10, 0x90, 0x90, 0xF0, 0xE0, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x17, 0x17, 0x17, 0x03}, // , 0x00}, // '@'
|
||||
// {0xC0, 0xE0, 0x30, 0x18, 0x30, 0xE0, 0xC0, /*0x00,*/ 0x1F, 0x1F, 0x01, 0x01, 0x01, 0x1F, 0x1F}, // , 0x00}, // 'A'
|
||||
// {0x08, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'B'
|
||||
// {0xE0, 0xF0, 0x18, 0x08, 0x08, 0x18, 0x30, /*0x00,*/ 0x07, 0x0F, 0x18, 0x10, 0x10, 0x18, 0x0C}, // , 0x00}, // 'C'
|
||||
// {0x08, 0xF8, 0xF8, 0x08, 0x18, 0xF0, 0xE0, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x18, 0x0F, 0x07}, // , 0x00}, // 'D'
|
||||
// {0x08, 0xF8, 0xF8, 0x88, 0xC8, 0x18, 0x38, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x11, 0x18, 0x1C}, // , 0x00}, // 'E'
|
||||
// {0x08, 0xF8, 0xF8, 0x88, 0xC8, 0x18, 0x38, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x01, 0x00, 0x00}, // , 0x00}, // 'F'
|
||||
// {0xE0, 0xF0, 0x18, 0x08, 0x08, 0x18, 0x30, /*0x00,*/ 0x07, 0x0F, 0x18, 0x11, 0x11, 0x0F, 0x1F}, // , 0x00}, // 'G'
|
||||
// {0xF8, 0xF8, 0x80, 0x80, 0x80, 0xF8, 0xF8, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'H'
|
||||
// {0x00, 0x00, 0x08, 0xF8, 0xF8, 0x08, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'I'
|
||||
// {0x00, 0x00, 0x00, 0x08, 0xF8, 0xF8, 0x08, /*0x00,*/ 0x0E, 0x1E, 0x10, 0x10, 0x1F, 0x0F, 0x00}, // , 0x00}, // 'J'
|
||||
// {0x08, 0xF8, 0xF8, 0x80, 0xE0, 0x78, 0x18, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x01, 0x03, 0x1E, 0x1C}, // , 0x00}, // 'K'
|
||||
// {0x08, 0xF8, 0xF8, 0x08, 0x00, 0x00, 0x00, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x10, 0x18, 0x1C}, // , 0x00}, // 'L'
|
||||
// {0xF8, 0xF8, 0x70, 0xE0, 0x70, 0xF8, 0xF8, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'M'
|
||||
// {0xF8, 0xF8, 0x70, 0xE0, 0xC0, 0xF8, 0xF8, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x00, 0x01, 0x1F, 0x1F}, // , 0x00}, // 'N'
|
||||
// {0xE0, 0xF0, 0x18, 0x08, 0x18, 0xF0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x18, 0x10, 0x18, 0x0F, 0x07}, // , 0x00}, // 'O'
|
||||
// {0x08, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x00, 0x00, 0x00}, // , 0x00}, // 'P'
|
||||
// {0xF0, 0xF8, 0x08, 0x08, 0x08, 0xF8, 0xF0, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x1C, 0x78, 0x7F, 0x4F}, // , 0x00}, // 'Q'
|
||||
// {0x08, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x00, 0x01, 0x1F, 0x1E}, // , 0x00}, // 'R'
|
||||
// {0x30, 0x78, 0xC8, 0x88, 0x88, 0x38, 0x30, /*0x00,*/ 0x0C, 0x1C, 0x10, 0x10, 0x11, 0x1F, 0x0E}, // , 0x00}, // 'S'
|
||||
// {0x00, 0x38, 0x18, 0xF8, 0xF8, 0x18, 0x38, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'T'
|
||||
// {0xF8, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'U'
|
||||
// {0xF8, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, /*0x00,*/ 0x03, 0x07, 0x0C, 0x18, 0x0C, 0x07, 0x03}, // , 0x00}, // 'V'
|
||||
// {0xF8, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, /*0x00,*/ 0x07, 0x1F, 0x1C, 0x07, 0x1C, 0x1F, 0x07}, // , 0x00}, // 'W'
|
||||
// {0x18, 0x78, 0xE0, 0x80, 0xE0, 0x78, 0x18, /*0x00,*/ 0x18, 0x1E, 0x07, 0x01, 0x07, 0x1E, 0x18}, // , 0x00}, // 'X'
|
||||
// {0x00, 0x78, 0xF8, 0x80, 0x80, 0xF8, 0x78, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'Y'
|
||||
// {0x38, 0x18, 0x08, 0x88, 0xC8, 0x78, 0x38, /*0x00,*/ 0x1C, 0x1E, 0x13, 0x11, 0x10, 0x18, 0x1C}, // , 0x00}, // 'Z'
|
||||
// {0x00, 0x00, 0xF8, 0xF8, 0x08, 0x08, 0x00, /*0x00,*/ 0x00, 0x00, 0x1F, 0x1F, 0x10, 0x10, 0x00}, // , 0x00}, // '['
|
||||
// {0x70, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x01, 0x03, 0x07, 0x0E, 0x1C}, // , 0x00}, // '"\'
|
||||
// {0x00, 0x00, 0x08, 0x08, 0xF8, 0xF8, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x10, 0x1F, 0x1F, 0x00}, // , 0x00}, // ']'
|
||||
// {0x10, 0x18, 0x0E, 0x07, 0x0E, 0x18, 0x10, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '^'
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40}, // , 0x40}, // '_'
|
||||
// {0x00, 0x00, 0x07, 0x0F, 0x08, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '`'
|
||||
// {0x00, 0x40, 0x40, 0x40, 0xC0, 0x80, 0x00, /*0x00,*/ 0x0E, 0x1F, 0x11, 0x11, 0x0F, 0x1F, 0x10}, // , 0x00}, // 'a'
|
||||
// {0x08, 0xF8, 0xF8, 0x40, 0xC0, 0x80, 0x00, /*0x00,*/ 0x10, 0x1F, 0x0F, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'b'
|
||||
// {0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x18, 0x08}, // , 0x00}, // 'c'
|
||||
// {0x00, 0x80, 0xC0, 0x48, 0xF8, 0xF8, 0x00, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x0F, 0x1F, 0x10}, // , 0x00}, // 'd'
|
||||
// {0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x11, 0x11, 0x11, 0x19, 0x09}, // , 0x00}, // 'e'
|
||||
// {0x80, 0xF0, 0xF8, 0x88, 0x18, 0x30, 0x00, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x00, 0x00, 0x00}, // , 0x00}, // 'f'
|
||||
// {0x80, 0xC0, 0x40, 0x40, 0x80, 0xC0, 0x40, /*0x00,*/ 0x4F, 0xDF, 0x90, 0x90, 0xFF, 0x7F, 0x00}, // , 0x00}, // 'g'
|
||||
// {0x08, 0xF8, 0xF8, 0x80, 0x40, 0xC0, 0x80, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'h'
|
||||
// {0x00, 0x00, 0x40, 0xD8, 0xD8, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'i'
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x40, 0xD8, 0xD8, /*0x00,*/ 0x00, 0x60, 0xE0, 0x80, 0x80, 0xFF, 0x7F}, // , 0x00}, // 'j'
|
||||
// {0x08, 0xF8, 0xF8, 0x00, 0x80, 0xC0, 0x40, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x03, 0x07, 0x1C, 0x18}, // , 0x00}, // 'k'
|
||||
// {0x00, 0x00, 0x08, 0xF8, 0xF8, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'l'
|
||||
// {0xC0, 0xC0, 0xC0, 0x80, 0xC0, 0xC0, 0x80, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x1F, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'm'
|
||||
// {0x40, 0xC0, 0x80, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x00, 0x1F, 0x1F, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'n'
|
||||
// {0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'o'
|
||||
// {0x40, 0xC0, 0x80, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x80, 0xFF, 0xFF, 0x90, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'p'
|
||||
// {0x80, 0xC0, 0x40, 0x40, 0x80, 0xC0, 0x40, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x90, 0xFF, 0xFF, 0x80}, // , 0x00}, // 'q'
|
||||
// {0x40, 0xC0, 0x80, 0xC0, 0x40, 0xC0, 0x80, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x00, 0x00, 0x01}, // , 0x00}, // 'r'
|
||||
// {0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x08, 0x19, 0x13, 0x12, 0x16, 0x1C, 0x08}, // , 0x00}, // 's'
|
||||
// {0x40, 0x40, 0xF0, 0xF8, 0x40, 0x40, 0x00, /*0x00,*/ 0x00, 0x00, 0x0F, 0x1F, 0x10, 0x18, 0x08}, // , 0x00}, // 't'
|
||||
// {0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x0F, 0x1F, 0x10}, // , 0x00}, // 'u'
|
||||
// {0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, /*0x00,*/ 0x00, 0x07, 0x0F, 0x18, 0x18, 0x0F, 0x07}, // , 0x00}, // 'v'
|
||||
// {0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, /*0x00,*/ 0x0F, 0x1F, 0x18, 0x0E, 0x18, 0x1F, 0x0F}, // , 0x00}, // 'w'
|
||||
// {0x40, 0xC0, 0x80, 0x00, 0x80, 0xC0, 0x40, /*0x00,*/ 0x10, 0x18, 0x0F, 0x07, 0x0F, 0x18, 0x10}, // , 0x00}, // 'x'
|
||||
// {0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, /*0x00,*/ 0x8F, 0x9F, 0x90, 0x90, 0xD0, 0x7F, 0x3F}, // , 0x00}, // 'y'
|
||||
// {0xC0, 0xC0, 0x40, 0x40, 0xC0, 0xC0, 0x40, /*0x00,*/ 0x18, 0x1C, 0x16, 0x13, 0x11, 0x18, 0x18}, // , 0x00}, // 'z'
|
||||
// {0x00, 0x80, 0x80, 0xF0, 0x78, 0x08, 0x08, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x10, 0x10}, // , 0x00}, // '{'
|
||||
// {0x00, 0x00, 0x00, 0x78, 0x78, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x00, 0x00}, // , 0x00}, // '|'
|
||||
// {0x00, 0x08, 0x08, 0x78, 0xF0, 0x80, 0x80, /*0x00,*/ 0x00, 0x10, 0x10, 0x1F, 0x0F, 0x00, 0x00}, // , 0x00}, // '}'
|
||||
// {0x10, 0x18, 0x08, 0x18, 0x10, 0x18, 0x08, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // , 0x00} // '->'
|
||||
//#else
|
||||
// // {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // ' '
|
||||
// {0x00, 0x00, 0x00, 0xFC, 0xFC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x00}, // '!'
|
||||
// {0x00, 0x0F, 0x1F, 0x00, 0x00, 0x1F, 0x0F, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '"'
|
||||
// {0x20, 0xF8, 0xF8, 0x20, 0xF8, 0xF8, 0x20, /*0x00,*/ 0x02, 0x0F, 0x0F, 0x02, 0x0F, 0x0F, 0x02}, // '#'
|
||||
// {0x70, 0xF8, 0x88, 0x8E, 0x8E, 0x98, 0x10, /*0x00,*/ 0x04, 0x0C, 0x08, 0x38, 0x38, 0x0F, 0x07}, // '$'
|
||||
// {0x30, 0x30, 0x00, 0x80, 0xC0, 0x60, 0x30, /*0x00,*/ 0x0C, 0x06, 0x03, 0x01, 0x00, 0x0C, 0x0C}, // '%'
|
||||
// {0x80, 0xD8, 0x7C, 0xE4, 0xBC, 0xD8, 0x40, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x07, 0x0F, 0x08}, // '&'
|
||||
// {0x00, 0x10, 0x1F, 0x0F, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '''
|
||||
// {0x00, 0x00, 0xF0, 0xF8, 0x0C, 0x04, 0x00, /*0x00,*/ 0x00, 0x00, 0x03, 0x07, 0x0C, 0x08, 0x00}, // '('
|
||||
// {0x00, 0x00, 0x04, 0x0C, 0xF8, 0xF0, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0C, 0x07, 0x03, 0x00}, // ')'
|
||||
// {0x00, 0x80, 0xA0, 0xE0, 0xC0, 0xE0, 0xA0, /*0x80,*/ 0x00, 0x00, 0x02, 0x03, 0x01, 0x03, 0x02}, // '*'
|
||||
// {0x00, 0x80, 0x80, 0xE0, 0xE0, 0x80, 0x80, /*0x00,*/ 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00}, // '+'
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1E, 0x0E, 0x00, 0x00}, // ','
|
||||
// {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '-'
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00}, // '.'
|
||||
// {0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x30, /*0x00,*/ 0x0C, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00}, // '/'
|
||||
// {0xF8, 0xFC, 0x04, 0x04, 0x04, 0xFC, 0xF8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '0'
|
||||
// {0x00, 0x10, 0x18, 0xFC, 0xFC, 0x00, 0x00, /*0x00,*/ 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08}, // '1'
|
||||
// {0x18, 0x1C, 0x04, 0x84, 0xC4, 0x7C, 0x38, /*0x00,*/ 0x0C, 0x0E, 0x0B, 0x09, 0x08, 0x08, 0x08}, // '2'
|
||||
// {0x18, 0x1C, 0x44, 0x44, 0x44, 0xFC, 0xB8, /*0x00,*/ 0x06, 0x0E, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '3'
|
||||
// {0x80, 0xC0, 0x60, 0x30, 0x18, 0xFC, 0xFC, /*0x00,*/ 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x0F}, // '4'
|
||||
// {0x7C, 0x7C, 0x44, 0x44, 0x44, 0xC4, 0x84, /*0x00,*/ 0x04, 0x0C, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '5'
|
||||
// {0xF0, 0xF8, 0x4C, 0x44, 0x44, 0xC4, 0x80, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '6'
|
||||
// {0x04, 0x04, 0x04, 0x84, 0xE4, 0x7C, 0x1C, /*0x00,*/ 0x00, 0x00, 0x0E, 0x0F, 0x01, 0x00, 0x00}, // '7'
|
||||
// {0xB8, 0xFC, 0x44, 0x44, 0x44, 0xFC, 0xB8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '8'
|
||||
// {0x78, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0xF8, /*0x00,*/ 0x00, 0x08, 0x08, 0x08, 0x0C, 0x07, 0x03}, // '9'
|
||||
// {0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00}, // ':'
|
||||
// {0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0E, 0x06, 0x00, 0x00}, // ';'
|
||||
// {0x00, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x08, /*0x00,*/ 0x00, 0x00, 0x01, 0x03, 0x06, 0x0C, 0x08}, // '<'
|
||||
// {0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /*0x00,*/ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}, // '='
|
||||
// {0x00, 0x08, 0x18, 0x30, 0x60, 0xC0, 0x80, /*0x00,*/ 0x00, 0x08, 0x0C, 0x06, 0x03, 0x01, 0x00}, // '>'
|
||||
// {0x38, 0x3C, 0x04, 0x84, 0xC4, 0x7C, 0x38, /*0x00,*/ 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x00}, // '?'
|
||||
// {0xF0, 0xF8, 0x08, 0xC8, 0xC8, 0xF8, 0xF0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x0B, 0x0B, 0x0B, 0x01}, // '@'
|
||||
// {0xF8, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0xF8, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'A'
|
||||
// {0xFC, 0xFC, 0x44, 0x44, 0x44, 0xFC, 0xB8, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'B'
|
||||
// {0xF8, 0xFC, 0x04, 0x04, 0x04, 0x1C, 0x18, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0E, 0x06}, // 'C'
|
||||
// {0xFC, 0xFC, 0x04, 0x04, 0x0C, 0xF8, 0xF0, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x0C, 0x07, 0x03}, // 'D'
|
||||
// {0xFC, 0xFC, 0x44, 0x44, 0x44, 0x04, 0x04, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x08}, // 'E'
|
||||
// {0xFC, 0xFC, 0x44, 0x44, 0x44, 0x04, 0x04, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, // 'F'
|
||||
// {0xF8, 0xFC, 0x04, 0x84, 0x84, 0x9C, 0x98, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'G'
|
||||
// {0xFC, 0xFC, 0x40, 0x40, 0x40, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'H'
|
||||
// {0x00, 0x00, 0x04, 0xFC, 0xFC, 0x04, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00}, // 'I'
|
||||
// {0x00, 0x00, 0x00, 0x04, 0xFC, 0xFC, 0x04, /*0x00,*/ 0x06, 0x0E, 0x08, 0x08, 0x0F, 0x07, 0x00}, // 'J'
|
||||
// {0xFC, 0xFC, 0xE0, 0x30, 0x18, 0x0C, 0x04, /*0x00,*/ 0x0F, 0x0F, 0x01, 0x03, 0x06, 0x0C, 0x08}, // 'K'
|
||||
// {0xFC, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x08}, // 'L'
|
||||
// {0xFC, 0xFC, 0x18, 0x70, 0x18, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'M'
|
||||
// {0xFC, 0xFC, 0x60, 0xC0, 0x80, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x01, 0x0F, 0x0F}, // 'N'
|
||||
// {0xF8, 0xFC, 0x04, 0x04, 0x04, 0xFC, 0xF8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'O'
|
||||
// {0xFC, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0x78, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, // 'P'
|
||||
// {0xF8, 0xFC, 0x04, 0x04, 0x04, 0xFC, 0xF8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x0C, 0x0C, 0x1F, 0x17}, // 'Q'
|
||||
// {0xFC, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0x78, /*0x00,*/ 0x0F, 0x0F, 0x01, 0x03, 0x06, 0x0C, 0x08}, // 'R'
|
||||
// {0x38, 0x7C, 0x44, 0x44, 0x44, 0xCC, 0x88, /*0x00,*/ 0x06, 0x0E, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'S'
|
||||
// {0x00, 0x04, 0x04, 0xFC, 0xFC, 0x04, 0x04, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00}, // 'T'
|
||||
// {0xFC, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0xFC, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'U'
|
||||
// {0x7C, 0xFC, 0x80, 0x00, 0x80, 0xFC, 0x7C, /*0x00,*/ 0x00, 0x03, 0x0F, 0x0C, 0x0F, 0x03, 0x00}, // 'V'
|
||||
// {0xFC, 0xFC, 0x00, 0x80, 0x00, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x06, 0x03, 0x06, 0x0F, 0x0F}, // 'W'
|
||||
// {0x0C, 0x3C, 0xF0, 0xC0, 0xF0, 0x3C, 0x0C, /*0x00,*/ 0x0C, 0x0F, 0x03, 0x00, 0x03, 0x0F, 0x0C}, // 'X'
|
||||
// {0x00, 0x3C, 0x7C, 0xC0, 0xC0, 0x7C, 0x3C, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00}, // 'Y'
|
||||
// {0x04, 0x04, 0x84, 0xC4, 0x64, 0x3C, 0x1C, /*0x00,*/ 0x0E, 0x0F, 0x09, 0x08, 0x08, 0x08, 0x08}, // 'Z'
|
||||
// {0x00, 0x00, 0xFC, 0xFC, 0x04, 0x04, 0x00, /*0x00,*/ 0x00, 0x00, 0x0F, 0x0F, 0x08, 0x08, 0x00}, // '['
|
||||
// {0x38, 0x70, 0xE0, 0xC0, 0x80, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0E}, // '"\'
|
||||
// {0x00, 0x00, 0x04, 0x04, 0xFC, 0xFC, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x00}, // ']'
|
||||
// {0x08, 0x0C, 0x06, 0x03, 0x06, 0x0C, 0x08, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '^'
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20}, // '_'
|
||||
// {0x00, 0x00, 0x03, 0x07, 0x04, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '`'
|
||||
// {0x00, 0xA0, 0xA0, 0xA0, 0xA0, 0xE0, 0xC0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x0F}, // 'a'
|
||||
// {0xFC, 0xFC, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'b'
|
||||
// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0x60, 0x40, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0C, 0x04}, // 'c'
|
||||
// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xFC, 0xFC, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x0F}, // 'd'
|
||||
// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x07, 0x0F, 0x09, 0x09, 0x09, 0x09, 0x01}, // 'e'
|
||||
// {0x20, 0x20, 0xF8, 0xFC, 0x24, 0x24, 0x04, /*0x00,*/ 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00}, // 'f'
|
||||
// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x4F, 0x48, 0x48, 0x48, 0x7F, 0x3F}, // 'g'
|
||||
// {0xFC, 0xFC, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'h'
|
||||
// {0x00, 0x00, 0x20, 0xEC, 0xEC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00}, // 'i'
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x20, 0xEC, 0xEC, /*0x00,*/ 0x00, 0x30, 0x70, 0x40, 0x40, 0x7F, 0x3F}, // 'j'
|
||||
// {0xFC, 0xFC, 0x00, 0x80, 0xC0, 0x60, 0x20, /*0x00,*/ 0x0F, 0x0F, 0x01, 0x03, 0x06, 0x0C, 0x08}, // 'k'
|
||||
// {0x00, 0x00, 0x04, 0xFC, 0xFC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00}, // 'l'
|
||||
// {0xE0, 0xE0, 0x20, 0xE0, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x0F, 0x00, 0x0F, 0x0F}, // 'm'
|
||||
// {0xE0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'n'
|
||||
// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'o'
|
||||
// {0xE0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x7F, 0x7F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'p'
|
||||
// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x7F, 0x7F}, // 'q'
|
||||
// {0xE0, 0xE0, 0x60, 0x20, 0x20, 0x20, 0x20, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, // 'r'
|
||||
// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0x20, 0x20, /*0x00,*/ 0x08, 0x09, 0x09, 0x09, 0x09, 0x0F, 0x06}, // 's'
|
||||
// {0x20, 0x20, 0xFC, 0xFC, 0x20, 0x20, 0x00, /*0x00,*/ 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x08}, // 't'
|
||||
// {0xE0, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x0F}, // 'u'
|
||||
// {0xE0, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x00, 0x03, 0x0F, 0x0C, 0x0F, 0x03, 0x00}, // 'v'
|
||||
// {0xE0, 0xE0, 0x00, 0x80, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x0F, 0x08, 0x0F, 0x07}, // 'w'
|
||||
// {0x60, 0xE0, 0x80, 0x00, 0x80, 0xE0, 0x60, /*0x00,*/ 0x0C, 0x0E, 0x03, 0x01, 0x03, 0x0E, 0x0C}, // 'x'
|
||||
// {0xE0, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x4F, 0x48, 0x48, 0x48, 0x7F, 0x3F}, // 'y'
|
||||
// {0x20, 0x20, 0x20, 0xA0, 0xE0, 0x60, 0x20, /*0x00,*/ 0x0C, 0x0E, 0x0B, 0x09, 0x08, 0x08, 0x08}, // 'z'
|
||||
// {0x00, 0x00, 0x40, 0xF8, 0xBC, 0x04, 0x04, /*0x00,*/ 0x00, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08}, // '{'
|
||||
// {0x00, 0x00, 0x00, 0xBC, 0xBC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00}, // '|'
|
||||
// {0x00, 0x04, 0x04, 0xBC, 0xF8, 0x40, 0x00, /*0x00,*/ 0x00, 0x08, 0x08, 0x0F, 0x07, 0x00, 0x00}, // '}'
|
||||
// {0x08, 0x0C, 0x04, 0x0C, 0x08, 0x0C, 0x04, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // '->'
|
||||
//#endif
|
||||
//};
|
||||
|
||||
#if 0
|
||||
// original font
|
||||
@@ -252,20 +252,20 @@ const uint8_t gFontBig[95 - 1][16 - 2] =
|
||||
#else
|
||||
// Terminus font
|
||||
|
||||
const uint8_t gFontBigDigits[11][26 - 6] =
|
||||
{
|
||||
{/*0x00, 0x00,*/ 0xFC, 0xFE, 0xFE, 0x06, 0x06, 0x06, 0x06, 0xFE, 0xFE, 0xFC, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0x00, 0x00, 0x18, 0x1C, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x00, 0x60, 0x60, 0x7F, 0x7F, 0x7F, 0x60, 0x60, 0x00, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0x1C, 0x1E, 0x1E, 0x06, 0x06, 0x06, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x60, 0x70, 0x78, 0x7C, 0x6E, 0x67, 0x63, 0x61, 0x60, 0x60, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0x0C, 0x0E, 0x0E, 0x86, 0x86, 0x86, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x30, 0x70, 0x70, 0x61, 0x61, 0x61, 0x61, 0x7F, 0x7F, 0x3E, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0x80, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0xFE, 0xFE, 0xFE, /*0x00,*/ /*0x00, 0x00,*/ 0x0F, 0x0F, 0x0F, 0x0C, 0x0C, 0x0C, 0x0C, 0x7F, 0x7F, 0x7F, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0xFE, 0xFE, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x86, /*0x00,*/ /*0x00, 0x00,*/ 0x30, 0x70, 0x70, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0xF8, 0xFC, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x80, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0x0E, 0x0E, 0x0E, 0x06, 0x06, 0x86, 0xE6, 0xFE, 0x7E, 0x1E, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x7C, 0x7F, 0x7F, 0x03, 0x00, 0x00, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0x7C, 0xFE, 0xFE, 0x86, 0x86, 0x86, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x61, 0x61, 0x61, 0x61, 0x7F, 0x7F, 0x3F, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0xFC, 0xFE, 0xFE, 0x06, 0x06, 0x06, 0x06, 0xFE, 0xFE, 0xFC, /*0x00,*/ /*0x00, 0x00,*/ 0x01, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x7F, 0x3F, 0x1F, /*0x00*/},
|
||||
{/*0x00, 0x00,*/ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, /*0x00*/}
|
||||
};
|
||||
// const uint8_t gFontBigDigits[11][26 - 6] =
|
||||
// {
|
||||
// {/*0x00, 0x00,*/ 0xFC, 0xFE, 0xFE, 0x06, 0x06, 0x06, 0x06, 0xFE, 0xFE, 0xFC, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0x00, 0x00, 0x18, 0x1C, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x00, 0x60, 0x60, 0x7F, 0x7F, 0x7F, 0x60, 0x60, 0x00, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0x1C, 0x1E, 0x1E, 0x06, 0x06, 0x06, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x60, 0x70, 0x78, 0x7C, 0x6E, 0x67, 0x63, 0x61, 0x60, 0x60, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0x0C, 0x0E, 0x0E, 0x86, 0x86, 0x86, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x30, 0x70, 0x70, 0x61, 0x61, 0x61, 0x61, 0x7F, 0x7F, 0x3E, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0x80, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0xFE, 0xFE, 0xFE, /*0x00,*/ /*0x00, 0x00,*/ 0x0F, 0x0F, 0x0F, 0x0C, 0x0C, 0x0C, 0x0C, 0x7F, 0x7F, 0x7F, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0xFE, 0xFE, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x86, /*0x00,*/ /*0x00, 0x00,*/ 0x30, 0x70, 0x70, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0xF8, 0xFC, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x80, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0x0E, 0x0E, 0x0E, 0x06, 0x06, 0x86, 0xE6, 0xFE, 0x7E, 0x1E, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x7C, 0x7F, 0x7F, 0x03, 0x00, 0x00, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0x7C, 0xFE, 0xFE, 0x86, 0x86, 0x86, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x61, 0x61, 0x61, 0x61, 0x7F, 0x7F, 0x3F, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0xFC, 0xFE, 0xFE, 0x06, 0x06, 0x06, 0x06, 0xFE, 0xFE, 0xFC, /*0x00,*/ /*0x00, 0x00,*/ 0x01, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x7F, 0x3F, 0x1F, /*0x00*/},
|
||||
// {/*0x00, 0x00,*/ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, /*0x00*/}
|
||||
// };
|
||||
#endif
|
||||
/*
|
||||
const uint8_t gFontSmallDigits[11][7] =
|
||||
|
293
frequencies.c
293
frequencies.c
@@ -24,90 +24,90 @@
|
||||
#define BX4819_band1_lower 1800000
|
||||
#define BX4819_band2_upper 130000000
|
||||
|
||||
const freq_band_table_t BX4819_band1 = {BX4819_band1_lower, 63000000};
|
||||
const freq_band_table_t BX4819_band1 = {BX4819_band1_lower, 63000000};
|
||||
const freq_band_table_t BX4819_band2 = {84000000, BX4819_band2_upper};
|
||||
|
||||
const freq_band_table_t frequencyBandTable[] =
|
||||
{
|
||||
#ifndef ENABLE_WIDE_RX
|
||||
// QS original
|
||||
[BAND1_50MHz ]={.lower = 5000000, .upper = 7600000},
|
||||
[BAND7_470MHz]={.lower = 47000000, .upper = 60000000},
|
||||
#else
|
||||
// extended range
|
||||
[BAND1_50MHz ]={.lower = BX4819_band1_lower, .upper = 10800000},
|
||||
[BAND7_470MHz]={.lower = 47000000, .upper = BX4819_band2_upper},
|
||||
#endif
|
||||
[BAND2_108MHz]={.lower = 10800000, .upper = 13700000},
|
||||
[BAND3_137MHz]={.lower = 13700000, .upper = 17400000},
|
||||
[BAND4_174MHz]={.lower = 17400000, .upper = 35000000},
|
||||
[BAND5_350MHz]={.lower = 35000000, .upper = 40000000},
|
||||
[BAND6_400MHz]={.lower = 40000000, .upper = 47000000}
|
||||
};
|
||||
{
|
||||
#ifndef ENABLE_WIDE_RX
|
||||
// QS original
|
||||
[BAND1_50MHz ]={.lower = 5000000, .upper = 7600000},
|
||||
[BAND7_470MHz]={.lower = 47000000, .upper = 60000000},
|
||||
#else
|
||||
// extended range
|
||||
[BAND1_50MHz]={.lower = BX4819_band1_lower, .upper = 10800000},
|
||||
[BAND7_470MHz]={.lower = 47000000, .upper = BX4819_band2_upper},
|
||||
#endif
|
||||
[BAND2_108MHz]={.lower = 10800000, .upper = 13700000},
|
||||
[BAND3_137MHz]={.lower = 13700000, .upper = 17400000},
|
||||
[BAND4_174MHz]={.lower = 17400000, .upper = 35000000},
|
||||
[BAND5_350MHz]={.lower = 35000000, .upper = 40000000},
|
||||
[BAND6_400MHz]={.lower = 40000000, .upper = 47000000}
|
||||
};
|
||||
|
||||
#ifdef ENABLE_NOAA
|
||||
const uint32_t NoaaFrequencyTable[10] =
|
||||
{
|
||||
16255000,
|
||||
16240000,
|
||||
16247500,
|
||||
16242500,
|
||||
16245000,
|
||||
16250000,
|
||||
16252500,
|
||||
16152500,
|
||||
16177500,
|
||||
16327500
|
||||
};
|
||||
const uint32_t NoaaFrequencyTable[10] =
|
||||
{
|
||||
16255000,
|
||||
16240000,
|
||||
16247500,
|
||||
16242500,
|
||||
16245000,
|
||||
16250000,
|
||||
16252500,
|
||||
16152500,
|
||||
16177500,
|
||||
16327500
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
// this order of steps has to be preserved for backwards compatibility with other/stock firmwares
|
||||
const uint16_t gStepFrequencyTable[] = {
|
||||
// standard steps
|
||||
[STEP_2_5kHz] = 250,
|
||||
[STEP_5kHz] = 500,
|
||||
[STEP_6_25kHz] = 625,
|
||||
[STEP_10kHz] = 1000,
|
||||
[STEP_12_5kHz] = 1250,
|
||||
[STEP_25kHz] = 2500,
|
||||
[STEP_8_33kHz] = 833,
|
||||
[STEP_2_5kHz] = 250,
|
||||
[STEP_5kHz] = 500,
|
||||
[STEP_6_25kHz] = 625,
|
||||
[STEP_10kHz] = 1000,
|
||||
[STEP_12_5kHz] = 1250,
|
||||
[STEP_25kHz] = 2500,
|
||||
[STEP_8_33kHz] = 833,
|
||||
// custom steps
|
||||
[STEP_0_01kHz] = 1,
|
||||
[STEP_0_05kHz] = 5,
|
||||
[STEP_0_1kHz] = 10,
|
||||
[STEP_0_25kHz] = 25,
|
||||
[STEP_0_5kHz] = 50,
|
||||
[STEP_1kHz] = 100,
|
||||
[STEP_1_25kHz] = 125,
|
||||
[STEP_9kHz] = 900,
|
||||
[STEP_15kHz] = 1500,
|
||||
[STEP_20kHz] = 2000,
|
||||
[STEP_30kHz] = 3000,
|
||||
[STEP_50kHz] = 5000,
|
||||
[STEP_100kHz] = 10000,
|
||||
[STEP_125kHz] = 12500,
|
||||
[STEP_200kHz] = 20000,
|
||||
[STEP_250kHz] = 25000,
|
||||
[STEP_500kHz] = 50000
|
||||
[STEP_0_01kHz] = 1,
|
||||
[STEP_0_05kHz] = 5,
|
||||
[STEP_0_1kHz] = 10,
|
||||
[STEP_0_25kHz] = 25,
|
||||
[STEP_0_5kHz] = 50,
|
||||
[STEP_1kHz] = 100,
|
||||
[STEP_1_25kHz] = 125,
|
||||
[STEP_9kHz] = 900,
|
||||
[STEP_15kHz] = 1500,
|
||||
[STEP_20kHz] = 2000,
|
||||
[STEP_30kHz] = 3000,
|
||||
[STEP_50kHz] = 5000,
|
||||
[STEP_100kHz] = 10000,
|
||||
[STEP_125kHz] = 12500,
|
||||
[STEP_200kHz] = 20000,
|
||||
[STEP_250kHz] = 25000,
|
||||
[STEP_500kHz] = 50000
|
||||
};
|
||||
|
||||
|
||||
const STEP_Setting_t StepSortedIndexes[] = {
|
||||
STEP_0_01kHz, STEP_0_05kHz, STEP_0_1kHz, STEP_0_25kHz, STEP_0_5kHz, STEP_1kHz, STEP_1_25kHz, STEP_2_5kHz, STEP_5kHz, STEP_6_25kHz,
|
||||
STEP_8_33kHz, STEP_9kHz, STEP_10kHz, STEP_12_5kHz, STEP_15kHz, STEP_20kHz, STEP_25kHz, STEP_30kHz, STEP_50kHz, STEP_100kHz,
|
||||
STEP_125kHz, STEP_200kHz, STEP_250kHz, STEP_500kHz
|
||||
STEP_0_01kHz, STEP_0_05kHz, STEP_0_1kHz, STEP_0_25kHz, STEP_0_5kHz, STEP_1kHz, STEP_1_25kHz, STEP_2_5kHz,
|
||||
STEP_5kHz, STEP_6_25kHz,
|
||||
STEP_8_33kHz, STEP_9kHz, STEP_10kHz, STEP_12_5kHz, STEP_15kHz, STEP_20kHz, STEP_25kHz, STEP_30kHz, STEP_50kHz,
|
||||
STEP_100kHz,
|
||||
STEP_125kHz, STEP_200kHz, STEP_250kHz, STEP_500kHz
|
||||
};
|
||||
|
||||
STEP_Setting_t FREQUENCY_GetStepIdxFromSortedIdx(uint8_t sortedIdx)
|
||||
{
|
||||
STEP_Setting_t FREQUENCY_GetStepIdxFromSortedIdx(uint8_t sortedIdx) {
|
||||
return StepSortedIndexes[sortedIdx];
|
||||
}
|
||||
|
||||
uint32_t FREQUENCY_GetSortedIdxFromStepIdx(uint8_t stepIdx)
|
||||
{
|
||||
for(uint8_t i = 0; i < ARRAY_SIZE(gStepFrequencyTable); i++)
|
||||
if(StepSortedIndexes[i] == stepIdx)
|
||||
uint32_t FREQUENCY_GetSortedIdxFromStepIdx(uint8_t stepIdx) {
|
||||
for (uint8_t i = 0; i < ARRAY_SIZE(gStepFrequencyTable); i++)
|
||||
if (StepSortedIndexes[i] == stepIdx)
|
||||
return i;
|
||||
return 0;
|
||||
}
|
||||
@@ -115,25 +115,24 @@ uint32_t FREQUENCY_GetSortedIdxFromStepIdx(uint8_t stepIdx)
|
||||
static_assert(ARRAY_SIZE(gStepFrequencyTable) == STEP_N_ELEM);
|
||||
|
||||
|
||||
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency)
|
||||
{
|
||||
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency) {
|
||||
for (int32_t band = BAND_N_ELEM - 1; band >= 0; band--)
|
||||
if (Frequency >= frequencyBandTable[band].lower)
|
||||
return (FREQUENCY_Band_t)band;
|
||||
return (FREQUENCY_Band_t) band;
|
||||
|
||||
return BAND1_50MHz;
|
||||
}
|
||||
|
||||
uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency)
|
||||
{
|
||||
uint8_t
|
||||
FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle,
|
||||
int32_t UpperLimit, int32_t Frequency) {
|
||||
if (Frequency <= LowerLimit)
|
||||
return TxpLow;
|
||||
|
||||
if (UpperLimit <= Frequency)
|
||||
return TxpHigh;
|
||||
|
||||
if (Frequency <= Middle)
|
||||
{
|
||||
if (Frequency <= Middle) {
|
||||
TxpMid += ((TxpMid - TxpLow) * (Frequency - LowerLimit)) / (Middle - LowerLimit);
|
||||
return TxpMid;
|
||||
}
|
||||
@@ -144,23 +143,22 @@ uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t T
|
||||
}
|
||||
|
||||
|
||||
uint32_t FREQUENCY_RoundToStep(uint32_t freq, uint16_t step)
|
||||
{
|
||||
if(step == 833) {
|
||||
uint32_t base = freq/2500*2500;
|
||||
int chno = (freq - base) / 700; // convert entered aviation 8.33Khz channel number scheme to actual frequency.
|
||||
uint32_t FREQUENCY_RoundToStep(uint32_t freq, uint16_t step) {
|
||||
if (step == 833) {
|
||||
uint32_t base = freq / 2500 * 2500;
|
||||
int chno =
|
||||
(freq - base) / 700; // convert entered aviation 8.33Khz channel number scheme to actual frequency.
|
||||
return base + (chno * 833) + (chno == 3);
|
||||
}
|
||||
|
||||
if(step == 1)
|
||||
if (step == 1)
|
||||
return freq;
|
||||
if(step >= 1000)
|
||||
step = step/2;
|
||||
if (step >= 1000)
|
||||
step = step / 2;
|
||||
return (freq + (step + 1) / 2) / step * step;
|
||||
}
|
||||
|
||||
int32_t TX_freq_check(const uint32_t Frequency)
|
||||
{ // return '0' if TX frequency is allowed
|
||||
int32_t TX_freq_check(const uint32_t Frequency) { // return '0' if TX frequency is allowed
|
||||
// otherwise return '-1'
|
||||
|
||||
if (Frequency < frequencyBandTable[0].lower || Frequency > frequencyBandTable[BAND_N_ELEM - 1].upper)
|
||||
@@ -169,90 +167,82 @@ int32_t TX_freq_check(const uint32_t Frequency)
|
||||
if (Frequency >= BX4819_band1.upper && Frequency < BX4819_band2.lower)
|
||||
return -1; // BX chip does not work in this range
|
||||
|
||||
switch (gSetting_F_LOCK)
|
||||
{
|
||||
switch (gSetting_F_LOCK) {
|
||||
case F_LOCK_DEF:
|
||||
if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < frequencyBandTable[BAND3_137MHz].upper)
|
||||
if (Frequency >= frequencyBandTable[BAND3_137MHz].lower &&
|
||||
Frequency < frequencyBandTable[BAND3_137MHz].upper)
|
||||
return 0;
|
||||
if (Frequency >= frequencyBandTable[BAND4_174MHz].lower && Frequency < frequencyBandTable[BAND4_174MHz].upper)
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
if (gSetting_200TX)
|
||||
#endif
|
||||
return 0;
|
||||
if (Frequency >= frequencyBandTable[BAND5_350MHz].lower && Frequency < frequencyBandTable[BAND5_350MHz].upper)
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
if (gSetting_350TX && gSetting_350EN)
|
||||
#else
|
||||
if (gSetting_350EN)
|
||||
#endif
|
||||
return 0;
|
||||
if (Frequency >= frequencyBandTable[BAND6_400MHz].lower && Frequency < frequencyBandTable[BAND6_400MHz].upper)
|
||||
if (Frequency >= frequencyBandTable[BAND4_174MHz].lower &&
|
||||
Frequency < frequencyBandTable[BAND4_174MHz].upper)
|
||||
return 0;
|
||||
if (Frequency >= frequencyBandTable[BAND5_350MHz].lower &&
|
||||
Frequency < frequencyBandTable[BAND5_350MHz].upper)
|
||||
return 0;
|
||||
if (Frequency >= frequencyBandTable[BAND6_400MHz].lower &&
|
||||
Frequency < frequencyBandTable[BAND6_400MHz].upper)
|
||||
return 0;
|
||||
if (Frequency >= frequencyBandTable[BAND7_470MHz].lower && Frequency <= 60000000)
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
if (gSetting_500TX)
|
||||
#endif
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case F_LOCK_FCC:
|
||||
if (Frequency >= 14400000 && Frequency < 14800000)
|
||||
return 0;
|
||||
if (Frequency >= 42000000 && Frequency < 45000000)
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case F_LOCK_CE:
|
||||
if (Frequency >= 14400000 && Frequency < 14600000)
|
||||
return 0;
|
||||
if (Frequency >= 43000000 && Frequency < 44000000)
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case F_LOCK_GB:
|
||||
if (Frequency >= 14400000 && Frequency < 14800000)
|
||||
return 0;
|
||||
if (Frequency >= 43000000 && Frequency < 44000000)
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case F_LOCK_430:
|
||||
if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < 17400000)
|
||||
return 0;
|
||||
if (Frequency >= 40000000 && Frequency < 43000000)
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case F_LOCK_438:
|
||||
if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < 17400000)
|
||||
return 0;
|
||||
if (Frequency >= 40000000 && Frequency < 43800000)
|
||||
return 0;
|
||||
break;
|
||||
// case F_LOCK_FCC:
|
||||
// if (Frequency >= 14400000 && Frequency < 14800000)
|
||||
// return 0;
|
||||
// if (Frequency >= 42000000 && Frequency < 45000000)
|
||||
// return 0;
|
||||
// break;
|
||||
//
|
||||
// case F_LOCK_CE:
|
||||
// if (Frequency >= 14400000 && Frequency < 14600000)
|
||||
// return 0;
|
||||
// if (Frequency >= 43000000 && Frequency < 44000000)
|
||||
// return 0;
|
||||
// break;
|
||||
//
|
||||
// case F_LOCK_GB:
|
||||
// if (Frequency >= 14400000 && Frequency < 14800000)
|
||||
// return 0;
|
||||
// if (Frequency >= 43000000 && Frequency < 44000000)
|
||||
// return 0;
|
||||
// break;
|
||||
//
|
||||
// case F_LOCK_430:
|
||||
// if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < 17400000)
|
||||
// return 0;
|
||||
// if (Frequency >= 40000000 && Frequency < 43000000)
|
||||
// return 0;
|
||||
// break;
|
||||
//
|
||||
// case F_LOCK_438:
|
||||
// if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < 17400000)
|
||||
// return 0;
|
||||
// if (Frequency >= 40000000 && Frequency < 43800000)
|
||||
// return 0;
|
||||
// break;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_PMR
|
||||
case F_LOCK_PMR:
|
||||
if (Frequency >= 44600625 && Frequency <= 44619375)
|
||||
return 0;
|
||||
break;
|
||||
case F_LOCK_PMR:
|
||||
if (Frequency >= 44600625 && Frequency <= 44619375)
|
||||
return 0;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_GMRS_FRS_MURS
|
||||
case F_LOCK_GMRS_FRS_MURS:
|
||||
// https://forums.radioreference.com/threads/the-great-unofficial-radioreference-frs-gmrs-murs-fact-sheet.275370/
|
||||
if ((Frequency >= 46255000 && Frequency <= 46272500) ||
|
||||
(Frequency >= 46755000 && Frequency <= 46772500)) // FRS/GMRS
|
||||
return 0;
|
||||
if (Frequency == 15182000 ||
|
||||
Frequency == 15188000 ||
|
||||
Frequency == 15194000 ||
|
||||
Frequency == 15457000 ||
|
||||
Frequency == 15460000) // MURS
|
||||
return 0;
|
||||
break;
|
||||
case F_LOCK_GMRS_FRS_MURS:
|
||||
// https://forums.radioreference.com/threads/the-great-unofficial-radioreference-frs-gmrs-murs-fact-sheet.275370/
|
||||
if ((Frequency >= 46255000 && Frequency <= 46272500) ||
|
||||
(Frequency >= 46755000 && Frequency <= 46772500)) // FRS/GMRS
|
||||
return 0;
|
||||
if (Frequency == 15182000 ||
|
||||
Frequency == 15188000 ||
|
||||
Frequency == 15194000 ||
|
||||
Frequency == 15457000 ||
|
||||
Frequency == 15460000) // MURS
|
||||
return 0;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_CA
|
||||
#ifdef ENABLE_FEAT_F4HWN_CA
|
||||
case F_LOCK_CA:
|
||||
if (Frequency >= 14400000 && Frequency < 14800000)
|
||||
return 0;
|
||||
@@ -275,8 +265,7 @@ int32_t TX_freq_check(const uint32_t Frequency)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t RX_freq_check(const uint32_t Frequency)
|
||||
{ // return '0' if RX frequency is allowed
|
||||
int32_t RX_freq_check(const uint32_t Frequency) { // return '0' if RX frequency is allowed
|
||||
// otherwise return '-1'
|
||||
|
||||
if (Frequency < frequencyBandTable[0].lower || Frequency > frequencyBandTable[BAND_N_ELEM - 1].upper)
|
||||
|
108
functions.c
108
functions.c
@@ -17,16 +17,24 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "app/dtmf.h"
|
||||
|
||||
#if defined(ENABLE_FMRADIO)
|
||||
#include "app/fm.h"
|
||||
|
||||
#include "app/fm.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "audio.h"
|
||||
#include "bsp/dp32g030/gpio.h"
|
||||
#include "dcs.h"
|
||||
#include "driver/backlight.h"
|
||||
|
||||
#if defined(ENABLE_FMRADIO)
|
||||
#include "driver/bk1080.h"
|
||||
|
||||
#include "driver/bk1080.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "driver/bk4819.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/system.h"
|
||||
@@ -39,36 +47,37 @@
|
||||
#include "settings.h"
|
||||
#include "ui/status.h"
|
||||
#include "ui/ui.h"
|
||||
#include "app/app.h"
|
||||
#include "driver/systick.h"
|
||||
|
||||
|
||||
FUNCTION_Type_t gCurrentFunction;
|
||||
|
||||
bool FUNCTION_IsRx()
|
||||
{
|
||||
bool FUNCTION_IsRx() {
|
||||
return gCurrentFunction == FUNCTION_MONITOR ||
|
||||
gCurrentFunction == FUNCTION_INCOMING ||
|
||||
gCurrentFunction == FUNCTION_RECEIVE;
|
||||
}
|
||||
|
||||
void FUNCTION_Init(void)
|
||||
{
|
||||
void FUNCTION_Init(void) {
|
||||
g_CxCSS_TAIL_Found = false;
|
||||
g_CDCSS_Lost = false;
|
||||
g_CTCSS_Lost = false;
|
||||
g_CDCSS_Lost = false;
|
||||
g_CTCSS_Lost = false;
|
||||
|
||||
g_SquelchLost = false;
|
||||
g_SquelchLost = false;
|
||||
|
||||
gFlagTailNoteEliminationComplete = false;
|
||||
gFlagTailNoteEliminationComplete = false;
|
||||
gTailNoteEliminationCountdown_10ms = 0;
|
||||
gFoundCTCSS = false;
|
||||
gFoundCDCSS = false;
|
||||
gFoundCTCSSCountdown_10ms = 0;
|
||||
gFoundCDCSSCountdown_10ms = 0;
|
||||
gEndOfRxDetectedMaybe = false;
|
||||
gFoundCTCSS = false;
|
||||
gFoundCDCSS = false;
|
||||
gFoundCTCSSCountdown_10ms = 0;
|
||||
gFoundCDCSSCountdown_10ms = 0;
|
||||
gEndOfRxDetectedMaybe = false;
|
||||
|
||||
gCurrentCodeType = (gRxVfo->Modulation != MODULATION_FM) ? CODE_TYPE_OFF : gRxVfo->pRX->CodeType;
|
||||
|
||||
#ifdef ENABLE_VOX
|
||||
g_VOX_Lost = false;
|
||||
g_VOX_Lost = false;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
@@ -86,8 +95,7 @@ void FUNCTION_Init(void)
|
||||
gUpdateStatus = true;
|
||||
}
|
||||
|
||||
void FUNCTION_Foreground(const FUNCTION_Type_t PreviousFunction)
|
||||
{
|
||||
void FUNCTION_Foreground(const FUNCTION_Type_t PreviousFunction) {
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (gDTMF_ReplyState != DTMF_REPLY_NONE)
|
||||
RADIO_PrepareCssTX();
|
||||
@@ -109,8 +117,7 @@ void FUNCTION_Foreground(const FUNCTION_Type_t PreviousFunction)
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (gDTMF_CallState == DTMF_CALL_STATE_CALL_OUT ||
|
||||
gDTMF_CallState == DTMF_CALL_STATE_RECEIVED ||
|
||||
gDTMF_CallState == DTMF_CALL_STATE_RECEIVED_STAY)
|
||||
{
|
||||
gDTMF_CallState == DTMF_CALL_STATE_RECEIVED_STAY) {
|
||||
gDTMF_auto_reset_time_500ms = gEeprom.DTMF_auto_reset_time * 2;
|
||||
}
|
||||
#endif
|
||||
@@ -118,18 +125,15 @@ void FUNCTION_Foreground(const FUNCTION_Type_t PreviousFunction)
|
||||
}
|
||||
|
||||
void FUNCTION_PowerSave() {
|
||||
#ifdef ENABLE_FEAT_F4HWN_SLEEP
|
||||
if(gWakeUp)
|
||||
{
|
||||
gPowerSave_10ms = gEeprom.BATTERY_SAVE * 200; // deep sleep now indexed on BatSav
|
||||
}
|
||||
else
|
||||
{
|
||||
gPowerSave_10ms = gEeprom.BATTERY_SAVE * 10;
|
||||
}
|
||||
#else
|
||||
#ifdef ENABLE_FEAT_F4HWN_SLEEP
|
||||
if (gWakeUp) {
|
||||
gPowerSave_10ms = gEeprom.BATTERY_SAVE * 200; // deep sleep now indexed on BatSav
|
||||
} else {
|
||||
gPowerSave_10ms = gEeprom.BATTERY_SAVE * 10;
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
gPowerSave_10ms = gEeprom.BATTERY_SAVE * 10;
|
||||
#endif
|
||||
gPowerSaveCountdownExpired = false;
|
||||
|
||||
gRxIdleMode = true;
|
||||
@@ -147,9 +151,11 @@ void FUNCTION_PowerSave() {
|
||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||
}
|
||||
|
||||
void FUNCTION_Transmit()
|
||||
{
|
||||
void FUNCTION_Transmit() {
|
||||
// if DTMF is enabled when TX'ing, it changes the TX audio filtering !! .. 1of11
|
||||
|
||||
MSG_EnableRX(false);
|
||||
|
||||
BK4819_DisableDTMF();
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
@@ -167,8 +173,7 @@ void FUNCTION_Transmit()
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
if (gAlarmState == ALARM_STATE_SITE_ALARM)
|
||||
{
|
||||
if (gAlarmState == ALARM_STATE_SITE_ALARM) {
|
||||
GUI_DisplayScreen();
|
||||
|
||||
AUDIO_AudioPathOff();
|
||||
@@ -200,40 +205,37 @@ void FUNCTION_Transmit()
|
||||
|
||||
DTMF_Reply();
|
||||
|
||||
BK4819_SetScramble(gCurrentVfo->SCRAMBLING_TYPE);
|
||||
if (gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_APOLLO)
|
||||
BK4819_PlaySingleTone(2525, 250, 0, gEeprom.DTMF_SIDE_TONE);
|
||||
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
if (gAlarmState != ALARM_STATE_OFF) {
|
||||
#ifdef ENABLE_TX1750
|
||||
if (gAlarmState == ALARM_STATE_TX1750)
|
||||
BK4819_TransmitTone(true, 1750);
|
||||
#endif
|
||||
#ifdef ENABLE_TX1750
|
||||
if (gAlarmState == ALARM_STATE_TX1750) {
|
||||
BK4819_TransmitTone(gEeprom.DTMF_SIDE_TONE, 1750);
|
||||
gAlarmState = ALARM_STATE_OFF;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
#ifdef ENABLE_ALARM
|
||||
if (gAlarmState == ALARM_STATE_TXALARM)
|
||||
BK4819_TransmitTone(true, 500);
|
||||
|
||||
gAlarmToneCounter = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SYSTEM_DelayMs(2);
|
||||
AUDIO_AudioPathOn();
|
||||
gEnableSpeaker = true;
|
||||
BK4819_ExitTxMute();
|
||||
|
||||
gVfoConfigureMode = VFO_CONFIGURE;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
BK4819_DisableScramble();
|
||||
#else
|
||||
if (gCurrentVfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
|
||||
BK4819_EnableScramble(gCurrentVfo->SCRAMBLING_TYPE - 1);
|
||||
else
|
||||
BK4819_DisableScramble();
|
||||
#endif
|
||||
|
||||
|
||||
if (gSetting_backlight_on_tx_rx & BACKLIGHT_ON_TR_TX) {
|
||||
BACKLIGHT_TurnOn();
|
||||
@@ -241,9 +243,7 @@ void FUNCTION_Transmit()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FUNCTION_Select(FUNCTION_Type_t Function)
|
||||
{
|
||||
void FUNCTION_Select(FUNCTION_Type_t Function) {
|
||||
const FUNCTION_Type_t PreviousFunction = gCurrentFunction;
|
||||
const bool bWasPowerSave = PreviousFunction == FUNCTION_POWER_SAVE;
|
||||
|
||||
@@ -298,10 +298,10 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
|
||||
}
|
||||
|
||||
gBatterySaveCountdown_10ms = battery_save_count_10ms;
|
||||
gSchedulePowerSave = false;
|
||||
gSchedulePowerSave = false;
|
||||
|
||||
#if defined(ENABLE_FMRADIO)
|
||||
if(Function != FUNCTION_INCOMING)
|
||||
if (Function != FUNCTION_INCOMING)
|
||||
gFM_RestoreCountdown_10ms = 0;
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FUNCTIONS_H
|
||||
#define FUNCTIONS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
enum FUNCTION_Type_t
|
||||
{
|
||||
enum FUNCTION_Type_t {
|
||||
FUNCTION_FOREGROUND = 0, // ???
|
||||
FUNCTION_TRANSMIT, // transmitting
|
||||
FUNCTION_MONITOR, // receiving with squelch forced open
|
||||
@@ -32,11 +32,12 @@ enum FUNCTION_Type_t
|
||||
};
|
||||
|
||||
typedef enum FUNCTION_Type_t FUNCTION_Type_t;
|
||||
|
||||
extern FUNCTION_Type_t gCurrentFunction;
|
||||
extern FUNCTION_Type_t gCurrentFunction;
|
||||
|
||||
void FUNCTION_Init(void);
|
||||
|
||||
void FUNCTION_Select(FUNCTION_Type_t Function);
|
||||
|
||||
bool FUNCTION_IsRx();
|
||||
|
||||
#endif
|
||||
|
@@ -137,10 +137,6 @@ void BATTERY_GetReadings(const bool bDisplayBatteryLevel)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((gScreenToDisplay == DISPLAY_MENU) && UI_MENU_GetCurrentMenuId() == MENU_VOL)
|
||||
gUpdateDisplay = true;
|
||||
|
||||
if (gBatteryCurrent < 501)
|
||||
{
|
||||
if (gChargingWithTypeC)
|
||||
|
127
helper/boot.c
127
helper/boot.c
@@ -17,8 +17,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
#include "app/aircopy.h"
|
||||
#include "app/aircopy.h"
|
||||
#endif
|
||||
|
||||
#include "bsp/dp32g030/gpio.h"
|
||||
#include "driver/bk4819.h"
|
||||
#include "driver/keyboard.h"
|
||||
@@ -31,95 +32,77 @@
|
||||
#include "ui/menu.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
BOOT_Mode_t BOOT_GetMode(void)
|
||||
{
|
||||
#if defined(ENABLE_FEAT_F4HWN_RESCUE_OPS) || defined(ENABLE_AIRCOPY)
|
||||
BOOT_Mode_t BOOT_GetMode(void) {
|
||||
unsigned int i;
|
||||
KEY_Code_t Keys[2];
|
||||
KEY_Code_t Keys[2];
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
||||
return BOOT_MODE_NORMAL; // PTT not pressed
|
||||
Keys[i] = KEYBOARD_Poll();
|
||||
SYSTEM_DelayMs(20);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
if (Keys[0] == (10 + gEeprom.SET_KEY))
|
||||
{
|
||||
return BOOT_MODE_RESCUE_OPS; // Secret KEY pressed
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Keys[0] == Keys[1])
|
||||
{
|
||||
if (Keys[0] == Keys[1]) {
|
||||
gKeyReading0 = Keys[0];
|
||||
gKeyReading1 = Keys[0];
|
||||
|
||||
gDebounceCounter = 2;
|
||||
|
||||
if (Keys[0] == KEY_SIDE1)
|
||||
return BOOT_MODE_F_LOCK;
|
||||
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
if (Keys[0] == KEY_SIDE2)
|
||||
return BOOT_MODE_AIRCOPY;
|
||||
#endif
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
if (Keys[0] == KEY_SIDE2)
|
||||
return BOOT_MODE_AIRCOPY;
|
||||
#endif
|
||||
}
|
||||
|
||||
return BOOT_MODE_NORMAL;
|
||||
}
|
||||
|
||||
void BOOT_ProcessMode(BOOT_Mode_t Mode)
|
||||
{
|
||||
if (Mode == BOOT_MODE_F_LOCK)
|
||||
void BOOT_ProcessMode(BOOT_Mode_t Mode) {
|
||||
Mode = Mode;
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
if (Mode == BOOT_MODE_AIRCOPY)
|
||||
{
|
||||
GUI_SelectNextDisplay(DISPLAY_MENU);
|
||||
}
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
else
|
||||
if (Mode == BOOT_MODE_AIRCOPY)
|
||||
{
|
||||
gEeprom.DUAL_WATCH = DUAL_WATCH_OFF;
|
||||
gEeprom.BATTERY_SAVE = 0;
|
||||
#ifdef ENABLE_VOX
|
||||
gEeprom.VOX_SWITCH = false;
|
||||
#endif
|
||||
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
|
||||
gEeprom.AUTO_KEYPAD_LOCK = false;
|
||||
gEeprom.KEY_1_SHORT_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_1_LONG_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_2_SHORT_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_2_LONG_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_M_LONG_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
|
||||
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_LAST - 1, 43400000); // LPD
|
||||
|
||||
gRxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_NARROW;
|
||||
gRxVfo->OUTPUT_POWER = OUTPUT_POWER_LOW1;
|
||||
|
||||
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
|
||||
|
||||
gCurrentVfo = gRxVfo;
|
||||
|
||||
RADIO_SetupRegisters(true);
|
||||
BK4819_SetupAircopy();
|
||||
BK4819_ResetFSK();
|
||||
|
||||
gAircopyState = AIRCOPY_READY;
|
||||
|
||||
gEeprom.BACKLIGHT_TIME = 61;
|
||||
gEeprom.KEY_LOCK = 0;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gEeprom.CURRENT_STATE = 0; // Don't scan if scan resume is active...
|
||||
#endif
|
||||
|
||||
GUI_SelectNextDisplay(DISPLAY_AIRCOPY);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||
gEeprom.DUAL_WATCH = DUAL_WATCH_OFF;
|
||||
gEeprom.BATTERY_SAVE = 0;
|
||||
#ifdef ENABLE_VOX
|
||||
gEeprom.VOX_SWITCH = false;
|
||||
#endif
|
||||
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
|
||||
gEeprom.AUTO_KEYPAD_LOCK = false;
|
||||
gEeprom.KEY_1_SHORT_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_1_LONG_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_2_SHORT_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_2_LONG_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_M_LONG_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
|
||||
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_LAST - 1, 43400000); // LPD
|
||||
|
||||
gRxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_NARROW;
|
||||
gRxVfo->OUTPUT_POWER = OUTPUT_POWER_LOW1;
|
||||
|
||||
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
|
||||
|
||||
gCurrentVfo = gRxVfo;
|
||||
|
||||
RADIO_SetupRegisters(true);
|
||||
BK4819_SetupAircopy();
|
||||
BK4819_ResetFSK();
|
||||
|
||||
gAircopyState = AIRCOPY_READY;
|
||||
|
||||
gEeprom.BACKLIGHT_TIME = 61;
|
||||
gEeprom.KEY_LOCK = 0;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
gEeprom.CURRENT_STATE = 0; // Don't resume is active...
|
||||
#endif
|
||||
|
||||
GUI_SelectNextDisplay(DISPLAY_AIRCOPY);
|
||||
}
|
||||
#endif
|
||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -20,10 +20,10 @@
|
||||
#include <stdint.h>
|
||||
#include "driver/keyboard.h"
|
||||
|
||||
#if defined(ENABLE_FEAT_F4HWN_RESCUE_OPS) || defined(ENABLE_AIRCOPY)
|
||||
enum BOOT_Mode_t
|
||||
{
|
||||
BOOT_MODE_NORMAL = 0,
|
||||
BOOT_MODE_F_LOCK,
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
BOOT_MODE_RESCUE_OPS,
|
||||
#endif
|
||||
@@ -38,4 +38,4 @@ BOOT_Mode_t BOOT_GetMode(void);
|
||||
void BOOT_ProcessMode(BOOT_Mode_t Mode);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
191
main.c
191
main.c
@@ -19,7 +19,9 @@
|
||||
#include <stdio.h> // NULL
|
||||
|
||||
#ifdef ENABLE_AM_FIX
|
||||
#include "am_fix.h"
|
||||
|
||||
#include "am_fix.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "audio.h"
|
||||
@@ -30,14 +32,20 @@
|
||||
#include "version.h"
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
#ifdef ENABLE_FMRADIO
|
||||
#include "app/action.h"
|
||||
#include "ui/ui.h"
|
||||
#endif
|
||||
#ifdef ENABLE_SPECTRUM
|
||||
#include "app/spectrum.h"
|
||||
#endif
|
||||
#include "app/chFrScanner.h"
|
||||
#ifdef ENABLE_FMRADIO
|
||||
|
||||
#include "app/action.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
#endif
|
||||
#ifdef ENABLE_SPECTRUM
|
||||
|
||||
#include "app/spectrum.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "app/chFrScanner.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "app/app.h"
|
||||
@@ -51,8 +59,11 @@
|
||||
#include "driver/system.h"
|
||||
#include "driver/systick.h"
|
||||
#include "driver/eeprom.h"
|
||||
|
||||
#ifdef ENABLE_UART
|
||||
#include "driver/uart.h"
|
||||
|
||||
#include "driver/uart.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "helper/battery.h"
|
||||
@@ -61,28 +72,27 @@
|
||||
#include "ui/lock.h"
|
||||
#include "ui/welcome.h"
|
||||
#include "ui/menu.h"
|
||||
void _putchar(__attribute__((unused)) char c)
|
||||
{
|
||||
|
||||
void _putchar(__attribute__((unused)) char c) {
|
||||
|
||||
#ifdef ENABLE_UART
|
||||
UART_Send((uint8_t *)&c, 1);
|
||||
UART_Send((uint8_t *) &c, 1);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void Main(void)
|
||||
{
|
||||
void Main(void) {
|
||||
// Enable clock gating of blocks we need
|
||||
SYSCON_DEV_CLK_GATE = 0
|
||||
| SYSCON_DEV_CLK_GATE_GPIOA_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_GPIOB_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_GPIOC_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_UART1_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_SPI0_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_SARADC_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_CRC_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_AES_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_PWM_PLUS0_BITS_ENABLE;
|
||||
| SYSCON_DEV_CLK_GATE_GPIOA_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_GPIOB_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_GPIOC_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_UART1_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_SPI0_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_SARADC_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_CRC_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_AES_BITS_ENABLE
|
||||
| SYSCON_DEV_CLK_GATE_PWM_PLUS0_BITS_ENABLE;
|
||||
|
||||
|
||||
SYSTICK_Init();
|
||||
@@ -106,10 +116,10 @@ void Main(void)
|
||||
|
||||
SETTINGS_InitEEPROM();
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gDW = gEeprom.DUAL_WATCH;
|
||||
gCB = gEeprom.CROSS_BAND_RX_TX;
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gDW = gEeprom.DUAL_WATCH;
|
||||
gCB = gEeprom.CROSS_BAND_RX_TX;
|
||||
#endif
|
||||
|
||||
SETTINGS_WriteBuildOptions();
|
||||
SETTINGS_LoadCalibration();
|
||||
@@ -130,7 +140,8 @@ void Main(void)
|
||||
AM_fix_init();
|
||||
#endif
|
||||
|
||||
BOOT_Mode_t BootMode = BOOT_GetMode();
|
||||
#if defined(ENABLE_FEAT_F4HWN_RESCUE_OPS) || defined(ENABLE_AIRCOPY)
|
||||
BOOT_Mode_t BootMode = BOOT_GetMode();
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
if (BootMode == BOOT_MODE_RESCUE_OPS)
|
||||
@@ -150,56 +161,26 @@ void Main(void)
|
||||
*/
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
if (BootMode == BOOT_MODE_F_LOCK && gEeprom.MENU_LOCK == true)
|
||||
{
|
||||
BootMode = BOOT_MODE_NORMAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (BootMode == BOOT_MODE_F_LOCK)
|
||||
{
|
||||
|
||||
gF_LOCK = true; // flag to say include the hidden menu items
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gEeprom.KEY_LOCK = 0;
|
||||
SETTINGS_SaveSettings();
|
||||
#ifndef ENABLE_VOX
|
||||
gMenuCursor = 67; // move to hidden section, fix me if change... !!! Remove VOX and Mic Bar
|
||||
#else
|
||||
gMenuCursor = 68; // move to hidden section, fix me if change... !!!
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NOAA
|
||||
gMenuCursor += 1; // move to hidden section, fix me if change... !!!
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
gMenuCursor += 1; // move to hidden section, fix me if change... !!!
|
||||
#endif
|
||||
gSubMenuSelection = gSetting_F_LOCK;
|
||||
#endif
|
||||
}
|
||||
|
||||
// count the number of menu items
|
||||
gMenuListCount = 0;
|
||||
while (MenuList[gMenuListCount].name[0] != '\0') {
|
||||
if(!gF_LOCK && MenuList[gMenuListCount].menu_id == FIRST_HIDDEN_MENU_ITEM)
|
||||
break;
|
||||
|
||||
gMenuListCount++;
|
||||
}
|
||||
|
||||
// wait for user to release all butts before moving on
|
||||
if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT) ||
|
||||
KEYBOARD_Poll() != KEY_INVALID ||
|
||||
BootMode != BOOT_MODE_NORMAL)
|
||||
{ // keys are pressed
|
||||
KEYBOARD_Poll() != KEY_INVALID
|
||||
#if defined(ENABLE_FEAT_F4HWN_RESCUE_OPS) || defined(ENABLE_AIRCOPY)
|
||||
|| BootMode != BOOT_MODE_NORMAL
|
||||
#endif
|
||||
) { // keys are pressed
|
||||
UI_DisplayReleaseKeys();
|
||||
BACKLIGHT_TurnOn();
|
||||
|
||||
// 500ms
|
||||
for (int i = 0; i < 50;)
|
||||
{
|
||||
for (int i = 0; i < 50;) {
|
||||
i = (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT) && KEYBOARD_Poll() == KEY_INVALID) ? i + 1 : 0;
|
||||
SYSTEM_DelayMs(10);
|
||||
}
|
||||
@@ -208,8 +189,7 @@ void Main(void)
|
||||
gDebounceCounter = 0;
|
||||
}
|
||||
|
||||
if (!gChargingWithTypeC && gBatteryDisplayLevel == 0)
|
||||
{
|
||||
if (!gChargingWithTypeC && gBatteryDisplayLevel == 0) {
|
||||
FUNCTION_Select(FUNCTION_POWER_SAVE);
|
||||
|
||||
if (gEeprom.BACKLIGHT_TIME < 61) // backlight is not set to be always on
|
||||
@@ -218,29 +198,11 @@ void Main(void)
|
||||
BACKLIGHT_TurnOn(); // turn the backlight ON
|
||||
|
||||
gReducedService = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
UI_DisplayWelcome();
|
||||
|
||||
BACKLIGHT_TurnOn();
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE && gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_SOUND)
|
||||
#else
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE)
|
||||
#endif
|
||||
{ // 2.55 second boot-up screen
|
||||
while (boot_counter_10ms > 0)
|
||||
{
|
||||
if (KEYBOARD_Poll() != KEY_INVALID)
|
||||
{ // halt boot beeps
|
||||
boot_counter_10ms = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
RADIO_SetupRegisters(true);
|
||||
}
|
||||
RADIO_SetupRegisters(true);
|
||||
|
||||
#ifdef ENABLE_PWRON_PASSWORD
|
||||
if (gEeprom.POWER_ON_PASSWORD < 1000000)
|
||||
@@ -261,7 +223,9 @@ void Main(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_FEAT_F4HWN_RESCUE_OPS) || defined(ENABLE_AIRCOPY)
|
||||
BOOT_ProcessMode(BootMode);
|
||||
#endif
|
||||
|
||||
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0);
|
||||
|
||||
@@ -335,36 +299,35 @@ void Main(void)
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
if (gEeprom.CURRENT_STATE == 2 || gEeprom.CURRENT_STATE == 5) {
|
||||
gScanRangeStart = gScanRangeStart ? 0 : gTxVfo->pRX->Frequency;
|
||||
gScanRangeStop = gEeprom.VfoInfo[!gEeprom.TX_VFO].freq_config_RX.Frequency;
|
||||
if (gScanRangeStart > gScanRangeStop) {
|
||||
SWAP(gScanRangeStart, gScanRangeStop);
|
||||
}
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
if (gEeprom.CURRENT_STATE == 2 || gEeprom.CURRENT_STATE == 5) {
|
||||
gScanRangeStart = gScanRangeStart ? 0 : gTxVfo->pRX->Frequency;
|
||||
gScanRangeStop = gEeprom.VfoInfo[!gEeprom.TX_VFO].freq_config_RX.Frequency;
|
||||
if (gScanRangeStart > gScanRangeStop) {
|
||||
SWAP(gScanRangeStart, gScanRangeStop);
|
||||
}
|
||||
}
|
||||
|
||||
if (gEeprom.CURRENT_STATE == 1) {
|
||||
gEeprom.SCAN_LIST_DEFAULT = gEeprom.CURRENT_LIST;
|
||||
}
|
||||
if (gEeprom.CURRENT_STATE == 1) {
|
||||
gEeprom.SCAN_LIST_DEFAULT = gEeprom.CURRENT_LIST;
|
||||
}
|
||||
|
||||
if (gEeprom.CURRENT_STATE == 1 || gEeprom.CURRENT_STATE == 2) {
|
||||
CHFRSCANNER_Start(true, SCAN_FWD);
|
||||
}
|
||||
#ifdef ENABLE_FMRADIO
|
||||
else if (gEeprom.CURRENT_STATE == 3) {
|
||||
ACTION_FM();
|
||||
GUI_SelectNextDisplay(gRequestDisplayScreen);
|
||||
}
|
||||
#endif
|
||||
#ifdef ENABLE_SPECTRUM
|
||||
else if (gEeprom.CURRENT_STATE == 4 || gEeprom.CURRENT_STATE == 5) {
|
||||
APP_RunSpectrum();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (gEeprom.CURRENT_STATE == 1 || gEeprom.CURRENT_STATE == 2) {
|
||||
CHFRSCANNER_Start(true, SCAN_FWD);
|
||||
}
|
||||
#ifdef ENABLE_FMRADIO
|
||||
else if (gEeprom.CURRENT_STATE == 3) {
|
||||
ACTION_FM();
|
||||
GUI_SelectNextDisplay(gRequestDisplayScreen);
|
||||
}
|
||||
#endif
|
||||
#ifdef ENABLE_SPECTRUM
|
||||
else if (gEeprom.CURRENT_STATE == 4 || gEeprom.CURRENT_STATE == 5) {
|
||||
APP_RunSpectrum();
|
||||
}
|
||||
#endif
|
||||
// Pas besoin de `default`, aucun effet si l'état n'est pas traité.
|
||||
#endif
|
||||
|
||||
while (true) {
|
||||
APP_Update();
|
||||
|
||||
|
18
misc.c
18
misc.c
@@ -91,16 +91,10 @@ const uint8_t gMicGain_dB2[5] = {3, 8, 16, 24, 31};
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
bool gSetting_350TX;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
bool gSetting_KILLED;
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
bool gSetting_200TX;
|
||||
bool gSetting_500TX;
|
||||
#endif
|
||||
bool gSetting_350EN;
|
||||
uint8_t gSetting_F_LOCK;
|
||||
bool gSetting_ScrambleEnable;
|
||||
|
||||
@@ -116,18 +110,8 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
uint8_t gSetting_set_pwr = 1;
|
||||
bool gSetting_set_ptt = 0;
|
||||
uint8_t gSetting_set_tot = 0;
|
||||
uint8_t gSetting_set_ctr = 10;
|
||||
bool gSetting_set_inv = false;
|
||||
uint8_t gSetting_set_eot = 0;
|
||||
bool gSetting_set_lck = false;
|
||||
bool gSetting_set_met = 0;
|
||||
bool gSetting_set_gui = 0;
|
||||
#ifdef ENABLE_FEAT_F4HWN_NARROWER
|
||||
bool gSetting_set_nfm = 0;
|
||||
#endif
|
||||
bool gSetting_set_tmr = 0;
|
||||
bool gSetting_set_ptt_session;
|
||||
#ifdef ENABLE_FEAT_F4HWN_DEBUG
|
||||
@@ -139,10 +123,8 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
||||
uint8_t crc[15] = { 0 };
|
||||
uint8_t lErrorsDuringAirCopy = 0;
|
||||
uint8_t gAircopyStep = 0;
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
bool gPowerHigh = false;
|
||||
bool gRemoveOffset = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_AUDIO_BAR
|
||||
|
18
misc.h
18
misc.h
@@ -143,17 +143,11 @@ extern const uint8_t gMicGain_dB2[5];
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
extern bool gSetting_350TX;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
extern bool gSetting_KILLED;
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
extern bool gSetting_200TX;
|
||||
extern bool gSetting_500TX;
|
||||
#endif
|
||||
|
||||
extern bool gSetting_350EN;
|
||||
extern uint8_t gSetting_F_LOCK;
|
||||
extern bool gSetting_ScrambleEnable;
|
||||
|
||||
@@ -169,18 +163,8 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
extern uint8_t gSetting_set_pwr;
|
||||
extern bool gSetting_set_ptt;
|
||||
extern uint8_t gSetting_set_tot;
|
||||
extern uint8_t gSetting_set_ctr;
|
||||
extern bool gSetting_set_inv;
|
||||
extern uint8_t gSetting_set_eot;
|
||||
extern bool gSetting_set_lck;
|
||||
extern bool gSetting_set_met;
|
||||
extern bool gSetting_set_gui;
|
||||
#ifdef ENABLE_FEAT_F4HWN_NARROWER
|
||||
extern bool gSetting_set_nfm;
|
||||
#endif
|
||||
extern bool gSetting_set_tmr;
|
||||
extern bool gSetting_set_ptt_session;
|
||||
#ifdef ENABLE_FEAT_F4HWN_DEBUG
|
||||
@@ -192,10 +176,8 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
||||
extern uint8_t crc[15];
|
||||
extern uint8_t lErrorsDuringAirCopy;
|
||||
extern uint8_t gAircopyStep;
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
extern bool gPowerHigh;
|
||||
extern bool gRemoveOffset;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_AUDIO_BAR
|
||||
|
@@ -1,4 +0,0 @@
|
||||
#define PRINTF_DISABLE_SUPPORT_LONG_LONG
|
||||
#define PRINTF_DISABLE_SUPPORT_EXPONENTIAL
|
||||
#define PRINTF_DISABLE_SUPPORT_PTRDIFF_T
|
||||
#define PRINTF_DISABLE_SUPPORT_FLOAT
|
128
radio.h
128
radio.h
@@ -24,7 +24,7 @@
|
||||
#include "frequencies.h"
|
||||
|
||||
enum {
|
||||
RADIO_CHANNEL_UP = 0x01u,
|
||||
RADIO_CHANNEL_UP = 0x01u,
|
||||
RADIO_CHANNEL_DOWN = 0xFFu,
|
||||
};
|
||||
|
||||
@@ -42,8 +42,7 @@ enum PTT_ID_t {
|
||||
};
|
||||
typedef enum PTT_ID_t PTT_ID_t;
|
||||
|
||||
enum VfoState_t
|
||||
{
|
||||
enum VfoState_t {
|
||||
VFO_STATE_NORMAL = 0,
|
||||
VFO_STATE_BUSY,
|
||||
VFO_STATE_BAT_LOW,
|
||||
@@ -70,18 +69,16 @@ typedef enum {
|
||||
|
||||
extern const char gModulationStr[MODULATION_UKNOWN][4];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Frequency;
|
||||
typedef struct {
|
||||
uint32_t Frequency;
|
||||
DCS_CodeType_t CodeType;
|
||||
uint8_t Code;
|
||||
uint8_t Padding[2];
|
||||
uint8_t Code;
|
||||
uint8_t Padding[2];
|
||||
} FREQ_Config_t;
|
||||
|
||||
typedef struct VFO_Info_t
|
||||
{
|
||||
FREQ_Config_t freq_config_RX;
|
||||
FREQ_Config_t freq_config_TX;
|
||||
typedef struct VFO_Info_t {
|
||||
FREQ_Config_t freq_config_RX;
|
||||
FREQ_Config_t freq_config_TX;
|
||||
|
||||
// this is for a purpose of the FrequencyReverse function
|
||||
// it points to freq_config_RX normally and to freq_config_TX if reverse function is active
|
||||
@@ -92,82 +89,97 @@ typedef struct VFO_Info_t
|
||||
// it points to freq_config_TX normally and to freq_config_RX if reverse function is active
|
||||
FREQ_Config_t *pTX;
|
||||
|
||||
uint32_t TX_OFFSET_FREQUENCY;
|
||||
uint16_t StepFrequency;
|
||||
uint32_t TX_OFFSET_FREQUENCY;
|
||||
uint16_t StepFrequency;
|
||||
|
||||
uint8_t CHANNEL_SAVE;
|
||||
uint8_t CHANNEL_SAVE;
|
||||
|
||||
uint8_t TX_OFFSET_FREQUENCY_DIRECTION;
|
||||
uint8_t TX_OFFSET_FREQUENCY_DIRECTION;
|
||||
|
||||
uint8_t SquelchOpenRSSIThresh;
|
||||
uint8_t SquelchOpenNoiseThresh;
|
||||
uint8_t SquelchCloseGlitchThresh;
|
||||
uint8_t SquelchCloseRSSIThresh;
|
||||
uint8_t SquelchCloseNoiseThresh;
|
||||
uint8_t SquelchOpenGlitchThresh;
|
||||
uint8_t SquelchOpenRSSIThresh;
|
||||
uint8_t SquelchOpenNoiseThresh;
|
||||
uint8_t SquelchCloseGlitchThresh;
|
||||
uint8_t SquelchCloseRSSIThresh;
|
||||
uint8_t SquelchCloseNoiseThresh;
|
||||
uint8_t SquelchOpenGlitchThresh;
|
||||
|
||||
STEP_Setting_t STEP_SETTING;
|
||||
uint8_t TX_LOCK;
|
||||
uint8_t OUTPUT_POWER;
|
||||
uint8_t TXP_CalculatedSetting;
|
||||
bool FrequencyReverse;
|
||||
uint8_t OUTPUT_POWER;
|
||||
uint8_t TXP_CalculatedSetting;
|
||||
bool FrequencyReverse;
|
||||
|
||||
uint8_t SCRAMBLING_TYPE;
|
||||
uint8_t CHANNEL_BANDWIDTH;
|
||||
uint16_t SCRAMBLING_TYPE;
|
||||
uint8_t CHANNEL_BANDWIDTH;
|
||||
|
||||
uint8_t SCANLIST1_PARTICIPATION;
|
||||
uint8_t SCANLIST2_PARTICIPATION;
|
||||
uint8_t SCANLIST3_PARTICIPATION;
|
||||
uint8_t SCANLIST1_PARTICIPATION;
|
||||
uint8_t SCANLIST2_PARTICIPATION;
|
||||
uint8_t SCANLIST3_PARTICIPATION;
|
||||
|
||||
uint8_t Band;
|
||||
uint8_t Band;
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
uint8_t DTMF_DECODING_ENABLE;
|
||||
#endif
|
||||
PTT_ID_t DTMF_PTT_ID_TX_MODE;
|
||||
PTT_ID_t DTMF_PTT_ID_TX_MODE;
|
||||
|
||||
uint8_t BUSY_CHANNEL_LOCK;
|
||||
uint8_t BUSY_CHANNEL_LOCK;
|
||||
|
||||
ModulationMode_t Modulation;
|
||||
ModulationMode_t Modulation;
|
||||
|
||||
uint8_t Compander;
|
||||
uint8_t Compander;
|
||||
|
||||
char Name[16];
|
||||
char Name[16];
|
||||
} VFO_Info_t;
|
||||
|
||||
// Settings of the main VFO that is selected by the user
|
||||
// The pointer follows gEeprom.TX_VFO index
|
||||
extern VFO_Info_t *gTxVfo;
|
||||
extern VFO_Info_t *gTxVfo;
|
||||
|
||||
// Settings of the actual VFO that is now used for RX,
|
||||
// It is being alternated by dual watch, and flipped by crossband
|
||||
// The pointer follows gEeprom.RX_VFO
|
||||
extern VFO_Info_t *gRxVfo;
|
||||
extern VFO_Info_t *gRxVfo;
|
||||
|
||||
// Equal to gTxVfo unless dual watch changes it on incomming transmition (this can only happen when XB off and DW on)
|
||||
extern VFO_Info_t *gCurrentVfo;
|
||||
extern VFO_Info_t *gCurrentVfo;
|
||||
|
||||
extern DCS_CodeType_t gCurrentCodeType;
|
||||
|
||||
extern VfoState_t VfoState[2];
|
||||
extern VfoState_t VfoState[2];
|
||||
|
||||
bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanList);
|
||||
|
||||
uint8_t RADIO_FindNextChannel(uint8_t ChNum, int8_t Direction, bool bCheckScanList, uint8_t RadioNum);
|
||||
|
||||
void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const uint32_t Frequency);
|
||||
|
||||
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure);
|
||||
|
||||
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo);
|
||||
|
||||
void RADIO_ApplyOffset(VFO_Info_t *pInfo);
|
||||
|
||||
void RADIO_SelectVfos(void);
|
||||
|
||||
void RADIO_SetupRegisters(bool switchToForeground);
|
||||
|
||||
bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanList);
|
||||
uint8_t RADIO_FindNextChannel(uint8_t ChNum, int8_t Direction, bool bCheckScanList, uint8_t RadioNum);
|
||||
void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const uint32_t Frequency);
|
||||
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure);
|
||||
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo);
|
||||
void RADIO_ApplyOffset(VFO_Info_t *pInfo);
|
||||
void RADIO_SelectVfos(void);
|
||||
void RADIO_SetupRegisters(bool switchToForeground);
|
||||
#ifdef ENABLE_NOAA
|
||||
void RADIO_ConfigureNOAA(void);
|
||||
void RADIO_ConfigureNOAA(void);
|
||||
#endif
|
||||
void RADIO_SetTxParameters(void);
|
||||
void RADIO_SetupAGC(bool listeningAM, bool disable);
|
||||
void RADIO_SetModulation(ModulationMode_t modulation);
|
||||
void RADIO_SetVfoState(VfoState_t State);
|
||||
void RADIO_PrepareTX(void);
|
||||
void RADIO_SendCssTail(void);
|
||||
void RADIO_PrepareCssTX(void);
|
||||
void RADIO_SendEndOfTransmission(void);
|
||||
|
||||
void RADIO_SetTxParameters(void);
|
||||
|
||||
void RADIO_SetupAGC(bool listeningAM, bool disable);
|
||||
|
||||
void RADIO_SetModulation(ModulationMode_t modulation);
|
||||
|
||||
void RADIO_SetVfoState(VfoState_t State);
|
||||
|
||||
void RADIO_PrepareTX(void);
|
||||
|
||||
void RADIO_SendCssTail(void);
|
||||
|
||||
void RADIO_PrepareCssTX(void);
|
||||
|
||||
void RADIO_SendEndOfTransmission(void);
|
||||
|
||||
#endif
|
||||
|
@@ -57,13 +57,14 @@ void SystickHandler(void)
|
||||
gNextTimeslice_500ms = true;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
DECREMENT_AND_TRIGGER(gTxTimerCountdownAlert_500ms - ALERT_TOT * 2, gTxTimeoutReachedAlert);
|
||||
#ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER
|
||||
DECREMENT(gRxTimerCountdown_500ms);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
||||
|
||||
if (gEeprom.TX_TIMEOUT_TIMER != 0) {
|
||||
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
||||
}
|
||||
DECREMENT(gSerialConfigCountDown_500ms);
|
||||
}
|
||||
|
||||
|
823
settings.c
823
settings.c
File diff suppressed because it is too large
Load Diff
253
settings.h
253
settings.h
@@ -23,8 +23,20 @@
|
||||
#include "frequencies.h"
|
||||
#include <helper/battery.h>
|
||||
#include "radio.h"
|
||||
#include "functions.h"
|
||||
#include "app/fskmodem.h"
|
||||
#include <driver/backlight.h>
|
||||
|
||||
// Modem Modulation
|
||||
typedef enum ModemModulation {
|
||||
MOD_FSK_450, // for bad conditions
|
||||
MOD_FSK_700, // for medium conditions
|
||||
MOD_AFSK_1200, // for good conditions
|
||||
MOD_AFSK_2400,
|
||||
MOD_FSK_1200_2400,
|
||||
MOD_NOAA_SAME
|
||||
} ModemModulation;
|
||||
|
||||
enum POWER_OnDisplayMode_t {
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
POWER_ON_DISPLAY_MODE_ALL,
|
||||
@@ -40,14 +52,14 @@ typedef enum POWER_OnDisplayMode_t POWER_OnDisplayMode_t;
|
||||
|
||||
enum TxLockModes_t {
|
||||
F_LOCK_DEF, //all default frequencies + configurable
|
||||
F_LOCK_FCC,
|
||||
#ifdef ENABLE_FEAT_F4HWN_CA
|
||||
F_LOCK_FCC,
|
||||
F_LOCK_CA,
|
||||
#endif
|
||||
F_LOCK_CE,
|
||||
F_LOCK_GB,
|
||||
F_LOCK_430,
|
||||
F_LOCK_438,
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_PMR
|
||||
F_LOCK_PMR,
|
||||
#endif
|
||||
@@ -86,8 +98,7 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
OUTPUT_POWER_USER = 0,
|
||||
OUTPUT_POWER_LOW1,
|
||||
OUTPUT_POWER_LOW1 = 0,
|
||||
OUTPUT_POWER_LOW2,
|
||||
OUTPUT_POWER_LOW3,
|
||||
OUTPUT_POWER_LOW4,
|
||||
@@ -113,15 +124,10 @@ enum ACTION_OPT_t {
|
||||
ACTION_OPT_BLMIN_TMP_OFF, //BackLight Minimum Temporay OFF
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
ACTION_OPT_RXMODE,
|
||||
ACTION_OPT_MAINONLY,
|
||||
ACTION_OPT_PTT,
|
||||
ACTION_OPT_WN,
|
||||
ACTION_OPT_BACKLIGHT,
|
||||
ACTION_OPT_MUTE,
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
ACTION_OPT_POWER_HIGH,
|
||||
ACTION_OPT_REMOVE_OFFSET,
|
||||
#endif
|
||||
#endif
|
||||
#ifdef ENABLE_REGA
|
||||
ACTION_OPT_REGA_ALARM,
|
||||
@@ -131,13 +137,13 @@ enum ACTION_OPT_t {
|
||||
};
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
enum VOICE_Prompt_t
|
||||
{
|
||||
VOICE_PROMPT_OFF = 0,
|
||||
VOICE_PROMPT_CHINESE,
|
||||
VOICE_PROMPT_ENGLISH
|
||||
};
|
||||
typedef enum VOICE_Prompt_t VOICE_Prompt_t;
|
||||
enum VOICE_Prompt_t
|
||||
{
|
||||
VOICE_PROMPT_OFF = 0,
|
||||
VOICE_PROMPT_CHINESE,
|
||||
VOICE_PROMPT_ENGLISH
|
||||
};
|
||||
typedef enum VOICE_Prompt_t VOICE_Prompt_t;
|
||||
#endif
|
||||
|
||||
enum ALARM_Mode_t {
|
||||
@@ -161,24 +167,37 @@ enum CHANNEL_DisplayMode_t {
|
||||
};
|
||||
typedef enum CHANNEL_DisplayMode_t CHANNEL_DisplayMode_t;
|
||||
|
||||
enum BK1080_DEEMPHASIS {
|
||||
DEEMPHASIS_OFF = 0,
|
||||
DEEMPHASIS_USA = 1,
|
||||
DEEMPHASIS_EUR = 2
|
||||
};
|
||||
|
||||
enum BK1080_BLEND {
|
||||
BLEND_DEF = 0,
|
||||
BLEND_POS6 = 1,
|
||||
BLEND_NEG12 = 2,
|
||||
BLEND_NEG6 = 3
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint8_t ScreenChannel[2]; // current channels set in the radio (memory or frequency channels)
|
||||
uint8_t FreqChannel[2]; // last frequency channels used
|
||||
uint8_t MrChannel[2]; // last memory channels used
|
||||
uint8_t ScreenChannel[2]; // current channels set in the radio (memory or frequency channels)
|
||||
uint8_t FreqChannel[2]; // last frequency channels used
|
||||
uint8_t MrChannel[2]; // last memory channels used
|
||||
#ifdef ENABLE_NOAA
|
||||
uint8_t NoaaChannel[2];
|
||||
#endif
|
||||
|
||||
// The actual VFO index (0-upper/1-lower) that is now used for RX,
|
||||
// It is being alternated by dual watch, and flipped by crossband
|
||||
uint8_t RX_VFO;
|
||||
uint8_t RX_VFO;
|
||||
|
||||
// The main VFO index (0-upper/1-lower) selected by the user
|
||||
//
|
||||
uint8_t TX_VFO;
|
||||
uint8_t TX_VFO;
|
||||
|
||||
uint8_t field7_0xa;
|
||||
uint8_t field8_0xb;
|
||||
uint8_t field7_0xa;
|
||||
uint8_t field8_0xb;
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
uint16_t FM_SelectedFrequency;
|
||||
@@ -186,148 +205,170 @@ typedef struct {
|
||||
bool FM_IsMrMode;
|
||||
uint16_t FM_FrequencyPlaying;
|
||||
uint8_t FM_Band : 2;
|
||||
enum BK1080_DEEMPHASIS BK1080_DEEMPHASIS_CONFIG: 2;
|
||||
enum BK1080_BLEND BK1080_BLEND_CONFIG : 2;
|
||||
bool BK1080_AGC_ENABLED;
|
||||
//uint8_t FM_Space : 2;
|
||||
#endif
|
||||
|
||||
uint8_t SQUELCH_LEVEL;
|
||||
uint8_t TX_TIMEOUT_TIMER;
|
||||
bool KEY_LOCK;
|
||||
uint8_t SQUELCH_LEVEL;
|
||||
uint8_t TX_TIMEOUT_TIMER;
|
||||
bool KEY_LOCK;
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
bool KEY_LOCK_PTT;
|
||||
bool KEY_LOCK_PTT;
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
bool MENU_LOCK;
|
||||
uint8_t SET_KEY;
|
||||
#endif
|
||||
bool VOX_SWITCH;
|
||||
uint8_t VOX_LEVEL;
|
||||
bool VOX_SWITCH;
|
||||
uint8_t VOX_LEVEL;
|
||||
#ifdef ENABLE_VOICE
|
||||
VOICE_Prompt_t VOICE_PROMPT;
|
||||
#endif
|
||||
bool BEEP_CONTROL;
|
||||
uint8_t CHANNEL_DISPLAY_MODE;
|
||||
bool TAIL_TONE_ELIMINATION;
|
||||
bool VFO_OPEN;
|
||||
uint8_t DUAL_WATCH;
|
||||
uint8_t CROSS_BAND_RX_TX;
|
||||
uint8_t BATTERY_SAVE;
|
||||
uint8_t BACKLIGHT_TIME;
|
||||
uint8_t SCAN_RESUME_MODE;
|
||||
uint8_t SCAN_LIST_DEFAULT;
|
||||
bool SCAN_LIST_ENABLED[3];
|
||||
uint8_t SCANLIST_PRIORITY_CH1[3];
|
||||
uint8_t SCANLIST_PRIORITY_CH2[3];
|
||||
bool BEEP_CONTROL;
|
||||
uint8_t CHANNEL_DISPLAY_MODE;
|
||||
bool TAIL_TONE_ELIMINATION;
|
||||
bool VFO_OPEN;
|
||||
uint8_t DUAL_WATCH;
|
||||
uint8_t CROSS_BAND_RX_TX;
|
||||
uint8_t BATTERY_SAVE;
|
||||
uint8_t BACKLIGHT_TIME;
|
||||
uint8_t SCAN_RESUME_MODE;
|
||||
uint8_t SCAN_LIST_DEFAULT;
|
||||
bool SCAN_LIST_ENABLED[3];
|
||||
uint8_t SCANLIST_PRIORITY_CH1[3];
|
||||
uint8_t SCANLIST_PRIORITY_CH2[3];
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
uint8_t CURRENT_STATE;
|
||||
uint8_t CURRENT_LIST;
|
||||
uint8_t CURRENT_STATE;
|
||||
uint8_t CURRENT_LIST;
|
||||
#endif
|
||||
|
||||
uint8_t field29_0x26;
|
||||
uint8_t field30_0x27;
|
||||
|
||||
uint8_t field37_0x32;
|
||||
uint8_t field38_0x33;
|
||||
uint8_t field29_0x26;
|
||||
uint8_t field30_0x27;
|
||||
|
||||
uint8_t AUTO_KEYPAD_LOCK;
|
||||
uint8_t field37_0x32;
|
||||
uint8_t field38_0x33;
|
||||
|
||||
uint8_t AUTO_KEYPAD_LOCK;
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
ALARM_Mode_t ALARM_MODE;
|
||||
ALARM_Mode_t ALARM_MODE;
|
||||
#endif
|
||||
POWER_OnDisplayMode_t POWER_ON_DISPLAY_MODE;
|
||||
ROGER_Mode_t ROGER;
|
||||
uint8_t REPEATER_TAIL_TONE_ELIMINATION;
|
||||
uint8_t KEY_1_SHORT_PRESS_ACTION;
|
||||
uint8_t KEY_1_LONG_PRESS_ACTION;
|
||||
uint8_t KEY_2_SHORT_PRESS_ACTION;
|
||||
uint8_t KEY_2_LONG_PRESS_ACTION;
|
||||
uint8_t MIC_SENSITIVITY;
|
||||
uint8_t MIC_SENSITIVITY_TUNING;
|
||||
uint8_t CHAN_1_CALL;
|
||||
ROGER_Mode_t ROGER;
|
||||
uint8_t REPEATER_TAIL_TONE_ELIMINATION;
|
||||
uint8_t KEY_1_SHORT_PRESS_ACTION;
|
||||
uint8_t KEY_1_LONG_PRESS_ACTION;
|
||||
uint8_t KEY_2_SHORT_PRESS_ACTION;
|
||||
uint8_t KEY_2_LONG_PRESS_ACTION;
|
||||
uint8_t MIC_SENSITIVITY;
|
||||
uint8_t MIC_SENSITIVITY_TUNING;
|
||||
uint8_t CHAN_1_CALL;
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
char ANI_DTMF_ID[8];
|
||||
char KILL_CODE[8];
|
||||
char REVIVE_CODE[8];
|
||||
#endif
|
||||
char DTMF_UP_CODE[16];
|
||||
char DTMF_UP_CODE[16];
|
||||
|
||||
uint8_t field57_0x6c;
|
||||
uint8_t field58_0x6d;
|
||||
uint8_t field57_0x6c;
|
||||
uint8_t field58_0x6d;
|
||||
|
||||
char DTMF_DOWN_CODE[16];
|
||||
char DTMF_DOWN_CODE[16];
|
||||
|
||||
uint8_t field60_0x7e;
|
||||
uint8_t field61_0x7f;
|
||||
uint8_t field60_0x7e;
|
||||
uint8_t field61_0x7f;
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
char DTMF_SEPARATE_CODE;
|
||||
char DTMF_GROUP_CALL_CODE;
|
||||
uint8_t DTMF_DECODE_RESPONSE;
|
||||
uint8_t DTMF_auto_reset_time;
|
||||
#endif
|
||||
uint16_t DTMF_PRELOAD_TIME;
|
||||
uint16_t DTMF_FIRST_CODE_PERSIST_TIME;
|
||||
uint16_t DTMF_HASH_CODE_PERSIST_TIME;
|
||||
uint16_t DTMF_CODE_PERSIST_TIME;
|
||||
uint16_t DTMF_CODE_INTERVAL_TIME;
|
||||
bool DTMF_SIDE_TONE;
|
||||
#endif
|
||||
uint16_t DTMF_PRELOAD_TIME;
|
||||
uint16_t DTMF_FIRST_CODE_PERSIST_TIME;
|
||||
uint16_t DTMF_HASH_CODE_PERSIST_TIME;
|
||||
uint16_t DTMF_CODE_PERSIST_TIME;
|
||||
uint16_t DTMF_CODE_INTERVAL_TIME;
|
||||
bool DTMF_SIDE_TONE;
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
bool PERMIT_REMOTE_KILL;
|
||||
#endif
|
||||
int16_t BK4819_XTAL_FREQ_LOW;
|
||||
int16_t BK4819_XTAL_FREQ_LOW;
|
||||
#ifdef ENABLE_NOAA
|
||||
bool NOAA_AUTO_SCAN;
|
||||
#endif
|
||||
uint8_t VOLUME_GAIN;
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
uint8_t VOLUME_GAIN_BACKUP;
|
||||
#endif
|
||||
uint8_t DAC_GAIN;
|
||||
uint8_t VOLUME_GAIN;
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
uint8_t VOLUME_GAIN_BACKUP;
|
||||
#endif
|
||||
uint8_t DAC_GAIN;
|
||||
|
||||
VFO_Info_t VfoInfo[2];
|
||||
uint32_t POWER_ON_PASSWORD;
|
||||
uint16_t VOX1_THRESHOLD;
|
||||
uint16_t VOX0_THRESHOLD;
|
||||
VFO_Info_t VfoInfo[2];
|
||||
uint32_t POWER_ON_PASSWORD;
|
||||
uint16_t VOX1_THRESHOLD;
|
||||
uint16_t VOX0_THRESHOLD;
|
||||
|
||||
uint8_t field77_0x95;
|
||||
uint8_t field78_0x96;
|
||||
uint8_t field79_0x97;
|
||||
uint8_t field77_0x95;
|
||||
uint8_t field78_0x96;
|
||||
uint8_t field79_0x97;
|
||||
|
||||
uint8_t KEY_M_LONG_PRESS_ACTION;
|
||||
uint8_t BACKLIGHT_MIN;
|
||||
uint8_t KEY_M_LONG_PRESS_ACTION;
|
||||
uint8_t BACKLIGHT_MIN;
|
||||
#ifdef ENABLE_BLMIN_TMP_OFF
|
||||
BLMIN_STAT_t BACKLIGHT_MIN_STAT;
|
||||
BLMIN_STAT_t BACKLIGHT_MIN_STAT;
|
||||
#endif
|
||||
uint8_t BACKLIGHT_MAX;
|
||||
BATTERY_Type_t BATTERY_TYPE;
|
||||
uint8_t BACKLIGHT_MAX;
|
||||
BATTERY_Type_t BATTERY_TYPE;
|
||||
#ifdef ENABLE_RSSI_BAR
|
||||
uint8_t S0_LEVEL;
|
||||
uint8_t S9_LEVEL;
|
||||
uint8_t S0_LEVEL;
|
||||
uint8_t S9_LEVEL;
|
||||
#endif
|
||||
|
||||
ModemModulation FSKMode;
|
||||
uint32_t FSKSRCAddress;
|
||||
} EEPROM_Config_t;
|
||||
|
||||
extern EEPROM_Config_t gEeprom;
|
||||
|
||||
void SETTINGS_InitEEPROM(void);
|
||||
void SETTINGS_LoadCalibration(void);
|
||||
void SETTINGS_InitEEPROM(void);
|
||||
|
||||
void SETTINGS_LoadCalibration(void);
|
||||
|
||||
uint32_t SETTINGS_FetchChannelFrequency(const int channel);
|
||||
void SETTINGS_FetchChannelName(char *s, const int channel);
|
||||
void SETTINGS_FactoryReset(bool bIsAll);
|
||||
|
||||
void SETTINGS_FetchChannelName(char *s, const int channel);
|
||||
|
||||
void SETTINGS_FactoryReset(bool bIsAll);
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
void SETTINGS_SaveFM(void);
|
||||
void SETTINGS_SaveFM(void);
|
||||
#endif
|
||||
|
||||
void SETTINGS_SaveVfoIndices(void);
|
||||
|
||||
void SETTINGS_SaveSettings(void);
|
||||
void SETTINGS_SaveChannelName(uint8_t channel, const char * name);
|
||||
|
||||
void SETTINGS_SaveChannelName(uint8_t channel, const char *name);
|
||||
|
||||
void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, uint8_t Mode);
|
||||
void SETTINGS_SaveBatteryCalibration(const uint16_t * batteryCalibration);
|
||||
|
||||
void SETTINGS_SaveBatteryCalibration(const uint16_t *batteryCalibration);
|
||||
|
||||
void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep, bool check, bool save);
|
||||
|
||||
void SETTINGS_WriteBuildOptions(void);
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
void SETTINGS_WriteCurrentState(void);
|
||||
|
||||
void SETTINGS_WriteCurrentState(void);
|
||||
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_VOL
|
||||
void SETTINGS_WriteCurrentVol(void);
|
||||
|
||||
void SETTINGS_WriteCurrentVol(void);
|
||||
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
void SETTINGS_ResetTxLock(void);
|
||||
|
||||
void SETTINGS_ResetTxLock(void);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
10
ui/aircopy.c
10
ui/aircopy.c
@@ -52,7 +52,7 @@ void UI_DisplayAircopy(void)
|
||||
gAircopyState = AIRCOPY_READY;
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, 2, 127, 0, 8);
|
||||
UI_PrintString(pPrintStr, 2, 127, 0 /*, 8 */);
|
||||
|
||||
if (gInputBoxIndex == 0) {
|
||||
uint32_t frequency = gRxVfo->freq_config_RX.Frequency;
|
||||
@@ -61,11 +61,13 @@ void UI_DisplayAircopy(void)
|
||||
UI_PrintStringSmallNormal(String + 7, 97, 0, 3);
|
||||
String[7] = 0;
|
||||
// show the main large frequency digits
|
||||
UI_DisplayFrequency(String, 16, 2, false);
|
||||
//UI_DisplayFrequency(String, 16, 2, false);
|
||||
UI_PrintStringSmallNormal(String, 0, 20, 2);
|
||||
} else {
|
||||
const char *ascii = INPUTBOX_GetAscii();
|
||||
sprintf(String, "%.3s.%.3s", ascii, ascii + 3);
|
||||
UI_DisplayFrequency(String, 16, 2, false);
|
||||
//UI_DisplayFrequency(String, 16, 2, false);
|
||||
UI_PrintStringSmallNormal(String, 0, 20, 2);
|
||||
}
|
||||
|
||||
memset(String, 0, sizeof(String));
|
||||
@@ -81,7 +83,7 @@ void UI_DisplayAircopy(void)
|
||||
// Draw gauge
|
||||
if(gAircopyStep != 0)
|
||||
{
|
||||
UI_PrintString(String, 2, 127, 5, 8);
|
||||
UI_PrintString(String, 2, 127, 5 /*, 8 */);
|
||||
|
||||
gFrameBuffer[4][1] = 0x3c;
|
||||
gFrameBuffer[4][2] = 0x42;
|
||||
|
72
ui/fmradio.c
72
ui/fmradio.c
@@ -29,15 +29,63 @@
|
||||
#include "ui/inputbox.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
const char gBlendStrings[][4] = {
|
||||
"DEF",
|
||||
"+6 ",
|
||||
"-12",
|
||||
"-6 "
|
||||
};
|
||||
|
||||
const char gDeemphasisStrings[][3] = {
|
||||
"NO",
|
||||
"US",
|
||||
"EU"
|
||||
};
|
||||
|
||||
bool wasStereo;
|
||||
uint8_t oldRssi;
|
||||
|
||||
void UI_UpdateFMThings(bool force) {
|
||||
force = force;
|
||||
char String[16] = {0};
|
||||
const uint16_t Status = BK1080_ReadRegister(BK1080_REG_10_RSSI_STATUS);
|
||||
|
||||
bool isStereo = Status & (1 << 9);
|
||||
uint8_t rssi = Status & 0xFF;
|
||||
|
||||
if (!force && isStereo == wasStereo && rssi == oldRssi) {
|
||||
return;
|
||||
}
|
||||
oldRssi = rssi;
|
||||
wasStereo = isStereo;
|
||||
|
||||
sprintf(String, "%s RSSI%d/255",
|
||||
isStereo ? "STER" : "MONO", rssi);
|
||||
|
||||
UI_PrintStringSmallNormal(String, 1, 0, 4);
|
||||
ST7565_BlitLine(4);
|
||||
|
||||
}
|
||||
|
||||
void UI_DisplayFM(void)
|
||||
{
|
||||
char String[16] = {0};
|
||||
char *pPrintStr = String;
|
||||
UI_DisplayClear();
|
||||
|
||||
UI_PrintString("FM", 2, 0, 0, 8);
|
||||
UI_UpdateFMThings(true);
|
||||
|
||||
sprintf(String, "%d%s-%dM",
|
||||
UI_PrintString("FM", 2, 0, 0 /*, 8 */);
|
||||
|
||||
|
||||
sprintf(String, "%s D%s B%s",
|
||||
gEeprom.BK1080_AGC_ENABLED ? " AGC" : "NAGC",
|
||||
gDeemphasisStrings[gEeprom.BK1080_DEEMPHASIS_CONFIG],
|
||||
gBlendStrings[gEeprom.BK1080_BLEND_CONFIG]);
|
||||
|
||||
UI_PrintStringSmallNormal(String, 1, 0, 5);
|
||||
|
||||
sprintf(String, "%d%s-%dM",
|
||||
BK1080_GetFreqLoLimit(gEeprom.FM_Band)/10,
|
||||
gEeprom.FM_Band == 0 ? ".5" : "",
|
||||
BK1080_GetFreqHiLimit(gEeprom.FM_Band)/10
|
||||
@@ -50,51 +98,51 @@ void UI_DisplayFM(void)
|
||||
//UI_PrintStringSmallNormal(String, 127 - 4*7, 0, 6);
|
||||
|
||||
if (gAskToSave) {
|
||||
pPrintStr = "SAVE?";
|
||||
pPrintStr = "SAV?";
|
||||
} else if (gAskToDelete) {
|
||||
pPrintStr = "DEL?";
|
||||
} else if (gFM_ScanState == FM_SCAN_OFF) {
|
||||
if (gEeprom.FM_IsMrMode) {
|
||||
sprintf(String, "MR(CH%02u)", gEeprom.FM_SelectedChannel + 1);
|
||||
sprintf(String, "CH%02u", gEeprom.FM_SelectedChannel + 1);
|
||||
pPrintStr = String;
|
||||
} else {
|
||||
pPrintStr = "VFO";
|
||||
for (unsigned int i = 0; i < 20; i++) {
|
||||
if (gEeprom.FM_FrequencyPlaying == gFM_Channels[i]) {
|
||||
sprintf(String, "VFO(CH%02u)", i + 1);
|
||||
sprintf(String, "C%02u MHz", i + 1);
|
||||
pPrintStr = String;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (gFM_AutoScan) {
|
||||
sprintf(String, "A-SCAN(%u)", gFM_ChannelPosition + 1);
|
||||
sprintf(String, "A-SCN(%u)", gFM_ChannelPosition + 1);
|
||||
pPrintStr = String;
|
||||
} else {
|
||||
pPrintStr = "M-SCAN";
|
||||
pPrintStr = "M-SCN";
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, 0, 127, 3, 10); // memory, vfo, scan
|
||||
UI_PrintString(pPrintStr, 0, 127, 3 /*, 12 */); // memory, vfo, scan
|
||||
|
||||
memset(String, 0, sizeof(String));
|
||||
if (gAskToSave || (gEeprom.FM_IsMrMode && gInputBoxIndex > 0)) {
|
||||
UI_GenerateChannelString(String, gFM_ChannelPosition);
|
||||
} else if (gAskToDelete) {
|
||||
sprintf(String, "CH-%02u", gEeprom.FM_SelectedChannel + 1);
|
||||
sprintf(String, "C-%02u", gEeprom.FM_SelectedChannel + 1);
|
||||
} else {
|
||||
if (gInputBoxIndex == 0) {
|
||||
sprintf(String, "%3d.%d", gEeprom.FM_FrequencyPlaying / 10, gEeprom.FM_FrequencyPlaying % 10);
|
||||
sprintf(String, " %3d.%d", gEeprom.FM_FrequencyPlaying / 10, gEeprom.FM_FrequencyPlaying % 10);
|
||||
} else {
|
||||
const char * ascii = INPUTBOX_GetAscii();
|
||||
sprintf(String, "%.3s.%.1s",ascii, ascii + 3);
|
||||
}
|
||||
|
||||
UI_DisplayFrequency(String, 36, 1, gInputBoxIndex == 0); // frequency
|
||||
UI_PrintString(String, 0, 20, 1 /*, 10 */); // frequency
|
||||
ST7565_BlitFullScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
UI_PrintString(String, 0, 127, 1, 10);
|
||||
UI_PrintString(String, 0, 127, 1 /*, 10 */);
|
||||
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
void UI_DisplayFM(void);
|
||||
void UI_UpdateFMThings(bool force);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
425
ui/helper.c
425
ui/helper.c
@@ -24,15 +24,13 @@
|
||||
#include "misc.h"
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof((arr)[0]))
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof((arr)[0]))
|
||||
#endif
|
||||
|
||||
void UI_GenerateChannelString(char *pString, const uint8_t Channel)
|
||||
{
|
||||
void UI_GenerateChannelString(char *pString, const uint8_t Channel) {
|
||||
unsigned int i;
|
||||
|
||||
if (gInputBoxIndex == 0)
|
||||
{
|
||||
if (gInputBoxIndex == 0) {
|
||||
sprintf(pString, "CH-%02u", Channel + 1);
|
||||
return;
|
||||
}
|
||||
@@ -44,8 +42,7 @@ void UI_GenerateChannelString(char *pString, const uint8_t Channel)
|
||||
pString[i + 3] = (gInputBox[i] == 10) ? '-' : gInputBox[i] + '0';
|
||||
}
|
||||
|
||||
void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uint8_t ChannelNumber)
|
||||
{
|
||||
void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uint8_t ChannelNumber) {
|
||||
if (gInputBoxIndex > 0) {
|
||||
for (unsigned int i = 0; i < 3; i++) {
|
||||
pString[i] = (gInputBox[i] == 10) ? '-' : gInputBox[i] + '0';
|
||||
@@ -65,41 +62,44 @@ void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uin
|
||||
}
|
||||
}
|
||||
|
||||
void UI_PrintStringBuffer(const char *pString, uint8_t * buffer, uint32_t char_width, const uint8_t *font)
|
||||
{
|
||||
void *memcpy_inv(void *dst, const void *src, size_t n) {
|
||||
if (!dst || !src) return dst;
|
||||
|
||||
uint8_t *d = (uint8_t *) dst;
|
||||
const uint8_t *s = (const uint8_t *) src;
|
||||
|
||||
while (n--) {
|
||||
*d++ = ~(*s++);
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
void UI_PrintStringBuffer(const char *pString, uint8_t *buffer, uint32_t char_width, const uint8_t *font, bool inv) {
|
||||
const size_t Length = strlen(pString);
|
||||
const unsigned int char_spacing = char_width + 1;
|
||||
const uint32_t total_width = Length * char_spacing; // Total width of the text
|
||||
|
||||
if (inv) {
|
||||
// Draw background rectangle from 1 px before the first char to 1 px after the last char
|
||||
memset(buffer, 0xFF, total_width + 2);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < Length; i++) {
|
||||
const unsigned int index = pString[i] - ' ' - 1;
|
||||
if (pString[i] > ' ' && pString[i] < 127) {
|
||||
const uint32_t offset = i * char_spacing + 1;
|
||||
memcpy(buffer + offset, font + index * char_width, char_width);
|
||||
if (inv) {
|
||||
memcpy_inv(buffer + offset, font + index * char_width, char_width);
|
||||
} else {
|
||||
memcpy(buffer + offset, font + index * char_width, char_width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width)
|
||||
{
|
||||
size_t i;
|
||||
size_t Length = strlen(pString);
|
||||
|
||||
if (End > Start)
|
||||
Start += (((End - Start) - (Length * Width)) + 1) / 2;
|
||||
|
||||
for (i = 0; i < Length; i++)
|
||||
{
|
||||
const unsigned int ofs = (unsigned int)Start + (i * Width);
|
||||
if (pString[i] > ' ' && pString[i] < 127)
|
||||
{
|
||||
const unsigned int index = pString[i] - ' ' - 1;
|
||||
memcpy(gFrameBuffer[Line + 0] + ofs, &gFontBig[index][0], 7);
|
||||
memcpy(gFrameBuffer[Line + 1] + ofs, &gFontBig[index][7], 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t char_width, const uint8_t *font)
|
||||
{
|
||||
void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t char_width,
|
||||
const uint8_t *font, bool inv) {
|
||||
const size_t Length = strlen(pString);
|
||||
const unsigned int char_spacing = char_width + 1;
|
||||
|
||||
@@ -107,80 +107,124 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_
|
||||
Start += (((End - Start) - Length * char_spacing) + 1) / 2;
|
||||
}
|
||||
|
||||
UI_PrintStringBuffer(pString, gFrameBuffer[Line] + Start, char_width, font);
|
||||
UI_PrintStringBuffer(pString, gFrameBuffer[Line] + Start, char_width, font, inv);
|
||||
}
|
||||
|
||||
void itoa(unsigned long num, char *str) {
|
||||
char buf[20]; // Enough to store any 32-bit or 64-bit unsigned number
|
||||
int i = 0;
|
||||
|
||||
void UI_PrintStringSmallNormal(const char *pString, uint8_t Start, uint8_t End, uint8_t Line)
|
||||
{
|
||||
UI_PrintStringSmall(pString, Start, End, Line, ARRAY_SIZE(gFontSmall[0]), (const uint8_t *)gFontSmall);
|
||||
}
|
||||
|
||||
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line)
|
||||
{
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
const uint8_t *font = (uint8_t *)gFontSmallBold;
|
||||
const uint8_t char_width = ARRAY_SIZE(gFontSmallBold[0]);
|
||||
#else
|
||||
const uint8_t *font = (uint8_t *)gFontSmall;
|
||||
const uint8_t char_width = ARRAY_SIZE(gFontSmall[0]);
|
||||
#endif
|
||||
|
||||
UI_PrintStringSmall(pString, Start, End, Line, char_width, font);
|
||||
}
|
||||
|
||||
void UI_PrintStringSmallBufferNormal(const char *pString, uint8_t * buffer)
|
||||
{
|
||||
UI_PrintStringBuffer(pString, buffer, ARRAY_SIZE(gFontSmall[0]), (uint8_t *)gFontSmall);
|
||||
}
|
||||
|
||||
void UI_PrintStringSmallBufferBold(const char *pString, uint8_t * buffer)
|
||||
{
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
const uint8_t *font = (uint8_t *)gFontSmallBold;
|
||||
const uint8_t char_width = ARRAY_SIZE(gFontSmallBold[0]);
|
||||
#else
|
||||
const uint8_t *font = (uint8_t *)gFontSmall;
|
||||
const uint8_t char_width = ARRAY_SIZE(gFontSmall[0]);
|
||||
#endif
|
||||
UI_PrintStringBuffer(pString, buffer, char_width, font);
|
||||
}
|
||||
|
||||
void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center)
|
||||
{
|
||||
const unsigned int char_width = 13;
|
||||
uint8_t *pFb0 = gFrameBuffer[Y] + X;
|
||||
uint8_t *pFb1 = pFb0 + 128;
|
||||
bool bCanDisplay = false;
|
||||
|
||||
uint8_t len = strlen(string);
|
||||
for(int i = 0; i < len; i++) {
|
||||
char c = string[i];
|
||||
if(c=='-') c = '9' + 1;
|
||||
if (bCanDisplay || c != ' ')
|
||||
{
|
||||
bCanDisplay = true;
|
||||
if(c>='0' && c<='9' + 1) {
|
||||
memcpy(pFb0 + 2, gFontBigDigits[c-'0'], char_width - 3);
|
||||
memcpy(pFb1 + 2, gFontBigDigits[c-'0'] + char_width - 3, char_width - 3);
|
||||
}
|
||||
else if(c=='.') {
|
||||
*pFb1 = 0x60; pFb0++; pFb1++;
|
||||
*pFb1 = 0x60; pFb0++; pFb1++;
|
||||
*pFb1 = 0x60; pFb0++; pFb1++;
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
else if (center) {
|
||||
pFb0 -= 6;
|
||||
pFb1 -= 6;
|
||||
}
|
||||
pFb0 += char_width;
|
||||
pFb1 += char_width;
|
||||
// Handle 0 explicitly
|
||||
if (num == 0) {
|
||||
str[i++] = '0';
|
||||
str[i] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert number to string in reverse order
|
||||
while (num > 0) {
|
||||
buf[i++] = (num % 10) + '0'; // Get last digit and convert to ASCII
|
||||
num /= 10;
|
||||
}
|
||||
|
||||
// Reverse the string
|
||||
int j = 0;
|
||||
while (i > 0) {
|
||||
str[j++] = buf[--i];
|
||||
}
|
||||
str[j] = '\0'; // Null-terminate the string
|
||||
}
|
||||
|
||||
|
||||
void UI_PrintStringSmallNormal(const char *pString, uint8_t Start, uint8_t End, uint8_t Line) {
|
||||
UI_PrintStringSmall(pString, Start, End, Line, ARRAY_SIZE(gFontSmall[0]), (const uint8_t *) gFontSmall, false);
|
||||
}
|
||||
|
||||
//void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line /*, uint8_t Width */) {
|
||||
// UI_PrintStringSmallNormal(pString, Start, End, Line);
|
||||
//// size_t i;
|
||||
//// size_t Length = strlen(pString);
|
||||
////
|
||||
//// if (End > Start)
|
||||
//// Start += (((End - Start) - (Length * Width)) + 1) / 2;
|
||||
////
|
||||
//// for (i = 0; i < Length; i++)
|
||||
//// {
|
||||
//// const unsigned int ofs = (unsigned int)Start + (i * Width);
|
||||
//// if (pString[i] > ' ' && pString[i] < 127)
|
||||
//// {
|
||||
//// const unsigned int index = pString[i] - ' ' - 1;
|
||||
//// memcpy(gFrameBuffer[Line + 0] + ofs, &gFontSmall[index + '0'][0], 7);
|
||||
//// memcpy(gFrameBuffer[Line + 1] + ofs, &gFontSmall[index + '0'][7], 7);
|
||||
//// }
|
||||
//// }
|
||||
//}
|
||||
|
||||
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line) {
|
||||
//#ifdef ENABLE_SMALL_BOLD
|
||||
// const uint8_t *font = (uint8_t *)gFontSmallBold;
|
||||
// const uint8_t char_width = ARRAY_SIZE(gFontSmallBold[0]);
|
||||
//#else
|
||||
// const uint8_t *font = (uint8_t *) gFontSmall;
|
||||
// const uint8_t char_width = ARRAY_SIZE(gFontSmall[0]);
|
||||
//#endif
|
||||
//
|
||||
// UI_PrintStringSmall(pString, Start, End, Line, char_width, font);
|
||||
UI_PrintStringSmall(pString, Start, End, Line, ARRAY_SIZE(gFontSmall[0]), (const uint8_t *) gFontSmall, true);
|
||||
}
|
||||
|
||||
void UI_PrintStringSmallBufferNormal(const char *pString, uint8_t *buffer) {
|
||||
UI_PrintStringBuffer(pString, buffer, ARRAY_SIZE(gFontSmall[0]), (uint8_t *) gFontSmall, false);
|
||||
}
|
||||
|
||||
void UI_PrintStringSmallBufferBold(const char *pString, uint8_t *buffer) {
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
const uint8_t *font = (uint8_t *) gFontSmallBold;
|
||||
const uint8_t char_width = ARRAY_SIZE(gFontSmallBold[0]);
|
||||
#else
|
||||
const uint8_t *font = (uint8_t *) gFontSmall;
|
||||
const uint8_t char_width = ARRAY_SIZE(gFontSmall[0]);
|
||||
#endif
|
||||
UI_PrintStringBuffer(pString, buffer, char_width, font, false);
|
||||
}
|
||||
|
||||
//void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center) {
|
||||
// const unsigned int char_width = 13;
|
||||
// uint8_t *pFb0 = gFrameBuffer[Y] + X;
|
||||
// uint8_t *pFb1 = pFb0 + 128;
|
||||
// bool bCanDisplay = false;
|
||||
//
|
||||
// uint8_t len = strlen(string);
|
||||
// for (int i = 0; i < len; i++) {
|
||||
// char c = string[i];
|
||||
// if (c == '-') c = '9' + 1;
|
||||
// if (bCanDisplay || c != ' ') {
|
||||
// bCanDisplay = true;
|
||||
// if (c >= '0' && c <= '9' + 1) {
|
||||
// memcpy(pFb0 + 2, gFontSmall[(unsigned char) c], char_width - 3);
|
||||
// memcpy(pFb1 + 2, gFontSmall[(unsigned char) c] + char_width - 3, char_width - 3);
|
||||
// } else if (c == '.') {
|
||||
// *pFb1 = 0x60;
|
||||
// pFb0++;
|
||||
// pFb1++;
|
||||
// *pFb1 = 0x60;
|
||||
// pFb0++;
|
||||
// pFb1++;
|
||||
// *pFb1 = 0x60;
|
||||
// pFb0++;
|
||||
// pFb1++;
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// } else if (center) {
|
||||
// pFb0 -= 6;
|
||||
// pFb1 -= 6;
|
||||
// }
|
||||
// pFb0 += char_width;
|
||||
// pFb1 += char_width;
|
||||
// }
|
||||
//}
|
||||
|
||||
/*
|
||||
void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center)
|
||||
{
|
||||
@@ -221,18 +265,16 @@ void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center)
|
||||
}
|
||||
*/
|
||||
|
||||
void UI_DrawPixelBuffer(uint8_t (*buffer)[128], uint8_t x, uint8_t y, bool black)
|
||||
{
|
||||
void UI_DrawPixelBuffer(uint8_t (*buffer)[128], uint8_t x, uint8_t y, bool black) {
|
||||
const uint8_t pattern = 1 << (y % 8);
|
||||
if(black)
|
||||
buffer[y/8][x] |= pattern;
|
||||
if (black)
|
||||
buffer[y / 8][x] |= pattern;
|
||||
else
|
||||
buffer[y/8][x] &= ~pattern;
|
||||
buffer[y / 8][x] &= ~pattern;
|
||||
}
|
||||
|
||||
static void sort(int16_t *a, int16_t *b)
|
||||
{
|
||||
if(*a > *b) {
|
||||
static void sort(int16_t *a, int16_t *b) {
|
||||
if (*a > *b) {
|
||||
int16_t t = *a;
|
||||
*a = *b;
|
||||
*b = t;
|
||||
@@ -240,66 +282,13 @@ static void sort(int16_t *a, int16_t *b)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
/*
|
||||
void UI_DrawLineDottedBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black)
|
||||
{
|
||||
if(x2==x1) {
|
||||
sort(&y1, &y2);
|
||||
for(int16_t i = y1; i <= y2; i+=2) {
|
||||
UI_DrawPixelBuffer(buffer, x1, i, black);
|
||||
}
|
||||
} else {
|
||||
const int multipl = 1000;
|
||||
int a = (y2-y1)*multipl / (x2-x1);
|
||||
int b = y1 - a * x1 / multipl;
|
||||
|
||||
sort(&x1, &x2);
|
||||
for(int i = x1; i<= x2; i+=2)
|
||||
{
|
||||
UI_DrawPixelBuffer(buffer, i, i*a/multipl +b, black);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void PutPixel(uint8_t x, uint8_t y, bool fill) {
|
||||
UI_DrawPixelBuffer(gFrameBuffer, x, y, fill);
|
||||
}
|
||||
|
||||
void PutPixelStatus(uint8_t x, uint8_t y, bool fill) {
|
||||
UI_DrawPixelBuffer(&gStatusLine, x, y, fill);
|
||||
}
|
||||
|
||||
void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
|
||||
bool statusbar, bool fill) {
|
||||
uint8_t c;
|
||||
uint8_t pixels;
|
||||
const uint8_t *p = (const uint8_t *)pString;
|
||||
|
||||
while ((c = *p++) && c != '\0') {
|
||||
c -= 0x20;
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
pixels = gFont3x5[c][i];
|
||||
for (int j = 0; j < 6; ++j) {
|
||||
if (pixels & 1) {
|
||||
if (statusbar)
|
||||
PutPixelStatus(x + i, y + j, fill);
|
||||
else
|
||||
PutPixel(x + i, y + j, fill);
|
||||
}
|
||||
pixels >>= 1;
|
||||
}
|
||||
}
|
||||
x += 4;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void UI_DrawLineBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black)
|
||||
/*
|
||||
void UI_DrawLineDottedBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black)
|
||||
{
|
||||
if(x2==x1) {
|
||||
sort(&y1, &y2);
|
||||
for(int16_t i = y1; i <= y2; i++) {
|
||||
for(int16_t i = y1; i <= y2; i+=2) {
|
||||
UI_DrawPixelBuffer(buffer, x1, i, black);
|
||||
}
|
||||
} else {
|
||||
@@ -308,24 +297,102 @@ void UI_DrawLineBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x
|
||||
int b = y1 - a * x1 / multipl;
|
||||
|
||||
sort(&x1, &x2);
|
||||
for(int i = x1; i<= x2; i++)
|
||||
for(int i = x1; i<= x2; i+=2)
|
||||
{
|
||||
UI_DrawPixelBuffer(buffer, i, i*a/multipl +b, black);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void UI_DrawRectangleBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black)
|
||||
{
|
||||
UI_DrawLineBuffer(buffer, x1,y1, x1,y2, black);
|
||||
UI_DrawLineBuffer(buffer, x1,y1, x2,y1, black);
|
||||
UI_DrawLineBuffer(buffer, x2,y1, x2,y2, black);
|
||||
UI_DrawLineBuffer(buffer, x1,y2, x2,y2, black);
|
||||
void PutPixel(uint8_t x, uint8_t y, bool fill) {
|
||||
UI_DrawPixelBuffer(gFrameBuffer, x, y, fill);
|
||||
}
|
||||
|
||||
void PutPixelStatus(uint8_t x, uint8_t y, bool fill) {
|
||||
UI_DrawPixelBuffer(&gStatusLine, x, y, fill);
|
||||
}
|
||||
|
||||
//void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
|
||||
// bool statusbar, bool fill) {
|
||||
// uint8_t c;
|
||||
// uint8_t pixels;
|
||||
// const uint8_t *p = (const uint8_t *) pString;
|
||||
//
|
||||
// while ((c = *p++) && c != '\0') {
|
||||
// c -= 0x20;
|
||||
// for (int i = 0; i < 3; ++i) {
|
||||
// pixels = gFont3x5[c][i];
|
||||
// for (int j = 0; j < 6; ++j) {
|
||||
// if (pixels & 1) {
|
||||
// if (statusbar)
|
||||
// PutPixelStatus(x + i, y + j, fill);
|
||||
// else
|
||||
// PutPixel(x + i, y + j, fill);
|
||||
// }
|
||||
// pixels >>= 1;
|
||||
// }
|
||||
// }
|
||||
// x += 4;
|
||||
// }
|
||||
//}
|
||||
|
||||
void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
|
||||
bool statusbar, bool fill) {
|
||||
uint8_t c;
|
||||
uint8_t pixels;
|
||||
const uint8_t *p = (const uint8_t *) pString;
|
||||
|
||||
while ((c = *p++) && c != '\0') {
|
||||
c -= 0x20;
|
||||
for (int i = 0; i < (int) ARRAY_SIZE(gFontSmall[0]); ++i) {
|
||||
if (c) {
|
||||
pixels = gFontSmall[c - 1][i];
|
||||
for (int j = 0; j < 8; ++j) {
|
||||
if (pixels & 1) {
|
||||
if (statusbar)
|
||||
PutPixelStatus(x + i, y + j, fill);
|
||||
else
|
||||
PutPixel(x + i, y + j, fill);
|
||||
}
|
||||
pixels >>= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
x += ARRAY_SIZE(gFontSmall[0]) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UI_DisplayPopup(const char *string)
|
||||
{
|
||||
#endif
|
||||
|
||||
void UI_DrawLineBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black) {
|
||||
if (x2 == x1) {
|
||||
sort(&y1, &y2);
|
||||
for (int16_t i = y1; i <= y2; i++) {
|
||||
UI_DrawPixelBuffer(buffer, x1, i, black);
|
||||
}
|
||||
} else {
|
||||
const int multipl = 1000;
|
||||
int a = (y2 - y1) * multipl / (x2 - x1);
|
||||
int b = y1 - a * x1 / multipl;
|
||||
|
||||
sort(&x1, &x2);
|
||||
for (int i = x1; i <= x2; i++) {
|
||||
UI_DrawPixelBuffer(buffer, i, i * a / multipl + b, black);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UI_DrawRectangleBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black) {
|
||||
UI_DrawLineBuffer(buffer, x1, y1, x1, y2, black);
|
||||
UI_DrawLineBuffer(buffer, x1, y1, x2, y1, black);
|
||||
UI_DrawLineBuffer(buffer, x2, y1, x2, y2, black);
|
||||
UI_DrawLineBuffer(buffer, x1, y2, x2, y2, black);
|
||||
}
|
||||
|
||||
|
||||
void UI_DisplayPopup(const char *string) {
|
||||
UI_DisplayClear();
|
||||
|
||||
// for(uint8_t i = 1; i < 5; i++) {
|
||||
@@ -342,11 +409,17 @@ void UI_DisplayPopup(const char *string)
|
||||
// UI_DrawPixelBuffer(117, y, true);
|
||||
// }
|
||||
// DrawRectangle(9,9, 118,38, true);
|
||||
UI_PrintString(string, 9, 118, 2, 8);
|
||||
UI_PrintString(string, 9, 118, 2 /*, 8 */);
|
||||
UI_PrintStringSmallNormal("Press EXIT", 9, 118, 6);
|
||||
}
|
||||
|
||||
void UI_DisplayClear()
|
||||
{
|
||||
void UI_ClearLine(uint8_t Line) {
|
||||
if (Line < 8) { // ST7565 has 8 pages (rows of 8 pixels)
|
||||
memset(gFrameBuffer[Line], 0x00, 128); // Clear all pixels on the line
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UI_DisplayClear() {
|
||||
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
|
||||
}
|
||||
|
@@ -22,13 +22,14 @@
|
||||
|
||||
void UI_GenerateChannelString(char *pString, const uint8_t Channel);
|
||||
void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uint8_t ChannelNumber);
|
||||
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width);
|
||||
//void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line /*, uint8_t Width */);
|
||||
#define UI_PrintString UI_PrintStringSmallNormal
|
||||
void UI_PrintStringSmallNormal(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
|
||||
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
|
||||
void UI_PrintStringSmallBufferNormal(const char *pString, uint8_t *buffer);
|
||||
void UI_PrintStringSmallBufferBold(const char *pString, uint8_t * buffer);
|
||||
void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center);
|
||||
|
||||
//void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center);
|
||||
void UI_ClearLine(uint8_t Line);
|
||||
void UI_DisplayPopup(const char *string);
|
||||
|
||||
void UI_DrawPixelBuffer(uint8_t (*buffer)[128], uint8_t x, uint8_t y, bool black);
|
||||
@@ -40,7 +41,7 @@ void UI_DrawPixelBuffer(uint8_t (*buffer)[128], uint8_t x, uint8_t y, bool black
|
||||
#endif
|
||||
void UI_DrawLineBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black);
|
||||
void UI_DrawRectangleBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black);
|
||||
|
||||
void itoa(unsigned long num, char *str);
|
||||
void UI_DisplayClear();
|
||||
|
||||
#endif
|
||||
|
@@ -37,11 +37,11 @@ static void Render(void)
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
UI_DisplayClear();
|
||||
|
||||
UI_PrintString("PASSWORD", 0, 127, 1, 10);
|
||||
UI_PrintString("PASSWORD", 0, 127, 1 /*, 10 */);
|
||||
for (i = 0; i < 6; i++)
|
||||
String[i] = (gInputBox[i] == 10) ? '-' : 'x';
|
||||
String[6] = 0;
|
||||
UI_PrintString(String, 0, 127, 3, 12);
|
||||
UI_PrintString(String, 0, 127, 3 /*, 12 */);
|
||||
|
||||
ST7565_BlitStatusLine();
|
||||
ST7565_BlitFullScreen();
|
||||
|
@@ -41,6 +41,7 @@ extern const int8_t dBmCorrTable[7];
|
||||
void UI_DisplayAudioBar(void);
|
||||
void UI_MAIN_TimeSlice500ms(void);
|
||||
void UI_DisplayMain(void);
|
||||
bool isMainOnly();
|
||||
|
||||
#ifdef ENABLE_AGC_SHOW_DATA
|
||||
void UI_MAIN_PrintAGC(bool force);
|
||||
|
143
ui/menu.h
143
ui/menu.h
@@ -24,12 +24,11 @@
|
||||
#include "settings.h"
|
||||
|
||||
typedef struct {
|
||||
const char name[7]; // menu display area only has room for 6 characters
|
||||
uint8_t menu_id;
|
||||
const char name[7]; // menu display area only has room for 6 characters
|
||||
uint8_t menu_id;
|
||||
} t_menu_item;
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
MENU_SQL = 0,
|
||||
MENU_STEP,
|
||||
MENU_TXP,
|
||||
@@ -41,13 +40,8 @@ enum
|
||||
MENU_OFFSET,
|
||||
MENU_TOT,
|
||||
MENU_W_N,
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
MENU_SCR,
|
||||
#endif
|
||||
MENU_BCL,
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
MENU_TX_LOCK,
|
||||
#endif
|
||||
MENU_MEM_CH,
|
||||
MENU_DEL_CH,
|
||||
MENU_MEM_NAME,
|
||||
@@ -93,35 +87,26 @@ enum
|
||||
MENU_D_HOLD,
|
||||
#endif
|
||||
MENU_D_PRE,
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
MENU_D_DCD,
|
||||
MENU_D_LIST,
|
||||
#endif
|
||||
MENU_D_LIVE_DEC,
|
||||
MENU_PONMSG,
|
||||
MENU_FSKSRC,
|
||||
MENU_FSKMOD,
|
||||
MENU_ROGER,
|
||||
MENU_VOL,
|
||||
MENU_BAT_TXT,
|
||||
MENU_AM,
|
||||
#ifdef ENABLE_AM_FIX
|
||||
MENU_AM_FIX,
|
||||
#endif
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
#ifdef ENABLE_NOAA
|
||||
MENU_NOAA_S,
|
||||
#endif
|
||||
#ifdef ENABLE_NOAA
|
||||
MENU_NOAA_S,
|
||||
#endif
|
||||
#endif
|
||||
MENU_RESET,
|
||||
MENU_F_LOCK,
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
MENU_200TX,
|
||||
MENU_350TX,
|
||||
MENU_500TX,
|
||||
#endif
|
||||
MENU_350EN,
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
MENU_SCREN,
|
||||
#endif
|
||||
#ifdef ENABLE_F_CAL_MENU
|
||||
MENU_F_CALI, // reference xtal calibration
|
||||
#endif
|
||||
@@ -129,28 +114,15 @@ enum
|
||||
MENU_SET_OFF,
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
MENU_SET_PWR,
|
||||
MENU_SET_PTT,
|
||||
MENU_SET_TOT,
|
||||
MENU_SET_EOT,
|
||||
MENU_SET_CTR,
|
||||
MENU_SET_INV,
|
||||
MENU_SET_LCK,
|
||||
MENU_SET_MET,
|
||||
MENU_SET_GUI,
|
||||
MENU_SET_TMR,
|
||||
#ifdef ENABLE_FEAT_F4HWN_NARROWER
|
||||
MENU_SET_NFM,
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_VOL
|
||||
MENU_SET_VOL,
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
MENU_SET_KEY,
|
||||
#endif
|
||||
#ifdef ENABLE_NOAA
|
||||
MENU_NOAA_S,
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_VOL
|
||||
MENU_SET_VOL,
|
||||
#endif
|
||||
#ifdef ENABLE_NOAA
|
||||
MENU_NOAA_S,
|
||||
#endif
|
||||
#endif
|
||||
MENU_BATCAL, // battery voltage calibration
|
||||
MENU_F1SHRT,
|
||||
@@ -161,75 +133,60 @@ enum
|
||||
MENU_BATTYP
|
||||
};
|
||||
|
||||
extern const uint8_t FIRST_HIDDEN_MENU_ITEM;
|
||||
extern const t_menu_item MenuList[];
|
||||
|
||||
extern const char gSubMenu_TXP[8][6];
|
||||
extern const char gSubMenu_SFT_D[3][4];
|
||||
extern const char gSubMenu_W_N[2][7];
|
||||
extern const char gSubMenu_OFF_ON[2][4];
|
||||
extern const char gSubMenu_NA[4];
|
||||
extern const char gSubMenu_TOT[11][7];
|
||||
extern const char* const gSubMenu_RXMode[4];
|
||||
extern const char gSubMenu_TXP[7][5];
|
||||
extern const char gSubMenu_SFT_D[3][4];
|
||||
extern const char gSubMenu_W_N[3][5];
|
||||
extern const char gSubMenu_OFF_ON[2][4];
|
||||
extern const char gSubMenu_NA[4];
|
||||
extern const char *const gSubMenu_RXMode[4];
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
extern const char gSubMenu_VOICE[3][4];
|
||||
extern const char gSubMenu_VOICE[3][4];
|
||||
#endif
|
||||
extern const char* const gSubMenu_MDF[4];
|
||||
extern const char *const gSubMenu_MDF[4];
|
||||
#ifdef ENABLE_ALARM
|
||||
extern const char gSubMenu_AL_MOD[2][5];
|
||||
extern const char gSubMenu_AL_MOD[2][5];
|
||||
#endif
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
extern const char gSubMenu_D_RSP[4][11];
|
||||
extern const char gSubMenu_D_RSP[4][11];
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
extern const char gSubMenu_SET_PWR[7][6];
|
||||
extern const char gSubMenu_SET_PTT[2][8];
|
||||
extern const char gSubMenu_SET_TOT[4][7];
|
||||
extern const char gSubMenu_SET_LCK[2][9];
|
||||
extern const char gSubMenu_SET_MET[2][8];
|
||||
#ifdef ENABLE_FEAT_F4HWN_NARROWER
|
||||
extern const char gSubMenu_SET_NFM[2][9];
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
extern const char gSubMenu_SET_KEY[][9];
|
||||
#endif
|
||||
extern const char gSubMenu_SET_PTT[2][4];
|
||||
#endif
|
||||
|
||||
extern const char* const gSubMenu_PTT_ID[5];
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
extern const char gSubMenu_PONMSG[5][8];
|
||||
#else
|
||||
extern const char gSubMenu_PONMSG[4][8];
|
||||
#endif
|
||||
extern const char gSubMenu_ROGER[3][6];
|
||||
extern const char gSubMenu_RESET[2][4];
|
||||
extern const char* const gSubMenu_F_LOCK[F_LOCK_LEN];
|
||||
extern const char gSubMenu_RX_TX[4][6];
|
||||
extern const char gSubMenu_BAT_TXT[3][8];
|
||||
extern const char gSubMenu_BATTYP[3][9];
|
||||
extern const char *const gSubMenu_PTT_ID[5];
|
||||
extern const char gSubMenu_FSKMod[6][8];
|
||||
extern const char gSubMenu_ROGER[3][6];
|
||||
extern const char gSubMenu_RESET[2][4];
|
||||
extern const char *const gSubMenu_F_LOCK[F_LOCK_LEN];
|
||||
extern const char gSubMenu_RX_TX[4][6];
|
||||
extern const char gSubMenu_BAT_TXT[3][5];
|
||||
extern const char gSubMenu_BATTYP[3][3];
|
||||
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
extern const char gSubMenu_SCRAMBLER[11][7];
|
||||
#endif
|
||||
|
||||
typedef struct {char* name; uint8_t id;} t_sidefunction;
|
||||
extern const uint8_t gSubMenu_SIDEFUNCTIONS_size;
|
||||
typedef struct {
|
||||
char *name;
|
||||
uint8_t id;
|
||||
} t_sidefunction;
|
||||
extern const uint8_t gSubMenu_SIDEFUNCTIONS_size;
|
||||
extern const t_sidefunction gSubMenu_SIDEFUNCTIONS[];
|
||||
|
||||
extern bool gIsInSubMenu;
|
||||
|
||||
extern uint8_t gMenuCursor;
|
||||
|
||||
extern int32_t gSubMenuSelection;
|
||||
|
||||
extern char edit_original[17];
|
||||
extern char edit[17];
|
||||
extern int edit_index;
|
||||
extern bool gIsInSubMenu;
|
||||
|
||||
extern uint8_t gMenuCursor;
|
||||
|
||||
extern int32_t gSubMenuSelection;
|
||||
|
||||
extern char edit_original[17];
|
||||
extern char edit[17];
|
||||
extern int edit_index;
|
||||
|
||||
void UI_DisplayMenu(void);
|
||||
|
||||
int UI_MENU_GetCurrentMenuId();
|
||||
|
||||
uint8_t UI_MENU_GetMenuIdx(uint8_t id);
|
||||
|
||||
#endif
|
||||
|
121
ui/messages.c
Normal file
121
ui/messages.c
Normal file
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// Created by bruno on 3/30/25.
|
||||
//
|
||||
|
||||
#include "messages.h"
|
||||
|
||||
|
||||
// Convert a 32-bit number to a string (10 digits, zero-padded)
|
||||
void u32_to_str(uint32_t num, char *str) {
|
||||
for (int i = 9; i >= 0; i--) {
|
||||
str[i] = '0' + (num % 10);
|
||||
num /= 10;
|
||||
}
|
||||
str[10] = '\0';
|
||||
}
|
||||
|
||||
// Convert an 8-bit number to a 2-digit string (zero-padded)
|
||||
void u8_to_str(uint8_t num, char *str) {
|
||||
str[0] = '0' + (num / 100); // Hundreds place
|
||||
str[1] = '0' + ((num / 10) % 10); // Tens place
|
||||
str[2] = '0' + (num % 10); // Ones place
|
||||
str[3] = '\0';
|
||||
}
|
||||
|
||||
|
||||
void UI_DisplayMessages(void) {
|
||||
char String[19];
|
||||
UI_DisplayClear();
|
||||
if (gEnteringSMS != SMS_NOT_ENTERING) {
|
||||
if (gEnteringSMS == SMS_ENTERING_DEST) {
|
||||
UI_PrintString("SMS dest", 0, 0, 0 /*, 8 */);
|
||||
u32_to_str(dataPacket.dest, String);
|
||||
UI_PrintStringSmallNormal(String, 0, 0, 2);
|
||||
} else if (gEnteringSMS == SMS_ENTERING_MESSAGE) {
|
||||
UI_PrintString("SMS data", 0, 0, 0 /*, 8 */);
|
||||
UI_PrintStringSmallNormal((const char *) dataPacket.data, 1, 0, 1);
|
||||
memset(gFrameBuffer[1] + 2 + (7 * strlen((const char *) dataPacket.data)), gKeyTimeout == 0 ? 0xFF : 0x80,
|
||||
6);
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
String[0] = 'M';
|
||||
String[1] = 'S';
|
||||
String[2] = 'G';
|
||||
String[3] = ' ';
|
||||
|
||||
for (size_t i = 8; i < 14; i++) {
|
||||
String[i] = ' ';
|
||||
}
|
||||
|
||||
String[4] = 'F';
|
||||
String[5] = 'l';
|
||||
String[6] = 'g';
|
||||
String[7] = 's';
|
||||
String[8] = ':';
|
||||
String[9] = ' ';
|
||||
u8_to_str(loadedPacket.flags, &String[10]); // Write at offset 7
|
||||
|
||||
String[13] = ' ';
|
||||
if (gActiveMessage == MESSAGES_COUNT) {
|
||||
String[14] = 'T';
|
||||
} else {
|
||||
String[14] = '0' + gActiveMessage;
|
||||
}
|
||||
String[15] = '/';
|
||||
String[16] = '0' + MESSAGES_COUNT;
|
||||
String[17] = 0;
|
||||
|
||||
UI_PrintString(String, 2, 0, 0 /*, 8 */);
|
||||
|
||||
String[5] = ' ';
|
||||
if (gActiveMessage == MESSAGES_COUNT) {
|
||||
String[0] = 'T';
|
||||
String[1] = 'o';
|
||||
String[2] = ':';
|
||||
String[3] = ' ';
|
||||
String[4] = ' ';
|
||||
} else {
|
||||
String[0] = 'F';
|
||||
String[1] = 'r';
|
||||
String[2] = 'o';
|
||||
String[3] = 'm';
|
||||
String[4] = ':';
|
||||
}
|
||||
u32_to_str(gActiveMessage == MESSAGES_COUNT ? dataPacket.dest : loadedPacket.src,
|
||||
&String[6]); // Write at offset 6
|
||||
UI_PrintString(String, 2, 0, 1 /*, 8 */);
|
||||
|
||||
String[0] = 'S';
|
||||
String[1] = 'E';
|
||||
String[2] = 'Q';
|
||||
String[3] = ':';
|
||||
String[4] = ' ';
|
||||
u8_to_str(loadedPacket.seq, &String[5]); // Write at offset 5
|
||||
String[8] = ' ';
|
||||
String[9] = 'T';
|
||||
String[10] = 'T';
|
||||
String[11] = 'L';
|
||||
String[12] = ':';
|
||||
String[13] = ' ';
|
||||
String[14] = 0;
|
||||
u8_to_str(loadedPacket.ttl, &String[14]); // Write at new offset
|
||||
UI_PrintString(String, 2, 0, 2 /*, 8 */);
|
||||
|
||||
|
||||
char String2[13] = "Data: ";
|
||||
if (gGotACK) {
|
||||
String2[6] = 'G';
|
||||
String2[7] = 'o';
|
||||
String2[8] = 't';
|
||||
String2[9] = 'A';
|
||||
String2[10] = 'C';
|
||||
String2[11] = 'K';
|
||||
}
|
||||
String2[12] = 0;
|
||||
UI_PrintString(String2, 0, 0, 3 /*, 8 */);
|
||||
UI_PrintString((const char *) loadedPacket.data, 2, 0, 4 /*, 8 */);
|
||||
}
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
18
ui/messages.h
Normal file
18
ui/messages.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Created by bruno on 3/30/25.
|
||||
//
|
||||
|
||||
#ifndef BRNQUANFW_MESSAGES_H
|
||||
#define BRNQUANFW_MESSAGES_H
|
||||
#include "stdio.h"
|
||||
#include "helper.h"
|
||||
#include "../driver/st7565.h"
|
||||
#include "string.h"
|
||||
#include "../app/messages.h"
|
||||
#include "../app/fskmodem.h"
|
||||
|
||||
void UI_DisplayMessages(void);
|
||||
void u8_to_str(uint8_t num, char *str);
|
||||
void u32_to_str(uint32_t num, char *str);
|
||||
|
||||
#endif //BRNQUANFW_MESSAGES_H
|
16
ui/scanner.c
16
ui/scanner.c
@@ -40,7 +40,7 @@ void UI_DisplayScanner(void)
|
||||
pPrintStr = "FREQ:**.*****";
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, 2, 0, 1, 8);
|
||||
UI_PrintString(pPrintStr, 2, 0, 1 /*, 8 */);
|
||||
|
||||
if (gScanCssState < SCAN_CSS_STATE_FOUND || !gScanUseCssResult) {
|
||||
pPrintStr = "CTC:******";
|
||||
@@ -52,10 +52,10 @@ void UI_DisplayScanner(void)
|
||||
pPrintStr = String;
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, 2, 0, 3, 8);
|
||||
UI_PrintString(pPrintStr, 2, 0, 3 /*, 8 */);
|
||||
memset(String, 0, sizeof(String));
|
||||
if (gScannerSaveState == SCAN_SAVE_CHANNEL) {
|
||||
pPrintStr = "SAVE?";
|
||||
pPrintStr = "SAV?";
|
||||
Start = 0;
|
||||
bCentered = 1;
|
||||
} else {
|
||||
@@ -63,21 +63,21 @@ void UI_DisplayScanner(void)
|
||||
bCentered = 0;
|
||||
|
||||
if (gScannerSaveState == SCAN_SAVE_CHAN_SEL) {
|
||||
strcpy(String, "SAVE:");
|
||||
strcpy(String, "SAV:");
|
||||
UI_GenerateChannelStringEx(String + 5, gShowChPrefix, gScanChannel);
|
||||
pPrintStr = String;
|
||||
} else if (gScanCssState < SCAN_CSS_STATE_FOUND) {
|
||||
strcpy(String, "SCAN");
|
||||
strcpy(String, "SCN");
|
||||
memset(String + 4, '.', (gScanProgressIndicator & 7) + 1);
|
||||
pPrintStr = String;
|
||||
} else if (gScanCssState == SCAN_CSS_STATE_FOUND) {
|
||||
pPrintStr = "SCAN CMP.";
|
||||
pPrintStr = "SCN CMP.";
|
||||
} else {
|
||||
pPrintStr = "SCAN FAIL.";
|
||||
pPrintStr = "SCN FAIL.";
|
||||
}
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, Start, bCentered ? 127 : 0, 5, 8);
|
||||
UI_PrintString(pPrintStr, Start, bCentered ? 127 : 0, 5 /*, 8 */);
|
||||
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
|
29
ui/status.c
29
ui/status.c
@@ -54,6 +54,17 @@ static void convertTime(uint8_t *line, uint8_t type)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//static const char* const FunctionStrings[] = {
|
||||
// [FUNCTION_FOREGROUND] = "FG",
|
||||
// [FUNCTION_TRANSMIT] = "TX",
|
||||
// [FUNCTION_MONITOR] = "MON",
|
||||
// [FUNCTION_INCOMING] = "INC",
|
||||
// [FUNCTION_RECEIVE] = "RX",
|
||||
// [FUNCTION_POWER_SAVE] = "PWS",
|
||||
// [FUNCTION_BAND_SCOPE] = "BS",
|
||||
// [FUNCTION_N_ELEM] = "NE"
|
||||
//};
|
||||
|
||||
void UI_DisplayStatus()
|
||||
{
|
||||
char str[8] = "";
|
||||
@@ -84,13 +95,6 @@ void UI_DisplayStatus()
|
||||
|
||||
unsigned int x1 = x;
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (gSetting_KILLED) {
|
||||
memset(line + x, 0xFF, 10);
|
||||
x1 = x + 10;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{ // SCAN indicator
|
||||
if (gScanStateDir != SCAN_OFF || SCANNER_IsScanning()) {
|
||||
if (IS_MR_CHANNEL(gNextMrChannel) && !SCANNER_IsScanning()) { // channel mode
|
||||
@@ -234,10 +238,6 @@ void UI_DisplayStatus()
|
||||
size = sizeof(gFontMute);
|
||||
}
|
||||
#endif
|
||||
else if (gBackLight) {
|
||||
src = gFontLight;
|
||||
size = sizeof(gFontLight);
|
||||
}
|
||||
#ifdef ENABLE_FEAT_F4HWN_CHARGING_C
|
||||
else if (gChargingWithTypeC) {
|
||||
src = BITMAP_USB_C;
|
||||
@@ -246,9 +246,7 @@ void UI_DisplayStatus()
|
||||
#endif
|
||||
|
||||
// Perform the memcpy if a source was selected
|
||||
if (src) {
|
||||
memcpy(line + x + 1, src, size);
|
||||
}
|
||||
memcpy(line + x + 1, src, size);
|
||||
|
||||
// Battery
|
||||
unsigned int x2 = LCD_WIDTH - sizeof(BITMAP_BatteryLevel1) - 0;
|
||||
@@ -289,5 +287,8 @@ void UI_DisplayStatus()
|
||||
|
||||
// **************
|
||||
|
||||
// x2 -= (7 * strlen(str));
|
||||
// UI_PrintStringSmallBufferNormal(FunctionStrings[gCurrentFunction], line + x2 - 20);
|
||||
|
||||
ST7565_BlitStatusLine();
|
||||
}
|
||||
|
2
ui/ui.c
2
ui/ui.c
@@ -39,6 +39,7 @@
|
||||
#include "ui/scanner.h"
|
||||
#include "ui/ui.h"
|
||||
#include "../misc.h"
|
||||
#include "messages.h"
|
||||
|
||||
GUI_DisplayType_t gScreenToDisplay;
|
||||
GUI_DisplayType_t gRequestDisplayScreen = DISPLAY_INVALID;
|
||||
@@ -52,6 +53,7 @@ void (*UI_DisplayFunctions[])(void) = {
|
||||
[DISPLAY_MAIN] = &UI_DisplayMain,
|
||||
[DISPLAY_MENU] = &UI_DisplayMenu,
|
||||
[DISPLAY_SCANNER] = &UI_DisplayScanner,
|
||||
[DISPLAY_MESSAGES] = &UI_DisplayMessages,
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
[DISPLAY_FM] = &UI_DisplayFM,
|
||||
|
1
ui/ui.h
1
ui/ui.h
@@ -25,6 +25,7 @@ enum GUI_DisplayType_t
|
||||
DISPLAY_MAIN = 0,
|
||||
DISPLAY_MENU,
|
||||
DISPLAY_SCANNER,
|
||||
DISPLAY_MESSAGES,
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
DISPLAY_FM,
|
||||
|
164
ui/welcome.c
164
ui/welcome.c
@@ -28,175 +28,37 @@
|
||||
#include "version.h"
|
||||
#include "bitmaps.h"
|
||||
|
||||
void UI_DisplayReleaseKeys(void)
|
||||
{
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
void UI_DisplayReleaseKeys(void) {
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
#if defined(ENABLE_FEAT_F4HWN_CTR) || defined(ENABLE_FEAT_F4HWN_INV)
|
||||
ST7565_ContrastAndInv();
|
||||
ST7565_ContrastAndInv();
|
||||
#endif
|
||||
UI_DisplayClear();
|
||||
|
||||
UI_PrintString("RELEASE", 0, 127, 1, 10);
|
||||
UI_PrintString("ALL KEYS", 0, 127, 3, 10);
|
||||
UI_PrintString("RELEASE KEYS", 0, 127, 1 /*, 10 */);
|
||||
|
||||
ST7565_BlitStatusLine(); // blank status line
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
|
||||
void UI_DisplayWelcome(void)
|
||||
{
|
||||
char WelcomeString0[16];
|
||||
char WelcomeString1[16];
|
||||
char WelcomeString2[16];
|
||||
char WelcomeString3[20];
|
||||
void UI_DisplayWelcome(void) {
|
||||
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
|
||||
#if defined(ENABLE_FEAT_F4HWN_CTR) || defined(ENABLE_FEAT_F4HWN_INV)
|
||||
ST7565_ContrastAndInv();
|
||||
ST7565_ContrastAndInv();
|
||||
#endif
|
||||
UI_DisplayClear();
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
ST7565_BlitStatusLine();
|
||||
ST7565_BlitFullScreen();
|
||||
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND) {
|
||||
ST7565_FillScreen(0x00);
|
||||
#else
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_FULL_SCREEN) {
|
||||
ST7565_FillScreen(0xFF);
|
||||
#endif
|
||||
} else {
|
||||
memset(WelcomeString0, 0, sizeof(WelcomeString0));
|
||||
memset(WelcomeString1, 0, sizeof(WelcomeString1));
|
||||
|
||||
EEPROM_ReadBuffer(0x0EB0, WelcomeString0, 16);
|
||||
EEPROM_ReadBuffer(0x0EC0, WelcomeString1, 16);
|
||||
|
||||
sprintf(WelcomeString2, "%u.%02uV %u%%",
|
||||
gBatteryVoltageAverage / 100,
|
||||
gBatteryVoltageAverage % 100,
|
||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||
UI_DrawLineBuffer(gFrameBuffer, 0, 31, 127, 31, 1); // Be ware, status zone = 8 lines, the rest = 56 ->total 64
|
||||
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_VOLTAGE)
|
||||
{
|
||||
strcpy(WelcomeString0, "VOLTAGE");
|
||||
strcpy(WelcomeString1, WelcomeString2);
|
||||
}
|
||||
else if(gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_ALL)
|
||||
{
|
||||
if(strlen(WelcomeString0) == 0 && strlen(WelcomeString1) == 0)
|
||||
{
|
||||
strcpy(WelcomeString0, "WELCOME");
|
||||
strcpy(WelcomeString1, WelcomeString2);
|
||||
}
|
||||
else if(strlen(WelcomeString0) == 0 || strlen(WelcomeString1) == 0)
|
||||
{
|
||||
if(strlen(WelcomeString0) == 0)
|
||||
{
|
||||
strcpy(WelcomeString0, WelcomeString1);
|
||||
}
|
||||
strcpy(WelcomeString1, WelcomeString2);
|
||||
}
|
||||
}
|
||||
else if(gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_MESSAGE)
|
||||
{
|
||||
if(strlen(WelcomeString0) == 0)
|
||||
{
|
||||
strcpy(WelcomeString0, "WELCOME");
|
||||
}
|
||||
|
||||
if(strlen(WelcomeString1) == 0)
|
||||
{
|
||||
strcpy(WelcomeString1, "BIENVENUE");
|
||||
}
|
||||
}
|
||||
|
||||
UI_PrintString(WelcomeString0, 0, 127, 0, 10);
|
||||
UI_PrintString(WelcomeString1, 0, 127, 2, 10);
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
UI_PrintStringSmallNormal(Version, 0, 128, 4);
|
||||
|
||||
UI_DrawLineBuffer(gFrameBuffer, 0, 31, 127, 31, 1); // Be ware, status zone = 8 lines, the rest = 56 ->total 64
|
||||
|
||||
for (uint8_t i = 18; i < 110; i++)
|
||||
{
|
||||
gFrameBuffer[4][i] ^= 0xFF;
|
||||
}
|
||||
|
||||
sprintf(WelcomeString3, "%s Edition", Edition);
|
||||
UI_PrintStringSmallNormal(WelcomeString3, 0, 127, 6);
|
||||
|
||||
/*
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
#if ENABLE_FEAT_F4HWN_RESCUE_OPS > 1
|
||||
UI_PrintStringSmallNormal(Edition, 18, 0, 6);
|
||||
if(gEeprom.MENU_LOCK == true) {
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_NotReady, sizeof(BITMAP_NotReady));
|
||||
}
|
||||
#else
|
||||
UI_PrintStringSmallNormal(Edition, 18, 0, 5);
|
||||
memcpy(gFrameBuffer[5] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
UI_PrintStringSmallNormal("RescueOps", 18, 0, 6);
|
||||
if(gEeprom.MENU_LOCK == true) {
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_NotReady, sizeof(BITMAP_NotReady));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
UI_PrintStringSmallNormal(Edition, 18, 0, 6);
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
#endif
|
||||
*/
|
||||
|
||||
/*
|
||||
#ifdef ENABLE_SPECTRUM
|
||||
#ifdef ENABLE_FMRADIO
|
||||
UI_PrintStringSmallNormal(Based, 0, 127, 5);
|
||||
UI_PrintStringSmallNormal(Credits, 0, 127, 6);
|
||||
#else
|
||||
UI_PrintStringSmallNormal("Bandscope ", 0, 127, 5);
|
||||
memcpy(gFrameBuffer[5] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
UI_PrintStringSmallNormal("RescueOps ", 0, 127, 6);
|
||||
if(gEeprom.MENU_LOCK == true) {
|
||||
memcpy(gFrameBuffer[6] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
}
|
||||
#else
|
||||
UI_PrintStringSmallNormal("Broadcast ", 0, 127, 6);
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
UI_PrintStringSmallNormal("RescueOps ", 0, 127, 5);
|
||||
if(gEeprom.MENU_LOCK == true) {
|
||||
memcpy(gFrameBuffer[5] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
}
|
||||
#else
|
||||
UI_PrintStringSmallNormal("Bandscope ", 0, 127, 5);
|
||||
#endif
|
||||
UI_PrintStringSmallNormal("Broadcast ", 0, 127, 6);
|
||||
memcpy(gFrameBuffer[6] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
#endif
|
||||
*/
|
||||
#else
|
||||
UI_PrintStringSmallNormal(Version, 0, 127, 6);
|
||||
#endif
|
||||
|
||||
//ST7565_BlitStatusLine(); // blank status line : I think it's useless
|
||||
ST7565_BlitFullScreen();
|
||||
for (uint8_t i = 18; i < 110; i++) {
|
||||
gFrameBuffer[4][i] ^= 0xFF;
|
||||
}
|
||||
|
||||
//ST7565_BlitStatusLine(); // blank status line : I think it's useless
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
const char Version[] = AUTHOR_STRING_2 " " VERSION_STRING_2;
|
||||
const char Edition[] = EDITION_STRING;
|
||||
#else
|
||||
const char Version[] = AUTHOR_STRING VER;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user