Some more LCD functions renamed

This commit is contained in:
Bertrand Songis
2015-11-24 22:09:22 +01:00
parent f92b71c0b8
commit 01187e60c2
53 changed files with 318 additions and 333 deletions
+20 -20
View File
@@ -120,9 +120,9 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
if (inv) plot = !plot;
if (!blink) {
if (flags & VERTICAL)
lcd_plot(y+j, LCD_H-x, plot ? FORCE : ERASE);
lcdDrawPoint(y+j, LCD_H-x, plot ? FORCE : ERASE);
else
lcd_plot(x, y+j, plot ? FORCE : ERASE);
lcdDrawPoint(x, y+j, plot ? FORCE : ERASE);
}
}
}
@@ -457,14 +457,14 @@ void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t
}
else if (smlsize) {
x -= 2;
lcd_plot(x+1, y+5);
lcdDrawPoint(x+1, y+5);
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
lcd_vline(x+1, y, 7);
}
}
else if (tinsize) {
x--;
lcd_plot(x-1, y+4);
lcdDrawPoint(x-1, y+4);
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
lcd_vline(x-1, y-1, 7);
}
@@ -489,8 +489,8 @@ void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t
lcd_vline(xn, y, 12);
lcd_vline(xn+1, y, 12);
}
lcd_hline(xn, y+9, 2);
lcd_hline(xn, y+10, 2);
lcdDrawSolidHorizontalLine(xn, y+9, 2);
lcdDrawSolidHorizontalLine(xn, y+10, 2);
}
else {
// TODO needed on CPUAVR? y &= ~0x07;
@@ -501,7 +501,7 @@ void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t
}
#endif
void lcd_hline(coord_t x, coord_t y, coord_t w, LcdFlags att)
void lcdDrawSolidHorizontalLine(coord_t x, coord_t y, coord_t w, LcdFlags att)
{
lcdDrawHorizontalLine(x, y, w, 0xff, att);
}
@@ -529,7 +529,7 @@ void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, Lc
py += sdy;
}
if ((1<<(px%8)) & pat) {
lcd_plot(px, py, att);
lcdDrawPoint(px, py, att);
}
px += sdx;
}
@@ -543,7 +543,7 @@ void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, Lc
px += sdx;
}
if ((1<<(py%8)) & pat) {
lcd_plot(px, py, att);
lcdDrawPoint(px, py, att);
}
py += sdy;
}
@@ -593,7 +593,7 @@ void lcdDrawTelemetryTopBar()
att = (timersStates[0].val<0 ? BLINK : 0);
putsTimer(17*FW+5*FWNUM+1, 0, timersStates[0].val, att, att);
}
lcd_invert_line(0);
lcdInvertLine(0);
}
#if defined(CPUARM) && defined(RTCLOCK)
@@ -824,7 +824,7 @@ void displayGpsCoord(coord_t x, coord_t y, char direction, int16_t bp, int16_t a
if (seconds) {
uint16_t ss = ap * 6 / 10;
lcd_outdezNAtt(lcdLastPos+3, y, ss / 100, att|LEFT|LEADING0, 2); // ''
lcd_plot(lcdLastPos, y+FH-2, 0); // small decimal point
lcdDrawPoint(lcdLastPos, y+FH-2, 0); // small decimal point
lcd_outdezNAtt(lcdLastPos+2, y, ss % 100, att|LEFT|LEADING0, 2); // ''
lcd_vline(lcdLastPos, y, 2);
lcd_vline(lcdLastPos+2, y, 2);
@@ -833,7 +833,7 @@ void displayGpsCoord(coord_t x, coord_t y, char direction, int16_t bp, int16_t a
}
else {
lcd_outdezNAtt(lcdLastPos+FW, y, mn, att|LEFT|LEADING0, 2); // mm before '.'
lcd_plot(lcdLastPos, y+FH-2, 0); // small decimal point
lcdDrawPoint(lcdLastPos, y+FH-2, 0); // small decimal point
lcd_outdezNAtt(lcdLastPos+2, y, ap, att|LEFT|UNSIGN|LEADING0, 4); // after '.'
lcd_putc(lcdLastPos+1, y, direction);
}
@@ -1262,7 +1262,7 @@ void lcdDrawChar(coord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
}
#endif
void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att)
void lcdMaskPoint(uint8_t *p, uint8_t mask, LcdFlags att)
{
ASSERT_IN_DISPLAY(p);
@@ -1274,11 +1274,11 @@ void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att)
*p ^= mask;
}
void lcd_plot(coord_t x, coord_t y, LcdFlags att)
void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att)
{
uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ];
if (p<DISPLAY_END)
lcd_mask(p, BITMASK(y%8), att);
lcdMaskPoint(p, BITMASK(y%8), att);
}
void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att)
@@ -1290,7 +1290,7 @@ void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlag
uint8_t msk = BITMASK(y%8);
while (w--) {
if(pat&1) {
lcd_mask(p, msk, att);
lcdMaskPoint(p, msk, att);
pat = (pat >> 1) | 0x80;
}
else {
@@ -1357,23 +1357,23 @@ void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlag
h -= 8-y;
if (h < 0)
msk -= ~(BITMASK(8+h)-1);
lcd_mask(p, msk & pat, att);
lcdMaskPoint(p, msk & pat, att);
p += LCD_W;
}
while (h>=8) {
ASSERT_IN_DISPLAY(p);
lcd_mask(p, pat, att);
lcdMaskPoint(p, pat, att);
p += LCD_W;
h -= 8;
}
if (h>0) {
ASSERT_IN_DISPLAY(p);
lcd_mask(p, (BITMASK(h)-1) & pat, att);
lcdMaskPoint(p, (BITMASK(h)-1) & pat, att);
}
}
#endif
void lcd_invert_line(int8_t y)
void lcdInvertLine(int8_t y)
{
uint8_t *p = &displayBuf[y * LCD_W];
for (coord_t x=0; x<LCD_W; x++) {
+6 -6
View File
@@ -223,9 +223,9 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
#define SOLID 0xff
#define DOTTED 0x55
void lcd_plot(coord_t x, coord_t y, LcdFlags att=0);
void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att=0);
void lcd_hline(coord_t x, coord_t y, coord_t w, LcdFlags att=0);
void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att=0);
void lcdMaskPoint(uint8_t *p, uint8_t mask, LcdFlags att=0);
void lcdDrawSolidHorizontalLine(coord_t x, coord_t y, coord_t w, LcdFlags att=0);
void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att=0);
void lcd_vline(coord_t x, scoord_t y, scoord_t h);
#if defined(CPUM64)
@@ -241,9 +241,9 @@ void lcd_vline(coord_t x, scoord_t y, scoord_t h);
void drawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
void lcd_invert_line(int8_t line);
#define lcd_status_line() lcd_invert_line(LCD_LINES-1)
inline void lcd_square(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcdDrawRect(x, y, w, w, SOLID, att); }
void lcdInvertLine(int8_t line);
#define lcdInvertLastLine() lcdInvertLine(LCD_LINES-1)
inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcdDrawRect(x, y, w, w, SOLID, att); }
void lcdDrawTelemetryTopBar();
+1 -1
View File
@@ -136,7 +136,7 @@ void menuFirstCalib(uint8_t event)
}
else {
lcd_putsCenter(0*FH, MENUCALIBRATION);
lcd_invert_line(0);
lcdInvertLine(0);
menuCommonCalib(event);
}
}
+1 -1
View File
@@ -281,6 +281,6 @@ void menuModelFlightModesAll(uint8_t event)
lcd_putsLeft((LCD_LINES-1)*FH+1, STR_CHECKTRIMS);
putsFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, mixerCurrentFlightMode+1);
if (sub==MAX_FLIGHT_MODES && !trimsCheckTimer) {
lcd_status_line();
lcdInvertLastLine();
}
}
+6 -6
View File
@@ -93,7 +93,7 @@ void drawFunction(FnFuncP fn, uint8_t offset)
coord_t yv = (LCD_H-1) - (((uint16_t)RESX + fn(xv * (RESX/WCHART))) / 2 * (LCD_H-1) / RESX);
if (prev_yv != (coord_t)-1) {
if (abs((int8_t)yv-prev_yv) <= 1) {
lcd_plot(X0+xv-offset-1, prev_yv, FORCE);
lcdDrawPoint(X0+xv-offset-1, prev_yv, FORCE);
}
else {
uint8_t tmp = (prev_yv < yv ? 0 : 1);
@@ -384,7 +384,7 @@ void menuModelExpoOne(uint8_t event)
#endif
lcd_vline(x512, y512-3, 3*2+1);
lcd_hline(x512-3, y512, 3*2+1);
lcdDrawSolidHorizontalLine(x512-3, y512, 3*2+1);
}
enum MixFields {
@@ -447,14 +447,14 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
lcd_vline(x+GAUGE_WIDTH/2-1, y, GAUGE_HEIGHT+1);
if (barMin == -101) {
for (uint8_t i=0; i<3; ++i) {
lcd_plot(x+i, y+4-i);
lcd_plot(x+3+i, y+4-i);
lcdDrawPoint(x+i, y+4-i);
lcdDrawPoint(x+3+i, y+4-i);
}
}
if (barMax == 101) {
for (uint8_t i=0; i<3; ++i) {
lcd_plot(x+GAUGE_WIDTH-8+i, y+4-i);
lcd_plot(x+GAUGE_WIDTH-5+i, y+4-i);
lcdDrawPoint(x+GAUGE_WIDTH-8+i, y+4-i);
lcdDrawPoint(x+GAUGE_WIDTH-5+i, y+4-i);
}
}
}
+5 -5
View File
@@ -835,7 +835,7 @@ void menuModelFailsafe(uint8_t event)
ch = 8 * (m_posVert / 8);
lcd_putsCenter(0*FH, FAILSAFESET);
lcd_invert_line(0);
lcdInvertLine(0);
uint8_t col = 0;
@@ -880,10 +880,10 @@ void menuModelFailsafe(uint8_t event)
uint16_t lim = g_model.extendedLimits ? 640*2 : 512*2;
uint8_t len = limit((uint8_t)1, uint8_t((abs(val) * wbar/2 + lim/2) / lim), uint8_t(wbar/2));
coord_t x0 = (val>0) ? x+COL_W-ofs-3-wbar/2 : x+COL_W-ofs-2-wbar/2-len;
lcd_hline(x0, y+1, len);
lcd_hline(x0, y+2, len);
lcd_hline(x0, y+3, len);
lcd_hline(x0, y+4, len);
lcdDrawSolidHorizontalLine(x0, y+1, len);
lcdDrawSolidHorizontalLine(x0, y+2, len);
lcdDrawSolidHorizontalLine(x0, y+3, len);
lcdDrawSolidHorizontalLine(x0, y+4, len);
ch++;
}
+1 -1
View File
@@ -83,7 +83,7 @@ void menuAboutView(uint8_t event)
}
lcdDrawText(17, 0, STR_ABOUTUS, DBLSIZE|INVERS);
lcd_hline(17, 16, LCD_W-17);
lcdDrawSolidHorizontalLine(17, 16, LCD_W-17);
lcd_img(8, 0, about_bmp, 0);
LcdFlags att = 0;
+11 -11
View File
@@ -126,13 +126,13 @@ void displayTrims(uint8_t phase)
#if !defined(CPUM64) || !defined(FRSKY)
drawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
if (dir >= 0) {
lcd_hline(xm-1, ym-1, 3);
lcdDrawSolidHorizontalLine(xm-1, ym-1, 3);
}
if (dir <= 0) {
lcd_hline(xm-1, ym+1, 3);
lcdDrawSolidHorizontalLine(xm-1, ym+1, 3);
}
if (exttrim) {
lcd_hline(xm-1, ym, 3);
lcdDrawSolidHorizontalLine(xm-1, ym, 3);
}
#endif
#if defined(CPUARM)
@@ -145,9 +145,9 @@ void displayTrims(uint8_t phase)
}
else {
ym = 60;
lcd_hline(xm-TRIM_LEN, ym, TRIM_LEN*2);
lcd_hline(xm-1, ym-1, 3);
lcd_hline(xm-1, ym+1, 3);
lcdDrawSolidHorizontalLine(xm-TRIM_LEN, ym, TRIM_LEN*2);
lcdDrawSolidHorizontalLine(xm-1, ym-1, 3);
lcdDrawSolidHorizontalLine(xm-1, ym+1, 3);
xm += val;
#if !defined(CPUM64) || !defined(FRSKY)
drawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
@@ -169,7 +169,7 @@ void displayTrims(uint8_t phase)
}
#endif
}
lcd_square(xm-3, ym-3, 7, att);
lcdDrawSquare(xm-3, ym-3, 7, att);
}
}
@@ -453,9 +453,9 @@ void menuMainView(uint8_t event)
// scroll bar
lcdDrawHorizontalLine(38, 34, 54, DOTTED);
#if defined(PCBSKY9X)
lcd_hline(38 + (g_eeGeneral.view / ALTERNATE_VIEW) * 13, 34, 13, SOLID);
lcdDrawSolidHorizontalLine(38 + (g_eeGeneral.view / ALTERNATE_VIEW) * 13, 34, 13, SOLID);
#else
lcd_hline((g_eeGeneral.view & ALTERNATE_VIEW) ? 64 : 38, 34, 26, SOLID);
lcdDrawSolidHorizontalLine((g_eeGeneral.view & ALTERNATE_VIEW) ? 64 : 38, 34, 26, SOLID);
#endif
for (uint8_t i=0; i<8; i++) {
@@ -497,8 +497,8 @@ void menuMainView(uint8_t event)
x0+=1;
else
x0-=len;
lcd_hline(x0,y0+1,len);
lcd_hline(x0,y0-1,len);
lcdDrawSolidHorizontalLine(x0,y0+1,len);
lcdDrawSolidHorizontalLine(x0,y0-1,len);
break;
}
}
+2 -2
View File
@@ -72,7 +72,7 @@ void menuStatisticsView(uint8_t event)
coord_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0);
const coord_t x = 5;
const coord_t y = 60;
lcd_hline(x-3, y, MAXTRACE+3+3);
lcdDrawSolidHorizontalLine(x-3, y, MAXTRACE+3+3);
lcd_vline(x, y-32, 32+3);
for (coord_t i=0; i<MAXTRACE; i+=6) {
@@ -217,5 +217,5 @@ void menuStatisticsDebug(uint8_t event)
#endif
lcd_puts(4*FW, 7*FH+1, STR_MENUTORESET);
lcd_status_line();
lcdInvertLastLine();
}
+8 -8
View File
@@ -51,7 +51,7 @@ uint8_t s_frsky_view = 0;
void displayRssiLine()
{
if (TELEMETRY_STREAMING()) {
lcd_hline(0, 55, 128, 0); // separator
lcdDrawSolidHorizontalLine(0, 55, 128, 0); // separator
uint8_t rssi;
#if !defined(CPUARM)
rssi = min((uint8_t)99, frskyData.rssi[1].value);
@@ -67,7 +67,7 @@ void displayRssiLine()
}
else {
lcdDrawText(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
lcd_status_line();
lcdInvertLastLine();
}
}
@@ -80,7 +80,7 @@ void displayGpsTime()
lcd_outdezNAtt(CENTER_OFS+9*FW+2, STATUS_BAR_Y, frskyData.hub.min, att, 2);
lcdDrawChar(CENTER_OFS+11*FW-1, STATUS_BAR_Y, ':', att);
lcd_outdezNAtt(CENTER_OFS+12*FW-3, STATUS_BAR_Y, frskyData.hub.sec, att, 2);
lcd_status_line();
lcdInvertLastLine();
}
void displayGpsCoord(uint8_t y, char direction, int16_t bp, int16_t ap)
@@ -96,14 +96,14 @@ void displayGpsCoord(uint8_t y, char direction, int16_t bp, int16_t ap)
lcd_vline(lcdLastPos, y, 2);
uint16_t ss = ap * 6;
lcd_outdezNAtt(lcdLastPos+3, y, ss / 1000, LEFT|LEADING0, 2); // ''
lcd_plot(lcdLastPos, y+FH-2, 0); // small decimal point
lcdDrawPoint(lcdLastPos, y+FH-2, 0); // small decimal point
lcd_outdezNAtt(lcdLastPos+2, y, ss % 1000, LEFT|LEADING0, 3); // ''
lcd_vline(lcdLastPos, y, 2);
lcd_vline(lcdLastPos+2, y, 2);
}
else {
lcd_outdezNAtt(lcdLastPos+FW, y, mn, LEFT|LEADING0, 2); // mm before '.'
lcd_plot(lcdLastPos, y+FH-2, 0); // small decimal point
lcdDrawPoint(lcdLastPos, y+FH-2, 0); // small decimal point
lcd_outdezNAtt(lcdLastPos+2, y, ap, LEFT|UNSIGN|LEADING0, 4); // after '.'
lcd_putc(lcdLastPos+1, y, direction);
}
@@ -315,7 +315,7 @@ bool displayGaugesTelemetryScreen(FrSkyScreenData & screen)
if (thresholdX) {
lcdDrawVerticalLine(BAR_LEFT+1+thresholdX, y-2, barHeight+3, DOTTED);
lcd_hline(BAR_LEFT+thresholdX, y-2, 3);
lcdDrawSolidHorizontalLine(BAR_LEFT+thresholdX, y-2, 3);
}
}
else {
@@ -373,7 +373,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
}
}
}
lcd_status_line();
lcdInvertLastLine();
return fields_count;
}
#else
@@ -426,7 +426,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
}
}
}
lcd_status_line();
lcdInvertLastLine();
return fields_count;
}
#endif
+1 -1
View File
@@ -148,7 +148,7 @@ void menuTextView(uint8_t event)
// TODO?
#endif
lcd_puts(LCD_W/2-strlen(title)*FW/2, 0, title);
lcd_invert_line(0);
lcdInvertLine(0);
if (lines_count > LCD_LINES-1) {
drawVerticalScrollbar(LCD_W-1, FH, LCD_H-FH, s_pgOfs, lines_count, LCD_LINES-1);
+6 -6
View File
@@ -40,10 +40,10 @@ void drawStick(coord_t centrex, int16_t xval, int16_t yval)
{
#define BOX_CENTERY (LCD_H-9-BOX_WIDTH/2)
#define MARKER_WIDTH 5
lcd_square(centrex-BOX_WIDTH/2, BOX_CENTERY-BOX_WIDTH/2, BOX_WIDTH);
lcdDrawSquare(centrex-BOX_WIDTH/2, BOX_CENTERY-BOX_WIDTH/2, BOX_WIDTH);
lcd_vline(centrex, BOX_CENTERY-1, 3);
lcd_hline(centrex-1, BOX_CENTERY, 3);
lcd_square(centrex + (xval/((2*RESX)/(BOX_WIDTH-MARKER_WIDTH))) - MARKER_WIDTH/2, BOX_CENTERY - (yval/((2*RESX)/(BOX_WIDTH-MARKER_WIDTH))) - MARKER_WIDTH/2, MARKER_WIDTH, ROUND);
lcdDrawSolidHorizontalLine(centrex-1, BOX_CENTERY, 3);
lcdDrawSquare(centrex + (xval/((2*RESX)/(BOX_WIDTH-MARKER_WIDTH))) - MARKER_WIDTH/2, BOX_CENTERY - (yval/((2*RESX)/(BOX_WIDTH-MARKER_WIDTH))) - MARKER_WIDTH/2, MARKER_WIDTH, ROUND);
#undef BOX_CENTERY
#undef MARKER_WIDTH
}
@@ -56,7 +56,7 @@ void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
if (attr)
drawFilledRect(x, y, 7, 7);
else
lcd_square(x, y, 7);
lcdDrawSquare(x, y, 7);
#else
/* ON / OFF version */
lcdDrawTextAtIndex(x, y, STR_OFFON, value, attr ? INVERS:0) ;
@@ -118,14 +118,14 @@ int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, uint8_t
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
{
lcd_putc(x+(value*4*FW)/max, y, '$');
lcd_hline(x, y+3, 5*FW-1, FORCE);
lcdDrawSolidHorizontalLine(x, y+3, 5*FW-1, FORCE);
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) drawFilledRect(x, y, 5*FW-1, FH-1);
}
#elif defined(GRAPHICS)
void display5posSlider(coord_t x, coord_t y, uint8_t value, uint8_t attr)
{
lcd_putc(x+2*FW+(value*FW), y, '$');
lcd_hline(x, y+3, 5*FW-1, SOLID);
lcdDrawSolidHorizontalLine(x, y+3, 5*FW-1, SOLID);
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) drawFilledRect(x, y, 5*FW-1, FH-1);
}
#endif