0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 22:58:04 +03:00

Use memcpy() instead of memmove() when it's possible (two memmove call were kept).

Rename some variable named 'String' (to 'str') which is quite confusing.
This commit is contained in:
Daniel Caujolle-Bert
2023-10-24 11:40:35 +02:00
parent 024c4bb79d
commit 64f19b2d78
12 changed files with 317 additions and 317 deletions

View File

@ -49,7 +49,7 @@ void UI_DisplayStatus(const bool test_display)
// POWER-SAVE indicator
if (g_current_function == FUNCTION_TRANSMIT)
{
memmove(line + x, BITMAP_TX, sizeof(BITMAP_TX));
memcpy(line + x, BITMAP_TX, sizeof(BITMAP_TX));
x1 = x + sizeof(BITMAP_TX);
}
else
@ -57,13 +57,13 @@ void UI_DisplayStatus(const bool test_display)
g_current_function == FUNCTION_MONITOR ||
g_current_function == FUNCTION_NEW_RECEIVE)
{
memmove(line + x, BITMAP_RX, sizeof(BITMAP_RX));
memcpy(line + x, BITMAP_RX, sizeof(BITMAP_RX));
x1 = x + sizeof(BITMAP_RX);
}
else
if (g_current_function == FUNCTION_POWER_SAVE || test_display)
{
memmove(line + x, BITMAP_POWERSAVE, sizeof(BITMAP_POWERSAVE));
memcpy(line + x, BITMAP_POWERSAVE, sizeof(BITMAP_POWERSAVE));
x1 = x + sizeof(BITMAP_POWERSAVE);
}
x += sizeof(BITMAP_POWERSAVE);
@ -72,7 +72,7 @@ void UI_DisplayStatus(const bool test_display)
// NOASS SCAN indicator
if (g_is_noaa_mode || test_display)
{
memmove(line + x, BITMAP_NOAA, sizeof(BITMAP_NOAA));
memcpy(line + x, BITMAP_NOAA, sizeof(BITMAP_NOAA));
x1 = x + sizeof(BITMAP_NOAA);
}
x += sizeof(BITMAP_NOAA);
@ -93,7 +93,7 @@ void UI_DisplayStatus(const bool test_display)
// FM indicator
if (g_fm_radio_mode || test_display)
{
memmove(line + x, BITMAP_FM, sizeof(BITMAP_FM));
memcpy(line + x, BITMAP_FM, sizeof(BITMAP_FM));
x1 = x + sizeof(BITMAP_FM);
}
else
@ -125,7 +125,7 @@ void UI_DisplayStatus(const bool test_display)
// VOICE indicator
if (g_eeprom.voice_prompt != VOICE_PROMPT_OFF || test_display)
{
memmove(line + x, BITMAP_VOICE_PROMPT, sizeof(BITMAP_VOICE_PROMPT));
memcpy(line + x, BITMAP_VOICE_PROMPT, sizeof(BITMAP_VOICE_PROMPT));
x1 = x + sizeof(BITMAP_VOICE_PROMPT);
}
x += sizeof(BITMAP_VOICE_PROMPT);
@ -143,11 +143,11 @@ void UI_DisplayStatus(const bool test_display)
(g_current_function != FUNCTION_FOREGROUND && g_current_function != FUNCTION_POWER_SAVE) ||
g_screen_to_display == DISPLAY_SEARCH)
{
memmove(line + x, BITMAP_TDR_HOLDING, sizeof(BITMAP_TDR_HOLDING));
memcpy(line + x, BITMAP_TDR_HOLDING, sizeof(BITMAP_TDR_HOLDING));
}
else
{
memmove(line + x, BITMAP_TDR_RUNNING, sizeof(BITMAP_TDR_RUNNING));
memcpy(line + x, BITMAP_TDR_RUNNING, sizeof(BITMAP_TDR_RUNNING));
}
x1 = x + sizeof(BITMAP_TDR_RUNNING);
}
@ -155,7 +155,7 @@ void UI_DisplayStatus(const bool test_display)
if (g_current_function == FUNCTION_MONITOR)
{
memmove(line + x, BITMAP_MONITOR, sizeof(BITMAP_MONITOR));
memcpy(line + x, BITMAP_MONITOR, sizeof(BITMAP_MONITOR));
x1 = x + sizeof(BITMAP_MONITOR);
}
x += sizeof(BITMAP_MONITOR);
@ -163,7 +163,7 @@ void UI_DisplayStatus(const bool test_display)
// CROSS-VFO indicator
if (g_eeprom.cross_vfo_rx_tx != CROSS_BAND_OFF || test_display)
{
memmove(line + x, BITMAP_XB, sizeof(BITMAP_XB));
memcpy(line + x, BITMAP_XB, sizeof(BITMAP_XB));
x1 = x + sizeof(BITMAP_XB);
}
x += sizeof(BITMAP_XB);
@ -172,7 +172,7 @@ void UI_DisplayStatus(const bool test_display)
// VOX indicator
if (g_eeprom.vox_switch || test_display)
{
memmove(line + x, BITMAP_VOX, sizeof(BITMAP_VOX));
memcpy(line + x, BITMAP_VOX, sizeof(BITMAP_VOX));
x1 = x + sizeof(BITMAP_VOX);
}
x += sizeof(BITMAP_VOX);
@ -182,7 +182,7 @@ void UI_DisplayStatus(const bool test_display)
// KEY-LOCK indicator
if (g_eeprom.key_lock || test_display)
{
memmove(line + x, BITMAP_KEYLOCK, sizeof(BITMAP_KEYLOCK));
memcpy(line + x, BITMAP_KEYLOCK, sizeof(BITMAP_KEYLOCK));
x += sizeof(BITMAP_KEYLOCK);
x1 = x;
}
@ -190,7 +190,7 @@ void UI_DisplayStatus(const bool test_display)
#endif
if (g_fkey_pressed)
{
memmove(line + x, BITMAP_F_KEY, sizeof(BITMAP_F_KEY));
memcpy(line + x, BITMAP_F_KEY, sizeof(BITMAP_F_KEY));
x += sizeof(BITMAP_F_KEY);
x1 = x;
}
@ -236,7 +236,7 @@ void UI_DisplayStatus(const bool test_display)
// USB-C charge indicator
if (g_charging_with_type_c || test_display)
memmove(line + x, BITMAP_USB_C, sizeof(BITMAP_USB_C));
memcpy(line + x, BITMAP_USB_C, sizeof(BITMAP_USB_C));
x += sizeof(BITMAP_USB_C);
// BATTERY LEVEL indicator