Compile fixes
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, LcdFlags flags)
|
void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, LcdFlags flags)
|
||||||
{
|
{
|
||||||
@@ -35,7 +36,7 @@ void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, Lc
|
|||||||
FlightModesType editFlightModes(coord_t x, coord_t y, event_t event, FlightModesType value, uint8_t attr)
|
FlightModesType editFlightModes(coord_t x, coord_t y, event_t event, FlightModesType value, uint8_t attr)
|
||||||
{
|
{
|
||||||
int posHorz = menuHorizontalPosition;
|
int posHorz = menuHorizontalPosition;
|
||||||
|
|
||||||
for (uint8_t p=0; p<MAX_FLIGHT_MODES; p++) {
|
for (uint8_t p=0; p<MAX_FLIGHT_MODES; p++) {
|
||||||
LcdFlags flags = 0;
|
LcdFlags flags = 0;
|
||||||
if (attr) {
|
if (attr) {
|
||||||
@@ -48,7 +49,7 @@ FlightModesType editFlightModes(coord_t x, coord_t y, event_t event, FlightModes
|
|||||||
lcdDrawChar(x, y, '0'+p, flags);
|
lcdDrawChar(x, y, '0'+p, flags);
|
||||||
x += FW;
|
x += FW;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attr) {
|
if (attr) {
|
||||||
if (s_editMode && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
if (s_editMode && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
s_editMode = 0;
|
s_editMode = 0;
|
||||||
@@ -56,7 +57,7 @@ FlightModesType editFlightModes(coord_t x, coord_t y, event_t event, FlightModes
|
|||||||
storageDirty(EE_MODEL);
|
storageDirty(EE_MODEL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,13 +73,13 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, ui
|
|||||||
|
|
||||||
lcdDrawSizedText(x, y, name, size, attr | mode);
|
lcdDrawSizedText(x, y, name, size, attr | mode);
|
||||||
coord_t backupNextPos = lcdNextPos;
|
coord_t backupNextPos = lcdNextPos;
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
uint8_t cur = editNameCursorPos;
|
uint8_t cur = editNameCursorPos;
|
||||||
if (s_editMode > 0) {
|
if (s_editMode > 0) {
|
||||||
int8_t c = name[cur];
|
int8_t c = name[cur];
|
||||||
int8_t v = c;
|
int8_t v = c;
|
||||||
|
|
||||||
if (IS_NEXT_EVENT(event) || IS_PREVIOUS_EVENT(event)) {
|
if (IS_NEXT_EVENT(event) || IS_PREVIOUS_EVENT(event)) {
|
||||||
if (attr == ZCHAR) {
|
if (attr == ZCHAR) {
|
||||||
v = checkIncDec(event, abs(v), 0, ZCHAR_MAX, 0);
|
v = checkIncDec(event, abs(v), 0, ZCHAR_MAX, 0);
|
||||||
@@ -88,7 +89,7 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, ui
|
|||||||
v = checkIncDec(event, abs(v), '0', 'z', 0);
|
v = checkIncDec(event, abs(v), '0', 'z', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case EVT_KEY_BREAK(KEY_ENTER):
|
case EVT_KEY_BREAK(KEY_ENTER):
|
||||||
if (s_editMode == EDIT_MODIFY_FIELD) {
|
if (s_editMode == EDIT_MODIFY_FIELD) {
|
||||||
@@ -105,7 +106,7 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, ui
|
|||||||
case EVT_KEY_BREAK(KEY_LEFT):
|
case EVT_KEY_BREAK(KEY_LEFT):
|
||||||
if (cur>0) cur--;
|
if (cur>0) cur--;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_RIGHT):
|
case EVT_KEY_BREAK(KEY_RIGHT):
|
||||||
if (cur<size-1) cur++;
|
if (cur<size-1) cur++;
|
||||||
break;
|
break;
|
||||||
@@ -119,7 +120,7 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, ui
|
|||||||
case EVT_KEY_LONG(KEY_LEFT):
|
case EVT_KEY_LONG(KEY_LEFT):
|
||||||
case EVT_KEY_LONG(KEY_RIGHT):
|
case EVT_KEY_LONG(KEY_RIGHT):
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (attr & ZCHAR) {
|
if (attr & ZCHAR) {
|
||||||
#if defined(PCBTARANIS) && !defined(PCBXLITE)
|
#if defined(PCBTARANIS) && !defined(PCBXLITE)
|
||||||
if (v == 0) {
|
if (v == 0) {
|
||||||
@@ -153,12 +154,12 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, ui
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c != v) {
|
if (c != v) {
|
||||||
name[cur] = v;
|
name[cur] = v;
|
||||||
storageDirty(isModelMenuDisplayed() ? EE_MODEL : EE_GENERAL);
|
storageDirty(isModelMenuDisplayed() ? EE_MODEL : EE_GENERAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attr == ZCHAR) {
|
if (attr == ZCHAR) {
|
||||||
lcdDrawChar(x+editNameCursorPos*FW, y, zchar2char(v), ERASEBG|INVERS|FIXEDWIDTH);
|
lcdDrawChar(x+editNameCursorPos*FW, y, zchar2char(v), ERASEBG|INVERS|FIXEDWIDTH);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -386,7 +386,6 @@ const char STR_TURN_OFF_RECEIVER [] = TR_TURN_OFF_RECEIVER ;
|
|||||||
const char STR_STOPPING [] = TR_STOPPING ;
|
const char STR_STOPPING [] = TR_STOPPING ;
|
||||||
const char STR_MENU_SPECTRUM_ANALYSER[] = TR_MENU_SPECTRUM_ANALYSER;
|
const char STR_MENU_SPECTRUM_ANALYSER[] = TR_MENU_SPECTRUM_ANALYSER;
|
||||||
const char STR_MENU_POWER_METER[] = TR_MENU_POWER_METER;
|
const char STR_MENU_POWER_METER[] = TR_MENU_POWER_METER;
|
||||||
const char STR_MENUTOOLS[] = TR_MENUTOOLS;
|
|
||||||
const char STR_SENSOR[] = TR_SENSOR;
|
const char STR_SENSOR[] = TR_SENSOR;
|
||||||
const char STR_DISABLE_INTERNAL[] = TR_DISABLE_INTERNAL;
|
const char STR_DISABLE_INTERNAL[] = TR_DISABLE_INTERNAL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user