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"
@@ -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);