mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
Compilation fixes
This commit is contained in:
parent
39d99abc30
commit
07840007de
10 changed files with 20 additions and 31 deletions
|
@ -24,7 +24,7 @@ void runPopupCurvePreset(event_t event)
|
|||
{
|
||||
warningResult = false;
|
||||
|
||||
drawMessageBox();
|
||||
drawMessageBox(warningText);
|
||||
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+2*FH, STR_POPUPS_ENTER_EXIT);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ enum MenuModelFlightModeItems {
|
|||
IF_ROTARY_ENCODERS(ITEM_MODEL_FLIGHT_MODE_ROTARY_ENCODERS)
|
||||
ITEM_MODEL_FLIGHT_MODE_FADE_IN,
|
||||
ITEM_MODEL_FLIGHT_MODE_FADE_OUT,
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
#if defined(GVARS)
|
||||
ITEM_MODEL_FLIGHT_MODE_GVARS_LABEL,
|
||||
ITEM_MODEL_FLIGHT_MODE_GV1,
|
||||
ITEM_MODEL_FLIGHT_MODE_GV2,
|
||||
|
@ -87,7 +87,7 @@ void menuModelFlightModeOne(event_t event)
|
|||
int8_t sub = menuVerticalPosition;
|
||||
int8_t editMode = s_editMode;
|
||||
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
#if defined(GVARS)
|
||||
if (s_currIdx == 0 && sub>=ITEM_MODEL_FLIGHT_MODE_SWITCH) sub += VERTICAL_SHIFT;
|
||||
|
||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||
|
@ -147,7 +147,7 @@ void menuModelFlightModeOne(event_t event)
|
|||
fm->fadeOut = EDIT_DELAY(0, y, event, attr, STR_FADEOUT, fm->fadeOut);
|
||||
break;
|
||||
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
#if defined(GVARS)
|
||||
case ITEM_MODEL_FLIGHT_MODE_GVARS_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_GLOBAL_VARS);
|
||||
break;
|
||||
|
|
|
@ -350,7 +350,7 @@ void runPopupRegister(event_t event)
|
|||
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
if (s_editMode <= 0) {
|
||||
warningText = NULL;
|
||||
warningText = nullptr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ void runPopupRegister(event_t event)
|
|||
const uint8_t dialogRows[] = { 0, 0, uint8_t(reusableBuffer.moduleSetup.pxx2.registerStep < REGISTER_RX_NAME_RECEIVED ? READONLY_ROW : 0), uint8_t(reusableBuffer.moduleSetup.pxx2.registerStep < REGISTER_RX_NAME_RECEIVED ? 0 : 1)};
|
||||
check(event, 0, nullptr, 0, dialogRows, 3, 4 - HEADER_LINE); // TODO add a comment for 3 - HEADER_LINE once understood
|
||||
|
||||
drawMessageBox();
|
||||
drawMessageBox(warningText);
|
||||
|
||||
// registration password
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y - 4, STR_REG_ID);
|
||||
|
|
|
@ -27,22 +27,14 @@ uint8_t warningType;
|
|||
uint8_t warningResult = 0;
|
||||
uint8_t warningInfoFlags = ZCHAR;
|
||||
|
||||
void drawMessageBox()
|
||||
void drawMessageBox(const char * title)
|
||||
{
|
||||
lcdDrawFilledRect(MENU_X, MENU_Y, MENU_W, 40, SOLID, ERASE);
|
||||
lcdDrawRect(MENU_X, MENU_Y, MENU_W, 40);
|
||||
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y, warningText, WARNING_LINE_LEN);
|
||||
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y, title, WARNING_LINE_LEN);
|
||||
// could be a place for a warningInfoText
|
||||
}
|
||||
|
||||
void showMessageBox(const char * str)
|
||||
{
|
||||
warningText = str;
|
||||
drawMessageBox();
|
||||
warningText = NULL;
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
const unsigned char ASTERISK_BITMAP[] = {
|
||||
#include "asterisk.lbm"
|
||||
};
|
||||
|
|
|
@ -30,12 +30,10 @@
|
|||
#define WARNING_LINE_X 16
|
||||
#define WARNING_LINE_Y 3*FH
|
||||
|
||||
void drawMessageBox();
|
||||
void drawMessageBox(const char * title);
|
||||
void showMessageBox(const char * title);
|
||||
void runPopupWarning(event_t event);
|
||||
|
||||
#define DRAW_MESSAGE_BOX(title) (warningText = title, drawMessageBox(), warningText = NULL)
|
||||
|
||||
extern void (*popupFunc)(event_t event);
|
||||
extern uint8_t warningInfoFlags;
|
||||
|
||||
|
|
|
@ -399,7 +399,7 @@ void menuMainView(event_t event)
|
|||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
#if defined(GVARS)
|
||||
if (gvarDisplayTimer > 0) {
|
||||
gvarDisplayTimer = 0;
|
||||
}
|
||||
|
@ -551,11 +551,11 @@ void menuMainView(event_t event)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
#if defined(GVARS)
|
||||
if (gvarDisplayTimer > 0) {
|
||||
gvarDisplayTimer--;
|
||||
warningText = STR_GLOBAL_VAR;
|
||||
drawMessageBox();
|
||||
drawMessageBox(warningText);
|
||||
lcdDrawSizedText(16, 5*FH, g_model.gvars[gvarLastChanged].name, LEN_GVAR_NAME, ZCHAR);
|
||||
lcdDrawText(16+6*FW, 5*FH, "[", BOLD);
|
||||
drawGVarValue(lcdLastRightPos, 5*FH, gvarLastChanged, GVAR_VALUE(gvarLastChanged, getGVarFlightMode(mixerCurrentFlightMode, gvarLastChanged)), LEFT|BOLD);
|
||||
|
|
|
@ -35,12 +35,6 @@ void drawMessageBox(const char * title)
|
|||
// could be a place for a warningInfoText
|
||||
}
|
||||
|
||||
void showMessageBox(const char * title)
|
||||
{
|
||||
drawMessageBox(title);
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
const unsigned char ASTERISK_BITMAP[] = {
|
||||
#include "asterisk.lbm"
|
||||
};
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
void drawMessageBox(const char * title);
|
||||
void showMessageBox(const char * title);
|
||||
void runPopupWarning(event_t event);
|
||||
#define DRAW_MESSAGE_BOX(title) drawMessageBox(title)
|
||||
|
||||
extern void (*popupFunc)(event_t event);
|
||||
extern uint8_t warningInfoFlags;
|
||||
|
|
|
@ -139,7 +139,7 @@ void runPopupWarning(event_t event)
|
|||
{
|
||||
warningResult = false;
|
||||
|
||||
drawMessageBox();
|
||||
drawMessageBox(warningText);
|
||||
|
||||
if (warningInfoText) {
|
||||
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, WARNING_INFO_FLAGS);
|
||||
|
@ -174,6 +174,12 @@ void runPopupWarning(event_t event)
|
|||
}
|
||||
}
|
||||
|
||||
void showMessageBox(const char * str)
|
||||
{
|
||||
drawMessageBox(str);
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
void showAlertBox(const char * title, const char * text, const char * action , uint8_t sound)
|
||||
{
|
||||
drawAlertBox(title, text, action);
|
||||
|
|
|
@ -733,7 +733,7 @@ void luaLoadPermanentScripts()
|
|||
void displayLuaError(const char * title)
|
||||
{
|
||||
#if !defined(COLORLCD)
|
||||
DRAW_MESSAGE_BOX(title);
|
||||
drawMessageBox(title);
|
||||
#endif
|
||||
if (lua_warning_info[0]) {
|
||||
char * split = strstr(lua_warning_info, ": ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue