mirror of
https://github.com/opentx/opentx.git
synced 2025-07-20 06:45:10 +03:00
Compilation fixes
This commit is contained in:
parent
3323b0a82f
commit
354cd97fd3
2 changed files with 20 additions and 20 deletions
|
@ -243,7 +243,7 @@ int getSwitchWarningsCount()
|
||||||
#define PORT_CHANNELS_ROWS(x) (x==INTERNAL_MODULE ? INTERNAL_MODULE_CHANNELS_ROWS : (x==EXTERNAL_MODULE ? EXTERNAL_MODULE_CHANNELS_ROWS : 1))
|
#define PORT_CHANNELS_ROWS(x) (x==INTERNAL_MODULE ? INTERNAL_MODULE_CHANNELS_ROWS : (x==EXTERNAL_MODULE ? EXTERNAL_MODULE_CHANNELS_ROWS : 1))
|
||||||
|
|
||||||
#if defined(BLUETOOTH) && defined(USEHORUSBT)
|
#if defined(BLUETOOTH) && defined(USEHORUSBT)
|
||||||
#define TRAINER_LINE1_BLUETOOTH_M_ROWS ((bluetoothDistantAddr[0] == 0 || bluetoothState == BLUETOOTH_STATE_CONNECTED) ? (uint8_t)0 : (uint8_t)1)
|
#define TRAINER_LINE1_BLUETOOTH_M_ROWS ((bluetoothDistantAddr[0] == 0 || bluetooth.state == BLUETOOTH_STATE_CONNECTED) ? (uint8_t)0 : (uint8_t)1)
|
||||||
#define TRAINER_LINE1_ROWS (g_model.trainerData.mode == TRAINER_MODE_SLAVE ? (uint8_t)1 : (g_model.trainerData.mode == TRAINER_MODE_MASTER_BLUETOOTH ? TRAINER_LINE1_BLUETOOTH_M_ROWS : (g_model.trainerData.mode == TRAINER_MODE_SLAVE_BLUETOOTH ? (uint8_t)1 : HIDDEN_ROW)))
|
#define TRAINER_LINE1_ROWS (g_model.trainerData.mode == TRAINER_MODE_SLAVE ? (uint8_t)1 : (g_model.trainerData.mode == TRAINER_MODE_MASTER_BLUETOOTH ? TRAINER_LINE1_BLUETOOTH_M_ROWS : (g_model.trainerData.mode == TRAINER_MODE_SLAVE_BLUETOOTH ? (uint8_t)1 : HIDDEN_ROW)))
|
||||||
#define TRAINER_LINE2_ROWS (g_model.trainerData.mode == TRAINER_MODE_SLAVE ? (uint8_t)2 : HIDDEN_ROW)
|
#define TRAINER_LINE2_ROWS (g_model.trainerData.mode == TRAINER_MODE_SLAVE ? (uint8_t)2 : HIDDEN_ROW)
|
||||||
#else
|
#else
|
||||||
|
@ -717,7 +717,7 @@ void menuModelSetup(event_t event)
|
||||||
}
|
}
|
||||||
#if defined(BLUETOOTH) && defined(USEHORUSBT)
|
#if defined(BLUETOOTH) && defined(USEHORUSBT)
|
||||||
if (attr && checkIncDec_Ret) {
|
if (attr && checkIncDec_Ret) {
|
||||||
bluetoothState = BLUETOOTH_STATE_OFF;
|
bluetooth.state = BLUETOOTH_STATE_OFF;
|
||||||
bluetoothDistantAddr[0] = 0;
|
bluetoothDistantAddr[0] = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -842,7 +842,7 @@ void menuModelSetup(event_t event)
|
||||||
}
|
}
|
||||||
if (bluetoothDistantAddr[0]) {
|
if (bluetoothDistantAddr[0]) {
|
||||||
lcdDrawText(INDENT_WIDTH, y+1, bluetoothDistantAddr, TINSIZE);
|
lcdDrawText(INDENT_WIDTH, y+1, bluetoothDistantAddr, TINSIZE);
|
||||||
if (bluetoothState != BLUETOOTH_STATE_CONNECTED) {
|
if (bluetooth.state != BLUETOOTH_STATE_CONNECTED) {
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Bind"), menuHorizontalPosition == 0 ? attr : 0);
|
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Bind"), menuHorizontalPosition == 0 ? attr : 0);
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+5*FW, y, BUTTON("Clear"), menuHorizontalPosition == 1 ? attr : 0);
|
lcdDrawText(MODEL_SETUP_2ND_COLUMN+5*FW, y, BUTTON("Clear"), menuHorizontalPosition == 1 ? attr : 0);
|
||||||
}
|
}
|
||||||
|
@ -850,26 +850,26 @@ void menuModelSetup(event_t event)
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Clear"), attr);
|
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Clear"), attr);
|
||||||
}
|
}
|
||||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
||||||
if (bluetoothState == BLUETOOTH_STATE_CONNECTED || menuHorizontalPosition == 1) {
|
if (bluetooth.state == BLUETOOTH_STATE_CONNECTED || menuHorizontalPosition == 1) {
|
||||||
bluetoothState = BLUETOOTH_STATE_OFF;
|
bluetooth.state = BLUETOOTH_STATE_OFF;
|
||||||
bluetoothDistantAddr[0] = 0;
|
bluetoothDistantAddr[0] = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bluetoothState = BLUETOOTH_STATE_BIND_REQUESTED;
|
bluetooth.state = BLUETOOTH_STATE_BIND_REQUESTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawText(INDENT_WIDTH, y, "---");
|
lcdDrawText(INDENT_WIDTH, y, "---");
|
||||||
if (bluetoothState < BLUETOOTH_STATE_IDLE)
|
if (bluetooth.state < BLUETOOTH_STATE_IDLE)
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Init"), attr);
|
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Init"), attr);
|
||||||
else
|
else
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Discover"), attr);
|
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Discover"), attr);
|
||||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
||||||
if (bluetoothState < BLUETOOTH_STATE_IDLE)
|
if (bluetooth.state < BLUETOOTH_STATE_IDLE)
|
||||||
bluetoothState = BLUETOOTH_STATE_OFF;
|
bluetooth.state = BLUETOOTH_STATE_OFF;
|
||||||
else
|
else
|
||||||
bluetoothState = BLUETOOTH_STATE_DISCOVER_REQUESTED;
|
bluetooth.state = BLUETOOTH_STATE_DISCOVER_REQUESTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -253,7 +253,7 @@ int getSwitchWarningsCount()
|
||||||
#define POT_WARN_ITEMS() ((g_model.potsWarnMode) ? uint8_t(NAVIGATION_LINE_BY_LINE|(NUM_POTS-1)) : (uint8_t)0)
|
#define POT_WARN_ITEMS() ((g_model.potsWarnMode) ? uint8_t(NAVIGATION_LINE_BY_LINE|(NUM_POTS-1)) : (uint8_t)0)
|
||||||
#define SLIDER_WARN_ITEMS() ((g_model.potsWarnMode) ? uint8_t(NAVIGATION_LINE_BY_LINE|(NUM_SLIDERS-1)) : (uint8_t)0)
|
#define SLIDER_WARN_ITEMS() ((g_model.potsWarnMode) ? uint8_t(NAVIGATION_LINE_BY_LINE|(NUM_SLIDERS-1)) : (uint8_t)0)
|
||||||
|
|
||||||
#define TRAINER_LINE1_BLUETOOTH_M_ROWS ((bluetoothDistantAddr[0] == 0 || bluetoothState == BLUETOOTH_STATE_CONNECTED) ? (uint8_t)0 : (uint8_t)1)
|
#define TRAINER_LINE1_BLUETOOTH_M_ROWS ((bluetoothDistantAddr[0] == 0 || bluetooth.state == BLUETOOTH_STATE_CONNECTED) ? (uint8_t)0 : (uint8_t)1)
|
||||||
#define TRAINER_LINE1_ROWS (g_model.trainerData.mode == TRAINER_MODE_SLAVE ? (uint8_t)1 : (g_model.trainerData.mode == TRAINER_MODE_MASTER_BLUETOOTH ? TRAINER_LINE1_BLUETOOTH_M_ROWS : (g_model.trainerData.mode == TRAINER_MODE_SLAVE_BLUETOOTH ? (uint8_t)1 : HIDDEN_ROW)))
|
#define TRAINER_LINE1_ROWS (g_model.trainerData.mode == TRAINER_MODE_SLAVE ? (uint8_t)1 : (g_model.trainerData.mode == TRAINER_MODE_MASTER_BLUETOOTH ? TRAINER_LINE1_BLUETOOTH_M_ROWS : (g_model.trainerData.mode == TRAINER_MODE_SLAVE_BLUETOOTH ? (uint8_t)1 : HIDDEN_ROW)))
|
||||||
#define TRAINER_LINE2_ROWS (g_model.trainerData.mode == TRAINER_MODE_SLAVE ? (uint8_t)2 : HIDDEN_ROW)
|
#define TRAINER_LINE2_ROWS (g_model.trainerData.mode == TRAINER_MODE_SLAVE ? (uint8_t)2 : HIDDEN_ROW)
|
||||||
|
|
||||||
|
@ -679,7 +679,7 @@ bool menuModelSetup(event_t event)
|
||||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_MODE);
|
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_MODE);
|
||||||
g_model.trainerData.mode = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_VTRAINERMODES, g_model.trainerData.mode, 0, TRAINER_MODE_MAX(), attr, event);
|
g_model.trainerData.mode = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_VTRAINERMODES, g_model.trainerData.mode, 0, TRAINER_MODE_MAX(), attr, event);
|
||||||
if (attr && checkIncDec_Ret) {
|
if (attr && checkIncDec_Ret) {
|
||||||
bluetoothState = BLUETOOTH_STATE_OFF;
|
bluetooth.state = BLUETOOTH_STATE_OFF;
|
||||||
bluetoothDistantAddr[0] = 0;
|
bluetoothDistantAddr[0] = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -800,7 +800,7 @@ bool menuModelSetup(event_t event)
|
||||||
}
|
}
|
||||||
if (bluetoothDistantAddr[0]) {
|
if (bluetoothDistantAddr[0]) {
|
||||||
lcdDrawText(MENUS_MARGIN_LEFT + INDENT_WIDTH, y, bluetoothDistantAddr);
|
lcdDrawText(MENUS_MARGIN_LEFT + INDENT_WIDTH, y, bluetoothDistantAddr);
|
||||||
if (bluetoothState != BLUETOOTH_STATE_CONNECTED) {
|
if (bluetooth.state != BLUETOOTH_STATE_CONNECTED) {
|
||||||
drawButton(MODEL_SETUP_2ND_COLUMN, y, "Bind", menuHorizontalPosition == 0 ? attr : 0);
|
drawButton(MODEL_SETUP_2ND_COLUMN, y, "Bind", menuHorizontalPosition == 0 ? attr : 0);
|
||||||
drawButton(MODEL_SETUP_2ND_COLUMN+60, y, "Clear", menuHorizontalPosition == 1 ? attr : 0);
|
drawButton(MODEL_SETUP_2ND_COLUMN+60, y, "Clear", menuHorizontalPosition == 1 ? attr : 0);
|
||||||
}
|
}
|
||||||
|
@ -808,26 +808,26 @@ bool menuModelSetup(event_t event)
|
||||||
drawButton(MODEL_SETUP_2ND_COLUMN, y, "Clear", attr);
|
drawButton(MODEL_SETUP_2ND_COLUMN, y, "Clear", attr);
|
||||||
}
|
}
|
||||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
||||||
if (bluetoothState == BLUETOOTH_STATE_CONNECTED || menuHorizontalPosition == 1) {
|
if (bluetooth.state == BLUETOOTH_STATE_CONNECTED || menuHorizontalPosition == 1) {
|
||||||
bluetoothState = BLUETOOTH_STATE_OFF;
|
bluetooth.state = BLUETOOTH_STATE_OFF;
|
||||||
bluetoothDistantAddr[0] = 0;
|
bluetoothDistantAddr[0] = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bluetoothState = BLUETOOTH_STATE_BIND_REQUESTED;
|
bluetooth.state = BLUETOOTH_STATE_BIND_REQUESTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawText(MENUS_MARGIN_LEFT + INDENT_WIDTH, y, "---");
|
lcdDrawText(MENUS_MARGIN_LEFT + INDENT_WIDTH, y, "---");
|
||||||
if (bluetoothState < BLUETOOTH_STATE_IDLE)
|
if (bluetooth.state < BLUETOOTH_STATE_IDLE)
|
||||||
drawButton(MODEL_SETUP_2ND_COLUMN, y, STR_BLUETOOTH_INIT, attr);
|
drawButton(MODEL_SETUP_2ND_COLUMN, y, STR_BLUETOOTH_INIT, attr);
|
||||||
else
|
else
|
||||||
drawButton(MODEL_SETUP_2ND_COLUMN, y, STR_BLUETOOTH_DISC, attr);
|
drawButton(MODEL_SETUP_2ND_COLUMN, y, STR_BLUETOOTH_DISC, attr);
|
||||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
||||||
if (bluetoothState < BLUETOOTH_STATE_IDLE)
|
if (bluetooth.state < BLUETOOTH_STATE_IDLE)
|
||||||
bluetoothState = BLUETOOTH_STATE_OFF;
|
bluetooth.state = BLUETOOTH_STATE_OFF;
|
||||||
else
|
else
|
||||||
bluetoothState = BLUETOOTH_STATE_DISCOVER_REQUESTED;
|
bluetooth.state = BLUETOOTH_STATE_DISCOVER_REQUESTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue