[Horus] SD Storage started. UI continued.
+ Some boyscout work on LCD functions
This commit is contained in:
@@ -78,18 +78,18 @@ void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
||||
{
|
||||
lcd_outdezAtt(LCD_W, 0, count, attr);
|
||||
coord_t x = 1+LCD_W-FW*(count>9 ? 3 : 2);
|
||||
lcd_putcAtt(x, 0, '/', attr);
|
||||
lcdDrawChar(x, 0, '/', attr);
|
||||
lcd_outdezAtt(x, 0, index+1, attr);
|
||||
}
|
||||
|
||||
void lcdDrawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
||||
{
|
||||
lcd_vlineStip(x, y, h, DOTTED);
|
||||
lcdDrawVerticalLine(x, y, h, DOTTED);
|
||||
coord_t yofs = (h * offset) / count;
|
||||
coord_t yhgt = (h * visible) / count;
|
||||
if (yhgt + yofs > h)
|
||||
yhgt = h - yofs;
|
||||
lcd_vlineStip(x, y + yofs, yhgt, SOLID, FORCE);
|
||||
lcdDrawVerticalLine(x, y + yofs, yhgt, SOLID, FORCE);
|
||||
}
|
||||
|
||||
const pm_uchar MAINMENU_LBM[] PROGMEM = {
|
||||
@@ -102,14 +102,14 @@ void displayMenuBar(const MenuItem *menu, int index)
|
||||
drawFilledRect(0, 24, LCD_W, 7, SOLID, GREY_DEFAULT);
|
||||
lcd_bmp(1, 0, MAINMENU_LBM);
|
||||
lcd_putsAtt(0, 24, menu[index].name, INVERS);
|
||||
lcd_rect(index*24, 0, 26, 24, SOLID, FORCE);
|
||||
lcd_hlineStip(0, 31, LCD_W, SOLID, FORCE);
|
||||
lcdDrawRect(index*24, 0, 26, 24, SOLID, FORCE);
|
||||
lcdDrawHorizontalLine(0, 31, LCD_W, SOLID, FORCE);
|
||||
}
|
||||
|
||||
void displayProgressBar(const char *label)
|
||||
{
|
||||
lcd_putsLeft(4*FH, label);
|
||||
lcd_rect(3, 6*FH+4, 204, 7);
|
||||
lcdDrawRect(3, 6*FH+4, 204, 7);
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ void updateProgressBar(int num, int den)
|
||||
|
||||
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max)
|
||||
{
|
||||
lcd_rect(x, y, w+1, h);
|
||||
lcdDrawRect(x, y, w+1, h);
|
||||
drawFilledRect(x+1, y+1, w-1, 4, SOLID, ERASE);
|
||||
coord_t len = limit((uint8_t)1, uint8_t((abs(val) * w/2 + max/2) / max), uint8_t(w/2));
|
||||
coord_t x0 = (val>0) ? x+w/2 : x+1+w/2-len;
|
||||
@@ -188,7 +188,7 @@ int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t m
|
||||
value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, mixerCurrentFlightMode)*10 : delta);
|
||||
else
|
||||
value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, mixerCurrentFlightMode) : delta);
|
||||
eeDirty(EE_MODEL);
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
if (GV_IS_GV_VALUE(value, min, max)) {
|
||||
@@ -208,7 +208,7 @@ int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t m
|
||||
if (idx < 0) {
|
||||
value = (int16_t) GV_CALC_VALUE_IDX_NEG(idx, delta);
|
||||
idx = -idx;
|
||||
lcd_putcAtt(x-6, y, '-', attr);
|
||||
lcdDrawChar(x-6, y, '-', attr);
|
||||
}
|
||||
else {
|
||||
value = (int16_t) GV_CALC_VALUE_IDX_POS(idx-1, delta);
|
||||
|
||||
Reference in New Issue
Block a user