diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index da66c18a9..55f0e8c36 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -335,7 +335,7 @@ IF( WIN32 ) ENDIF( ) SET( SYSDIR "$ENV{windir}/system32" ) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../winbuild/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion9x.nsi @ONLY) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion9x.nsi @ONLY) FIND_PROGRAM(NSIS_EXE makensis.exe PATHS "C:/Program Files/NSIS" diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index 235cecef2..4f91a8719 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -26,9 +26,9 @@ #include #if __GNUC__ -#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) + #define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) #else -#include "../winbuild/winbuild.h" + #include "../targets/windows/winbuild.h" #endif #define EESIZE_STOCK 2048 diff --git a/companion/src/file.h b/companion/src/file.h index de5fd3afe..4c047c6bb 100644 --- a/companion/src/file.h +++ b/companion/src/file.h @@ -18,12 +18,6 @@ #ifndef file_h #define file_h -#if __GNUC__ -#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) -#else -#include "../winbuild/winbuild.h" -#endif - #include "eeprominterface.h" #define ERR_NONE 0 diff --git a/companion/src/firmwares/er9x/er9xsimulator.cpp b/companion/src/firmwares/er9x/er9xsimulator.cpp index dc406909a..10fd339c9 100644 --- a/companion/src/firmwares/er9x/er9xsimulator.cpp +++ b/companion/src/firmwares/er9x/er9xsimulator.cpp @@ -27,10 +27,6 @@ #define NUM_POTS 3 #define SWSRC_SW1 DSW_SW1 -#ifndef __GNUC__ -#include "../winbuild/winbuild.h" -#endif - #include namespace Er9x { diff --git a/companion/src/firmwares/ersky9x/ersky9xsimulator.cpp b/companion/src/firmwares/ersky9x/ersky9xsimulator.cpp index ae0c467d8..868f81625 100644 --- a/companion/src/firmwares/ersky9x/ersky9xsimulator.cpp +++ b/companion/src/firmwares/ersky9x/ersky9xsimulator.cpp @@ -37,10 +37,6 @@ #undef min #undef max -#ifndef __GNUC__ -#include "../winbuild/winbuild.h" -#endif - #include namespace Ersky9x { diff --git a/companion/src/firmwares/opentx/open9xGruvin9xsimulator.cpp b/companion/src/firmwares/opentx/open9xGruvin9xsimulator.cpp index a9e327d18..9cb478b16 100644 --- a/companion/src/firmwares/opentx/open9xGruvin9xsimulator.cpp +++ b/companion/src/firmwares/opentx/open9xGruvin9xsimulator.cpp @@ -53,10 +53,6 @@ #undef min #undef max -#ifndef __GNUC__ -#include "../winbuild/winbuild.h" -#endif - #include namespace Open9xGruvin9x { diff --git a/companion/src/firmwares/opentx/open9xM128simulator.cpp b/companion/src/firmwares/opentx/open9xM128simulator.cpp index 7391f449e..a82b53b0c 100644 --- a/companion/src/firmwares/opentx/open9xM128simulator.cpp +++ b/companion/src/firmwares/opentx/open9xM128simulator.cpp @@ -52,10 +52,6 @@ #undef min #undef max -#ifndef __GNUC__ -#include "../winbuild/winbuild.h" -#endif - #include namespace Open9xM128 { diff --git a/companion/src/firmwares/opentx/open9xSky9xsimulator.cpp b/companion/src/firmwares/opentx/open9xSky9xsimulator.cpp index 9f8512047..d724028ec 100644 --- a/companion/src/firmwares/opentx/open9xSky9xsimulator.cpp +++ b/companion/src/firmwares/opentx/open9xSky9xsimulator.cpp @@ -58,10 +58,6 @@ #undef min #undef max -#ifndef __GNUC__ -#include "../winbuild/winbuild.h" -#endif - #include namespace Open9xSky9x { diff --git a/companion/src/firmwares/opentx/open9xsimulator.cpp b/companion/src/firmwares/opentx/open9xsimulator.cpp index a0e14e156..252ee6ecc 100644 --- a/companion/src/firmwares/opentx/open9xsimulator.cpp +++ b/companion/src/firmwares/opentx/open9xsimulator.cpp @@ -56,10 +56,6 @@ #undef min #undef max -#ifndef __GNUC__ -#include "../winbuild/winbuild.h" -#endif - #include namespace Open9x { diff --git a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp index d63ba95c9..6f216273a 100644 --- a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp +++ b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp @@ -52,10 +52,6 @@ #undef min #undef max -#ifndef __GNUC__ -#include "../winbuild/winbuild.h" -#endif - #include namespace Open9xX9D { diff --git a/companion/src/firmwares/th9x/th9xsimulator.cpp b/companion/src/firmwares/th9x/th9xsimulator.cpp index 2e8ec5a8a..7aa354953 100644 --- a/companion/src/firmwares/th9x/th9xsimulator.cpp +++ b/companion/src/firmwares/th9x/th9xsimulator.cpp @@ -28,10 +28,6 @@ #define NUM_CSW 12 #define SWSRC_SW1 10 -#ifndef __GNUC__ -#include "../winbuild/winbuild.h" -#endif - #include #include diff --git a/companion/targets/windows/companion9x-msys.nsi.in b/companion/targets/windows/companion9x-msys.nsi.in index f8b6cfdf1..ed7bf33fb 100644 --- a/companion/targets/windows/companion9x-msys.nsi.in +++ b/companion/targets/windows/companion9x-msys.nsi.in @@ -6,7 +6,7 @@ ;Include Modern UI !include "MUI2.nsh" - !include "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\FileAssociation.nsh" + !include "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\FileAssociation.nsh" ;-------------------------------- ;General @@ -41,7 +41,7 @@ ;-------------------------------- ;Pages - !insertmacro MUI_PAGE_LICENSE "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\license.txt" + !insertmacro MUI_PAGE_LICENSE "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY @@ -80,7 +80,7 @@ Section "companion9x" SecDummy SetOutPath "$INSTDIR" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\license.txt" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" File "companion9x.exe" File "C:\Programs\xerces\src\.libs\libxerces-c-3-1.dll" File "C:\MinGW\bin\libgcc_s_dw2-1.dll" @@ -91,10 +91,10 @@ Section "companion9x" SecDummy File "@QT_BINARY_DIR@\QtXml4.dll" File "@QT_BINARY_DIR@\QtNetwork4.dll" File "@QT_BINARY_DIR@\Phonon4.dll" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\avrdude.exe" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\avrdude.conf" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\libusb0.dll" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\dfu-util.exe" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.exe" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.conf" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb0.dll" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\dfu-util.exe" CreateDirectory "$INSTDIR\lang" SetOutPath "$INSTDIR\lang" diff --git a/companion/targets/windows/companion9x-vs.nsi.in b/companion/targets/windows/companion9x-vs.nsi.in index 402d8ab4e..3e5950ada 100644 --- a/companion/targets/windows/companion9x-vs.nsi.in +++ b/companion/targets/windows/companion9x-vs.nsi.in @@ -6,7 +6,7 @@ ;Include Modern UI !include "MUI2.nsh" - !include "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\FileAssociation.nsh" + !include "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\FileAssociation.nsh" ;-------------------------------- ;General @@ -60,7 +60,7 @@ ;-------------------------------- ;Pages - !insertmacro MUI_PAGE_LICENSE "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\license.txt" + !insertmacro MUI_PAGE_LICENSE "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY @@ -99,7 +99,7 @@ Section "companion9x" SecDummy SetOutPath "$INSTDIR" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\license.txt" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" File "Release\companion9x.exe" ${!defineifexist} PTHREAD_WINDIR "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll" !ifdef PTHREAD_WINDIR @@ -116,11 +116,11 @@ Section "companion9x" SecDummy File "@QT_BINARY_DIR@\QtNetwork4.dll" File "@QT_BINARY_DIR@\Phonon4.dll" File "@QT_BINARY_DIR@\QtXml4.dll" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\avrdude.exe" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\avrdude.conf" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\libusb0.dll" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\dfu-util.exe" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\libusb-1.0.dll" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.exe" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.conf" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb0.dll" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\dfu-util.exe" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb-1.0.dll" CreateDirectory "$INSTDIR\lang" SetOutPath "$INSTDIR\lang" diff --git a/radio/src/eeprom_conversions.cpp b/radio/src/eeprom_conversions.cpp index 3442e3c5d..6edb00974 100644 --- a/radio/src/eeprom_conversions.cpp +++ b/radio/src/eeprom_conversions.cpp @@ -48,6 +48,12 @@ PACK(typedef struct { int8_t curveParam; }) ExpoData_v215; +#if defined(PCBTARANIS) + #define LIMITDATA_V215_EXTRA char name[LEN_CHANNEL_NAME]; +#else + #define LIMITDATA_V215_EXTRA +#endif + PACK(typedef struct { int8_t min; int8_t max; @@ -55,9 +61,7 @@ PACK(typedef struct { int16_t offset:14; uint16_t symetrical:1; uint16_t revert:1; -#if defined(PCBTARANIS) - char name[LEN_CHANNEL_NAME]; -#endif + LIMITDATA_V215_EXTRA }) LimitData_v215; #if defined(PCBTARANIS) @@ -462,7 +466,7 @@ bool eeConvert() theFile.openRlc(0); theFile.readRlc((uint8_t*)&g_eeGeneral, sizeof(g_eeGeneral)); #else - #warning "TODO openRlc for sky9x" + #pragma message("TODO openRlc for sky9x") #endif if (g_eeGeneral.version == 215) ConvertGeneralSettings_215_to_216(g_eeGeneral); s_eeDirtyMsk = EE_GENERAL; @@ -482,7 +486,7 @@ bool eeConvert() theFile.openRlc(FILE_MODEL(id)); theFile.readRlc((uint8_t*)&g_model, sizeof(g_model)); #else - #warning "TODO openRlc for sky9x" + #pragma message("TODO openRlc for sky9x") #endif int version = conversionVersionStart; if (version == 215) { diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index d94e42ebf..d1f9889fb 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -3934,7 +3934,7 @@ void menuModelLimits(uint8_t event) #if defined(PPM_CENTER_ADJUSTABLE) case ITEM_LIMITS_PPM_CENTER: lcd_outdezAtt(LIMITS_PPM_CENTER_POS, y, PPM_CENTER+ld->ppmCenter, attr); -#warning "could be less restrictive!" +#pragma message("could be less restrictive!") if (active && ld->max <= 0 && ld->min >= 0) { CHECK_INCDEC_MODELVAR(event, ld->ppmCenter, -125, +125); } diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 34347e299..3c49e6f59 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -770,7 +770,7 @@ PACK(typedef struct t_CustomFnData { // Function Switches data #define CFN_CH_NUMBER(p) (CFN_FUNC(p)) #define CFN_PLAY_REPEAT(p) ((p)->active) #define CFN_PLAY_REPEAT_MUL 1 -#define CFN_PLAY_REPEAT_NOSTART 0b111111 +#define CFN_PLAY_REPEAT_NOSTART 0x3F #define CFN_GVAR_MODE(p) ((p)->mode) #define CFN_PARAM(p) ((p)->param.composite.val) #define CFN_RESET(p) (p->active = 0, memset(&(p)->param, 0, sizeof((p)->param))) @@ -1411,6 +1411,12 @@ PACK(typedef struct t_ModelHeader { MODELDATA_BITMAP }) ModelHeader; +#if defined (CPUARM) + #define ARM_OR_AVR(x, y) x +#else + #define ARM_OR_AVR(x, y) y +#endif + PACK(typedef struct t_ModelData { ModelHeader header; TimerData timers[MAX_TIMERS]; @@ -1419,11 +1425,7 @@ PACK(typedef struct t_ModelData { int8_t ppmNCH:4; /* spare on ARM */ uint8_t trimInc:3; // Trim Increments uint8_t disableThrottleWarning:1; -#if defined (CPUARM) - uint8_t displayText:1; -#else - uint8_t pulsePol:1; /* unused on ARM */ -#endif + uint8_t ARM_OR_AVR(displayText, pulsePol):1; uint8_t extendedLimits:1; uint8_t extendedTrims:1; uint8_t throttleReversed:1; diff --git a/radio/src/templates.cpp b/radio/src/templates.cpp index 33e4ca7b2..e5b10dad1 100644 --- a/radio/src/templates.cpp +++ b/radio/src/templates.cpp @@ -204,7 +204,7 @@ void applyTemplate(uint8_t idx) case TMPL_ELEVON_DELTA: defaultInputs(); #if defined(PCBTARANIS) -#warning "Templates below are not implemented (only V-TAIL has been done). Feel free to help!" + #pragma message("Templates below are not implemented (only V-TAIL has been done). Feel free to help!") #endif setDest(ICC(STK_ELE), MIXSRC_Ele, true); setDest(ICC(STK_ELE), MIXSRC_Ail);