diff --git a/Makefile b/Makefile index ae70746..cb717c7 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/app/messenger.c b/app/messenger.c index a7318df..ade2d55 100644 --- a/app/messenger.c +++ b/app/messenger.c @@ -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 } @@ -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) diff --git a/driver/bk4819.c b/driver/bk4819.c index e381d8d..c227dda 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -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(); @@ -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);