diff --git a/Makefile b/Makefile index a5bf37e..aa089f4 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ ENABLE_REDUCE_LOW_MID_TX_POWER := 1 # Tx Alarm 0.6 kB ENABLE_ALARM := 0 ENABLE_TX1750 := 0 -ENABLE_MDC1200 := 0 +ENABLE_MDC1200 := 1 ENABLE_PWRON_PASSWORD := 0 ENABLE_RESET_AES_KEY := 1 ENABLE_BIG_FREQ := 0 diff --git a/README.md b/README.md index 2d40994..ba09444 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ around with experimental code. There is absolutely no guarantee that it will work in any way shape or form on your radio(s), it may even brick your radio(s), at which point, maybe find a quiet corner to sob your hert out in. +NO REFUNDS, ever ! + ## Radio performance Please note that the Quansheng UV-Kx radios are not professional quality transceivers, their diff --git a/app/app.c b/app/app.c index f01d644..e172646 100644 --- a/app/app.c +++ b/app/app.c @@ -2823,7 +2823,7 @@ Skip: RADIO_setup_registers(true); -// g_tx_vfo->frequency_channel = BOARD_find_channel(frequency); +// g_tx_vfo->freq_in_channel = BOARD_find_channel(frequency); g_dtmf_auto_reset_time_500ms = 0; g_dtmf_call_state = DTMF_CALL_STATE_NONE; diff --git a/app/main.c b/app/main.c index 70fa693..c4e7e5f 100644 --- a/app/main.c +++ b/app/main.c @@ -118,7 +118,7 @@ void toggle_chan_scanlist(void) RADIO_setup_registers(true); // find the first channel that contains this frequency - g_tx_vfo->frequency_channel = BOARD_find_channel(g_tx_vfo->freq_config_tx.frequency); + g_tx_vfo->freq_in_channel = BOARD_find_channel(g_tx_vfo->freq_config_tx.frequency); g_request_save_vfo = true; @@ -559,7 +559,7 @@ void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held) g_tx_vfo->freq_config_rx.frequency = Frequency; // find the first channel that contains this frequency - g_tx_vfo->frequency_channel = BOARD_find_channel(Frequency); + g_tx_vfo->freq_in_channel = BOARD_find_channel(Frequency); // 1of11 .. test to prevent monitor mode being turned off #if 0 @@ -837,7 +837,7 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio g_tx_vfo->freq_config_tx.frequency = g_tx_vfo->freq_config_rx.frequency; // find the first channel that contains this frequency - g_tx_vfo->frequency_channel = BOARD_find_channel(g_tx_vfo->freq_config_rx.frequency); + g_tx_vfo->freq_in_channel = BOARD_find_channel(g_tx_vfo->freq_config_rx.frequency); // only update eeprom when the key is released - saves a LOT of wear and tear on the little eeprom SETTINGS_save_channel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, 1); @@ -917,10 +917,10 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio // TODO: include this once we have the entire eeprom loaded // //if (!key_held && key_pressed) - // g_tx_vfo->frequency_channel = BOARD_find_channel(frequency); + // g_tx_vfo->freq_in_channel = BOARD_find_channel(frequency); //else //if (key_held && key_pressed) - g_tx_vfo->frequency_channel = 0xff; + g_tx_vfo->freq_in_channel = 0xff; if (new_band != old_band) { // original slow method diff --git a/driver/bk4819.c b/driver/bk4819.c index 850cc6a..9ba7a0d 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -2089,14 +2089,14 @@ void BK4819_PlayRogerMDC1200(void) // <15:8> 0x55 FSK Sync Byte 0 (Sync Byte 0 first, then 1,2,3) // <7:0> 0x55 FSK Sync Byte 1 // - BK4819_WriteRegister(BK4819_REG_5A, 0); // can be any bit pattern you like + BK4819_WriteRegister(BK4819_REG_5A, 0xffff); // bytes 1 & 2 // REG_5B // // <15:8> 0x55 FSK Sync Byte 2 (Sync Byte 0 first, then 1,2,3) // <7:0> 0xAA FSK Sync Byte 3 // - BK4819_WriteRegister(BK4819_REG_5B, 0); // bytes 2 & 3 not sent/used + BK4819_WriteRegister(BK4819_REG_5B, 0xffff); // bytes 2 & 3 (not used) // CRC setting (plus other stuff we don't know what) // diff --git a/firmware.bin b/firmware.bin index 861662d..63feea0 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 71de038..e2a6875 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/mdc1200.c b/mdc1200.c index c4cd551..e4e0f24 100644 --- a/mdc1200.c +++ b/mdc1200.c @@ -6,8 +6,12 @@ #include "misc.h" // MDC1200 sync bit reversals and packet header -static const uint8_t header[] = {0x00, 0x00, 0x00, 0x05, 0x55, 0x55, 0x55, 0x07, 0x09, 0x2a, 0x44, 0x6f}; -//static const uint8_t header[] = {0x00, 0x00, 0x00, 0x0A, 0xAA, 0xAA, 0xAA, 0x07, 0x09, 0x2a, 0x44, 0x6f}; +// +// 0000 0111 1011 0111 0010 0100 0000 1001 1001 1010 +// +//static const uint8_t header[] = {0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0x55, 0x07, 0x09, 0x2a, 0x44, 0x6f}; +//static const uint8_t header[] = {0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x07, 0x09, 0x2a, 0x44, 0x6f}; +static const uint8_t header[] = {0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x97, 0x1f, 0xc4, 0x4e}; uint8_t bit_reverse_8(uint8_t n) { diff --git a/radio.c b/radio.c index 0676655..8d8a1b9 100644 --- a/radio.c +++ b/radio.c @@ -137,7 +137,7 @@ void RADIO_InitInfo(vfo_info_t *p_vfo, const uint8_t ChannelSave, const uint32_t p_vfo->p_tx = &p_vfo->freq_config_tx; p_vfo->compand = 0; // off p_vfo->squelch_level = 0; // use main squelch - p_vfo->frequency_channel = 0xff; + p_vfo->freq_in_channel = 0xff; if (ChannelSave == (FREQ_CHANNEL_FIRST + BAND2_108MHz)) p_vfo->am_mode = 1; @@ -165,7 +165,7 @@ void RADIO_configure_channel(const unsigned int VFO, const unsigned int configur Channel = g_eeprom.screen_channel[VFO]; - p_vfo->frequency_channel = 0xff; + p_vfo->freq_in_channel = 0xff; if (IS_VALID_CHANNEL(Channel)) { @@ -383,7 +383,7 @@ void RADIO_configure_channel(const unsigned int VFO, const unsigned int configur RADIO_ConfigureSquelchAndOutputPower(p_vfo); if (IS_FREQ_CHANNEL(Channel)) - p_vfo->frequency_channel = BOARD_find_channel(Frequency); // remember if a channel has this frequency + p_vfo->freq_in_channel = BOARD_find_channel(Frequency); // remember if a channel has this frequency } void RADIO_ConfigureSquelchAndOutputPower(vfo_info_t *p_vfo) diff --git a/radio.h b/radio.h index 5e196ac..3bdbad9 100644 --- a/radio.h +++ b/radio.h @@ -115,7 +115,7 @@ typedef struct vfo_info_t uint8_t compand; - uint8_t frequency_channel; // channel number if the VFO's frequency is found stored in a channel + uint8_t freq_in_channel; // channel number if the VFO's frequency is found stored in a channel char name[16]; } vfo_info_t; diff --git a/ui/main.c b/ui/main.c index c5e8fec..0abbf53 100644 --- a/ui/main.c +++ b/ui/main.c @@ -760,10 +760,10 @@ void UI_DisplayMain(void) if (IS_FREQ_CHANNEL(g_eeprom.screen_channel[vfo_num])) { - //g_eeprom.vfo_info[vfo_num].frequency_channel = BOARD_find_channel(frequency); - if (g_eeprom.vfo_info[vfo_num].frequency_channel <= USER_CHANNEL_LAST) + //g_eeprom.vfo_info[vfo_num].freq_in_channel = BOARD_find_channel(frequency); + if (g_eeprom.vfo_info[vfo_num].freq_in_channel <= USER_CHANNEL_LAST) { // the channel number that contains this VFO frequency - sprintf(String, "%03u", g_eeprom.vfo_info[vfo_num].frequency_channel); + sprintf(String, "%03u", g_eeprom.vfo_info[vfo_num].freq_in_channel); UI_PrintStringSmallest(String, x, (line + 0) * 8, false, true); } }