Skip to content

Commit

Permalink
ENABLE_VOLTAGE_PERCENTAGE_WELCOME_MESSAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
spm81 committed Feb 24, 2024
1 parent 50a6948 commit 3c477c3
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 38 deletions.
79 changes: 42 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,82 +14,84 @@ ENABLE_FLASHLIGHT_SOS := 1
ENABLE_UART := 1
ENABLE_UART_CAT := 0
# Bause we can cut more... - 4108 bytes
ENABLE_DTMF_CALLING := 1
ENABLE_DTMF_CALLING := 0
# 1750Hz & 1050Hz FN1 FN2 Tones
ENABLE_DTMF_SIDETONES := 1
ENABLE_TX1750 := 0
# Keep this in stock options, and add option in mods for extra rogers
ENABLE_ROGERBEEP := 1
ENABLE_MDC := 1
ENABLE_MDC := 0

#============== MODIFICATIONS =============#
# AM Modulation Fix - 544 bytes
ENABLE_AM_FIX := 1
ENABLE_AM_FIX := 1
# Apply fix to Spectrum - 40 bytes
ENABLE_AM_FIX_ON_SPECTRUM := 1
ENABLE_SQUELCH_MORE_SENSITIVE := 0
ENABLE_AM_FIX_ON_SPECTRUM := 1
ENABLE_SQUELCH_MORE_SENSITIVE := 0
# Restore FM in 1 second after RX - 0 bytes
ENABLE_FMRADIO_FAST_RESTORE := 1
ENABLE_FMRADIO_FAST_RESTORE := 1
# Scan List Editor
ENABLE_SCANLIST := 0
ENABLE_SCANLIST := 0

# Battery percentage at the Welcome Message - 12 bytes
ENABLE_VOLTAGE_PERCENTAGE_WELCOME_MESSAGE := 1
# Battery percentage - 296 bytes
ENABLE_STATUS_BATTERY_PERC := 1
ENABLE_STATUS_BATTERY_PERC := 1
# Show current while charging - 136 bytes Thanks Tunas1337
ENABLE_BATTERY_CHARGING := 1
ENABLE_BATTERY_CHARGING := 1
# Invert LCD Colors
ENABLE_LCD_INVERT_OPTION := 0
#ENABLE_LCD_CONTRAST_OPTION := 0 # WIP
ENABLE_LCD_INVERT_OPTION := 0
#ENABLE_LCD_CONTRAST_OPTION := 0 # WIP
# Mic Gain Bar while TXing - 255 bytes
ENABLE_MIC_PLUS_GAIN_BAR_TX := 1
ENABLE_MIC_PLUS_GAIN_BAR_TX := 1
# Enable Vox 1920ms(max) delay - 0 bytes
ENABLE_VOX_MAX_DELAY := 1
ENABLE_NOSCANTIMEOUT := 1
ENABLE_KEEPNAMEONSAVE := 1
ENABLE_FASTER_CHANNEL_SCAN := 1
ENABLE_VOX_MAX_DELAY := 1
ENABLE_NOSCANTIMEOUT := 1
ENABLE_KEEPNAMEONSAVE := 1
ENABLE_FASTER_CHANNEL_SCAN := 1
# Enable Timeout beep at the end of timeout - 44 bytes
ENABLE_TIMEOUT_ROGERBEEP_NOTIFICATION := 1
ENABLE_TIMEOUT_ROGERBEEP_NOTIFICATION := 1
# CW Modulation
ENABLE_CW := 0
ENABLE_CW := 0

#============ EXTRA: MESSENGER ============#
ENABLE_MESSENGER := 0
ENABLE_MESSENGER_MORE_ONE_LINE := 1
#=============== EXTRA: MESSENGER ===============#
ENABLE_MESSENGER := 1
ENABLE_MESSENGER_MORE_ONE_LINE := 1
# 124 bytes
ENABLE_MESSENGER_SHOW_RX_FREQ := 1
ENABLE_MESSENGER_SHOW_RX_FREQ := 1
# 124 (+20) bytes
ENABLE_MESSENGER_SHOW_RX_TX_FREQ := 1
ENABLE_MESSENGER_SHOW_RX_TX_FREQ := 1
# 156 bytes
ENABLE_MESSENGER_UART := 0
ENABLE_MESSENGER_UART := 1
# 3408 bytes
ENABLE_MESSENGER_ENCRYPTION := 0
ENABLE_MESSENGER_ENCRYPTION := 1
# 140 bytes
ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION := 0
ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION := 1

# ---- EXTRA: SPECTRUM ----
ENABLE_SPECTRUM := 1
ENABLE_SPECTRUM_NUNU := 0
SPECTRUM_AUTOMATIC_SQUELCH := 1
SPECTRUM_EXTRA_VALUES := 1
# -------------- EXTRA: SPECTRUM --------------
ENABLE_SPECTRUM := 1
ENABLE_SPECTRUM_NUNU := 0
SPECTRUM_AUTOMATIC_SQUELCH := 1
SPECTRUM_EXTRA_VALUES := 1
# 3568 bytes
ENABLE_ALL_REGISTERS := 0
ENABLE_ALL_REGISTERS := 0
# 0 bytes
ENABLE_MATOZ_KEYS := 1
ENABLE_MATOZ_KEYS := 1

# https://github.com/nicsure/QuanshengDock
# ---- EXTRA: DOCK ----
# 2204 bytes
ENABLE_DOCK := 0
ENABLE_DOCK := 0

#Thanks to KD8CEC for sharing his code / We have to check the code better, i just code & paste it to the right places...
# 1476 bytes
ENABLE_LIVESEEK_MHZ_KEYPAD := 1
ENABLE_LIVESEEK_MHZ_KEYPAD := 0


# ---- DEBUGGING ----
# ---- COMPILER/LINKER OPTIONS ----
ENABLE_OVERLAY := 0
ENABLE_SWD := 0
ENABLE_OVERLAY := 0
ENABLE_SWD := 0



Expand Down Expand Up @@ -352,6 +354,9 @@ endif
ifeq ($(ENABLE_TX1750),1)
CFLAGS += -DENABLE_TX1750
endif
ifeq ($(ENABLE_VOLTAGE_PERCENTAGE_WELCOME_MESSAGE),1)
CFLAGS += -DENABLE_VOLTAGE_PERCENTAGE_WELCOME_MESSAGE
endif
ifeq ($(ENABLE_STATUS_BATTERY_PERC),1)
CFLAGS += -DENABLE_STATUS_BATTERY_PERC
endif
Expand Down
89 changes: 89 additions & 0 deletions app/nunucommon.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#include "app/chFrScanner.h"
#include "audio.h"
#include "functions.h"
#include "misc.h"
#include "settings.h"
#include "ui/ui.h"

void COMMON_KeypadLockToggle()
{

if (gScreenToDisplay != DISPLAY_MENU &&
gCurrentFunction != FUNCTION_TRANSMIT)
{ // toggle the keyboad lock

#ifdef ENABLE_VOICE
gAnotherVoiceID = gEeprom.KEY_LOCK ? VOICE_ID_UNLOCK : VOICE_ID_LOCK;
#endif

gEeprom.KEY_LOCK = !gEeprom.KEY_LOCK;

gRequestSaveSettings = true;
}
}

void COMMON_SwitchVFOs()
{
#ifdef ENABLE_SCAN_RANGES
gScanRangeStart = 0;
#endif
gEeprom.TX_CHANNEL ^= 1;

if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF)
gEeprom.CROSS_BAND_RX_TX = gEeprom.TX_CHANNEL + 1;
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
gEeprom.DUAL_WATCH = gEeprom.TX_CHANNEL + 1;

gRequestSaveSettings = 1;
gFlagReconfigureVfos = true;
gScheduleDualWatch = true;

gRequestDisplayScreen = DISPLAY_MAIN;
}

void COMMON_SwitchToVFOMode()
{
gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] = gEeprom.FreqChannel[gEeprom.TX_CHANNEL];
#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE;
#endif
gRequestSaveVFO = true;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
return;
}
void COMMON_SwitchToChannelMode()
{
uint8_t Channel = RADIO_FindNextChannel(gEeprom.MrChannel[gEeprom.TX_CHANNEL], 1, false, 0);
if (Channel != 0xFF)
{ // swap to channel mode
gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] = Channel;
#ifdef ENABLE_VOICE
AUDIO_SetVoiceID(0, VOICE_ID_CHANNEL_MODE);
AUDIO_SetDigitVoice(1, Channel + 1);
gAnotherVoiceID = (VOICE_ID_t)0xFE;
#endif
gRequestSaveVFO = true;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
return;
}
}

void COMMON_SwitchVFOMode()
{
#ifdef ENABLE_NOAA
if (gEeprom.VFO_OPEN && !IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
#else
if (gEeprom.VFO_OPEN)
#endif
{
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE))
{ // swap to frequency mode
COMMON_SwitchToVFOMode();
}
else
{
//swap to channel mode
COMMON_SwitchToChannelMode();
}
}
}
15 changes: 15 additions & 0 deletions app/nunucommon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

#ifndef APP_COMMON_H
#define APP_COMMON_H

#include "functions.h"
#include "settings.h"
#include "ui/ui.h"

void COMMON_KeypadLockToggle();
void COMMON_SwitchVFOs();
void COMMON_SwitchVFOMode();
void COMMON_SwitchToVFOMode();
void COMMON_SwitchToChannelMode();

#endif
7 changes: 6 additions & 1 deletion ui/welcome.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ void UI_DisplayWelcome(void) {
memset(WelcomeString1, 0, sizeof(WelcomeString1));
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_VOLTAGE) {
sprintf(WelcomeString0, "VOLTAGE");
sprintf(WelcomeString1, "%d.%02dV", gBatteryVoltageAverage / 100,
#ifdef ENABLE_VOLTAGE_PERCENTAGE_WELCOME_MESSAGE
sprintf(WelcomeString1, "%d.%02dV %d%%", gBatteryVoltageAverage / 100,
gBatteryVoltageAverage % 100, BATTERY_VoltsToPercent(gBatteryVoltageAverage));
#else
sprintf(WelcomeString1, "%d.%02dV", gBatteryVoltageAverage / 100,
gBatteryVoltageAverage % 100);
#endif
} else {
EEPROM_ReadBuffer(0x0EB0, WelcomeString0, 16);
EEPROM_ReadBuffer(0x0EC0, WelcomeString1, 16);
Expand Down

0 comments on commit 3c477c3

Please sign in to comment.