Skip to content

Commit

Permalink
Merge pull request #113 from kamilsss655/rc20.1
Browse files Browse the repository at this point in the history
Rc20.1
  • Loading branch information
kamilsss655 committed Jan 30, 2024
2 parents 98a5da2 + 34cb598 commit 8333de6
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 139 deletions.
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ ENABLE_TX1750 := 0
ENABLE_PWRON_PASSWORD := 1
ENABLE_DTMF_CALLING := 0

#---- DEBUG ----
ENABLE_ULTRA_LOW_POWER_TX := 0

# ---- CUSTOM MODS ----
ENABLE_BIG_FREQ := 1
ENABLE_SMALL_BOLD := 1
Expand Down Expand Up @@ -364,9 +361,6 @@ endif
ifeq ($(ENABLE_DTMF_CALLING),1)
CFLAGS += -DENABLE_DTMF_CALLING
endif
ifeq ($(ENABLE_ULTRA_LOW_POWER_TX),1)
CFLAGS += -DENABLE_ULTRA_LOW_POWER_TX
endif
ifeq ($(ENABLE_SPECTRUM_CHANNEL_SCAN),1)
CFLAGS += -DENABLE_SPECTRUM_CHANNEL_SCAN
endif
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This repository is a fork of [Egzumer firmare](https://github.com/egzumer/uv-k5-
* `RxOff` menu setting offsets the receive frequency by any specified amount in the range of `0-150Mhz` for use with upconverters. Allows to fine tune frequency (in `1kHz` steps) as opposed to other implementations that use hardcoded offsets. (**IMPORTANT: Make sure you set this value to 0 if not using an upconverter, when used for the first time. Otherwise it might load some random offset from EEPROM.**)
* `ENABLE_SPECTRUM_COPY_VFO` allowing to exit the spectrum and fine tuning screen with PTT button and copy current peak frequency, modulation, step, bandwidth to VFO. Also entering spectrum will carry these settings from VFO (full integration). Now to enter fine tuning screen in spectrum press MENU button. This allows you to save and respond to the frequencies found much faster.
* `ENABLE_SPECTRUM_SHOW_CHANNEL_NAME` shows channel number and channel name of the peak frequency in spectrum
* `ENABLE_ULTRA_LOW_POWER_TX` flag allows to transmit with ultra low power (thanks to egzumer work) for local testing of communication between radios.
* `ENABLE_ADJUSTABLE_RX_GAIN_SETTINGS` keeps the rx gain settings set in spectrum mode after exit (otherwise these are always overwritten to default value), this makes much more sense considering that we have a radio with user adjustable gain so why not use it to adjust to current radio conditions, maximum gain allows to greatly increase reception in scan memory channels mode (in this configuration default gain settings are only set at boot and when exiting AM modulation mode to set it to sane value after am fix)
* `VOXSen` fixed and improved VOX sensitivity setting from menu. Added `VoxDel` - VOX delay setting allowing to set value to `0` for no VOX delay which might be useful for packet radio enthusiasts (APRS etc.).
* `SqTone` configurable squelch tail tones and 180* phase shift tail when in CTCSS mode
Expand Down Expand Up @@ -163,7 +162,6 @@ ENABLE_BLMIN_TMP_OFF := 0 additional function for configurab
ENABLE_SCAN_RANGES := 1 scan range mode for frequency scanning, see wiki for instructions (radio operation -> frequency scanning)
ENABLE_SPECTRUM_COPY_VFO := 1 pressing MENU in spectrum mode will exit and copy current peak frequency, bw, step, modulation to current VFO, also entering spectrum will carry these settings from VFO (full integration)
ENABLE_SPECTRUM_SHOW_CHANNEL_NAME := 1 shows channel number and channel name of the peak frequency in spectrum
ENABLE_ULTRA_LOW_POWER_TX := 0 transmits with ultra low power. useful for dev/testing
ENABLE_ADJUSTABLE_RX_GAIN_SETTINGS := 1 keeps the rx gain settings set in spectrum mode after exit (otherwise these are always overwritten to default value), this makes much more sense considering that we have a radio with user adjustable gain so why not use it to adjust to current radio conditions, maximum gain allows to greatly increase reception in scan memory channels mode (in this configuration default gain settings are only set at boot and when exiting AM modulation mode to set it to sane value after am fix)
ENABLE_SPECTRUM_CHANNEL_SCAN := 1 this enables spectrum channel scan mode (enter by going into memory mode and press F+5, this allows SUPER fast channel scanning (4.5x faster than regular scanning), regular scan of 200 memory channels takes roughly 18 seconds, spectrum memory scan takes roughly 4 seconds, if you have less channels stored i.e 50 - the spectrum memory scan will take only **1 second**
ENABLE_ENCRYPTION := 1 enable ChaCha20 256 bit encryption for messenger
Expand Down
20 changes: 19 additions & 1 deletion app/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,24 @@ void ACTION_Scan(bool bRestart)
}
#endif

void ACTION_RunSpectrum(void)
{
#ifdef ENABLE_SPECTRUM_CHANNEL_SCAN

if(gScanRangeStart){
// if scanRangeStart then we enter in scan range mode
APP_RunSpectrum(SCAN_RANGE_MODE);
}
else{
// if we are in channel mode then enter spectrum in channel mode
// otherwise enter spectrum in frequency mode
APP_RunSpectrum(IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE));
}
#elif
APP_RunSpectrum();
#endif
}

void ACTION_SwitchDemodul(void)
{
gTxVfo->Modulation++;
Expand Down Expand Up @@ -408,7 +426,7 @@ void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
ACTION_NextBandwidth(gTxVfo->CHANNEL_BANDWIDTH, gTxVfo->Modulation != MODULATION_AM);
break;
case ACTION_OPT_SPECTRUM:
APP_RunSpectrum(IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE));
ACTION_RunSpectrum();
break;
#ifdef ENABLE_BLMIN_TMP_OFF
case ACTION_OPT_BLMIN_TMP_OFF:
Expand Down
1 change: 1 addition & 0 deletions app/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
void ACTION_Power(void);
void ACTION_Monitor(void);
void ACTION_Scan(bool bRestart);
void ACTION_RunSpectrum(void);
#ifdef ENABLE_VOX
void ACTION_Vox(void);
#endif
Expand Down
8 changes: 1 addition & 7 deletions app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,7 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
gRequestSaveVFO = true;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
#elif defined(ENABLE_SPECTRUM)
#ifdef ENABLE_SPECTRUM_CHANNEL_SCAN
// if we are in channel mode then enter spectrum in channel mode
// otherwise enter spectrum in frequency mode
APP_RunSpectrum(IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE));
#elif
APP_RunSpectrum();
#endif
ACTION_RunSpectrum();
gRequestDisplayScreen = DISPLAY_MAIN;
#endif
}
Expand Down
8 changes: 5 additions & 3 deletions app/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ void MSG_FSKSendData() {
uint16_t deviation = 850;
switch (gEeprom.VfoInfo[gEeprom.TX_VFO].CHANNEL_BANDWIDTH)
{
case BK4819_FILTER_BW_WIDE: deviation = 1050; break;
case BK4819_FILTER_BW_NARROW: deviation = 850; break;
case BK4819_FILTER_BW_NARROWER: deviation = 750; break;
case BK4819_FILTER_BW_WIDE: deviation = 1350; 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
}
//BK4819_WriteRegister(0x40, (3u << 12) | (deviation & 0xfff));
BK4819_WriteRegister(BK4819_REG_40, (dev_val & 0xf000) | (deviation & 0xfff));
Expand Down
Loading

0 comments on commit 8333de6

Please sign in to comment.