Skip to content

Commit

Permalink
fix scanlist ordering for chirp driver compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
prokrypt committed Jul 10, 2024
1 parent 4e0f603 commit 4c261c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void toggle_chan_scanlist(uint8_t num)
gTxVfo->SCANLIST_PARTICIPATION = (gTxVfo->SCANLIST_PARTICIPATION++ < 7) ? gTxVfo->SCANLIST_PARTICIPATION : 0;
} else {
num-=1;
gTxVfo->SCANLIST_PARTICIPATION ^= (1 << (2-num));
gTxVfo->SCANLIST_PARTICIPATION ^= (1 << (num));
/*
switch(num){
case 1:
Expand Down
8 changes: 4 additions & 4 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ void MENU_AcceptSetting(void)
break;

case MENU_S_ADD1:
gTxVfo->SCANLIST_PARTICIPATION = (gTxVfo->SCANLIST_PARTICIPATION & ~(1 << 2)) | (gSubMenuSelection << 2);
gTxVfo->SCANLIST_PARTICIPATION = (gTxVfo->SCANLIST_PARTICIPATION & ~(1 << 0)) | (gSubMenuSelection << 0);
SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, false, true);
gVfoConfigureMode = VFO_CONFIGURE;
gFlagResetVfos = true;
Expand All @@ -639,7 +639,7 @@ void MENU_AcceptSetting(void)
return;

case MENU_S_ADD3:
gTxVfo->SCANLIST_PARTICIPATION = (gTxVfo->SCANLIST_PARTICIPATION & ~(1 << 0)) | (gSubMenuSelection << 0);
gTxVfo->SCANLIST_PARTICIPATION = (gTxVfo->SCANLIST_PARTICIPATION & ~(1 << 2)) | (gSubMenuSelection << 2);
SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, false, true);
gVfoConfigureMode = VFO_CONFIGURE;
gFlagResetVfos = true;
Expand Down Expand Up @@ -1088,15 +1088,15 @@ void MENU_ShowCurrentSetting(void)
break;

case MENU_S_ADD1:
gSubMenuSelection = gTxVfo->SCANLIST_PARTICIPATION >> 2 & 1;
gSubMenuSelection = gTxVfo->SCANLIST_PARTICIPATION >> 0 & 1;
break;

case MENU_S_ADD2:
gSubMenuSelection = gTxVfo->SCANLIST_PARTICIPATION >> 1 & 1;
break;

case MENU_S_ADD3:
gSubMenuSelection = gTxVfo->SCANLIST_PARTICIPATION >> 0 & 1;
gSubMenuSelection = gTxVfo->SCANLIST_PARTICIPATION >> 2 & 1;
break;

case MENU_STE:
Expand Down
2 changes: 1 addition & 1 deletion radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanL
// return false;

if(scanList<3){
if(!((att.scanlists >> (2-scanList)) & 1))
if(!((att.scanlists >> scanList) & 1))
return false;
}
else if(scanList==3 && att.scanlists)
Expand Down
4 changes: 2 additions & 2 deletions ui/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,11 +923,11 @@ void UI_DisplayMain(void)
memcpy(((shiftList%2==1)?p_line0:p_line1) + 128 - ((shiftList>2?2:shiftList) * 8), BITMAP_ScanList3, sizeof(BITMAP_ScanList3));
}
*/
if (att.scanlists & 0b100)
if (att.scanlists & 0b001)
memcpy(p_line0 + 129 - (2 * 8), BITMAP_ScanList1, sizeof(BITMAP_ScanList1));
if (att.scanlists & 0b010)
memcpy(p_line0 + 129 - (1 * 8), BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
if (att.scanlists & 0b001)
if (att.scanlists & 0b100)
memcpy(p_line1 + 129 - (2 * 8), BITMAP_ScanList3, sizeof(BITMAP_ScanList3));


Expand Down

0 comments on commit 4c261c7

Please sign in to comment.