Skip to content

Commit

Permalink
SPLIT MESSENGER NOTIFICATION
Browse files Browse the repository at this point in the history
  • Loading branch information
spm81 committed Jan 10, 2024
1 parent 8111b16 commit fc038ce
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 46 deletions.
88 changes: 46 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,73 @@

TARGET = firmware

#======== STOCK QUANSHENG FERATURES ========#
ENABLE_AIRCOPY := 0
#============== STOCK QUANSHENG FERATURES ==============#
ENABLE_AIRCOPY := 0
# 3856 bytes
ENABLE_FMRADIO := 0
ENABLE_FMRADIO := 0
# 84 bytes
ENABLE_FLASHLIGHT_SOS := 0
ENABLE_UART := 1
ENABLE_UART_CAT := 0
ENABLE_FLASHLIGHT_SOS := 0
ENABLE_UART := 1
ENABLE_UART_CAT := 0
# 4108 bytes
ENABLE_DTMF_CALLING := 0
ENABLE_DTMF_CALLING := 0
# 1750Hz & 1050Hz FN1 FN2 Tones
ENABLE_DTMF_SIDETONES := 1
ENABLE_TX1750 := 0
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 := 0
ENABLE_ROGERBEEP := 1
ENABLE_MDC := 0

#============== MODIFICATIONS =============#
#==================== 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 := 1
ENABLE_AM_FIX_ON_SPECTRUM := 1
ENABLE_SQUELCH_MORE_SENSITIVE := 1
# Restore FM in 1 second after RX - 0 bytes
ENABLE_FMRADIO_FAST_RESTORE := 1
ENABLE_FMRADIO_FAST_RESTORE := 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 := 0
ENABLE_BATTERY_CHARGING := 0
# Invert LCD Colors
ENABLE_LCD_INVERT_OPTION := 0
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_NOSCANTIMEOUT := 1
ENABLE_KEEPNAMEONSAVE := 1
ENABLE_FASTER_CHANNEL_SCAN := 1
ENABLE_MIC_PLUS_GAIN_BAR_TX := 1
ENABLE_NOSCANTIMEOUT := 1
ENABLE_KEEPNAMEONSAVE := 1
ENABLE_FASTER_CHANNEL_SCAN := 1
# CW Modulation
ENABLE_CW := 1
ENABLE_CW := 1

#============ EXTRA: MESSENGER ============#
ENABLE_MESSENGER := 1
ENABLE_MESSENGER_DELIVERY_NOTIFICATION := 1
ENABLE_MESSENGER_MORE_ONE_LINE := 1
#================== EXTRA: MESSENGER ==================#
ENABLE_MESSENGER := 1
ENABLE_MESSENGER_DELIVERY_ACK_NOTIFICATION := 1
ENABLE_MESSENGER_DELIVERY_SOUND_NOTIFICATION := 0
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 := 0
ENABLE_MESSENGER_SHOW_RX_TX_FREQ := 0
# 156 bytes
ENABLE_MESSENGER_UART := 1
ENABLE_MESSENGER_UART := 1

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

#Thanks to KD8CEC for sharing his code / We have to check the code better, i just code & paste it to the right places...
ENABLE_LIVESEEK_MHZ_KEYPAD := 0
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 @@ -348,8 +349,11 @@ endif
ifeq ($(ENABLE_MESSENGER),1)
CFLAGS += -DENABLE_MESSENGER
endif
ifeq ($(ENABLE_MESSENGER_DELIVERY_NOTIFICATION),1)
CFLAGS += -DENABLE_MESSENGER_DELIVERY_NOTIFICATION
ifeq ($(ENABLE_MESSENGER_DELIVERY_ACK_NOTIFICATION),1)
CFLAGS += -DENABLE_MESSENGER_DELIVERY_ACK_NOTIFICATION
endif
ifeq ($(ENABLE_MESSENGER_DELIVERY_SOUND_NOTIFICATION),1)
CFLAGS += -DENABLE_MESSENGER_DELIVERY_SOUND_NOTIFICATION
endif
ifeq ($(ENABLE_MESSENGER_MORE_ONE_LINE),1)
CFLAGS += -DENABLE_MESSENGER_MORE_ONE_LINE
Expand Down
10 changes: 8 additions & 2 deletions app/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,13 @@ void MSG_StorePacket(const uint16_t interrupt_bits)
#ifdef ENABLE_MESSENGER_UART
UART_printf("SMS<%s\r\n", &msgFSKBuffer[2]);
#endif

#ifdef ENABLE_MESSENGER_DELIVERY_SOUND_NOTIFICATION
BK4819_DisableDTMF();
RADIO_SetTxParameters();
SYSTEM_DelayMs(500);
BK4819_ExitTxMute();
BK4819_PlayRoger(99);
#endif

}

Expand All @@ -719,7 +725,7 @@ void MSG_StorePacket(const uint16_t interrupt_bits)
// Transmit a message to the sender that we have received the message (Unless it's a service message)
if (msgFSKBuffer[0] == 'M' && msgFSKBuffer[1] == 'S' && msgFSKBuffer[2] != 0x1b)
{
#ifdef ENABLE_MESSENGER_DELIVERY_NOTIFICATION
#ifdef ENABLE_MESSENGER_DELIVERY_ACK_NOTIFICATION
MSG_Send("\x1b\x1b\x1bRCVD ", true);
#endif
if (rx_finished && gAppToDisplay != APP_MESSENGER)
Expand Down
4 changes: 2 additions & 2 deletions driver/bk4819.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ void BK4819_PlayBeep(const uint16_t freq, const int delay)
BK4819_EnterTxMute();
}

#if defined(ENABLE_ROGERBEEP) || defined(ENABLE_MESSENGER_DELIVERY_NOTIFICATION)
#if defined(ENABLE_ROGERBEEP) || defined(ENABLE_MESSENGER_DELIVERY_SOUND_NOTIFICATION)
void BK4819_PlayRoger(int t)
{
BK4819_EnterTxMute();
Expand Down Expand Up @@ -1022,7 +1022,7 @@ void BK4819_PlayRoger(int t)

#endif

#ifdef ENABLE_MESSENGER_DELIVERY_NOTIFICATION
#ifdef ENABLE_MESSENGER_DELIVERY_SOUND_NOTIFICATION
case 99: // NOKIA SMS Tone2
BK4819_PlayBeep(800, 200); // Frequency and duration can be adjusted
BK4819_PlayBeep(600, 200);
Expand Down

0 comments on commit fc038ce

Please sign in to comment.