mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 22:31:25 +03:00
Fix F+* and F+4 search bug - wiping out radios sram :(
This commit is contained in:
parent
8c8c183490
commit
4397931cfb
@ -217,7 +217,7 @@ static void SEARCH_Key_MENU(bool key_pressed, bool key_held)
|
|||||||
|
|
||||||
case SEARCH_EDIT_STATE_SAVE_CHAN:
|
case SEARCH_EDIT_STATE_SAVE_CHAN:
|
||||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
UART_SendText("edit save chan\r\n");
|
// UART_SendText("edit save chan\r\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g_input_box_index > 0)
|
if (g_input_box_index > 0)
|
||||||
@ -235,7 +235,7 @@ static void SEARCH_Key_MENU(bool key_pressed, bool key_held)
|
|||||||
|
|
||||||
case SEARCH_EDIT_STATE_SAVE_CONFIRM:
|
case SEARCH_EDIT_STATE_SAVE_CONFIRM:
|
||||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
UART_SendText("edit save confirm\r\n");
|
// UART_SendText("edit save confirm\r\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!g_search_single_frequency)
|
if (!g_search_single_frequency)
|
||||||
@ -428,9 +428,9 @@ void SEARCH_Start(void)
|
|||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
// this is why it needs such a strong signal
|
// this is why it needs such a strong signal
|
||||||
BK4819_set_rf_filter_path(0xFFFFFFFF); // disable the LNA filter paths
|
BK4819_set_rf_filter_path(0xFFFFFFFF); // disable the LNA filter paths - why it needs a strong signal
|
||||||
#else
|
#else
|
||||||
BK4819_set_rf_filter_path(g_rx_vfo->p_rx->frequency); // lets have a play ;)
|
BK4819_set_rf_filter_path(g_rx_vfo->p_rx->frequency); // lets have a play !
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BK4819_EnableFrequencyScan();
|
BK4819_EnableFrequencyScan();
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -16,7 +16,7 @@
|
|||||||
// >= 24-bit pre-amble
|
// >= 24-bit pre-amble
|
||||||
// 40-bit sync
|
// 40-bit sync
|
||||||
//
|
//
|
||||||
//static const uint8_t pre_amble[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0xCC};
|
//static const uint8_t pre_amble[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0xCC}; / add some bit reversals just before the sync pattern
|
||||||
static const uint8_t pre_amble[] = {0x00, 0x00, 0x00, 0x00, 0x00};
|
static const uint8_t pre_amble[] = {0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
static const uint8_t sync[] = {0x07, 0x09, 0x2a, 0x44, 0x6f};
|
static const uint8_t sync[] = {0x07, 0x09, 0x2a, 0x44, 0x6f};
|
||||||
|
|
||||||
|
30
ui/helper.c
30
ui/helper.c
@ -70,22 +70,26 @@ void UI_GenerateChannelStringEx(char *pString, const char *prefix, const uint8_t
|
|||||||
sprintf(pString + strlen(prefix), "%03u", ChannelNumber + 1);
|
sprintf(pString + strlen(prefix), "%03u", ChannelNumber + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width)
|
void UI_PrintString(const char *str, unsigned int start, const unsigned int end, const unsigned int line, const unsigned int width)
|
||||||
{
|
{
|
||||||
|
const size_t length = strlen(str);
|
||||||
size_t i;
|
size_t i;
|
||||||
size_t Length = strlen(pString);
|
|
||||||
|
|
||||||
if (End > Start)
|
if (end > start)
|
||||||
Start += ((End - Start) - (Length * Width) - 1) / 2;
|
{
|
||||||
|
const int ofs = ((int)(end - start) - (length * width) - 1) / 2;
|
||||||
|
if (ofs > 0 && (start + ofs) <= end)
|
||||||
|
start += ofs;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < Length; i++)
|
for (i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
if (pString[i] >= ' ' && pString[i] < 127)
|
if (str[i] >= ' ' && str[i] < 127)
|
||||||
{
|
{
|
||||||
const unsigned int index = pString[i] - ' ';
|
const unsigned int index = str[i] - ' ';
|
||||||
const unsigned int ofs = (unsigned int)Start + (i * Width);
|
const unsigned int ofs = start + (i * width);
|
||||||
memcpy(g_frame_buffer[Line + 0] + ofs, &g_font_big[index][0], 8);
|
memcpy(g_frame_buffer[line + 0] + ofs, &g_font_big[index][0], 8);
|
||||||
memcpy(g_frame_buffer[Line + 1] + ofs, &g_font_big[index][8], 7);
|
memcpy(g_frame_buffer[line + 1] + ofs, &g_font_big[index][8], 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +109,11 @@ void UI_print_string(
|
|||||||
uint8_t *f_buf;
|
uint8_t *f_buf;
|
||||||
|
|
||||||
if (end > start)
|
if (end > start)
|
||||||
start += ((end - start) - (length * char_pitch)) / 2;
|
{
|
||||||
|
const int ofs = ((int)(end - start) - (length * char_pitch) - 1) / 2;
|
||||||
|
if (ofs > 0 && (start + ofs) <= end)
|
||||||
|
start += ofs;
|
||||||
|
}
|
||||||
|
|
||||||
f_buf = g_frame_buffer[line] + start;
|
f_buf = g_frame_buffer[line] + start;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
void UI_GenerateChannelString(char *pString, const uint8_t Channel, const char separating_char);
|
void UI_GenerateChannelString(char *pString, const uint8_t Channel, const char separating_char);
|
||||||
void UI_GenerateChannelStringEx(char *pString, const char *prefix, const uint8_t ChannelNumber);
|
void UI_GenerateChannelStringEx(char *pString, const char *prefix, const uint8_t ChannelNumber);
|
||||||
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width);
|
void UI_PrintString(const char *str, unsigned int start, const unsigned int end, const unsigned int line, const unsigned int width);
|
||||||
void UI_PrintStringSmall(const char *str, const unsigned int start, const unsigned int end, const unsigned int line);
|
void UI_PrintStringSmall(const char *str, const unsigned int start, const unsigned int end, const unsigned int line);
|
||||||
#ifdef ENABLE_SMALL_BOLD
|
#ifdef ENABLE_SMALL_BOLD
|
||||||
void UI_PrintStringSmallBold(const char *str, const unsigned int start, const unsigned int end, const unsigned int line);
|
void UI_PrintStringSmallBold(const char *str, const unsigned int start, const unsigned int end, const unsigned int line);
|
||||||
|
22
ui/main.c
22
ui/main.c
@ -749,28 +749,6 @@ void UI_DisplayMain(void)
|
|||||||
{ // frequency mode
|
{ // frequency mode
|
||||||
#ifdef ENABLE_BIG_FREQ
|
#ifdef ENABLE_BIG_FREQ
|
||||||
big_freq(frequency, x, line);
|
big_freq(frequency, x, line);
|
||||||
/*
|
|
||||||
NUMBER_ToDigits(frequency, str); // 8 digits
|
|
||||||
|
|
||||||
// show the main large frequency digits
|
|
||||||
UI_DisplayFrequency(str, x, line, false, false);
|
|
||||||
|
|
||||||
// show the remaining 2 small frequency digits
|
|
||||||
#ifdef ENABLE_TRIM_TRAILING_ZEROS
|
|
||||||
{
|
|
||||||
unsigned int small_num = 2;
|
|
||||||
if (str[7] == 0)
|
|
||||||
{
|
|
||||||
small_num--;
|
|
||||||
if (str[6] == 0)
|
|
||||||
small_num--;
|
|
||||||
}
|
|
||||||
UI_Displaysmall_digits(small_num, str + 6, x + 81, line + 1, true);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
UI_Displaysmall_digits(2, str + 6, x + 81, line + 1, true);
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
#else
|
#else
|
||||||
// show the frequency in the main font
|
// show the frequency in the main font
|
||||||
|
|
||||||
|
@ -99,7 +99,11 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
// SCAN indicator
|
// SCAN indicator
|
||||||
if (g_scan_state_dir != SCAN_STATE_DIR_OFF || g_screen_to_display == DISPLAY_SEARCH || test_display)
|
if (g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
||||||
|
g_screen_to_display == DISPLAY_SEARCH ||
|
||||||
|
test_display)
|
||||||
|
{
|
||||||
|
if (g_search_css_state == SEARCH_CSS_STATE_OFF) // don't display this if in search mode
|
||||||
{
|
{
|
||||||
if (g_scan_next_channel <= USER_CHANNEL_LAST)
|
if (g_scan_next_channel <= USER_CHANNEL_LAST)
|
||||||
{ // channel mode
|
{ // channel mode
|
||||||
@ -119,6 +123,7 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
x1 = x + 7;
|
x1 = x + 7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
x += 7; // font character width
|
x += 7; // font character width
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user