[Horus] Fixes. ADC + Switches + Trims + RTC OK

This commit is contained in:
Bertrand Songis
2016-01-08 22:21:26 +01:00
parent 685dece185
commit 82a4ad4103
43 changed files with 402 additions and 398 deletions
+2 -2
View File
@@ -38,8 +38,8 @@ extern const pm_uchar sticks[] PROGMEM;
#define MIXES_2ND_COLUMN (12*FW)
#endif
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 drawStick(coord_t centrex, int16_t xval, int16_t yval);
#if !defined(CPUM64)
+2 -2
View File
@@ -309,9 +309,9 @@ void menuModelSelect(uint8_t event)
#endif
#if defined(ROTARY_ENCODER_NAVIGATION)
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_RE_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
drawScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_RE_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
#else
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? INVERS : 0);
drawScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? INVERS : 0);
#endif
TITLE(STR_MENUMODELSEL);
+1 -1
View File
@@ -435,7 +435,7 @@ void check(check_event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, ui
}
calibrationState = 0;
displayScreenIndex(curr, menuTabSize, attr);
drawScreenIndex(curr, menuTabSize, attr);
}
+1 -1
View File
@@ -27,7 +27,7 @@ const pm_uchar splashdata[] PROGMEM = {
'S','P','E',0 };
const pm_uchar * const splash_lbm = splashdata+4;
void displaySplash()
void drawSplash()
{
lcdClear();
lcd_img(0, 0, splash_lbm, 0, 0);
+1 -1
View File
@@ -182,7 +182,7 @@ void mav_title(const pm_char * s, uint8_t index)
{
lcdDrawText(0, 0, PSTR("MAVLINK"), INVERS);
lcdDrawText(10 * FW, 0, s);
displayScreenIndex(index, MAX_MAVLINK_MENU, INVERS);
drawScreenIndex(index, MAX_MAVLINK_MENU, INVERS);
lcdDrawChar(7 * FW, 0, (mav_heartbeat > 0) ? '*' : ' ');
if (telemetry_data.active)
lcdDrawChar(8 * FW, 0, 'A', BLINK);
+1 -1
View File
@@ -33,7 +33,7 @@
#define APSIZE (BSS | DBLSIZE)
void menuTelemetryMavlink(uint8_t event);
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
void lcd_outdezFloat(uint8_t x, uint8_t y, float val, uint8_t precis, uint8_t mode = 0);
void mav_title(const pm_char * s, uint8_t index);
void menuTelemetryMavlinkInfos(void);
+1 -1
View File
@@ -47,7 +47,7 @@ void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
#endif
}
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);
+8
View File
@@ -251,3 +251,11 @@ const uint8_t LBM_CURVE_POINT_CENTER[] = {
const uint8_t LBM_CURVE_COORD_SHADOW[] = {
#include "mask_coord_shadow.lbm"
};
/*
const uint8_t LBM_SHUTDOWN[] = {
#include "shutdown.lbm"
};
const uint8_t LBM_SLEEP[] = {
#include "sleep.lbm"
}; */
+4 -2
View File
@@ -63,8 +63,8 @@ extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
bool loadModelBitmap(char * name, uint8_t * bitmap);
#define LOAD_MODEL_BITMAP() loadModelBitmap(g_model.header.bitmap, modelBitmap)
void displaySplash();
void displayScreenIndex(uint8_t index, uint8_t count);
void drawSplash();
void drawScreenIndex(uint8_t index, uint8_t count);
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
void drawHorizontalScrollbar(coord_t x, coord_t y, coord_t w, uint16_t offset, uint16_t count, uint8_t visible);
void drawHeader(int index);
@@ -124,3 +124,5 @@ extern const uint8_t LBM_POINT[];
extern const uint8_t LBM_CURVE_POINT[];
extern const uint8_t LBM_CURVE_POINT_CENTER[];
extern const uint8_t LBM_CURVE_COORD_SHADOW[];
extern const uint8_t LBM_SHUTDOWN[];
extern const uint8_t LBM_SLEEP[];
+6
View File
@@ -450,6 +450,12 @@ void putsStrIdx(coord_t x, coord_t y, const pm_char *str, int idx, LcdFlags att,
lcdDrawText(x, y, s, att);
}
void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
{
uint8_t length = STR_VSRCRAW[0];
lcdDrawSizedText(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att);
}
void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
{
if (idx == MIXSRC_NONE) {
+3 -1
View File
@@ -181,6 +181,7 @@ void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags flags=0, uint8_t
void putsStrIdx(coord_t x, coord_t y, const pm_char *str, int idx, LcdFlags att=0, const char *prefix="");
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att);
void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0);
void putsSwitches(coord_t x, coord_t y, int8_t swtch, LcdFlags att=0);
void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0);
void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
@@ -211,7 +212,6 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att=0);
#define PIXEL_PTR(x, y) &displayBuf[(y)*LCD_W + (x)]
inline void lcdDrawPixel(display_t * p, display_t value)
{
*p = value;
@@ -313,6 +313,8 @@ void lcdSetContrast();
const char * bmpLoad(uint8_t * dest, const char * filename, uint16_t width, uint16_t height);
const char * imgLoad(uint8_t * dest, const char * filename, uint16_t width, uint16_t height);
void drawSleepBitmap();
void drawShutdownBitmap(uint8_t index);
#if defined(BOOT)
#define BLINK_ON_PHASE (0)
+27 -37
View File
@@ -20,22 +20,25 @@
#include "../../opentx.h"
#define XPOT_DELTA 10
#define XPOT_DELAY 10 /* cycles */
#define BAR_HEIGHT (BOX_WIDTH-9)
#define LBOX_CENTERX (BOX_WIDTH/2 + 17)
#define RBOX_CENTERX (LCD_W-LBOX_CENTERX)
#define XPOT_DELTA 10
#define XPOT_DELAY 10 /* cycles */
#define BAR_WIDTH 7
#define BAR_HEIGHT (BOX_WIDTH-9)
#define BAR_INTERVAL 20
#define BAR_BOTTOM 200
#define LBOX_CENTERX (BOX_WIDTH/2 + 17)
#define RBOX_CENTERX (LCD_W-LBOX_CENTERX)
void drawPotsBars()
{
// Optimization by Mike Blandford
unsigned int x, i, len ; // declare temporary variables
for (x=LCD_W/2-9, i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; x+=9, i++) {
for (x=LCD_W/2-(BAR_INTERVAL*NUM_POTS/2), i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; x+=BAR_INTERVAL, i++) {
if (IS_POT_AVAILABLE(i)) {
len = ((calibratedStick[i]+RESX)*BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
// TODO 220 constant
lcdDrawSolidFilledRect(x, 220-FH-len, 5, len, TEXT_COLOR);
lcdDrawSolidFilledRect(x, BAR_BOTTOM-len, BAR_WIDTH, len, TEXT_COLOR);
putsStickName(x-2, BAR_BOTTOM+5, i, TEXT_COLOR|TINSIZE);
}
}
}
@@ -63,7 +66,6 @@ bool menuCommonCalib(evt_t event)
if (IS_POT_WITHOUT_DETENT(i)) {
reusableBuffer.calib.midVals[i] = (reusableBuffer.calib.hiVals[i] + reusableBuffer.calib.loVals[i]) / 2;
}
#if 0
uint8_t idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
if (IS_POT_MULTIPOS(i) && count <= XPOTS_MULTIPOS_COUNT) {
@@ -92,35 +94,32 @@ bool menuCommonCalib(evt_t event)
}
}
}
#endif
}
}
calibrationState = reusableBuffer.calib.state; // make sure we don't scroll while calibrating
switch (event)
{
switch (event) {
case EVT_ENTRY:
reusableBuffer.calib.state = 0;
case EVT_KEY_BREAK(KEY_EXIT):
calibrationState = 0;
break;
case EVT_KEY_BREAK(KEY_ENTER):
reusableBuffer.calib.state++;
calibrationState++;
break;
}
switch (reusableBuffer.calib.state) {
switch (calibrationState) {
case 0:
// START CALIBRATION
if (!READ_ONLY()) {
lcd_putsCenter(MENU_CONTENT_TOP+FH, STR_MENUTOSTART);
lcd_putsCenter(MENU_CONTENT_TOP, STR_MENUTOSTART);
}
break;
case 1:
// SET MIDPOINT
lcd_putsCenter(MENU_CONTENT_TOP+FH, STR_SETMIDPOINT, INVERS);
lcd_putsCenter(MENU_CONTENT_TOP+2*FH, STR_MENUWHENDONE);
lcd_putsCenter(MENU_CONTENT_TOP, STR_SETMIDPOINT, INVERS);
lcd_putsCenter(MENU_CONTENT_TOP+FH, STR_MENUWHENDONE);
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
reusableBuffer.calib.loVals[i] = 15000;
@@ -136,8 +135,8 @@ bool menuCommonCalib(evt_t event)
case 2:
// MOVE STICKS/POTS
STICK_SCROLL_DISABLE();
lcd_putsCenter(MENU_CONTENT_TOP+FH, STR_MOVESTICKSPOTS, INVERS);
lcd_putsCenter(MENU_CONTENT_TOP+2*FH, STR_MENUWHENDONE);
lcd_putsCenter(MENU_CONTENT_TOP, STR_MOVESTICKSPOTS, INVERS);
lcd_putsCenter(MENU_CONTENT_TOP+FH, STR_MENUWHENDONE);
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
@@ -151,7 +150,6 @@ bool menuCommonCalib(evt_t event)
break;
case 3:
#if 0
for (int i=POT1; i<=POT_LAST; i++) {
int idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
@@ -171,28 +169,26 @@ bool menuCommonCalib(evt_t event)
}
}
else {
g_eeGeneral.potsType &= ~(0x03<<(2*idx));
g_eeGeneral.potsConfig &= ~(0x03<<(2*idx));
}
}
}
#endif
g_eeGeneral.chkSum = evalChkSum();
storageDirty(EE_GENERAL);
reusableBuffer.calib.state = 4;
calibrationState = 4;
break;
default:
reusableBuffer.calib.state = 0;
calibrationState = 0;
break;
}
drawSticksPositions();
drawPotsBars();
#if 0
for (int i=POT1; i<=POT_LAST; i++) {
uint8_t steps = 0;
if (reusableBuffer.calib.state == 2) {
if (calibrationState == 2) {
steps = reusableBuffer.calib.xpotsCalib[i-POT1].stepsCount;
}
else if (IS_POT_MULTIPOS(i)) {
@@ -200,10 +196,9 @@ bool menuCommonCalib(evt_t event)
steps = calib->count + 1;
}
if (steps > 0 && steps <= XPOTS_MULTIPOS_COUNT) {
lcdDrawNumber(LCD_W/2-2+(i-POT1)*5, LCD_H-6, steps, TINSIZE);
lcdDrawNumber(LCD_W/2-(BAR_INTERVAL*NUM_POTS/2)+(BAR_INTERVAL*(i-POT1)), BAR_BOTTOM+15, steps, TEXT_COLOR|TINSIZE, 0, "[", "]");
}
}
#endif
return true;
}
@@ -211,19 +206,14 @@ bool menuCommonCalib(evt_t event)
bool menuGeneralCalib(evt_t event)
{
SIMPLE_MENU(STR_MENUCALIBRATION, menuTabGeneral, e_Calib, 0, DEFAULT_SCROLLBAR_X);
menuVerticalPosition = -1;
if (menuEvent) {
calibrationState = 0;
}
return menuCommonCalib(READ_ONLY() ? 0 : event);
}
bool menuFirstCalib(evt_t event)
{
if (event == EVT_KEY_BREAK(KEY_EXIT) || reusableBuffer.calib.state == 4) {
if (event == EVT_KEY_BREAK(KEY_EXIT) || calibrationState == 4) {
calibrationState = 0;
chainMenu(menuMainView);
return false;
+1 -1
View File
@@ -368,7 +368,7 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u
}
#endif
}
else {
else if (!calibrationState) {
popMenu();
}
break;
+1 -1
View File
@@ -25,7 +25,7 @@ const uint8_t LBM_SPLASH[] = {
};
#if defined(SPLASH)
void displaySplash()
void drawSplash()
{
lcdClear();
+14
View File
@@ -323,3 +323,17 @@ int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t m
return value;
}
#endif
void drawSleepBitmap()
{
/* lcdClear();
lcdDrawBitmap(POPUP_X-80, POPUP_Y-30, LBM_SLEEP);
lcdRefresh(); */
}
void drawShutdownBitmap(uint8_t index)
{
/*lcdClear();
lcdDrawBitmap(76, 2, LBM_SHUTDOWN, index * 60, 60);
lcdRefresh();*/
}
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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++;
+8 -5
View File
@@ -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();
+1 -2
View File
@@ -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);
}
}
+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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) {
+21 -21
View File
@@ -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);
+22 -22
View File
@@ -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) {
+14 -3
View File
@@ -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);