Add compile options
This commit is contained in:
4
Makefile
4
Makefile
@@ -43,6 +43,7 @@ ENABLE_SCAN_RANGES ?= 1
|
|||||||
ENABLE_FEAT_F4HWN ?= 1
|
ENABLE_FEAT_F4HWN ?= 1
|
||||||
ENABLE_FEAT_F4HWN_SCREENSHOT ?= 0
|
ENABLE_FEAT_F4HWN_SCREENSHOT ?= 0
|
||||||
ENABLE_FEAT_F4HWN_PMR ?= 1
|
ENABLE_FEAT_F4HWN_PMR ?= 1
|
||||||
|
ENABLE_FEAT_F4HWN_SPECTRUM ?= 1
|
||||||
|
|
||||||
# ---- DEBUGGING ----
|
# ---- DEBUGGING ----
|
||||||
ENABLE_AM_FIX_SHOW_DATA ?= 0
|
ENABLE_AM_FIX_SHOW_DATA ?= 0
|
||||||
@@ -407,6 +408,9 @@ endif
|
|||||||
ifeq ($(ENABLE_FEAT_F4HWN_PMR),1)
|
ifeq ($(ENABLE_FEAT_F4HWN_PMR),1)
|
||||||
CFLAGS += -DENABLE_FEAT_F4HWN_PMR
|
CFLAGS += -DENABLE_FEAT_F4HWN_PMR
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(ENABLE_FEAT_F4HWN_SPECTRUM),1)
|
||||||
|
CFLAGS += -DENABLE_FEAT_F4HWN_SPECTRUM
|
||||||
|
endif
|
||||||
|
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
LDFLAGS += -z noexecstack -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld -Wl,--gc-sections
|
LDFLAGS += -z noexecstack -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld -Wl,--gc-sections
|
||||||
|
@@ -23,7 +23,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "driver/backlight.h"
|
#include "driver/backlight.h"
|
||||||
#include "driver/eeprom.h"
|
|
||||||
#include "frequencies.h"
|
#include "frequencies.h"
|
||||||
#include "ui/helper.h"
|
#include "ui/helper.h"
|
||||||
#include "ui/main.h"
|
#include "ui/main.h"
|
||||||
@@ -32,6 +31,10 @@
|
|||||||
#include "screenshot.h"
|
#include "screenshot.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
|
||||||
|
#include "driver/eeprom.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
struct FrequencyBandInfo {
|
struct FrequencyBandInfo {
|
||||||
uint32_t lower;
|
uint32_t lower;
|
||||||
uint32_t upper;
|
uint32_t upper;
|
||||||
@@ -106,9 +109,9 @@ RegisterSpec registerSpecs[] = {
|
|||||||
|
|
||||||
uint16_t statuslineUpdateTimer = 0;
|
uint16_t statuslineUpdateTimer = 0;
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
|
||||||
static void LoadSettings()
|
static void LoadSettings()
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
|
||||||
uint8_t Data[8] = {0};
|
uint8_t Data[8] = {0};
|
||||||
// 1FF0..0x1FF7
|
// 1FF0..0x1FF7
|
||||||
EEPROM_ReadBuffer(0x1FF0, Data, 8);
|
EEPROM_ReadBuffer(0x1FF0, Data, 8);
|
||||||
@@ -133,13 +136,10 @@ static void LoadSettings()
|
|||||||
{
|
{
|
||||||
settings.listenBw = BK4819_FILTER_BW_WIDE;
|
settings.listenBw = BK4819_FILTER_BW_WIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SaveSettings()
|
static void SaveSettings()
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
|
||||||
uint8_t Data[8] = {0};
|
uint8_t Data[8] = {0};
|
||||||
// 1FF0..0x1FF7
|
// 1FF0..0x1FF7
|
||||||
EEPROM_ReadBuffer(0x1FF0, Data, 8);
|
EEPROM_ReadBuffer(0x1FF0, Data, 8);
|
||||||
@@ -147,9 +147,8 @@ static void SaveSettings()
|
|||||||
Data[4] = (settings.scanStepIndex << 4) | (settings.stepsCount << 2) | settings.listenBw;
|
Data[4] = (settings.scanStepIndex << 4) | (settings.stepsCount << 2) | settings.listenBw;
|
||||||
|
|
||||||
EEPROM_WriteBuffer(0x1FF0, Data);
|
EEPROM_WriteBuffer(0x1FF0, Data);
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static uint8_t DBm2S(int dbm) {
|
static uint8_t DBm2S(int dbm) {
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
@@ -978,7 +977,9 @@ static void OnKeyDown(uint8_t key) {
|
|||||||
menuState = 0;
|
menuState = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
|
#endif
|
||||||
DeInitSpectrum();
|
DeInitSpectrum();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1368,7 +1369,9 @@ static void Tick() {
|
|||||||
void APP_RunSpectrum() {
|
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;
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
|
||||||
LoadSettings();
|
LoadSettings();
|
||||||
|
#endif
|
||||||
// set the current frequency in the middle of the display
|
// set the current frequency in the middle of the display
|
||||||
#ifdef ENABLE_SCAN_RANGES
|
#ifdef ENABLE_SCAN_RANGES
|
||||||
if(gScanRangeStart) {
|
if(gScanRangeStart) {
|
||||||
@@ -1393,11 +1396,14 @@ void APP_RunSpectrum() {
|
|||||||
redrawScreen = true;
|
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 = gTxVfo->Modulation);
|
RADIO_SetModulation(settings.modulationType = gTxVfo->Modulation);
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
|
||||||
BK4819_SetFilterBandwidth(settings.listenBw, false);
|
BK4819_SetFilterBandwidth(settings.listenBw, false);
|
||||||
|
#else
|
||||||
|
BK4819_SetFilterBandwidth(settings.listenBw = BK4819_FILTER_BW_WIDE, false);
|
||||||
|
#endif
|
||||||
|
|
||||||
RelaunchScan();
|
RelaunchScan();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user