lcd: Remove internal function get_viewport()

Only the scroll engine calls this, but it's easily replaced
by the return value of set_viewport_ex().

Change-Id: I2e2c8234f969bc07c9ff7d864e58551115175e26
This commit is contained in:
Aidan MacDonald 2022-09-26 15:20:00 +01:00
parent 4f9e4ddb99
commit eaccdeeae2
3 changed files with 3 additions and 25 deletions

View file

@ -271,18 +271,6 @@ struct viewport* LCDFN(set_viewport)(struct viewport* vp)
return LCDFN(set_viewport_ex)(vp, VP_FLAG_VP_DIRTY); return LCDFN(set_viewport_ex)(vp, VP_FLAG_VP_DIRTY);
} }
struct viewport *LCDFN(get_viewport)(bool *is_default)
{
#if 0
*is_default = memcmp(LCDFN(current_viewport),
&default_vp, sizeof(struct viewport)) == 0;
#else
*is_default = LCDFN(current_viewport) == &default_vp;
#endif
return LCDFN(current_viewport);
}
void LCDFN(update_viewport)(void) void LCDFN(update_viewport)(void)
{ {

View file

@ -185,10 +185,9 @@ static void LCDFN(scroll_worker)(void)
{ {
int index; int index;
bool makedelay; bool makedelay;
bool is_default;
struct scroll_screen_info *si = &LCDFN(scroll_info); struct scroll_screen_info *si = &LCDFN(scroll_info);
struct scrollinfo *s; struct scrollinfo *s;
struct viewport *vp; struct viewport *oldvp;
int step; int step;
for ( index = 0; index < si->lines; index++ ) for ( index = 0; index < si->lines; index++ )
@ -206,8 +205,7 @@ static void LCDFN(scroll_worker)(void)
* is unaware of the swapped viewports. the vp must * is unaware of the swapped viewports. the vp must
* be switched early so that lcd_getstringsize() picks the * be switched early so that lcd_getstringsize() picks the
* correct font */ * correct font */
vp = LCDFN(get_viewport)(&is_default); oldvp = LCDFN(set_viewport_ex)(s->vp, 0); /* don't mark the last vp as dirty */
LCDFN(set_viewport_ex)(s->vp, 0); /* don't mark the last vp as dirty */
makedelay = false; makedelay = false;
step = si->step; step = si->step;
@ -220,7 +218,7 @@ static void LCDFN(scroll_worker)(void)
/* put the line onto the display now */ /* put the line onto the display now */
makedelay = LCDFN(scroll_now(s)); makedelay = LCDFN(scroll_now(s));
LCDFN(set_viewport_ex)(vp, 0); /* don't mark the last vp as dirty */ LCDFN(set_viewport_ex)(oldvp, 0); /* don't mark the last vp as dirty */
if (makedelay) if (makedelay)
s->start_tick += si->delay + si->ticks; s->start_tick += si->delay + si->ticks;

View file

@ -37,14 +37,6 @@
#endif #endif
#include "scroll_engine.h" #include "scroll_engine.h"
/* private helper function for the scroll engine. Do not use in apps/.
* defined in lcd-bitmap-common.c */
extern struct viewport *lcd_get_viewport(bool *is_defaut);
#ifdef HAVE_REMOTE_LCD
extern struct viewport *lcd_remote_get_viewport(bool *is_defaut);
#endif
static const char scroll_tick_table[18] = { static const char scroll_tick_table[18] = {
/* Hz values [f(x)=100.8/(x+.048)]: /* Hz values [f(x)=100.8/(x+.048)]:
1, 1.25, 1.55, 2, 2.5, 3.12, 4, 5, 6.25, 8.33, 10, 12.5, 16.7, 20, 25, 33, 49.2, 96.2 */ 1, 1.25, 1.55, 2, 2.5, 3.12, 4, 5, 6.25, 8.33, 10, 12.5, 16.7, 20, 25, 33, 49.2, 96.2 */