mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 20:35:17 +03:00
Some more LCD functions renamed
This commit is contained in:
parent
f92b71c0b8
commit
01187e60c2
53 changed files with 318 additions and 333 deletions
|
@ -1156,7 +1156,7 @@ ifeq ($(PCB), FLAMENCO)
|
||||||
endif
|
endif
|
||||||
CPPDEFS += -DLUA
|
CPPDEFS += -DLUA
|
||||||
INCDIRS += $(LUADIR)
|
INCDIRS += $(LUADIR)
|
||||||
CPPSRC += lua_api.cpp
|
CPPSRC += lua/interface.cpp lua/api_general.cpp lua/api_lcd.cpp lua/api_model.cpp
|
||||||
LUASRC = $(LUADIR)/lapi.c $(LUADIR)/lcode.c $(LUADIR)/lctype.c $(LUADIR)/ldebug.c $(LUADIR)/ldo.c $(LUADIR)/ldump.c $(LUADIR)/lfunc.c $(LUADIR)/lgc.c $(LUADIR)/llex.c $(LUADIR)/lmem.c \
|
LUASRC = $(LUADIR)/lapi.c $(LUADIR)/lcode.c $(LUADIR)/lctype.c $(LUADIR)/ldebug.c $(LUADIR)/ldo.c $(LUADIR)/ldump.c $(LUADIR)/lfunc.c $(LUADIR)/lgc.c $(LUADIR)/llex.c $(LUADIR)/lmem.c \
|
||||||
$(LUADIR)/lobject.c $(LUADIR)/lopcodes.c $(LUADIR)/lparser.c $(LUADIR)/lstate.c $(LUADIR)/lstring.c $(LUADIR)/ltable.c $(LUADIR)/lrotable.c $(LUADIR)/ltm.c $(LUADIR)/lundump.c $(LUADIR)/lvm.c $(LUADIR)/lzio.c \
|
$(LUADIR)/lobject.c $(LUADIR)/lopcodes.c $(LUADIR)/lparser.c $(LUADIR)/lstate.c $(LUADIR)/lstring.c $(LUADIR)/ltable.c $(LUADIR)/lrotable.c $(LUADIR)/ltm.c $(LUADIR)/lundump.c $(LUADIR)/lvm.c $(LUADIR)/lzio.c \
|
||||||
$(LUADIR)/lbaselib.c $(LUADIR)/linit.c $(LUADIR)/lmathlib.c $(LUADIR)/lbitlib.c $(LUADIR)/loadlib.c $(LUADIR)/lauxlib.c $(LUADIR)/ltablib.c $(LUADIR)/lcorolib.c $(LUADIR)/liolib.c
|
$(LUADIR)/lbaselib.c $(LUADIR)/linit.c $(LUADIR)/lmathlib.c $(LUADIR)/lbitlib.c $(LUADIR)/loadlib.c $(LUADIR)/lauxlib.c $(LUADIR)/ltablib.c $(LUADIR)/lcorolib.c $(LUADIR)/liolib.c
|
||||||
|
@ -1286,7 +1286,7 @@ ifeq ($(PCB), HORUS)
|
||||||
endif
|
endif
|
||||||
CPPDEFS += -DLUA
|
CPPDEFS += -DLUA
|
||||||
INCDIRS += $(LUADIR)
|
INCDIRS += $(LUADIR)
|
||||||
CPPSRC += lua_api.cpp
|
CPPSRC += lua/interface.cpp lua/api_general.cpp lua/api_lcd.cpp lua/api_model.cpp
|
||||||
LUASRC = $(LUADIR)/lapi.c $(LUADIR)/lcode.c $(LUADIR)/lctype.c $(LUADIR)/ldebug.c $(LUADIR)/ldo.c $(LUADIR)/ldump.c $(LUADIR)/lfunc.c $(LUADIR)/lgc.c $(LUADIR)/llex.c $(LUADIR)/lmem.c \
|
LUASRC = $(LUADIR)/lapi.c $(LUADIR)/lcode.c $(LUADIR)/lctype.c $(LUADIR)/ldebug.c $(LUADIR)/ldo.c $(LUADIR)/ldump.c $(LUADIR)/lfunc.c $(LUADIR)/lgc.c $(LUADIR)/llex.c $(LUADIR)/lmem.c \
|
||||||
$(LUADIR)/lobject.c $(LUADIR)/lopcodes.c $(LUADIR)/lparser.c $(LUADIR)/lstate.c $(LUADIR)/lstring.c $(LUADIR)/ltable.c $(LUADIR)/lrotable.c $(LUADIR)/ltm.c $(LUADIR)/lundump.c $(LUADIR)/lvm.c $(LUADIR)/lzio.c \
|
$(LUADIR)/lobject.c $(LUADIR)/lopcodes.c $(LUADIR)/lparser.c $(LUADIR)/lstate.c $(LUADIR)/lstring.c $(LUADIR)/ltable.c $(LUADIR)/lrotable.c $(LUADIR)/ltm.c $(LUADIR)/lundump.c $(LUADIR)/lvm.c $(LUADIR)/lzio.c \
|
||||||
$(LUADIR)/lbaselib.c $(LUADIR)/linit.c $(LUADIR)/lmathlib.c $(LUADIR)/lbitlib.c $(LUADIR)/loadlib.c $(LUADIR)/lauxlib.c $(LUADIR)/ltablib.c $(LUADIR)/lcorolib.c $(LUADIR)/liolib.c
|
$(LUADIR)/lbaselib.c $(LUADIR)/linit.c $(LUADIR)/lmathlib.c $(LUADIR)/lbitlib.c $(LUADIR)/loadlib.c $(LUADIR)/lauxlib.c $(LUADIR)/ltablib.c $(LUADIR)/lcorolib.c $(LUADIR)/liolib.c
|
||||||
|
|
|
@ -120,9 +120,9 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
|
||||||
if (inv) plot = !plot;
|
if (inv) plot = !plot;
|
||||||
if (!blink) {
|
if (!blink) {
|
||||||
if (flags & VERTICAL)
|
if (flags & VERTICAL)
|
||||||
lcd_plot(y+j, LCD_H-x, plot ? FORCE : ERASE);
|
lcdDrawPoint(y+j, LCD_H-x, plot ? FORCE : ERASE);
|
||||||
else
|
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) {
|
else if (smlsize) {
|
||||||
x -= 2;
|
x -= 2;
|
||||||
lcd_plot(x+1, y+5);
|
lcdDrawPoint(x+1, y+5);
|
||||||
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
||||||
lcd_vline(x+1, y, 7);
|
lcd_vline(x+1, y, 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tinsize) {
|
else if (tinsize) {
|
||||||
x--;
|
x--;
|
||||||
lcd_plot(x-1, y+4);
|
lcdDrawPoint(x-1, y+4);
|
||||||
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
||||||
lcd_vline(x-1, y-1, 7);
|
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, y, 12);
|
||||||
lcd_vline(xn+1, y, 12);
|
lcd_vline(xn+1, y, 12);
|
||||||
}
|
}
|
||||||
lcd_hline(xn, y+9, 2);
|
lcdDrawSolidHorizontalLine(xn, y+9, 2);
|
||||||
lcd_hline(xn, y+10, 2);
|
lcdDrawSolidHorizontalLine(xn, y+10, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// TODO needed on CPUAVR? y &= ~0x07;
|
// 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
|
#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);
|
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;
|
py += sdy;
|
||||||
}
|
}
|
||||||
if ((1<<(px%8)) & pat) {
|
if ((1<<(px%8)) & pat) {
|
||||||
lcd_plot(px, py, att);
|
lcdDrawPoint(px, py, att);
|
||||||
}
|
}
|
||||||
px += sdx;
|
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;
|
px += sdx;
|
||||||
}
|
}
|
||||||
if ((1<<(py%8)) & pat) {
|
if ((1<<(py%8)) & pat) {
|
||||||
lcd_plot(px, py, att);
|
lcdDrawPoint(px, py, att);
|
||||||
}
|
}
|
||||||
py += sdy;
|
py += sdy;
|
||||||
}
|
}
|
||||||
|
@ -593,7 +593,7 @@ void lcdDrawTelemetryTopBar()
|
||||||
att = (timersStates[0].val<0 ? BLINK : 0);
|
att = (timersStates[0].val<0 ? BLINK : 0);
|
||||||
putsTimer(17*FW+5*FWNUM+1, 0, timersStates[0].val, att, att);
|
putsTimer(17*FW+5*FWNUM+1, 0, timersStates[0].val, att, att);
|
||||||
}
|
}
|
||||||
lcd_invert_line(0);
|
lcdInvertLine(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CPUARM) && defined(RTCLOCK)
|
#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) {
|
if (seconds) {
|
||||||
uint16_t ss = ap * 6 / 10;
|
uint16_t ss = ap * 6 / 10;
|
||||||
lcd_outdezNAtt(lcdLastPos+3, y, ss / 100, att|LEFT|LEADING0, 2); // ''
|
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_outdezNAtt(lcdLastPos+2, y, ss % 100, att|LEFT|LEADING0, 2); // ''
|
||||||
lcd_vline(lcdLastPos, y, 2);
|
lcd_vline(lcdLastPos, y, 2);
|
||||||
lcd_vline(lcdLastPos+2, 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 {
|
else {
|
||||||
lcd_outdezNAtt(lcdLastPos+FW, y, mn, att|LEFT|LEADING0, 2); // mm before '.'
|
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_outdezNAtt(lcdLastPos+2, y, ap, att|LEFT|UNSIGN|LEADING0, 4); // after '.'
|
||||||
lcd_putc(lcdLastPos+1, y, direction);
|
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
|
#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);
|
ASSERT_IN_DISPLAY(p);
|
||||||
|
|
||||||
|
@ -1274,11 +1274,11 @@ void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att)
|
||||||
*p ^= mask;
|
*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 ];
|
uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ];
|
||||||
if (p<DISPLAY_END)
|
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)
|
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);
|
uint8_t msk = BITMASK(y%8);
|
||||||
while (w--) {
|
while (w--) {
|
||||||
if(pat&1) {
|
if(pat&1) {
|
||||||
lcd_mask(p, msk, att);
|
lcdMaskPoint(p, msk, att);
|
||||||
pat = (pat >> 1) | 0x80;
|
pat = (pat >> 1) | 0x80;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1357,23 +1357,23 @@ void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlag
|
||||||
h -= 8-y;
|
h -= 8-y;
|
||||||
if (h < 0)
|
if (h < 0)
|
||||||
msk -= ~(BITMASK(8+h)-1);
|
msk -= ~(BITMASK(8+h)-1);
|
||||||
lcd_mask(p, msk & pat, att);
|
lcdMaskPoint(p, msk & pat, att);
|
||||||
p += LCD_W;
|
p += LCD_W;
|
||||||
}
|
}
|
||||||
while (h>=8) {
|
while (h>=8) {
|
||||||
ASSERT_IN_DISPLAY(p);
|
ASSERT_IN_DISPLAY(p);
|
||||||
lcd_mask(p, pat, att);
|
lcdMaskPoint(p, pat, att);
|
||||||
p += LCD_W;
|
p += LCD_W;
|
||||||
h -= 8;
|
h -= 8;
|
||||||
}
|
}
|
||||||
if (h>0) {
|
if (h>0) {
|
||||||
ASSERT_IN_DISPLAY(p);
|
ASSERT_IN_DISPLAY(p);
|
||||||
lcd_mask(p, (BITMASK(h)-1) & pat, att);
|
lcdMaskPoint(p, (BITMASK(h)-1) & pat, att);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lcd_invert_line(int8_t y)
|
void lcdInvertLine(int8_t y)
|
||||||
{
|
{
|
||||||
uint8_t *p = &displayBuf[y * LCD_W];
|
uint8_t *p = &displayBuf[y * LCD_W];
|
||||||
for (coord_t x=0; x<LCD_W; x++) {
|
for (coord_t x=0; x<LCD_W; x++) {
|
||||||
|
|
|
@ -223,9 +223,9 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||||
#define SOLID 0xff
|
#define SOLID 0xff
|
||||||
#define DOTTED 0x55
|
#define DOTTED 0x55
|
||||||
|
|
||||||
void lcd_plot(coord_t x, coord_t y, LcdFlags att=0);
|
void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att=0);
|
||||||
void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att=0);
|
void lcdMaskPoint(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 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 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);
|
void lcd_vline(coord_t x, scoord_t y, scoord_t h);
|
||||||
#if defined(CPUM64)
|
#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 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 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);
|
void lcdInvertLine(int8_t line);
|
||||||
#define lcd_status_line() lcd_invert_line(LCD_LINES-1)
|
#define lcdInvertLastLine() lcdInvertLine(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); }
|
inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcdDrawRect(x, y, w, w, SOLID, att); }
|
||||||
|
|
||||||
void lcdDrawTelemetryTopBar();
|
void lcdDrawTelemetryTopBar();
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ void menuFirstCalib(uint8_t event)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcd_putsCenter(0*FH, MENUCALIBRATION);
|
lcd_putsCenter(0*FH, MENUCALIBRATION);
|
||||||
lcd_invert_line(0);
|
lcdInvertLine(0);
|
||||||
menuCommonCalib(event);
|
menuCommonCalib(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,6 +281,6 @@ void menuModelFlightModesAll(uint8_t event)
|
||||||
lcd_putsLeft((LCD_LINES-1)*FH+1, STR_CHECKTRIMS);
|
lcd_putsLeft((LCD_LINES-1)*FH+1, STR_CHECKTRIMS);
|
||||||
putsFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, mixerCurrentFlightMode+1);
|
putsFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, mixerCurrentFlightMode+1);
|
||||||
if (sub==MAX_FLIGHT_MODES && !trimsCheckTimer) {
|
if (sub==MAX_FLIGHT_MODES && !trimsCheckTimer) {
|
||||||
lcd_status_line();
|
lcdInvertLastLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
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 (prev_yv != (coord_t)-1) {
|
||||||
if (abs((int8_t)yv-prev_yv) <= 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 {
|
else {
|
||||||
uint8_t tmp = (prev_yv < yv ? 0 : 1);
|
uint8_t tmp = (prev_yv < yv ? 0 : 1);
|
||||||
|
@ -384,7 +384,7 @@ void menuModelExpoOne(uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lcd_vline(x512, y512-3, 3*2+1);
|
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 {
|
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);
|
lcd_vline(x+GAUGE_WIDTH/2-1, y, GAUGE_HEIGHT+1);
|
||||||
if (barMin == -101) {
|
if (barMin == -101) {
|
||||||
for (uint8_t i=0; i<3; ++i) {
|
for (uint8_t i=0; i<3; ++i) {
|
||||||
lcd_plot(x+i, y+4-i);
|
lcdDrawPoint(x+i, y+4-i);
|
||||||
lcd_plot(x+3+i, y+4-i);
|
lcdDrawPoint(x+3+i, y+4-i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (barMax == 101) {
|
if (barMax == 101) {
|
||||||
for (uint8_t i=0; i<3; ++i) {
|
for (uint8_t i=0; i<3; ++i) {
|
||||||
lcd_plot(x+GAUGE_WIDTH-8+i, y+4-i);
|
lcdDrawPoint(x+GAUGE_WIDTH-8+i, y+4-i);
|
||||||
lcd_plot(x+GAUGE_WIDTH-5+i, y+4-i);
|
lcdDrawPoint(x+GAUGE_WIDTH-5+i, y+4-i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -835,7 +835,7 @@ void menuModelFailsafe(uint8_t event)
|
||||||
ch = 8 * (m_posVert / 8);
|
ch = 8 * (m_posVert / 8);
|
||||||
|
|
||||||
lcd_putsCenter(0*FH, FAILSAFESET);
|
lcd_putsCenter(0*FH, FAILSAFESET);
|
||||||
lcd_invert_line(0);
|
lcdInvertLine(0);
|
||||||
|
|
||||||
uint8_t col = 0;
|
uint8_t col = 0;
|
||||||
|
|
||||||
|
@ -880,10 +880,10 @@ void menuModelFailsafe(uint8_t event)
|
||||||
uint16_t lim = g_model.extendedLimits ? 640*2 : 512*2;
|
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));
|
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;
|
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);
|
lcdDrawSolidHorizontalLine(x0, y+1, len);
|
||||||
lcd_hline(x0, y+2, len);
|
lcdDrawSolidHorizontalLine(x0, y+2, len);
|
||||||
lcd_hline(x0, y+3, len);
|
lcdDrawSolidHorizontalLine(x0, y+3, len);
|
||||||
lcd_hline(x0, y+4, len);
|
lcdDrawSolidHorizontalLine(x0, y+4, len);
|
||||||
|
|
||||||
ch++;
|
ch++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ void menuAboutView(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
lcdDrawText(17, 0, STR_ABOUTUS, DBLSIZE|INVERS);
|
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);
|
lcd_img(8, 0, about_bmp, 0);
|
||||||
LcdFlags att = 0;
|
LcdFlags att = 0;
|
||||||
|
|
||||||
|
|
|
@ -126,13 +126,13 @@ void displayTrims(uint8_t phase)
|
||||||
#if !defined(CPUM64) || !defined(FRSKY)
|
#if !defined(CPUM64) || !defined(FRSKY)
|
||||||
drawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
|
drawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
|
||||||
if (dir >= 0) {
|
if (dir >= 0) {
|
||||||
lcd_hline(xm-1, ym-1, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym-1, 3);
|
||||||
}
|
}
|
||||||
if (dir <= 0) {
|
if (dir <= 0) {
|
||||||
lcd_hline(xm-1, ym+1, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym+1, 3);
|
||||||
}
|
}
|
||||||
if (exttrim) {
|
if (exttrim) {
|
||||||
lcd_hline(xm-1, ym, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym, 3);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
|
@ -145,9 +145,9 @@ void displayTrims(uint8_t phase)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ym = 60;
|
ym = 60;
|
||||||
lcd_hline(xm-TRIM_LEN, ym, TRIM_LEN*2);
|
lcdDrawSolidHorizontalLine(xm-TRIM_LEN, ym, TRIM_LEN*2);
|
||||||
lcd_hline(xm-1, ym-1, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym-1, 3);
|
||||||
lcd_hline(xm-1, ym+1, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym+1, 3);
|
||||||
xm += val;
|
xm += val;
|
||||||
#if !defined(CPUM64) || !defined(FRSKY)
|
#if !defined(CPUM64) || !defined(FRSKY)
|
||||||
drawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
|
drawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
|
||||||
|
@ -169,7 +169,7 @@ void displayTrims(uint8_t phase)
|
||||||
}
|
}
|
||||||
#endif
|
#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
|
// scroll bar
|
||||||
lcdDrawHorizontalLine(38, 34, 54, DOTTED);
|
lcdDrawHorizontalLine(38, 34, 54, DOTTED);
|
||||||
#if defined(PCBSKY9X)
|
#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
|
#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
|
#endif
|
||||||
|
|
||||||
for (uint8_t i=0; i<8; i++) {
|
for (uint8_t i=0; i<8; i++) {
|
||||||
|
@ -497,8 +497,8 @@ void menuMainView(uint8_t event)
|
||||||
x0+=1;
|
x0+=1;
|
||||||
else
|
else
|
||||||
x0-=len;
|
x0-=len;
|
||||||
lcd_hline(x0,y0+1,len);
|
lcdDrawSolidHorizontalLine(x0,y0+1,len);
|
||||||
lcd_hline(x0,y0-1,len);
|
lcdDrawSolidHorizontalLine(x0,y0-1,len);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ void menuStatisticsView(uint8_t event)
|
||||||
coord_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0);
|
coord_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0);
|
||||||
const coord_t x = 5;
|
const coord_t x = 5;
|
||||||
const coord_t y = 60;
|
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);
|
lcd_vline(x, y-32, 32+3);
|
||||||
|
|
||||||
for (coord_t i=0; i<MAXTRACE; i+=6) {
|
for (coord_t i=0; i<MAXTRACE; i+=6) {
|
||||||
|
@ -217,5 +217,5 @@ void menuStatisticsDebug(uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lcd_puts(4*FW, 7*FH+1, STR_MENUTORESET);
|
lcd_puts(4*FW, 7*FH+1, STR_MENUTORESET);
|
||||||
lcd_status_line();
|
lcdInvertLastLine();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ uint8_t s_frsky_view = 0;
|
||||||
void displayRssiLine()
|
void displayRssiLine()
|
||||||
{
|
{
|
||||||
if (TELEMETRY_STREAMING()) {
|
if (TELEMETRY_STREAMING()) {
|
||||||
lcd_hline(0, 55, 128, 0); // separator
|
lcdDrawSolidHorizontalLine(0, 55, 128, 0); // separator
|
||||||
uint8_t rssi;
|
uint8_t rssi;
|
||||||
#if !defined(CPUARM)
|
#if !defined(CPUARM)
|
||||||
rssi = min((uint8_t)99, frskyData.rssi[1].value);
|
rssi = min((uint8_t)99, frskyData.rssi[1].value);
|
||||||
|
@ -67,7 +67,7 @@ void displayRssiLine()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawText(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
|
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);
|
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);
|
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_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)
|
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);
|
lcd_vline(lcdLastPos, y, 2);
|
||||||
uint16_t ss = ap * 6;
|
uint16_t ss = ap * 6;
|
||||||
lcd_outdezNAtt(lcdLastPos+3, y, ss / 1000, LEFT|LEADING0, 2); // ''
|
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_outdezNAtt(lcdLastPos+2, y, ss % 1000, LEFT|LEADING0, 3); // ''
|
||||||
lcd_vline(lcdLastPos, y, 2);
|
lcd_vline(lcdLastPos, y, 2);
|
||||||
lcd_vline(lcdLastPos+2, y, 2);
|
lcd_vline(lcdLastPos+2, y, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcd_outdezNAtt(lcdLastPos+FW, y, mn, LEFT|LEADING0, 2); // mm before '.'
|
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_outdezNAtt(lcdLastPos+2, y, ap, LEFT|UNSIGN|LEADING0, 4); // after '.'
|
||||||
lcd_putc(lcdLastPos+1, y, direction);
|
lcd_putc(lcdLastPos+1, y, direction);
|
||||||
}
|
}
|
||||||
|
@ -315,7 +315,7 @@ bool displayGaugesTelemetryScreen(FrSkyScreenData & screen)
|
||||||
|
|
||||||
if (thresholdX) {
|
if (thresholdX) {
|
||||||
lcdDrawVerticalLine(BAR_LEFT+1+thresholdX, y-2, barHeight+3, DOTTED);
|
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 {
|
else {
|
||||||
|
@ -373,7 +373,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lcd_status_line();
|
lcdInvertLastLine();
|
||||||
return fields_count;
|
return fields_count;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -426,7 +426,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lcd_status_line();
|
lcdInvertLastLine();
|
||||||
return fields_count;
|
return fields_count;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -148,7 +148,7 @@ void menuTextView(uint8_t event)
|
||||||
// TODO?
|
// TODO?
|
||||||
#endif
|
#endif
|
||||||
lcd_puts(LCD_W/2-strlen(title)*FW/2, 0, title);
|
lcd_puts(LCD_W/2-strlen(title)*FW/2, 0, title);
|
||||||
lcd_invert_line(0);
|
lcdInvertLine(0);
|
||||||
|
|
||||||
if (lines_count > LCD_LINES-1) {
|
if (lines_count > LCD_LINES-1) {
|
||||||
drawVerticalScrollbar(LCD_W-1, FH, LCD_H-FH, s_pgOfs, lines_count, LCD_LINES-1);
|
drawVerticalScrollbar(LCD_W-1, FH, LCD_H-FH, s_pgOfs, lines_count, LCD_LINES-1);
|
||||||
|
|
|
@ -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 BOX_CENTERY (LCD_H-9-BOX_WIDTH/2)
|
||||||
#define MARKER_WIDTH 5
|
#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_vline(centrex, BOX_CENTERY-1, 3);
|
||||||
lcd_hline(centrex-1, BOX_CENTERY, 3);
|
lcdDrawSolidHorizontalLine(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);
|
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 BOX_CENTERY
|
||||||
#undef MARKER_WIDTH
|
#undef MARKER_WIDTH
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
||||||
if (attr)
|
if (attr)
|
||||||
drawFilledRect(x, y, 7, 7);
|
drawFilledRect(x, y, 7, 7);
|
||||||
else
|
else
|
||||||
lcd_square(x, y, 7);
|
lcdDrawSquare(x, y, 7);
|
||||||
#else
|
#else
|
||||||
/* ON / OFF version */
|
/* ON / OFF version */
|
||||||
lcdDrawTextAtIndex(x, y, STR_OFFON, value, attr ? INVERS:0) ;
|
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)
|
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_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);
|
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) drawFilledRect(x, y, 5*FW-1, FH-1);
|
||||||
}
|
}
|
||||||
#elif defined(GRAPHICS)
|
#elif defined(GRAPHICS)
|
||||||
void display5posSlider(coord_t x, coord_t y, uint8_t value, uint8_t attr)
|
void display5posSlider(coord_t x, coord_t y, uint8_t value, uint8_t attr)
|
||||||
{
|
{
|
||||||
lcd_putc(x+2*FW+(value*FW), y, '$');
|
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);
|
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) drawFilledRect(x, y, 5*FW-1, FH-1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -233,10 +233,19 @@ bool menuModelCurveOne(evt_t event)
|
||||||
point_t point = getPoint(i);
|
point_t point = getPoint(i);
|
||||||
uint8_t selectionMode = 0;
|
uint8_t selectionMode = 0;
|
||||||
if (m_posHorz == i) {
|
if (m_posHorz == i) {
|
||||||
if (m_posVert == ITEM_CURVE_COORDS2)
|
if (m_posVert == ITEM_CURVE_COORDS1)
|
||||||
|
selectionMode = (crv.type==CURVE_TYPE_CUSTOM ? 1 : 2);
|
||||||
|
else if (m_posVert == ITEM_CURVE_COORDS2)
|
||||||
selectionMode = 2;
|
selectionMode = 2;
|
||||||
else if (m_posVert == ITEM_CURVE_COORDS1)
|
}
|
||||||
selectionMode = 1;
|
|
||||||
|
if (selectionMode == 1) {
|
||||||
|
if (m_posHorz == 0) {
|
||||||
|
REPEAT_LAST_CURSOR_MOVE(1);
|
||||||
|
}
|
||||||
|
else if (m_posHorz == 4+crv.points) {
|
||||||
|
REPEAT_LAST_CURSOR_MOVE(3+crv.points);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t x = -100 + 200*i/(5+crv.points-1);
|
int8_t x = -100 + 200*i/(5+crv.points-1);
|
||||||
|
|
|
@ -165,7 +165,7 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
||||||
else {
|
else {
|
||||||
j = 4; // skip other fields
|
j = 4; // skip other fields
|
||||||
if (sub==k && m_posHorz > 0) {
|
if (sub==k && m_posHorz > 0) {
|
||||||
REPEAT_LAST_CURSOR_MOVE();
|
REPEAT_LAST_CURSOR_MOVE(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -198,7 +198,7 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (attr) {
|
else if (attr) {
|
||||||
REPEAT_LAST_CURSOR_MOVE();
|
REPEAT_LAST_CURSOR_MOVE(0);
|
||||||
}
|
}
|
||||||
if (active) CHECK_INCDEC_MODELVAR_ZERO(event, CFN_CH_INDEX(cfn), maxParam);
|
if (active) CHECK_INCDEC_MODELVAR_ZERO(event, CFN_CH_INDEX(cfn), maxParam);
|
||||||
break;
|
break;
|
||||||
|
@ -330,7 +330,7 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (attr) {
|
else if (attr) {
|
||||||
REPEAT_LAST_CURSOR_MOVE();
|
REPEAT_LAST_CURSOR_MOVE(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
|
@ -357,7 +357,7 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (attr) {
|
else if (attr) {
|
||||||
REPEAT_LAST_CURSOR_MOVE();
|
REPEAT_LAST_CURSOR_MOVE(0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ bool menuModelFlightModesAll(evt_t event)
|
||||||
|
|
||||||
horzpos_t posHorz = m_posHorz;
|
horzpos_t posHorz = m_posHorz;
|
||||||
if (sub==0 && posHorz == 1) {
|
if (sub==0 && posHorz == 1) {
|
||||||
REPEAT_LAST_CURSOR_MOVE();
|
REPEAT_LAST_CURSOR_MOVE(0);
|
||||||
posHorz = m_posHorz;
|
posHorz = m_posHorz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ bool menuModelLogicalSwitches(evt_t event)
|
||||||
if (cstate == LS_FAMILY_EDGE) {
|
if (cstate == LS_FAMILY_EDGE) {
|
||||||
lcdDrawText(CSW_6TH_COLUMN, y, STR_NA);
|
lcdDrawText(CSW_6TH_COLUMN, y, STR_NA);
|
||||||
if (attr && horz == LS_FIELD_DELAY) {
|
if (attr && horz == LS_FIELD_DELAY) {
|
||||||
REPEAT_LAST_CURSOR_MOVE();
|
REPEAT_LAST_CURSOR_MOVE(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cs->delay > 0) {
|
else if (cs->delay > 0) {
|
||||||
|
@ -220,7 +220,7 @@ bool menuModelLogicalSwitches(evt_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attr && horz == LS_FIELD_V3 && cstate != LS_FAMILY_EDGE) {
|
if (attr && horz == LS_FIELD_V3 && cstate != LS_FAMILY_EDGE) {
|
||||||
REPEAT_LAST_CURSOR_MOVE();
|
REPEAT_LAST_CURSOR_MOVE(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_editMode>0 && attr) {
|
if (s_editMode>0 && attr) {
|
||||||
|
|
|
@ -76,9 +76,13 @@ void drawModel(coord_t x, coord_t y, const char * name, bool selected)
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
lcdDrawBitmapPattern(x+104+i*11, y+25, LBM_SCORE0, TITLE_BGCOLOR);
|
lcdDrawBitmapPattern(x+104+i*11, y+25, LBM_SCORE0, TITLE_BGCOLOR);
|
||||||
}
|
}
|
||||||
loadModelBitmap(header.bitmap, modelBitmap);
|
if (loadModelBitmap(header.bitmap, modelBitmap)) {
|
||||||
lcdDrawBitmap(x+5, y+24, modelBitmap, 0, 0, getBitmapScale(modelBitmap, 64, 32));
|
lcdDrawBitmap(x+5, y+24, modelBitmap, 0, 0, getBitmapScale(modelBitmap, 64, 32));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
lcdDrawBitmapPattern(x+5, y+23, LBM_LIBRARY_SLOT, TEXT_COLOR);
|
||||||
|
}
|
||||||
|
}
|
||||||
lcdDrawSolidHorizontalLine(x+5, y+19, 143, LINE_COLOR);
|
lcdDrawSolidHorizontalLine(x+5, y+19, 143, LINE_COLOR);
|
||||||
if (selected) {
|
if (selected) {
|
||||||
lcdDrawSolidRect(x, y, MODELCELL_WIDTH, MODELCELL_HEIGHT, TITLE_BGCOLOR);
|
lcdDrawSolidRect(x, y, MODELCELL_WIDTH, MODELCELL_HEIGHT, TITLE_BGCOLOR);
|
||||||
|
@ -99,6 +103,8 @@ void onCategorySelectMenu(const char * result)
|
||||||
}
|
}
|
||||||
else if (result == STR_RENAME_CATEGORY) {
|
else if (result == STR_RENAME_CATEGORY) {
|
||||||
selectMode = MODE_RENAME_CATEGORY;
|
selectMode = MODE_RENAME_CATEGORY;
|
||||||
|
s_editMode = EDIT_MODIFY_STRING;
|
||||||
|
editNameCursorPos = 0;
|
||||||
}
|
}
|
||||||
else if (result == STR_DELETE_CATEGORY) {
|
else if (result == STR_DELETE_CATEGORY) {
|
||||||
storageRemoveCategory(currentCategory--);
|
storageRemoveCategory(currentCategory--);
|
||||||
|
@ -235,7 +241,6 @@ bool menuModelSelect(evt_t event)
|
||||||
break;
|
break;
|
||||||
if (y < LCD_H) {
|
if (y < LCD_H) {
|
||||||
if (selectMode == MODE_RENAME_CATEGORY && currentCategory == index) {
|
if (selectMode == MODE_RENAME_CATEGORY && currentCategory == index) {
|
||||||
s_editMode = EDIT_MODIFY_STRING;
|
|
||||||
lcdDrawSolidFilledRect(0, y-INVERT_VERT_MARGIN, CATEGORIES_WIDTH, INVERT_LINE_HEIGHT, TEXT_BGCOLOR);
|
lcdDrawSolidFilledRect(0, y-INVERT_VERT_MARGIN, CATEGORIES_WIDTH, INVERT_LINE_HEIGHT, TEXT_BGCOLOR);
|
||||||
editName(MENUS_MARGIN_LEFT, y, selectedCategory, LEN_MODEL_FILENAME, event, 1, 0);
|
editName(MENUS_MARGIN_LEFT, y, selectedCategory, LEN_MODEL_FILENAME, event, 1, 0);
|
||||||
if (s_editMode == 0 || event == EVT_KEY_BREAK(KEY_EXIT)) {
|
if (s_editMode == 0 || event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||||
|
@ -246,7 +251,8 @@ bool menuModelSelect(evt_t event)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (currentCategory == index) {
|
if (currentCategory == index) {
|
||||||
memcpy(selectedCategory, line, sizeof(selectedCategory));
|
memset(selectedCategory, 0, sizeof(selectedCategory));
|
||||||
|
strncpy(selectedCategory, line, sizeof(selectedCategory));
|
||||||
}
|
}
|
||||||
drawCategory(y, line, currentCategory==index);
|
drawCategory(y, line, currentCategory==index);
|
||||||
}
|
}
|
||||||
|
@ -256,6 +262,7 @@ bool menuModelSelect(evt_t event)
|
||||||
}
|
}
|
||||||
if (selectMode == MODE_SELECT_CATEGORY) {
|
if (selectMode == MODE_SELECT_CATEGORY) {
|
||||||
if (navigate(event, index, 9)) {
|
if (navigate(event, index, 9)) {
|
||||||
|
TRACE("Refresh 1");
|
||||||
putEvent(EVT_REFRESH);
|
putEvent(EVT_REFRESH);
|
||||||
currentCategory = m_posVert;
|
currentCategory = m_posVert;
|
||||||
}
|
}
|
||||||
|
@ -289,7 +296,12 @@ bool menuModelSelect(evt_t event)
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (selectMode == MODE_SELECT_MODEL) {
|
if (selectMode == MODE_SELECT_MODEL) {
|
||||||
if (navigate(event, count, 3, 2)) {
|
if (count == 0) {
|
||||||
|
selectMode = MODE_SELECT_CATEGORY;
|
||||||
|
m_posVert = currentCategory;
|
||||||
|
putEvent(EVT_REFRESH);
|
||||||
|
}
|
||||||
|
else if (navigate(event, count, 3, 2)) {
|
||||||
putEvent(EVT_REFRESH);
|
putEvent(EVT_REFRESH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -717,7 +717,7 @@ bool menuModelFailsafe(evt_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO lcd_putsCenter(0, FAILSAFESET);
|
// TODO lcd_putsCenter(0, FAILSAFESET);
|
||||||
// TODO lcd_invert_line(0);
|
// TODO lcdInvertLine(0);
|
||||||
|
|
||||||
for (int col=0; col<2; col++) {
|
for (int col=0; col<2; col++) {
|
||||||
coord_t x = col*COL_W+1;
|
coord_t x = col*COL_W+1;
|
||||||
|
|
|
@ -842,7 +842,7 @@ bool menuModelTelemetry(evt_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (attr && m_posHorz == NUM_LINE_ITEMS) {
|
if (attr && m_posHorz == NUM_LINE_ITEMS) {
|
||||||
REPEAT_LAST_CURSOR_MOVE();
|
REPEAT_LAST_CURSOR_MOVE(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -310,8 +310,8 @@ void pushModelNotes();
|
||||||
#define CURSOR_MOVED_LEFT(event) (event==EVT_ROTARY_LEFT || EVT_KEY_MASK(event) == KEY_LEFT)
|
#define CURSOR_MOVED_LEFT(event) (event==EVT_ROTARY_LEFT || EVT_KEY_MASK(event) == KEY_LEFT)
|
||||||
#define CURSOR_MOVED_RIGHT(event) (event==EVT_ROTARY_RIGHT || EVT_KEY_MASK(event) == KEY_RIGHT)
|
#define CURSOR_MOVED_RIGHT(event) (event==EVT_ROTARY_RIGHT || EVT_KEY_MASK(event) == KEY_RIGHT)
|
||||||
|
|
||||||
#define REPEAT_LAST_CURSOR_MOVE() { if (CURSOR_MOVED_LEFT(event) || CURSOR_MOVED_RIGHT(event)) putEvent(event); else m_posHorz = 0; }
|
#define REPEAT_LAST_CURSOR_MOVE(defaultPosition) { if (CURSOR_MOVED_LEFT(event) || CURSOR_MOVED_RIGHT(event)) putEvent(event); else m_posHorz = (defaultPosition); }
|
||||||
#define MOVE_CURSOR_FROM_HERE() if (m_posHorz > 0) REPEAT_LAST_CURSOR_MOVE()
|
#define MOVE_CURSOR_FROM_HERE() if (m_posHorz > 0) REPEAT_LAST_CURSOR_MOVE(0)
|
||||||
|
|
||||||
#define MENU_FIRST_LINE_EDIT (MAXCOL((uint16_t)0) >= HIDDEN_ROW ? (MAXCOL((uint16_t)1) >= HIDDEN_ROW ? 2 : 1) : 0)
|
#define MENU_FIRST_LINE_EDIT (MAXCOL((uint16_t)0) >= HIDDEN_ROW ? (MAXCOL((uint16_t)1) >= HIDDEN_ROW ? 2 : 1) : 0)
|
||||||
#define POS_HORZ_INIT(posVert) ((COLATTR(posVert) & NAVIGATION_LINE_BY_LINE) ? -1 : 0)
|
#define POS_HORZ_INIT(posVert) ((COLATTR(posVert) & NAVIGATION_LINE_BY_LINE) ? -1 : 0)
|
||||||
|
|
|
@ -390,10 +390,12 @@ bool menuMainView(evt_t event)
|
||||||
lcdDrawBitmapPattern(MODELPANEL_LEFT+6, MODELPANEL_TOP+4, LBM_MODEL_ICON, TITLE_BGCOLOR);
|
lcdDrawBitmapPattern(MODELPANEL_LEFT+6, MODELPANEL_TOP+4, LBM_MODEL_ICON, TITLE_BGCOLOR);
|
||||||
lcdDrawTextWithLen(MODELPANEL_LEFT+45, MODELPANEL_TOP+10, g_model.header.name, LEN_MODEL_NAME, ZCHAR|SMLSIZE);
|
lcdDrawTextWithLen(MODELPANEL_LEFT+45, MODELPANEL_TOP+10, g_model.header.name, LEN_MODEL_NAME, ZCHAR|SMLSIZE);
|
||||||
lcdDrawSolidHorizontalLine(MODELPANEL_LEFT+39, MODELPANEL_TOP+27, MODELPANEL_WIDTH-48, TITLE_BGCOLOR);
|
lcdDrawSolidHorizontalLine(MODELPANEL_LEFT+39, MODELPANEL_TOP+27, MODELPANEL_WIDTH-48, TITLE_BGCOLOR);
|
||||||
|
#if 0
|
||||||
int scale = getBitmapScale(modelBitmap, MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT);
|
int scale = getBitmapScale(modelBitmap, MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT);
|
||||||
int width = getBitmapScaledSize(getBitmapWidth(modelBitmap), scale);
|
int width = getBitmapScaledSize(getBitmapWidth(modelBitmap), scale);
|
||||||
int height = getBitmapScaledSize(getBitmapHeight(modelBitmap), scale);
|
int height = getBitmapScaledSize(getBitmapHeight(modelBitmap), scale);
|
||||||
lcdDrawBitmap(MODELPANEL_LEFT+(MODEL_BITMAP_WIDTH-width)/2, MODELPANEL_TOP+MODELPANEL_HEIGHT-MODEL_BITMAP_HEIGHT/2-height/2, modelBitmap, 0, 0, scale);
|
lcdDrawBitmap(MODELPANEL_LEFT+(MODEL_BITMAP_WIDTH-width)/2, MODELPANEL_TOP+MODELPANEL_HEIGHT-MODEL_BITMAP_HEIGHT/2-height/2, modelBitmap, 0, 0, scale);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Timers
|
// Timers
|
||||||
if (g_model.timers[0].mode) {
|
if (g_model.timers[0].mode) {
|
||||||
|
|
|
@ -157,7 +157,7 @@ bool menuStatisticsDebug(evt_t event)
|
||||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS+150, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
|
lcdDrawNumber(MENU_DEBUG_COL1_OFS+150, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
|
||||||
|
|
||||||
lcd_putsCenter(7*FH+1, STR_MENUTORESET);
|
lcd_putsCenter(7*FH+1, STR_MENUTORESET);
|
||||||
// lcd_status_line();
|
// lcdInvertLastLine();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,9 +131,9 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
|
||||||
if (inv) plot = !plot;
|
if (inv) plot = !plot;
|
||||||
if (!blink) {
|
if (!blink) {
|
||||||
if (flags & VERTICAL)
|
if (flags & VERTICAL)
|
||||||
lcd_plot(y+j, LCD_H-x, plot ? FORCE : ERASE);
|
lcdDrawPoint(y+j, LCD_H-x, plot ? FORCE : ERASE);
|
||||||
else
|
else
|
||||||
lcd_plot(x, y+j, plot ? FORCE : ERASE);
|
lcdDrawPoint(x, y+j, plot ? FORCE : ERASE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -430,16 +430,16 @@ void lcd_outdezNAtt(coord_t x, coord_t y, int32_t val, LcdFlags flags, uint8_t l
|
||||||
}
|
}
|
||||||
else if (smlsize) {
|
else if (smlsize) {
|
||||||
x -= 2;
|
x -= 2;
|
||||||
lcd_plot(x+1, y+5);
|
lcdDrawPoint(x+1, y+5);
|
||||||
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
||||||
lcd_vline(x+1, y, 7);
|
lcdDrawSolidVerticalLine(x+1, y, 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tinsize) {
|
else if (tinsize) {
|
||||||
x--;
|
x--;
|
||||||
lcd_plot(x-1, y+4);
|
lcdDrawPoint(x-1, y+4);
|
||||||
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
||||||
lcd_vline(x-1, y-1, 7);
|
lcdDrawSolidVerticalLine(x-1, y-1, 7);
|
||||||
}
|
}
|
||||||
x--;
|
x--;
|
||||||
}
|
}
|
||||||
|
@ -458,22 +458,22 @@ void lcd_outdezNAtt(coord_t x, coord_t y, int32_t val, LcdFlags flags, uint8_t l
|
||||||
if (xn) {
|
if (xn) {
|
||||||
if (midsize) {
|
if (midsize) {
|
||||||
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
||||||
lcd_vline(xn, y, 12);
|
lcdDrawSolidVerticalLine(xn, y, 12);
|
||||||
lcd_vline(xn+1, y, 12);
|
lcdDrawSolidVerticalLine(xn+1, y, 12);
|
||||||
}
|
}
|
||||||
lcd_hline(xn, y+9, 2);
|
lcdDrawSolidHorizontalLine(xn, y+9, 2);
|
||||||
lcd_hline(xn, y+10, 2);
|
lcdDrawSolidHorizontalLine(xn, y+10, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// TODO needed on CPUAVR? y &= ~0x07;
|
// TODO needed on CPUAVR? y &= ~0x07;
|
||||||
drawFilledRect(xn, y+2*FH-3, ln, 2);
|
lcdDrawFilledRect(xn, y+2*FH-3, ln, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (neg) lcdDrawChar(x, y, '-', flags);
|
if (neg) lcdDrawChar(x, y, '-', flags);
|
||||||
}
|
}
|
||||||
#endif
|
#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);
|
lcdDrawHorizontalLine(x, y, w, 0xff, att);
|
||||||
}
|
}
|
||||||
|
@ -498,7 +498,7 @@ void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, Lc
|
||||||
/* the line is more horizontal than vertical */
|
/* the line is more horizontal than vertical */
|
||||||
for (int i=0; i<=dxabs; i++) {
|
for (int i=0; i<=dxabs; i++) {
|
||||||
if ((1<<(px%8)) & pat) {
|
if ((1<<(px%8)) & pat) {
|
||||||
lcd_plot(px, py, att);
|
lcdDrawPoint(px, py, att);
|
||||||
}
|
}
|
||||||
y += dyabs;
|
y += dyabs;
|
||||||
if (y>=dxabs) {
|
if (y>=dxabs) {
|
||||||
|
@ -512,7 +512,7 @@ void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, Lc
|
||||||
/* the line is more vertical than horizontal */
|
/* the line is more vertical than horizontal */
|
||||||
for (int i=0; i<=dyabs; i++) {
|
for (int i=0; i<=dyabs; i++) {
|
||||||
if ((1<<(py%8)) & pat) {
|
if ((1<<(py%8)) & pat) {
|
||||||
lcd_plot(px, py, att);
|
lcdDrawPoint(px, py, att);
|
||||||
}
|
}
|
||||||
x += dxabs;
|
x += dxabs;
|
||||||
if (x >= dyabs) {
|
if (x >= dyabs) {
|
||||||
|
@ -524,7 +524,7 @@ void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, Lc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_vline(coord_t x, scoord_t y, scoord_t h)
|
void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h)
|
||||||
{
|
{
|
||||||
lcdDrawVerticalLine(x, y, h, SOLID);
|
lcdDrawVerticalLine(x, y, h, SOLID);
|
||||||
}
|
}
|
||||||
|
@ -540,7 +540,7 @@ void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFla
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(BOOT)
|
#if !defined(BOOT)
|
||||||
void drawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
||||||
{
|
{
|
||||||
for (scoord_t i=y; i<y+h; i++) {
|
for (scoord_t i=y; i<y+h; i++) {
|
||||||
if ((att&ROUND) && (i==y || i==y+h-1))
|
if ((att&ROUND) && (i==y || i==y+h-1))
|
||||||
|
@ -566,7 +566,7 @@ void lcdDrawTelemetryTopBar()
|
||||||
putsTimer(31*FW+5*FWNUM+3, 0, timersStates[1].val, att, att);
|
putsTimer(31*FW+5*FWNUM+3, 0, timersStates[1].val, att, att);
|
||||||
putsMixerSource(27*FW+2, 1, MIXSRC_TIMER2, SMLSIZE);
|
putsMixerSource(27*FW+2, 1, MIXSRC_TIMER2, SMLSIZE);
|
||||||
}
|
}
|
||||||
lcd_invert_line(0);
|
lcdInvertLine(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsRtcTime(coord_t x, coord_t y, LcdFlags att)
|
void putsRtcTime(coord_t x, coord_t y, LcdFlags att)
|
||||||
|
@ -644,7 +644,7 @@ void putsMixerSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
|
||||||
}
|
}
|
||||||
else if (idx <= MIXSRC_LAST_INPUT) {
|
else if (idx <= MIXSRC_LAST_INPUT) {
|
||||||
lcdDrawChar(x+2, y+1, CHR_INPUT, TINSIZE);
|
lcdDrawChar(x+2, y+1, CHR_INPUT, TINSIZE);
|
||||||
drawFilledRect(x, y, 7, 7);
|
lcdDrawFilledRect(x, y, 7, 7);
|
||||||
if (ZEXIST(g_model.inputNames[idx-MIXSRC_FIRST_INPUT]))
|
if (ZEXIST(g_model.inputNames[idx-MIXSRC_FIRST_INPUT]))
|
||||||
lcdDrawTextWithLen(x+8, y, g_model.inputNames[idx-MIXSRC_FIRST_INPUT], LEN_INPUT_NAME, ZCHAR|att);
|
lcdDrawTextWithLen(x+8, y, g_model.inputNames[idx-MIXSRC_FIRST_INPUT], LEN_INPUT_NAME, ZCHAR|att);
|
||||||
else
|
else
|
||||||
|
@ -656,7 +656,7 @@ void putsMixerSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
|
||||||
#if defined(LUA_MODEL_SCRIPTS)
|
#if defined(LUA_MODEL_SCRIPTS)
|
||||||
if (qr.quot < MAX_SCRIPTS && qr.rem < scriptInputsOutputs[qr.quot].outputsCount) {
|
if (qr.quot < MAX_SCRIPTS && qr.rem < scriptInputsOutputs[qr.quot].outputsCount) {
|
||||||
lcdDrawChar(x+2, y+1, '1'+qr.quot, TINSIZE);
|
lcdDrawChar(x+2, y+1, '1'+qr.quot, TINSIZE);
|
||||||
drawFilledRect(x, y, 7, 7);
|
lcdDrawFilledRect(x, y, 7, 7);
|
||||||
lcdDrawTextWithLen(x+8, y, scriptInputsOutputs[qr.quot].outputs[qr.rem].name, att & STREXPANDED ? 9 : 4, att);
|
lcdDrawTextWithLen(x+8, y, scriptInputsOutputs[qr.quot].outputs[qr.rem].name, att & STREXPANDED ? 9 : 4, att);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -898,20 +898,20 @@ void displayGpsCoord(coord_t x, coord_t y, char direction, int16_t bp, int16_t a
|
||||||
uint8_t mn = bp % 100; // TODO div_t
|
uint8_t mn = bp % 100; // TODO div_t
|
||||||
if (g_eeGeneral.gpsFormat == 0) {
|
if (g_eeGeneral.gpsFormat == 0) {
|
||||||
lcd_outdezNAtt(lcdNextPos, y, mn, att|LEFT|LEADING0, 2); // mm before '.'
|
lcd_outdezNAtt(lcdNextPos, y, mn, att|LEFT|LEADING0, 2); // mm before '.'
|
||||||
lcd_vline(lcdLastPos, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
|
||||||
if (seconds) {
|
if (seconds) {
|
||||||
uint16_t ss = ap * 6 / 10;
|
uint16_t ss = ap * 6 / 10;
|
||||||
lcd_outdezNAtt(lcdLastPos+3, y, ss / 100, att|LEFT|LEADING0, 2); // ''
|
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_outdezNAtt(lcdLastPos+2, y, ss % 100, att|LEFT|LEADING0, 2); // ''
|
||||||
lcd_vline(lcdLastPos, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
|
||||||
lcd_vline(lcdLastPos+2, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastPos+2, y, 2);
|
||||||
}
|
}
|
||||||
lcd_putc(lcdLastPos+2, y, direction);
|
lcd_putc(lcdLastPos+2, y, direction);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcd_outdezNAtt(lcdLastPos+FW, y, mn, att|LEFT|LEADING0, 2); // mm before '.'
|
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_outdezNAtt(lcdLastPos+2, y, ap, att|LEFT|UNSIGN|LEADING0, 4); // after '.'
|
||||||
lcd_putc(lcdLastPos+1, y, direction);
|
lcd_putc(lcdLastPos+1, y, direction);
|
||||||
}
|
}
|
||||||
|
@ -1022,7 +1022,7 @@ void lcdSetContrast()
|
||||||
}
|
}
|
||||||
#endif // BOOT
|
#endif // BOOT
|
||||||
|
|
||||||
void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att)
|
void lcdMaskPoint(uint8_t *p, uint8_t mask, LcdFlags att)
|
||||||
{
|
{
|
||||||
if ((p) >= DISPLAY_END) {
|
if ((p) >= DISPLAY_END) {
|
||||||
return;
|
return;
|
||||||
|
@ -1047,12 +1047,12 @@ void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att)
|
||||||
|
|
||||||
#define PIXEL_GREY_MASK(y, att) (((y) & 1) ? (0xF0 - (COLOUR_MASK(att) >> 12)) : (0x0F - (COLOUR_MASK(att) >> 16)))
|
#define PIXEL_GREY_MASK(y, att) (((y) & 1) ? (0xF0 - (COLOUR_MASK(att) >> 12)) : (0x0F - (COLOUR_MASK(att) >> 16)))
|
||||||
|
|
||||||
void lcd_plot(coord_t x, coord_t y, LcdFlags att)
|
void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (lcdIsPointOutside(x, y)) return;
|
if (lcdIsPointOutside(x, y)) return;
|
||||||
uint8_t *p = &displayBuf[ y / 2 * LCD_W + x ];
|
uint8_t *p = &displayBuf[ y / 2 * LCD_W + x ];
|
||||||
uint8_t mask = PIXEL_GREY_MASK(y, att);
|
uint8_t mask = PIXEL_GREY_MASK(y, att);
|
||||||
lcd_mask(p, mask, att);
|
lcdMaskPoint(p, mask, att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att)
|
void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att)
|
||||||
|
@ -1067,7 +1067,7 @@ void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlag
|
||||||
uint8_t mask = PIXEL_GREY_MASK(y, att);
|
uint8_t mask = PIXEL_GREY_MASK(y, att);
|
||||||
while (w--) {
|
while (w--) {
|
||||||
if (pat&1) {
|
if (pat&1) {
|
||||||
lcd_mask(p, mask, att);
|
lcdMaskPoint(p, mask, att);
|
||||||
pat = (pat >> 1) | 0x80;
|
pat = (pat >> 1) | 0x80;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1091,7 +1091,7 @@ void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlag
|
||||||
|
|
||||||
while (h--) {
|
while (h--) {
|
||||||
if (pat & 1) {
|
if (pat & 1) {
|
||||||
lcd_plot(x, y, att);
|
lcdDrawPoint(x, y, att);
|
||||||
pat = (pat >> 1) | 0x80;
|
pat = (pat >> 1) | 0x80;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1101,7 +1101,7 @@ void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_invert_line(int8_t line)
|
void lcdInvertLine(int8_t line)
|
||||||
{
|
{
|
||||||
uint8_t *p = &displayBuf[line * 4 * LCD_W];
|
uint8_t *p = &displayBuf[line * 4 * LCD_W];
|
||||||
for (coord_t x=0; x<LCD_W*4; x++) {
|
for (coord_t x=0; x<LCD_W*4; x++) {
|
||||||
|
@ -1124,7 +1124,7 @@ void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags a
|
||||||
uint8_t val = inv ? ~b : b;
|
uint8_t val = inv ? ~b : b;
|
||||||
for (int k=0; k<8; k++) {
|
for (int k=0; k<8; k++) {
|
||||||
if (val & (1<<k)) {
|
if (val & (1<<k)) {
|
||||||
lcd_plot(x+i, y+yb*8+k, 0);
|
lcdDrawPoint(x+i, y+yb*8+k, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,29 +192,28 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||||
#define SOLID 0xff
|
#define SOLID 0xff
|
||||||
#define DOTTED 0x55
|
#define DOTTED 0x55
|
||||||
|
|
||||||
void lcd_plot(coord_t x, coord_t y, LcdFlags att=0);
|
void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att=0);
|
||||||
void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att=0);
|
void lcdMaskPoint(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 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 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);
|
void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h);
|
||||||
void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att=0);
|
void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att=0);
|
||||||
void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0);
|
void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0);
|
||||||
|
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
||||||
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 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);
|
void lcdInvertLine(int8_t line);
|
||||||
#define lcd_status_line() lcd_invert_line(LCD_LINES-1)
|
#define lcdInvertLastLine() lcdInvertLine(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); }
|
inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcdDrawRect(x, y, w, w, SOLID, att); }
|
||||||
|
|
||||||
void displaySleepBitmap();
|
void displaySleepBitmap();
|
||||||
|
|
||||||
void lcdDrawTelemetryTopBar();
|
void lcdDrawTelemetryTopBar();
|
||||||
|
|
||||||
#define V_BAR(xx, yy, ll) \
|
#define V_BAR(xx, yy, ll) \
|
||||||
lcd_vline(xx-1,yy-ll,ll); \
|
lcdDrawSolidVerticalLine(xx-1,yy-ll,ll); \
|
||||||
lcd_vline(xx ,yy-ll,ll); \
|
lcdDrawSolidVerticalLine(xx ,yy-ll,ll); \
|
||||||
lcd_vline(xx+1,yy-ll,ll)
|
lcdDrawSolidVerticalLine(xx+1,yy-ll,ll)
|
||||||
|
|
||||||
void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0);
|
void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0);
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,7 @@ void menuFirstCalib(uint8_t event)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcd_putsCenter(0*FH, MENUCALIBRATION);
|
lcd_putsCenter(0*FH, MENUCALIBRATION);
|
||||||
lcd_invert_line(0);
|
lcdInvertLine(0);
|
||||||
menuCommonCalib(event);
|
menuCommonCalib(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,7 @@ void menuGeneralSetup(uint8_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (attr && m_posHorz < 0) drawFilledRect(RADIO_SETUP_2ND_COLUMN, y, LCD_W-RADIO_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
|
if (attr && m_posHorz < 0) lcdDrawFilledRect(RADIO_SETUP_2ND_COLUMN, y, LCD_W-RADIO_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
|
||||||
if (attr && checkIncDec_Ret) {
|
if (attr && checkIncDec_Ret) {
|
||||||
g_rtcTime = gmktime(&t); // update local timestamp and get wday calculated
|
g_rtcTime = gmktime(&t); // update local timestamp and get wday calculated
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ void menuGeneralSetup(uint8_t event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (attr && m_posHorz < 0) drawFilledRect(RADIO_SETUP_2ND_COLUMN, y, LCD_W-RADIO_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
|
if (attr && m_posHorz < 0) lcdDrawFilledRect(RADIO_SETUP_2ND_COLUMN, y, LCD_W-RADIO_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
|
||||||
if (attr && checkIncDec_Ret)
|
if (attr && checkIncDec_Ret)
|
||||||
g_rtcTime = gmktime(&t); // update local timestamp and get wday calculated
|
g_rtcTime = gmktime(&t); // update local timestamp and get wday calculated
|
||||||
break;
|
break;
|
||||||
|
@ -201,7 +201,7 @@ void menuGeneralSetup(uint8_t event)
|
||||||
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (m_posHorz==0 ? attr : 0)|LEFT|NO_UNIT);
|
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (m_posHorz==0 ? attr : 0)|LEFT|NO_UNIT);
|
||||||
lcd_putc(lcdLastPos, y, '-');
|
lcd_putc(lcdLastPos, y, '-');
|
||||||
putsVolts(lcdLastPos+FW, y, 120+g_eeGeneral.vBatMax, (m_posHorz>0 ? attr : 0)|LEFT|NO_UNIT);
|
putsVolts(lcdLastPos+FW, y, 120+g_eeGeneral.vBatMax, (m_posHorz>0 ? attr : 0)|LEFT|NO_UNIT);
|
||||||
if (attr && m_posHorz < 0) drawFilledRect(RADIO_SETUP_2ND_COLUMN, y, LCD_W-RADIO_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
|
if (attr && m_posHorz < 0) lcdDrawFilledRect(RADIO_SETUP_2ND_COLUMN, y, LCD_W-RADIO_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
|
||||||
if (attr && s_editMode>0) {
|
if (attr && s_editMode>0) {
|
||||||
if (m_posHorz==0)
|
if (m_posHorz==0)
|
||||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -50, g_eeGeneral.vBatMax+29); // min=4.0V
|
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -50, g_eeGeneral.vBatMax+29); // min=4.0V
|
||||||
|
@ -478,7 +478,7 @@ void menuGeneralSetup(uint8_t event)
|
||||||
lcd_img((6+4*i)*FW, y, sticks, i, 0);
|
lcd_img((6+4*i)*FW, y, sticks, i, 0);
|
||||||
#if defined(FRSKY_STICKS)
|
#if defined(FRSKY_STICKS)
|
||||||
if (g_eeGeneral.stickReverse & (1<<i)) {
|
if (g_eeGeneral.stickReverse & (1<<i)) {
|
||||||
drawFilledRect((6+4*i)*FW, y, 3*FW, FH-1);
|
lcdDrawFilledRect((6+4*i)*FW, y, 3*FW, FH-1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ void menuGeneralVersion(uint8_t event)
|
||||||
|
|
||||||
lcd_putsLeft(MENU_HEADER_HEIGHT+5*FH+1, STR_EEBACKUP);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+5*FH+1, STR_EEBACKUP);
|
||||||
lcd_putsLeft(MENU_HEADER_HEIGHT+6*FH+1, STR_FACTORYRESET);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+6*FH+1, STR_FACTORYRESET);
|
||||||
drawFilledRect(0, MENU_HEADER_HEIGHT+5*FH, LCD_W, 2*FH+1, SOLID);
|
lcdDrawFilledRect(0, MENU_HEADER_HEIGHT+5*FH, LCD_W, 2*FH+1, SOLID);
|
||||||
|
|
||||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||||
backupEeprom();
|
backupEeprom();
|
||||||
|
|
|
@ -72,7 +72,7 @@ void DrawCurve(uint8_t offset=0)
|
||||||
point_t point = getPoint(i);
|
point_t point = getPoint(i);
|
||||||
i++;
|
i++;
|
||||||
if (point.x == 0) break;
|
if (point.x == 0) break;
|
||||||
drawFilledRect(point.x-offset, point.y-1, 3, 3, SOLID, FORCE); // do markup square
|
lcdDrawFilledRect(point.x-offset, point.y-1, 3, 3, SOLID, FORCE); // do markup square
|
||||||
} while(1);
|
} while(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ void menuModelCurveOne(uint8_t event)
|
||||||
int8_t * points = curveAddress(s_curveChan);
|
int8_t * points = curveAddress(s_curveChan);
|
||||||
|
|
||||||
lcd_puts(9*FW, 0, TR_PT "\003X\006Y");
|
lcd_puts(9*FW, 0, TR_PT "\003X\006Y");
|
||||||
drawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||||
|
|
||||||
SIMPLE_SUBMENU(STR_MENUCURVE, 4 + 5+crv.points + (crv.type==CURVE_TYPE_CUSTOM ? 5+crv.points-2 : 0));
|
SIMPLE_SUBMENU(STR_MENUCURVE, 4 + 5+crv.points + (crv.type==CURVE_TYPE_CUSTOM ? 5+crv.points-2 : 0));
|
||||||
lcd_outdezAtt(PSIZE(TR_MENUCURVE)*FW+1, 0, s_curveChan+1, INVERS|LEFT);
|
lcd_outdezAtt(PSIZE(TR_MENUCURVE)*FW+1, 0, s_curveChan+1, INVERS|LEFT);
|
||||||
|
@ -242,8 +242,8 @@ void menuModelCurveOne(uint8_t event)
|
||||||
|
|
||||||
if (selectionMode > 0) {
|
if (selectionMode > 0) {
|
||||||
// do selection square
|
// do selection square
|
||||||
drawFilledRect(point.x-FW-1, point.y-2, 5, 5, SOLID, FORCE);
|
lcdDrawFilledRect(point.x-FW-1, point.y-2, 5, 5, SOLID, FORCE);
|
||||||
drawFilledRect(point.x-FW, point.y-1, 3, 3, SOLID);
|
lcdDrawFilledRect(point.x-FW, point.y-1, 3, 3, SOLID);
|
||||||
if (s_editMode > 0) {
|
if (s_editMode > 0) {
|
||||||
if (selectionMode == 1)
|
if (selectionMode == 1)
|
||||||
CHECK_INCDEC_MODELVAR(event, points[5+crv.points+i-1], i==1 ? -100 : points[5+crv.points+i-2], i==5+crv.points-2 ? 100 : points[5+crv.points+i]); // edit X
|
CHECK_INCDEC_MODELVAR(event, points[5+crv.points+i-1], i==1 ? -100 : points[5+crv.points+i-2], i==5+crv.points-2 ? 100 : points[5+crv.points+i]); // edit X
|
||||||
|
|
|
@ -124,7 +124,7 @@ void menuModelCustomScriptOne(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scriptInputsOutputs[s_currIdx].outputsCount > 0) {
|
if (scriptInputsOutputs[s_currIdx].outputsCount > 0) {
|
||||||
lcd_vline(SCRIPT_ONE_3RD_COLUMN_POS-4, FH+1, LCD_H-FH-1);
|
lcdDrawSolidVerticalLine(SCRIPT_ONE_3RD_COLUMN_POS-4, FH+1, LCD_H-FH-1);
|
||||||
lcd_puts(SCRIPT_ONE_3RD_COLUMN_POS, FH+1, STR_OUTPUTS);
|
lcd_puts(SCRIPT_ONE_3RD_COLUMN_POS, FH+1, STR_OUTPUTS);
|
||||||
|
|
||||||
for (int i=0; i<scriptInputsOutputs[s_currIdx].outputsCount; i++) {
|
for (int i=0; i<scriptInputsOutputs[s_currIdx].outputsCount; i++) {
|
||||||
|
|
|
@ -92,7 +92,7 @@ void menuModelFlightModesAll(uint8_t event)
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcd_status_line();
|
lcdInvertLastLine();
|
||||||
s_editMode = 0;
|
s_editMode = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,11 +92,11 @@ 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);
|
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 (prev_yv != (coord_t)-1) {
|
||||||
if (abs((int8_t)yv-prev_yv) <= 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 {
|
else {
|
||||||
uint8_t tmp = (prev_yv < yv ? 0 : 1);
|
uint8_t tmp = (prev_yv < yv ? 0 : 1);
|
||||||
lcd_vline(X0+xv-offset-1, yv+tmp, prev_yv-yv);
|
lcdDrawSolidVerticalLine(X0+xv-offset-1, yv+tmp, prev_yv-yv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prev_yv = yv;
|
prev_yv = yv;
|
||||||
|
@ -414,8 +414,8 @@ void menuModelExpoOne(uint8_t event)
|
||||||
x512 = X0+x512/(RESX/WCHART);
|
x512 = X0+x512/(RESX/WCHART);
|
||||||
y512 = (LCD_H-1) - ((y512+RESX)/2) * (LCD_H-1) / RESX;
|
y512 = (LCD_H-1) - ((y512+RESX)/2) * (LCD_H-1) / RESX;
|
||||||
|
|
||||||
lcd_vline(x512, y512-3, 3*2+1);
|
lcdDrawSolidVerticalLine(x512, y512-3, 3*2+1);
|
||||||
lcd_hline(x512-3, y512, 3*2+1);
|
lcdDrawSolidHorizontalLine(x512-3, y512, 3*2+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MixFields {
|
enum MixFields {
|
||||||
|
@ -462,24 +462,24 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
|
||||||
barMax = 101;
|
barMax = 101;
|
||||||
lcdDrawHorizontalLine(x-2, y, GAUGE_WIDTH+2, DOTTED);
|
lcdDrawHorizontalLine(x-2, y, GAUGE_WIDTH+2, DOTTED);
|
||||||
lcdDrawHorizontalLine(x-2, y+GAUGE_HEIGHT, GAUGE_WIDTH+2, DOTTED);
|
lcdDrawHorizontalLine(x-2, y+GAUGE_HEIGHT, GAUGE_WIDTH+2, DOTTED);
|
||||||
lcd_vline(x-2, y+1, GAUGE_HEIGHT-1);
|
lcdDrawSolidVerticalLine(x-2, y+1, GAUGE_HEIGHT-1);
|
||||||
lcd_vline(x+GAUGE_WIDTH-1, y+1, GAUGE_HEIGHT-1);
|
lcdDrawSolidVerticalLine(x+GAUGE_WIDTH-1, y+1, GAUGE_HEIGHT-1);
|
||||||
if (barMin <= barMax) {
|
if (barMin <= barMax) {
|
||||||
int8_t right = (barMax * GAUGE_WIDTH) / 200;
|
int8_t right = (barMax * GAUGE_WIDTH) / 200;
|
||||||
int8_t left = ((barMin * GAUGE_WIDTH) / 200)-1;
|
int8_t left = ((barMin * GAUGE_WIDTH) / 200)-1;
|
||||||
drawFilledRect(x+GAUGE_WIDTH/2+left, y+2, right-left, GAUGE_HEIGHT-3);
|
lcdDrawFilledRect(x+GAUGE_WIDTH/2+left, y+2, right-left, GAUGE_HEIGHT-3);
|
||||||
}
|
}
|
||||||
lcd_vline(x+GAUGE_WIDTH/2-1, y, GAUGE_HEIGHT+1);
|
lcdDrawSolidVerticalLine(x+GAUGE_WIDTH/2-1, y, GAUGE_HEIGHT+1);
|
||||||
if (barMin == -101) {
|
if (barMin == -101) {
|
||||||
for (uint8_t i=0; i<3; ++i) {
|
for (uint8_t i=0; i<3; ++i) {
|
||||||
lcd_plot(x+i, y+4-i);
|
lcdDrawPoint(x+i, y+4-i);
|
||||||
lcd_plot(x+3+i, y+4-i);
|
lcdDrawPoint(x+3+i, y+4-i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (barMax == 101) {
|
if (barMax == 101) {
|
||||||
for (uint8_t i=0; i<3; ++i) {
|
for (uint8_t i=0; i<3; ++i) {
|
||||||
lcd_plot(x+GAUGE_WIDTH-8+i, y+4-i);
|
lcdDrawPoint(x+GAUGE_WIDTH-8+i, y+4-i);
|
||||||
lcd_plot(x+GAUGE_WIDTH-5+i, y+4-i);
|
lcdDrawPoint(x+GAUGE_WIDTH-5+i, y+4-i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ void menuModelMixOne(uint8_t event)
|
||||||
SUBMENU_NOTITLE(MIX_FIELD_COUNT, {0, 0, 0, 0, 0, CASE_CURVES(1) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/});
|
SUBMENU_NOTITLE(MIX_FIELD_COUNT, {0, 0, 0, 0, 0, CASE_CURVES(1) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/});
|
||||||
|
|
||||||
#if MENU_COLUMNS > 1
|
#if MENU_COLUMNS > 1
|
||||||
lcd_vline(MENU_COLUMN2_X-4, FH+1, LCD_H-FH-1);
|
lcdDrawSolidVerticalLine(MENU_COLUMN2_X-4, FH+1, LCD_H-FH-1);
|
||||||
SET_SCROLLBAR_X(0);
|
SET_SCROLLBAR_X(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -930,7 +930,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||||
}
|
}
|
||||||
if (cur == sub) {
|
if (cur == sub) {
|
||||||
/* invert the raw when it's the current one */
|
/* invert the raw when it's the current one */
|
||||||
drawFilledRect(expo ? EXPO_LINE_SELECT_POS+1 : 23, y, expo ? (LCD_W-EXPO_LINE_SELECT_POS-2) : (LCD_W-24), 7);
|
lcdDrawFilledRect(expo ? EXPO_LINE_SELECT_POS+1 : 23, y, expo ? (LCD_W-EXPO_LINE_SELECT_POS-2) : (LCD_W-24), 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,7 +241,7 @@ void menuModelSelect(uint8_t event)
|
||||||
lcd_puts(21*FW, 0, STR_BYTES);
|
lcd_puts(21*FW, 0, STR_BYTES);
|
||||||
|
|
||||||
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), 0);
|
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), 0);
|
||||||
drawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||||
|
|
||||||
TITLE(STR_MENUMODELSEL);
|
TITLE(STR_MENUMODELSEL);
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ void menuModelSelect(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_copyMode && (vertpos_t)sub==i+s_pgOfs) {
|
if (s_copyMode && (vertpos_t)sub==i+s_pgOfs) {
|
||||||
drawFilledRect(9, y, MODELSEL_W-1-9, 7);
|
lcdDrawFilledRect(9, y, MODELSEL_W-1-9, 7);
|
||||||
lcdDrawRect(8, y-1, MODELSEL_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED);
|
lcdDrawRect(8, y-1, MODELSEL_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
|
||||||
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, m_posHorz==0 ? attr : 0);
|
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, m_posHorz==0 ? attr : 0);
|
||||||
|
|
||||||
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, m_posHorz==1 ? attr : 0, m_posHorz==2 ? attr : 0);
|
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, m_posHorz==1 ? attr : 0, m_posHorz==2 ? attr : 0);
|
||||||
if (attr && m_posHorz < 0) drawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, FH+1);
|
if (attr && m_posHorz < 0) lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, FH+1);
|
||||||
if (attr && s_editMode>0) {
|
if (attr && s_editMode>0) {
|
||||||
div_t qr = div(timer->start, 60);
|
div_t qr = div(timer->start, 60);
|
||||||
switch (m_posHorz) {
|
switch (m_posHorz) {
|
||||||
|
@ -521,9 +521,9 @@ void menuModelSetup(uint8_t event)
|
||||||
}
|
}
|
||||||
if (attr && m_posHorz < 0) {
|
if (attr && m_posHorz < 0) {
|
||||||
#if defined(REV9E)
|
#if defined(REV9E)
|
||||||
drawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 8*(2*FW+1), 1+FH*((current+7)/8));
|
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 8*(2*FW+1), 1+FH*((current+7)/8));
|
||||||
#else
|
#else
|
||||||
drawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, current*(2*FW+1), FH+1);
|
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, current*(2*FW+1), FH+1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -592,9 +592,9 @@ void menuModelSetup(uint8_t event)
|
||||||
}
|
}
|
||||||
if (attr && m_posHorz < 0) {
|
if (attr && m_posHorz < 0) {
|
||||||
#if defined(REV9E)
|
#if defined(REV9E)
|
||||||
drawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-FH-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, 2*FH+1);
|
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-FH-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, 2*FH+1);
|
||||||
#else
|
#else
|
||||||
drawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, FH+1);
|
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, FH+1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -845,7 +845,7 @@ void menuModelSetup(uint8_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
drawFilledRect(MODEL_SETUP_2ND_COLUMN, y, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
|
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN, y, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -900,10 +900,10 @@ void menuModelFailsafe(uint8_t event)
|
||||||
#define COL_W (LCD_W/2)
|
#define COL_W (LCD_W/2)
|
||||||
const uint8_t SLIDER_W = 64;
|
const uint8_t SLIDER_W = 64;
|
||||||
// Column separator
|
// Column separator
|
||||||
lcd_vline(LCD_W/2, FH, LCD_H-FH);
|
lcdDrawSolidVerticalLine(LCD_W/2, FH, LCD_H-FH);
|
||||||
|
|
||||||
lcd_putsCenter(0*FH, FAILSAFESET);
|
lcd_putsCenter(0*FH, FAILSAFESET);
|
||||||
lcd_invert_line(0);
|
lcdInvertLine(0);
|
||||||
|
|
||||||
unsigned int lim = g_model.extendedLimits ? 640*2 : 512*2;
|
unsigned int lim = g_model.extendedLimits ? 640*2 : 512*2;
|
||||||
|
|
||||||
|
@ -982,8 +982,8 @@ void menuModelFailsafe(uint8_t event)
|
||||||
coord_t xFailsafe = (failsafeValue>0) ? x+COL_W-ofs-3-wbar/2 : x+COL_W-ofs-2-wbar/2-lenFailsafe;
|
coord_t xFailsafe = (failsafeValue>0) ? x+COL_W-ofs-3-wbar/2 : x+COL_W-ofs-2-wbar/2-lenFailsafe;
|
||||||
lcdDrawHorizontalLine(xChannel, y+1, lenChannel, DOTTED, 0);
|
lcdDrawHorizontalLine(xChannel, y+1, lenChannel, DOTTED, 0);
|
||||||
lcdDrawHorizontalLine(xChannel, y+2, lenChannel, DOTTED, 0);
|
lcdDrawHorizontalLine(xChannel, y+2, lenChannel, DOTTED, 0);
|
||||||
lcd_hline(xFailsafe, y+3, lenFailsafe);
|
lcdDrawSolidHorizontalLine(xFailsafe, y+3, lenFailsafe);
|
||||||
lcd_hline(xFailsafe, y+4, lenFailsafe);
|
lcdDrawSolidHorizontalLine(xFailsafe, y+4, lenFailsafe);
|
||||||
}
|
}
|
||||||
ch++;
|
ch++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -413,7 +413,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
||||||
displayScreenIndex(curr, menuTabSize, 0);
|
displayScreenIndex(curr, menuTabSize, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
drawFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT);
|
lcdDrawFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
|
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
|
||||||
|
|
|
@ -56,7 +56,7 @@ void (*menuHandler)(const char *result);
|
||||||
|
|
||||||
void displayBox(const char *title)
|
void displayBox(const char *title)
|
||||||
{
|
{
|
||||||
drawFilledRect(10, 16, LCD_W-20, 40, SOLID, ERASE);
|
lcdDrawFilledRect(10, 16, LCD_W-20, 40, SOLID, ERASE);
|
||||||
lcdDrawRect(10, 16, LCD_W-20, 40);
|
lcdDrawRect(10, 16, LCD_W-20, 40);
|
||||||
lcd_putsn(WARNING_LINE_X, WARNING_LINE_Y, title, WARNING_LINE_LEN);
|
lcd_putsn(WARNING_LINE_X, WARNING_LINE_Y, title, WARNING_LINE_LEN);
|
||||||
// could be a place for a s_warning_info
|
// could be a place for a s_warning_info
|
||||||
|
@ -83,7 +83,7 @@ void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SO
|
||||||
lcdDrawText(MESSAGE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE);
|
lcdDrawText(MESSAGE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
drawFilledRect(MESSAGE_LCD_OFFSET, 0, LCD_W-MESSAGE_LCD_OFFSET, 32);
|
lcdDrawFilledRect(MESSAGE_LCD_OFFSET, 0, LCD_W-MESSAGE_LCD_OFFSET, 32);
|
||||||
if (t) lcd_puts(MESSAGE_LCD_OFFSET, 5*FH, t);
|
if (t) lcd_puts(MESSAGE_LCD_OFFSET, 5*FH, t);
|
||||||
if (last) {
|
if (last) {
|
||||||
lcd_puts(MESSAGE_LCD_OFFSET, 7*FH, last);
|
lcd_puts(MESSAGE_LCD_OFFSET, 7*FH, last);
|
||||||
|
@ -130,12 +130,12 @@ const char * displayMenu(uint8_t event)
|
||||||
|
|
||||||
uint8_t display_count = min<unsigned int>(s_menu_count, MENU_MAX_DISPLAY_LINES);
|
uint8_t display_count = min<unsigned int>(s_menu_count, MENU_MAX_DISPLAY_LINES);
|
||||||
uint8_t y = (display_count >= 5 ? MENU_Y - FH - 1 : MENU_Y);
|
uint8_t y = (display_count >= 5 ? MENU_Y - FH - 1 : MENU_Y);
|
||||||
drawFilledRect(MENU_X, y, MENU_W, display_count * (FH+1) + 2, SOLID, ERASE);
|
lcdDrawFilledRect(MENU_X, y, MENU_W, display_count * (FH+1) + 2, SOLID, ERASE);
|
||||||
lcdDrawRect(MENU_X, y, MENU_W, display_count * (FH+1) + 2);
|
lcdDrawRect(MENU_X, y, MENU_W, display_count * (FH+1) + 2);
|
||||||
|
|
||||||
for (uint8_t i=0; i<display_count; i++) {
|
for (uint8_t i=0; i<display_count; i++) {
|
||||||
lcdDrawText(MENU_X+6, i*(FH+1) + y + 2, s_menu[i+(s_menu_offset_type == MENU_OFFSET_INTERNAL ? s_menu_offset : 0)], s_menu_flags);
|
lcdDrawText(MENU_X+6, i*(FH+1) + y + 2, s_menu[i+(s_menu_offset_type == MENU_OFFSET_INTERNAL ? s_menu_offset : 0)], s_menu_flags);
|
||||||
if (i == s_menu_item) drawFilledRect(MENU_X+1, i*(FH+1) + y + 1, MENU_W-2, 9);
|
if (i == s_menu_item) lcdDrawFilledRect(MENU_X+1, i*(FH+1) + y + 1, MENU_W-2, 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_menu_count > display_count) {
|
if (s_menu_count > display_count) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ void displaySplash()
|
||||||
|
|
||||||
#if MENUS_LOCK == 1
|
#if MENUS_LOCK == 1
|
||||||
if (readonly == false) {
|
if (readonly == false) {
|
||||||
drawFilledRect((LCD_W-(sizeof(TR_UNLOCKED)-1)*FW)/2 - 9, 50, (sizeof(TR_UNLOCKED)-1)*FW+16, 11, SOLID, ERASE|ROUND);
|
lcdDrawFilledRect((LCD_W-(sizeof(TR_UNLOCKED)-1)*FW)/2 - 9, 50, (sizeof(TR_UNLOCKED)-1)*FW+16, 11, SOLID, ERASE|ROUND);
|
||||||
lcd_puts((LCD_W-(sizeof(TR_UNLOCKED)-1)*FW)/2 , 53, STR_UNLOCKED);
|
lcd_puts((LCD_W-(sizeof(TR_UNLOCKED)-1)*FW)/2 , 53, STR_UNLOCKED);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -84,8 +84,8 @@ void menuAboutView(uint8_t event)
|
||||||
|
|
||||||
lcd_bmp(0, 0, about_bmp);
|
lcd_bmp(0, 0, about_bmp);
|
||||||
lcdDrawText(64, 0, STR_ABOUTUS, DBLSIZE);
|
lcdDrawText(64, 0, STR_ABOUTUS, DBLSIZE);
|
||||||
lcd_hline(ABOUT_X, 18, 120);
|
lcdDrawSolidHorizontalLine(ABOUT_X, 18, 120);
|
||||||
lcd_hline(ABOUT_X, 19, 130, GREY_DEFAULT);
|
lcdDrawSolidHorizontalLine(ABOUT_X, 19, 130, GREY_DEFAULT);
|
||||||
LcdFlags att = GREY(max(0, 15-greyIndex/2));
|
LcdFlags att = GREY(max(0, 15-greyIndex/2));
|
||||||
|
|
||||||
uint8_t screenDuration = 150;
|
uint8_t screenDuration = 150;
|
||||||
|
|
|
@ -74,10 +74,10 @@ void menuChannelsView(uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
lcd_putsCenter(0*FH, CHANNELS_MONITOR);
|
lcd_putsCenter(0*FH, CHANNELS_MONITOR);
|
||||||
|
|
||||||
lcd_invert_line(0);
|
lcdInvertLine(0);
|
||||||
|
|
||||||
// Column separator
|
// Column separator
|
||||||
lcd_vline(LCD_W/2, FH, LCD_H-FH);
|
lcdDrawSolidVerticalLine(LCD_W/2, FH, LCD_H-FH);
|
||||||
|
|
||||||
for (uint8_t col=0; col<2; col++) {
|
for (uint8_t col=0; col<2; col++) {
|
||||||
|
|
||||||
|
|
|
@ -128,21 +128,21 @@ void displayTrims(uint8_t phase)
|
||||||
|
|
||||||
if (vert[i]) {
|
if (vert[i]) {
|
||||||
ym = 31;
|
ym = 31;
|
||||||
lcd_vline(xm, ym-TRIM_LEN, TRIM_LEN*2);
|
lcdDrawSolidVerticalLine(xm, ym-TRIM_LEN, TRIM_LEN*2);
|
||||||
if (i!=2 || !g_model.thrTrim) {
|
if (i!=2 || !g_model.thrTrim) {
|
||||||
lcd_vline(xm-1, ym-1, 3);
|
lcdDrawSolidVerticalLine(xm-1, ym-1, 3);
|
||||||
lcd_vline(xm+1, ym-1, 3);
|
lcdDrawSolidVerticalLine(xm+1, ym-1, 3);
|
||||||
}
|
}
|
||||||
ym -= val;
|
ym -= val;
|
||||||
drawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
|
lcdDrawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
|
||||||
if (trim >= 0) {
|
if (trim >= 0) {
|
||||||
lcd_hline(xm-1, ym-1, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym-1, 3);
|
||||||
}
|
}
|
||||||
if (trim <= 0) {
|
if (trim <= 0) {
|
||||||
lcd_hline(xm-1, ym+1, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym+1, 3);
|
||||||
}
|
}
|
||||||
if (exttrim) {
|
if (exttrim) {
|
||||||
lcd_hline(xm-1, ym, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym, 3);
|
||||||
}
|
}
|
||||||
if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
|
if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
|
||||||
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
|
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
|
||||||
|
@ -152,19 +152,19 @@ void displayTrims(uint8_t phase)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ym = 60;
|
ym = 60;
|
||||||
lcd_hline(xm-TRIM_LEN, ym, TRIM_LEN*2);
|
lcdDrawSolidHorizontalLine(xm-TRIM_LEN, ym, TRIM_LEN*2);
|
||||||
lcd_hline(xm-1, ym-1, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym-1, 3);
|
||||||
lcd_hline(xm-1, ym+1, 3);
|
lcdDrawSolidHorizontalLine(xm-1, ym+1, 3);
|
||||||
xm += val;
|
xm += val;
|
||||||
drawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
|
lcdDrawFilledRect(xm-3, ym-3, 7, 7, SOLID, att|ERASE);
|
||||||
if (trim >= 0) {
|
if (trim >= 0) {
|
||||||
lcd_vline(xm+1, ym-1, 3);
|
lcdDrawSolidVerticalLine(xm+1, ym-1, 3);
|
||||||
}
|
}
|
||||||
if (trim <= 0) {
|
if (trim <= 0) {
|
||||||
lcd_vline(xm-1, ym-1, 3);
|
lcdDrawSolidVerticalLine(xm-1, ym-1, 3);
|
||||||
}
|
}
|
||||||
if (exttrim) {
|
if (exttrim) {
|
||||||
lcd_vline(xm, ym-1, 3);
|
lcdDrawSolidVerticalLine(xm, ym-1, 3);
|
||||||
}
|
}
|
||||||
if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
|
if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
|
||||||
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
|
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
|
||||||
|
@ -172,7 +172,7 @@ void displayTrims(uint8_t phase)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lcd_square(xm-3, ym-3, 7, att);
|
lcdDrawSquare(xm-3, ym-3, 7, att);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,12 +188,12 @@ void drawSliders()
|
||||||
coord_t x = ((i==POT1 || i==SLIDER1) ? 3 : LCD_W-5);
|
coord_t x = ((i==POT1 || i==SLIDER1) ? 3 : LCD_W-5);
|
||||||
int8_t y = (i>=SLIDER1 ? LCD_H/2+1 : 1);
|
int8_t y = (i>=SLIDER1 ? LCD_H/2+1 : 1);
|
||||||
#endif
|
#endif
|
||||||
lcd_vline(x, y, LCD_H/2-2);
|
lcdDrawSolidVerticalLine(x, y, LCD_H/2-2);
|
||||||
lcd_vline(x+1, y, LCD_H/2-2);
|
lcdDrawSolidVerticalLine(x+1, y, LCD_H/2-2);
|
||||||
y += LCD_H/2-4;
|
y += LCD_H/2-4;
|
||||||
y -= ((calibratedStick[i]+RESX)*(LCD_H/2-4)/(RESX*2)); // calculate once per loop
|
y -= ((calibratedStick[i]+RESX)*(LCD_H/2-4)/(RESX*2)); // calculate once per loop
|
||||||
lcd_vline(x-1, y, 2);
|
lcdDrawSolidVerticalLine(x-1, y, 2);
|
||||||
lcd_vline(x+2, y, 2);
|
lcdDrawSolidVerticalLine(x+2, y, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,14 +208,14 @@ void drawSliders()
|
||||||
void displayTopBarGauge(coord_t x, int count, bool blinking=false)
|
void displayTopBarGauge(coord_t x, int count, bool blinking=false)
|
||||||
{
|
{
|
||||||
if (!blinking || BLINK_ON_PHASE)
|
if (!blinking || BLINK_ON_PHASE)
|
||||||
drawFilledRect(x+1, BAR_Y+2, 11, 5, SOLID, ERASE);
|
lcdDrawFilledRect(x+1, BAR_Y+2, 11, 5, SOLID, ERASE);
|
||||||
for (int i=0; i<count; i+=2)
|
for (int i=0; i<count; i+=2)
|
||||||
lcd_vline(x+2+i, BAR_Y+3, 3);
|
lcdDrawSolidVerticalLine(x+2+i, BAR_Y+3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LCD_NOTIF_ICON(x, icon) \
|
#define LCD_NOTIF_ICON(x, icon) \
|
||||||
lcd_bmp(x, BAR_Y, icons, icon); \
|
lcd_bmp(x, BAR_Y, icons, icon); \
|
||||||
lcd_hline(x, BAR_Y+8, 11)
|
lcdDrawSolidHorizontalLine(x, BAR_Y+8, 11)
|
||||||
|
|
||||||
void displayTopBar()
|
void displayTopBar()
|
||||||
{
|
{
|
||||||
|
@ -226,7 +226,7 @@ void displayTopBar()
|
||||||
putsVBat(BAR_X+2, BAR_Y+1, LEFT);
|
putsVBat(BAR_X+2, BAR_Y+1, LEFT);
|
||||||
batt_icon_x = lcdLastPos;
|
batt_icon_x = lcdLastPos;
|
||||||
lcdDrawRect(batt_icon_x+FW, BAR_Y+1, 13, 7);
|
lcdDrawRect(batt_icon_x+FW, BAR_Y+1, 13, 7);
|
||||||
lcd_vline(batt_icon_x+FW+13, BAR_Y+2, 5);
|
lcdDrawSolidVerticalLine(batt_icon_x+FW+13, BAR_Y+2, 5);
|
||||||
|
|
||||||
if (TELEMETRY_STREAMING()) {
|
if (TELEMETRY_STREAMING()) {
|
||||||
/* RSSI */
|
/* RSSI */
|
||||||
|
@ -302,7 +302,7 @@ void displayTopBar()
|
||||||
putsRtcTime(BAR_TIME_X, BAR_Y+1, LEFT|TIMEBLINK);
|
putsRtcTime(BAR_TIME_X, BAR_Y+1, LEFT|TIMEBLINK);
|
||||||
|
|
||||||
/* The background */
|
/* The background */
|
||||||
drawFilledRect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY(12)|ROUND);
|
lcdDrawFilledRect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY(12)|ROUND);
|
||||||
|
|
||||||
/* The inside of the Batt gauge */
|
/* The inside of the Batt gauge */
|
||||||
displayTopBarGauge(batt_icon_x+FW, GET_TXBATT_BARS(), IS_TXBATT_WARNING());
|
displayTopBarGauge(batt_icon_x+FW, GET_TXBATT_BARS(), IS_TXBATT_WARNING());
|
||||||
|
@ -333,7 +333,7 @@ void displayTimers()
|
||||||
}
|
}
|
||||||
if (timerState.val < 0) {
|
if (timerState.val < 0) {
|
||||||
if (BLINK_ON_PHASE) {
|
if (BLINK_ON_PHASE) {
|
||||||
drawFilledRect(TIMERS_X-7, y-8, 60, 20);
|
lcdDrawFilledRect(TIMERS_X-7, y-8, 60, 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -396,12 +396,12 @@ void displaySwitch(coord_t x, coord_t y, int width, unsigned int index)
|
||||||
int val = getValue(MIXSRC_FIRST_SWITCH+index);
|
int val = getValue(MIXSRC_FIRST_SWITCH+index);
|
||||||
|
|
||||||
if (val >= 0) {
|
if (val >= 0) {
|
||||||
lcd_hline(x, y, width);
|
lcdDrawSolidHorizontalLine(x, y, width);
|
||||||
lcd_hline(x, y+2, width);
|
lcdDrawSolidHorizontalLine(x, y+2, width);
|
||||||
y += 4;
|
y += 4;
|
||||||
if (val > 0) {
|
if (val > 0) {
|
||||||
lcd_hline(x, y, width);
|
lcdDrawSolidHorizontalLine(x, y, width);
|
||||||
lcd_hline(x, y+2, width);
|
lcdDrawSolidHorizontalLine(x, y+2, width);
|
||||||
y += 4;
|
y += 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -410,11 +410,11 @@ void displaySwitch(coord_t x, coord_t y, int width, unsigned int index)
|
||||||
y += 6;
|
y += 6;
|
||||||
|
|
||||||
if (val <= 0) {
|
if (val <= 0) {
|
||||||
lcd_hline(x, y, width);
|
lcdDrawSolidHorizontalLine(x, y, width);
|
||||||
lcd_hline(x, y+2, width);
|
lcdDrawSolidHorizontalLine(x, y+2, width);
|
||||||
if (val < 0) {
|
if (val < 0) {
|
||||||
lcd_hline(x, y+4, width);
|
lcdDrawSolidHorizontalLine(x, y+4, width);
|
||||||
lcd_hline(x, y+6, width);
|
lcdDrawSolidHorizontalLine(x, y+6, width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -575,11 +575,11 @@ void menuMainView(uint8_t event)
|
||||||
uint8_t x = TRIM_RH_X - TRIM_LEN + qr.rem*5 + (qr.rem >= 5 ? 3 : 0);
|
uint8_t x = TRIM_RH_X - TRIM_LEN + qr.rem*5 + (qr.rem >= 5 ? 3 : 0);
|
||||||
LogicalSwitchData * cs = lswAddress(sw);
|
LogicalSwitchData * cs = lswAddress(sw);
|
||||||
if (cs->func == LS_FUNC_NONE) {
|
if (cs->func == LS_FUNC_NONE) {
|
||||||
lcd_hline(x, y+6, 4);
|
lcdDrawSolidHorizontalLine(x, y+6, 4);
|
||||||
lcd_hline(x, y+7, 4);
|
lcdDrawSolidHorizontalLine(x, y+7, 4);
|
||||||
}
|
}
|
||||||
else if (getSwitch(SWSRC_SW1+sw)) {
|
else if (getSwitch(SWSRC_SW1+sw)) {
|
||||||
drawFilledRect(x, y, 4, 8);
|
lcdDrawFilledRect(x, y, 4, 8);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawRect(x, y, 4, 8);
|
lcdDrawRect(x, y, 4, 8);
|
||||||
|
@ -590,7 +590,7 @@ void menuMainView(uint8_t event)
|
||||||
#if defined(GVARS)
|
#if defined(GVARS)
|
||||||
if (s_gvar_timer > 0) {
|
if (s_gvar_timer > 0) {
|
||||||
s_gvar_timer--;
|
s_gvar_timer--;
|
||||||
drawFilledRect(BITMAP_X, BITMAP_Y, 64, 32, SOLID, ERASE);
|
lcdDrawFilledRect(BITMAP_X, BITMAP_Y, 64, 32, SOLID, ERASE);
|
||||||
lcdDrawRect(BITMAP_X, BITMAP_Y, 64, 32);
|
lcdDrawRect(BITMAP_X, BITMAP_Y, 64, 32);
|
||||||
putsStrIdx(BITMAP_X+FW, BITMAP_Y+FH-1, STR_GV, s_gvar_last+1);
|
putsStrIdx(BITMAP_X+FW, BITMAP_Y+FH-1, STR_GV, s_gvar_last+1);
|
||||||
lcdDrawTextWithLen(BITMAP_X+4*FW+FW/2, BITMAP_Y+FH-1, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR);
|
lcdDrawTextWithLen(BITMAP_X+4*FW+FW/2, BITMAP_Y+FH-1, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR);
|
||||||
|
|
|
@ -79,14 +79,14 @@ void menuStatisticsView(uint8_t event)
|
||||||
coord_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0);
|
coord_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0);
|
||||||
const coord_t x = 5;
|
const coord_t x = 5;
|
||||||
const coord_t y = 60;
|
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);
|
lcdDrawSolidVerticalLine(x, y-32, 32+3);
|
||||||
|
|
||||||
for (coord_t i=0; i<MAXTRACE; i+=6) {
|
for (coord_t i=0; i<MAXTRACE; i+=6) {
|
||||||
lcd_vline(x+i+6, y-1, 3);
|
lcdDrawSolidVerticalLine(x+i+6, y-1, 3);
|
||||||
}
|
}
|
||||||
for (coord_t i=1; i<=MAXTRACE; i++) {
|
for (coord_t i=1; i<=MAXTRACE; i++) {
|
||||||
lcd_vline(x+i, y-s_traceBuf[traceRd], s_traceBuf[traceRd]);
|
lcdDrawSolidVerticalLine(x+i, y-s_traceBuf[traceRd], s_traceBuf[traceRd]);
|
||||||
traceRd++;
|
traceRd++;
|
||||||
if (traceRd>=MAXTRACE) traceRd = 0;
|
if (traceRd>=MAXTRACE) traceRd = 0;
|
||||||
if (traceRd==s_traceWr) break;
|
if (traceRd==s_traceWr) break;
|
||||||
|
@ -198,7 +198,7 @@ void menuStatisticsDebug(uint8_t event)
|
||||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stackAvailable(), UNSIGN|LEFT);
|
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stackAvailable(), UNSIGN|LEFT);
|
||||||
|
|
||||||
lcd_puts(3*FW, 7*FH+1, STR_MENUTORESET);
|
lcd_puts(3*FW, 7*FH+1, STR_MENUTORESET);
|
||||||
lcd_status_line();
|
lcdInvertLastLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,15 +51,15 @@ uint8_t s_frsky_view = 0;
|
||||||
void displayRssiLine()
|
void displayRssiLine()
|
||||||
{
|
{
|
||||||
if (TELEMETRY_STREAMING()) {
|
if (TELEMETRY_STREAMING()) {
|
||||||
lcd_hline(0, 55, 212, 0); // separator
|
lcdDrawSolidHorizontalLine(0, 55, 212, 0); // separator
|
||||||
uint8_t rssi = min((uint8_t)99, TELEMETRY_RSSI());
|
uint8_t rssi = min((uint8_t)99, TELEMETRY_RSSI());
|
||||||
lcd_putsn(0, STATUS_BAR_Y, STR_RX, 2); lcd_outdezNAtt(4*FW, STATUS_BAR_Y, rssi, LEADING0, 2);
|
lcd_putsn(0, STATUS_BAR_Y, STR_RX, 2); lcd_outdezNAtt(4*FW, STATUS_BAR_Y, rssi, LEADING0, 2);
|
||||||
lcdDrawRect(BAR_LEFT, 57, 78, 7);
|
lcdDrawRect(BAR_LEFT, 57, 78, 7);
|
||||||
drawFilledRect(BAR_LEFT+1, 58, 19*rssi/25, 5, (rssi < getRssiAlarmValue(0)) ? DOTTED : SOLID);
|
lcdDrawFilledRect(BAR_LEFT+1, 58, 19*rssi/25, 5, (rssi < getRssiAlarmValue(0)) ? DOTTED : SOLID);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawText(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
|
lcdDrawText(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
|
||||||
lcd_status_line();
|
lcdInvertLastLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,15 +100,15 @@ void displayGaugesTelemetryScreen(FrSkyScreenData & screen)
|
||||||
uint8_t thresholdX = 0;
|
uint8_t thresholdX = 0;
|
||||||
int width = barCoord(value, barMin, barMax);
|
int width = barCoord(value, barMin, barMax);
|
||||||
uint8_t barShade = SOLID;
|
uint8_t barShade = SOLID;
|
||||||
drawFilledRect(BAR_LEFT+1, y+1, width, barHeight, barShade);
|
lcdDrawFilledRect(BAR_LEFT+1, y+1, width, barHeight, barShade);
|
||||||
for (uint8_t j=24; j<99; j+=25) {
|
for (uint8_t j=24; j<99; j+=25) {
|
||||||
if (j>thresholdX || j>width) {
|
if (j>thresholdX || j>width) {
|
||||||
lcd_vline(j*BAR_WIDTH/100+BAR_LEFT+1, y+1, barHeight);
|
lcdDrawSolidVerticalLine(j*BAR_WIDTH/100+BAR_LEFT+1, y+1, barHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (thresholdX) {
|
if (thresholdX) {
|
||||||
lcdDrawVerticalLine(BAR_LEFT+1+thresholdX, y-2, barHeight+3, DOTTED);
|
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 {
|
else {
|
||||||
|
@ -129,8 +129,8 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||||
fields_count++;
|
fields_count++;
|
||||||
}
|
}
|
||||||
if (i==3) {
|
if (i==3) {
|
||||||
lcd_vline(69, 8, 48);
|
lcdDrawSolidVerticalLine(69, 8, 48);
|
||||||
lcd_vline(141, 8, 48);
|
lcdDrawSolidVerticalLine(141, 8, 48);
|
||||||
if (!TELEMETRY_STREAMING()) {
|
if (!TELEMETRY_STREAMING()) {
|
||||||
displayRssiLine();
|
displayRssiLine();
|
||||||
return fields_count;
|
return fields_count;
|
||||||
|
@ -165,7 +165,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lcd_status_line();
|
lcdInvertLastLine();
|
||||||
return fields_count;
|
return fields_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ void menuTextView(uint8_t event)
|
||||||
// TODO?
|
// TODO?
|
||||||
#endif
|
#endif
|
||||||
lcd_puts(LCD_W/2-strlen(title)*FW/2, 0, title);
|
lcd_puts(LCD_W/2-strlen(title)*FW/2, 0, title);
|
||||||
lcd_invert_line(0);
|
lcdInvertLine(0);
|
||||||
|
|
||||||
if (lines_count > LCD_LINES-1) {
|
if (lines_count > LCD_LINES-1) {
|
||||||
drawVerticalScrollbar(LCD_W-1, FH, LCD_H-FH, s_pgOfs, lines_count, LCD_LINES-1);
|
drawVerticalScrollbar(LCD_W-1, FH, LCD_H-FH, s_pgOfs, lines_count, LCD_LINES-1);
|
||||||
|
|
|
@ -51,10 +51,10 @@ void drawStick(coord_t centrex, int16_t xval, int16_t yval)
|
||||||
{
|
{
|
||||||
#define BOX_CENTERY (LCD_H-BOX_WIDTH/2-10)
|
#define BOX_CENTERY (LCD_H-BOX_WIDTH/2-10)
|
||||||
#define MARKER_WIDTH 5
|
#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);
|
lcdDrawSolidVerticalLine(centrex, BOX_CENTERY-1, 3);
|
||||||
lcd_hline(centrex-1, BOX_CENTERY, 3);
|
lcdDrawSolidHorizontalLine(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);
|
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 BOX_CENTERY
|
||||||
#undef MARKER_WIDTH
|
#undef MARKER_WIDTH
|
||||||
}
|
}
|
||||||
|
@ -69,9 +69,9 @@ void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
||||||
if (value)
|
if (value)
|
||||||
lcd_putc(x+1, y, '#');
|
lcd_putc(x+1, y, '#');
|
||||||
if (attr)
|
if (attr)
|
||||||
drawFilledRect(x, y, 7, 7);
|
lcdDrawFilledRect(x, y, 7, 7);
|
||||||
else
|
else
|
||||||
lcd_square(x, y, 7);
|
lcdDrawSquare(x, y, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
||||||
|
@ -103,9 +103,9 @@ void updateProgressBar(int num, int den)
|
||||||
{
|
{
|
||||||
if (num > 0 && den > 0) {
|
if (num > 0 && den > 0) {
|
||||||
int width = (200*num)/den;
|
int width = (200*num)/den;
|
||||||
lcd_hline(5, 6*FH+6, width, FORCE);
|
lcdDrawSolidHorizontalLine(5, 6*FH+6, width, FORCE);
|
||||||
lcd_hline(5, 6*FH+7, width, FORCE);
|
lcdDrawSolidHorizontalLine(5, 6*FH+7, width, FORCE);
|
||||||
lcd_hline(5, 6*FH+8, width, FORCE);
|
lcdDrawSolidHorizontalLine(5, 6*FH+8, width, FORCE);
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,11 +113,11 @@ 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)
|
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max)
|
||||||
{
|
{
|
||||||
lcdDrawRect(x, y, w+1, h);
|
lcdDrawRect(x, y, w+1, h);
|
||||||
drawFilledRect(x+1, y+1, w-1, 4, SOLID, ERASE);
|
lcdDrawFilledRect(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 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;
|
coord_t x0 = (val>0) ? x+w/2 : x+1+w/2-len;
|
||||||
for (coord_t i=h-2; i>0; i--) {
|
for (coord_t i=h-2; i>0; i--) {
|
||||||
lcd_hline(x0, y+i, len);
|
lcdDrawSolidHorizontalLine(x0, y+i, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,8 +151,8 @@ swsrc_t switchMenuItem(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, uint8
|
||||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
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_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);
|
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) lcdDrawFilledRect(x, y, 5*FW-1, FH-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(GVARS)
|
#if defined(GVARS)
|
||||||
|
@ -240,9 +240,9 @@ void drawStatusLine()
|
||||||
statusLineTime = 0;
|
statusLineTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawFilledRect(0, LCD_H-statusLineHeight, LCD_W, FH, SOLID, ERASE);
|
lcdDrawFilledRect(0, LCD_H-statusLineHeight, LCD_W, FH, SOLID, ERASE);
|
||||||
lcdDrawText(5, LCD_H+1-statusLineHeight, statusLineMsg, BSS);
|
lcdDrawText(5, LCD_H+1-statusLineHeight, statusLineMsg, BSS);
|
||||||
drawFilledRect(0, LCD_H-statusLineHeight, LCD_W, FH, SOLID);
|
lcdDrawFilledRect(0, LCD_H-statusLineHeight, LCD_W, FH, SOLID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -54,7 +54,10 @@
|
||||||
#define RADIO "taranisplus"
|
#define RADIO "taranisplus"
|
||||||
#elif defined(PCBTARANIS)
|
#elif defined(PCBTARANIS)
|
||||||
#define RADIO "taranis"
|
#define RADIO "taranis"
|
||||||
#else
|
#elif defined(PCBHORUS)
|
||||||
|
#define RADIO "horus"
|
||||||
|
#elif defined(PCBFLAMENCO)
|
||||||
|
#define RADIO "flamenco"
|
||||||
#error "Unknown board"
|
#error "Unknown board"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -719,11 +722,9 @@ const luaR_value_entry opentxConstants[] = {
|
||||||
{ "MIXSRC_CH1", MIXSRC_CH1 },
|
{ "MIXSRC_CH1", MIXSRC_CH1 },
|
||||||
{ "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH },
|
{ "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH },
|
||||||
{ "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU) },
|
{ "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU) },
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
{ "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE) },
|
{ "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE) },
|
||||||
{ "EVT_PAGE_LONG", EVT_KEY_LONG(KEY_PAGE) },
|
{ "EVT_PAGE_LONG", EVT_KEY_LONG(KEY_PAGE) },
|
||||||
{ "EVT_ENTER_BREAK", EVT_KEY_BREAK(KEY_ENTER) },
|
|
||||||
{ "EVT_ENTER_LONG", EVT_KEY_LONG(KEY_ENTER) },
|
|
||||||
{ "EVT_EXIT_BREAK", EVT_KEY_BREAK(KEY_EXIT) },
|
|
||||||
{ "EVT_PLUS_BREAK", EVT_KEY_BREAK(KEY_PLUS) },
|
{ "EVT_PLUS_BREAK", EVT_KEY_BREAK(KEY_PLUS) },
|
||||||
{ "EVT_MINUS_BREAK", EVT_KEY_BREAK(KEY_MINUS) },
|
{ "EVT_MINUS_BREAK", EVT_KEY_BREAK(KEY_MINUS) },
|
||||||
{ "EVT_PLUS_FIRST", EVT_KEY_FIRST(KEY_PLUS) },
|
{ "EVT_PLUS_FIRST", EVT_KEY_FIRST(KEY_PLUS) },
|
||||||
|
@ -732,11 +733,15 @@ const luaR_value_entry opentxConstants[] = {
|
||||||
{ "EVT_MINUS_REPT", EVT_KEY_REPT(KEY_MINUS) },
|
{ "EVT_MINUS_REPT", EVT_KEY_REPT(KEY_MINUS) },
|
||||||
{ "FILL_WHITE", FILL_WHITE },
|
{ "FILL_WHITE", FILL_WHITE },
|
||||||
{ "GREY_DEFAULT", GREY_DEFAULT },
|
{ "GREY_DEFAULT", GREY_DEFAULT },
|
||||||
{ "SOLID", SOLID },
|
|
||||||
{ "DOTTED", DOTTED },
|
|
||||||
{ "FORCE", FORCE },
|
{ "FORCE", FORCE },
|
||||||
{ "ERASE", ERASE },
|
{ "ERASE", ERASE },
|
||||||
{ "ROUND", ROUND },
|
{ "ROUND", ROUND },
|
||||||
|
#endif
|
||||||
|
{ "EVT_ENTER_BREAK", EVT_KEY_BREAK(KEY_ENTER) },
|
||||||
|
{ "EVT_ENTER_LONG", EVT_KEY_LONG(KEY_ENTER) },
|
||||||
|
{ "EVT_EXIT_BREAK", EVT_KEY_BREAK(KEY_EXIT) },
|
||||||
|
{ "SOLID", SOLID },
|
||||||
|
{ "DOTTED", DOTTED },
|
||||||
{ "LCD_W", LCD_W },
|
{ "LCD_W", LCD_W },
|
||||||
{ "LCD_H", LCD_H },
|
{ "LCD_H", LCD_H },
|
||||||
{ "PLAY_NOW", PLAY_NOW },
|
{ "PLAY_NOW", PLAY_NOW },
|
||||||
|
|
|
@ -88,7 +88,7 @@ static int luaLcdDrawPoint(lua_State *L)
|
||||||
if (!luaLcdAllowed) return 0;
|
if (!luaLcdAllowed) return 0;
|
||||||
int x = luaL_checkinteger(L, 1);
|
int x = luaL_checkinteger(L, 1);
|
||||||
int y = luaL_checkinteger(L, 2);
|
int y = luaL_checkinteger(L, 2);
|
||||||
lcd_plot(x, y);
|
lcdDrawPoint(x, y);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ static int luaLcdDrawFilledRectangle(lua_State *L)
|
||||||
int w = luaL_checkinteger(L, 3);
|
int w = luaL_checkinteger(L, 3);
|
||||||
int h = luaL_checkinteger(L, 4);
|
int h = luaL_checkinteger(L, 4);
|
||||||
unsigned int flags = luaL_optunsigned(L, 5, 0);
|
unsigned int flags = luaL_optunsigned(L, 5, 0);
|
||||||
drawFilledRect(x, y, w, h, SOLID, flags);
|
lcdDrawFilledRect(x, y, w, h, SOLID, flags);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@ static int luaLcdDrawGauge(lua_State *L)
|
||||||
lcdDrawRect(x, y, w, h);
|
lcdDrawRect(x, y, w, h);
|
||||||
uint8_t len = limit((uint8_t)1, uint8_t(w*num/den), uint8_t(w));
|
uint8_t len = limit((uint8_t)1, uint8_t(w*num/den), uint8_t(w));
|
||||||
for (int i=1; i<h-1; i++) {
|
for (int i=1; i<h-1; i++) {
|
||||||
lcd_hline(x+1, y+i, len);
|
lcdDrawSolidHorizontalLine(x+1, y+i, len);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -468,13 +468,15 @@ static int luaLcdDrawScreenTitle(lua_State *L)
|
||||||
int cnt = luaL_checkinteger(L, 3);
|
int cnt = luaL_checkinteger(L, 3);
|
||||||
|
|
||||||
if (cnt) displayScreenIndex(idx-1, cnt, 0);
|
if (cnt) displayScreenIndex(idx-1, cnt, 0);
|
||||||
drawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||||
title(str);
|
title(str);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
|
||||||
/*luadoc
|
/*luadoc
|
||||||
@function lcd.drawCombobox(x, y, w, list, idx [, flags])
|
@function lcd.drawCombobox(x, y, w, list, idx [, flags])
|
||||||
|
|
||||||
|
@ -511,39 +513,40 @@ static int luaLcdDrawCombobox(lua_State *L)
|
||||||
// TODO error
|
// TODO error
|
||||||
}
|
}
|
||||||
if (flags & BLINK) {
|
if (flags & BLINK) {
|
||||||
drawFilledRect(x, y, w-9, count*9+2, SOLID, ERASE);
|
lcdDrawFilledRect(x, y, w-9, count*9+2, SOLID, ERASE);
|
||||||
lcdDrawRect(x, y, w-9, count*9+2);
|
lcdDrawRect(x, y, w-9, count*9+2);
|
||||||
for (int i=0; i<count; i++) {
|
for (int i=0; i<count; i++) {
|
||||||
lua_rawgeti(L, 4, i+1);
|
lua_rawgeti(L, 4, i+1);
|
||||||
const char * item = luaL_checkstring(L, -1);
|
const char * item = luaL_checkstring(L, -1);
|
||||||
lcdDrawText(x+2, y+2+9*i, item, 0);
|
lcdDrawText(x+2, y+2+9*i, item, 0);
|
||||||
}
|
}
|
||||||
drawFilledRect(x+1, y+1+9*idx, w-11, 9);
|
lcdDrawFilledRect(x+1, y+1+9*idx, w-11, 9);
|
||||||
drawFilledRect(x+w-10, y, 10, 11, SOLID, ERASE);
|
lcdDrawFilledRect(x+w-10, y, 10, 11, SOLID, ERASE);
|
||||||
lcdDrawRect(x+w-10, y, 10, 11);
|
lcdDrawRect(x+w-10, y, 10, 11);
|
||||||
}
|
}
|
||||||
else if (flags & INVERS) {
|
else if (flags & INVERS) {
|
||||||
drawFilledRect(x, y, w, 11);
|
lcdDrawFilledRect(x, y, w, 11);
|
||||||
drawFilledRect(x+w-9, y+1, 8, 9, SOLID, ERASE);
|
lcdDrawFilledRect(x+w-9, y+1, 8, 9, SOLID, ERASE);
|
||||||
lua_rawgeti(L, 4, idx+1);
|
lua_rawgeti(L, 4, idx+1);
|
||||||
const char * item = luaL_checkstring(L, -1);
|
const char * item = luaL_checkstring(L, -1);
|
||||||
lcdDrawText(x+2, y+2, item, INVERS);
|
lcdDrawText(x+2, y+2, item, INVERS);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
drawFilledRect(x, y, w, 11, SOLID, ERASE);
|
lcdDrawFilledRect(x, y, w, 11, SOLID, ERASE);
|
||||||
lcdDrawRect(x, y, w, 11);
|
lcdDrawRect(x, y, w, 11);
|
||||||
drawFilledRect(x+w-10, y+1, 9, 9, SOLID);
|
lcdDrawFilledRect(x+w-10, y+1, 9, 9, SOLID);
|
||||||
lua_rawgeti(L, 4, idx+1);
|
lua_rawgeti(L, 4, idx+1);
|
||||||
const char * item = luaL_checkstring(L, -1);
|
const char * item = luaL_checkstring(L, -1);
|
||||||
lcdDrawText(x+2, y+2, item, 0);
|
lcdDrawText(x+2, y+2, item, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_hline(x+w-8, y+3, 6);
|
lcdDrawSolidHorizontalLine(x+w-8, y+3, 6);
|
||||||
lcd_hline(x+w-8, y+5, 6);
|
lcdDrawSolidHorizontalLine(x+w-8, y+5, 6);
|
||||||
lcd_hline(x+w-8, y+7, 6);
|
lcdDrawSolidHorizontalLine(x+w-8, y+7, 6);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const luaL_Reg lcdLib[] = {
|
const luaL_Reg lcdLib[] = {
|
||||||
{ "lock", luaLcdLock },
|
{ "lock", luaLcdLock },
|
||||||
|
@ -562,6 +565,8 @@ const luaL_Reg lcdLib[] = {
|
||||||
{ "drawSource", luaLcdDrawSource },
|
{ "drawSource", luaLcdDrawSource },
|
||||||
{ "drawPixmap", luaLcdDrawPixmap },
|
{ "drawPixmap", luaLcdDrawPixmap },
|
||||||
{ "drawScreenTitle", luaLcdDrawScreenTitle },
|
{ "drawScreenTitle", luaLcdDrawScreenTitle },
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
{ "drawCombobox", luaLcdDrawCombobox },
|
{ "drawCombobox", luaLcdDrawCombobox },
|
||||||
|
#endif
|
||||||
{ NULL, NULL } /* sentinel */
|
{ NULL, NULL } /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
|
@ -479,7 +479,7 @@ void displayLuaError(const char * title)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayAcknowledgeLuaError(uint8_t event)
|
void displayAcknowledgeLuaError(evt_t event)
|
||||||
{
|
{
|
||||||
s_warning_result = false;
|
s_warning_result = false;
|
||||||
displayLuaError(s_warning);
|
displayLuaError(s_warning);
|
||||||
|
@ -583,12 +583,15 @@ void luaDoOneRunStandalone(uint8_t evt)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (luaDisplayStatistics) {
|
else if (luaDisplayStatistics) {
|
||||||
lcd_hline(0, 7*FH-1, lcdLastPos+6, ERASE);
|
#if defined(COLORLCD)
|
||||||
|
#else
|
||||||
|
lcdDrawSolidHorizontalLine(0, 7*FH-1, lcdLastPos+6, ERASE);
|
||||||
lcd_puts(0, 7*FH, "GV Use: ");
|
lcd_puts(0, 7*FH, "GV Use: ");
|
||||||
lcd_outdezAtt(lcdLastPos, 7*FH, luaGetMemUsed(), LEFT);
|
lcd_outdezAtt(lcdLastPos, 7*FH, luaGetMemUsed(), LEFT);
|
||||||
lcd_putc(lcdLastPos, 7*FH, 'b');
|
lcd_putc(lcdLastPos, 7*FH, 'b');
|
||||||
lcd_hline(0, 7*FH-2, lcdLastPos+6, FORCE);
|
lcdDrawSolidHorizontalLine(0, 7*FH-2, lcdLastPos+6, FORCE);
|
||||||
lcdDrawVerticalLine(lcdLastPos+6, 7*FH-2, FH+2, SOLID, FORCE);
|
lcdDrawVerticalLine(lcdLastPos+6, 7*FH-2, FH+2, SOLID, FORCE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,7 +283,7 @@ extern CurveInfo curveInfo(uint8_t idx);
|
||||||
#define CURVDATA int8_t
|
#define CURVDATA int8_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS) || defined(PCBSKY9X)
|
#if defined(PCBTARANIS) || defined(PCBSKY9X) || defined(PCBHORUS)
|
||||||
#define NUM_MODULES 2
|
#define NUM_MODULES 2
|
||||||
#else
|
#else
|
||||||
#define NUM_MODULES 1
|
#define NUM_MODULES 1
|
||||||
|
|
|
@ -57,7 +57,7 @@ Clipboard clipboard;
|
||||||
|
|
||||||
#if (defined(PCBTARANIS) || defined(PCBHORUS)) && defined(SDCARD)
|
#if (defined(PCBTARANIS) || defined(PCBHORUS)) && defined(SDCARD)
|
||||||
uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
||||||
void loadModelBitmap(char * name, uint8_t * bitmap)
|
bool loadModelBitmap(char * name, uint8_t * bitmap)
|
||||||
{
|
{
|
||||||
uint8_t len = zlen(name, LEN_BITMAP_NAME);
|
uint8_t len = zlen(name, LEN_BITMAP_NAME);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
|
@ -65,7 +65,7 @@ void loadModelBitmap(char * name, uint8_t * bitmap)
|
||||||
strncpy(lfn+sizeof(BITMAPS_PATH), name, len);
|
strncpy(lfn+sizeof(BITMAPS_PATH), name, len);
|
||||||
strcpy(lfn+sizeof(BITMAPS_PATH)+len, BITMAPS_EXT);
|
strcpy(lfn+sizeof(BITMAPS_PATH)+len, BITMAPS_EXT);
|
||||||
if (bmpLoad(bitmap, lfn, MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT) == 0) {
|
if (bmpLoad(bitmap, lfn, MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT) == 0) {
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,6 +73,8 @@ void loadModelBitmap(char * name, uint8_t * bitmap)
|
||||||
// In all error cases, we set the default logo
|
// In all error cases, we set the default logo
|
||||||
memcpy(bitmap, logo_taranis, MODEL_BITMAP_SIZE);
|
memcpy(bitmap, logo_taranis, MODEL_BITMAP_SIZE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -462,7 +462,7 @@
|
||||||
#define MODEL_BITMAP_HEIGHT (3*32) // 101
|
#define MODEL_BITMAP_HEIGHT (3*32) // 101
|
||||||
#define MODEL_BITMAP_SIZE BITMAP_BUFFER_SIZE(MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT)
|
#define MODEL_BITMAP_SIZE BITMAP_BUFFER_SIZE(MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT)
|
||||||
extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
||||||
void loadModelBitmap(char * name, uint8_t * bitmap);
|
bool loadModelBitmap(char * name, uint8_t * bitmap);
|
||||||
#define LOAD_MODEL_BITMAP() loadModelBitmap(g_model.header.bitmap, modelBitmap)
|
#define LOAD_MODEL_BITMAP() loadModelBitmap(g_model.header.bitmap, modelBitmap)
|
||||||
#elif defined(PCBTARANIS)
|
#elif defined(PCBTARANIS)
|
||||||
#define BITMAP_BUFFER_SIZE(width, height) (2 + (width) * (((height)+7)/8)*4)
|
#define BITMAP_BUFFER_SIZE(width, height) (2 + (width) * (((height)+7)/8)*4)
|
||||||
|
@ -470,7 +470,7 @@
|
||||||
#define MODEL_BITMAP_HEIGHT 32
|
#define MODEL_BITMAP_HEIGHT 32
|
||||||
#define MODEL_BITMAP_SIZE BITMAP_BUFFER_SIZE(MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT)
|
#define MODEL_BITMAP_SIZE BITMAP_BUFFER_SIZE(MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT)
|
||||||
extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
||||||
void loadModelBitmap(char * name, uint8_t * bitmap);
|
bool loadModelBitmap(char * name, uint8_t * bitmap);
|
||||||
#define LOAD_MODEL_BITMAP() loadModelBitmap(g_model.header.bitmap, modelBitmap)
|
#define LOAD_MODEL_BITMAP() loadModelBitmap(g_model.header.bitmap, modelBitmap)
|
||||||
#else
|
#else
|
||||||
#define LOAD_MODEL_BITMAP()
|
#define LOAD_MODEL_BITMAP()
|
||||||
|
|
|
@ -1435,9 +1435,9 @@ bool eeConvert()
|
||||||
for (uint8_t id=0; id<MAX_MODELS; id++) {
|
for (uint8_t id=0; id<MAX_MODELS; id++) {
|
||||||
#if defined(COLORLCD)
|
#if defined(COLORLCD)
|
||||||
#elif LCD_W >= 212
|
#elif LCD_W >= 212
|
||||||
lcd_hline(61, 6*FH+5, 10+id*2, FORCE);
|
lcdDrawSolidHorizontalLine(61, 6*FH+5, 10+id*2, FORCE);
|
||||||
#else
|
#else
|
||||||
lcd_hline(11, 6*FH+5, 10+(id*3)/2, FORCE);
|
lcdDrawSolidHorizontalLine(11, 6*FH+5, 10+(id*3)/2, FORCE);
|
||||||
#endif
|
#endif
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
if (eeModelExists(id)) {
|
if (eeModelExists(id)) {
|
||||||
|
|
|
@ -629,9 +629,9 @@ int main()
|
||||||
}
|
}
|
||||||
|
|
||||||
lcdDrawRect( 3, 6*FH+4, 204, 7);
|
lcdDrawRect( 3, 6*FH+4, 204, 7);
|
||||||
lcd_hline(5, 6*FH+6, progress, FORCE);
|
lcdDrawSolidHorizontalLine(5, 6*FH+6, progress, FORCE);
|
||||||
lcd_hline(5, 6*FH+7, progress, FORCE);
|
lcdDrawSolidHorizontalLine(5, 6*FH+7, progress, FORCE);
|
||||||
lcd_hline(5, 6*FH+8, progress, FORCE);
|
lcdDrawSolidHorizontalLine(5, 6*FH+8, progress, FORCE);
|
||||||
|
|
||||||
fr = f_read(&FlashFile, (BYTE *)Block_buffer, sizeof(Block_buffer), &BlockCount);
|
fr = f_read(&FlashFile, (BYTE *)Block_buffer, sizeof(Block_buffer), &BlockCount);
|
||||||
if (BlockCount == 0) {
|
if (BlockCount == 0) {
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
To dump FAT and prepare input for this program, one can use command like this:
|
|
||||||
# dd if=/dev/sde skip=1 count=1 | hexdump -v -e '/1 "%02X "' | tr -d ' '
|
|
||||||
|
|
||||||
Stock FAT is this:
|
|
||||||
F8FFFF03400005600007800009F0FF0BC0000DE0000F000111200113400115600117800119A0011BC0011DE0011F000221200223400225600227800229A0022BC0022DE0022F000331200333400335600337800339A0033BC0033DE0033F000441200443400445600447800449A0044BC0044DE0044F000551200553400555600557800559A0055BC0055DE0055F000661200663400665600667800669A0066BC0066DE0066F000771200773400775600777800779A0077BC0077DE0077F000881200883400885600887800889F0FF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
def displayCluster(cluster, hexfat):
|
|
||||||
decfat = int(hexfat, 16)
|
|
||||||
|
|
||||||
next = ""
|
|
||||||
if decfat == 0:
|
|
||||||
next = "-"
|
|
||||||
elif decfat == 1:
|
|
||||||
next = "invalid"
|
|
||||||
elif decfat <= 0xfef : # 002-fef: cluster in use
|
|
||||||
next = "next %03d" % decfat
|
|
||||||
elif decfat <= 0xff6: # reserved,
|
|
||||||
next = "reserved (0x%03x)" % decfat
|
|
||||||
elif decfat == 0xff7: #bad cluster
|
|
||||||
next = "bad"
|
|
||||||
elif decfat <= 0xfff: # cluster in use, the last one in this file
|
|
||||||
next = "last in this file (0x%03x)" % decfat
|
|
||||||
|
|
||||||
print "cluster %03d: %s" % (cluster, next)
|
|
||||||
|
|
||||||
|
|
||||||
data = sys.argv[1]
|
|
||||||
|
|
||||||
cluster = 0
|
|
||||||
while len(data) > 0:
|
|
||||||
twofats = data[0:6]
|
|
||||||
fat1 = twofats[3] + twofats[0:2]
|
|
||||||
fat2 = twofats[4:6] + twofats[2]
|
|
||||||
# print "fat1 %s, fat2 %s" % (fat1, fat2)
|
|
||||||
data = data[len(twofats):]
|
|
||||||
|
|
||||||
displayCluster(cluster, fat1)
|
|
||||||
displayCluster(cluster+1, fat2)
|
|
||||||
|
|
||||||
# print "cluster %03d: next %03d" % (cluster, int(fat1, 16))
|
|
||||||
# print "cluster %03d: next %03d" % (cluster+1, int(fat2, 16))
|
|
||||||
cluster = cluster + 2
|
|
Loading…
Add table
Add a link
Reference in a new issue