UI: Fixed bug in channel menu resulting in a pinned first channel

This commit is contained in:
Federico Amedeo Izzo 2021-01-13 21:10:31 +01:00
parent ad78fe41e8
commit 0e1e9469ea
1 changed files with 2 additions and 2 deletions

View File

@ -58,13 +58,13 @@ void _ui_drawChannelList(point_t pos, uint8_t selected)
uint8_t scroll = 0;
char entry_buf[MAX_ENTRY_LEN] = "";
int result = 0;
channel_t channel;
for(int item=0; (result == 0) && (pos.y < SCREEN_HEIGHT); item++)
{
channel_t channel;
result = nvm_readChannelData(&channel, item + scroll);
// If selection is off the screen, scroll screen
if(selected >= entries_in_screen)
scroll = selected - entries_in_screen + 1;
result = nvm_readChannelData(&channel, item + scroll);
snprintf(entry_buf, sizeof(entry_buf), "%s", channel.name);
if(item + scroll == selected)
{