From 8b8b258e39c7d31dcb2202f7e162f3c2d3fb20df Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Thu, 25 Jul 2024 06:22:50 +0200 Subject: [PATCH] Save 60 bytes --- ui/main.c | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/ui/main.c b/ui/main.c index cba423d..8e68aa7 100644 --- a/ui/main.c +++ b/ui/main.c @@ -900,34 +900,31 @@ void UI_DisplayMain(void) // show the scan list assigment symbols const ChannelAttributes_t att = gMR_ChannelAttributes[gEeprom.ScreenChannel[vfo_num]]; - if (att.scanlist1) - countList++; - if (att.scanlist2) - countList++; - if (att.scanlist3) - countList++; - - shiftList = countList; - - if (att.scanlist1) - { - memcpy(p_line0 + 127 - (shiftList * 6), BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); - shiftList--; - } - if (att.scanlist2) - { - memcpy(p_line0 + 127 - (shiftList * 6), BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); - shiftList--; - } - if (att.scanlist3) - { - memcpy(p_line0 + 127 - (shiftList * 6), BITMAP_ScanList3, sizeof(BITMAP_ScanList3)); - } + countList = att.scanlist1 + att.scanlist2 + att.scanlist3; if(countList == 0) { memcpy(p_line0 + 127 - (1 * 6), BITMAP_ScanList0, sizeof(BITMAP_ScanList0)); } + else + { + shiftList = countList; + + if (att.scanlist1) + { + memcpy(p_line0 + 127 - (shiftList * 6), BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); + shiftList--; + } + if (att.scanlist2) + { + memcpy(p_line0 + 127 - (shiftList * 6), BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); + shiftList--; + } + if (att.scanlist3) + { + memcpy(p_line0 + 127 - (shiftList * 6), BITMAP_ScanList3, sizeof(BITMAP_ScanList3)); + } + } } else {