Advertisement
Guest User

Untitled

a guest
May 28th, 2010
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. diff --git a/apps/debug_menu.c b/apps/debug_menu.c
  2. index 1288d9a..fc9424a 100644
  3. --- a/apps/debug_menu.c
  4. +++ b/apps/debug_menu.c
  5. @@ -1495,7 +1495,7 @@ static bool tsc2100_debug(void)
  6. static bool view_battery(void)
  7. {
  8. int view = 0;
  9. - int i, x, y;
  10. + int i, x, y, ygraph, ygraph_old;
  11. unsigned short maxv, minv;
  12.  
  13. lcd_setfont(FONT_SYSFIXED);
  14. @@ -1521,13 +1521,15 @@ static bool view_battery(void)
  15. minv / 1000, minv % 1000, maxv / 1000, maxv % 1000);
  16.  
  17. x = 0;
  18. + ygraph_old = LCD_HEIGHT-1;
  19. for (i = BAT_LAST_VAL - 1; i >= 0; i--) {
  20. y = (power_history[i] - minv) * BAT_YSPACE / (maxv - minv);
  21. + ygraph = MIN(MAX(LCD_HEIGHT-1 - y, 20), LCD_HEIGHT-1);
  22. lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  23. - lcd_vline(x, LCD_HEIGHT-1, 20);
  24. + lcd_vline(x, LCD_HEIGHT-1, 20); /*clear space */
  25. lcd_set_drawmode(DRMODE_SOLID);
  26. - lcd_vline(x, LCD_HEIGHT-1,
  27. - MIN(MAX(LCD_HEIGHT-1 - y, 20), LCD_HEIGHT-1));
  28. + lcd_vline(x, ygraph_old, ygraph);
  29. + ygraph_old = ygraph;
  30. x++;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement