mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 22:31:25 +03:00
Band edges updated
This commit is contained in:
parent
bfe2a116e2
commit
69b108e430
@ -62,7 +62,7 @@ ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)savin
|
|||||||
ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though front-end/PA not designed for full range)
|
ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though front-end/PA not designed for full range)
|
||||||
ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM
|
ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM
|
||||||
ENABLE_F_CAL_MENU := 0 enable/disable the radios hidden frequency calibration menu
|
ENABLE_F_CAL_MENU := 0 enable/disable the radios hidden frequency calibration menu
|
||||||
ENABLE_TX_UNLOCK := 0 allow TX everywhere EXCEPT airband (108~136) .. TX harmonic content will cause interference to other services, do so entirely at your own risk !
|
ENABLE_TX_UNLOCK := 0 allow TX everywhere EXCEPT airband (108~137) .. TX harmonic content will cause interference to other services, do so entirely at your own risk !
|
||||||
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 0 standard CTCSS tail phase shift rather than QS's own 55Hz tone method
|
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 0 standard CTCSS tail phase shift rather than QS's own 55Hz tone method
|
||||||
ENABLE_CONTRAST := 0 add contrast menu
|
ENABLE_CONTRAST := 0 add contrast menu
|
||||||
ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume knob position at boot-up
|
ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume knob position at boot-up
|
||||||
|
2
app/fm.c
2
app/fm.c
@ -49,7 +49,7 @@ uint16_t g_fm_restore_count_down_10ms;
|
|||||||
|
|
||||||
bool FM_CheckValidChannel(uint8_t Channel)
|
bool FM_CheckValidChannel(uint8_t Channel)
|
||||||
{
|
{
|
||||||
return (Channel < ARRAY_SIZE(g_fm_channels) && (g_fm_channels[Channel] >= 760 && g_fm_channels[Channel] < 1080)) ? true : false;
|
return (Channel < ARRAY_SIZE(g_fm_channels) && (g_fm_channels[Channel] >= FM_RADIO_BAND.lower && g_fm_channels[Channel] < FM_RADIO_BAND.upper)) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t FM_FindNextChannel(uint8_t Channel, uint8_t Direction)
|
uint8_t FM_FindNextChannel(uint8_t Channel, uint8_t Direction)
|
||||||
|
@ -2089,14 +2089,14 @@ void BK4819_PlayRogerMDC1200(void)
|
|||||||
// <15:8> 0x55 FSK Sync Byte 0 (Sync Byte 0 first, then 1,2,3)
|
// <15:8> 0x55 FSK Sync Byte 0 (Sync Byte 0 first, then 1,2,3)
|
||||||
// <7:0> 0x55 FSK Sync Byte 1
|
// <7:0> 0x55 FSK Sync Byte 1
|
||||||
//
|
//
|
||||||
BK4819_WriteRegister(BK4819_REG_5A, 0xffff); // bytes 1 & 2
|
BK4819_WriteRegister(BK4819_REG_5A, 0x0000); // bytes 1 & 2
|
||||||
|
|
||||||
// REG_5B
|
// REG_5B
|
||||||
//
|
//
|
||||||
// <15:8> 0x55 FSK Sync Byte 2 (Sync Byte 0 first, then 1,2,3)
|
// <15:8> 0x55 FSK Sync Byte 2 (Sync Byte 0 first, then 1,2,3)
|
||||||
// <7:0> 0xAA FSK Sync Byte 3
|
// <7:0> 0xAA FSK Sync Byte 3
|
||||||
//
|
//
|
||||||
BK4819_WriteRegister(BK4819_REG_5B, 0xffff); // bytes 2 & 3 (not used)
|
BK4819_WriteRegister(BK4819_REG_5B, 0x0000); // bytes 2 & 3 (not used)
|
||||||
|
|
||||||
// CRC setting (plus other stuff we don't know what)
|
// CRC setting (plus other stuff we don't know what)
|
||||||
//
|
//
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -22,11 +22,13 @@
|
|||||||
// the default AIRCOPY frequency
|
// the default AIRCOPY frequency
|
||||||
uint32_t g_aircopy_freq = 41002500;
|
uint32_t g_aircopy_freq = 41002500;
|
||||||
|
|
||||||
|
const freq_band_table_t AIR_BAND = {10800000, 13700000};
|
||||||
|
|
||||||
// FM broadcast band lower/upper limit
|
// FM broadcast band lower/upper limit
|
||||||
#ifdef ENABLE_FMRADIO_64_108
|
#ifdef ENABLE_FMRADIO_64_108
|
||||||
const freq_band_table_t FM_RADIO_BAND = {680, 1080};
|
const freq_band_table_t FM_RADIO_BAND = {680, 1080};
|
||||||
#else
|
#else
|
||||||
const freq_band_table_t FM_RADIO_BAND = {880, 1080};
|
const freq_band_table_t FM_RADIO_BAND = {875, 1080};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// the BK4819 has 2 bands it covers, 18MHz ~ 630MHz and 760MHz ~ 1300MHz
|
// the BK4819 has 2 bands it covers, 18MHz ~ 630MHz and 760MHz ~ 1300MHz
|
||||||
@ -38,8 +40,8 @@ const freq_band_table_t FREQ_BAND_TABLE[7] =
|
|||||||
#ifdef ENABLE_WIDE_RX
|
#ifdef ENABLE_WIDE_RX
|
||||||
// extended range
|
// extended range
|
||||||
{ 1800000, 10800000}, // band 1
|
{ 1800000, 10800000}, // band 1
|
||||||
{10800000, 13600000}, // band 2
|
{AIR_BAND.lower, AIR_BAND.upper}, // band 2
|
||||||
{13600000, 17400000}, // band 3
|
{AIR_BAND.upper, 17400000}, // band 3
|
||||||
{17400000, 35000000}, // band 4
|
{17400000, 35000000}, // band 4
|
||||||
{35000000, 40000000}, // band 5
|
{35000000, 40000000}, // band 5
|
||||||
{40000000, 47000000}, // band 6
|
{40000000, 47000000}, // band 6
|
||||||
@ -47,8 +49,8 @@ const freq_band_table_t FREQ_BAND_TABLE[7] =
|
|||||||
#else
|
#else
|
||||||
// QS original
|
// QS original
|
||||||
{ 5000000, 7600000}, // band 1
|
{ 5000000, 7600000}, // band 1
|
||||||
{10800000, 13600000}, // band 2
|
{AIR_BAND.lower, AIR_BAND.upper}, // band 2
|
||||||
{13600000, 17400000}, // band 3
|
{AIR_BAND.upper, 17400000}, // band 3
|
||||||
{17400000, 35000000}, // band 4
|
{17400000, 35000000}, // band 4
|
||||||
{35000000, 40000000}, // band 5
|
{35000000, 40000000}, // band 5
|
||||||
{40000000, 47000000}, // band 6
|
{40000000, 47000000}, // band 6
|
||||||
@ -188,7 +190,7 @@ int FREQUENCY_tx_freq_check(const uint32_t Frequency)
|
|||||||
if (Frequency >= BX4819_BAND1.upper && Frequency < BX4819_BAND2.lower)
|
if (Frequency >= BX4819_BAND1.upper && Frequency < BX4819_BAND2.lower)
|
||||||
return -1; // BX radio chip does not work in this range
|
return -1; // BX radio chip does not work in this range
|
||||||
|
|
||||||
if (Frequency >= 10800000 && Frequency < 13600000)
|
if (Frequency >= AIR_BAND.lower && Frequency < AIR_BAND.upper)
|
||||||
return -1; // TX not allowed in the airband
|
return -1; // TX not allowed in the airband
|
||||||
|
|
||||||
if (Frequency < FREQ_BAND_TABLE[0].lower || Frequency > FREQ_BAND_TABLE[ARRAY_SIZE(FREQ_BAND_TABLE) - 1].upper)
|
if (Frequency < FREQ_BAND_TABLE[0].lower || Frequency > FREQ_BAND_TABLE[ARRAY_SIZE(FREQ_BAND_TABLE) - 1].upper)
|
||||||
@ -197,7 +199,7 @@ int FREQUENCY_tx_freq_check(const uint32_t Frequency)
|
|||||||
switch (g_setting_freq_lock)
|
switch (g_setting_freq_lock)
|
||||||
{
|
{
|
||||||
case FREQ_LOCK_NORMAL:
|
case FREQ_LOCK_NORMAL:
|
||||||
if (Frequency >= 13600000 && Frequency < 17400000)
|
if (Frequency >= AIR_BAND.upper && Frequency < 17400000)
|
||||||
return 0;
|
return 0;
|
||||||
if (Frequency >= 17400000 && Frequency < 35000000)
|
if (Frequency >= 17400000 && Frequency < 35000000)
|
||||||
if (g_setting_174_tx_enable)
|
if (g_setting_174_tx_enable)
|
||||||
@ -234,14 +236,14 @@ int FREQUENCY_tx_freq_check(const uint32_t Frequency)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FREQ_LOCK_430:
|
case FREQ_LOCK_430:
|
||||||
if (Frequency >= 13600000 && Frequency < 17400000)
|
if (Frequency >= AIR_BAND.lower && Frequency < 17400000)
|
||||||
return 0;
|
return 0;
|
||||||
if (Frequency >= 40000000 && Frequency < 43000000)
|
if (Frequency >= 40000000 && Frequency < 43000000)
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FREQ_LOCK_438:
|
case FREQ_LOCK_438:
|
||||||
if (Frequency >= 13600000 && Frequency < 17400000)
|
if (Frequency >= AIR_BAND.lower && Frequency < 17400000)
|
||||||
return 0;
|
return 0;
|
||||||
if (Frequency >= 40000000 && Frequency < 43800000)
|
if (Frequency >= 40000000 && Frequency < 43800000)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -26,7 +26,7 @@ enum frequency_band_e {
|
|||||||
BAND_NONE = -1,
|
BAND_NONE = -1,
|
||||||
BAND1_50MHz = 0,
|
BAND1_50MHz = 0,
|
||||||
BAND2_108MHz,
|
BAND2_108MHz,
|
||||||
BAND3_136MHz,
|
BAND3_137MHz,
|
||||||
BAND4_174MHz,
|
BAND4_174MHz,
|
||||||
BAND5_350MHz,
|
BAND5_350MHz,
|
||||||
BAND6_400MHz,
|
BAND6_400MHz,
|
||||||
@ -41,6 +41,8 @@ typedef struct {
|
|||||||
|
|
||||||
extern uint32_t g_aircopy_freq;
|
extern uint32_t g_aircopy_freq;
|
||||||
|
|
||||||
|
extern const freq_band_table_t AIR_BAND;
|
||||||
|
|
||||||
extern const freq_band_table_t FM_RADIO_BAND;
|
extern const freq_band_table_t FM_RADIO_BAND;
|
||||||
|
|
||||||
extern const freq_band_table_t BX4819_BAND1;
|
extern const freq_band_table_t BX4819_BAND1;
|
||||||
|
22
mdc1200.c
22
mdc1200.c
@ -5,13 +5,16 @@
|
|||||||
#include "mdc1200.h"
|
#include "mdc1200.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
// MDC1200 sync bit reversals and packet header
|
// MDC1200 sync bit reversals and packet magic
|
||||||
//
|
//
|
||||||
// 0000 0111 1011 0111 0010 0100 0000 1001 1001 1010
|
// 24-bit pre-amble
|
||||||
|
// 40-bit sync
|
||||||
//
|
//
|
||||||
//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, 0x00, 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, 0x00, 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};
|
//
|
||||||
|
//static const uint8_t header[] = {0x00, 0x00, 0x00, 0x0A, 0xAA, 0xAA, 0xA0, 0xb6, 0x8e, 0x03, 0xbb, 0x14};
|
||||||
|
static const uint8_t header[] = {0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x50, 0x29, 0x71, 0xfc, 0x44, 0xeb};
|
||||||
|
|
||||||
uint8_t bit_reverse_8(uint8_t n)
|
uint8_t bit_reverse_8(uint8_t n)
|
||||||
{
|
{
|
||||||
@ -188,10 +191,8 @@ void delta_modulation(uint8_t *data, const unsigned int size)
|
|||||||
for (bit_num = 7; bit_num >= 0; bit_num--)
|
for (bit_num = 7; bit_num >= 0; bit_num--)
|
||||||
{
|
{
|
||||||
const uint8_t b2 = (in >> bit_num) & 1u;
|
const uint8_t b2 = (in >> bit_num) & 1u;
|
||||||
// const uint8_t b2 = (in >> (7 - bit_num)) & 1u;
|
|
||||||
if (b1 != b2)
|
if (b1 != b2)
|
||||||
out |= 1u << bit_num; // previous bit and new bit are different
|
out |= 1u << bit_num; // previous bit and new bit are different
|
||||||
// out |= 1u << (7 - bit_num);
|
|
||||||
b1 = b2;
|
b1 = b2;
|
||||||
}
|
}
|
||||||
data[i] = out;
|
data[i] = out;
|
||||||
@ -218,6 +219,13 @@ unsigned int MDC1200_encode_single_packet(uint8_t *data, const uint8_t op, const
|
|||||||
|
|
||||||
p = encode_data(p);
|
p = encode_data(p);
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
{ // op 0x01, arg 0x80, id 0xB183
|
||||||
|
const uint8_t test_packet[] = {0x07, 0x25, 0xDD, 0xD5, 0x9F, 0xC5, 0x3D, 0x89, 0x2D, 0xBD, 0x57, 0x35, 0xE7, 0x44};
|
||||||
|
memcpy(data + sizeof(header), test_packet, sizeof(test_packet));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
size = (unsigned int)(p - data);
|
size = (unsigned int)(p - data);
|
||||||
|
|
||||||
delta_modulation(data, size);
|
delta_modulation(data, size);
|
||||||
|
4
radio.c
4
radio.c
@ -342,7 +342,7 @@ void RADIO_configure_channel(const unsigned int VFO, const unsigned int configur
|
|||||||
|
|
||||||
p_vfo->freq_config_rx.frequency = Frequency;
|
p_vfo->freq_config_rx.frequency = Frequency;
|
||||||
|
|
||||||
if (Frequency >= 10800000 && Frequency < 13600000)
|
if (Frequency >= AIR_BAND.lower && Frequency < AIR_BAND.upper)
|
||||||
{ // air band
|
{ // air band
|
||||||
p_vfo->tx_offset_freq_dir = TX_OFFSET_FREQ_DIR_OFF;
|
p_vfo->tx_offset_freq_dir = TX_OFFSET_FREQ_DIR_OFF;
|
||||||
p_vfo->tx_offset_freq = 0;
|
p_vfo->tx_offset_freq = 0;
|
||||||
@ -508,7 +508,7 @@ void RADIO_ConfigureSquelchAndOutputPower(vfo_info_t *p_vfo)
|
|||||||
//
|
//
|
||||||
// 1ED0 32 32 32 64 64 64 8C 8C 8C FF FF FF FF FF FF FF .. 50 MHz
|
// 1ED0 32 32 32 64 64 64 8C 8C 8C FF FF FF FF FF FF FF .. 50 MHz
|
||||||
// 1EE0 32 32 32 64 64 64 8C 8C 8C FF FF FF FF FF FF FF .. 108 MHz
|
// 1EE0 32 32 32 64 64 64 8C 8C 8C FF FF FF FF FF FF FF .. 108 MHz
|
||||||
// 1EF0 5F 5F 5F 69 69 69 91 91 8F FF FF FF FF FF FF FF .. 136 MHz
|
// 1EF0 5F 5F 5F 69 69 69 91 91 8F FF FF FF FF FF FF FF .. 137 MHz
|
||||||
// 1F00 32 32 32 64 64 64 8C 8C 8C FF FF FF FF FF FF FF .. 174 MHz
|
// 1F00 32 32 32 64 64 64 8C 8C 8C FF FF FF FF FF FF FF .. 174 MHz
|
||||||
// 1F10 5A 5A 5A 64 64 64 82 82 82 FF FF FF FF FF FF FF .. 350 MHz
|
// 1F10 5A 5A 5A 64 64 64 82 82 82 FF FF FF FF FF FF FF .. 350 MHz
|
||||||
// 1F20 5A 5A 5A 64 64 64 8F 91 8A FF FF FF FF FF FF FF .. 400 MHz
|
// 1F20 5A 5A 5A 64 64 64 8F 91 8A FF FF FF FF FF FF FF .. 400 MHz
|
||||||
|
@ -1088,7 +1088,7 @@ void UI_DisplayMenu(void)
|
|||||||
switch (g_sub_menu_selection)
|
switch (g_sub_menu_selection)
|
||||||
{
|
{
|
||||||
case FREQ_LOCK_NORMAL:
|
case FREQ_LOCK_NORMAL:
|
||||||
strcpy(String, "136~174\n400~470\n+ others");
|
strcpy(String, "137~174\n400~470\n+ others");
|
||||||
break;
|
break;
|
||||||
case FREQ_LOCK_FCC:
|
case FREQ_LOCK_FCC:
|
||||||
strcpy(String, "FCC HAM\n144~148\n420~450");
|
strcpy(String, "FCC HAM\n144~148\n420~450");
|
||||||
@ -1100,10 +1100,10 @@ void UI_DisplayMenu(void)
|
|||||||
strcpy(String, "GB HAM\n144~148\n430~440");
|
strcpy(String, "GB HAM\n144~148\n430~440");
|
||||||
break;
|
break;
|
||||||
case FREQ_LOCK_430:
|
case FREQ_LOCK_430:
|
||||||
strcpy(String, "136~174\n400~430");
|
strcpy(String, "137~174\n400~430");
|
||||||
break;
|
break;
|
||||||
case FREQ_LOCK_438:
|
case FREQ_LOCK_438:
|
||||||
strcpy(String, "136~174\n400~438");
|
strcpy(String, "137~174\n400~438");
|
||||||
break;
|
break;
|
||||||
case FREQ_LOCK_446:
|
case FREQ_LOCK_446:
|
||||||
strcpy(String, "446.00625\n~\n446.19375");
|
strcpy(String, "446.00625\n~\n446.19375");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user