mirror of
https://github.com/opentx/opentx.git
synced 2025-07-16 04:45:17 +03:00
More AVR removal
This commit is contained in:
parent
f3bfde242b
commit
ea76998beb
67 changed files with 1321 additions and 1486 deletions
|
@ -28,7 +28,7 @@ bool warble = false;
|
|||
bool warbleC;
|
||||
|
||||
// The various "beep" tone lengths
|
||||
static const pm_uint8_t beepTab[] = {
|
||||
static const uint8_t beepTab[] = {
|
||||
// key, trim, warn2, warn1, error
|
||||
1, 1, 2, 10, 60, //xShort
|
||||
1, 1, 4, 20, 80, //short
|
||||
|
@ -54,7 +54,7 @@ void beep(uint8_t val)
|
|||
#endif
|
||||
|
||||
if (g_eeGeneral.beepMode>0 || (g_eeGeneral.beepMode==0 && val!=0) || (g_eeGeneral.beepMode==-1 && val>=3)) {
|
||||
_beep(pgm_read_byte(beepTab+5*(2+g_eeGeneral.beepLength)+val));
|
||||
_beep(*(beepTab+5*(2+g_eeGeneral.beepLength)+val));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,21 +38,21 @@ void loadFonts();
|
|||
|
||||
#else
|
||||
|
||||
extern const pm_uchar font_5x7[];
|
||||
extern const pm_uchar font_10x14[];
|
||||
extern const unsigned char font_5x7[];
|
||||
extern const unsigned char font_10x14[];
|
||||
|
||||
#if defined(BOLD_FONT) && ((!defined(CPUM64) && !defined(PCBMEGA2560)) || defined(TELEMETRY_NONE)) && !defined(BOOT)
|
||||
#define BOLD_SPECIFIC_FONT
|
||||
extern const pm_uchar font_5x7_B[];
|
||||
extern const unsigned char font_5x7_B[];
|
||||
#endif
|
||||
|
||||
extern const pm_uchar font_3x5[];
|
||||
extern const pm_uchar font_4x6[];
|
||||
extern const pm_uchar font_8x10[];
|
||||
extern const pm_uchar font_22x38_num[];
|
||||
extern const pm_uchar font_5x7_extra[];
|
||||
extern const pm_uchar font_10x14_extra[];
|
||||
extern const pm_uchar font_4x6_extra[];
|
||||
extern const unsigned char font_3x5[];
|
||||
extern const unsigned char font_4x6[];
|
||||
extern const unsigned char font_8x10[];
|
||||
extern const unsigned char font_22x38_num[];
|
||||
extern const unsigned char font_5x7_extra[];
|
||||
extern const unsigned char font_10x14_extra[];
|
||||
extern const unsigned char font_4x6_extra[];
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -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"
|
||||
};
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "opentx.h"
|
||||
|
||||
const pm_uchar about_bmp[] = {
|
||||
const unsigned char about_bmp[] = {
|
||||
#include "about.lbm"
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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"
|
||||
};
|
||||
|
||||
|
|
|
@ -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"
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "opentx.h"
|
||||
|
||||
const pm_uchar about_bmp[] = {
|
||||
const unsigned char about_bmp[] = {
|
||||
#include "about.lbm"
|
||||
};
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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[] = {
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "ff.h"
|
||||
|
||||
FIL g_oLogFile __DMA;
|
||||
const pm_char * g_logError = NULL;
|
||||
const char * g_logError = NULL;
|
||||
uint8_t logDelay;
|
||||
|
||||
void writeHeader();
|
||||
|
@ -41,7 +41,7 @@ void logsInit()
|
|||
memset(&g_oLogFile, 0, sizeof(g_oLogFile));
|
||||
}
|
||||
|
||||
const pm_char * logsOpen()
|
||||
const char * logsOpen()
|
||||
{
|
||||
// Determine and set log file filename
|
||||
FRESULT result;
|
||||
|
@ -192,7 +192,7 @@ uint32_t getLogicalSwitchesStates(uint8_t first)
|
|||
|
||||
void logsWrite()
|
||||
{
|
||||
static const pm_char * error_displayed = NULL;
|
||||
static const char * error_displayed = NULL;
|
||||
|
||||
if (isFunctionActive(FUNCTION_LOGS) && logDelay > 0) {
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
|
@ -200,7 +200,7 @@ void logsWrite()
|
|||
lastLogTime = tmr10ms;
|
||||
|
||||
if (!g_oLogFile.obj.fs) {
|
||||
const pm_char * result = logsOpen();
|
||||
const char * result = logsOpen();
|
||||
if (result != NULL) {
|
||||
if (result != error_displayed) {
|
||||
error_displayed = result;
|
||||
|
|
|
@ -423,13 +423,6 @@ void perMain()
|
|||
|
||||
event_t evt = getEvent(false);
|
||||
|
||||
#if defined(NAVIGATION_STICKS)
|
||||
uint8_t sticks_evt = getSticksNavigationEvent();
|
||||
if (sticks_evt) {
|
||||
evt = sticks_evt;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(RAMBACKUP)
|
||||
if (unexpectedShutdown) {
|
||||
drawFatalErrorScreen(STR_EMERGENCY_MODE);
|
||||
|
|
|
@ -992,9 +992,7 @@ void evalMixes(uint8_t tick10ms)
|
|||
|
||||
int16_t value = applyLimits(i, q); // applyLimits will remove the 256 100% basis
|
||||
|
||||
cli();
|
||||
channelOutputs[i] = value; // copy consistent word to int-level
|
||||
sei();
|
||||
}
|
||||
|
||||
if (tick10ms && flightModesFade) {
|
||||
|
|
|
@ -48,7 +48,7 @@ union ReusableBuffer reusableBuffer __DMA;
|
|||
uint8_t* MSC_BOT_Data = reusableBuffer.MSC_BOT_Data;
|
||||
#endif
|
||||
|
||||
const pm_uint8_t bchout_ar[] = {
|
||||
const uint8_t bchout_ar[] = {
|
||||
0x1B, 0x1E, 0x27, 0x2D, 0x36, 0x39,
|
||||
0x4B, 0x4E, 0x63, 0x6C, 0x72, 0x78,
|
||||
0x87, 0x8D, 0x93, 0x9C, 0xB1, 0xB4,
|
||||
|
@ -56,7 +56,7 @@ const pm_uint8_t bchout_ar[] = {
|
|||
|
||||
uint8_t channel_order(uint8_t x)
|
||||
{
|
||||
return ( ((pgm_read_byte(bchout_ar + g_eeGeneral.templateSetup) >> (6-(x-1) * 2)) & 3 ) + 1 );
|
||||
return ( ((*(bchout_ar + g_eeGeneral.templateSetup) >> (6-(x-1) * 2)) & 3 ) + 1 );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -65,7 +65,7 @@ mode2 rud thr ele ail
|
|||
mode3 ail ele thr rud
|
||||
mode4 ail thr ele rud
|
||||
*/
|
||||
const pm_uint8_t modn12x3[] = {
|
||||
const uint8_t modn12x3[] = {
|
||||
0, 1, 2, 3,
|
||||
0, 2, 1, 3,
|
||||
3, 1, 2, 0,
|
||||
|
@ -1026,7 +1026,7 @@ void checkAlarm() // added by Gohst
|
|||
}
|
||||
}
|
||||
|
||||
void alert(const pm_char * title, const pm_char * msg , uint8_t sound)
|
||||
void alert(const char * title, const char * msg , uint8_t sound)
|
||||
{
|
||||
LED_ERROR_BEGIN();
|
||||
|
||||
|
@ -1562,34 +1562,8 @@ void doMixerCalculations()
|
|||
s_mixer_first_run_done = true;
|
||||
}
|
||||
|
||||
#if defined(NAVIGATION_STICKS)
|
||||
uint8_t StickScrollAllowed;
|
||||
uint8_t StickScrollTimer;
|
||||
static const pm_uint8_t rate[] = { 0, 0, 100, 40, 16, 7, 3, 1 } ;
|
||||
|
||||
uint8_t calcStickScroll( uint8_t index )
|
||||
{
|
||||
uint8_t direction;
|
||||
int8_t value;
|
||||
|
||||
if ( ( g_eeGeneral.stickMode & 1 ) == 0 )
|
||||
index ^= 3;
|
||||
|
||||
value = calibratedAnalogs[index] / 128;
|
||||
direction = value > 0 ? 0x80 : 0;
|
||||
if (value < 0)
|
||||
value = -value; // (abs)
|
||||
if (value > 7)
|
||||
value = 7;
|
||||
value = pgm_read_byte(rate+(uint8_t)value);
|
||||
if (value)
|
||||
StickScrollTimer = STICK_SCROLL_TIMEOUT; // Seconds
|
||||
return value | direction;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define OPENTX_START_ARGS uint8_t splash=true
|
||||
#define OPENTX_START_SPLASH_NEEDED() (splash)
|
||||
#define OPENTX_START_ARGS uint8_t splash=true
|
||||
#define OPENTX_START_SPLASH_NEEDED() (splash)
|
||||
|
||||
void opentxStart(OPENTX_START_ARGS)
|
||||
{
|
||||
|
@ -1717,81 +1691,7 @@ void opentxResume()
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(NAVIGATION_STICKS)
|
||||
uint8_t getSticksNavigationEvent()
|
||||
{
|
||||
uint8_t evt = 0;
|
||||
if (StickScrollAllowed) {
|
||||
if ( StickScrollTimer ) {
|
||||
static uint8_t repeater;
|
||||
uint8_t direction;
|
||||
uint8_t value;
|
||||
|
||||
if ( repeater < 128 )
|
||||
{
|
||||
repeater += 1;
|
||||
}
|
||||
value = calcStickScroll( 2 );
|
||||
direction = value & 0x80;
|
||||
value &= 0x7F;
|
||||
if ( value )
|
||||
{
|
||||
if ( repeater > value )
|
||||
{
|
||||
repeater = 0;
|
||||
if ( evt == 0 )
|
||||
{
|
||||
if ( direction )
|
||||
{
|
||||
evt = EVT_KEY_FIRST(KEY_UP);
|
||||
}
|
||||
else
|
||||
{
|
||||
evt = EVT_KEY_FIRST(KEY_DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
value = calcStickScroll( 3 );
|
||||
direction = value & 0x80;
|
||||
value &= 0x7F;
|
||||
if ( value )
|
||||
{
|
||||
if ( repeater > value )
|
||||
{
|
||||
repeater = 0;
|
||||
if ( evt == 0 )
|
||||
{
|
||||
if ( direction )
|
||||
{
|
||||
evt = EVT_KEY_FIRST(KEY_RIGHT);
|
||||
}
|
||||
else
|
||||
{
|
||||
evt = EVT_KEY_FIRST(KEY_LEFT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
StickScrollTimer = 0; // Seconds
|
||||
}
|
||||
StickScrollAllowed = 1 ;
|
||||
return evt;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define INSTANT_TRIM_MARGIN 10 /* around 1% */
|
||||
#define INSTANT_TRIM_MARGIN 10 /* around 1% */
|
||||
|
||||
void instantTrim()
|
||||
{
|
||||
|
@ -2108,17 +2008,10 @@ int main()
|
|||
drawSplash();
|
||||
#endif
|
||||
|
||||
sei(); // interrupts needed now
|
||||
|
||||
|
||||
#if defined(DSM2_SERIAL) && !defined(TELEMETRY_FRSKY)
|
||||
DSM2_Init();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(MENU_ROTARY_SW)
|
||||
init_rotary_sw();
|
||||
#endif
|
||||
|
|
|
@ -228,17 +228,6 @@
|
|||
|
||||
#if defined(SIMU)
|
||||
#include "targets/simu/simpgmspace.h"
|
||||
#else
|
||||
typedef const unsigned char pm_uchar;
|
||||
typedef const char pm_char;
|
||||
typedef const uint16_t pm_uint16_t;
|
||||
typedef const uint8_t pm_uint8_t;
|
||||
typedef const int16_t pm_int16_t;
|
||||
typedef const int8_t pm_int8_t;
|
||||
#define pgm_read_byte(address_short) (*(uint8_t*)(address_short))
|
||||
#define pgm_read_adr(x) *(x)
|
||||
#define cli()
|
||||
#define sei()
|
||||
#endif
|
||||
|
||||
#include "debug.h"
|
||||
|
@ -309,20 +298,14 @@ void memswap(void * a, void * b, uint8_t size);
|
|||
#define PPM_CH_CENTER(ch) (PPM_CENTER)
|
||||
#endif
|
||||
|
||||
#include "fifo.h"
|
||||
#include "io/io_arm.h"
|
||||
// This doesn't need protection on this processor
|
||||
extern volatile tmr10ms_t g_tmr10ms;
|
||||
#define get_tmr10ms() g_tmr10ms
|
||||
#include "fifo.h"
|
||||
#include "io/io_arm.h"
|
||||
|
||||
#if defined(NAVIGATION_STICKS)
|
||||
extern uint8_t StickScrollAllowed;
|
||||
extern uint8_t StickScrollTimer;
|
||||
#define STICK_SCROLL_TIMEOUT 9
|
||||
#define STICK_SCROLL_DISABLE() StickScrollAllowed = 0
|
||||
#else
|
||||
#define STICK_SCROLL_DISABLE()
|
||||
#endif
|
||||
extern volatile tmr10ms_t g_tmr10ms;
|
||||
static inline tmr10ms_t get_tmr10ms()
|
||||
{
|
||||
return g_tmr10ms;
|
||||
}
|
||||
|
||||
#if defined(CLI)
|
||||
#include "cli.h"
|
||||
|
@ -331,12 +314,10 @@ void memswap(void * a, void * b, uint8_t size);
|
|||
#include "timers.h"
|
||||
#include "storage/storage.h"
|
||||
#include "pulses/pulses.h"
|
||||
|
||||
#include "pulses/modules.h"
|
||||
|
||||
|
||||
#define MASK_CFN_TYPE uint64_t // current max = 64 function switches
|
||||
#define MASK_FUNC_TYPE uint32_t // current max = 32 functions
|
||||
#define MASK_CFN_TYPE uint64_t // current max = 64 function switches
|
||||
#define MASK_FUNC_TYPE uint32_t // current max = 32 functions
|
||||
|
||||
typedef struct {
|
||||
MASK_FUNC_TYPE activeFunctions;
|
||||
|
@ -365,8 +346,8 @@ typedef struct {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
extern const pm_uint8_t bchout_ar[];
|
||||
extern const pm_uint8_t modn12x3[];
|
||||
extern const uint8_t bchout_ar[];
|
||||
extern const uint8_t modn12x3[];
|
||||
|
||||
//convert from mode 1 to mode stickMode
|
||||
//NOTICE! => 0..3 -> 0..3
|
||||
|
@ -374,7 +355,7 @@ extern const pm_uint8_t modn12x3[];
|
|||
#define ELE_STICK 1
|
||||
#define THR_STICK 2
|
||||
#define AIL_STICK 3
|
||||
#define CONVERT_MODE(x) (((x)<=AIL_STICK) ? pgm_read_byte(modn12x3 + 4*g_eeGeneral.stickMode + (x)) : (x) )
|
||||
#define CONVERT_MODE(x) (((x)<=AIL_STICK) ? *(modn12x3 + 4*g_eeGeneral.stickMode + (x)) : (x) )
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
#define CONVERT_MODE_TRIMS(x) (((x) == RUD_STICK) ? AIL_STICK : ((x) == AIL_STICK) ? RUD_STICK : (x))
|
||||
|
@ -488,7 +469,7 @@ uint16_t evalChkSum();
|
|||
#define ALERT(title, msg, sound) alert(title, msg, sound)
|
||||
#endif
|
||||
|
||||
void alert(const pm_char * t, const pm_char * s , uint8_t sound);
|
||||
void alert(const char * t, const char * s , uint8_t sound);
|
||||
|
||||
enum PerOutMode {
|
||||
e_perout_mode_normal = 0,
|
||||
|
@ -610,7 +591,7 @@ extern uint8_t unexpectedShutdown;
|
|||
extern uint16_t maxMixerDuration;
|
||||
|
||||
|
||||
#define DURATION_MS_PREC2(x) ((x)/20)
|
||||
#define DURATION_MS_PREC2(x) ((x)/20)
|
||||
|
||||
#if defined(THRTRACE)
|
||||
#if defined(COLORLCD)
|
||||
|
@ -660,10 +641,16 @@ void checkSwitches();
|
|||
void checkAlarm();
|
||||
void checkAll();
|
||||
|
||||
#if !defined(SIMU)
|
||||
void getADC();
|
||||
#define GET_ADC_IF_MIXER_NOT_RUNNING() do { if (s_pulses_paused) getADC(); } while(0)
|
||||
#endif
|
||||
static inline void GET_ADC_IF_MIXER_NOT_RUNNING()
|
||||
{
|
||||
do {
|
||||
if (s_pulses_paused) {
|
||||
getADC();
|
||||
}
|
||||
}
|
||||
while(0);
|
||||
}
|
||||
|
||||
#include "sbus.h"
|
||||
|
||||
|
@ -1287,7 +1274,7 @@ inline int div_and_round(int num, int den)
|
|||
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
|
||||
extern const pm_uint8_t bchunit_ar[];
|
||||
extern const uint8_t bchunit_ar[];
|
||||
|
||||
#define FRSKY_MULTIPLIER_MAX 5
|
||||
|
||||
|
@ -1327,7 +1314,7 @@ void varioWakeup();
|
|||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
extern const pm_uchar logo_taranis[];
|
||||
extern const unsigned char logo_taranis[];
|
||||
#endif
|
||||
|
||||
#if defined(STM32)
|
||||
|
|
|
@ -107,7 +107,7 @@ uint32_t sdGetFreeSectors();
|
|||
const char * sdCheckAndCreateDirectory(const char * path);
|
||||
|
||||
#if !defined(BOOT)
|
||||
inline const pm_char * SDCARD_ERROR(FRESULT result)
|
||||
inline const char * SDCARD_ERROR(FRESULT result)
|
||||
{
|
||||
if (result == FR_NOT_READY)
|
||||
return STR_NO_SDCARD;
|
||||
|
|
|
@ -31,14 +31,14 @@
|
|||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
const pm_char vers_stamp[] = "VERS" TAB ": " "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")";
|
||||
const pm_char date_stamp[] = "DATE" TAB ": " DATE;
|
||||
const pm_char time_stamp[] = "TIME" TAB ": " TIME;
|
||||
const pm_char eeprom_stamp[] = "EEPR" TAB ": " EEPROM_STR;
|
||||
const char vers_stamp[] = "VERS" TAB ": " "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")";
|
||||
const char date_stamp[] = "DATE" TAB ": " DATE;
|
||||
const char time_stamp[] = "TIME" TAB ": " TIME;
|
||||
const char eeprom_stamp[] = "EEPR" TAB ": " EEPROM_STR;
|
||||
#elif defined(PCBTARANIS)
|
||||
const pm_char vers_stamp[] = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION " (" GIT_STR ")" "\036DATE\037\033: " DATE " " TIME "\036EEPR\037\033: " EEPROM_STR;
|
||||
const char vers_stamp[] = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION " (" GIT_STR ")" "\036DATE\037\033: " DATE " " TIME "\036EEPR\037\033: " EEPROM_STR;
|
||||
#else
|
||||
const pm_char vers_stamp[] = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION "\036DATE\037\033: " DATE "\036TIME\037\033: " TIME "\036EEPR\037\033: " EEPROM_STR;
|
||||
const char vers_stamp[] = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION "\036DATE\037\033: " DATE "\036TIME\037\033: " TIME "\036EEPR\037\033: " EEPROM_STR;
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -440,7 +440,7 @@ uint16_t eeModelSize(uint8_t index)
|
|||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
const pm_char * eeBackupModel(uint8_t i_fileSrc)
|
||||
const char * eeBackupModel(uint8_t i_fileSrc)
|
||||
{
|
||||
char * buf = reusableBuffer.modelsel.mainname;
|
||||
FIL archiveFile;
|
||||
|
@ -507,7 +507,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
||||
const char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
||||
{
|
||||
char * buf = reusableBuffer.modelsel.mainname;
|
||||
FIL restoreFile;
|
||||
|
|
|
@ -32,8 +32,8 @@ void eeSwapModels(uint8_t id1, uint8_t id2);
|
|||
#define DISPLAY_PROGRESS_BAR(x)
|
||||
|
||||
#if defined(SDCARD)
|
||||
const pm_char * eeBackupModel(uint8_t i_fileSrc);
|
||||
const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name);
|
||||
const char * eeBackupModel(uint8_t i_fileSrc);
|
||||
const char * eeRestoreModel(uint8_t i_fileDst, char *model_name);
|
||||
#endif
|
||||
|
||||
enum EepromWriteState {
|
||||
|
|
|
@ -441,7 +441,7 @@ bool RlcFile::copy(uint8_t i_fileDst, uint8_t i_fileSrc)
|
|||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
const pm_char * eeBackupModel(uint8_t i_fileSrc)
|
||||
const char * eeBackupModel(uint8_t i_fileSrc)
|
||||
{
|
||||
char * buf = reusableBuffer.modelsel.mainname;
|
||||
UINT written;
|
||||
|
@ -524,7 +524,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
||||
const char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
||||
{
|
||||
char * buf = reusableBuffer.modelsel.mainname;
|
||||
UINT read;
|
||||
|
|
|
@ -183,8 +183,8 @@ void eeSwapModels(uint8_t id1, uint8_t id2);
|
|||
void eeDeleteModel(uint8_t idx);
|
||||
|
||||
#if defined(SDCARD)
|
||||
const pm_char * eeBackupModel(uint8_t i_fileSrc);
|
||||
const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name);
|
||||
const char * eeBackupModel(uint8_t i_fileSrc);
|
||||
const char * eeRestoreModel(uint8_t i_fileDst, char *model_name);
|
||||
#endif
|
||||
|
||||
// For conversions
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "opentx.h"
|
||||
|
||||
#if !defined(BOOT)
|
||||
const pm_char s_charTab[] = "_-.,";
|
||||
const char s_charTab[] = "_-.,";
|
||||
|
||||
char hex2zchar(uint8_t hex)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ char idx2char(int8_t idx)
|
|||
}
|
||||
if (idx < 27) return 'A' + idx - 1;
|
||||
if (idx < 37) return '0' + idx - 27;
|
||||
if (idx <= 40) return pgm_read_byte(s_charTab+idx-37);
|
||||
if (idx <= 40) return *(s_charTab+idx-37);
|
||||
#if LEN_SPECIAL_CHARS > 0
|
||||
if (idx <= (LEN_STD_CHARS + LEN_SPECIAL_CHARS)) return 'z' + 5 + idx - 40;
|
||||
#endif
|
||||
|
|
|
@ -553,11 +553,10 @@ void checkSwitches()
|
|||
|
||||
while (1) {
|
||||
|
||||
#if defined(TELEMETRY_MOD_14051) || defined(TELEMETRY_MOD_14051_SWAPPED)
|
||||
#define GETADC_COUNT (MUX_MAX+1)
|
||||
#elif defined(PCBTARANIS) || defined(PCBHORUS)
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
||||
#define GETADC_COUNT 1
|
||||
#endif
|
||||
|
||||
#ifdef GETADC_COUNT
|
||||
for (uint8_t i=0; i<GETADC_COUNT; i++) {
|
||||
GET_ADC_IF_MIXER_NOT_RUNNING();
|
||||
|
|
|
@ -77,16 +77,8 @@ void sig(int sgn)
|
|||
#undef min
|
||||
#undef max
|
||||
|
||||
#define APM
|
||||
#define __REV
|
||||
|
||||
typedef const unsigned char pm_uchar;
|
||||
typedef const char pm_char;
|
||||
typedef const uint16_t pm_uint16_t;
|
||||
typedef const uint8_t pm_uint8_t;
|
||||
typedef const int16_t pm_int16_t;
|
||||
typedef const int8_t pm_int8_t;
|
||||
|
||||
#if defined(STM32)
|
||||
extern GPIO_TypeDef gpioa, gpiob, gpioc, gpiod, gpioe, gpiof, gpiog, gpioh, gpioi, gpioj;
|
||||
extern TIM_TypeDef tim1, tim2, tim3, tim4, tim5, tim6, tim7, tim8, tim9, tim10;
|
||||
|
@ -235,13 +227,12 @@ extern uint32_t Master_frequency;
|
|||
#define __disable_irq()
|
||||
#define __enable_irq()
|
||||
|
||||
extern uint8_t portb, portc, porth, dummyport;
|
||||
extern uint16_t dummyport16;
|
||||
extern uint8_t main_thread_running;
|
||||
extern char * main_thread_error;
|
||||
|
||||
#define getADC()
|
||||
#define GET_ADC_IF_MIXER_NOT_RUNNING()
|
||||
static inline void getADC()
|
||||
{
|
||||
}
|
||||
|
||||
#define SIMU_SLEEP(x) do { if (!main_thread_running) return; sleep(x/*ms*/); } while (0)
|
||||
#define SIMU_SLEEP_NORET(x) do { sleep(x/*ms*/); } while (0)
|
||||
|
|
|
@ -107,10 +107,10 @@ extern "C" void INTERRUPT_xMS_IRQHandler()
|
|||
#endif
|
||||
|
||||
#if (defined(PCBX9E) && !defined(SIMU))
|
||||
const pm_uchar bmp_startup[] = {
|
||||
const unsigned char bmp_startup[] = {
|
||||
#include "startup.lbm"
|
||||
};
|
||||
const pm_uchar bmp_lock[] = {
|
||||
const unsigned char bmp_lock[] = {
|
||||
#include "lock.lbm"
|
||||
};
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -25,13 +25,13 @@ def modifyTranslations(constant, translation, after):
|
|||
|
||||
|
||||
def modifyDeclaration(constant, after):
|
||||
newline = "extern const pm_char S" + constant + "[];"
|
||||
newline = "extern const char S" + constant + "[];"
|
||||
filename = "translations.h"
|
||||
addLine(filename, newline, after + "[];")
|
||||
|
||||
|
||||
def modifyDefinition(constant, after):
|
||||
newline = "const pm_char S" + constant + "[] = " + constant + ";"
|
||||
newline = "const char S" + constant + "[] = " + constant + ";"
|
||||
filename = "translations.cpp"
|
||||
addLine(filename, newline, after + "[] ")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue