More AVR removal

This commit is contained in:
Bertrand Songis
2018-08-05 12:39:05 +02:00
parent f3bfde242b
commit ea76998beb
67 changed files with 1321 additions and 1486 deletions
+10 -10
View File
@@ -20,7 +20,7 @@
#include "opentx.h"
const pm_uchar font_5x7[] = {
const unsigned char font_5x7[] = {
#include "font_05x07.lbm"
#if defined(TRANSLATIONS_DE)
#include "font_de_05x07.lbm"
@@ -44,13 +44,13 @@ const pm_uchar font_5x7[] = {
};
#if defined(BOLD_SPECIFIC_FONT)
const pm_uchar font_5x7_B[] = {
const unsigned char font_5x7_B[] = {
#include "font_05x07_B_compressed.lbm"
};
#endif
#if !defined(BOOT)
const pm_uchar font_10x14[] = {
const unsigned char font_10x14[] = {
#include "font_10x14_compressed.lbm"
#if defined(TRANSLATIONS_DE)
#include "font_de_10x14.lbm"
@@ -75,10 +75,10 @@ const pm_uchar font_10x14[] = {
#endif
#if !defined(BOOT)
const pm_uchar font_3x5[] = {
const unsigned char font_3x5[] = {
#include "font_03x05.lbm"
};
const pm_uchar font_4x6[] = {
const unsigned char font_4x6[] = {
#include "font_04x06.lbm"
#if defined(TRANSLATIONS_DE)
#include "font_de_04x06.lbm"
@@ -101,7 +101,7 @@ const pm_uchar font_4x6[] = {
#endif
};
const pm_uchar font_8x10[] = {
const unsigned char font_8x10[] = {
#include "font_08x10.lbm"
#if defined(TRANSLATIONS_DE)
#include "font_de_08x10.lbm"
@@ -124,19 +124,19 @@ const pm_uchar font_8x10[] = {
#endif
};
const pm_uchar font_22x38_num[] = {
const unsigned char font_22x38_num[] = {
#include "font_22x38_num.lbm"
};
const pm_uchar font_4x6_extra[] = {
const unsigned char font_4x6_extra[] = {
#include "font_04x06_extra.lbm"
};
const pm_uchar font_5x7_extra[] = {
const unsigned char font_5x7_extra[] = {
#include "font_05x07_extra.lbm"
};
const pm_uchar font_10x14_extra[] = {
const unsigned char font_10x14_extra[] = {
#include "font_10x14_extra.lbm"
};
+11 -11
View File
@@ -160,11 +160,11 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
#define CURSOR_ON_LINE() (0)
#endif
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow);
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow);
void check_simple(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, vertpos_t maxrow);
void check_submenu_simple(event_t event, uint8_t maxrow);
void title(const pm_char * s);
void title(const char * s);
#define TITLE(str) title(str)
#define MENU_TAB(...) const uint8_t mstate_tab[] = __VA_ARGS__
@@ -225,8 +225,8 @@ void title(const pm_char * s);
typedef int choice_t;
choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char * label, LcdFlags attr, event_t event);
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char * label, LcdFlags attr, event_t event);
int8_t editSwitch(coord_t x, coord_t y, int8_t value, LcdFlags attr, event_t event);
#define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event)
@@ -258,17 +258,17 @@ void gvarWeightItem(coord_t x, coord_t y, MixData * md, LcdFlags attr, event_t e
void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, uint8_t active, LcdFlags attr=ZCHAR);
void editSingleName(coord_t x, coord_t y, const pm_char * label, char * name, uint8_t size, event_t event, uint8_t active);
void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8_t size, event_t event, uint8_t active);
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const pm_char * str, uint8_t delay);
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay);
#define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(y, event, attr, str, delay)
#define WARNING_TYPE_ASTERISK 0
#define WARNING_TYPE_CONFIRM 1
#define WARNING_TYPE_INPUT 2
extern const pm_char * warningText;
extern const pm_char * warningInfoText;
extern const char * warningText;
extern const char * warningInfoText;
extern uint8_t warningInfoLength;
extern uint8_t warningResult;
extern uint8_t warningType;
@@ -361,7 +361,7 @@ void deleteExpoMix(uint8_t expo, uint8_t idx);
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
extern const pm_uchar sticks[] ;
extern const unsigned char sticks[] ;
void drawSplash();
void drawSecondSplash();
@@ -376,10 +376,10 @@ void drawSleepBitmap();
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
#if defined(PCBTARANIS)
void drawAlertBox(const pm_char * title, const pm_char * text, const char * action);
void drawAlertBox(const char * title, const char * text, const char * action);
#endif
void showAlertBox(const pm_char * title, const pm_char * text, const char * action , uint8_t sound);
void showAlertBox(const char * title, const char * text, const char * action , uint8_t sound);
#define SET_SCROLLBAR_X(x)
#define LOAD_MODEL_BITMAP()
+10 -10
View File
@@ -67,7 +67,7 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
else if (i<=width) {
uint8_t skip = true;
for (uint8_t j=0; j<lines; j++) {
b[j] = pgm_read_byte(pattern++); /*top byte*/
b[j] = *(pattern++); /*top byte*/
if (b[j] != 0xff) {
skip = false;
}
@@ -214,7 +214,7 @@ uint8_t getCharWidth(char c, LcdFlags flags)
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags flags)
{
const pm_uchar * q;
const unsigned char * q;
lcdNextPos = x-1;
@@ -303,7 +303,7 @@ uint8_t getTextWidth(const char * s, uint8_t len, LcdFlags flags)
}
#endif
void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlags flags)
{
const coord_t orig_x = x;
@@ -331,7 +331,7 @@ void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdF
break;
#endif
default:
c = pgm_read_byte(s);
c = *s;
break;
}
@@ -388,31 +388,31 @@ void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdF
#endif
}
void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len)
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len)
{
lcdDrawSizedText(x, y, s, len, 0);
}
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags flags)
void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags flags)
{
lcdDrawSizedText(x, y, s, 255, flags);
}
void lcdDrawText(coord_t x, coord_t y, const pm_char * s)
void lcdDrawText(coord_t x, coord_t y, const char * s)
{
lcdDrawText(x, y, s, 0);
}
void lcdDrawTextAlignedLeft(coord_t y, const pm_char * s)
void lcdDrawTextAlignedLeft(coord_t y, const char * s)
{
lcdDrawText(0, y, s);
}
#if !defined(BOOT)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s,uint8_t idx, LcdFlags flags)
{
uint8_t length;
length = pgm_read_byte(s++);
length = *(s++);
lcdDrawSizedText(x, y, s+length*idx, length, flags & ~(BSS|ZCHAR));
}
+8 -15
View File
@@ -108,26 +108,19 @@ extern coord_t lcdNextPos;
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)
#define ASSERT_IN_DISPLAY(p) assert((p) >= displayBuf && (p) < DISPLAY_END)
#if defined(PCBSKY9X)
extern volatile uint8_t lcdLock ;
extern volatile uint32_t lcdInputs ;
#endif
#if defined(BOOT)
// TODO quick & dirty :(
typedef const unsigned char pm_uchar;
typedef const char pm_char;
#endif
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c);
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags flags);
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags flags);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s, uint8_t idx, LcdFlags flags);
void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, unsigned char len, LcdFlags flags);
void lcdDrawText(coord_t x, coord_t y, const pm_char * s);
void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, unsigned char len);
void lcdDrawTextAlignedLeft(coord_t y, const pm_char * s);
void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags flags);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s, uint8_t idx, LcdFlags flags);
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len, LcdFlags flags);
void lcdDrawText(coord_t x, coord_t y, const char * s);
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len);
void lcdDrawTextAlignedLeft(coord_t y, const char * s);
#define lcdDrawTextAlignedCenter(y, s) lcdDrawText((LCD_W-sizeof(TR_##s)*FW+FW+1)/2, y, STR_##s)
@@ -137,7 +130,7 @@ void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags mode, uint8_t le
void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags mode=0);
void lcdDraw8bitsNumber(coord_t x, coord_t y, int8_t val);
void drawStringWithIndex(coord_t x, coord_t y, const pm_char * str, uint8_t idx, LcdFlags att=0);
void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, LcdFlags att=0);
void putsModelName(coord_t x, coord_t y, char * name, uint8_t id, LcdFlags att);
#if !defined(BOOT) // TODO not here ...
void drawSwitch(coord_t x, coord_t y, swsrc_t swtch, LcdFlags att=0);
@@ -202,7 +195,7 @@ void drawTelemetryTopBar();
void lcdClear(void);
void lcdDraw1bitBitmap(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0);
void lcdDraw1bitBitmap(coord_t x, coord_t y, const unsigned char * img, uint8_t idx, LcdFlags att=0);
inline void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * bitmap)
{
lcdDraw1bitBitmap(x, y, bitmap, 0);
+2 -2
View File
@@ -21,7 +21,7 @@
#include "opentx.h"
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const pm_char * str, uint8_t delay)
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay)
{
lcdDrawTextAlignedLeft(y, str);
lcdDrawNumber(MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
@@ -39,7 +39,7 @@ uint8_t s_copySrcCh;
uint8_t editNameCursorPos = 0;
void editSingleName(coord_t x, coord_t y, const pm_char * label, char * name, uint8_t size, event_t event, uint8_t active)
void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8_t size, event_t event, uint8_t active)
{
lcdDrawTextAlignedLeft(y, label);
editName(x, y, name, size, event, active);
+3 -3
View File
@@ -67,12 +67,12 @@ void menuModelFlightModeOne(event_t event)
#if defined(GVARS) && !defined(GVARS_IN_CURVES_SCREEN)
#if defined(PCBTARANIS)
#define VERTICAL_SHIFT (ITEM_MODEL_FLIGHT_MODE_FADE_IN-ITEM_MODEL_FLIGHT_MODE_TRIMS)
static const pm_uint8_t mstate_tab_fm1[] = {0, 3, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1, 1};
static const uint8_t mstate_tab_fm1[] = {0, 3, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1, 1};
#else
#define VERTICAL_SHIFT (ITEM_MODEL_FLIGHT_MODE_FADE_IN-ITEM_MODEL_FLIGHT_MODE_SWITCH)
static const pm_uint8_t mstate_tab_fm1[] = {0, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1};
static const uint8_t mstate_tab_fm1[] = {0, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1};
#endif
static const pm_uint8_t mstate_tab_others[] = {0, 0, 3, IF_ROTARY_ENCODERS(NUM_ROTARY_ENCODERS-1) 0, 0, (uint8_t)-1, 2, 2, 2, 2, 2};
static const uint8_t mstate_tab_others[] = {0, 0, 3, IF_ROTARY_ENCODERS(NUM_ROTARY_ENCODERS-1) 0, 0, (uint8_t)-1, 2, 2, 2, 2, 2};
check(event, 0, NULL, 0, (s_currIdx == 0) ? mstate_tab_fm1 : mstate_tab_others, DIM(mstate_tab_others)-1, ITEM_MODEL_FLIGHT_MODE_MAX - HEADER_LINE - (s_currIdx==0 ? (ITEM_MODEL_FLIGHT_MODE_FADE_IN-ITEM_MODEL_FLIGHT_MODE_SWITCH-1) : 0));
@@ -266,7 +266,6 @@ void menuModelLimits(event_t event)
}
for (uint8_t j=0; j<ITEM_OUTPUTS_COUNT; j++) {
if (attr && (s_editMode>0 || p1valdiff)) STICK_SCROLL_DISABLE();
switch (j) {
case ITEM_OUTPUTS_OFFSET:
#if defined(PPM_UNIT_US)
+2 -2
View File
@@ -493,7 +493,7 @@ void menuModelSetup(event_t event)
#if defined(PCBTARANIS)
{
#define FIRSTSW_STR STR_VSRCRAW+(MIXSRC_FIRST_SWITCH-MIXSRC_Rud+1)*length
uint8_t length = pgm_read_byte(STR_VSRCRAW);
uint8_t length = STR_VSRCRAW[0];
horzpos_t l_posHorz = menuHorizontalPosition;
if (i>=NUM_BODY_LINES-2 && getSwitchWarningsCount() > 5*(NUM_BODY_LINES-i)) {
@@ -606,7 +606,7 @@ void menuModelSetup(event_t event)
else {
if ((states & 0x01) && swactive)
attr = INVERS;
c = pgm_read_byte(STR_VSWITCHES - 2 + 9 + (3*(i+1)));
c = *(STR_VSWITCHES - 2 + 9 + (3*(i+1)));
states >>= 1;
}
if (line && (menuHorizontalPosition == i)) {
+6 -6
View File
@@ -20,8 +20,8 @@
#include "opentx.h"
const pm_char * warningText = NULL;
const pm_char * warningInfoText;
const char * warningText = NULL;
const char * warningInfoText;
uint8_t warningInfoLength;
uint8_t warningType;
uint8_t warningResult = 0;
@@ -39,7 +39,7 @@ void drawMessageBox()
// could be a place for a warningInfoText
}
void showMessageBox(const pm_char * str)
void showMessageBox(const char * str)
{
warningText = str;
drawMessageBox();
@@ -47,11 +47,11 @@ void showMessageBox(const pm_char * str)
lcdRefresh();
}
const pm_uchar ASTERISK_BITMAP[] = {
const unsigned char ASTERISK_BITMAP[] = {
#include "asterisk.lbm"
};
void drawAlertBox(const pm_char * title, const pm_char * text, const char * action)
void drawAlertBox(const char * title, const char * text, const char * action)
{
lcdClear();
lcdDraw1bitBitmap(2, 0, ASTERISK_BITMAP, 0, 0);
@@ -77,7 +77,7 @@ void drawAlertBox(const pm_char * title, const pm_char * text, const char * acti
#undef MESSAGE_LCD_OFFSET
}
void showAlertBox(const pm_char * title, const pm_char * text, const char * action , uint8_t sound)
void showAlertBox(const char * title, const char * text, const char * action , uint8_t sound)
{
drawAlertBox(title, text, action);
+1 -1
View File
@@ -29,7 +29,7 @@
#define WARNING_LINE_Y 3*FH
void drawMessageBox();
void showMessageBox(const pm_char * title);
void showMessageBox(const char * title);
void runPopupWarning(event_t event);
#define DRAW_MESSAGE_BOX(title) (warningText = title, drawMessageBox(), warningText = NULL)
@@ -118,7 +118,6 @@ void menuCommonCalib(event_t event)
case CALIB_MOVE_STICKS:
// MOVE STICKS/POTS
STICK_SCROLL_DISABLE();
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
-2
View File
@@ -33,8 +33,6 @@ void menuRadioDiagAnalogs(event_t event)
SIMPLE_MENU(STR_MENU_RADIO_ANALOGS, menuTabGeneral, MENU_RADIO_ANALOGS_TEST, HEADER_LINE+ANAS_ITEMS_COUNT);
STICK_SCROLL_DISABLE();
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
#if (NUM_STICKS+NUM_POTS+NUM_SLIDERS) > 9
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/3)*FH;
+4 -4
View File
@@ -22,7 +22,7 @@
#include "opentx.h"
const pm_uchar sticks[] = {
const unsigned char sticks[] = {
#include "sticks.lbm"
};
@@ -166,8 +166,8 @@ void menuRadioSetup(event_t event)
{
int16_t year = TM_YEAR_BASE + t.tm_year;
int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0);
static const pm_uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
dlim += pgm_read_byte(&dmon[t.tm_mon]);
static const uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
dlim += dmon[t.tm_mon];
lcdDrawNumber(RADIO_SETUP_DATE_COLUMN+6*FW-4, y, t.tm_mday, rowattr|LEADING0|RIGHT, 2);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0);
break;
@@ -559,7 +559,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_STICK_MODE:
lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr);
for (uint8_t i=0; i<NUM_STICKS; i++) {
drawSource((5*FW-3)+i*(4*FW+2), y, MIXSRC_Rud + pgm_read_byte(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0);
drawSource((5*FW-3)+i*(4*FW+2), y, MIXSRC_Rud + *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0);
}
if (attr && s_editMode>0) {
CHECK_INCDEC_GENVAR(event, reusableBuffer.generalSettings.stickMode, 0, 3);
+4 -4
View File
@@ -41,12 +41,12 @@
#endif
#if defined(SPLASH)
const pm_uchar splashdata[] = {
const unsigned char splashdata[] = {
'S','P','S',0,
#include "bitmaps/128x64/splash.lbm"
'S','P','E',0 };
const pm_uchar * const splash_lbm = splashdata+4;
const unsigned char * const splash_lbm = splashdata+4;
void drawSplash()
{
@@ -65,12 +65,12 @@ void drawSplash()
#endif
#if defined(SPLASH_FRSKY)
const pm_uchar splashdata2[] = {
const unsigned char splashdata2[] = {
'S','F','S',0,
#include "bitmaps/128x64/splash_frsky.lbm"
'S','F','E',0 };
const pm_uchar * const splash2_lbm = splashdata2+4;
const unsigned char * const splash2_lbm = splashdata2+4;
void drawSecondSplash()
{
+1 -1
View File
@@ -20,7 +20,7 @@
#include "opentx.h"
const pm_uchar about_bmp[] = {
const unsigned char about_bmp[] = {
#include "about.lbm"
};
-2
View File
@@ -303,8 +303,6 @@ void onMainViewMenu(const char *result)
void menuMainView(event_t event)
{
STICK_SCROLL_DISABLE();
uint8_t view = g_eeGeneral.view;
uint8_t view_base = view & 0x0f;
+4 -4
View File
@@ -65,12 +65,12 @@ void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uin
lcdDrawVerticalLine(x, y + yofs, yhgt, SOLID, FORCE);
}
void title(const pm_char * s)
void title(const char * s)
{
lcdDrawText(0, 0, s, INVERS);
}
choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event)
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event)
{
drawFieldLabel(x, y, label);
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
@@ -78,7 +78,7 @@ choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char *
return value;
}
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, event_t event )
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event )
{
#if defined(GRAPHICS)
drawCheckBox(x, y, value, attr);
@@ -246,7 +246,7 @@ void drawProgressBar(const char * label, int num, int den)
lcdRefresh();
}
const pm_uchar SLEEP_BITMAP[] = {
const unsigned char SLEEP_BITMAP[] = {
#include "sleep.lbm"
};
+10 -10
View File
@@ -20,7 +20,7 @@
#include "opentx.h"
const pm_uchar font_5x7[] = {
const unsigned char font_5x7[] = {
#include "font_05x07.lbm"
#if defined(TRANSLATIONS_DE)
#include "font_de_05x07.lbm"
@@ -43,12 +43,12 @@ const pm_uchar font_5x7[] = {
#endif
};
const pm_uchar font_5x7_B[] = {
const unsigned char font_5x7_B[] = {
#include "font_05x07_B_compressed.lbm"
};
#if !defined(BOOT)
const pm_uchar font_10x14[] = {
const unsigned char font_10x14[] = {
#include "font_10x14_compressed.lbm"
#if defined(TRANSLATIONS_DE)
#include "font_de_10x14.lbm"
@@ -71,11 +71,11 @@ const pm_uchar font_10x14[] = {
#endif
};
const pm_uchar font_3x5[] = {
const unsigned char font_3x5[] = {
#include "font_03x05.lbm"
};
const pm_uchar font_4x6[] = {
const unsigned char font_4x6[] = {
#include "font_04x06.lbm"
#if defined(TRANSLATIONS_DE)
#include "font_de_04x06.lbm"
@@ -98,7 +98,7 @@ const pm_uchar font_4x6[] = {
#endif
};
const pm_uchar font_8x10[] = {
const unsigned char font_8x10[] = {
#include "font_08x10.lbm"
#if defined(TRANSLATIONS_DE)
#include "font_de_08x10.lbm"
@@ -121,19 +121,19 @@ const pm_uchar font_8x10[] = {
#endif
};
const pm_uchar font_22x38_num[] = {
const unsigned char font_22x38_num[] = {
#include "font_22x38_num.lbm"
};
const pm_uchar font_4x6_extra[] = {
const unsigned char font_4x6_extra[] = {
#include "font_04x06_extra.lbm"
};
const pm_uchar font_5x7_extra[] = {
const unsigned char font_5x7_extra[] = {
#include "font_05x07_extra.lbm"
};
const pm_uchar font_10x14_extra[] = {
const unsigned char font_10x14_extra[] = {
#include "font_10x14_extra.lbm"
};
+8 -8
View File
@@ -178,11 +178,11 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
#define CURSOR_ON_LINE() (menuHorizontalPosition<0)
#define CHECK_FLAG_NO_SCREEN_INDEX 1
void check(const char * title, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint8_t flags=0);
void check(const char * title, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint8_t flags=0);
void check_simple(const char *title, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, vertpos_t maxrow);
void check_submenu_simple(const char * title, event_t event, uint8_t maxrow);
void title(const pm_char * s);
void title(const char * s);
#define TITLE(str) title(str)
#define MENU_TAB(...) const uint8_t mstate_tab[] = __VA_ARGS__
@@ -224,8 +224,8 @@ void title(const pm_char * s);
typedef int choice_t;
choice_t editChoice(coord_t x, coord_t y, const pm_char *label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, event_t event);
choice_t editChoice(coord_t x, coord_t y, const char *label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event);
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event);
#define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event)
@@ -249,7 +249,7 @@ void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlag
extern uint8_t editNameCursorPos;
void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, uint8_t active, LcdFlags attr=ZCHAR);
void editSingleName(coord_t x, coord_t y, const pm_char * label, char * name, uint8_t size, event_t event, uint8_t active);
void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8_t size, event_t event, uint8_t active);
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay);
#define EDIT_DELAY(y, event, attr, str, delay) editDelay(y, event, attr, str, delay)
@@ -260,8 +260,8 @@ uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint
void copySelection(char * dst, const char * src, uint8_t size);
extern const pm_char * warningText;
extern const pm_char * warningInfoText;
extern const char * warningText;
extern const char * warningInfoText;
extern uint8_t warningInfoLength;
extern uint8_t warningResult;
extern uint8_t warningType;
@@ -326,7 +326,7 @@ uint8_t switchToMix(uint8_t source);
extern coord_t scrollbar_X;
#define SET_SCROLLBAR_X(x) scrollbar_X = (x);
extern const pm_uchar sticks[] ;
extern const unsigned char sticks[] ;
#if defined(FLIGHT_MODES)
void displayFlightModes(coord_t x, coord_t y, FlightModesType value);
+12 -12
View File
@@ -103,7 +103,7 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
else if (i<=width) {
uint8_t skip = true;
for (uint8_t j=0; j<lines; j++) {
b[j] = pgm_read_byte(pattern++); /*top byte*/
b[j] = *(pattern++); /*top byte*/
if (b[j] != 0xff) {
skip = false;
}
@@ -342,30 +342,30 @@ void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlag
}
}
void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len)
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len)
{
lcdDrawSizedText(x, y, s, len, 0);
}
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags flags)
void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags flags)
{
lcdDrawSizedText(x, y, s, 255, flags);
}
void lcdDrawText(coord_t x, coord_t y, const pm_char * s)
void lcdDrawText(coord_t x, coord_t y, const char * s)
{
lcdDrawText(x, y, s, 0);
}
void lcdDrawTextAlignedLeft(coord_t y, const pm_char * s)
void lcdDrawTextAlignedLeft(coord_t y, const char * s)
{
lcdDrawText(0, y, s);
}
#if !defined(BOOT)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s,uint8_t idx, LcdFlags flags)
{
uint8_t length = pgm_read_byte(s++);
uint8_t length = *(s++);
lcdDrawSizedText(x, y, s+length*idx, length, flags & ~ZCHAR);
}
@@ -914,16 +914,16 @@ void lcdInvertLine(int8_t line)
}
#if !defined(BOOT)
void lcdDraw1bitBitmap(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att)
void lcdDraw1bitBitmap(coord_t x, coord_t y, const unsigned char * img, uint8_t idx, LcdFlags att)
{
const pm_uchar *q = img;
uint8_t w = pgm_read_byte(q++);
uint8_t hb = (pgm_read_byte(q++)+7) / 8;
const unsigned char *q = img;
uint8_t w = *(q++);
uint8_t hb = (*(q++)+7) / 8;
bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false);
q += idx*w*hb;
for (uint8_t yb = 0; yb < hb; yb++) {
for (uint8_t i=0; i<w; i++) {
uint8_t b = pgm_read_byte(q++);
uint8_t b = *(q++);
uint8_t val = inv ? ~b : b;
for (int k=0; k<8; k++) {
if (val & (1<<k)) {
+8 -14
View File
@@ -104,20 +104,14 @@ extern coord_t lcdNextPos;
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)
#define ASSERT_IN_DISPLAY(p) assert((p) >= displayBuf && (p) < DISPLAY_END)
#if defined(BOOT)
// TODO quick & dirty :(
typedef const unsigned char pm_uchar;
typedef const char pm_char;
#endif
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c);
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags mode);
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags mode);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags mode);
void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s,unsigned char len, LcdFlags mode);
void lcdDrawText(coord_t x, coord_t y, const pm_char * s);
void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, unsigned char len);
void lcdDrawTextAlignedLeft(coord_t y, const pm_char * s);
void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags mode);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s,uint8_t idx, LcdFlags mode);
void lcdDrawSizedText(coord_t x, coord_t y, const char * s,unsigned char len, LcdFlags mode);
void lcdDrawText(coord_t x, coord_t y, const char * s);
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len);
void lcdDrawTextAlignedLeft(coord_t y, const char * s);
#define lcdDrawTextAlignedCenter(y, s) lcdDrawText((LCD_W-sizeof(TR_##s)*FW+FW+1)/2, y, STR_##s)
@@ -125,7 +119,7 @@ void lcdDrawHexNumber(coord_t x, coord_t y, uint32_t val, LcdFlags mode=0);
void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags mode, uint8_t len);
void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags mode=0);
void drawStringWithIndex(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags att=0);
void drawStringWithIndex(coord_t x, coord_t y, const char *str, uint8_t idx, LcdFlags att=0);
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att);
void drawSwitch(coord_t x, coord_t y, int32_t swtch, LcdFlags att=0);
void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0);
@@ -182,7 +176,7 @@ void drawTelemetryTopBar();
lcdDrawSolidVerticalLine(xx ,yy-ll,ll); \
lcdDrawSolidVerticalLine(xx+1,yy-ll,ll)
void lcdDraw1bitBitmap(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0);
void lcdDraw1bitBitmap(coord_t x, coord_t y, const unsigned char * img, uint8_t idx, LcdFlags att=0);
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)
+1 -1
View File
@@ -60,7 +60,7 @@ uint8_t s_copySrcCh;
uint8_t editNameCursorPos = 0;
void editSingleName(coord_t x, coord_t y, const pm_char * label, char *name, uint8_t size, event_t event, uint8_t active)
void editSingleName(coord_t x, coord_t y, const char * label, char *name, uint8_t size, event_t event, uint8_t active)
{
lcdDrawTextAlignedLeft(y, label);
editName(x, y, name, size, event, active);
-1
View File
@@ -148,7 +148,6 @@ void menuModelLimits(event_t event)
for (int j=0; j<ITEM_LIMITS_COUNT; j++) {
LcdFlags attr = ((sub==k && menuHorizontalPosition==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
uint8_t active = (attr && s_editMode>0) ;
if (active) STICK_SCROLL_DISABLE();
switch(j)
{
case ITEM_LIMITS_CH_NAME:
+1 -1
View File
@@ -44,7 +44,7 @@ void showMessageBox(const char * title)
lcdRefresh();
}
const pm_uchar ASTERISK_BITMAP[] = {
const unsigned char ASTERISK_BITMAP[] = {
#include "asterisk.lbm"
};
@@ -126,7 +126,6 @@ void menuCommonCalib(event_t event)
case CALIB_MOVE_STICKS:
// MOVE STICKS/POTS
STICK_SCROLL_DISABLE();
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
-2
View File
@@ -24,8 +24,6 @@ void menuRadioDiagAnalogs(event_t event)
{
SIMPLE_MENU(STR_MENU_RADIO_ANALOGS, menuTabGeneral, MENU_RADIO_ANALOGS_TEST, 0);
STICK_SCROLL_DISABLE();
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH;
uint8_t x = i&1 ? LCD_W/2 + FW : 0;
+4 -4
View File
@@ -22,7 +22,7 @@
#include "opentx.h"
const pm_uchar sticks[] = {
const unsigned char sticks[] = {
#include "sticks.lbm"
};
@@ -149,8 +149,8 @@ void menuRadioSetup(event_t event)
{
int16_t year = TM_YEAR_BASE + t.tm_year;
int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0);
static const pm_uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
dlim += pgm_read_byte(&dmon[t.tm_mon]);
static const uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
dlim += dmon[t.tm_mon];
lcdDrawNumber(RADIO_SETUP_DATE_COLUMN+6*FW-4, y, t.tm_mday, rowattr|LEADING0|RIGHT, 2);
if (rowattr && s_editMode>0) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0);
break;
@@ -495,7 +495,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_STICK_MODE:
lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr);
for (uint8_t i=0; i<4; i++) {
putsStickName((6+4*i)*FW, y, pgm_read_byte(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0);
putsStickName((6+4*i)*FW, y, *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0);
}
if (attr && s_editMode>0) {
CHECK_INCDEC_GENVAR(event, reusableBuffer.generalSettings.stickMode, 0, 3);
+4 -4
View File
@@ -21,11 +21,11 @@
#include "opentx.h"
#if defined(SPLASH)
const pm_uchar splashdata[] = {
const unsigned char splashdata[] = {
'S','P','S',0,
#include "bitmaps/212x64/splash.lbm"
'S','P','E',0 };
const pm_uchar * const splash_lbm = splashdata+4;
const unsigned char * const splash_lbm = splashdata+4;
void drawSplash()
{
@@ -44,11 +44,11 @@ void drawSplash()
#endif
#if defined(SPLASH_FRSKY)
const pm_uchar splashdata2[] = {
const unsigned char splashdata2[] = {
'S','F','S',0,
#include "bitmaps/212x64/splash_frsky.lbm"
'S','F','E',0 };
const pm_uchar * const splash2_lbm = splashdata2+4;
const unsigned char * const splash2_lbm = splashdata2+4;
void drawSecondSplash()
{
+1 -1
View File
@@ -20,7 +20,7 @@
#include "opentx.h"
const pm_uchar about_bmp[] = {
const unsigned char about_bmp[] = {
#include "about.lbm"
};
+2 -4
View File
@@ -49,11 +49,11 @@
#define TRIM_LEN 27
#define MARKER_WIDTH 5
const pm_uchar logo_taranis[] = {
const unsigned char logo_taranis[] = {
#include "logo.lbm"
};
const pm_uchar icons[] = {
const unsigned char icons[] = {
#include "icons.lbm"
};
@@ -439,8 +439,6 @@ void menuMainView(event_t event)
{
static bool secondPage = false;
STICK_SCROLL_DISABLE();
switch(event) {
case EVT_ENTRY:
+5 -5
View File
@@ -20,7 +20,7 @@
#include "opentx.h"
const pm_uchar SLEEP_BITMAP[] = {
const unsigned char SLEEP_BITMAP[] = {
#include "../../bitmaps/212x64/sleep.lbm"
};
@@ -34,7 +34,7 @@ void drawSleepBitmap()
}
#if defined(PWR_BUTTON_PRESS)
const pm_uchar SHUTDOWN_BITMAP[] = {
const unsigned char SHUTDOWN_BITMAP[] = {
#include "../../bitmaps/212x64/shutdown.lbm"
};
@@ -125,12 +125,12 @@ void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t
}
}
void title(const pm_char * s)
void title(const char * s)
{
lcdDrawText(0, 0, s, INVERS);
}
choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event)
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event)
{
drawFieldLabel(x, y, label);
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
@@ -138,7 +138,7 @@ choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char *
return value;
}
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, event_t event )
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event )
{
drawCheckBox(x, y, value, attr);
return editChoice(x, y, label, NULL, value, 0, 1, attr, event);
+1 -1
View File
@@ -318,7 +318,7 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l
int width = getTextWidth(s, len, flags);
int height = getFontHeight(flags);
uint32_t fontindex = FONTINDEX(flags);
const pm_uchar * font = fontsTable[fontindex];
const unsigned char * font = fontsTable[fontindex];
const uint16_t * fontspecs = fontspecsTable[fontindex];
BitmapBuffer * fontcache = NULL;
+7 -7
View File
@@ -26,7 +26,7 @@ const uint16_t font_tinsize_specs[] = {
#include "font_tinsize.specs"
};
const pm_uchar font_tinsize[] = {
const unsigned char font_tinsize[] = {
#include "font_tinsize.lbm"
};
@@ -34,7 +34,7 @@ const uint16_t font_smlsize_specs[] = {
#include "font_smlsize.specs"
};
const pm_uchar font_smlsize[] = {
const unsigned char font_smlsize[] = {
#include "font_smlsize.lbm"
};
#endif
@@ -43,7 +43,7 @@ const uint16_t font_stdsize_specs[] = {
#include "font_stdsize.specs"
};
const pm_uchar font_stdsize[] = {
const unsigned char font_stdsize[] = {
#include "font_stdsize.lbm"
};
@@ -52,7 +52,7 @@ const uint16_t font_midsize_specs[] = {
#include "font_midsize.specs"
};
const pm_uchar font_midsize[] = {
const unsigned char font_midsize[] = {
#include "font_midsize.lbm"
};
@@ -60,7 +60,7 @@ const uint16_t font_dblsize_specs[] = {
#include "font_dblsize.specs"
};
const pm_uchar font_dblsize[] = {
const unsigned char font_dblsize[] = {
#include "font_dblsize.lbm"
};
@@ -68,7 +68,7 @@ const uint16_t font_xxlsize_specs[] = {
#include "font_xxlsize.specs"
};
const pm_uchar font_xxlsize[] = {
const unsigned char font_xxlsize[] = {
#include "font_xxlsize.lbm"
};
@@ -76,7 +76,7 @@ const uint16_t font_stdsizebold_specs[] = {
#include "font_stdsizebold.specs"
};
const pm_uchar font_stdsizebold[] = {
const unsigned char font_stdsizebold[] = {
#include "font_stdsizebold.lbm"
};
#endif
+3 -3
View File
@@ -102,7 +102,7 @@ void lcdPutFontPattern(coord_t x, coord_t y, const uint8_t * font, const uint16_
void lcdDrawChar(coord_t x, coord_t y, char c, LcdFlags flags)
{
uint32_t fontindex = FONTINDEX(flags);
const pm_uchar * font = fontsTable[fontindex];
const unsigned char * font = fontsTable[fontindex];
const uint16_t * fontspecs = fontspecsTable[fontindex];
lcdPutFontPattern(x, y, font, fontspecs, getMappedChar(c), flags);
}
@@ -142,10 +142,10 @@ int getTextWidth(const char * s, int len, LcdFlags flags)
return result;
}
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s, uint8_t idx, LcdFlags flags)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s, uint8_t idx, LcdFlags flags)
{
uint8_t length;
length = pgm_read_byte(s++);
length = *(s++);
lcdDrawSizedText(x, y, s+length*idx, length, flags & ~ZCHAR);
}
+2 -2
View File
@@ -120,7 +120,7 @@ extern coord_t lcdNextPos;
void lcdDrawChar(coord_t x, coord_t y, char c, LcdFlags flags=0);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s, uint8_t idx, LcdFlags flags=0);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s, uint8_t idx, LcdFlags flags=0);
inline void lcdClear()
{
@@ -132,7 +132,7 @@ inline void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags attr=0)
lcd->drawText(x, y, s, attr);
}
inline void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags attr=0)
inline void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlags attr=0)
{
lcd->drawSizedText(x, y, s, len, attr);
}
+2 -2
View File
@@ -428,8 +428,8 @@ extern uint8_t s_curveChan;
#define WARNING_TYPE_INPUT 3
#define WARNING_TYPE_INFO 4
extern const pm_char * warningText;
extern const pm_char * warningInfoText;
extern const char * warningText;
extern const char * warningInfoText;
extern uint8_t warningInfoLength;
extern uint8_t warningResult;
extern uint8_t warningType;
-1
View File
@@ -139,7 +139,6 @@ bool menuModelLimits(event_t event)
for (uint8_t j=0; j<ITEM_LIMITS_COUNT; j++) {
uint8_t attr = ((sub==k && menuHorizontalPosition==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
uint8_t active = (attr && s_editMode>0) ;
if (active) STICK_SCROLL_DISABLE();
switch(j)
{
case ITEM_LIMITS_CH_NAME:
+3 -3
View File
@@ -154,8 +154,8 @@ bool menuRadioSetup(event_t event)
{
int16_t year = TM_YEAR_BASE + t.tm_year;
int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0);
static const pm_uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
dlim += pgm_read_byte(&dmon[t.tm_mon]);
static const uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
dlim += dmon[t.tm_mon];
lcdDrawNumber(lcdNextPos+3, y, t.tm_mday, flags|rowattr|LEADING0, 2);
if (rowattr && s_editMode>0) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0);
break;
@@ -473,7 +473,7 @@ bool menuRadioSetup(event_t event)
s[0] = '1'+reusableBuffer.generalSettings.stickMode;
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, s, attr);
for (uint8_t i=0; i<4; i++) {
drawSource(RADIO_SETUP_2ND_COLUMN + 40 + 50*i, y, MIXSRC_Rud + pgm_read_byte(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i));
drawSource(RADIO_SETUP_2ND_COLUMN + 40 + 50*i, y, MIXSRC_Rud + *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i));
}
if (attr && s_editMode>0) {
CHECK_INCDEC_GENVAR(event, reusableBuffer.generalSettings.stickMode, 0, 3);
+1 -1
View File
@@ -162,7 +162,7 @@ void drawComboOutputBar(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t chan
lcdDrawNumber(x + limPos, y + h, chanVal, SMLSIZE | TEXT_COLOR, 0, NULL, "%");
}
coord_t drawChannelsMonitorLegend(coord_t x, const pm_char * s, int color)
coord_t drawChannelsMonitorLegend(coord_t x, const char * s, int color)
{
lcdDrawSolidFilledRect(x, MENU_FOOTER_TOP + 2, LEG_COLORBOX + 2, LEG_COLORBOX + 2, BARGRAPH_BGCOLOR);
lcdDrawSolidFilledRect(x + 1, MENU_FOOTER_TOP + 3, LEG_COLORBOX, LEG_COLORBOX, color);
+1 -1
View File
@@ -20,7 +20,7 @@
#include "opentx.h"
void drawStringWithIndex(coord_t x, coord_t y, const pm_char * str, uint8_t idx, LcdFlags flags)
void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, LcdFlags flags)
{
if (flags & RIGHT) {
lcdDrawNumber(x, y, idx, flags);
+1 -1
View File
@@ -132,7 +132,7 @@ struct mm_protocol_definition {
uint8_t protocol;
uint8_t maxSubtype;
bool failsafe;
const pm_char *subTypeString;
const char *subTypeString;
const char *optionsstr;
};
+24 -24
View File
@@ -647,53 +647,53 @@ int getFirstAvailable(int min, int max, IsValueAvailable isValueAvailable)
// we don't need the special eeprom/flash string handling, just define them as
// local strings
const pm_char STR_SUBTYPE_FLYSKY[] = "\004""Std\0""V9x9""V6x6""V912""CX20";
const char STR_SUBTYPE_FLYSKY[] = "\004""Std\0""V9x9""V6x6""V912""CX20";
const pm_char STR_SUBTYPE_AFHDS2A[] = "\010""PWM,IBUS""PPM,IBUS""PWM,SBUS""PPM,SBUS";
const char STR_SUBTYPE_AFHDS2A[] = "\010""PWM,IBUS""PPM,IBUS""PWM,SBUS""PPM,SBUS";
const pm_char STR_SUBTYPE_FRSKY[] = "\007""D16\0 ""D8\0 ""D16 8ch""V8\0 ""LBT(EU)""LBT 8ch";
const char STR_SUBTYPE_FRSKY[] = "\007""D16\0 ""D8\0 ""D16 8ch""V8\0 ""LBT(EU)""LBT 8ch";
const pm_char STR_SUBTYPE_HISKY[] = "\005""HiSky""HK310";
const char STR_SUBTYPE_HISKY[] = "\005""HiSky""HK310";
const pm_char STR_SUBTYPE_DSM[] = "\006""2 22ms""2 11ms""X 22ms""X 11ms";
const char STR_SUBTYPE_DSM[] = "\006""2 22ms""2 11ms""X 22ms""X 11ms";
const pm_char STR_SUBTYPE_YD717[] = "\007""YD717\0 ""SKYWLKR""Syma X2""XINXUN\0""NIHUI\0 ";
const char STR_SUBTYPE_YD717[] = "\007""YD717\0 ""SKYWLKR""Syma X2""XINXUN\0""NIHUI\0 ";
const pm_char STR_SUBTYPE_SYMAX[] = "\003""Std""5c\0";
const char STR_SUBTYPE_SYMAX[] = "\003""Std""5c\0";
const pm_char STR_SUBTYPE_SLT[] = "\005""SLT\0 ""Vista";
const char STR_SUBTYPE_SLT[] = "\005""SLT\0 ""Vista";
const pm_char STR_SUBTYPE_CX10[] = "\007""Green\0 ""Blue\0 ""DM007\0 ""-\0 ""JC3015a""JC3015b""MK33041""Q242\0 ";
const char STR_SUBTYPE_CX10[] = "\007""Green\0 ""Blue\0 ""DM007\0 ""-\0 ""JC3015a""JC3015b""MK33041""Q242\0 ";
const pm_char STR_SUBTYPE_CG023[] = "\005""CG023""YD829";
const char STR_SUBTYPE_CG023[] = "\005""CG023""YD829";
const pm_char STR_SUBTYPE_KN[] = "\006""WLtoys""FeiLun";
const char STR_SUBTYPE_KN[] = "\006""WLtoys""FeiLun";
const pm_char STR_SUBTYPE_MT99[] = "\005""MT99\0""H7\0 ""YZ\0 ""LS\0 ""FY805";
const char STR_SUBTYPE_MT99[] = "\005""MT99\0""H7\0 ""YZ\0 ""LS\0 ""FY805";
const pm_char STR_SUBTYPE_MJXQ[] = "\005""WLH08""X600\0""X800\0""H26D\0""E010\0""H26WH";
const char STR_SUBTYPE_MJXQ[] = "\005""WLH08""X600\0""X800\0""H26D\0""E010\0""H26WH";
const pm_char STR_SUBTYPE_HONTAI[] = "\007""Std\0 ""JJRC X1""X5C1cln";
const char STR_SUBTYPE_HONTAI[] = "\007""Std\0 ""JJRC X1""X5C1cln";
const pm_char STR_SUBTYPE_Q2X2[] = "\004""Q222""Q242""Q282";
const char STR_SUBTYPE_Q2X2[] = "\004""Q222""Q242""Q282";
const pm_char STR_SUBTYPE_Q303[] = "\006""Q303\0 ""CX35\0 ""CX10D\0""CX10WD";
const char STR_SUBTYPE_Q303[] = "\006""Q303\0 ""CX35\0 ""CX10D\0""CX10WD";
const pm_char STR_SUBTYPE_WK2x01[] = "\006""WK2801""WK2401""W6_5_1""W6_6_1""W6_Hel""W6_HeI";
const char STR_SUBTYPE_WK2x01[] = "\006""WK2801""WK2401""W6_5_1""W6_6_1""W6_Hel""W6_HeI";
const pm_char STR_SUBTYPE_V2X2[] = "\006""V2x2\0 ""JXD506";
const char STR_SUBTYPE_V2X2[] = "\006""V2x2\0 ""JXD506";
const pm_char STR_SUBTYPE_BAYANG[] = "\007""Bayang\0""H8S3D\0 ""X16 AH\0 ""irdrone";
const char STR_SUBTYPE_BAYANG[] = "\007""Bayang\0""H8S3D\0 ""X16 AH\0 ""irdrone";
const pm_char STR_SUBTYPE_FY326[] = "\005""FY326""FY319";
const char STR_SUBTYPE_FY326[] = "\005""FY326""FY319";
const pm_char STR_SUBTYPE_CABELL[] = "\006""CAB_V3""C_TELM""-\0 ""-\0 ""-\0 ""-\0 ""F_SAFE""UNBIND";
const char STR_SUBTYPE_CABELL[] = "\006""CAB_V3""C_TELM""-\0 ""-\0 ""-\0 ""-\0 ""F_SAFE""UNBIND";
const pm_char STR_SUBTYPE_H83D[] = "\006""H8_3D\0""H20H\0 ""H20Mini""H30Mini";
const char STR_SUBTYPE_H83D[] = "\006""H8_3D\0""H20H\0 ""H20Mini""H30Mini";
const pm_char STR_SUBTYPE_CORONA[] = "\005""V1\0 ""V2\0 ""FD V3";
const char STR_SUBTYPE_CORONA[] = "\005""V1\0 ""V2\0 ""FD V3";
const pm_char STR_SUBTYPE_HITEC[] = "\006""Optima\0""Minima";
const char STR_SUBTYPE_HITEC[] = "\006""Optima\0""Minima";
const mm_protocol_definition multi_protocols[] = {
+3 -3
View File
@@ -182,10 +182,10 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
tmr10ms_t menuEntryTime;
#define MAXCOL(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
#define MAXCOL(row) (horTab ? *(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
#define POS_HORZ_INIT(posVert) 0
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
{
vertpos_t l_posVert = menuVerticalPosition;
horzpos_t l_posHorz = menuHorizontalPosition;
@@ -275,7 +275,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
}
if (cc != curr) {
chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc]));
chainMenu(menuTab[cc]);
}
#if defined(ROTARY_ENCODER_NAVIGATION)
@@ -339,7 +339,7 @@ int8_t navigate(event_t event, int count, int rows, int columns, bool loop)
return (prevPosHorz != menuHorizontalPosition || prevPosVert != menuVerticalPosition) ? result : 0;
}
bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const pm_uint8_t * horTab, uint8_t horTabMax, int rowcount, uint8_t flags)
bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const uint8_t * horTab, uint8_t horTabMax, int rowcount, uint8_t flags)
{
uint8_t maxcol = MAXCOL(menuVerticalPosition);
@@ -372,7 +372,7 @@ bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
}
if (cc != curr) {
chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc]));
chainMenu(menuTab[cc]);
return false;
}
+3 -3
View File
@@ -240,13 +240,13 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
tmr10ms_t menuEntryTime;
#define MAXCOL_RAW(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
#define MAXCOL_RAW(row) (horTab ? *(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
#define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE)))
#define COLATTR(row) (MAXCOL_RAW(row) == (uint8_t)-1 ? (const uint8_t)0 : (const uint8_t)(MAXCOL_RAW(row) & NAVIGATION_LINE_BY_LINE))
#define MENU_FIRST_LINE_EDIT (menuTab ? (MAXCOL((uint16_t)0) >= HIDDEN_ROW ? (MAXCOL((uint16_t)1) >= HIDDEN_ROW ? 2 : 1) : 0) : 0)
#define POS_HORZ_INIT(posVert) ((COLATTR(posVert) & NAVIGATION_LINE_BY_LINE) ? -1 : 0)
void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const pm_uint8_t * horTab, uint8_t horTabMax, vertpos_t rowcount)
void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const uint8_t * horTab, uint8_t horTabMax, vertpos_t rowcount)
{
vertpos_t l_posVert = menuVerticalPosition;
horzpos_t l_posHorz = menuHorizontalPosition;
@@ -273,7 +273,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
}
if (!menuCalibrationState && cc != curr) {
chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc]));
chainMenu(menuTab[cc]);
}
drawScreenIndex(curr, menuTabSize, 0);
+3 -3
View File
@@ -316,7 +316,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
}
#define CURSOR_NOT_ALLOWED_IN_ROW(row) ((int8_t)MAXCOL(row) < 0)
#define MAXCOL_RAW(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
#define MAXCOL_RAW(row) (horTab ? *(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
#define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE)))
#define COLATTR(row) (MAXCOL_RAW(row) == (uint8_t)-1 ? (const uint8_t)0 : (const uint8_t)(MAXCOL_RAW(row) & NAVIGATION_LINE_BY_LINE))
#define INC(val, min, max) if (val<max) {val++;} else if (max>min) {val=min;}
@@ -336,7 +336,7 @@ void onLongMenuPress(const char * result)
tmr10ms_t menuEntryTime;
void check(const char * name, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint8_t flags)
void check(const char * name, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint8_t flags)
{
vertpos_t l_posVert = menuVerticalPosition;
horzpos_t l_posHorz = menuHorizontalPosition;
@@ -377,7 +377,7 @@ void check(const char * name, event_t event, uint8_t curr, const MenuHandlerFunc
}
if (!menuCalibrationState && cc != curr) {
chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc]));
chainMenu(menuTab[cc]);
}
if (!(flags&CHECK_FLAG_NO_SCREEN_INDEX)) {
@@ -302,11 +302,11 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
tmr10ms_t menuEntryTime;
#define MAXCOL_RAW(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
#define MAXCOL_RAW(row) (horTab ? *(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
#define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE)))
#define POS_HORZ_INIT(posVert) 0
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
{
vertpos_t l_posVert = menuVerticalPosition;
horzpos_t l_posHorz = menuHorizontalPosition;
@@ -362,7 +362,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
}
if (cc != curr) {
chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc]));
chainMenu(menuTab[cc]);
}
#if defined(ROTARY_ENCODER_NAVIGATION)