Another animation (circle). Comments welcome :)

This commit is contained in:
bsongis
2011-11-26 16:02:46 +00:00
parent 2ec3769bb5
commit e0cdbb8294
3 changed files with 19 additions and 5 deletions
+12 -1
View File
@@ -572,12 +572,23 @@ void RlcFile::flush()
s_sync_write = false;
}
#define PROGRESS_CIRCLE
void RlcFile::DisplayProgressBar()
{
if (s_eeDirtyMsk || m_rlc_len || eeprom_buffer_size) {
#if defined (PROGRESS_BAR)
uint8_t len = (s_eeDirtyMsk ? 123 : min((uint8_t)123, (uint8_t)((m_rlc_len) / 5 + eeprom_buffer_size)));
lcd_filled_rect(2, 1, 125, 5, WHITE);
lcd_filled_rect(3, 2, 123-len, 3);
#elif defined (PROGRESS_CIRCLE)
uint8_t len = 200 - (s_eeDirtyMsk ? 200 : min((uint8_t)200, (uint8_t)(m_rlc_len / 4 + eeprom_buffer_size)));
uint8_t x = 17*FW-3;
lcd_hline(x+1, 1, len >= 50 ? 3 : len / 16);
if (len >= 50) lcd_vline(x+4, 2, len >= 100 ? 3 : (len-50) / 17);
if (len >= 100) lcd_hline(x+4, 1+4, len >= 150 ? -3 : -((len-100) / 17));
if (len >= 150) lcd_vline(x, 5, -((len-133) / 17));
#elif defined (PROGRESS_FIXED_CIRCLE)
lcd_square(17*FW-3, 1, 5);
#endif
}
}
+5 -2
View File
@@ -292,9 +292,10 @@ void lcd_plot(uint8_t x,uint8_t y, uint8_t att)
lcd_mask(p, BITMASK(y%8), att);
}
void lcd_hlineStip(int8_t x, uint8_t y, uint8_t w, uint8_t pat, uint8_t att)
void lcd_hlineStip(int8_t x, uint8_t y, int8_t w, uint8_t pat, uint8_t att)
{
if (y >= DISPLAY_H) return;
if (w<0) { x+=w; w=-w; }
if (x<0) { w+=x; x=0; }
if (x+w > DISPLAY_W) { w = DISPLAY_W - x; }
@@ -313,13 +314,15 @@ void lcd_hlineStip(int8_t x, uint8_t y, uint8_t w, uint8_t pat, uint8_t att)
}
}
void lcd_hline(uint8_t x,uint8_t y, uint8_t w, uint8_t att)
void lcd_hline(uint8_t x,uint8_t y, int8_t w, uint8_t att)
{
lcd_hlineStip(x, y, w, 0xff, att);
}
void lcd_vlineStip(uint8_t x, int8_t y, int8_t h, uint8_t pat)
{
if (x >= DISPLAY_W) return;
if (h<0) { y+=h; h=-h; }
if (y<0) { h+=y; y=0; }
if (y+h > DISPLAY_H) { h = DISPLAY_H - y; }
+2 -2
View File
@@ -103,8 +103,8 @@ extern void putsTelemetry(uint8_t x, uint8_t y, uint8_t val, uint8_t unit, uint8
#endif
extern void lcd_plot(unsigned char x, unsigned char y, uint8_t att=0);
extern void lcd_hline(unsigned char x,unsigned char y, uint8_t w, uint8_t att=0);
extern void lcd_hlineStip(int8_t x, uint8_t y, uint8_t w, uint8_t pat, uint8_t att=0);
extern void lcd_hline(unsigned char x, unsigned char y, int8_t w, uint8_t att=0);
extern void lcd_hlineStip(int8_t x, uint8_t y, int8_t w, uint8_t pat, uint8_t att=0);
extern void lcd_vline(uint8_t x, int8_t y, int8_t h);
extern void lcd_vlineStip(uint8_t x, int8_t y, int8_t h, uint8_t pat);