This commit is contained in:
wu58430 2023-12-24 18:15:10 +08:00
parent e9d1733118
commit 84606bb047
19 changed files with 277 additions and 279 deletions

View file

@ -21,13 +21,24 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="中文"> <list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="中文">
<change beforePath="$PROJECT_DIR$/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/uart.c" beforeDir="false" afterPath="$PROJECT_DIR$/app/uart.c" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Makefile" beforeDir="false" afterPath="$PROJECT_DIR$/Makefile" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.c" beforeDir="false" afterPath="$PROJECT_DIR$/main.c" afterDir="false" /> <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/chFrScanner.c" beforeDir="false" afterPath="$PROJECT_DIR$/app/chFrScanner.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/chFrScanner.h" beforeDir="false" afterPath="$PROJECT_DIR$/app/chFrScanner.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/main.c" beforeDir="false" afterPath="$PROJECT_DIR$/app/main.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/spectrum.c" beforeDir="false" afterPath="$PROJECT_DIR$/app/spectrum.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/spectrum.h" beforeDir="false" afterPath="$PROJECT_DIR$/app/spectrum.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/chinese.h" beforeDir="false" afterPath="$PROJECT_DIR$/chinese.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/font.c" beforeDir="false" afterPath="$PROJECT_DIR$/font.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/font.h" beforeDir="false" afterPath="$PROJECT_DIR$/font.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/misc.h" beforeDir="false" afterPath="$PROJECT_DIR$/misc.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ui/helper.c" beforeDir="false" afterPath="$PROJECT_DIR$/ui/helper.c" afterDir="false" /> <change beforePath="$PROJECT_DIR$/ui/helper.c" beforeDir="false" afterPath="$PROJECT_DIR$/ui/helper.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uv-k5font/uv-k5font_full/cmake-build-debug/Testing/Temporary/LastTest.log" beforeDir="false" afterPath="$PROJECT_DIR$/uv-k5font/uv-k5font_full/cmake-build-debug/Testing/Temporary/LastTest.log" afterDir="false" /> <change beforePath="$PROJECT_DIR$/ui/helper.h" beforeDir="false" afterPath="$PROJECT_DIR$/ui/helper.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uv-k5font/uv-k5font_full/main.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/uv-k5font/uv-k5font_full/main.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/ui/main.c" beforeDir="false" afterPath="$PROJECT_DIR$/ui/main.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ui/menu.c" beforeDir="false" afterPath="$PROJECT_DIR$/ui/menu.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ui/menu.h" beforeDir="false" afterPath="$PROJECT_DIR$/ui/menu.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uv-k5font/uv-k5font_full/font.xlsx" beforeDir="false" afterPath="$PROJECT_DIR$/uv-k5font/uv-k5font_full/font.xlsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/version.c" beforeDir="false" afterPath="$PROJECT_DIR$/version.c" afterDir="false" /> <change beforePath="$PROJECT_DIR$/version.c" beforeDir="false" afterPath="$PROJECT_DIR$/version.c" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -103,12 +114,7 @@
<recent name="C:\Users\RUPC\Desktop\UV-K6\uv-k5-firmware-chinese" /> <recent name="C:\Users\RUPC\Desktop\UV-K6\uv-k5-firmware-chinese" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Shell Script.win"> <component name="RunManager" selected="Shell Script.win docker">
<configuration default="true" type="CLionExternalRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true">
<method v="2">
<option name="CLION.EXTERNAL.BUILD" enabled="true" />
</method>
</configuration>
<configuration name="clean" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile" temporary="true"> <configuration name="clean" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile" temporary="true">
<makefile filename="$PROJECT_DIR$/Makefile" target="clean" workingDirectory="" arguments=""> <makefile filename="$PROJECT_DIR$/Makefile" target="clean" workingDirectory="" arguments="">
<envs /> <envs />
@ -248,6 +254,8 @@
<workItem from="1703216340003" duration="19547000" /> <workItem from="1703216340003" duration="19547000" />
<workItem from="1703259169230" duration="73000" /> <workItem from="1703259169230" duration="73000" />
<workItem from="1703259273867" duration="8810000" /> <workItem from="1703259273867" duration="8810000" />
<workItem from="1703380739516" duration="6230000" />
<workItem from="1703411329993" duration="1576000" />
</task> </task>
<task id="LOCAL-00048" summary="MDC RX"> <task id="LOCAL-00048" summary="MDC RX">
<created>1701693594928</created> <created>1701693594928</created>

View file

@ -24,7 +24,6 @@ ENABLE_FLASHLIGHT ?= 1
# ---- CUSTOM MODS ---- # ---- CUSTOM MODS ----
ENABLE_BIG_FREQ ?= 1 ENABLE_BIG_FREQ ?= 1
ENABLE_SMALL_BOLD ?= 0
ENABLE_KEEP_MEM_NAME ?= 1 ENABLE_KEEP_MEM_NAME ?= 1
ENABLE_WIDE_RX ?= 1 ENABLE_WIDE_RX ?= 1
ENABLE_TX_WHEN_AM ?= 0 ENABLE_TX_WHEN_AM ?= 0
@ -290,9 +289,7 @@ endif
ifeq ($(ENABLE_BIG_FREQ),1) ifeq ($(ENABLE_BIG_FREQ),1)
CFLAGS += -DENABLE_BIG_FREQ CFLAGS += -DENABLE_BIG_FREQ
endif endif
ifeq ($(ENABLE_SMALL_BOLD),1)
CFLAGS += -DENABLE_SMALL_BOLD
endif
ifeq ($(ENABLE_NOAA),1) ifeq ($(ENABLE_NOAA),1)
CFLAGS += -DENABLE_NOAA CFLAGS += -DENABLE_NOAA
endif endif

View file

@ -93,7 +93,6 @@ ENABLE_PWRON_PASSWORD := 0 开机密码
ENABLE_DTMF_CALLING := 1 ENABLE_DTMF_CALLING := 1
ENABLE_FLASHLIGHT := 1 ENABLE_FLASHLIGHT := 1
ENABLE_BIG_FREQ := 1 频率模式大字体 ENABLE_BIG_FREQ := 1 频率模式大字体
ENABLE_SMALL_BOLD := 1 粗体通道名称/编号(当名称+频率频道显示模式时)
ENABLE_KEEP_MEM_NAME := 1 在(重新)保存信道时保持信道名称 ENABLE_KEEP_MEM_NAME := 1 在(重新)保存信道时保持信道名称
ENABLE_WIDE_RX := 1 18MHz 至 1300MHz 接收(尽管前端/PA 不是为全范围设计的) ENABLE_WIDE_RX := 1 18MHz 至 1300MHz 接收(尽管前端/PA 不是为全范围设计的)
ENABLE_TX_WHEN_AM := 0 当 RX 设置为 AM 时允许 FM 发射 ENABLE_TX_WHEN_AM := 0 当 RX 设置为 AM 时允许 FM 发射

View file

@ -11,6 +11,7 @@ bool gScanPauseMode;
#ifdef ENABLE_SCAN_RANGES #ifdef ENABLE_SCAN_RANGES
uint32_t gScanRangeStart; uint32_t gScanRangeStart;
uint32_t gScanRangeStop;
#endif #endif
typedef enum { typedef enum {
@ -157,9 +158,7 @@ static void NextFreqChannel(void)
{ {
#ifdef ENABLE_SCAN_RANGES #ifdef ENABLE_SCAN_RANGES
if(gScanRangeStart) { if(gScanRangeStart) {
uint32_t start = gScanRangeStart; gRxVfo->freq_config_RX.Frequency = APP_SetFreqByStepAndLimits(gRxVfo, gScanStateDir, gScanRangeStart, gScanRangeStop);
uint32_t end = gEeprom.VfoInfo[(gEeprom.TX_VFO+1)%2].freq_config_RX.Frequency;
gRxVfo->freq_config_RX.Frequency = APP_SetFreqByStepAndLimits(gRxVfo, gScanStateDir, MIN(start, end), MAX(start, end));
} }
else else
#endif #endif

View file

@ -12,6 +12,7 @@ extern bool gScanPauseMode;
#ifdef ENABLE_SCAN_RANGES #ifdef ENABLE_SCAN_RANGES
extern uint32_t gScanRangeStart; extern uint32_t gScanRangeStart;
extern uint32_t gScanRangeStop;
#endif #endif
void CHFRSCANNER_Found(void); void CHFRSCANNER_Found(void);

View file

@ -51,6 +51,9 @@ void toggle_chan_scanlist(void) { // toggle the selected channels scanlist se
if (!IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) { if (!IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
#ifdef ENABLE_SCAN_RANGES #ifdef ENABLE_SCAN_RANGES
gScanRangeStart = gScanRangeStart ? 0 : gTxVfo->pRX->Frequency; gScanRangeStart = gScanRangeStart ? 0 : gTxVfo->pRX->Frequency;
gScanRangeStop = gEeprom.VfoInfo[!gEeprom.TX_VFO].freq_config_RX.Frequency;
if(gScanRangeStart > gScanRangeStop)
SWAP(gScanRangeStart, gScanRangeStop);
#endif #endif
return; return;
} }

View file

@ -13,14 +13,19 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "app/spectrum.h" #include "app/spectrum.h"
#include "am_fix.h" #include "am_fix.h"
#include "audio.h" #include "audio.h"
#ifdef ENABLE_SCAN_RANGES
#include "chFrScanner.h"
#endif
#include "driver/backlight.h" #include "driver/backlight.h"
#include "frequencies.h"
#include "ui/helper.h" #include "ui/helper.h"
#include "ui/main.h" #include "ui/main.h"
#include "frequencies.h"
struct FrequencyBandInfo { struct FrequencyBandInfo {
uint32_t lower; uint32_t lower;
uint32_t upper; uint32_t upper;
@ -52,6 +57,11 @@ PeakInfo peak;
ScanInfo scanInfo; ScanInfo scanInfo;
KeyboardState kbd = {KEY_INVALID, KEY_INVALID, 0}; KeyboardState kbd = {KEY_INVALID, KEY_INVALID, 0};
#ifdef ENABLE_SCAN_RANGES
static uint16_t blacklistFreqs[15];
static uint8_t blacklistFreqsIdx;
#endif
const char *bwOptions[] = {" 25k", "12.5k", "6.25k"}; const char *bwOptions[] = {" 25k", "12.5k", "6.25k"};
const uint8_t modulationTypeTuneSteps[] = {100, 50, 10}; const uint8_t modulationTypeTuneSteps[] = {100, 50, 10};
const uint8_t modTypeReg47Values[] = {1, 7, 5}; const uint8_t modTypeReg47Values[] = {1, 7, 5};
@ -259,12 +269,24 @@ static void ResetPeak() {
} }
bool IsCenterMode() { return settings.scanStepIndex < S_STEP_2_5kHz; } bool IsCenterMode() { return settings.scanStepIndex < S_STEP_2_5kHz; }
uint8_t GetStepsCount() { return 128 >> settings.stepsCount; } // scan step in 0.01khz
uint16_t GetScanStep() { return scanStepValues[settings.scanStepIndex]; } uint16_t GetScanStep() { return scanStepValues[settings.scanStepIndex]; }
uint16_t GetStepsCount()
{
#ifdef ENABLE_SCAN_RANGES
if(gScanRangeStart) {
return (gScanRangeStop - gScanRangeStart) / GetScanStep();
}
#endif
return 128 >> settings.stepsCount;
}
uint32_t GetBW() { return GetStepsCount() * GetScanStep(); } uint32_t GetBW() { return GetStepsCount() * GetScanStep(); }
uint32_t GetFStart() { uint32_t GetFStart() {
return IsCenterMode() ? currentFreq - (GetBW() >> 1) : currentFreq; return IsCenterMode() ? currentFreq - (GetBW() >> 1) : currentFreq;
} }
uint32_t GetFEnd() { return currentFreq + GetBW(); } uint32_t GetFEnd() { return currentFreq + GetBW(); }
static void TuneToPeak() { static void TuneToPeak() {
@ -351,6 +373,10 @@ static void ResetBlacklist() {
if (rssiHistory[i] == RSSI_MAX_VALUE) if (rssiHistory[i] == RSSI_MAX_VALUE)
rssiHistory[i] = 0; rssiHistory[i] = 0;
} }
#ifdef ENABLE_SCAN_RANGES
memset(blacklistFreqs, 0, sizeof(blacklistFreqs));
blacklistFreqsIdx = 0;
#endif
} }
static void RelaunchScan() { static void RelaunchScan() {
@ -397,7 +423,25 @@ static void UpdatePeakInfo() {
UpdatePeakInfoForce(); UpdatePeakInfoForce();
} }
static void Measure() { rssiHistory[scanInfo.i] = scanInfo.rssi = GetRssi(); } static void SetRssiHistory(uint16_t idx, uint16_t rssi)
{
#ifdef ENABLE_SCAN_RANGES
if(scanInfo.measurementsCount > 128) {
uint8_t i = (uint32_t)ARRAY_SIZE(rssiHistory) * 1000 / scanInfo.measurementsCount * idx / 1000;
if(rssiHistory[i] < rssi || isListening)
rssiHistory[i] = rssi;
rssiHistory[(i+1)%128] = 0;
return;
}
#endif
rssiHistory[idx] = rssi;
}
static void Measure()
{
uint16_t rssi = scanInfo.rssi = GetRssi();
SetRssiHistory(scanInfo.i, rssi);
}
// Update things by keypress // Update things by keypress
@ -594,12 +638,26 @@ static void UpdateFreqInput(KEY_Code_t key) {
} }
static void Blacklist() { static void Blacklist() {
rssiHistory[peak.i] = RSSI_MAX_VALUE; #ifdef ENABLE_SCAN_RANGES
blacklistFreqs[blacklistFreqsIdx++ % ARRAY_SIZE(blacklistFreqs)] = peak.i;
#endif
SetRssiHistory(peak.i, RSSI_MAX_VALUE);
ResetPeak(); ResetPeak();
ToggleRX(false); ToggleRX(false);
newScanStart = true; ResetScanStats();
} }
#ifdef ENABLE_SCAN_RANGES
static bool IsBlacklisted(uint16_t idx)
{
for(uint8_t i = 0; i < ARRAY_SIZE(blacklistFreqs); i++)
if(blacklistFreqs[i] == idx)
return true;
return false;
}
#endif
// Draw things // Draw things
// applied x2 to prevent initial rounding // applied x2 to prevent initial rounding
@ -709,9 +767,11 @@ static void DrawRssiTriggerLevel() {
} }
static void DrawTicks() { static void DrawTicks() {
uint32_t f = GetFStart() % 100000; uint32_t f = GetFStart();
uint32_t step = GetScanStep(); uint32_t span = GetFEnd() - GetFStart();
for (uint8_t i = 0; i < 128; i += (1 << settings.stepsCount), f += step) { uint32_t step = span / 128;
for (uint8_t i = 0; i < 128; i += (1 << settings.stepsCount)) {
f = GetFStart() + span * i / 128;
uint8_t barValue = 0b00000001; uint8_t barValue = 0b00000001;
(f % 10000) < step && (barValue |= 0b00000010); (f % 10000) < step && (barValue |= 0b00000010);
(f % 50000) < step && (barValue |= 0b00000100); (f % 50000) < step && (barValue |= 0b00000100);
@ -763,9 +823,15 @@ static void OnKeyDown(uint8_t key) {
UpdateFreqChangeStep(false); UpdateFreqChangeStep(false);
break; break;
case KEY_UP: case KEY_UP:
#ifdef ENABLE_SCAN_RANGES
if(!gScanRangeStart)
#endif
UpdateCurrentFreq(true); UpdateCurrentFreq(true);
break; break;
case KEY_DOWN: case KEY_DOWN:
#ifdef ENABLE_SCAN_RANGES
if(!gScanRangeStart)
#endif
UpdateCurrentFreq(false); UpdateCurrentFreq(false);
break; break;
case KEY_SIDE1: case KEY_SIDE1:
@ -778,6 +844,9 @@ static void OnKeyDown(uint8_t key) {
UpdateRssiTriggerLevel(false); UpdateRssiTriggerLevel(false);
break; break;
case KEY_5: case KEY_5:
#ifdef ENABLE_SCAN_RANGES
if(!gScanRangeStart)
#endif
FreqInput(); FreqInput();
break; break;
case KEY_0: case KEY_0:
@ -787,6 +856,9 @@ static void OnKeyDown(uint8_t key) {
ToggleListeningBW(); ToggleListeningBW();
break; break;
case KEY_4: case KEY_4:
#ifdef ENABLE_SCAN_RANGES
if(!gScanRangeStart)
#endif
ToggleStepsCount(); ToggleStepsCount();
break; break;
case KEY_SIDE2: case KEY_SIDE2:
@ -931,7 +1003,7 @@ static void RenderStatus() {
static void RenderSpectrum() { static void RenderSpectrum() {
DrawTicks(); DrawTicks();
DrawArrow(peak.i << settings.stepsCount); DrawArrow(128u * peak.i / GetStepsCount());
DrawSpectrum(); DrawSpectrum();
DrawRssiTriggerLevel(); DrawRssiTriggerLevel();
DrawF(peak.f); DrawF(peak.f);
@ -952,6 +1024,7 @@ static void RenderStill() {
for (int i = 0; i < 121; i+=10) { for (int i = 0; i < 121; i+=10) {
gFrameBuffer[2][i + METER_PAD_LEFT] = 0b01110000; gFrameBuffer[2][i + METER_PAD_LEFT] = 0b01110000;
} }
uint8_t x = Rssi2PX(scanInfo.rssi, 0, 121); uint8_t x = Rssi2PX(scanInfo.rssi, 0, 121);
for (int i = 0; i < x; ++i) { for (int i = 0; i < x; ++i) {
if (i % 5) { if (i % 5) {
@ -1047,7 +1120,11 @@ bool HandleUserInput() {
} }
static void Scan() { static void Scan() {
if (rssiHistory[scanInfo.i] != RSSI_MAX_VALUE) { if (rssiHistory[scanInfo.i] != RSSI_MAX_VALUE
#ifdef ENABLE_SCAN_RANGES
&& !IsBlacklisted(scanInfo.i)
#endif
) {
SetF(scanInfo.f); SetF(scanInfo.f);
Measure(); Measure();
UpdateScanInfo(); UpdateScanInfo();
@ -1068,6 +1145,10 @@ static void UpdateScan() {
return; return;
} }
if(scanInfo.measurementsCount < 128)
memset(&rssiHistory[scanInfo.measurementsCount], 0,
sizeof(rssiHistory) - scanInfo.measurementsCount*sizeof(rssiHistory[0]));
redrawScreen = true; redrawScreen = true;
preventKeypress = false; preventKeypress = false;
@ -1120,7 +1201,7 @@ static void UpdateListening() {
} }
ToggleRX(false); ToggleRX(false);
newScanStart = true; ResetScanStats();
} }
static void Tick() { static void Tick() {
@ -1133,6 +1214,26 @@ static void Tick() {
} }
#endif #endif
#ifdef ENABLE_SCAN_RANGES
if (gNextTimeslice_500ms) {
gNextTimeslice_500ms = false;
// if a lot of steps then it takes long time
// we don't want to wait for whole scan
// listening has it's own timer
if(GetStepsCount()>128 && !isListening) {
UpdatePeakInfo();
if (IsPeakOverLevel()) {
ToggleRX(true);
TuneToPeak();
return;
}
redrawScreen = true;
preventKeypress = false;
}
}
#endif
if (!preventKeypress) { if (!preventKeypress) {
HandleUserInput(); HandleUserInput();
} }
@ -1164,18 +1265,32 @@ void APP_RunSpectrum() {
// TX here coz it always? set to active VFO // TX here coz it always? set to active VFO
vfo = gEeprom.TX_VFO; vfo = gEeprom.TX_VFO;
// set the current frequency in the middle of the display // set the current frequency in the middle of the display
currentFreq = initialFreq = gEeprom.VfoInfo[vfo].pRX->Frequency - #ifdef ENABLE_SCAN_RANGES
if(gScanRangeStart) {
currentFreq = initialFreq = gScanRangeStart;
for(uint8_t i = 0; i < ARRAY_SIZE(scanStepValues); i++) {
if(scanStepValues[i] >= gTxVfo->StepFrequency) {
settings.scanStepIndex = i;
break;
}
}
settings.stepsCount = STEPS_128;
}
else
#endif
currentFreq = initialFreq = gTxVfo->pRX->Frequency -
((GetStepsCount() / 2) * GetScanStep()); ((GetStepsCount() / 2) * GetScanStep());
BackupRegisters(); BackupRegisters();
isListening = true; // to turn off RX later isListening = true; // to turn off RX later
redrawStatus = true; redrawStatus = true;
redrawScreen = false; // we will wait until scan done redrawScreen = true;
newScanStart = true; newScanStart = true;
ToggleRX(true), ToggleRX(false); // hack to prevent noise when squelch off ToggleRX(true), ToggleRX(false); // hack to prevent noise when squelch off
RADIO_SetModulation(settings.modulationType = gRxVfo->Modulation); RADIO_SetModulation(settings.modulationType = gTxVfo->Modulation);
BK4819_SetFilterBandwidth(settings.listenBw = BK4819_FILTER_BW_WIDE, false); BK4819_SetFilterBandwidth(settings.listenBw = BK4819_FILTER_BW_WIDE, false);

View file

@ -16,7 +16,7 @@
#ifndef SPECTRUM_H #ifndef SPECTRUM_H
#define SPECTRUM_H #define SPECTRUM_H
#include "../frequencies.h"
#include "../bitmaps.h" #include "../bitmaps.h"
#include "../board.h" #include "../board.h"
#include "../bsp/dp32g030/gpio.h" #include "../bsp/dp32g030/gpio.h"
@ -29,7 +29,6 @@
#include "../driver/systick.h" #include "../driver/systick.h"
#include "../external/printf/printf.h" #include "../external/printf/printf.h"
#include "../font.h" #include "../font.h"
#include "../frequencies.h"
#include "../helper/battery.h" #include "../helper/battery.h"
#include "../misc.h" #include "../misc.h"
#include "../radio.h" #include "../radio.h"
@ -49,6 +48,7 @@ static const uint16_t scanStepValues[] = {
1, 10, 50, 100, 250, 500, 625, 833, 1, 10, 50, 100, 250, 500, 625, 833,
1000, 1250, 1500, 2000, 2500, 5000, 10000, 1000, 1250, 1500, 2000, 2500, 5000, 10000,
}; };
static const uint16_t scanStepBWRegValues[] = { static const uint16_t scanStepBWRegValues[] = {
// RX RXw TX BW // RX RXw TX BW
// 0b0 000 000 001 01 1000 // 0b0 000 000 001 01 1000
@ -138,17 +138,17 @@ typedef struct KeyboardState {
typedef struct ScanInfo { typedef struct ScanInfo {
uint16_t rssi, rssiMin, rssiMax; uint16_t rssi, rssiMin, rssiMax;
uint8_t i, iPeak; uint16_t i, iPeak;
uint32_t f, fPeak; uint32_t f, fPeak;
uint16_t scanStep; uint16_t scanStep;
uint8_t measurementsCount; uint16_t measurementsCount;
} ScanInfo; } ScanInfo;
typedef struct PeakInfo { typedef struct PeakInfo {
uint16_t t; uint16_t t;
uint16_t rssi; uint16_t rssi;
uint32_t f; uint32_t f;
uint8_t i; uint16_t i;
} PeakInfo; } PeakInfo;
void APP_RunSpectrum(void); void APP_RunSpectrum(void);

View file

@ -243,7 +243,7 @@
#define MDC尾音 "\x4D\x44\x43\x84\xE1\x8A\x01" #define MDC尾音 "\x4D\x44\x43\x84\xE1\x8A\x01"
#define MDC首音 "\x4D\x44\x43\x8A\x1E\x8A\x01" #define MDC首音 "\x4D\x44\x43\x8A\x1E\x8A\x01"
#define MDC首尾音 "\x4D\x44\x43\x8A\x1E\x84\xE1\x8A\x01" #define MDC首尾音 "\x4D\x44\x43\x8A\x1E\x84\xE1\x8A\x01"
#define MDC首音加ROGER "\x4D\x44\x43\x8A\x1E\x8A\x01\x2B+\x52\x4F\x47\x45\x52" #define MDC首音加ROGER "\x4D\x44\x43\x8A\x1E\x8A\x01\x2B\x52\x4F\x47\x45\x52"
#define 除信道参数 "\x8A\xB7\x89\x89\x92\xC8\x87\xB8\x95\x19" #define 除信道参数 "\x8A\xB7\x89\x89\x92\xC8\x87\xB8\x95\x19"
#define 全部参数 "\x82\x65\x8D\x11\x87\xB8\x95\x19" #define 全部参数 "\x82\x65\x8D\x11\x87\xB8\x95\x19"
#define 禁用全部 "\x93\xCF\x81\x50\x82\x65\x8D\x11" #define 禁用全部 "\x93\xCF\x81\x50\x82\x65\x8D\x11"

111
font.c
View file

@ -15,7 +15,7 @@
*/ */
#include "font.h" #include "font.h"
bool menu_set_flag=false;
#if 0 #if 0
@ -26,11 +26,6 @@
const uint8_t gFontBigDigits[11][20] = const uint8_t gFontBigDigits[11][20] =
{ {
//
//
{/*0x00, 0x00,*/ 0xFC, 0xFE, 0xFE, 0x06, 0x86, 0xC6, 0xE6, 0xFE, 0xFE, 0xFC, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x67, 0x63, 0x61, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/}, {/*0x00, 0x00,*/ 0xFC, 0xFE, 0xFE, 0x06, 0x86, 0xC6, 0xE6, 0xFE, 0xFE, 0xFC, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x67, 0x63, 0x61, 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,*/ 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,*/ 0x1C, 0x1E, 0x1E, 0x06, 0x06, 0x06, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x60, 0x70, 0x78, 0x7C, 0x6E, 0x67, 0x63, 0x61, 0x60, 0x60, /*0x00*/},
@ -144,110 +139,6 @@ const uint8_t gFontSmall[95-1][6] =
{0x04, 0x02, 0x04, 0x08, 0x04, 0x00} // '->' {0x04, 0x02, 0x04, 0x08, 0x04, 0x00} // '->'
}; };
#ifdef ENABLE_SMALL_BOLD
const uint8_t gFontSmallBold[95 - 1][6] =
{
// {0x7F, 0x7F, 0x1B, 0x3B, 0x7F, 0x66},
// {0x3F, 0x7F, 0x30, 0x30, 0x7F, 0x3F},
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x5E, 0x5E, 0x00, 0x00},
{0x06, 0x06, 0x00, 0x06, 0x06, 0x00},
{0x14, 0x3E, 0x14, 0x3E, 0x14, 0x00},
{0x2E, 0x6B, 0x7F, 0x6B, 0x3A, 0x00},
{0x63, 0x33, 0x18, 0x0C, 0x66, 0x63},
{0x30, 0x4B, 0x4D, 0x55, 0x22, 0x50},
{0x00, 0x00, 0x07, 0x07, 0x00, 0x00},
{0x00, 0x1C, 0x3E, 0x63, 0x41, 0x00},
{0x00, 0x41, 0x63, 0x3E, 0x1C, 0x00},
{0x00, 0x2A, 0x1C, 0x1C, 0x2A, 0x00},
{0x18, 0x18, 0x7E, 0x7E, 0x18, 0x18},
{0x00, 0x40, 0x60, 0x20, 0x00, 0x00},
{0x00, 0x18, 0x18, 0x18, 0x18, 0x00},
{0x00, 0x00, 0x60, 0x60, 0x00, 0x00},
{0x60, 0x30, 0x18, 0x0C, 0x06, 0x03},
{0x3E, 0x7F, 0x63, 0x63, 0x7F, 0x3E},
{0x64, 0x66, 0x7F, 0x7F, 0x60, 0x60},
{0x62, 0x73, 0x7B, 0x7B, 0x6F, 0x66},
{0x63, 0x63, 0x6B, 0x6B, 0x7F, 0x36},
{0x38, 0x3C, 0x36, 0x7F, 0x7F, 0x30},
{0x6F, 0x6F, 0x6B, 0x6B, 0x7B, 0x33},
{0x3E, 0x7F, 0x6B, 0x6B, 0x7B, 0x32},
{0x03, 0x03, 0x73, 0x7B, 0x0F, 0x07},
{0x36, 0x7F, 0x6B, 0x6B, 0x7F, 0x36},
{0x06, 0x6F, 0x6B, 0x6B, 0x7F, 0x3E},
{0x00, 0x00, 0x6C, 0x6C, 0x00, 0x00},
{0x00, 0x40, 0x6C, 0x2C, 0x00, 0x00},
{0x08, 0x14, 0x22, 0x41, 0x00, 0x00},
{0x36, 0x36, 0x36, 0x36, 0x36, 0x00},
{0x00, 0x41, 0x22, 0x14, 0x08, 0x00},
{0x06, 0x07, 0x53, 0x5B, 0x1F, 0x0E},
{0x30, 0x7B, 0x6B, 0x7B, 0x7F, 0x3E},
{0x7E, 0x7F, 0x1B, 0x1B, 0x7F, 0x7E},
{0x7F, 0x7F, 0x6B, 0x6B, 0x7F, 0x36},
{0x3E, 0x7F, 0x63, 0x63, 0x63, 0x36},
{0x7F, 0x7F, 0x63, 0x63, 0x7F, 0x3E},
{0x7F, 0x7F, 0x6B, 0x6B, 0x6B, 0x63},
{0x7F, 0x7F, 0x1B, 0x1B, 0x1B, 0x03},
{0x3E, 0x7F, 0x63, 0x6B, 0x7B, 0x3A},
{0x7F, 0x7F, 0x0C, 0x0C, 0x7F, 0x7F},
{0x63, 0x63, 0x7F, 0x7F, 0x63, 0x63},
{0x30, 0x73, 0x63, 0x7F, 0x3F, 0x03},
{0x7F, 0x7F, 0x1C, 0x36, 0x63, 0x41},
{0x7F, 0x7F, 0x60, 0x60, 0x60, 0x60},
{0x7F, 0x7F, 0x06, 0x06, 0x7F, 0x7F},
{0x7F, 0x7F, 0x0C, 0x18, 0x7F, 0x7F},
{0x3E, 0x7F, 0x63, 0x63, 0x7F, 0x3E},
{0x7F, 0x7F, 0x1B, 0x1B, 0x1F, 0x0E},
{0x3E, 0x7F, 0x63, 0x73, 0x7F, 0x7E},
{0x7F, 0x7F, 0x1B, 0x3B, 0x7F, 0x66},
{0x66, 0x6F, 0x6B, 0x6B, 0x7B, 0x33},
{0x03, 0x03, 0x7F, 0x7F, 0x03, 0x03},
{0x3F, 0x7F, 0x60, 0x60, 0x7F, 0x3F},
{0x1F, 0x3F, 0x60, 0x60, 0x3F, 0x1F},
{0x3F, 0x7F, 0x30, 0x30, 0x7F, 0x3F},
{0x63, 0x77, 0x1C, 0x1C, 0x77, 0x63},
{0x07, 0x0F, 0x78, 0x78, 0x0F, 0x07},
{0x63, 0x73, 0x7B, 0x6F, 0x67, 0x63},
{0x00, 0x7F, 0x7F, 0x63, 0x63, 0x00},
{0x01, 0x02, 0x04, 0x08, 0x10, 0x60},
{0x00, 0x63, 0x63, 0x7F, 0x7F, 0x00},
{0x0C, 0x0E, 0x03, 0x03, 0x0E, 0x0C},
{0x60, 0x60, 0x60, 0x60, 0x60, 0x60},
{0x00, 0x03, 0x07, 0x06, 0x00, 0x00},
{0x20, 0x76, 0x56, 0x56, 0x7E, 0x3C},
{0x7F, 0x7F, 0x6C, 0x6C, 0x7C, 0x38},
{0x38, 0x7C, 0x6C, 0x6C, 0x6C, 0x00},
{0x38, 0x7C, 0x6C, 0x6C, 0x7F, 0x7F},
{0x3C, 0x7E, 0x56, 0x56, 0x5E, 0x0C},
{0x7E, 0x7F, 0x1B, 0x1B, 0x02, 0x00},
{0x0C, 0x5E, 0x56, 0x56, 0x7E, 0x3C},
{0x7F, 0x7F, 0x0C, 0x0C, 0x7C, 0x78},
{0x00, 0x00, 0x7A, 0x7A, 0x00, 0x00},
{0x30, 0x60, 0x60, 0x7D, 0x3D, 0x00},
{0x7F, 0x7F, 0x18, 0x3C, 0x7E, 0x66},
{0x00, 0x3F, 0x7F, 0x40, 0x00, 0x00},
{0x7C, 0x7C, 0x18, 0x18, 0x7C, 0x7C},
{0x7C, 0x7C, 0x0C, 0x0C, 0x7C, 0x78},
{0x3C, 0x7E, 0x66, 0x66, 0x7E, 0x3C},
{0x7E, 0x7E, 0x36, 0x36, 0x3E, 0x1C},
{0x1C, 0x3E, 0x36, 0x7E, 0x7E, 0x60},
{0x7C, 0x7C, 0x0C, 0x0C, 0x18, 0x00},
{0x4C, 0x5E, 0x56, 0x56, 0x76, 0x20},
{0x3F, 0x7F, 0x6C, 0x6C, 0x60, 0x00},
{0x3C, 0x7C, 0x60, 0x60, 0x7C, 0x3C},
{0x0C, 0x3C, 0x70, 0x70, 0x3C, 0x0C},
{0x3C, 0x7C, 0x30, 0x30, 0x7C, 0x3C},
{0x44, 0x6C, 0x38, 0x38, 0x6C, 0x44},
{0x06, 0x6E, 0x68, 0x68, 0x7E, 0x3E},
{0x66, 0x76, 0x7E, 0x6E, 0x66, 0x00},
{0x08, 0x3E, 0x77, 0x41, 0x00, 0x00},
{0x00, 0x00, 0x7F, 0x00, 0x00, 0x00},
{0x00, 0x41, 0x77, 0x3E, 0x08, 0x00},
{0x0C, 0x06, 0x0C, 0x18, 0x0C, 0x00}
};
#endif
#ifdef ENABLE_SPECTRUM #ifdef ENABLE_SPECTRUM
const uint8_t gFont3x5[][3] = const uint8_t gFont3x5[][3] =

7
font.h
View file

@ -22,19 +22,18 @@
extern const uint8_t gFontChinese_out[2013]; extern const uint8_t gFontChinese_out[2013];
#define CHN_FONT_WIDTH 11U #define CHN_FONT_WIDTH 11U
#define CHN_FONT_HIGH 12U #define CHN_FONT_HIGH 12U
#define ENABLE_CHINESE_FULL 4 #define ENABLE_CHINESE_FULL 0
#if ENABLE_CHINESE_FULL ==4 #if ENABLE_CHINESE_FULL ==4
#define MAX_EDIT_INDEX 13 #define MAX_EDIT_INDEX 13
#else #else
#define MAX_EDIT_INDEX 10 #define MAX_EDIT_INDEX 10
#endif #endif
extern bool menu_set_flag;
extern const uint8_t gFontBigDigits[11][20/*20*/]; extern const uint8_t gFontBigDigits[11][20/*20*/];
extern const uint8_t gFont3x5[96][3]; extern const uint8_t gFont3x5[96][3];
extern const uint8_t gFontSmall[95 - 1][6]; extern const uint8_t gFontSmall[95 - 1][6];
#ifdef ENABLE_SMALL_BOLD
extern const uint8_t gFontSmallBold[95 - 1][6];
#endif
#if ENABLE_CHINESE_FULL > 0 #if ENABLE_CHINESE_FULL > 0
#if ENABLE_CHINESE_FULL==1 #if ENABLE_CHINESE_FULL==1

4
misc.h
View file

@ -36,7 +36,9 @@
#define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST) #define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
#define IS_VALID_CHANNEL(x) ((x) < LAST_CHANNEL) #define IS_VALID_CHANNEL(x) ((x) < LAST_CHANNEL)
#define IS_NOAA_CHANNEL(x) ((x) >= NOAA_CHANNEL_FIRST && (x) <= NOAA_CHANNEL_LAST) #define IS_NOAA_CHANNEL(x) ((x) >= NOAA_CHANNEL_FIRST && (x) <= NOAA_CHANNEL_LAST)
#ifndef SWAP
#define SWAP(a, b) ({ __typeof__ (a) _c = (a); a = b; b = _c; })
#endif
enum { enum {
MR_CHANNEL_FIRST = 0, MR_CHANNEL_FIRST = 0,
MR_CHANNEL_LAST = 199u, MR_CHANNEL_LAST = 199u,

View file

@ -112,8 +112,13 @@ void UI_PrintCharSmall(char character, uint8_t Start, uint8_t Line) {
void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line) { void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line) {
uint8_t Length = strlen(pString); uint8_t Length = strlen(pString);
#if ENABLE_CHINESE_FULL == 0
if (menu_set_flag == 1)
{
Length = Length > 7 ? 7 : Length;
menu_set_flag = 0;
}
#endif
size_t i; size_t i;
uint8_t sum_pixel = 0; uint8_t sum_pixel = 0;
uint16_t true_char[Length]; uint16_t true_char[Length];
@ -225,29 +230,6 @@ true_char[i]=true_char[i]-true_char[i]/256-1;
} }
} }
#ifdef ENABLE_SMALL_BOLD
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line)
{
const size_t Length = strlen(pString);
size_t i;
if (End > Start)
Start += (((End - Start) - (Length * 8)) + 1) / 2;
const unsigned int char_width = ARRAY_SIZE(gFontSmallBold[0]);
const unsigned int char_spacing = char_width + 1;
uint8_t *pFb = gFrameBuffer[Line] + Start;
for (i = 0; i < Length; i++)
{
if (pString[i] > ' ')
{
const unsigned int index = (unsigned int)pString[i] - ' ' - 1;
if (index < ARRAY_SIZE(gFontSmallBold))
memmove(pFb + (i * char_spacing) + 1, &gFontSmallBold[index], char_width);
}
}
}
#endif
void UI_PrintStringSmallBuffer(const char *pString, uint8_t *buffer) { void UI_PrintStringSmallBuffer(const char *pString, uint8_t *buffer) {
size_t i; size_t i;

View file

@ -28,15 +28,13 @@ uint8_t is_chn(uint8_t num);
bool CHINESE_JUDGE(char *name,uint8_t len); bool CHINESE_JUDGE(char *name,uint8_t len);
#ifdef ENABLE_SMALL_BOLD
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
#endif
void UI_PrintStringSmallBuffer(const char *pString, uint8_t *buffer); void UI_PrintStringSmallBuffer(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);
#endif
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);
void UI_DisplayPopup(const char *string); void UI_DisplayPopup(const char *string);
#endif
//void UI_DrawPixel(uint8_t x, uint8_t y, bool black); //void UI_DrawPixel(uint8_t x, uint8_t y, bool black);
//void UI_DrawLine(int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black); //void UI_DrawLine(int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black);

View file

@ -360,8 +360,7 @@ void UI_DisplayMain(void) {
UI_PrintStringSmall("ScnRng", 5, 0, line); UI_PrintStringSmall("ScnRng", 5, 0, line);
sprintf(String, "%3u.%05u", gScanRangeStart / 100000, gScanRangeStart % 100000); sprintf(String, "%3u.%05u", gScanRangeStart / 100000, gScanRangeStart % 100000);
UI_PrintStringSmall(String, 56, 0, line); UI_PrintStringSmall(String, 56, 0, line);
uint32_t frq = gEeprom.VfoInfo[vfo_num].pRX->Frequency; sprintf(String, "%3u.%05u", gScanRangeStop / 100000, gScanRangeStop % 100000);
sprintf(String, "%3u.%05u", frq / 100000, frq % 100000);
UI_PrintStringSmall(String, 56, 0, line + 1); UI_PrintStringSmall(String, 56, 0, line + 1);
continue; continue;
} }
@ -541,11 +540,12 @@ void UI_DisplayMain(void) {
memcpy(gFrameBuffer[line + 2] + 113, BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); memcpy(gFrameBuffer[line + 2] + 113, BITMAP_ScanList1, sizeof(BITMAP_ScanList1));
else else
memcpy(p_line0 + 113, BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); memcpy(p_line0 + 113, BITMAP_ScanList1, sizeof(BITMAP_ScanList1));
#endif
} }
#endif
if (att.scanlist2) { if (att.scanlist2) {
#if ENABLE_CHINESE_FULL != 4 #if ENABLE_CHINESE_FULL != 4
memcpy(p_line0 + 120, BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); memcpy(p_line0 + 120, BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
@ -554,10 +554,10 @@ void UI_DisplayMain(void) {
memcpy(gFrameBuffer[line + 2] + 120, BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); memcpy(gFrameBuffer[line + 2] + 120, BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
else else
memcpy(p_line0 + 120, BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); memcpy(p_line0 + 120, BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
#endif
} }
#endif
// compander symbol // compander symbol
#ifndef ENABLE_BIG_FREQ #ifndef ENABLE_BIG_FREQ
@ -605,11 +605,9 @@ void UI_DisplayMain(void) {
if (gEeprom.CHANNEL_DISPLAY_MODE == MDF_NAME) { if (gEeprom.CHANNEL_DISPLAY_MODE == MDF_NAME) {
UI_PrintStringSmall(String, 32, 0, line); UI_PrintStringSmall(String, 32, 0, line);
} else { } else {
#ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold(String, 32 + 4, 0, line);
#else
UI_PrintStringSmall(String, 32 + 4, 0, line); UI_PrintStringSmall(String, 32 + 4, 0, line);
#endif
// show the channel frequency below the channel number/name // show the channel frequency below the channel number/name
sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000); sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000);
#if ENABLE_CHINESE_FULL != 4 #if ENABLE_CHINESE_FULL != 4
@ -727,7 +725,7 @@ void UI_DisplayMain(void) {
if(IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]) &&!(FUNCTION_IsRx() && gEeprom.RX_VFO == vfo_num ) &&!( gCurrentFunction == FUNCTION_TRANSMIT&&activeTxVFO == vfo_num) ) if(IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]) &&!(FUNCTION_IsRx() && gEeprom.RX_VFO == vfo_num ) &&!( gCurrentFunction == FUNCTION_TRANSMIT&&activeTxVFO == vfo_num) )
UI_PrintStringSmall(String, LCD_WIDTH + 8, 0, line -1); //中文信道1 UI_PrintStringSmall(String, LCD_WIDTH + 9, 0, line -1); //中文信道1
else if(!IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]) ) else if(!IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]) )
UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, line + 1); //中文信道1 UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, line + 1); //中文信道1
@ -744,7 +742,7 @@ void UI_DisplayMain(void) {
UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, line + 1);//中文信道1 UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, line + 1);//中文信道1
#else #else
if(IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]) &&!(FUNCTION_IsRx() && gEeprom.RX_VFO == vfo_num ) &&!( gCurrentFunction == FUNCTION_TRANSMIT&&activeTxVFO == vfo_num) ) if(IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]) &&!(FUNCTION_IsRx() && gEeprom.RX_VFO == vfo_num ) &&!( gCurrentFunction == FUNCTION_TRANSMIT&&activeTxVFO == vfo_num) )
UI_PrintStringSmall(String, LCD_WIDTH + 16, 0, line - 1);//中文信道1 UI_PrintStringSmall(String, LCD_WIDTH + 17, 0, line - 1);//中文信道1
else if(!IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]) ) else if(!IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]) )
UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, line + 1);//中文信道1 UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, line + 1);//中文信道1
#endif #endif
@ -792,9 +790,10 @@ void UI_DisplayMain(void) {
UI_PrintStringSmall("D", LCD_WIDTH + 105, 0, line + 1);//中文信道1 UI_PrintStringSmall("D", LCD_WIDTH + 105, 0, line + 1);//中文信道1
else else
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, line + 1);//中文信道1 UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, line + 1);//中文信道1
#endif
} }
#endif
#endif #endif
// show the audio scramble symbol // show the audio scramble symbol
if (gEeprom.VfoInfo[vfo_num].SCRAMBLING_TYPE > 0/* && gSetting_ScrambleEnable*/) { if (gEeprom.VfoInfo[vfo_num].SCRAMBLING_TYPE > 0/* && gSetting_ScrambleEnable*/) {
@ -806,9 +805,10 @@ void UI_DisplayMain(void) {
UI_PrintStringSmall("E", LCD_WIDTH + 29, 0, line +1);//中文信道1 ok UI_PrintStringSmall("E", LCD_WIDTH + 29, 0, line +1);//中文信道1 ok
else else
UI_PrintStringSmall("ENC", LCD_WIDTH + 106, 0, line + 1);//中文信道1 UI_PrintStringSmall("ENC", LCD_WIDTH + 106, 0, line + 1);//中文信道1
#endif
} }
#endif
} }
#ifdef ENABLE_AGC_SHOW_DATA #ifdef ENABLE_AGC_SHOW_DATA
@ -840,11 +840,9 @@ void UI_DisplayMain(void) {
//#else //#else
// sprintf(String, "MDC1200 ID %04X", mdc1200_unit_id); // sprintf(String, "MDC1200 ID %04X", mdc1200_unit_id);
//#endif //#endif
#ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold(String, print_col, 0, 3);
#else
UI_PrintStringSmall(String, print_col, 0, 3); UI_PrintStringSmall(String, print_col, 0, 3);
#endif
} else } else
#endif #endif

View file

@ -1189,6 +1189,7 @@ void UI_ShowChineseMenu() {
} }
cnt_char = 0; cnt_char = 0;
if (size_menu < 48)cnt_char = (48 - size_menu ) / 2; if (size_menu < 48)cnt_char = (48 - size_menu ) / 2;
menu_set_flag=1;
UI_PrintStringSmall(MenuList[gMenuCursor].name, (cnt_char), 0, 0); UI_PrintStringSmall(MenuList[gMenuCursor].name, (cnt_char), 0, 0);

View file

@ -27,7 +27,7 @@ typedef struct {
VOICE_ID_t voice_id; VOICE_ID_t voice_id;
uint8_t menu_id; uint8_t menu_id;
#if ENABLE_CHINESE_FULL==4 #if ENABLE_CHINESE_FULL==4
const char name[16]; // 使用指针而不是固定长度数组 const char name[15]; // 使用指针而不是固定长度数组
#else #else
const char name[7]; // 使用指针而不是固定长度数组 const char name[7]; // 使用指针而不是固定长度数组
#endif #endif

Binary file not shown.

View file

@ -1,10 +1,15 @@
#include "font.h"
#define ONE_OF_ELEVEN_VER #define ONE_OF_ELEVEN_VER
#ifdef GIT_HASH #ifdef GIT_HASH
#define VER GIT_HASH #define VER GIT_HASH
#else #else
#define VER "111TEST2" #if ENABLE_CHINESE_FULL ==0
#define VER "111"
#else
#define VER "111K"
#endif
#endif #endif
#ifndef ONE_OF_ELEVEN_VER #ifndef ONE_OF_ELEVEN_VER