Bsongis/gui refactoring for x7 d (#3701)

* [X7D] New board added
* Cosmetics
This commit is contained in:
Bertrand Songis
2016-08-18 11:49:16 +02:00
committed by GitHub
parent 282b856309
commit d3ae3c035d
233 changed files with 7472 additions and 4560 deletions
-17
View File
@@ -154,23 +154,6 @@ enum FailsafeModes {
#define BC_BIT_REA (0x80)
#define BC_BIT_REB (0x100)
// TODO remove this enum!
enum EnumKeys {
KEY_MENU,
KEY_EXIT,
#if defined(PCBTARANIS)
KEY_ENTER,
KEY_PAGE,
KEY_PLUS,
KEY_MINUS,
#else
KEY_DOWN,
KEY_UP,
KEY_RIGHT,
KEY_LEFT,
#endif
};
#define CHAR_FOR_NAMES " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-."
#define CHAR_FOR_NAMES_REGEX "[ A-Za-z0-9_.-,]*"
@@ -24,8 +24,9 @@
#undef min
#undef max
#define NUM_POTS 3
#define SWSRC_SW1 DSW_SW1
#define NUM_POTS 3
#define NUM_SLIDERS 0
#define SWSRC_SW1 DSW_SW1
#include <exception>
@@ -31,8 +31,9 @@
#define AUDIO
#define REVB
#define NUM_POTS 3
#define SWSRC_SW1 DSW_SW1
#define NUM_POTS 3
#define NUM_SLIDERS 0
#define SWSRC_SW1 DSW_SW1
#undef min
#undef max
@@ -26,7 +26,7 @@
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16))
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : 8)
#define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5)
#define MAX_SENSORS(board, version) (32)
#define MAX_TELEMETRY_SENSORS(board, version) (32)
#define NUM_PPM_INPUTS(board, version) ((IS_ARM(board) && version >= 216) ? 16 : 8)
#define ROTENC_COUNT(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 218) ? 0 : 1) : (IS_2560(board) ? 2 : 0))
@@ -3271,7 +3271,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
if (IS_ARM(board) && version >= 217) {
for (int i=0; i<MAX_SENSORS(board, version); ++i) {
for (int i=0; i<MAX_TELEMETRY_SENSORS(board, version); ++i) {
internalField.Append(new SensorField(modelData.sensorData[i], board, version));
}
}
@@ -24,9 +24,10 @@
#undef min
#undef max
#define NUM_POTS 3
#define NUM_CSW 12
#define SWSRC_SW1 10
#define NUM_POTS 3
#define NUM_SLIDERS 0
#define NUM_CSW 12
#define SWSRC_SW1 10
#include <exception>
#include <algorithm>
+4 -4
View File
@@ -16,8 +16,8 @@
#include <stdint.h>
#if !defined(NUM_LOGICAL_SWITCH) && defined(NUM_CSW)
#define NUM_LOGICAL_SWITCH NUM_CSW
#if !defined(MAX_LOGICAL_SWITCHES) && defined(NUM_CSW)
#define MAX_LOGICAL_SWITCHES NUM_CSW
#endif
#ifdef INIT_IMPORT
@@ -31,7 +31,7 @@ telemetryStreaming = 20;
#undef SETVALUES_IMPORT
for (int i=0; i<NUM_STICKS; i++)
g_anas[i] = inputs.sticks[i];
for (int i=0; i<NUM_POTS; i++)
for (int i=0; i<NUM_POTS+NUM_SLIDERS; i++)
g_anas[NUM_STICKS+i] = inputs.pots[i];
for (int i=0; i<C9X_NUM_SWITCHES; i++)
simuSetSwitch(i, inputs.switches[i]);
@@ -60,7 +60,7 @@ if (inputs.rotenc) simuSetKey(KEY_ENTER, true);
memset(outputs.chans, 0, sizeof(outputs.chans));
for (unsigned int i=0; i<DIM(g_chans512); i++)
outputs.chans[i] = g_chans512[i];
for (int i=0; i<NUM_LOGICAL_SWITCH; i++)
for (int i=0; i<MAX_LOGICAL_SWITCHES; i++)
#if defined(BOLD_FONT)
outputs.vsw[i] = getSwitch(SWSRC_SW1+i);
#else