mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
fix crc in makefile
This commit is contained in:
parent
f494b8565b
commit
7f07588b22
4
Makefile
4
Makefile
@ -147,9 +147,7 @@ ifeq ($(ENABLE_FMRADIO), 1)
|
|||||||
OBJS += driver/bk1080.o
|
OBJS += driver/bk1080.o
|
||||||
endif
|
endif
|
||||||
OBJS += driver/bk4819.o
|
OBJS += driver/bk4819.o
|
||||||
ifeq ($(filter $(ENABLE_AIRCOPY) $(ENABLE_UART) $(ENABLE_MDC1200), 1), 1)
|
OBJS += driver/crc.o
|
||||||
OBJS += driver/crc.o
|
|
||||||
endif
|
|
||||||
OBJS += driver/eeprom.o
|
OBJS += driver/eeprom.o
|
||||||
ifeq ($(ENABLE_OVERLAY),1)
|
ifeq ($(ENABLE_OVERLAY),1)
|
||||||
OBJS += driver/flash.o
|
OBJS += driver/flash.o
|
||||||
|
@ -65,7 +65,7 @@ static void ACTION_FlashLight(void)
|
|||||||
|
|
||||||
case FLASHLIGHT_SOS:
|
case FLASHLIGHT_SOS:
|
||||||
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE
|
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE
|
||||||
BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT);
|
BK4819_stop_tones(g_current_function == FUNCTION_TRANSMIT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Fallthrough
|
// Fallthrough
|
||||||
@ -104,7 +104,7 @@ void ACTION_Monitor(void)
|
|||||||
g_beep_to_play = BEEP_NONE;
|
g_beep_to_play = BEEP_NONE;
|
||||||
|
|
||||||
if (!g_squelch_open && GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
if (!g_squelch_open && GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
||||||
BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT);
|
BK4819_stop_tones(g_current_function == FUNCTION_TRANSMIT);
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
// if (g_rx_vfo->channel_save >= NOAA_CHANNEL_FIRST && g_noaa_mode)
|
// if (g_rx_vfo->channel_save >= NOAA_CHANNEL_FIRST && g_noaa_mode)
|
||||||
|
@ -1562,7 +1562,7 @@ void APP_process_flash_light_10ms(void)
|
|||||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||||
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE
|
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE
|
||||||
if (!g_squelch_open && !g_monitor_enabled && !GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
if (!g_squelch_open && !g_monitor_enabled && !GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
||||||
BK4819_StartTone1(880, 50, g_current_function == FUNCTION_TRANSMIT, true);
|
BK4819_start_tone(880, 70, g_current_function == FUNCTION_TRANSMIT, false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1573,7 +1573,7 @@ void APP_process_flash_light_10ms(void)
|
|||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // OFF
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // OFF
|
||||||
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE
|
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE
|
||||||
if (!g_squelch_open && !g_monitor_enabled && GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
if (!g_squelch_open && !g_monitor_enabled && GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
||||||
BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT);
|
BK4819_stop_tones(g_current_function == FUNCTION_TRANSMIT);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
app/menu.c
10
app/menu.c
@ -764,16 +764,6 @@ void MENU_AcceptSetting(void)
|
|||||||
|
|
||||||
case MENU_ROGER_MODE:
|
case MENU_ROGER_MODE:
|
||||||
g_eeprom.config.setting.roger_mode = g_sub_menu_selection;
|
g_eeprom.config.setting.roger_mode = g_sub_menu_selection;
|
||||||
if (g_eeprom.config.setting.roger_mode != ROGER_MODE_OFF)
|
|
||||||
{
|
|
||||||
if (g_tx_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_TX_DOWN ||
|
|
||||||
g_tx_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_BOTH ||
|
|
||||||
g_tx_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
|
|
||||||
{
|
|
||||||
g_tx_vfo->channel.dtmf_ptt_id_tx_mode = PTT_ID_OFF; // // disable PTT ID tail
|
|
||||||
g_request_save_channel = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_MOD_MODE:
|
case MENU_MOD_MODE:
|
||||||
|
2
audio.c
2
audio.c
@ -173,7 +173,7 @@ void AUDIO_PlayBeep(beep_type_t Beep)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
BK4819_StartTone1(ToneFrequency, 10, false, false);
|
BK4819_start_tone(ToneFrequency, 10, false, true);
|
||||||
|
|
||||||
SYSTEM_DelayMs(2);
|
SYSTEM_DelayMs(2);
|
||||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||||
|
@ -814,9 +814,9 @@ void BK4819_EnableDTMF(void)
|
|||||||
(15u << BK4819_REG_24_SHIFT_MAX_SYMBOLS)); // 0 ~ 15
|
(15u << BK4819_REG_24_SHIFT_MAX_SYMBOLS)); // 0 ~ 15
|
||||||
}
|
}
|
||||||
|
|
||||||
void BK4819_StartTone1(const uint16_t frequency, const unsigned int level, const bool tx, const bool tx_unmute)
|
void BK4819_start_tone(const uint16_t frequency, const unsigned int level, const bool tx, const bool tx_mute)
|
||||||
{
|
{
|
||||||
// (void)tx_unmute;
|
SYSTEM_DelayMs(1);
|
||||||
|
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||||
|
|
||||||
@ -868,14 +868,18 @@ void BK4819_StartTone1(const uint16_t frequency, const unsigned int level, const
|
|||||||
BK4819_SetAF(BK4819_AF_TONE); // RX
|
BK4819_SetAF(BK4819_AF_TONE); // RX
|
||||||
// BK4819_SetAF(BK4819_AF_BEEP); // TX
|
// BK4819_SetAF(BK4819_AF_BEEP); // TX
|
||||||
|
|
||||||
if (tx_unmute)
|
if (!tx_mute)
|
||||||
BK4819_write_reg(0x50, 0x3B20); // 0011 1011 0010 0000
|
BK4819_write_reg(0x50, 0x3B20); // 0011 1011 0010 0000
|
||||||
|
|
||||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||||
|
|
||||||
|
SYSTEM_DelayMs(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BK4819_StopTones(const bool tx)
|
void BK4819_stop_tones(const bool tx)
|
||||||
{
|
{
|
||||||
|
SYSTEM_DelayMs(1);
|
||||||
|
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||||
|
|
||||||
SYSTEM_DelayMs(1);
|
SYSTEM_DelayMs(1);
|
||||||
@ -923,34 +927,37 @@ void BK4819_StopTones(const bool tx)
|
|||||||
SYSTEM_DelayMs(1);
|
SYSTEM_DelayMs(1);
|
||||||
|
|
||||||
BK4819_ExitTxMute();
|
BK4819_ExitTxMute();
|
||||||
|
|
||||||
|
SYSTEM_DelayMs(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BK4819_PlayTone(const unsigned int tone_Hz, const unsigned int delay, const unsigned int level)
|
void BK4819_PlayRoger(const unsigned int type)
|
||||||
{
|
{
|
||||||
const uint16_t prev_af = BK4819_read_reg(0x47);
|
uint32_t tone1_Hz;
|
||||||
BK4819_StartTone1(tone_Hz, level, g_current_function == FUNCTION_TRANSMIT, true);
|
uint32_t tone2_Hz;
|
||||||
SYSTEM_DelayMs(delay - 2);
|
|
||||||
BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT);
|
|
||||||
BK4819_write_reg(0x47, prev_af);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BK4819_PlayRoger(void)
|
switch (type)
|
||||||
{
|
{
|
||||||
#if 0
|
case 1:
|
||||||
const uint32_t tone1_Hz = 500;
|
tone1_Hz = 1540;
|
||||||
const uint32_t tone2_Hz = 700;
|
tone2_Hz = 1310;
|
||||||
#else
|
break;
|
||||||
// motorola
|
case 2:
|
||||||
const uint32_t tone1_Hz = 1540;
|
tone1_Hz = 500;
|
||||||
const uint32_t tone2_Hz = 1310;
|
tone2_Hz = 700;
|
||||||
#endif
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const uint16_t prev_af = BK4819_read_reg(0x47);
|
const uint16_t prev_af = BK4819_read_reg(0x47);
|
||||||
BK4819_StartTone1(tone1_Hz, 96, true, true);
|
|
||||||
SYSTEM_DelayMs(80 - 2);
|
BK4819_start_tone(tone1_Hz, 10, true, false);
|
||||||
BK4819_StartTone1(tone2_Hz, 96, true, true);
|
SYSTEM_DelayMs(150);
|
||||||
SYSTEM_DelayMs(80);
|
BK4819_write_reg(0x71, scale_freq(tone2_Hz));
|
||||||
BK4819_StopTones(true);
|
SYSTEM_DelayMs(150);
|
||||||
|
BK4819_stop_tones(true);
|
||||||
|
|
||||||
BK4819_write_reg(0x47, prev_af);
|
BK4819_write_reg(0x47, prev_af);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,15 +104,20 @@ bool BK4819_CompanderEnabled(void);
|
|||||||
void BK4819_SetCompander(const unsigned int mode);
|
void BK4819_SetCompander(const unsigned int mode);
|
||||||
|
|
||||||
void BK4819_DisableVox(void);
|
void BK4819_DisableVox(void);
|
||||||
|
|
||||||
void BK4819_DisableDTMF(void);
|
void BK4819_DisableDTMF(void);
|
||||||
void BK4819_EnableDTMF(void);
|
void BK4819_EnableDTMF(void);
|
||||||
void BK4819_StartTone1(const uint16_t frequency, const unsigned int level, const bool tx, const bool tx_unmute);
|
|
||||||
void BK4819_StopTones(const bool tx);
|
void BK4819_start_tone(const uint16_t frequency, const unsigned int level, const bool tx, const bool tx_mute);
|
||||||
void BK4819_PlayTone(const unsigned int tone_Hz, const unsigned int delay, const unsigned int level);
|
void BK4819_stop_tones(const bool tx);
|
||||||
|
|
||||||
void BK4819_EnterTxMute(void);
|
void BK4819_EnterTxMute(void);
|
||||||
void BK4819_ExitTxMute(void);
|
void BK4819_ExitTxMute(void);
|
||||||
|
|
||||||
void BK4819_set_mic_gain(unsigned int level);
|
void BK4819_set_mic_gain(unsigned int level);
|
||||||
|
|
||||||
void BK4819_Sleep(void);
|
void BK4819_Sleep(void);
|
||||||
|
|
||||||
void BK4819_TurnsOffTones_TurnsOnRX(void);
|
void BK4819_TurnsOffTones_TurnsOnRX(void);
|
||||||
|
|
||||||
#ifdef ENABLE_AIRCOPY
|
#ifdef ENABLE_AIRCOPY
|
||||||
@ -161,7 +166,7 @@ uint8_t BK4819_get_CDCSS_code_type(void);
|
|||||||
uint8_t BK4819_GetCTCShift(void);
|
uint8_t BK4819_GetCTCShift(void);
|
||||||
uint8_t BK4819_GetCTCType(void);
|
uint8_t BK4819_GetCTCType(void);
|
||||||
|
|
||||||
void BK4819_PlayRoger(void);
|
void BK4819_PlayRoger(const unsigned int type);
|
||||||
|
|
||||||
#ifdef ENABLE_MDC1200
|
#ifdef ENABLE_MDC1200
|
||||||
void BK4819_enable_mdc1200_rx(const bool enable);
|
void BK4819_enable_mdc1200_rx(const bool enable);
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
14
functions.c
14
functions.c
@ -220,7 +220,7 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||||
|
|
||||||
SYSTEM_DelayMs(2);
|
SYSTEM_DelayMs(2);
|
||||||
BK4819_StartTone1(500, 28, g_current_function == FUNCTION_TRANSMIT, true);
|
BK4819_start_tone(500, 28, g_current_function == FUNCTION_TRANSMIT, false);
|
||||||
SYSTEM_DelayMs(2);
|
SYSTEM_DelayMs(2);
|
||||||
|
|
||||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||||
@ -267,25 +267,27 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
if (g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOT || g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOTH)
|
if (g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOT || g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOTH)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
||||||
// BK4819_StartTone1(880, 10, true, false);
|
// BK4819_start_tone(880, 10, true, true);
|
||||||
// SYSTEM_DelayMs(120);
|
// SYSTEM_DelayMs(120);
|
||||||
// BK4819_StopTones(true);
|
// BK4819_stop_tones(true);
|
||||||
#endif
|
#endif
|
||||||
SYSTEM_DelayMs(30);
|
SYSTEM_DelayMs(30);
|
||||||
|
|
||||||
BK4819_send_MDC1200(MDC1200_OP_CODE_PTT_ID, 0x80, g_eeprom.config.setting.mdc1200_id, true);
|
BK4819_send_MDC1200(MDC1200_OP_CODE_PTT_ID, 0x80, g_eeprom.config.setting.mdc1200_id, true);
|
||||||
|
|
||||||
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
||||||
BK4819_StartTone1(880, 10, true, false);
|
BK4819_start_tone(880, 10, true, true);
|
||||||
SYSTEM_DelayMs(120);
|
SYSTEM_DelayMs(120);
|
||||||
BK4819_StopTones(true);
|
BK4819_stop_tones(true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
|
if (g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
|
||||||
{
|
{
|
||||||
BK4819_PlayTone(APOLLO_TONE1_HZ, APOLLO_TONE_MS, 0);
|
BK4819_start_tone(APOLLO_TONE1_HZ, 28, true, false);
|
||||||
|
SYSTEM_DelayMs(APOLLO_TONE_MS);
|
||||||
|
BK4819_stop_tones(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
19
radio.c
19
radio.c
@ -1203,28 +1203,29 @@ void RADIO_tx_eot(void)
|
|||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (g_eeprom.config.setting.roger_mode == ROGER_MODE_ROGER)
|
|
||||||
{
|
|
||||||
BK4819_PlayRoger();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#ifdef ENABLE_MDC1200
|
#ifdef ENABLE_MDC1200
|
||||||
// if (g_eeprom.config.setting.roger_mode == ROGER_MODE_MDC)
|
|
||||||
if (g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_EOT || g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOTH)
|
if (g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_EOT || g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOTH)
|
||||||
{
|
{
|
||||||
BK4819_send_MDC1200(MDC1200_OP_CODE_POST_ID, 0x00, g_eeprom.config.setting.mdc1200_id, false);
|
BK4819_send_MDC1200(MDC1200_OP_CODE_POST_ID, 0x00, g_eeprom.config.setting.mdc1200_id, false);
|
||||||
|
|
||||||
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
||||||
BK4819_StartTone1(880, 10, true, false);
|
BK4819_start_tone(880, 10, true, true);
|
||||||
SYSTEM_DelayMs(120);
|
SYSTEM_DelayMs(120);
|
||||||
BK4819_StopTones(true);
|
BK4819_stop_tones(true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
|
if (g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
|
||||||
{
|
{
|
||||||
BK4819_PlayTone(APOLLO_TONE2_HZ, APOLLO_TONE_MS, 28);
|
BK4819_start_tone(APOLLO_TONE2_HZ, 28, true, false);
|
||||||
|
SYSTEM_DelayMs(APOLLO_TONE_MS);
|
||||||
|
BK4819_stop_tones(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (g_eeprom.config.setting.roger_mode != ROGER_MODE_OFF)
|
||||||
|
{
|
||||||
|
BK4819_PlayRoger(g_eeprom.config.setting.roger_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
BK4819_ExitDTMF_TX(true);
|
BK4819_ExitDTMF_TX(true);
|
||||||
|
@ -109,8 +109,8 @@ typedef enum alarm_mode_e alarm_mode_t;
|
|||||||
|
|
||||||
enum roger_mode_e {
|
enum roger_mode_e {
|
||||||
ROGER_MODE_OFF = 0,
|
ROGER_MODE_OFF = 0,
|
||||||
ROGER_MODE_ROGER,
|
ROGER_MODE_ROGER1,
|
||||||
ROGER_MODE_MDC
|
ROGER_MODE_ROGER2
|
||||||
};
|
};
|
||||||
typedef enum roger_mode_e roger_mode_t;
|
typedef enum roger_mode_e roger_mode_t;
|
||||||
|
|
||||||
|
@ -311,11 +311,11 @@ const char g_sub_menu_pwr_on_msg[4][14] =
|
|||||||
"NONE"
|
"NONE"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char g_sub_menu_roger_mode[2][16] =
|
const char g_sub_menu_roger_mode[3][15] =
|
||||||
{
|
{
|
||||||
"OFF",
|
"OFF",
|
||||||
"TX END\nROGER",
|
"TX END\nROGER 1",
|
||||||
// "TX END\nMDC1200"
|
"TX END\nROGER 2"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char g_sub_menu_reset[2][4] =
|
const char g_sub_menu_reset[2][4] =
|
||||||
|
@ -185,7 +185,7 @@ extern const char g_sub_menu_ptt_id[5][16];
|
|||||||
extern const char g_sub_menu_mdc1200_mode[4][8];
|
extern const char g_sub_menu_mdc1200_mode[4][8];
|
||||||
#endif
|
#endif
|
||||||
extern const char g_sub_menu_pwr_on_msg[4][14];
|
extern const char g_sub_menu_pwr_on_msg[4][14];
|
||||||
extern const char g_sub_menu_roger_mode[2][16];
|
extern const char g_sub_menu_roger_mode[3][15];
|
||||||
extern const char g_sub_menu_reset[2][4];
|
extern const char g_sub_menu_reset[2][4];
|
||||||
extern const char g_sub_menu_backlight[8][7];
|
extern const char g_sub_menu_backlight[8][7];
|
||||||
extern const char g_sub_menu_rx_tx[4][6];
|
extern const char g_sub_menu_rx_tx[4][6];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user