1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 04:15:26 +03:00

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

View file

@ -11,6 +11,31 @@ macro(add_lua_export_target target)
add_custom_target(lua_export_${target} DEPENDS lua_exports_${target}.inc)
endmacro(add_lua_export_target)
add_lua_export_target(taranis -DCPUARM -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
add_lua_export_target(taranis_x9e -DCPUARM -DPCBTARANIS -DPCBX9E -DLUA -DVIRTUALINPUTS)
add_lua_export_target(horus -DCPUARM -DPCBHORUS -DLUA -DVIRTUALINPUTS -I${RADIO_SRC_DIRECTORY}/gui/480x272)
set(LUA_INCLUDES
-DCPUARM -DLUA -DVIRTUAL_INPUTS -DLUA_INPUTS
-I${RADIO_SRC_DIRECTORY}/targets/${TARGET_DIR}
-I${RADIO_SRC_DIRECTORY}/thirdparty
-I${RADIO_SRC_DIRECTORY}/targets/common/arm/stm32
-I${RADIO_SRC_DIRECTORY}/${STM32LIB_DIR}/CMSIS/include
-I${RADIO_SRC_DIRECTORY}/${STM32USB_DIR}/STM32_USB_OTG_Driver/inc
-I${RADIO_SRC_DIRECTORY}/${STM32USB_DIR}/STM32_USB_Device_Library/Core/inc
-I${RADIO_SRC_DIRECTORY}/${STM32USB_DIR}/STM32_USB_Device_Library/Class/cdc/inc
-I${RADIO_SRC_DIRECTORY}/${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/inc
-I${RADIO_SRC_DIRECTORY}/${STM32USB_DIR}/STM32_USB_Device_Library/Class/hid/inc
)
set(LUA_INCLUDES_STM32F2
${LUA_INCLUDES}
-DSTM32F2
-I${RADIO_SRC_DIRECTORY}/${STM32LIB_DIR}/CMSIS/Device/ST/STM32F2xx/Include
)
set(LUA_INCLUDES_STM32F4
${LUA_INCLUDES}
-DSTM32F4
-I${RADIO_SRC_DIRECTORY}/${STM32LIB_DIR}/CMSIS/Device/ST/STM32F4xx/Include
)
add_lua_export_target(taranis ${LUA_INCLUDES_STM32F2} -DPCBTARANIS )
add_lua_export_target(taranis_x9e ${LUA_INCLUDES_STM32F4} -DPCBTARANIS -DPCBX9E -DSTM32F40_41xxx )
add_lua_export_target(horus ${LUA_INCLUDES_STM32F4} -DPCBHORUS -DSTM32F40_41xxx -I${RADIO_SRC_DIRECTORY}/gui/480x272)

View file

@ -269,7 +269,7 @@ bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags)
// search in telemetry
field.desc[0] = '\0';
for (int i=0; i<MAX_SENSORS; i++) {
for (int i=0; i<MAX_TELEMETRY_SENSORS; i++) {
if (isTelemetryFieldAvailable(i)) {
char sensorName[TELEM_LABEL_LEN+1];
int len = zchar2str(sensorName, g_model.telemetrySensors[i].label, TELEM_LABEL_LEN);

View file

@ -195,9 +195,9 @@ static int luaLcdDrawTimer(lua_State *L)
int seconds = luaL_checkinteger(L, 3);
unsigned int att = luaL_optunsigned(L, 4, 0);
#if defined(COLORLCD)
putsTimer(x, y, seconds, att|LEFT);
drawTimer(x, y, seconds, att|LEFT);
#else
putsTimer(x, y, seconds, att|LEFT, att);
drawTimer(x, y, seconds, att|LEFT, att);
#endif
return 0;
}
@ -288,7 +288,7 @@ static int luaLcdDrawSwitch(lua_State *L)
int y = luaL_checkinteger(L, 2);
int s = luaL_checkinteger(L, 3);
unsigned int att = luaL_optunsigned(L, 4, 0);
putsSwitches(x, y, s, att);
drawSwitch(x, y, s, att);
return 0;
}
@ -312,7 +312,7 @@ static int luaLcdDrawSource(lua_State *L)
int y = luaL_checkinteger(L, 2);
int s = luaL_checkinteger(L, 3);
unsigned int att = luaL_optunsigned(L, 4, 0);
putsMixerSource(x, y, s, att);
drawSource(x, y, s, att);
return 0;
}

View file

@ -579,7 +579,7 @@ static int luaModelInsertMix(lua_State *L)
unsigned int first = getFirstMix(chn);
unsigned int count = getMixesCountFromFirst(chn, first);
if (chn<NUM_CHNOUT && getMixesCount()<MAX_MIXERS && idx<=count) {
if (chn<MAX_OUTPUT_CHANNELS && getMixesCount()<MAX_MIXERS && idx<=count) {
idx += first;
s_currCh = chn+1;
insertMix(idx);
@ -702,7 +702,7 @@ Get Logical Switch parameters
static int luaModelGetLogicalSwitch(lua_State *L)
{
unsigned int idx = luaL_checkunsigned(L, 1);
if (idx < NUM_LOGICAL_SWITCH) {
if (idx < MAX_LOGICAL_SWITCHES) {
LogicalSwitchData * sw = lswAddress(idx);
lua_newtable(L);
lua_pushtableinteger(L, "func", sw->func);
@ -736,7 +736,7 @@ that parameter remains unchanged.
static int luaModelSetLogicalSwitch(lua_State *L)
{
unsigned int idx = luaL_checkunsigned(L, 1);
if (idx < NUM_LOGICAL_SWITCH) {
if (idx < MAX_LOGICAL_SWITCHES) {
LogicalSwitchData * sw = lswAddress(idx);
memclear(sw, sizeof(LogicalSwitchData));
luaL_checktype(L, -1, LUA_TTABLE);
@ -859,7 +859,7 @@ Get Custom Function parameters
static int luaModelGetCustomFunction(lua_State *L)
{
unsigned int idx = luaL_checkunsigned(L, 1);
if (idx < NUM_CFN) {
if (idx < MAX_SPECIAL_FUNCTIONS) {
CustomFunctionData * cfn = &g_model.customFn[idx];
lua_newtable(L);
lua_pushtableinteger(L, "switch", CFN_SWITCH(cfn));
@ -897,7 +897,7 @@ that parameter remains unchanged.
static int luaModelSetCustomFunction(lua_State *L)
{
unsigned int idx = luaL_checkunsigned(L, 1);
if (idx < NUM_CFN) {
if (idx < MAX_SPECIAL_FUNCTIONS) {
CustomFunctionData * cfn = &g_model.customFn[idx];
memclear(cfn, sizeof(CustomFunctionData));
luaL_checktype(L, -1, LUA_TTABLE);
@ -959,7 +959,7 @@ Get servo parameters
static int luaModelGetOutput(lua_State *L)
{
unsigned int idx = luaL_checkunsigned(L, 1);
if (idx < NUM_CHNOUT) {
if (idx < MAX_OUTPUT_CHANNELS) {
LimitData * limit = limitAddress(idx);
lua_newtable(L);
lua_pushtablezstring(L, "name", limit->name);
@ -997,7 +997,7 @@ that parameter remains unchanged.
static int luaModelSetOutput(lua_State *L)
{
unsigned int idx = luaL_checkunsigned(L, 1);
if (idx < NUM_CHNOUT) {
if (idx < MAX_OUTPUT_CHANNELS) {
LimitData * limit = limitAddress(idx);
luaL_checktype(L, -1, LUA_TTABLE);
for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 1)) {

View file

@ -407,7 +407,7 @@ void luaLoadPermanentScripts()
}
// Load custom function scripts
for (int i=0; i<NUM_CFN; i++) {
for (int i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
if (!luaLoadFunctionScript(i)) {
return;
}

View file

@ -74,7 +74,7 @@ enum ScriptReference {
SCRIPT_MIX_FIRST,
SCRIPT_MIX_LAST=SCRIPT_MIX_FIRST+MAX_SCRIPTS-1,
SCRIPT_FUNC_FIRST,
SCRIPT_FUNC_LAST=SCRIPT_FUNC_FIRST+NUM_CFN-1,
SCRIPT_FUNC_LAST=SCRIPT_FUNC_FIRST+MAX_SPECIAL_FUNCTIONS-1,
SCRIPT_TELEMETRY_FIRST,
SCRIPT_TELEMETRY_LAST=SCRIPT_TELEMETRY_FIRST+MAX_SCRIPTS, // telem0 and telem1 .. telem7
};