Scanlist refactoring
This commit is contained in:
16
ui/main.c
16
ui/main.c
@@ -909,22 +909,22 @@ void UI_DisplayMain(void)
|
||||
|
||||
if (att.scanlist1)
|
||||
{
|
||||
memcpy(p_line0 + 128 - (shiftList * 7), BITMAP_ScanList1, sizeof(BITMAP_ScanList1));
|
||||
memcpy(p_line0 + 128 - (shiftList * 5), BITMAP_ScanList1, sizeof(BITMAP_ScanList1));
|
||||
shiftList--;
|
||||
}
|
||||
if (att.scanlist2)
|
||||
{
|
||||
memcpy(p_line0 + 128 - (shiftList * 7), BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
|
||||
memcpy(p_line0 + 128 - (shiftList * 5), BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
|
||||
shiftList--;
|
||||
}
|
||||
if (att.scanlist3)
|
||||
{
|
||||
memcpy(p_line0 + 128 - (shiftList * 7), BITMAP_ScanList3, sizeof(BITMAP_ScanList3));
|
||||
memcpy(p_line0 + 128 - (shiftList * 5), BITMAP_ScanList3, sizeof(BITMAP_ScanList3));
|
||||
}
|
||||
|
||||
if(countList == 0)
|
||||
{
|
||||
memcpy(p_line0 + 128 - (1 * 7), BITMAP_ScanList4, sizeof(BITMAP_ScanList4));
|
||||
memcpy(p_line0 + 128 - (1 * 5), BITMAP_ScanList0, sizeof(BITMAP_ScanList0));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -978,14 +978,6 @@ void UI_DisplayMain(void)
|
||||
{ // no channel name, show the channel number instead
|
||||
sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Too many list, so remove last character name
|
||||
if(String[9] != 0 && countList == 3)
|
||||
{
|
||||
String[9] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gEeprom.CHANNEL_DISPLAY_MODE == MDF_NAME) {
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
|
@@ -811,10 +811,10 @@ void UI_DisplayMenu(void)
|
||||
break;
|
||||
|
||||
case MENU_S_LIST:
|
||||
if (gSubMenuSelection < 3)
|
||||
sprintf(String, "LIST [%u]", 1 + gSubMenuSelection);
|
||||
else if (gSubMenuSelection == 3)
|
||||
if (gSubMenuSelection == 0)
|
||||
strcpy(String, "LIST [0]\nNO LIST");
|
||||
else if (gSubMenuSelection < 4)
|
||||
sprintf(String, "LIST [%u]", gSubMenuSelection);
|
||||
else if (gSubMenuSelection == 4)
|
||||
strcpy(String, "LISTS\n[1, 2, 3]");
|
||||
else if (gSubMenuSelection == 5)
|
||||
|
22
ui/status.c
22
ui/status.c
@@ -50,7 +50,9 @@ static void convertTime(uint8_t *line, uint8_t type)
|
||||
m = t / 60;
|
||||
s = t - (m * 60);
|
||||
|
||||
gStatusLine[14] = 0x00; // Quick fix on display (on scanning I, II, etc.)
|
||||
gStatusLine[0] = 0x00; // Quick fix on display (on scanning I, II, etc.)
|
||||
gStatusLine[7] = 0x00; // Quick fix on display (on scanning I, II, etc.)
|
||||
gStatusLine[14] = 0x00; // Quick fix on display (on scanning I, II, etc.)
|
||||
|
||||
sprintf(str, "%02d:%02d", m, s);
|
||||
UI_PrintStringSmallBufferNormal(str, line + 0);
|
||||
@@ -95,23 +97,25 @@ void UI_DisplayStatus()
|
||||
if (gScanStateDir != SCAN_OFF || SCANNER_IsScanning()) {
|
||||
if (IS_MR_CHANNEL(gNextMrChannel) && !SCANNER_IsScanning()) { // channel mode
|
||||
switch(gEeprom.SCAN_LIST_DEFAULT) {
|
||||
case 0:
|
||||
memcpy(line + x + 2, BITMAP_ScanList1, sizeof(BITMAP_ScanList1));
|
||||
case 0:
|
||||
memcpy(line + 0, BITMAP_ScanList0, sizeof(BITMAP_ScanList0));
|
||||
break;
|
||||
case 1:
|
||||
memcpy(line + x + 2, BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
|
||||
case 1:
|
||||
memcpy(line + 0, BITMAP_ScanList1, sizeof(BITMAP_ScanList1));
|
||||
break;
|
||||
case 2:
|
||||
memcpy(line + x + 2, BITMAP_ScanList3, sizeof(BITMAP_ScanList3));
|
||||
memcpy(line + 0, BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
|
||||
break;
|
||||
case 3:
|
||||
memcpy(line + x + 2, BITMAP_ScanList4, sizeof(BITMAP_ScanList4));
|
||||
memcpy(line + 0, BITMAP_ScanList3, sizeof(BITMAP_ScanList3));
|
||||
break;
|
||||
case 4:
|
||||
memcpy(line + x + 0, BITMAP_ScanList5, sizeof(BITMAP_ScanList5));
|
||||
memcpy(line + 0, BITMAP_ScanList1, sizeof(BITMAP_ScanList1));
|
||||
memcpy(line + 5, BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
|
||||
memcpy(line + 10, BITMAP_ScanList3, sizeof(BITMAP_ScanList3));
|
||||
break;
|
||||
case 5:
|
||||
memcpy(line + x + 1, BITMAP_ScanList6, sizeof(BITMAP_ScanList6));
|
||||
memcpy(line + 0, BITMAP_ScanListAll, sizeof(BITMAP_ScanListAll));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user