[Horus] Fixes. ADC + Switches + Trims + RTC OK
This commit is contained in:
@@ -55,8 +55,8 @@ struct MenuItem {
|
||||
};
|
||||
|
||||
int circularIncDec(int current, int inc, int min, int max, IsValueAvailable isValueAvailable=NULL);
|
||||
void displaySplash();
|
||||
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
||||
void drawSplash();
|
||||
void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
||||
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void displayMenuBar(const MenuItem *menu, int index);
|
||||
void drawProgressBar(const char *label);
|
||||
|
||||
@@ -1108,7 +1108,7 @@ void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags a
|
||||
}
|
||||
}
|
||||
|
||||
void lcd_bmp(coord_t x, coord_t y, const uint8_t * img, coord_t offset, coord_t width)
|
||||
void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset, coord_t width)
|
||||
{
|
||||
const uint8_t *q = img;
|
||||
uint8_t w = *q++;
|
||||
|
||||
@@ -188,13 +188,16 @@ inline void lcdDrawSolidFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h,
|
||||
lcdDrawFilledRect(x, y, w, h, SOLID, att);
|
||||
}
|
||||
void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0)
|
||||
{
|
||||
lcdDrawRect(x, y, w, w, SOLID, att);
|
||||
}
|
||||
|
||||
void lcdInvertLine(int8_t line);
|
||||
#define lcdInvertLastLine() lcdInvertLine(LCD_LINES-1)
|
||||
inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcdDrawRect(x, y, w, w, SOLID, att); }
|
||||
|
||||
void displaySleepBitmap();
|
||||
|
||||
void drawShutdownBitmap(uint8_t index);
|
||||
void drawSleepBitmap();
|
||||
void lcdDrawTelemetryTopBar();
|
||||
|
||||
#define V_BAR(xx, yy, ll) \
|
||||
@@ -204,8 +207,8 @@ void lcdDrawTelemetryTopBar();
|
||||
|
||||
void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0);
|
||||
|
||||
void lcd_bmp(coord_t x, coord_t y, const uint8_t * img, coord_t offset=0, coord_t width=0);
|
||||
#define LCD_ICON(x, y, icon) lcd_bmp(x, y, icons, icon)
|
||||
void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset=0, coord_t width=0);
|
||||
#define LCD_ICON(x, y, icon) lcdDrawBitmap(x, y, icons, icon)
|
||||
|
||||
void lcdSetRefVolt(unsigned char val);
|
||||
void lcdClear();
|
||||
|
||||
@@ -81,8 +81,7 @@ void menuCommonCalib(uint8_t event)
|
||||
|
||||
calibrationState = reusableBuffer.calib.state; // make sure we don't scroll while calibrating
|
||||
|
||||
switch (event)
|
||||
{
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
reusableBuffer.calib.state = 0;
|
||||
|
||||
@@ -462,6 +462,6 @@ void menuGeneralSdManager(evt_t _event)
|
||||
memcpy(modelBitmap, logo_taranis, MODEL_BITMAP_SIZE);
|
||||
}
|
||||
}
|
||||
lcd_bmp(22*FW+2, 2*FH+FH/2, modelBitmap);
|
||||
lcdDrawBitmap(22*FW+2, 2*FH+FH/2, modelBitmap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ void menuModelSelect(uint8_t event)
|
||||
lcdDrawNumber(20*FW, 0, EeFsGetFree(), 0);
|
||||
lcdDrawText(21*FW, 0, STR_BYTES);
|
||||
|
||||
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), 0);
|
||||
drawScreenIndex(e_ModelSelect, DIM(menuTabModel), 0);
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
TITLE(STR_MENUMODELSEL);
|
||||
@@ -270,5 +270,5 @@ void menuModelSelect(uint8_t event)
|
||||
loadModelBitmap(modelHeaders[sub].bitmap, modelBitmap);
|
||||
}
|
||||
|
||||
lcd_bmp(22*FW+2, 2*FH+FH/2, modelBitmap);
|
||||
lcdDrawBitmap(22*FW+2, 2*FH+FH/2, modelBitmap);
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuHandle
|
||||
}
|
||||
|
||||
if (!(flags&CHECK_FLAG_NO_SCREEN_INDEX)) {
|
||||
displayScreenIndex(curr, menuTabSize, 0);
|
||||
drawScreenIndex(curr, menuTabSize, 0);
|
||||
}
|
||||
|
||||
lcdDrawFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
@@ -58,7 +58,7 @@ const pm_uchar asterisk_lbm[] PROGMEM = {
|
||||
void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SOUND_ARG)
|
||||
{
|
||||
lcdClear();
|
||||
lcd_bmp(0, 0, asterisk_lbm);
|
||||
lcdDrawBitmap(0, 0, asterisk_lbm);
|
||||
|
||||
#define MESSAGE_LCD_OFFSET 60
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ const pm_uchar splashdata[] PROGMEM = {
|
||||
'S','P','E',0 };
|
||||
const pm_uchar * const splash_lbm = splashdata+4;
|
||||
|
||||
void displaySplash()
|
||||
void drawSplash()
|
||||
{
|
||||
lcdClear();
|
||||
lcd_bmp(0, 0, splash_lbm);
|
||||
lcdDrawBitmap(0, 0, splash_lbm);
|
||||
|
||||
#if MENUS_LOCK == 1
|
||||
if (readonly == false) {
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
const pm_uchar about_bmp[] PROGMEM = {
|
||||
@@ -66,7 +66,7 @@ void menuAboutView(uint8_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
lcd_bmp(0, 0, about_bmp);
|
||||
lcdDrawBitmap(0, 0, about_bmp);
|
||||
lcdDrawText(64, 0, STR_ABOUTUS, DBLSIZE);
|
||||
lcdDrawSolidHorizontalLine(ABOUT_X, 18, 120);
|
||||
lcdDrawSolidHorizontalLine(ABOUT_X, 19, 130, GREY_DEFAULT);
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "../../timers.h"
|
||||
|
||||
@@ -198,7 +198,7 @@ void displayTopBarGauge(coord_t x, int count, bool blinking=false)
|
||||
}
|
||||
|
||||
#define LCD_NOTIF_ICON(x, icon) \
|
||||
lcd_bmp(x, BAR_Y, icons, icon); \
|
||||
lcdDrawBitmap(x, BAR_Y, icons, icon); \
|
||||
lcdDrawSolidHorizontalLine(x, BAR_Y+8, 11)
|
||||
|
||||
void displayTopBar()
|
||||
@@ -513,7 +513,7 @@ void menuMainView(uint8_t event)
|
||||
// Sliders (Pots / Sliders)
|
||||
drawSliders();
|
||||
|
||||
lcd_bmp(BITMAP_X, BITMAP_Y, modelBitmap);
|
||||
lcdDrawBitmap(BITMAP_X, BITMAP_Y, modelBitmap);
|
||||
|
||||
// Switches
|
||||
if (getSwitchCount() > 8) {
|
||||
|
||||
@@ -24,10 +24,21 @@ const pm_uchar bmp_sleep[] PROGMEM = {
|
||||
#include "../../bitmaps/taranis/sleep.lbm"
|
||||
};
|
||||
|
||||
void displaySleepBitmap()
|
||||
void drawSleepBitmap()
|
||||
{
|
||||
lcdClear();
|
||||
lcd_bmp(76, 2, bmp_sleep, 0, 60);
|
||||
lcdDrawBitmap(76, 2, bmp_sleep, 0, 60);
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
const pm_uchar bmp_shutdown[] PROGMEM = {
|
||||
#include "../../bitmaps/taranis/shutdown.lbm"
|
||||
};
|
||||
|
||||
void drawShutdownBitmap(uint8_t index)
|
||||
{
|
||||
lcdClear();
|
||||
lcdDrawBitmap(76, 2, bmp_shutdown, index * 60, 60);
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
@@ -58,7 +69,7 @@ void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
||||
lcdDrawSquare(x, y, 7);
|
||||
}
|
||||
|
||||
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
||||
void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
||||
{
|
||||
lcdDrawNumber(LCD_W, 0, count, attr);
|
||||
coord_t x = 1+LCD_W-FW*(count>9 ? 3 : 2);
|
||||
|
||||
Reference in New Issue
Block a user