1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-19 14:25:11 +03:00

Visual C++ compilation

This commit is contained in:
Bertrand Songis 2013-12-02 21:13:42 +01:00
parent 2f8f2df3c7
commit b2db04f4bb
17 changed files with 37 additions and 69 deletions

View file

@ -335,7 +335,7 @@ IF( WIN32 )
ENDIF( ) ENDIF( )
SET( SYSDIR "$ENV{windir}/system32" ) 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 FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS" "C:/Program Files/NSIS"

View file

@ -26,9 +26,9 @@
#include <iostream> #include <iostream>
#if __GNUC__ #if __GNUC__
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) #define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
#else #else
#include "../winbuild/winbuild.h" #include "../targets/windows/winbuild.h"
#endif #endif
#define EESIZE_STOCK 2048 #define EESIZE_STOCK 2048

View file

@ -18,12 +18,6 @@
#ifndef file_h #ifndef file_h
#define file_h #define file_h
#if __GNUC__
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
#else
#include "../winbuild/winbuild.h"
#endif
#include "eeprominterface.h" #include "eeprominterface.h"
#define ERR_NONE 0 #define ERR_NONE 0

View file

@ -27,10 +27,6 @@
#define NUM_POTS 3 #define NUM_POTS 3
#define SWSRC_SW1 DSW_SW1 #define SWSRC_SW1 DSW_SW1
#ifndef __GNUC__
#include "../winbuild/winbuild.h"
#endif
#include <exception> #include <exception>
namespace Er9x { namespace Er9x {

View file

@ -37,10 +37,6 @@
#undef min #undef min
#undef max #undef max
#ifndef __GNUC__
#include "../winbuild/winbuild.h"
#endif
#include <exception> #include <exception>
namespace Ersky9x { namespace Ersky9x {

View file

@ -53,10 +53,6 @@
#undef min #undef min
#undef max #undef max
#ifndef __GNUC__
#include "../winbuild/winbuild.h"
#endif
#include <exception> #include <exception>
namespace Open9xGruvin9x { namespace Open9xGruvin9x {

View file

@ -52,10 +52,6 @@
#undef min #undef min
#undef max #undef max
#ifndef __GNUC__
#include "../winbuild/winbuild.h"
#endif
#include <exception> #include <exception>
namespace Open9xM128 { namespace Open9xM128 {

View file

@ -58,10 +58,6 @@
#undef min #undef min
#undef max #undef max
#ifndef __GNUC__
#include "../winbuild/winbuild.h"
#endif
#include <exception> #include <exception>
namespace Open9xSky9x { namespace Open9xSky9x {

View file

@ -56,10 +56,6 @@
#undef min #undef min
#undef max #undef max
#ifndef __GNUC__
#include "../winbuild/winbuild.h"
#endif
#include <exception> #include <exception>
namespace Open9x { namespace Open9x {

View file

@ -52,10 +52,6 @@
#undef min #undef min
#undef max #undef max
#ifndef __GNUC__
#include "../winbuild/winbuild.h"
#endif
#include <exception> #include <exception>
namespace Open9xX9D { namespace Open9xX9D {

View file

@ -28,10 +28,6 @@
#define NUM_CSW 12 #define NUM_CSW 12
#define SWSRC_SW1 10 #define SWSRC_SW1 10
#ifndef __GNUC__
#include "../winbuild/winbuild.h"
#endif
#include <exception> #include <exception>
#include <algorithm> #include <algorithm>

View file

@ -6,7 +6,7 @@
;Include Modern UI ;Include Modern UI
!include "MUI2.nsh" !include "MUI2.nsh"
!include "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\FileAssociation.nsh" !include "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\FileAssociation.nsh"
;-------------------------------- ;--------------------------------
;General ;General
@ -41,7 +41,7 @@
;-------------------------------- ;--------------------------------
;Pages ;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_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
@ -80,7 +80,7 @@ Section "companion9x" SecDummy
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\license.txt" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt"
File "companion9x.exe" File "companion9x.exe"
File "C:\Programs\xerces\src\.libs\libxerces-c-3-1.dll" File "C:\Programs\xerces\src\.libs\libxerces-c-3-1.dll"
File "C:\MinGW\bin\libgcc_s_dw2-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@\QtXml4.dll"
File "@QT_BINARY_DIR@\QtNetwork4.dll" File "@QT_BINARY_DIR@\QtNetwork4.dll"
File "@QT_BINARY_DIR@\Phonon4.dll" File "@QT_BINARY_DIR@\Phonon4.dll"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\avrdude.exe" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.exe"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\avrdude.conf" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.conf"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\libusb0.dll" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb0.dll"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\dfu-util.exe" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\dfu-util.exe"
CreateDirectory "$INSTDIR\lang" CreateDirectory "$INSTDIR\lang"
SetOutPath "$INSTDIR\lang" SetOutPath "$INSTDIR\lang"

View file

@ -6,7 +6,7 @@
;Include Modern UI ;Include Modern UI
!include "MUI2.nsh" !include "MUI2.nsh"
!include "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\FileAssociation.nsh" !include "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\FileAssociation.nsh"
;-------------------------------- ;--------------------------------
;General ;General
@ -60,7 +60,7 @@
;-------------------------------- ;--------------------------------
;Pages ;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_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
@ -99,7 +99,7 @@ Section "companion9x" SecDummy
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\license.txt" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt"
File "Release\companion9x.exe" File "Release\companion9x.exe"
${!defineifexist} PTHREAD_WINDIR "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll" ${!defineifexist} PTHREAD_WINDIR "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll"
!ifdef PTHREAD_WINDIR !ifdef PTHREAD_WINDIR
@ -116,11 +116,11 @@ Section "companion9x" SecDummy
File "@QT_BINARY_DIR@\QtNetwork4.dll" File "@QT_BINARY_DIR@\QtNetwork4.dll"
File "@QT_BINARY_DIR@\Phonon4.dll" File "@QT_BINARY_DIR@\Phonon4.dll"
File "@QT_BINARY_DIR@\QtXml4.dll" File "@QT_BINARY_DIR@\QtXml4.dll"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\avrdude.exe" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.exe"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\avrdude.conf" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.conf"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\libusb0.dll" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb0.dll"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\dfu-util.exe" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\dfu-util.exe"
File "@CMAKE_CURRENT_SOURCE_DIR@\..\winbuild\libusb-1.0.dll" File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb-1.0.dll"
CreateDirectory "$INSTDIR\lang" CreateDirectory "$INSTDIR\lang"
SetOutPath "$INSTDIR\lang" SetOutPath "$INSTDIR\lang"

View file

@ -48,6 +48,12 @@ PACK(typedef struct {
int8_t curveParam; int8_t curveParam;
}) ExpoData_v215; }) ExpoData_v215;
#if defined(PCBTARANIS)
#define LIMITDATA_V215_EXTRA char name[LEN_CHANNEL_NAME];
#else
#define LIMITDATA_V215_EXTRA
#endif
PACK(typedef struct { PACK(typedef struct {
int8_t min; int8_t min;
int8_t max; int8_t max;
@ -55,9 +61,7 @@ PACK(typedef struct {
int16_t offset:14; int16_t offset:14;
uint16_t symetrical:1; uint16_t symetrical:1;
uint16_t revert:1; uint16_t revert:1;
#if defined(PCBTARANIS) LIMITDATA_V215_EXTRA
char name[LEN_CHANNEL_NAME];
#endif
}) LimitData_v215; }) LimitData_v215;
#if defined(PCBTARANIS) #if defined(PCBTARANIS)
@ -462,7 +466,7 @@ bool eeConvert()
theFile.openRlc(0); theFile.openRlc(0);
theFile.readRlc((uint8_t*)&g_eeGeneral, sizeof(g_eeGeneral)); theFile.readRlc((uint8_t*)&g_eeGeneral, sizeof(g_eeGeneral));
#else #else
#warning "TODO openRlc for sky9x" #pragma message("TODO openRlc for sky9x")
#endif #endif
if (g_eeGeneral.version == 215) ConvertGeneralSettings_215_to_216(g_eeGeneral); if (g_eeGeneral.version == 215) ConvertGeneralSettings_215_to_216(g_eeGeneral);
s_eeDirtyMsk = EE_GENERAL; s_eeDirtyMsk = EE_GENERAL;
@ -482,7 +486,7 @@ bool eeConvert()
theFile.openRlc(FILE_MODEL(id)); theFile.openRlc(FILE_MODEL(id));
theFile.readRlc((uint8_t*)&g_model, sizeof(g_model)); theFile.readRlc((uint8_t*)&g_model, sizeof(g_model));
#else #else
#warning "TODO openRlc for sky9x" #pragma message("TODO openRlc for sky9x")
#endif #endif
int version = conversionVersionStart; int version = conversionVersionStart;
if (version == 215) { if (version == 215) {

View file

@ -3934,7 +3934,7 @@ void menuModelLimits(uint8_t event)
#if defined(PPM_CENTER_ADJUSTABLE) #if defined(PPM_CENTER_ADJUSTABLE)
case ITEM_LIMITS_PPM_CENTER: case ITEM_LIMITS_PPM_CENTER:
lcd_outdezAtt(LIMITS_PPM_CENTER_POS, y, PPM_CENTER+ld->ppmCenter, attr); 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) { if (active && ld->max <= 0 && ld->min >= 0) {
CHECK_INCDEC_MODELVAR(event, ld->ppmCenter, -125, +125); CHECK_INCDEC_MODELVAR(event, ld->ppmCenter, -125, +125);
} }

View file

@ -770,7 +770,7 @@ PACK(typedef struct t_CustomFnData { // Function Switches data
#define CFN_CH_NUMBER(p) (CFN_FUNC(p)) #define CFN_CH_NUMBER(p) (CFN_FUNC(p))
#define CFN_PLAY_REPEAT(p) ((p)->active) #define CFN_PLAY_REPEAT(p) ((p)->active)
#define CFN_PLAY_REPEAT_MUL 1 #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_GVAR_MODE(p) ((p)->mode)
#define CFN_PARAM(p) ((p)->param.composite.val) #define CFN_PARAM(p) ((p)->param.composite.val)
#define CFN_RESET(p) (p->active = 0, memset(&(p)->param, 0, sizeof((p)->param))) #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 MODELDATA_BITMAP
}) ModelHeader; }) 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 { PACK(typedef struct t_ModelData {
ModelHeader header; ModelHeader header;
TimerData timers[MAX_TIMERS]; TimerData timers[MAX_TIMERS];
@ -1419,11 +1425,7 @@ PACK(typedef struct t_ModelData {
int8_t ppmNCH:4; /* spare on ARM */ int8_t ppmNCH:4; /* spare on ARM */
uint8_t trimInc:3; // Trim Increments uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1; uint8_t disableThrottleWarning:1;
#if defined (CPUARM) uint8_t ARM_OR_AVR(displayText, pulsePol):1;
uint8_t displayText:1;
#else
uint8_t pulsePol:1; /* unused on ARM */
#endif
uint8_t extendedLimits:1; uint8_t extendedLimits:1;
uint8_t extendedTrims:1; uint8_t extendedTrims:1;
uint8_t throttleReversed:1; uint8_t throttleReversed:1;

View file

@ -204,7 +204,7 @@ void applyTemplate(uint8_t idx)
case TMPL_ELEVON_DELTA: case TMPL_ELEVON_DELTA:
defaultInputs(); defaultInputs();
#if defined(PCBTARANIS) #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 #endif
setDest(ICC(STK_ELE), MIXSRC_Ele, true); setDest(ICC(STK_ELE), MIXSRC_Ele, true);
setDest(ICC(STK_ELE), MIXSRC_Ail); setDest(ICC(STK_ELE), MIXSRC_Ail);