From 0110f89cdb04f4525be27518ad3ce611711df7ac Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Fri, 28 Jun 2024 13:58:59 +0200 Subject: [PATCH] Scanlist refactoring --- bitmaps.c | 22 +++++++++++++++++----- bitmaps.h | 10 +++++----- ui/main.c | 8 ++++---- ui/status.c | 4 ++-- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/bitmaps.c b/bitmaps.c index 3baabd7..f75be17 100644 --- a/bitmaps.c +++ b/bitmaps.c @@ -159,60 +159,72 @@ const uint8_t BITMAP_VFO_NotDefault[8] = 0b00001000 }; -const uint8_t BITMAP_ScanList0[5] = +const uint8_t BITMAP_ScanList0[7] = { // '0' symbol + 0b01111111, 0b01111111, 0b01000011, 0b01011101, 0b01100001, 0b01111111, + 0b01111111 }; -const uint8_t BITMAP_ScanList1[5] = +const uint8_t BITMAP_ScanList1[7] = { // '1' symbol + 0b01111111, 0b01111111, 0b01111011, 0b01000001, 0b01111111, 0b01111111, + 0b01111111 }; -const uint8_t BITMAP_ScanList2[5] = +const uint8_t BITMAP_ScanList2[7] = { // '2' symbol + 0b01111111, 0b01111111, 0b01001101, 0b01010101, 0b01011011, 0b01111111, + 0b01111111 }; -const uint8_t BITMAP_ScanList3[5] = +const uint8_t BITMAP_ScanList3[7] = { // '3' symbol + 0b01111111, 0b01111111, 0b01011101, 0b01010101, 0b01101011, 0b01111111, + 0b01111111 }; -const uint8_t BITMAP_ScanListAll[15] = +const uint8_t BITMAP_ScanListAll[19] = { // 'All' symbol 0b01111111, + 0b01111111, 0b01000011, 0b01110101, 0b01000011, 0b01111111, 0b01111111, + 0b01111111, 0b01000001, 0b01011111, 0b01011111, 0b01111111, 0b01111111, + 0b01111111, 0b01000001, 0b01011111, 0b01011111, 0b01111111, + 0b01111111 }; const uint8_t BITMAP_compand[6] = diff --git a/bitmaps.h b/bitmaps.h index d2a03fa..69a4989 100644 --- a/bitmaps.h +++ b/bitmaps.h @@ -30,11 +30,11 @@ extern const uint8_t BITMAP_Ready[7]; extern const uint8_t BITMAP_Antenna[5]; extern const uint8_t BITMAP_VFO_Default[8]; extern const uint8_t BITMAP_VFO_NotDefault[8]; -extern const uint8_t BITMAP_ScanList0[5]; -extern const uint8_t BITMAP_ScanList1[5]; -extern const uint8_t BITMAP_ScanList2[5]; -extern const uint8_t BITMAP_ScanList3[5]; -extern const uint8_t BITMAP_ScanListAll[15]; +extern const uint8_t BITMAP_ScanList0[7]; +extern const uint8_t BITMAP_ScanList1[7]; +extern const uint8_t BITMAP_ScanList2[7]; +extern const uint8_t BITMAP_ScanList3[7]; +extern const uint8_t BITMAP_ScanListAll[19]; extern const uint8_t BITMAP_compand[6]; #ifndef ENABLE_CUSTOM_MENU_LAYOUT diff --git a/ui/main.c b/ui/main.c index 74272c6..7482773 100644 --- a/ui/main.c +++ b/ui/main.c @@ -909,22 +909,22 @@ void UI_DisplayMain(void) if (att.scanlist1) { - memcpy(p_line0 + 128 - (shiftList * 5), BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); + memcpy(p_line0 + 127 - (shiftList * 6), BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); shiftList--; } if (att.scanlist2) { - memcpy(p_line0 + 128 - (shiftList * 5), BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); + memcpy(p_line0 + 127 - (shiftList * 6), BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); shiftList--; } if (att.scanlist3) { - memcpy(p_line0 + 128 - (shiftList * 5), BITMAP_ScanList3, sizeof(BITMAP_ScanList3)); + memcpy(p_line0 + 127 - (shiftList * 6), BITMAP_ScanList3, sizeof(BITMAP_ScanList3)); } if(countList == 0) { - memcpy(p_line0 + 128 - (1 * 5), BITMAP_ScanList0, sizeof(BITMAP_ScanList0)); + memcpy(p_line0 + 127 - (1 * 6), BITMAP_ScanList0, sizeof(BITMAP_ScanList0)); } /* diff --git a/ui/status.c b/ui/status.c index c928363..030bd4c 100644 --- a/ui/status.c +++ b/ui/status.c @@ -111,8 +111,8 @@ void UI_DisplayStatus() break; case 4: memcpy(line + 0, BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); - memcpy(line + 5, BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); - memcpy(line + 10, BITMAP_ScanList3, sizeof(BITMAP_ScanList3)); + memcpy(line + 6, BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); + memcpy(line + 12, BITMAP_ScanList3, sizeof(BITMAP_ScanList3)); break; case 5: memcpy(line + 0, BITMAP_ScanListAll, sizeof(BITMAP_ScanListAll));