Now charcell displays require lcd_update() for updating the main lcd content like bitmap displays.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13050 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-04-06 22:55:00 +00:00
parent a5d7309d96
commit f9b90e9103
36 changed files with 131 additions and 187 deletions

View file

@ -1057,7 +1057,7 @@ bool dbg_ports(void)
lcd_puts(0, line++, buf);
#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)
snprintf(buf, sizeof(buf), "remotetype:: %d", remote_type());
snprintf(buf, sizeof(buf), "remotetype: %d", remote_type());
lcd_puts(0, line++, buf);
#endif
@ -1248,6 +1248,7 @@ bool dbg_ports(void)
snprintf(buf, 32, "Batt: %d.%02dV", adc_battery_voltage / 100,
adc_battery_voltage % 100);
lcd_puts(0, 1, buf);
lcd_update();
button = get_action(CONTEXT_SETTINGS,HZ/5);
@ -1350,6 +1351,7 @@ static bool view_battery(void)
while(1)
{
lcd_clear_display();
switch (view) {
case 0: /* voltage history graph */
/* Find maximum and minimum voltage for scaling */
@ -1371,7 +1373,6 @@ static bool view_battery(void)
if (minv == maxv)
maxv < 65535 ? maxv++ : minv--;
lcd_clear_display();
snprintf(buf, 30, "Battery %d.%02d", power_history[0] / 100,
power_history[0] % 100);
lcd_puts(0, 0, buf);
@ -1393,7 +1394,6 @@ static bool view_battery(void)
break;
case 1: /* status: */
lcd_clear_display();
lcd_puts(0, 0, "Power status:");
battery_read_info(NULL, &y, NULL);
@ -1456,7 +1456,6 @@ static bool view_battery(void)
break;
case 2: /* voltage deltas: */
lcd_clear_display();
lcd_puts(0, 0, "Voltage deltas:");
for (i = 0; i <= 6; i++) {
@ -1469,7 +1468,6 @@ static bool view_battery(void)
break;
case 3: /* remaining time estimation: */
lcd_clear_display();
#if CONFIG_CHARGING == CHARGING_CONTROL
snprintf(buf, 30, "charge_state: %d", charge_state);
@ -1657,9 +1655,7 @@ static bool dbg_disk_info(void)
bool timing_info_present = false;
char pio3[2], pio4[2];
#ifdef HAVE_LCD_BITMAP
lcd_setmargins(0, 0);
#endif
while(!done)
{
@ -1999,9 +1995,7 @@ static bool dbg_fm_radio(void)
char buf[32];
bool fm_detected;
#ifdef HAVE_LCD_BITMAP
lcd_setmargins(0, 0);
#endif
while(1)
{

View file

@ -178,9 +178,7 @@ static void splash(struct screen * screen, const char *fmt, va_list ap)
screen->set_drawmode(DRMODE_SOLID);
}
#endif
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
screen->update();
#endif
}
void gui_splash(struct screen * screen, int ticks,

View file

@ -191,10 +191,10 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
}
else
{
#else
#else /* CONFIG_CHARGING < CHARGING_MONITOR */
lasttime = current_tick;
{
#endif
#endif /* CONFIG_CHARGING < CHARGING_MONITOR */
/* animate in (max.) 4 steps, starting near the current charge level */
if (TIME_AFTER(current_tick, bar->battery_icon_switch_tick))
{
@ -205,7 +205,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
}
}
else
#endif
#endif /* CONFIG_CHARGING */
{
bar->info.batt_charge_step = -1;
if (battery_level_safe())
@ -254,13 +254,6 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
display->fillrect(0, 0, display->width, STATUSBAR_HEIGHT);
display->set_drawmode(DRMODE_SOLID);
#else
/* players always "redraw" */
{
#endif /* HAVE_LCD_BITMAP */
#ifdef HAVE_LCD_BITMAP
if (bar->info.battery_state)
gui_statusbar_icon_battery(display, bar->info.battlevel,
bar->info.batt_charge_step);
@ -281,7 +274,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
STATUSBAR_PLUG_X_POS,
STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH,
STATUSBAR_HEIGHT);
#endif
#endif /* CONFIG_CHARGING */
#ifdef HAVE_RECORDING
/* turn off volume display in recording screen */
bool recscreen_on = in_recording_screen();
@ -332,8 +325,8 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
#endif
display->update_rect(0, 0, display->width, STATUSBAR_HEIGHT);
bar->lastinfo = bar->info;
#endif /* HAVE_LCD_BITMAP */
}
#endif /* HAVE_LCD_BITMAP */
#ifdef HAVE_LCD_CHARCELLS

View file

@ -33,14 +33,16 @@ void gui_textarea_clear(struct screen * display)
#endif
}
#ifdef HAVE_LCD_BITMAP
void gui_textarea_update(struct screen * display)
{
#ifdef HAVE_LCD_BITMAP
int y_start = gui_textarea_get_ystart(display);
int y_end = gui_textarea_get_yend(display);
display->update_rect(0, y_start, display->width, y_end - y_start);
}
#else
display->update();
#endif
}
int gui_textarea_put_message(struct screen * display,
struct text_message * message,
@ -56,8 +58,8 @@ int gui_textarea_put_message(struct screen * display,
void gui_textarea_update_nblines(struct screen * display)
{
#ifdef HAVE_LCD_BITMAP
int height=display->height;
#ifdef HAVE_LCD_BITMAP
if(global_settings.statusbar)
height -= STATUSBAR_HEIGHT;
#ifdef HAS_BUTTONBAR
@ -66,11 +68,9 @@ void gui_textarea_update_nblines(struct screen * display)
#endif
display->getstringsize((unsigned char *)"A", &display->char_width,
&display->char_height);
display->nb_lines = height / display->char_height;
#else
display->char_width = 1;
display->char_height = 1;
/* default on char based player supported by rb */
display->nb_lines = MAX_LINES_ON_SCREEN;
#endif
display->nb_lines = height / display->char_height;
}

View file

@ -40,16 +40,7 @@ extern void gui_textarea_clear(struct screen * display);
* Updates the area in the screen in which text can be displayed
* - display : the screen structure
*/
#ifdef HAVE_LCD_BITMAP
extern void gui_textarea_update(struct screen * display);
#else
#ifdef SIMULATOR
#define gui_textarea_update(display) \
(display)->update();
#else
#define gui_textarea_update(display)
#endif
#endif
/*
* Displays message lines on the given screen

View file

@ -442,8 +442,9 @@ static void init(void)
#ifdef HAVE_LCD_BITMAP
lcd_puts(0, 2, "Insert USB cable");
lcd_puts(0, 3, "and fix it.");
lcd_update();
#endif
lcd_update();
while(button_get(true) != SYS_USB_CONNECTED) {};
usb_screen();
system_reboot();

View file

@ -825,23 +825,29 @@ int show_logo( void )
char version[32];
int font_h, font_w;
snprintf(version, sizeof(version), "Ver. %s", appsversion);
lcd_clear_display();
lcd_bitmap(rockboxlogo, 0, 10, BMPWIDTH_rockboxlogo, BMPHEIGHT_rockboxlogo);
lcd_setfont(FONT_SYSFIXED);
lcd_getstringsize((unsigned char *)"A", &font_w, &font_h);
lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
LCD_HEIGHT-font_h, (unsigned char *)version);
#else
char *rockbox = " ROCKbox!";
lcd_clear_display();
lcd_double_height(true);
lcd_puts(0, 0, rockbox);
lcd_puts_scroll(0, 1, appsversion);
#endif
lcd_update();
#ifdef HAVE_REMOTE_LCD
lcd_remote_clear_display();
lcd_remote_bitmap(remote_rockboxlogo, 0, 10, BMPWIDTH_remote_rockboxlogo,
BMPHEIGHT_remote_rockboxlogo);
#endif
snprintf(version, sizeof(version), "Ver. %s", appsversion);
lcd_setfont(FONT_SYSFIXED);
lcd_getstringsize((unsigned char *)"A", &font_w, &font_h);
lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
LCD_HEIGHT-font_h, (unsigned char *)version);
lcd_update();
#ifdef HAVE_REMOTE_LCD
lcd_remote_setfont(FONT_SYSFIXED);
lcd_remote_getstringsize((unsigned char *)"A", &font_w, &font_h);
lcd_remote_putsxy((LCD_REMOTE_WIDTH/2) - ((strlen(version)*font_w)/2),
@ -849,14 +855,6 @@ int show_logo( void )
lcd_remote_update();
#endif
#else
char *rockbox = " ROCKbox!";
lcd_clear_display();
lcd_double_height(true);
lcd_puts(0, 0, rockbox);
lcd_puts_scroll(0, 1, appsversion);
#endif
return 0;
}

View file

@ -504,9 +504,7 @@ int plugin_load(const char* plugin, void* parameter)
int fd;
ssize_t readsize;
#endif
#ifdef HAVE_LCD_BITMAP
int xm, ym;
#endif
#ifdef HAVE_REMOTE_LCD
int rxm, rym;
#endif
@ -589,20 +587,15 @@ int plugin_load(const char* plugin, void* parameter)
plugin_loaded = true;
#ifdef HAVE_LCD_BITMAP
xm = lcd_getxmargin();
ym = lcd_getymargin();
lcd_setmargins(0,0);
#if LCD_DEPTH > 1
#if defined HAVE_LCD_BITMAP && LCD_DEPTH > 1
old_backdrop = lcd_get_backdrop();
#endif
lcd_clear_display();
lcd_update();
#else /* !HAVE_LCD_BITMAP */
lcd_clear_display();
#endif
#ifdef HAVE_REMOTE_LCD
rxm = lcd_remote_getxmargin();
@ -632,11 +625,12 @@ int plugin_load(const char* plugin, void* parameter)
#else /* LCD_DEPTH == 1 */
lcd_set_drawmode(DRMODE_SOLID);
#endif /* LCD_DEPTH */
#endif /* HAVE_LCD_BITMAP */
/* restore margins */
lcd_setmargins(xm,ym);
lcd_clear_display();
lcd_update();
#endif /* HAVE_LCD_BITMAP */
#ifdef HAVE_REMOTE_LCD
#if LCD_REMOTE_DEPTH > 1

View file

@ -647,9 +647,7 @@ void print_scroll(char* string)
rb->snprintf(screen[(pos+screentop) % LINES], sizeof(screen[0]), "%s", string);
rb->lcd_puts(0, pos, screen[(pos+screentop) % LINES]);
#ifndef HAVE_LCD_CHARCELLS
rb->lcd_update();
#endif
pos++;
}

View file

@ -129,10 +129,11 @@ bool exit_tsr(bool reenter)
rb->lcd_clear_display();
rb->lcd_puts_scroll(0, 0, "Batt.Bench is currently running.");
rb->lcd_puts_scroll(0, 1, "Press OFF to cancel the test");
rb->lcd_puts_scroll(0, 2, "Anything else will resume");
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
rb->lcd_puts_scroll(0, 2, "Anything else will resume");
#endif
rb->lcd_update();
if (rb->button_get(true) != BATTERY_OFF)
exit = false;
if (exit)
@ -369,21 +370,24 @@ int main(void)
int button, fd;
bool on = false;
#ifdef HAVE_LCD_BITMAP
int i;
const char *msgs[] = { "Battery Benchmark","Check file", BATTERY_LOG,
"for more info", "PLAY - start", "OFF - quit" };
#endif
rb->lcd_clear_display();
#ifdef HAVE_LCD_BITMAP
int i;
rb->lcd_clear_display();
rb->lcd_setfont(FONT_SYSFIXED);
for(i = 0; i<(int)(sizeof(msgs)/sizeof(char *)); i++)
put_centered_str(msgs[i],rb->lcd_putsxy,LCD_WIDTH,i+1);
#else
rb->lcd_puts_scroll(0, 0, "Batt.Bench.");
rb->lcd_puts_scroll(0, 1, "PLAY/STOP");
#endif
rb->lcd_update();
#ifdef HAVE_REMOTE_LCD
rb->lcd_remote_clear_display();
put_centered_str(msgs[0],rb->lcd_remote_putsxy,LCD_REMOTE_WIDTH,0);
@ -394,11 +398,6 @@ int main(void)
rb->lcd_remote_update();
#endif
#else
rb->lcd_puts_scroll(0, 0, "Batt.Bench.");
rb->lcd_puts_scroll(0, 1, "PLAY/STOP");
#endif
do
{
button = rb->button_get(true);

View file

@ -369,9 +369,8 @@ static int run_timer(int nr)
(unsigned char *)show_time((max_ticks-ticks+HZ-1)/HZ));
}
}
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
button = rb->button_get(false);
switch (button) {
/* OFF/ON key to exit */
@ -493,9 +492,8 @@ static int chessclock_set_int(char* string,
else
rb->snprintf(str, sizeof str,"%d", *variable);
rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)str);
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
button = rb->button_get(true);
switch(button) {
case CHC_SETTINGS_INC:
@ -562,9 +560,8 @@ static int simple_menu(int nr, unsigned char **strarr)
if (show<0)
show=nr-1;
rb->lcd_puts_scroll(0, FIRST_LINE, strarr[show]);
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
button = rb->button_get(true);
switch(button) {
case CHC_SETTINGS_INC:

View file

@ -90,7 +90,6 @@ void roll_credits(void)
else
rb->lcd_puts(x, line, credits[name]);
if (++name >= numnames)
break;
@ -104,6 +103,8 @@ void roll_credits(void)
x += MAX(len/2 + 2, len - new_len/2 + 1);
len = new_len;
}
rb->lcd_update();
/* abort on keypress */
if (rb->button_get_w_tmo(HZ/8) & BUTTON_REL)
return;

View file

@ -214,9 +214,7 @@ static void print_dice(const int dice[], const int total) {
rb->lcd_puts(0,START_DICE_ROW+(++row)," ");
}
#endif
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
}
static bool dice_menu(int *num_dice, int *side_index) {
int selection;

View file

@ -301,10 +301,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
break;
}
}
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
/* wait for keypress */
while(rb->button_get(true) != LP_QUIT)

View file

@ -87,8 +87,8 @@ void tidy_lcd_status(const char *name, int *removed)
rb->snprintf(text, 24, "Cleaned up %d items", *removed);
#ifdef HAVE_LCD_BITMAP
rb->lcd_puts(0, 2, text);
rb->lcd_update();
#endif
rb->lcd_update();
}
void tidy_get_absolute_path(struct dirent *entry, char *fullname,

View file

@ -290,14 +290,15 @@ static void display(longlong_t euro, longlong_t home, bool pos)
}
else
rb->lcd_puts_scroll(1,1,str);
rb->lcd_update();
}
/* Show country Abbreviation */
static void show_abbrev(void)
{
rb->lcd_puts(2,1,abbrev_str[country]);
rb->sleep(HZ*3/4);
rb->splash(HZ*3/4,abbrev_str[country]);
}
@ -325,6 +326,7 @@ static void currency_menu(void)
{
rb->lcd_puts(0,0,"Currency:");
rb->lcd_puts(0,1,currency_str[c]);
rb->lcd_update();
switch (rb->button_get(true))
{
case BUTTON_RIGHT|BUTTON_REL:
@ -361,6 +363,7 @@ static int euro_menu(void)
rb->lcd_puts(0,0," Currency");
rb->lcd_puts(0,1," Exit");
rb->lcd_putc(0,c,0xe110);
rb->lcd_update();
switch (rb->button_get(true))
{
@ -394,6 +397,7 @@ static void euro_exit(void *parameter)
//Clear the screen
rb->lcd_clear_display();
rb->lcd_update();
}

View file

@ -848,6 +848,7 @@ void ShowFlashInfo(tFlashInfo* pInfo)
{
rb->lcd_puts_scroll(0, 0, "Flash: M=? D=?");
rb->lcd_puts_scroll(0, 1, "Impossible to program");
rb->lcd_update();
WaitForButton();
}
else
@ -860,10 +861,12 @@ void ShowFlashInfo(tFlashInfo* pInfo)
{
rb->snprintf(buf, sizeof(buf), "Size: %d KB", pInfo->size / 1024);
rb->lcd_puts_scroll(0, 1, buf);
rb->lcd_update();
}
else
{
rb->lcd_puts_scroll(0, 1, "Unsupported chip");
rb->lcd_update();
WaitForButton();
}
}
@ -941,6 +944,7 @@ void DoUserDialog(char* filename)
rb->lcd_puts_scroll(0, 0, filename);
rb->lcd_puts_scroll(0, 1, "[Menu] to check");
rb->lcd_update();
button = WaitForButton();
if (button != BUTTON_MENU)
@ -950,6 +954,7 @@ void DoUserDialog(char* filename)
rb->lcd_clear_display();
rb->lcd_puts(0, 0, "Checking...");
rb->lcd_update();
rc = CheckFirmwareFile(filename, FlashInfo.size, is_romless);
rb->lcd_puts(0, 0, "Checked:");
@ -989,6 +994,7 @@ void DoUserDialog(char* filename)
rb->lcd_puts_scroll(0, 0, "Check failed.");
break;
}
rb->lcd_update();
rb->sleep(HZ*3);
@ -996,6 +1002,7 @@ void DoUserDialog(char* filename)
{
rb->lcd_puts_scroll(0, 0, "[On] to program,");
rb->lcd_puts_scroll(0, 1, "other key to exit.");
rb->lcd_update();
}
else
{ /* error occured */
@ -1012,6 +1019,7 @@ void DoUserDialog(char* filename)
rb->lcd_clear_display();
rb->lcd_puts_scroll(0, 0, "Are you sure?");
rb->lcd_puts_scroll(0, 1, "[+] to proceed.");
rb->lcd_update();
button = WaitForButton();
@ -1022,6 +1030,7 @@ void DoUserDialog(char* filename)
rb->lcd_clear_display();
rb->lcd_puts_scroll(0, 0, "Programming...");
rb->lcd_update();
rc = ProgramFirmwareFile(filename, FlashInfo.size);
@ -1031,11 +1040,13 @@ void DoUserDialog(char* filename)
rb->lcd_puts_scroll(0, 0, "Programming failed!");
rb->snprintf(buf, sizeof(buf), "%d errors", rc);
rb->lcd_puts_scroll(0, 1, buf);
rb->lcd_update();
WaitForButton();
}
rb->lcd_clear_display();
rb->lcd_puts_scroll(0, 0, "Verifying...");
rb->lcd_update();
rc = VerifyFirmwareFile(filename);
@ -1052,6 +1063,7 @@ void DoUserDialog(char* filename)
}
rb->lcd_puts_scroll(0, 1, "Press any key to exit.");
rb->lcd_update();
WaitForButton();
}

View file

@ -323,9 +323,7 @@ static void move_cursor(int x, int y)
+ ( ( y + 4 + cursor_pos/5 )%4 )*5;
draw_cursor();
}
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
}
/* initialize the board */
@ -339,9 +337,8 @@ static void flipit_init(void)
toggle[i]=1;
draw_spot(i);
}
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
for (i=0; i<20; i++) {
cursor_pos = (rb->rand() % 20);
flipit_toggle();
@ -351,9 +348,7 @@ static void flipit_init(void)
draw_cursor();
moves = 0;
draw_info_panel();
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
}
/* the main game loop */
@ -392,9 +387,7 @@ static bool flipit_loop(void)
cursor_pos = i;
flipit_toggle();
draw_cursor();
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
rb->sleep(HZ*2/3);
}
}
@ -412,9 +405,7 @@ static bool flipit_loop(void)
cursor_pos = i;
flipit_toggle();
draw_cursor();
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
break;
}
}
@ -429,9 +420,7 @@ static bool flipit_loop(void)
if (!flipit_finished()) {
flipit_toggle();
draw_cursor();
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
}
break;
@ -546,9 +535,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
spots[i]=1;
draw_spot(i);
}
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
rb->sleep(HZ*3/2);
rb->srand(*rb->current_tick);

View file

@ -78,6 +78,7 @@ static void jackpot_exit(void *parameter)
/* Clear the screen */
rb->lcd_clear_display();
rb->lcd_update();
}
@ -115,13 +116,15 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->lcd_putc(9,0,h2); rb->lcd_putc(10,0,h1);
rb->lcd_puts(0,1," V1.1 ");
rb->lcd_putc(1,1,h3); rb->lcd_putc(9,1,h3);
rb->lcd_update();
rb->sleep(HZ*2);
rb->lcd_clear_display();
/*First display*/
rb->lcd_clear_display();
rb->snprintf(str,sizeof(str),"[ ]$%d",g);
rb->lcd_puts(0,0,str);
rb->lcd_puts_scroll(0,1,"PLAY to begin");
rb->lcd_update();
/*Empty the event queue*/
rb->button_clear_queue();
@ -165,6 +168,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
/*Clear the Second line*/
rb->lcd_puts_scroll(0,1,"Good luck");
rb->lcd_update();
/*GO !!!!*/
if ( go && !exit )
@ -188,6 +192,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->lcd_putc(1,0, h1);
rb->lcd_putc(2,0, h2);
rb->lcd_putc(3,0, h3);
rb->lcd_update();
for(i=0;i<3;i++)
{
if (n[i]>=0)
@ -268,6 +273,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->snprintf(str,sizeof(str),"You win %d$",j);
rb->lcd_puts(0,1,str);
}
rb->lcd_update();
}
}

View file

@ -99,6 +99,8 @@ void pgfx_update(void)
for (i = 0; i < char_width * char_height; i++)
pgfx_rb->lcd_define_pattern(gfx_chars[i], gfx_buffer + 7 * i);
pgfx_rb->lcd_update();
}
/*** Parameter handling ***/

View file

@ -312,11 +312,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
#else
if (cpos != old_cpos) {
rb->lcd_clear_display();
pgfx_update();
pgfx_display(cpos, 0);
old_cpos = cpos;
}
else
pgfx_update();
#endif
rb->sleep(HZ/timer);

View file

@ -778,8 +778,8 @@ void draw_display(void)
rb->lcd_puts(0,2,METRONOME_MSG_START);
else
rb->lcd_puts(0,2,METRONOME_MSG_STOP);
rb->lcd_update();
#endif
rb->lcd_update();
#ifdef HAVE_REMOTE_LCD
rb->lcd_remote_drawline(0, 12, 111, 12);
if(sound_paused)

View file

@ -66,6 +66,7 @@ static struct plugin_api* rb;
static void impossible(void)
{
rb->lcd_puts(0,1,"Impossible!");
rb->lcd_update();
rb->sleep(HZ);
return;
}
@ -76,6 +77,7 @@ static void lose(void)
rb->lcd_define_pattern(hsmile,smile);
rb->lcd_puts(0,1,"You Win!!");
rb->lcd_putc(8,1,hsmile);
rb->lcd_update();
end=true;
rb->sleep(HZ*2);
return;
@ -88,6 +90,7 @@ static void win(void)
rb->lcd_define_pattern(hcry,cry);
rb->lcd_puts(0,1,"You Lose!!");
rb->lcd_putc(9,1,hcry);
rb->lcd_update();
end=true;
rb->sleep(HZ*2);
return;
@ -131,6 +134,7 @@ static void nim_exit(void *parameter)
/*Clear the screen*/
rb->lcd_clear_display();
rb->lcd_update();
}
/* this is the plugin entry point */
@ -183,6 +187,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->snprintf(str,sizeof(str),"[%d..%d]?=%d",min,v,y);
rb->lcd_puts(0,1,str);
rb->lcd_update();
go=false;
while (!go)
@ -221,6 +226,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
display_first_line(x);
rb->snprintf(str,sizeof(str),"[%d..%d]?=%d",min,v,y);
rb->lcd_puts(0,1,str);
rb->lcd_update();
}
if ( (y==0) && (x<21))
@ -281,6 +287,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
x-=y;
rb->snprintf(str,sizeof(str),"I take=%d",y);
rb->lcd_puts(0,1,str);
rb->lcd_update();
rb->sleep(HZ);
}
if ((x==1)&&(!end))

View file

@ -173,9 +173,8 @@ static bool _dir_properties(DPS* dps)
rb->snprintf(dps->tstr, 64, "Size: %s",
filesize2string(dps->bc, dps->tstr2, 64));
rb->lcd_puts(0,5,dps->tstr);
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
/* recursion */
result = _dir_properties(dps);
}
@ -302,9 +301,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
rb->lcd_clear_display();
rb->lcd_puts(0,0,"File/Dir not found:");
rb->lcd_puts(0,1,(char*)file);
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
rb->action_userabort(TIMEOUT_BLOCK);
return PLUGIN_OK;
}

View file

@ -59,22 +59,16 @@ struct file_format *list = NULL;
void update_screen(bool clear)
{
char buf[15];
#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */
int i;
rb->snprintf(buf,sizeof(buf),"Folders: %d",dirs_count);
FOR_NB_SCREENS(i)
{
rb->snprintf(buf,15,"Folders: %d",dirs_count);
if(clear)
rb->screens[i]->clear_display();
rb->screens[i]->putsxy(0,0,buf);
rb->screens[i]->update();
}
#else
rb->snprintf(buf,15,"Folders: %d",dirs_count);
if(clear)
rb->lcd_clear_display();
rb->lcd_puts(0,0,buf);
#endif
}
void traversedir(char* location, char* name)

View file

@ -893,6 +893,7 @@ void DoUserDialog(char* filename)
{
rb->lcd_puts_scroll(0, 0, "Hint: You're not using the latest bootloader. A full reflash is recommended, but not required.");
rb->lcd_puts_scroll(0, 1, "Press [Menu] to ignore");
rb->lcd_update();
if (WaitForButton() != BUTTON_MENU)
{
@ -902,6 +903,7 @@ void DoUserDialog(char* filename)
}
rb->lcd_puts(0, 0, "Checking...");
rb->lcd_update();
space = FlashInfo.size - (pos-FB + sizeof(ImageHeader));
/* size minus start */
@ -941,6 +943,7 @@ void DoUserDialog(char* filename)
rb->lcd_puts_scroll(0, 1, "Check failed.");
break;
}
rb->lcd_update();
if (rc == eOK)
{ /* was OK */
@ -955,6 +958,7 @@ void DoUserDialog(char* filename)
rb->lcd_puts_scroll(0, 0, "Flash failed.");
rb->lcd_puts_scroll(0, 1, "Any key to exit.");
}
rb->lcd_update();
button = WaitForButton();
if (rc != eOK || button != BUTTON_ON)
@ -972,6 +976,7 @@ void DoUserDialog(char* filename)
rb->lcd_clear_display();
rb->lcd_puts_scroll(0, 0, "Programming...");
rb->lcd_update();
rc = ProgramImageFile(filename, pos, &ImageHeader, UCL_HEADER, true_size);
if (rc)
@ -980,11 +985,13 @@ void DoUserDialog(char* filename)
rb->snprintf(buf, sizeof(buf), "%d errors", rc);
rb->lcd_puts_scroll(0, 0, "Programming failed!");
rb->lcd_puts_scroll(0, 1, buf);
rb->lcd_update();
button = WaitForButton();
}
rb->lcd_clear_display();
rb->lcd_puts_scroll(0, 0, "Verifying...");
rb->lcd_update();
rc = VerifyImageFile(filename, pos, &ImageHeader, UCL_HEADER, true_size);
@ -992,12 +999,14 @@ void DoUserDialog(char* filename)
if (rc == 0)
{
rb->lcd_puts(0, 0, "Verify OK.");
rb->lcd_update();
}
else
{
rb->snprintf(buf, sizeof(buf), "Verify fail! %d errors", rc);
rb->lcd_puts_scroll(0, 0, buf);
rb->lcd_puts_scroll(0, 1, "Use safe image if booting hangs: [-] during power-on");
rb->lcd_update();
button = WaitForButton();
}
}

View file

@ -34,7 +34,8 @@ rb->lcd_update()
#define PUTS(str) do { \
rb->lcd_puts(0, y, str); \
y = (y + 1) % 2; \
} while (0);
} while (0); \
rb->lcd_update()
#endif
extern struct plugin_api* rb;

View file

@ -24,9 +24,6 @@ static struct plugin_api* rb;
static int files, dirs, musicfiles;
static int lasttick;
static bool abort;
#ifdef HAVE_LCD_BITMAP
static int fontwidth, fontheight;
#endif
#if CONFIG_KEYPAD == PLAYER_PAD
#define STATS_STOP BUTTON_STOP
@ -70,43 +67,39 @@ const char *music_exts[] = {"mp3","mp2","mp1","mpa","ogg",
void prn(const char *str, int y)
{
#ifdef HAVE_LCD_BITMAP
rb->lcd_putsxy(0,y,str);
#ifdef HAVE_REMOTE_LCD
rb->lcd_remote_putsxy(0,y,str);
#endif
#else
rb->lcd_puts(0,y,str);
#ifdef HAVE_REMOTE_LCD
rb->lcd_remote_puts(0,y,str);
#endif
}
void update_screen(void)
{
char buf[15];
#ifdef HAVE_LCD_BITMAP
rb->lcd_clear_display();
#ifdef HAVE_REMOTE_LCD
rb->lcd_remote_clear_display();
#endif
#ifdef HAVE_LCD_BITMAP
rb->snprintf(buf, sizeof(buf), "Files: %d", files);
prn(buf,0);
rb->snprintf(buf, sizeof(buf), "Music: %d", musicfiles);
prn(buf,fontheight);
prn(buf,1);
rb->snprintf(buf, sizeof(buf), "Dirs: %d", dirs);
prn(buf,fontheight*2);
rb->lcd_update();
#ifdef HAVE_REMOTE_LCD
rb->lcd_remote_update();
#endif
prn(buf,2);
#else
rb->snprintf(buf, sizeof(buf), "Files:%5d", files);
prn(buf,0);
rb->snprintf(buf, sizeof(buf), "Dirs: %5d", dirs);
prn(buf,1);
#endif
rb->lcd_update();
#ifdef HAVE_REMOTE_LCD
rb->lcd_remote_update();
#endif
}
void traversedir(char* location, char* name)
@ -177,9 +170,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
musicfiles = 0;
abort = false;
#ifdef HAVE_LCD_BITMAP
rb->lcd_getstringsize("Files: ", &fontwidth, &fontheight);
#endif
rb->splash(HZ, "Counting...");
update_screen();
lasttick = *rb->current_tick;

View file

@ -204,9 +204,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
update_lap = false;
}
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
if (! counting)
{

View file

@ -31,9 +31,7 @@ static void xingupdate(int percent)
rb->snprintf(buf, 32, "%d%%", percent);
rb->lcd_puts(0, 1, buf);
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
}
static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes)
@ -141,9 +139,7 @@ static bool vbr_fix(char *selected_file)
rb->lcd_clear_display();
rb->lcd_puts_scroll(0, 0, selected_file);
#ifdef HAVE_LCD_BITMAP
rb->lcd_update();
#endif
xingupdate(0);

View file

@ -932,12 +932,12 @@ static void viewer_draw(int col)
if (prefs.need_scrollbar)
viewer_scrollbar();
if (col != -1)
rb->lcd_update();
#else
next_screen_to_draw_ptr = next_screen_ptr;
#endif
if (col != -1)
rb->lcd_update();
}
static void viewer_top(void)

View file

@ -113,8 +113,6 @@ void usb_screen(void)
(LCD_HEIGHT-BMPHEIGHT_usblogo)/2,
BMPWIDTH_usblogo, BMPHEIGHT_usblogo);
#endif /* HAVE_LCD_COLOR */
lcd_update();
#else
lcd_double_height(false);
lcd_puts_scroll(0, 0, "[USB Mode]");
@ -122,6 +120,7 @@ void usb_screen(void)
status_set_audio(false);
status_set_usb(true);
#endif /* HAVE_LCD_BITMAP */
lcd_update();
gui_syncstatusbar_draw(&statusbars, true);
#ifdef SIMULATOR
@ -315,6 +314,8 @@ static void charging_display_info(bool animate)
for (i = 0; i < 4; i++)
lcd_define_pattern(logo_chars[i], buf + 8 * i);
lcd_update();
}
#endif /* (not) HAVE_LCD_BITMAP */

View file

@ -295,10 +295,7 @@ void lcd_define_pattern(unsigned long ucs, const char *pattern)
memcpy(xfont_variable[glyph & 0x7fff], pattern, HW_PATTERN_SIZE);
pat = glyph_to_pat(glyph);
if (pat != NO_PATTERN)
{
memcpy(lcd_patterns[pat].pattern, pattern, HW_PATTERN_SIZE);
lcd_update(); //FIXME: remove when lcd_update() calls are checked all over
}
}
}
@ -315,8 +312,6 @@ void lcd_clear_display(void)
for (x = 0; x < LCD_WIDTH; x++)
for (y = 0; y < LCD_HEIGHT; y++)
lcd_putxchar(x, y, xspace);
lcd_update(); //FIXME: remove when lcd_update() calls are checked all over
}
/* Put an unicode character at the given position */
@ -326,7 +321,6 @@ void lcd_putc(int x, int y, unsigned long ucs)
return;
lcd_putxchar(x, y, find_xchar(ucs));
lcd_update(); //FIXME: remove when lcd_update() calls are checked all over
}
/* Show cursor (alternating with existing character) at the given position */
@ -384,7 +378,6 @@ void lcd_putsxy(int x, int y, const unsigned char *str)
return;
lcd_putsxyofs(x, y, 0, str);
lcd_update(); //FIXME: remove when lcd_update() calls are checked all over
}
/*** Line oriented text output ***/
@ -410,8 +403,6 @@ void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
x = lcd_putsxyofs(x, y, offset, str);
while (x < LCD_WIDTH)
lcd_putxchar(x++, y, xspace);
lcd_update(); //FIXME: remove when lcd_update() calls are checked all over
}
/** scrolling **/

View file

@ -74,11 +74,10 @@ void panicf( const char *fmt, ...)
panic_buf[i+18] = c;
}
}
lcd_update();
#else
/* no LCD */
#endif
lcd_update();
DEBUGF(panic_buf);
set_cpu_frequency(0);

View file

@ -452,10 +452,7 @@ void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
lcd_puts(0,0,str);
snprintf(str,sizeof(str),"at %08x",pc);
lcd_puts(0,1,str);
#ifdef HAVE_LCD_BITMAP
lcd_update ();
#endif
while (1)
{

View file

@ -46,9 +46,8 @@ void usb_screen(void)
{
lcd_clear_display();
lcd_puts(0, 0, "USB mode");
#ifdef HAVE_LCD_BITMAP
lcd_update();
#endif
usb_acknowledge(SYS_USB_CONNECTED_ACK);
while(usb_wait_for_disconnect_w_tmo(&button_queue, HZ)) {
}
@ -59,9 +58,8 @@ int show_logo(void)
lcd_clear_display();
lcd_puts(0, 0, "Rockbox");
lcd_puts(0, 1, "Rescue boot");
#ifdef HAVE_LCD_BITMAP
lcd_update();
#endif
return 0;
}
@ -104,10 +102,7 @@ void charging_screen(void)
battv / 100, battv % 100, battery_level());
lcd_puts(0, 1, buf);
}
#ifdef HAVE_LCD_BITMAP
lcd_update();
#endif
button = button_get_w_tmo(HZ/2);
#ifdef BUTTON_ON
@ -137,8 +132,8 @@ void prompt_usb(const char* msg1, const char* msg2)
#ifdef HAVE_LCD_BITMAP
lcd_puts(0, 2, "Insert USB cable");
lcd_puts(0, 3, "and fix it.");
lcd_update();
#endif
lcd_update();
do
{
button = button_get(true);