mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-24 16:55:15 +03:00
Directories FatFS / CoOS / STM32 libs moved to thirdparty
This commit is contained in:
parent
318fc79dfe
commit
2817866ad2
456 changed files with 1154 additions and 2580 deletions
|
@ -74,42 +74,11 @@ set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
|
||||||
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/simulation)
|
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/simulation)
|
||||||
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR})
|
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${RADIO_SRC_DIRECTORY}/bitmaps/9X/about.lbm
|
|
||||||
COMMAND make lbm PCB=9X
|
|
||||||
DEPENDS ${RADIO_SRC_DIRECTORY}/bitmaps/9X/about.png
|
|
||||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${RADIO_SRC_DIRECTORY}/bitmaps/Taranis/about.lbm
|
|
||||||
COMMAND make lbm PCB=TARANIS
|
|
||||||
DEPENDS ${RADIO_SRC_DIRECTORY}/bitmaps/Taranis/about.png
|
|
||||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${RADIO_SRC_DIRECTORY}/translations/en.h
|
|
||||||
COMMAND make tra
|
|
||||||
DEPENDS ${RADIO_SRC_DIRECTORY}/translations/en.h.txt
|
|
||||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${RADIO_SRC_DIRECTORY}/lua_exports.inc
|
|
||||||
COMMAND make PCB=TARANIS lua_exports.cpp
|
|
||||||
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
|
|
||||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
|
||||||
)
|
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
${PROJECT_SOURCE_DIR}/../..
|
${PROJECT_SOURCE_DIR}/../..
|
||||||
${PROJECT_SOURCE_DIR}/shared
|
${PROJECT_SOURCE_DIR}/shared
|
||||||
${SIMU_SRC_DIRECTORY}
|
${SIMU_SRC_DIRECTORY}
|
||||||
${RADIO_SRC_DIRECTORY}
|
|
||||||
${RADIO_SRC_DIRECTORY}/fonts/std
|
|
||||||
${RADIO_SRC_DIRECTORY}/lua/src
|
|
||||||
${XSD_INCLUDE_DIR}
|
${XSD_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -117,6 +86,7 @@ add_subdirectory(shared)
|
||||||
add_subdirectory(modeledit)
|
add_subdirectory(modeledit)
|
||||||
add_subdirectory(generaledit)
|
add_subdirectory(generaledit)
|
||||||
add_subdirectory(simulation)
|
add_subdirectory(simulation)
|
||||||
|
add_subdirectory(firmwares/opentx/simulator)
|
||||||
|
|
||||||
set(common_SRCS
|
set(common_SRCS
|
||||||
eeprominterface.cpp
|
eeprominterface.cpp
|
||||||
|
@ -128,21 +98,11 @@ set(common_SRCS
|
||||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||||
firmwares/ersky9x/ersky9xeeprom.cpp
|
firmwares/ersky9x/ersky9xeeprom.cpp
|
||||||
firmwares/ersky9x/ersky9xinterface.cpp
|
firmwares/ersky9x/ersky9xinterface.cpp
|
||||||
${RADIO_SRC_DIRECTORY}/bitmaps/9X/about.lbm
|
|
||||||
${RADIO_SRC_DIRECTORY}/bitmaps/Taranis/about.lbm
|
|
||||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
|
||||||
${RADIO_SRC_DIRECTORY}/lua_exports.inc
|
|
||||||
firmwares/opentx/opentxeeprom.cpp
|
firmwares/opentx/opentxeeprom.cpp
|
||||||
firmwares/opentx/open9xStockeeprom.cpp
|
firmwares/opentx/open9xStockeeprom.cpp
|
||||||
firmwares/opentx/open9xGruvin9xeeprom.cpp
|
firmwares/opentx/open9xGruvin9xeeprom.cpp
|
||||||
firmwares/opentx/open9xSky9xeeprom.cpp
|
firmwares/opentx/open9xSky9xeeprom.cpp
|
||||||
firmwares/opentx/opentxinterface.cpp
|
firmwares/opentx/opentxinterface.cpp
|
||||||
firmwares/opentx/opentxTaranisSimulator.cpp
|
|
||||||
firmwares/opentx/opentxTaranisX9ESimulator.cpp
|
|
||||||
firmwares/opentx/opentxSky9xsimulator.cpp
|
|
||||||
firmwares/opentx/opentxGruvin9xsimulator.cpp
|
|
||||||
firmwares/opentx/opentxM128simulator.cpp
|
|
||||||
firmwares/opentx/opentxM64simulator.cpp
|
|
||||||
file.cpp
|
file.cpp
|
||||||
appdata.cpp
|
appdata.cpp
|
||||||
)
|
)
|
||||||
|
@ -307,45 +267,11 @@ ELSE( )
|
||||||
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
|
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
|
||||||
ENDIF( )
|
ENDIF( )
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} generaledit modeledit simulation common shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
|
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} generaledit modeledit simulation common shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||||
|
|
||||||
############# Standalone simu ###############
|
############# Standalone simu ###############
|
||||||
|
|
||||||
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
|
|
||||||
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
|
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
|
|
||||||
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
|
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
|
|
||||||
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
|
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set(simu_SRCS
|
set(simu_SRCS
|
||||||
${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
|
||||||
${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
|
||||||
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
|
||||||
${RADIO_SRC_DIRECTORY}/bitmaps/9X/about.lbm
|
|
||||||
${RADIO_SRC_DIRECTORY}/bitmaps/Taranis/about.lbm
|
|
||||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
|
||||||
${RADIO_SRC_DIRECTORY}/lua_exports.inc
|
|
||||||
modeledit/node.cpp
|
modeledit/node.cpp
|
||||||
modeledit/edge.cpp # TODO not needed
|
modeledit/edge.cpp # TODO not needed
|
||||||
simulator.cpp
|
simulator.cpp
|
||||||
|
@ -369,10 +295,10 @@ else()
|
||||||
add_executable(simulator WIN32 ${simu_SRCS})
|
add_executable(simulator WIN32 ${simu_SRCS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_FOUND)
|
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
|
||||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
|
||||||
else()
|
if(NOT SDL_FOUND)
|
||||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
target_link_libraries(simulator ${QT_QTMAIN_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
############# Packaging ####################
|
############# Packaging ####################
|
||||||
|
|
|
@ -98,6 +98,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
registerEEpromInterfaces();
|
registerEEpromInterfaces();
|
||||||
registerOpenTxFirmwares();
|
registerOpenTxFirmwares();
|
||||||
|
registerSimulators();
|
||||||
|
|
||||||
if (g.profile[g.id()].fwType().isEmpty()){
|
if (g.profile[g.id()].fwType().isEmpty()){
|
||||||
g.profile[g.id()].fwType(default_firmware_variant->getId());
|
g.profile[g.id()].fwType(default_firmware_variant->getId());
|
||||||
|
|
38
companion/src/constants.h
Normal file
38
companion/src/constants.h
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
#ifndef _constants_h_
|
||||||
|
#define _constants_h_
|
||||||
|
|
||||||
|
enum BoardEnum {
|
||||||
|
BOARD_STOCK,
|
||||||
|
BOARD_M128,
|
||||||
|
BOARD_MEGA2560,
|
||||||
|
BOARD_GRUVIN9X,
|
||||||
|
BOARD_SKY9X,
|
||||||
|
BOARD_9XRPRO,
|
||||||
|
BOARD_TARANIS,
|
||||||
|
BOARD_TARANIS_PLUS,
|
||||||
|
BOARD_TARANIS_X9E
|
||||||
|
};
|
||||||
|
|
||||||
|
#define C9X_MAX_MODELS 60
|
||||||
|
#define C9X_MAX_TIMERS 3
|
||||||
|
#define C9X_MAX_FLIGHT_MODES 9
|
||||||
|
#define C9X_MAX_MIXERS 64
|
||||||
|
#define C9X_MAX_INPUTS 32
|
||||||
|
#define C9X_MAX_EXPOS 64
|
||||||
|
#define C9X_MAX_CURVES 32
|
||||||
|
#define C9X_MAX_POINTS 17
|
||||||
|
#define C9X_MAX_GVARS 9
|
||||||
|
#define C9X_MAX_ENCODERS 2
|
||||||
|
#define C9X_NUM_CHNOUT 32 // number of real output channels
|
||||||
|
#define C9X_NUM_CSW 32 // number of custom switches
|
||||||
|
#define C9X_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
|
||||||
|
#define C9X_NUM_MODULES 2
|
||||||
|
#define NUM_STICKS 4
|
||||||
|
#define BOARD_9X_NUM_POTS 3
|
||||||
|
#define C9X_NUM_POTS 8
|
||||||
|
#define NUM_CAL_PPM 4
|
||||||
|
#define NUM_CYC 3
|
||||||
|
#define C9X_NUM_SWITCHES 32
|
||||||
|
#define C9X_NUM_KEYS 32
|
||||||
|
|
||||||
|
#endif
|
|
@ -1615,3 +1615,13 @@ void Firmware::addOptions(Option options[])
|
||||||
}
|
}
|
||||||
this->opts.push_back(opts);
|
this->opts.push_back(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SimulatorInterface *GetCurrentFirmwareSimulator()
|
||||||
|
{
|
||||||
|
QString firmwareId = GetCurrentFirmware()->getId();
|
||||||
|
SimulatorFactory *factory = getSimulatorFactory(firmwareId);
|
||||||
|
if (factory)
|
||||||
|
return factory->create();
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
|
@ -17,19 +17,14 @@
|
||||||
#ifndef eeprom_interface_h
|
#ifndef eeprom_interface_h
|
||||||
#define eeprom_interface_h
|
#define eeprom_interface_h
|
||||||
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QtXml>
|
#include <QtXml>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include "constants.h"
|
||||||
#if __GNUC__
|
#include "simulatorinterface.h"
|
||||||
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
|
|
||||||
#else
|
|
||||||
#include "../targets/windows/winbuild.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define EESIZE_STOCK 2048
|
#define EESIZE_STOCK 2048
|
||||||
#define EESIZE_M128 4096
|
#define EESIZE_M128 4096
|
||||||
|
@ -39,20 +34,6 @@
|
||||||
#define EESIZE_9XRPRO (128*4096)
|
#define EESIZE_9XRPRO (128*4096)
|
||||||
#define EESIZE_RLC_MAX EESIZE_TARANIS
|
#define EESIZE_RLC_MAX EESIZE_TARANIS
|
||||||
|
|
||||||
template<class t> t LIMIT(t mi, t x, t ma) { return std::min(std::max(mi, x), ma); }
|
|
||||||
|
|
||||||
enum BoardEnum {
|
|
||||||
BOARD_STOCK,
|
|
||||||
BOARD_M128,
|
|
||||||
BOARD_MEGA2560,
|
|
||||||
BOARD_GRUVIN9X,
|
|
||||||
BOARD_SKY9X,
|
|
||||||
BOARD_9XRPRO,
|
|
||||||
BOARD_TARANIS,
|
|
||||||
BOARD_TARANIS_PLUS,
|
|
||||||
BOARD_TARANIS_X9E
|
|
||||||
};
|
|
||||||
|
|
||||||
QString getBoardName(BoardEnum board);
|
QString getBoardName(BoardEnum board);
|
||||||
|
|
||||||
#define IS_9X(board) (board==BOARD_STOCK || board==BOARD_M128)
|
#define IS_9X(board) (board==BOARD_STOCK || board==BOARD_M128)
|
||||||
|
@ -71,21 +52,6 @@ const uint8_t modn12x3[4][4]= {
|
||||||
{4, 2, 3, 1},
|
{4, 2, 3, 1},
|
||||||
{4, 3, 2, 1} };
|
{4, 3, 2, 1} };
|
||||||
|
|
||||||
#define C9X_MAX_MODELS 60
|
|
||||||
#define C9X_MAX_TIMERS 3
|
|
||||||
#define C9X_MAX_FLIGHT_MODES 9
|
|
||||||
#define C9X_MAX_MIXERS 64
|
|
||||||
#define C9X_MAX_INPUTS 32
|
|
||||||
#define C9X_MAX_EXPOS 64
|
|
||||||
#define C9X_MAX_CURVES 32
|
|
||||||
#define C9X_MAX_POINTS 17
|
|
||||||
#define C9X_MAX_GVARS 9
|
|
||||||
#define C9X_MAX_ENCODERS 2
|
|
||||||
#define C9X_NUM_CHNOUT 32 // number of real output channels
|
|
||||||
#define C9X_NUM_CSW 32 // number of custom switches
|
|
||||||
#define C9X_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
|
|
||||||
#define C9X_NUM_MODULES 2
|
|
||||||
|
|
||||||
#define STK_RUD 1
|
#define STK_RUD 1
|
||||||
#define STK_ELE 2
|
#define STK_ELE 2
|
||||||
#define STK_THR 3
|
#define STK_THR 3
|
||||||
|
@ -197,14 +163,6 @@ enum HeliSwashTypes {
|
||||||
HELI_SWASH_TYPE_90
|
HELI_SWASH_TYPE_90
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_STICKS 4
|
|
||||||
#define BOARD_9X_NUM_POTS 3
|
|
||||||
#define C9X_NUM_POTS 8
|
|
||||||
#define NUM_CAL_PPM 4
|
|
||||||
#define NUM_CYC 3
|
|
||||||
#define C9X_NUM_SWITCHES 10
|
|
||||||
#define C9X_NUM_KEYS 6
|
|
||||||
|
|
||||||
extern const char * switches9X[];
|
extern const char * switches9X[];
|
||||||
extern const char * switchesX9D[];
|
extern const char * switchesX9D[];
|
||||||
extern const char leftArrow[];
|
extern const char leftArrow[];
|
||||||
|
@ -1565,11 +1523,6 @@ class Firmware {
|
||||||
|
|
||||||
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
||||||
|
|
||||||
virtual SimulatorInterface * getSimulator()
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QList<const char *> languages;
|
QList<const char *> languages;
|
||||||
QList<const char *> ttslanguages;
|
QList<const char *> ttslanguages;
|
||||||
|
@ -1599,6 +1552,8 @@ inline Firmware * GetCurrentFirmware()
|
||||||
return current_firmware_variant;
|
return current_firmware_variant;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SimulatorInterface *getCurrentFirmwareSimulator();
|
||||||
|
|
||||||
inline EEPROMInterface * GetEepromInterface()
|
inline EEPROMInterface * GetEepromInterface()
|
||||||
{
|
{
|
||||||
return GetCurrentFirmware()->getEepromInterface();
|
return GetCurrentFirmware()->getEepromInterface();
|
||||||
|
@ -1611,4 +1566,6 @@ inline int divRoundClosest(const int n, const int d)
|
||||||
|
|
||||||
#define CHECK_IN_ARRAY(T, index) ((unsigned int)index < (unsigned int)(sizeof(T)/sizeof(T[0])) ? T[(unsigned int)index] : "???")
|
#define CHECK_IN_ARRAY(T, index) ((unsigned int)index < (unsigned int)(sizeof(T)/sizeof(T[0])) ? T[(unsigned int)index] : "???")
|
||||||
|
|
||||||
|
SimulatorInterface * GetCurrentFirmwareSimulator();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "er9xinterface.h"
|
#include "er9xinterface.h"
|
||||||
#include "er9xeeprom.h"
|
#include "er9xeeprom.h"
|
||||||
#include "er9xsimulator.h"
|
#include "simulator/er9xsimulator.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "appdata.h"
|
#include "appdata.h"
|
||||||
|
|
||||||
|
|
15
companion/src/firmwares/er9x/simulator/CMakeLists.txt
Normal file
15
companion/src/firmwares/er9x/simulator/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
|
||||||
|
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${PROJECT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(er9x-simulator er9xsimulator.cpp)
|
|
@ -50,8 +50,6 @@ class Er9xSimulator : public SimulatorInterface {
|
||||||
|
|
||||||
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps) { }
|
|
||||||
|
|
||||||
virtual const char * getError();
|
virtual const char * getError();
|
||||||
|
|
||||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
|
@ -18,7 +18,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include "ersky9xinterface.h"
|
#include "ersky9xinterface.h"
|
||||||
#include "ersky9xeeprom.h"
|
#include "ersky9xeeprom.h"
|
||||||
#include "ersky9xsimulator.h"
|
#include "simulator/ersky9xsimulator.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
|
||||||
#define FILE_TYP_GENERAL 1
|
#define FILE_TYP_GENERAL 1
|
||||||
|
|
15
companion/src/firmwares/ersky9x/simulator/CMakeLists.txt
Normal file
15
companion/src/firmwares/ersky9x/simulator/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||||
|
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${PROJECT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(ersky9x-simulator ersky9xsimulator.cpp)
|
|
@ -50,8 +50,6 @@ class Ersky9xSimulator : public SimulatorInterface {
|
||||||
|
|
||||||
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps) { }
|
|
||||||
|
|
||||||
virtual const char * getError();
|
virtual const char * getError();
|
||||||
|
|
||||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
|
@ -1,250 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opentxGruvin9xsimulator.h"
|
|
||||||
#include "opentxinterface.h"
|
|
||||||
#include "opentxeeprom.h"
|
|
||||||
|
|
||||||
#define SIMU
|
|
||||||
#define SIMU_EXCEPTIONS
|
|
||||||
#define PCBGRUVIN9X
|
|
||||||
#define CPUM2560
|
|
||||||
#define GUI
|
|
||||||
#define ROTARY_ENCODERS 2
|
|
||||||
#define HELI
|
|
||||||
#define TEMPLATES
|
|
||||||
#define SPLASH
|
|
||||||
#define FLIGHT_MODES
|
|
||||||
#define FRSKY
|
|
||||||
#define FRSKY_HUB
|
|
||||||
#define WS_HOW_HIGH
|
|
||||||
#define VARIO
|
|
||||||
#define PPM_UNIT_PERCENT_PREC1
|
|
||||||
#define BUZZER
|
|
||||||
#define AUDIO
|
|
||||||
#define HAPTIC
|
|
||||||
#define AUTOSWITCH
|
|
||||||
#define GRAPHICS
|
|
||||||
#define CURVES
|
|
||||||
#define GVARS
|
|
||||||
#define BOLD_FONT
|
|
||||||
#define VOICE
|
|
||||||
#define PPM_CENTER_ADJUSTABLE
|
|
||||||
#define PPM_LIMITS_SYMETRICAL
|
|
||||||
#define GAUGES
|
|
||||||
#define GPS
|
|
||||||
#define FAI_CHOICE
|
|
||||||
#define FRSKY_STICKS
|
|
||||||
#define OVERRIDE_CHANNEL_FUNCTION
|
|
||||||
#define TIMERS 2
|
|
||||||
#define THRTRACE
|
|
||||||
|
|
||||||
#define FLAVOUR "gruvin9x"
|
|
||||||
#define EEPROM_VARIANT 3
|
|
||||||
|
|
||||||
#undef min
|
|
||||||
#undef max
|
|
||||||
|
|
||||||
#include <exception>
|
|
||||||
|
|
||||||
namespace Open9xGruvin9x {
|
|
||||||
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
|
|
||||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
|
||||||
#include "radio/src/eeprom_common.cpp"
|
|
||||||
#include "radio/src/eeprom_rlc.cpp"
|
|
||||||
#include "radio/src/opentx.cpp"
|
|
||||||
#include "radio/src/main_avr.cpp"
|
|
||||||
#include "radio/src/strhelpers.cpp"
|
|
||||||
#include "radio/src/switches.cpp"
|
|
||||||
#include "radio/src/functions.cpp"
|
|
||||||
#include "radio/src/curves.cpp"
|
|
||||||
#include "radio/src/mixer.cpp"
|
|
||||||
#include "radio/src/timers.cpp"
|
|
||||||
#include "radio/src/pulses/pulses_avr.cpp"
|
|
||||||
#include "radio/src/stamp.cpp"
|
|
||||||
#include "radio/src/maths.cpp"
|
|
||||||
#include "radio/src/vario.cpp"
|
|
||||||
#include "radio/src/gui/9X/widgets.cpp"
|
|
||||||
#include "radio/src/gui/9X/navigation.cpp"
|
|
||||||
#include "radio/src/gui/9X/popups.cpp"
|
|
||||||
#include "radio/src/gui/9X/helpers.cpp"
|
|
||||||
#include "radio/src/gui/9X/menus.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_select.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_setup.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_heli.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_curves.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_limits.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_templates.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_setup.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_trainer.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_version.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_diagkeys.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_diaganas.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_calib.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_main.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_statistics.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/9X/lcd.cpp"
|
|
||||||
#include "radio/src/gui/9X/splash.cpp"
|
|
||||||
#include "radio/src/keys.cpp"
|
|
||||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
|
||||||
#include "radio/src/templates.cpp"
|
|
||||||
#include "radio/src/translations.cpp"
|
|
||||||
#include "radio/src/gui/9X/fonts.cpp"
|
|
||||||
#include "radio/src/audio_avr.cpp"
|
|
||||||
#include "radio/src/buzzer.cpp"
|
|
||||||
#include "radio/src/targets/gruvin9x/somo14d.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky_d.cpp"
|
|
||||||
#include "radio/src/translations/tts_en.cpp"
|
|
||||||
#include "radio/src/haptic.cpp"
|
|
||||||
|
|
||||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
|
||||||
|
|
||||||
uint16_t anaIn(uint8_t chan)
|
|
||||||
{
|
|
||||||
if (chan == 7)
|
|
||||||
return 150;
|
|
||||||
else
|
|
||||||
return g_anas[chan];
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasExtendedTrims()
|
|
||||||
{
|
|
||||||
return g_model.extendedTrims;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getStickMode()
|
|
||||||
{
|
|
||||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace Open9xGruvin9x;
|
|
||||||
|
|
||||||
Open9xGruvin9xSimulator::Open9xGruvin9xSimulator()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Open9xGruvin9xSimulator::timer10ms()
|
|
||||||
{
|
|
||||||
#define TIMER10MS_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t * Open9xGruvin9xSimulator::getLcd()
|
|
||||||
{
|
|
||||||
#define GETLCD_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Open9xGruvin9xSimulator::lcdChanged(bool & lightEnable)
|
|
||||||
{
|
|
||||||
#define LCDCHANGED_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xGruvin9xSimulator::start(QByteArray & eeprom, bool tests)
|
|
||||||
{
|
|
||||||
g_rotenc[0] = 0;
|
|
||||||
g_rotenc[1] = 0;
|
|
||||||
memcpy(Open9xGruvin9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xGruvin9x::eeprom), eeprom.size()));
|
|
||||||
StartEepromThread(NULL);
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xGruvin9xSimulator::start(const char * filename, bool tests)
|
|
||||||
{
|
|
||||||
g_rotenc[0] = 0;
|
|
||||||
g_rotenc[1] = 0;
|
|
||||||
StartEepromThread(filename);
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xGruvin9xSimulator::stop()
|
|
||||||
{
|
|
||||||
StopMainThread();
|
|
||||||
StopEepromThread();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xGruvin9xSimulator::getValues(TxOutputs &outputs)
|
|
||||||
{
|
|
||||||
#define GETVALUES_IMPORT
|
|
||||||
#define g_chans512 channelOutputs
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
outputs.beep = g_beepCnt;
|
|
||||||
g_beepCnt = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xGruvin9xSimulator::setValues(TxInputs &inputs)
|
|
||||||
{
|
|
||||||
#define SETVALUES_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xGruvin9xSimulator::setTrim(unsigned int idx, int value)
|
|
||||||
{
|
|
||||||
idx = Open9xGruvin9x::modn12x3[4*getStickMode() + idx];
|
|
||||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
|
||||||
setTrimValue(phase, idx, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xGruvin9xSimulator::getTrims(Trims & trims)
|
|
||||||
{
|
|
||||||
uint8_t phase = getFlightMode();
|
|
||||||
trims.extended = hasExtendedTrims();
|
|
||||||
for (uint8_t idx=0; idx<4; idx++) {
|
|
||||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i<2; i++) {
|
|
||||||
uint8_t idx = Open9xGruvin9x::modn12x3[4*getStickMode() + i];
|
|
||||||
int16_t tmp = trims.values[i];
|
|
||||||
trims.values[i] = trims.values[idx];
|
|
||||||
trims.values[idx] = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xGruvin9xSimulator::wheelEvent(uint8_t steps)
|
|
||||||
{
|
|
||||||
g_rotenc[0] += steps;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int Open9xGruvin9xSimulator::getPhase()
|
|
||||||
{
|
|
||||||
return getFlightMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * Open9xGruvin9xSimulator::getPhaseName(unsigned int phase)
|
|
||||||
{
|
|
||||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
|
||||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
|
||||||
return buff;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * Open9xGruvin9xSimulator::getError()
|
|
||||||
{
|
|
||||||
#define GETERROR_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef open9xGruvin9x_simulator_h
|
|
||||||
#define open9xGruvin9x_simulator_h
|
|
||||||
|
|
||||||
#include "simulatorinterface.h"
|
|
||||||
|
|
||||||
class RadioData;
|
|
||||||
class OpenTxEepromInterface;
|
|
||||||
|
|
||||||
class Open9xGruvin9xSimulator : public SimulatorInterface {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
Open9xGruvin9xSimulator();
|
|
||||||
|
|
||||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
|
||||||
|
|
||||||
virtual void start(const char * filename, bool tests=true);
|
|
||||||
|
|
||||||
virtual void stop();
|
|
||||||
|
|
||||||
virtual bool timer10ms();
|
|
||||||
|
|
||||||
virtual uint8_t * getLcd();
|
|
||||||
|
|
||||||
virtual bool lcdChanged(bool & lightEnable);
|
|
||||||
|
|
||||||
virtual void setValues(TxInputs &inputs);
|
|
||||||
|
|
||||||
virtual void getValues(TxOutputs &outputs);
|
|
||||||
|
|
||||||
virtual void setTrim(unsigned int idx, int value);
|
|
||||||
|
|
||||||
virtual void getTrims(Trims & trims);
|
|
||||||
|
|
||||||
virtual unsigned int getPhase();
|
|
||||||
|
|
||||||
virtual const char * getPhaseName(unsigned int phase);
|
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps);
|
|
||||||
|
|
||||||
virtual const char * getError();
|
|
||||||
|
|
||||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
|
||||||
|
|
||||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
|
||||||
|
|
||||||
virtual void installTraceHook(void (*callback)(const char *)) {};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,243 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opentxM128simulator.h"
|
|
||||||
#include "opentxinterface.h"
|
|
||||||
#include "opentxeeprom.h"
|
|
||||||
|
|
||||||
#define SIMU
|
|
||||||
#define SIMU_EXCEPTIONS
|
|
||||||
#define PCBSTD
|
|
||||||
#define CPUM128
|
|
||||||
#define GUI
|
|
||||||
#define HELI
|
|
||||||
#define TEMPLATES
|
|
||||||
#define SPLASH
|
|
||||||
#define FLIGHT_MODES
|
|
||||||
#define FRSKY
|
|
||||||
#define FRSKY_HUB
|
|
||||||
#define WS_HOW_HIGH
|
|
||||||
#define VARIO
|
|
||||||
#define PPM_UNIT_PERCENT_PREC1
|
|
||||||
#define AUDIO
|
|
||||||
#define HAPTIC
|
|
||||||
#define AUTOSWITCH
|
|
||||||
#define GRAPHICS
|
|
||||||
#define CURVES
|
|
||||||
#define GVARS
|
|
||||||
#define BOLD_FONT
|
|
||||||
#define VOICE
|
|
||||||
#define PPM_CENTER_ADJUSTABLE
|
|
||||||
#define PPM_LIMITS_SYMETRICAL
|
|
||||||
#define GAUGES
|
|
||||||
#define GPS
|
|
||||||
#define FAI_CHOICE
|
|
||||||
#define FRSKY_STICKS
|
|
||||||
#define DSM2
|
|
||||||
#define DSM2_PPM
|
|
||||||
#define OVERRIDE_CHANNEL_FUNCTION
|
|
||||||
#define TIMERS 2
|
|
||||||
#define GAUGES
|
|
||||||
#define THRTRACE
|
|
||||||
|
|
||||||
#define FLAVOUR "9x128"
|
|
||||||
#define EEPROM_VARIANT SIMU_M128_VARIANTS
|
|
||||||
|
|
||||||
#undef min
|
|
||||||
#undef max
|
|
||||||
|
|
||||||
#include <exception>
|
|
||||||
|
|
||||||
namespace OpenTxM128 {
|
|
||||||
#include "radio/src/targets/stock/board_stock.cpp"
|
|
||||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
|
||||||
#include "radio/src/eeprom_common.cpp"
|
|
||||||
#include "radio/src/eeprom_rlc.cpp"
|
|
||||||
#include "radio/src/opentx.cpp"
|
|
||||||
#include "radio/src/main_avr.cpp"
|
|
||||||
#include "radio/src/strhelpers.cpp"
|
|
||||||
#include "radio/src/switches.cpp"
|
|
||||||
#include "radio/src/functions.cpp"
|
|
||||||
#include "radio/src/curves.cpp"
|
|
||||||
#include "radio/src/mixer.cpp"
|
|
||||||
#include "radio/src/timers.cpp"
|
|
||||||
#include "radio/src/pulses/pulses_avr.cpp"
|
|
||||||
#include "radio/src/stamp.cpp"
|
|
||||||
#include "radio/src/maths.cpp"
|
|
||||||
#include "radio/src/vario.cpp"
|
|
||||||
#include "radio/src/gui/9X/widgets.cpp"
|
|
||||||
#include "radio/src/gui/9X/navigation.cpp"
|
|
||||||
#include "radio/src/gui/9X/popups.cpp"
|
|
||||||
#include "radio/src/gui/9X/helpers.cpp"
|
|
||||||
#include "radio/src/gui/9X/menus.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_select.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_setup.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_heli.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_curves.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_limits.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_templates.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_setup.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_trainer.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_version.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_diagkeys.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_diaganas.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_calib.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_main.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_statistics.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/9X/lcd.cpp"
|
|
||||||
#include "radio/src/gui/9X/splash.cpp"
|
|
||||||
#include "radio/src/keys.cpp"
|
|
||||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
|
||||||
#include "radio/src/templates.cpp"
|
|
||||||
#include "radio/src/translations.cpp"
|
|
||||||
#include "radio/src/gui/9X/fonts.cpp"
|
|
||||||
#include "radio/src/audio_avr.cpp"
|
|
||||||
#include "radio/src/targets/stock/voice.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky_d.cpp"
|
|
||||||
#include "radio/src/translations/tts_en.cpp"
|
|
||||||
#include "radio/src/haptic.cpp"
|
|
||||||
|
|
||||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
|
||||||
|
|
||||||
uint16_t anaIn(uint8_t chan)
|
|
||||||
{
|
|
||||||
if (chan == 7)
|
|
||||||
return 150;
|
|
||||||
else
|
|
||||||
return g_anas[chan];
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasExtendedTrims()
|
|
||||||
{
|
|
||||||
return g_model.extendedTrims;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getStickMode()
|
|
||||||
{
|
|
||||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace OpenTxM128;
|
|
||||||
|
|
||||||
OpenTxM128Simulator::OpenTxM128Simulator()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenTxM128Simulator::timer10ms()
|
|
||||||
{
|
|
||||||
#define TIMER10MS_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t * OpenTxM128Simulator::getLcd()
|
|
||||||
{
|
|
||||||
#define GETLCD_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenTxM128Simulator::lcdChanged(bool & lightEnable)
|
|
||||||
{
|
|
||||||
#define LCDCHANGED_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM128Simulator::start(QByteArray & eeprom, bool tests)
|
|
||||||
{
|
|
||||||
memcpy(OpenTxM128::eeprom, eeprom.data(), std::min<int>(sizeof(OpenTxM128::eeprom), eeprom.size()));
|
|
||||||
StartEepromThread(NULL);
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM128Simulator::start(const char * filename, bool tests)
|
|
||||||
{
|
|
||||||
StartEepromThread(filename);
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM128Simulator::stop()
|
|
||||||
{
|
|
||||||
StopMainThread();
|
|
||||||
StopEepromThread();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM128Simulator::getValues(TxOutputs &outputs)
|
|
||||||
{
|
|
||||||
#define GETVALUES_IMPORT
|
|
||||||
#define g_chans512 channelOutputs
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM128Simulator::setValues(TxInputs &inputs)
|
|
||||||
{
|
|
||||||
#define SETVALUES_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM128Simulator::setTrim(unsigned int idx, int value)
|
|
||||||
{
|
|
||||||
idx = OpenTxM128::modn12x3[4*getStickMode() + idx];
|
|
||||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
|
||||||
setTrimValue(phase, idx, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM128Simulator::getTrims(Trims & trims)
|
|
||||||
{
|
|
||||||
uint8_t phase = getFlightMode();
|
|
||||||
trims.extended = hasExtendedTrims();
|
|
||||||
for (uint8_t idx=0; idx<4; idx++) {
|
|
||||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i<2; i++) {
|
|
||||||
uint8_t idx = OpenTxM128::modn12x3[4*getStickMode() + i];
|
|
||||||
int16_t tmp = trims.values[i];
|
|
||||||
trims.values[i] = trims.values[idx];
|
|
||||||
trims.values[idx] = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM128Simulator::wheelEvent(uint8_t steps)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int OpenTxM128Simulator::getPhase()
|
|
||||||
{
|
|
||||||
return getFlightMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * OpenTxM128Simulator::getPhaseName(unsigned int phase)
|
|
||||||
{
|
|
||||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
|
||||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
|
||||||
return buff;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * OpenTxM128Simulator::getError()
|
|
||||||
{
|
|
||||||
#define GETERROR_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef OpenTxM128_simulator_h
|
|
||||||
#define OpenTxM128_simulator_h
|
|
||||||
|
|
||||||
#include "simulatorinterface.h"
|
|
||||||
|
|
||||||
class RadioData;
|
|
||||||
class OpenTxEepromInterface;
|
|
||||||
|
|
||||||
class OpenTxM128Simulator : public SimulatorInterface {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
OpenTxM128Simulator();
|
|
||||||
|
|
||||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
|
||||||
|
|
||||||
virtual void start(const char * filename, bool tests=true);
|
|
||||||
|
|
||||||
virtual void stop();
|
|
||||||
|
|
||||||
virtual bool timer10ms();
|
|
||||||
|
|
||||||
virtual uint8_t * getLcd();
|
|
||||||
|
|
||||||
virtual bool lcdChanged(bool & lightEnable);
|
|
||||||
|
|
||||||
virtual void setValues(TxInputs &inputs);
|
|
||||||
|
|
||||||
virtual void getValues(TxOutputs &outputs);
|
|
||||||
|
|
||||||
virtual void setTrim(unsigned int idx, int value);
|
|
||||||
|
|
||||||
virtual void getTrims(Trims & trims);
|
|
||||||
|
|
||||||
virtual unsigned int getPhase();
|
|
||||||
|
|
||||||
virtual const char * getPhaseName(unsigned int phase);
|
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps);
|
|
||||||
|
|
||||||
virtual const char * getError();
|
|
||||||
|
|
||||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
|
||||||
|
|
||||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
|
||||||
|
|
||||||
virtual void installTraceHook(void (*callback)(const char *)) {};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,247 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opentxM64simulator.h"
|
|
||||||
#include "opentxinterface.h"
|
|
||||||
#include "opentxeeprom.h"
|
|
||||||
|
|
||||||
#define HELI
|
|
||||||
#define SIMU
|
|
||||||
#define SIMU_EXCEPTIONS
|
|
||||||
#define PCBSTD
|
|
||||||
#define CPUM64
|
|
||||||
#define GUI
|
|
||||||
#define SPLASH
|
|
||||||
#define FLIGHT_MODES
|
|
||||||
#define PPM_UNIT_PERCENT_PREC1
|
|
||||||
#define HELI
|
|
||||||
#define TEMPLATES
|
|
||||||
#define FRSKY
|
|
||||||
#define FRSKY_HUB
|
|
||||||
#define WS_HOW_HIGH
|
|
||||||
#define PXX
|
|
||||||
#define DSM2
|
|
||||||
#define DSM2_PPM
|
|
||||||
#define VARIO
|
|
||||||
#define HAPTIC
|
|
||||||
#define AUTOSWITCH
|
|
||||||
#define GRAPHICS
|
|
||||||
#define CURVES
|
|
||||||
#define GVARS
|
|
||||||
#define BOLD_FONT
|
|
||||||
#define VOICE
|
|
||||||
#define PPM_CENTER_ADJUSTABLE
|
|
||||||
#define PPM_LIMITS_SYMETRICAL
|
|
||||||
#define BUZZER
|
|
||||||
#define GAUGES
|
|
||||||
#define GPS
|
|
||||||
#define FAI_CHOICE
|
|
||||||
#define FRSKY_STICKS
|
|
||||||
#define OVERRIDE_CHANNEL_FUNCTION
|
|
||||||
#define FAS_OFFSET
|
|
||||||
#define GAUGES
|
|
||||||
#define TIMERS 2
|
|
||||||
#define NUM_POTS 3
|
|
||||||
#define THRTRACE
|
|
||||||
|
|
||||||
#define FLAVOUR "9x"
|
|
||||||
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
|
|
||||||
|
|
||||||
#undef min
|
|
||||||
#undef max
|
|
||||||
|
|
||||||
#include <exception>
|
|
||||||
|
|
||||||
namespace OpenTxM64 {
|
|
||||||
#include "radio/src/targets/stock/board_stock.cpp"
|
|
||||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
|
||||||
#include "radio/src/eeprom_common.cpp"
|
|
||||||
#include "radio/src/eeprom_rlc.cpp"
|
|
||||||
#include "radio/src/opentx.cpp"
|
|
||||||
#include "radio/src/main_avr.cpp"
|
|
||||||
#include "radio/src/strhelpers.cpp"
|
|
||||||
#include "radio/src/switches.cpp"
|
|
||||||
#include "radio/src/functions.cpp"
|
|
||||||
#include "radio/src/curves.cpp"
|
|
||||||
#include "radio/src/mixer.cpp"
|
|
||||||
#include "radio/src/timers.cpp"
|
|
||||||
#include "radio/src/pulses/pulses_avr.cpp"
|
|
||||||
#include "radio/src/stamp.cpp"
|
|
||||||
#include "radio/src/maths.cpp"
|
|
||||||
#include "radio/src/vario.cpp"
|
|
||||||
#include "radio/src/gui/9X/widgets.cpp"
|
|
||||||
#include "radio/src/gui/9X/navigation.cpp"
|
|
||||||
#include "radio/src/gui/9X/popups.cpp"
|
|
||||||
#include "radio/src/gui/9X/helpers.cpp"
|
|
||||||
#include "radio/src/gui/9X/menus.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_select.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_setup.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_heli.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_curves.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_limits.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_templates.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_setup.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_trainer.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_version.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_diagkeys.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_diaganas.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_calib.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_main.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_statistics.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/9X/lcd.cpp"
|
|
||||||
#include "radio/src/gui/9X/splash.cpp"
|
|
||||||
#include "radio/src/keys.cpp"
|
|
||||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky_d.cpp"
|
|
||||||
#include "radio/src/templates.cpp"
|
|
||||||
#include "radio/src/translations.cpp"
|
|
||||||
#include "radio/src/gui/9X/fonts.cpp"
|
|
||||||
#include "radio/src/targets/stock/voice.cpp"
|
|
||||||
#include "radio/src/buzzer.cpp"
|
|
||||||
#include "radio/src/translations/tts_en.cpp"
|
|
||||||
#include "radio/src/haptic.cpp"
|
|
||||||
|
|
||||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
|
||||||
|
|
||||||
uint16_t anaIn(uint8_t chan)
|
|
||||||
{
|
|
||||||
if (chan == 7)
|
|
||||||
return 1500;
|
|
||||||
else
|
|
||||||
return g_anas[chan];
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasExtendedTrims()
|
|
||||||
{
|
|
||||||
return g_model.extendedTrims;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getStickMode()
|
|
||||||
{
|
|
||||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace OpenTxM64;
|
|
||||||
|
|
||||||
OpenTxM64Simulator::OpenTxM64Simulator()
|
|
||||||
{
|
|
||||||
#define INIT_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenTxM64Simulator::timer10ms()
|
|
||||||
{
|
|
||||||
#define TIMER10MS_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t * OpenTxM64Simulator::getLcd()
|
|
||||||
{
|
|
||||||
#define GETLCD_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenTxM64Simulator::lcdChanged(bool & lightEnable)
|
|
||||||
{
|
|
||||||
#define LCDCHANGED_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM64Simulator::start(QByteArray & eeprom, bool tests)
|
|
||||||
{
|
|
||||||
memcpy(&OpenTxM64::eeprom[0], eeprom.data(), 2048);
|
|
||||||
StartEepromThread(NULL);
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM64Simulator::start(const char * filename, bool tests)
|
|
||||||
{
|
|
||||||
StartEepromThread(filename);
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM64Simulator::stop()
|
|
||||||
{
|
|
||||||
StopMainThread();
|
|
||||||
StopEepromThread();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM64Simulator::getValues(TxOutputs &outputs)
|
|
||||||
{
|
|
||||||
#define GETVALUES_IMPORT
|
|
||||||
#define g_chans512 channelOutputs
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
outputs.beep = g_beepCnt;
|
|
||||||
g_beepCnt = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM64Simulator::setValues(TxInputs &inputs)
|
|
||||||
{
|
|
||||||
#define SETVALUES_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM64Simulator::setTrim(unsigned int idx, int value)
|
|
||||||
{
|
|
||||||
idx = OpenTxM64::modn12x3[4*getStickMode() + idx];
|
|
||||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
|
||||||
setTrimValue(phase, idx, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenTxM64Simulator::getTrims(Trims & trims)
|
|
||||||
{
|
|
||||||
uint8_t phase = getFlightMode();
|
|
||||||
trims.extended = hasExtendedTrims();
|
|
||||||
for (uint8_t idx=0; idx<4; idx++) {
|
|
||||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i<2; i++) {
|
|
||||||
uint8_t idx = OpenTxM64::modn12x3[4*getStickMode() + i];
|
|
||||||
int16_t tmp = trims.values[i];
|
|
||||||
trims.values[i] = trims.values[idx];
|
|
||||||
trims.values[idx] = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int OpenTxM64Simulator::getPhase()
|
|
||||||
{
|
|
||||||
return getFlightMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * OpenTxM64Simulator::getPhaseName(unsigned int phase)
|
|
||||||
{
|
|
||||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
|
||||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
|
||||||
return buff;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * OpenTxM64Simulator::getError()
|
|
||||||
{
|
|
||||||
#define GETERROR_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
|
@ -1,65 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef open9x_simulator_h
|
|
||||||
#define open9x_simulator_h
|
|
||||||
|
|
||||||
#include "simulatorinterface.h"
|
|
||||||
|
|
||||||
class OpenTxEepromInterface;
|
|
||||||
|
|
||||||
class OpenTxM64Simulator : public SimulatorInterface {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
OpenTxM64Simulator();
|
|
||||||
|
|
||||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
|
||||||
|
|
||||||
virtual void start(const char * filename, bool tests=true);
|
|
||||||
|
|
||||||
virtual void stop();
|
|
||||||
|
|
||||||
virtual bool timer10ms();
|
|
||||||
|
|
||||||
virtual uint8_t * getLcd();
|
|
||||||
|
|
||||||
virtual bool lcdChanged(bool & lightEnable);
|
|
||||||
|
|
||||||
virtual void setValues(TxInputs &inputs);
|
|
||||||
|
|
||||||
virtual void getValues(TxOutputs &outputs);
|
|
||||||
|
|
||||||
virtual void setTrim(unsigned int idx, int value);
|
|
||||||
|
|
||||||
virtual void getTrims(Trims & trims);
|
|
||||||
|
|
||||||
virtual unsigned int getPhase();
|
|
||||||
|
|
||||||
virtual const char * getPhaseName(unsigned int phase);
|
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps) { }
|
|
||||||
|
|
||||||
virtual const char * getError();
|
|
||||||
|
|
||||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
|
||||||
|
|
||||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
|
||||||
|
|
||||||
virtual void installTraceHook(void (*callback)(const char *)) {};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,306 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opentxSky9xsimulator.h"
|
|
||||||
#include "opentxinterface.h"
|
|
||||||
#include "appdata.h"
|
|
||||||
|
|
||||||
#define SIMU
|
|
||||||
#define SIMU_EXCEPTIONS
|
|
||||||
#define PCBSKY9X
|
|
||||||
#define CPUARM
|
|
||||||
#define GUI
|
|
||||||
#define REVB
|
|
||||||
#define ROTARY_ENCODERS 1
|
|
||||||
#define HELI
|
|
||||||
#define TEMPLATES
|
|
||||||
#define SPLASH
|
|
||||||
#define FLIGHT_MODES
|
|
||||||
#define FRSKY
|
|
||||||
#define FRSKY_HUB
|
|
||||||
#define WS_HOW_HIGH
|
|
||||||
#define VARIO
|
|
||||||
#define PPM_UNIT_PERCENT_PREC1
|
|
||||||
#define BUZZER
|
|
||||||
#define AUDIO
|
|
||||||
#define VOICE
|
|
||||||
#define HAPTIC
|
|
||||||
// #define PXX
|
|
||||||
#define DSM2
|
|
||||||
#define DSM2_PPM
|
|
||||||
#define DBLKEYS
|
|
||||||
#define AUTOSWITCH
|
|
||||||
#define GRAPHICS
|
|
||||||
#define SDCARD
|
|
||||||
#define CURVES
|
|
||||||
#define GVARS
|
|
||||||
#define BOLD_FONT
|
|
||||||
#define PPM_CENTER_ADJUSTABLE
|
|
||||||
#define PPM_LIMITS_SYMETRICAL
|
|
||||||
#define GAUGES
|
|
||||||
#define GPS
|
|
||||||
#define FAI_CHOICE
|
|
||||||
#define FRSKY_STICKS
|
|
||||||
#define OVERRIDE_CHANNEL_FUNCTION
|
|
||||||
#define NUM_POTS 3
|
|
||||||
#define TIMERS 2
|
|
||||||
#define THRTRACE
|
|
||||||
|
|
||||||
#define EEPROM_VARIANT 3
|
|
||||||
#define FLAVOUR "sky9x"
|
|
||||||
|
|
||||||
#undef min
|
|
||||||
#undef max
|
|
||||||
|
|
||||||
#include <exception>
|
|
||||||
|
|
||||||
namespace Open9xSky9x {
|
|
||||||
#include "radio/src/targets/sky9x/board_sky9x.cpp"
|
|
||||||
#include "radio/src/pulses/ppm_arm.cpp"
|
|
||||||
#include "radio/src/pulses/pxx_arm.cpp"
|
|
||||||
#include "radio/src/pulses/dsm2_arm.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/pwr_driver.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
|
|
||||||
#include "radio/src/eeprom_common.cpp"
|
|
||||||
#include "radio/src/eeprom_raw.cpp"
|
|
||||||
#include "radio/src/eeprom_conversions.cpp"
|
|
||||||
#include "radio/src/opentx.cpp"
|
|
||||||
// #include "radio/src/debug.cpp" // only included once in Taranis simulator because functions are exported as C and don't support namespaces
|
|
||||||
#include "radio/src/main_arm.cpp"
|
|
||||||
#include "radio/src/strhelpers.cpp"
|
|
||||||
#include "radio/src/switches.cpp"
|
|
||||||
#include "radio/src/functions.cpp"
|
|
||||||
#include "radio/src/mixer.cpp"
|
|
||||||
#include "radio/src/timers.cpp"
|
|
||||||
#include "radio/src/curves.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
|
||||||
#include "radio/src/pulses/pulses_arm.cpp"
|
|
||||||
#include "radio/src/tasks_arm.cpp"
|
|
||||||
#include "radio/src/stamp.cpp"
|
|
||||||
#include "radio/src/maths.cpp"
|
|
||||||
#include "radio/src/vario.cpp"
|
|
||||||
#include "radio/src/sdcard.cpp"
|
|
||||||
#include "radio/src/gui/9X/widgets.cpp"
|
|
||||||
#include "radio/src/gui/9X/navigation.cpp"
|
|
||||||
#include "radio/src/gui/9X/popups.cpp"
|
|
||||||
#include "radio/src/gui/9X/helpers.cpp"
|
|
||||||
#include "radio/src/gui/9X/menus.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_select.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_setup.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_heli.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_curves.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_limits.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_model_templates.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_setup.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_sdmanager.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_trainer.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_version.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_diagkeys.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_diaganas.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_hardware.cpp"
|
|
||||||
#include "radio/src/gui/9X/menu_general_calib.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_main.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_statistics.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_about.cpp"
|
|
||||||
#include "radio/src/gui/9X/view_text.cpp"
|
|
||||||
#include "radio/src/gui/9X/lcd.cpp"
|
|
||||||
#include "radio/src/gui/9X/splash.cpp"
|
|
||||||
#include "radio/src/logs.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/keys_driver.cpp"
|
|
||||||
#include "radio/src/keys.cpp"
|
|
||||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
|
||||||
#include "radio/src/templates.cpp"
|
|
||||||
#include "radio/src/translations.cpp"
|
|
||||||
#include "radio/src/gui/9X/fonts.cpp"
|
|
||||||
#include "radio/src/telemetry/telemetry.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky_d.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/audio_driver.cpp"
|
|
||||||
#include "radio/src/audio_arm.cpp"
|
|
||||||
#include "radio/src/buzzer.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/coproc_driver.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/haptic_driver.cpp"
|
|
||||||
#include "radio/src/targets/sky9x/second_serial_driver.cpp"
|
|
||||||
#include "radio/src/haptic.cpp"
|
|
||||||
#include "radio/src/translations/tts_cz.cpp"
|
|
||||||
#include "radio/src/translations/tts_de.cpp"
|
|
||||||
#include "radio/src/translations/tts_en.cpp"
|
|
||||||
#include "radio/src/translations/tts_es.cpp"
|
|
||||||
#include "radio/src/translations/tts_se.cpp"
|
|
||||||
#include "radio/src/translations/tts_it.cpp"
|
|
||||||
#include "radio/src/translations/tts_fr.cpp"
|
|
||||||
#include "radio/src/translations/tts_pt.cpp"
|
|
||||||
#include "radio/src/translations/tts_sk.cpp"
|
|
||||||
#include "radio/src/translations/tts_pl.cpp"
|
|
||||||
#include "radio/src/translations/tts_hu.cpp"
|
|
||||||
|
|
||||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
|
||||||
|
|
||||||
uint16_t anaIn(uint8_t chan)
|
|
||||||
{
|
|
||||||
if (chan == 7)
|
|
||||||
return 1500;
|
|
||||||
else
|
|
||||||
return g_anas[chan];
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasExtendedTrims()
|
|
||||||
{
|
|
||||||
return g_model.extendedTrims;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getStickMode()
|
|
||||||
{
|
|
||||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace Open9xSky9x;
|
|
||||||
|
|
||||||
Open9xSky9xSimulator::Open9xSky9xSimulator()
|
|
||||||
{
|
|
||||||
QString path=g.profile[g.id()].sdPath()+"/";
|
|
||||||
int i=0;
|
|
||||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
|
||||||
simuSdDirectory[i]=path.at(i).toAscii();
|
|
||||||
}
|
|
||||||
simuSdDirectory[i]=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Open9xSky9xSimulator::timer10ms()
|
|
||||||
{
|
|
||||||
#define TIMER10MS_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
::uint8_t * Open9xSky9xSimulator::getLcd()
|
|
||||||
{
|
|
||||||
#define GETLCD_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Open9xSky9xSimulator::lcdChanged(bool & lightEnable)
|
|
||||||
{
|
|
||||||
#define LCDCHANGED_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::start(QByteArray & eeprom, bool tests)
|
|
||||||
{
|
|
||||||
g_rotenc[0] = 0;
|
|
||||||
memcpy(Open9xSky9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xSky9x::eeprom), eeprom.size()));
|
|
||||||
StartEepromThread(NULL);
|
|
||||||
StartAudioThread();
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::start(const char * filename, bool tests)
|
|
||||||
{
|
|
||||||
g_rotenc[0] = 0;
|
|
||||||
StartEepromThread(filename);
|
|
||||||
StartAudioThread();
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::stop()
|
|
||||||
{
|
|
||||||
StopMainThread();
|
|
||||||
StopAudioThread();
|
|
||||||
StopEepromThread();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::getValues(TxOutputs &outputs)
|
|
||||||
{
|
|
||||||
#define GETVALUES_IMPORT
|
|
||||||
#define g_chans512 channelOutputs
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
outputs.beep = g_beepCnt;
|
|
||||||
g_beepCnt = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::setValues(TxInputs &inputs)
|
|
||||||
{
|
|
||||||
#define SETVALUES_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
|
|
||||||
{
|
|
||||||
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
|
|
||||||
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
|
||||||
setTrimValue(phase, idx, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::getTrims(Trims & trims)
|
|
||||||
{
|
|
||||||
::uint8_t phase = getFlightMode();
|
|
||||||
trims.extended = hasExtendedTrims();
|
|
||||||
for (::uint8_t idx=0; idx<4; idx++) {
|
|
||||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i<2; i++) {
|
|
||||||
::uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
|
|
||||||
::int16_t tmp = trims.values[i];
|
|
||||||
trims.values[i] = trims.values[idx];
|
|
||||||
trims.values[idx] = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::wheelEvent(::uint8_t steps)
|
|
||||||
{
|
|
||||||
g_rotenc[0] += steps*4;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int Open9xSky9xSimulator::getPhase()
|
|
||||||
{
|
|
||||||
return getFlightMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * Open9xSky9xSimulator::getPhaseName(unsigned int phase)
|
|
||||||
{
|
|
||||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
|
||||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
|
||||||
return buff;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * Open9xSky9xSimulator::getError()
|
|
||||||
{
|
|
||||||
#define GETERROR_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
|
||||||
{
|
|
||||||
#define SETTRAINER_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open9xSky9xSimulator::installTraceHook(void (*callback)(const char *)) {
|
|
||||||
::traceCallback = callback;
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef open9xSky9x_simulator_h
|
|
||||||
#define open9xSky9x_simulator_h
|
|
||||||
|
|
||||||
#include "simulatorinterface.h"
|
|
||||||
|
|
||||||
class RadioData;
|
|
||||||
class OpenTxEepromInterface;
|
|
||||||
|
|
||||||
class Open9xSky9xSimulator : public SimulatorInterface {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
Open9xSky9xSimulator();
|
|
||||||
|
|
||||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
|
||||||
|
|
||||||
virtual void start(const char * filename, bool tests=true);
|
|
||||||
|
|
||||||
virtual void stop();
|
|
||||||
|
|
||||||
virtual bool timer10ms();
|
|
||||||
|
|
||||||
virtual uint8_t * getLcd();
|
|
||||||
|
|
||||||
virtual bool lcdChanged(bool & lightEnable);
|
|
||||||
|
|
||||||
virtual void setValues(TxInputs &inputs);
|
|
||||||
|
|
||||||
virtual void getValues(TxOutputs &outputs);
|
|
||||||
|
|
||||||
virtual void setTrim(unsigned int idx, int value);
|
|
||||||
|
|
||||||
virtual void getTrims(Trims & trims);
|
|
||||||
|
|
||||||
virtual unsigned int getPhase();
|
|
||||||
|
|
||||||
virtual const char * getPhaseName(unsigned int phase);
|
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps);
|
|
||||||
|
|
||||||
virtual const char * getError();
|
|
||||||
|
|
||||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
|
||||||
|
|
||||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
|
|
||||||
|
|
||||||
virtual void installTraceHook(void (*callback)(const char *));
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,353 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opentxTaranisSimulator.h"
|
|
||||||
#include "opentxinterface.h"
|
|
||||||
#include "appdata.h"
|
|
||||||
|
|
||||||
#define SIMU
|
|
||||||
#define SIMU_EXCEPTIONS
|
|
||||||
#define PCBTARANIS
|
|
||||||
#define CPUARM
|
|
||||||
#define CPUSTM32
|
|
||||||
#define GUI
|
|
||||||
#define HELI
|
|
||||||
#define SPLASH
|
|
||||||
#define FLIGHT_MODES
|
|
||||||
#define FRSKY
|
|
||||||
#define FRSKY_HUB
|
|
||||||
#define FRSKY_SPORT
|
|
||||||
#define GPS
|
|
||||||
#define VARIO
|
|
||||||
#define GAUGES
|
|
||||||
#define PPM_UNIT_PERCENT_PREC1
|
|
||||||
#define AUDIO
|
|
||||||
#define VOICE
|
|
||||||
#define PXX
|
|
||||||
#define DSM2
|
|
||||||
#define DSM2_PPM
|
|
||||||
#define DBLKEYS
|
|
||||||
#define AUTOSWITCH
|
|
||||||
#define GRAPHICS
|
|
||||||
#define SDCARD
|
|
||||||
#define RTCLOCK
|
|
||||||
#define VIRTUALINPUTS
|
|
||||||
#define CURVES
|
|
||||||
#define XCURVES
|
|
||||||
#define GVARS
|
|
||||||
#define BOLD_FONT
|
|
||||||
#define PPM_CENTER_ADJUSTABLE
|
|
||||||
#define PPM_LIMITS_SYMETRICAL
|
|
||||||
#define FAI_CHOICE
|
|
||||||
#define LUA
|
|
||||||
#define LUA_MODEL_SCRIPTS
|
|
||||||
#define HAPTIC
|
|
||||||
#define REVPLUS
|
|
||||||
#define OVERRIDE_CHANNEL_FUNCTION
|
|
||||||
#define TIMERS 3
|
|
||||||
#define THRTRACE
|
|
||||||
|
|
||||||
#define EEPROM_VARIANT 3
|
|
||||||
#define FLAVOUR "taranis-plus"
|
|
||||||
|
|
||||||
#undef min
|
|
||||||
#undef max
|
|
||||||
|
|
||||||
#include <exception>
|
|
||||||
|
|
||||||
namespace Open9xX9D {
|
|
||||||
|
|
||||||
int taranisSimulatorBoard = 0;
|
|
||||||
inline int geteepromsize() {
|
|
||||||
return 32*1024;
|
|
||||||
}
|
|
||||||
#define EESIZE geteepromsize()
|
|
||||||
|
|
||||||
#include "radio/src/targets/taranis/board_taranis.cpp"
|
|
||||||
#include "radio/src/pulses/ppm_arm.cpp"
|
|
||||||
#include "radio/src/pulses/pxx_arm.cpp"
|
|
||||||
#include "radio/src/pulses/dsm2_arm.cpp"
|
|
||||||
#include "radio/src/eeprom_common.cpp"
|
|
||||||
#include "radio/src/eeprom_conversions.cpp"
|
|
||||||
#include "radio/src/eeprom_rlc.cpp"
|
|
||||||
#include "radio/src/opentx.cpp"
|
|
||||||
#include "radio/src/debug.cpp"
|
|
||||||
#include "radio/src/main_arm.cpp"
|
|
||||||
#include "radio/src/strhelpers.cpp"
|
|
||||||
#include "radio/src/switches.cpp"
|
|
||||||
#include "radio/src/functions.cpp"
|
|
||||||
#include "radio/src/curves.cpp"
|
|
||||||
#include "radio/src/mixer.cpp"
|
|
||||||
#include "radio/src/sdcard.cpp"
|
|
||||||
#include "radio/src/timers.cpp"
|
|
||||||
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
|
||||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
|
||||||
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
|
||||||
#include "radio/src/targets/taranis/uart3_driver.cpp"
|
|
||||||
#include "radio/src/pulses/pulses_arm.cpp"
|
|
||||||
#include "radio/src/tasks_arm.cpp"
|
|
||||||
#include "radio/src/stamp.cpp"
|
|
||||||
#include "radio/src/maths.cpp"
|
|
||||||
#include "radio/src/vario.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/widgets.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/navigation.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/popups.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/helpers.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menus.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_select.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_setup.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_heli.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_flightmodes.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_inputs_mixes.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_curves.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_logical_switches.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_custom_functions.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_custom_scripts.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_gvars.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_limits.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_model_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_general.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_general_setup.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_general_sdmanager.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_general_trainer.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_general_version.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_general_diagkeys.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_general_diaganas.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_general_hardware.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/menu_general_calib.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/view_main.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/view_statistics.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/view_channels.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/view_telemetry.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/view_text.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/view_about.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/lcd.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/splash.cpp"
|
|
||||||
#include "radio/src/logs.cpp"
|
|
||||||
#include "radio/src/rtc.cpp"
|
|
||||||
#include "radio/src/targets/taranis/keys_driver.cpp"
|
|
||||||
#include "radio/src/keys.cpp"
|
|
||||||
#include "radio/src/bmp.cpp"
|
|
||||||
#include "radio/src/haptic.cpp"
|
|
||||||
#include "radio/src/sbus.cpp"
|
|
||||||
#include "radio/src/targets/taranis/haptic_driver.cpp"
|
|
||||||
// Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
|
|
||||||
#define SKIP_FATFS_DECLARATION
|
|
||||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
|
||||||
#include "radio/src/translations.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/fonts.cpp"
|
|
||||||
#include "radio/src/telemetry/telemetry.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky_d.cpp"
|
|
||||||
#include "radio/src/targets/taranis/audio_driver.cpp"
|
|
||||||
#include "radio/src/targets/taranis/telemetry_driver.cpp"
|
|
||||||
#include "radio/src/audio_arm.cpp"
|
|
||||||
#include "radio/src/translations/tts_cz.cpp"
|
|
||||||
#include "radio/src/translations/tts_de.cpp"
|
|
||||||
#include "radio/src/translations/tts_en.cpp"
|
|
||||||
#include "radio/src/translations/tts_es.cpp"
|
|
||||||
#include "radio/src/translations/tts_se.cpp"
|
|
||||||
#include "radio/src/translations/tts_it.cpp"
|
|
||||||
#include "radio/src/translations/tts_fr.cpp"
|
|
||||||
#include "radio/src/translations/tts_pt.cpp"
|
|
||||||
#include "radio/src/translations/tts_sk.cpp"
|
|
||||||
#include "radio/src/translations/tts_pl.cpp"
|
|
||||||
#include "radio/src/translations/tts_hu.cpp"
|
|
||||||
#include "radio/src/lua_api.cpp"
|
|
||||||
#include "radio/src/lua/src/lapi.c"
|
|
||||||
#include "radio/src/lua/src/lcode.c"
|
|
||||||
#include "radio/src/lua/src/lctype.c"
|
|
||||||
#include "radio/src/lua/src/ldebug.c"
|
|
||||||
#include "radio/src/lua/src/ldo.c"
|
|
||||||
#include "radio/src/lua/src/ldump.c"
|
|
||||||
#include "radio/src/lua/src/lfunc.c"
|
|
||||||
#include "radio/src/lua/src/lgc.c"
|
|
||||||
#include "radio/src/lua/src/llex.c"
|
|
||||||
#include "radio/src/lua/src/lmem.c"
|
|
||||||
#include "radio/src/lua/src/lobject.c"
|
|
||||||
#include "radio/src/lua/src/lopcodes.c"
|
|
||||||
#include "radio/src/lua/src/lparser.c"
|
|
||||||
#include "radio/src/lua/src/lstate.c"
|
|
||||||
#include "radio/src/lua/src/lstring.c"
|
|
||||||
#include "radio/src/lua/src/ltable.c"
|
|
||||||
#include "radio/src/lua/src/lrotable.c"
|
|
||||||
#include "radio/src/lua/src/ltm.c"
|
|
||||||
#include "radio/src/lua/src/lundump.c"
|
|
||||||
#include "radio/src/lua/src/lvm.c"
|
|
||||||
#include "radio/src/lua/src/lzio.c"
|
|
||||||
#include "radio/src/lua/src/lbaselib.c"
|
|
||||||
#include "radio/src/lua/src/linit.c"
|
|
||||||
#include "radio/src/lua/src/lmathlib.c"
|
|
||||||
#include "radio/src/lua/src/lbitlib.c"
|
|
||||||
#include "radio/src/lua/src/loadlib.c"
|
|
||||||
#include "radio/src/lua/src/lauxlib.c"
|
|
||||||
#include "radio/src/lua/src/ltablib.c"
|
|
||||||
#include "radio/src/lua/src/lcorolib.c"
|
|
||||||
|
|
||||||
|
|
||||||
int16_t g_anas[NUM_STICKS+NUM_POTS];
|
|
||||||
|
|
||||||
uint16_t anaIn(uint8_t chan)
|
|
||||||
{
|
|
||||||
return g_anas[chan];
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasExtendedTrims()
|
|
||||||
{
|
|
||||||
return g_model.extendedTrims;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getStickMode()
|
|
||||||
{
|
|
||||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void resetTrims()
|
|
||||||
{
|
|
||||||
GPIOE->IDR |= PIN_TRIM_LH_L | PIN_TRIM_LH_R | PIN_TRIM_LV_DN | PIN_TRIM_LV_UP;
|
|
||||||
GPIOC->IDR |= PIN_TRIM_RV_DN | PIN_TRIM_RV_UP | PIN_TRIM_RH_L | PIN_TRIM_RH_R;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace Open9xX9D;
|
|
||||||
|
|
||||||
OpentxTaranisSimulator::OpentxTaranisSimulator()
|
|
||||||
{
|
|
||||||
taranisSimulatorBoard = GetEepromInterface()->getBoard();
|
|
||||||
QString path = g.profile[g.id()].sdPath()+"/";
|
|
||||||
int i=0;
|
|
||||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
|
||||||
simuSdDirectory[i]=path.at(i).toAscii();
|
|
||||||
}
|
|
||||||
simuSdDirectory[i]=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpentxTaranisSimulator::timer10ms()
|
|
||||||
{
|
|
||||||
#define TIMER10MS_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
::uint8_t * OpentxTaranisSimulator::getLcd()
|
|
||||||
{
|
|
||||||
#define GETLCD_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpentxTaranisSimulator::lcdChanged(bool & lightEnable)
|
|
||||||
{
|
|
||||||
#define LCDCHANGED_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::start(QByteArray & eeprom, bool tests)
|
|
||||||
{
|
|
||||||
memcpy(Open9xX9D::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9D::eeprom), eeprom.size()));
|
|
||||||
StartEepromThread(NULL);
|
|
||||||
StartAudioThread();
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::start(const char * filename, bool tests)
|
|
||||||
{
|
|
||||||
StartEepromThread(filename);
|
|
||||||
StartAudioThread();
|
|
||||||
StartMainThread(tests);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::stop()
|
|
||||||
{
|
|
||||||
StopMainThread();
|
|
||||||
StopAudioThread();
|
|
||||||
StopEepromThread();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::getValues(TxOutputs &outputs)
|
|
||||||
{
|
|
||||||
#define GETVALUES_IMPORT
|
|
||||||
#define g_chans512 channelOutputs
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::setValues(TxInputs &inputs)
|
|
||||||
{
|
|
||||||
#define SETVALUES_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
|
|
||||||
{
|
|
||||||
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
|
|
||||||
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
|
||||||
setTrimValue(phase, idx, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::getTrims(Trims & trims)
|
|
||||||
{
|
|
||||||
::uint8_t phase = getFlightMode();
|
|
||||||
trims.extended = hasExtendedTrims();
|
|
||||||
for (::uint8_t idx=0; idx<4; idx++) {
|
|
||||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i<2; i++) {
|
|
||||||
::uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
|
|
||||||
::int16_t tmp = trims.values[i];
|
|
||||||
trims.values[i] = trims.values[idx];
|
|
||||||
trims.values[idx] = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::wheelEvent(::uint8_t steps)
|
|
||||||
{
|
|
||||||
// g_rotenc[0] += steps*4;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int OpentxTaranisSimulator::getPhase()
|
|
||||||
{
|
|
||||||
return getFlightMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * OpentxTaranisSimulator::getPhaseName(unsigned int phase)
|
|
||||||
{
|
|
||||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
|
||||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
|
||||||
return buff;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * OpentxTaranisSimulator::getError()
|
|
||||||
{
|
|
||||||
#define GETERROR_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
|
|
||||||
{
|
|
||||||
processSportPacket(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
|
||||||
{
|
|
||||||
#define SETTRAINER_IMPORT
|
|
||||||
#include "simulatorimport.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpentxTaranisSimulator::installTraceHook(void (*callback)(const char *)) {
|
|
||||||
::traceCallback = callback;
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
|
||||||
*
|
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef opentx_taranis_x9e_simulator_h
|
|
||||||
#define opentx_taranis_x9e_simulator_h
|
|
||||||
|
|
||||||
#include "simulatorinterface.h"
|
|
||||||
|
|
||||||
class RadioData;
|
|
||||||
class OpenTxEepromInterface;
|
|
||||||
|
|
||||||
class OpentxTaranisX9ESimulator : public SimulatorInterface {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
OpentxTaranisX9ESimulator();
|
|
||||||
|
|
||||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
|
||||||
|
|
||||||
virtual void start(const char * filename, bool tests=true);
|
|
||||||
|
|
||||||
virtual void stop();
|
|
||||||
|
|
||||||
virtual bool timer10ms();
|
|
||||||
|
|
||||||
virtual uint8_t * getLcd();
|
|
||||||
|
|
||||||
virtual bool lcdChanged(bool & lightEnable);
|
|
||||||
|
|
||||||
virtual void setValues(TxInputs &inputs);
|
|
||||||
|
|
||||||
virtual void getValues(TxOutputs &outputs);
|
|
||||||
|
|
||||||
virtual void setTrim(unsigned int idx, int value);
|
|
||||||
|
|
||||||
virtual void getTrims(Trims & trims);
|
|
||||||
|
|
||||||
virtual unsigned int getPhase();
|
|
||||||
|
|
||||||
virtual const char * getPhaseName(unsigned int phase);
|
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps);
|
|
||||||
|
|
||||||
virtual const char * getError();
|
|
||||||
|
|
||||||
virtual void sendTelemetry(uint8_t * data, unsigned int len);
|
|
||||||
|
|
||||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
|
|
||||||
|
|
||||||
virtual void installTraceHook(void (*callback)(const char *));
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -20,12 +20,6 @@
|
||||||
#include "opentxeeprom.h"
|
#include "opentxeeprom.h"
|
||||||
#include "open9xGruvin9xeeprom.h"
|
#include "open9xGruvin9xeeprom.h"
|
||||||
#include "open9xSky9xeeprom.h"
|
#include "open9xSky9xeeprom.h"
|
||||||
#include "opentxM64simulator.h"
|
|
||||||
#include "opentxM128simulator.h"
|
|
||||||
#include "opentxGruvin9xsimulator.h"
|
|
||||||
#include "opentxSky9xsimulator.h"
|
|
||||||
#include "opentxTaranisSimulator.h"
|
|
||||||
#include "opentxTaranisX9ESimulator.h"
|
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "appdata.h"
|
#include "appdata.h"
|
||||||
|
|
||||||
|
@ -486,7 +480,10 @@ int OpenTxEepromInterface::getSize(GeneralSettings &settings)
|
||||||
|
|
||||||
Firmware * OpenTxFirmware::getFirmwareVariant(const QString & id)
|
Firmware * OpenTxFirmware::getFirmwareVariant(const QString & id)
|
||||||
{
|
{
|
||||||
if (id.contains(getId()+"-") || (!id.contains("-") && id.contains(getId()))) {
|
if (id == getId()) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
else if (id.contains(getId()+"-") || (!id.contains("-") && id.contains(getId()))) {
|
||||||
Firmware * result = new OpenTxFirmware(id, this);
|
Firmware * result = new OpenTxFirmware(id, this);
|
||||||
// TODO result.variant = firmware->getVariant(id);
|
// TODO result.variant = firmware->getVariant(id);
|
||||||
return result;
|
return result;
|
||||||
|
@ -1070,29 +1067,6 @@ QString OpenTxFirmware::getStampUrl()
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimulatorInterface * OpenTxFirmware::getSimulator()
|
|
||||||
{
|
|
||||||
switch (board) {
|
|
||||||
case BOARD_STOCK:
|
|
||||||
return new OpenTxM64Simulator();
|
|
||||||
case BOARD_M128:
|
|
||||||
return new OpenTxM128Simulator();
|
|
||||||
case BOARD_GRUVIN9X:
|
|
||||||
case BOARD_MEGA2560:
|
|
||||||
return new Open9xGruvin9xSimulator();
|
|
||||||
case BOARD_SKY9X:
|
|
||||||
case BOARD_9XRPRO:
|
|
||||||
return new Open9xSky9xSimulator();
|
|
||||||
case BOARD_TARANIS:
|
|
||||||
case BOARD_TARANIS_PLUS:
|
|
||||||
return new OpentxTaranisSimulator();
|
|
||||||
case BOARD_TARANIS_X9E:
|
|
||||||
return new OpentxTaranisX9ESimulator();
|
|
||||||
default:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void addOpenTxCommonOptions(OpenTxFirmware * firmware)
|
void addOpenTxCommonOptions(OpenTxFirmware * firmware)
|
||||||
{
|
{
|
||||||
firmware->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
firmware->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||||
|
|
|
@ -121,8 +121,6 @@ class OpenTxFirmware: public Firmware {
|
||||||
virtual int getCapability(const Capability);
|
virtual int getCapability(const Capability);
|
||||||
|
|
||||||
virtual bool isTelemetrySourceAvailable(int source);
|
virtual bool isTelemetrySourceAvailable(int source);
|
||||||
|
|
||||||
virtual SimulatorInterface * getSimulator();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
129
companion/src/firmwares/opentx/simulator/CMakeLists.txt
Normal file
129
companion/src/firmwares/opentx/simulator/CMakeLists.txt
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||||
|
|
||||||
|
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${RADIO_SRC_DIRECTORY}/bitmaps/9X/about.lbm
|
||||||
|
COMMAND make lbm PCB=9X
|
||||||
|
DEPENDS ${RADIO_SRC_DIRECTORY}/bitmaps/9X/about.png
|
||||||
|
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${RADIO_SRC_DIRECTORY}/bitmaps/Taranis/about.lbm
|
||||||
|
COMMAND make lbm PCB=TARANIS
|
||||||
|
DEPENDS ${RADIO_SRC_DIRECTORY}/bitmaps/Taranis/about.png
|
||||||
|
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||||
|
COMMAND make tra
|
||||||
|
DEPENDS ${RADIO_SRC_DIRECTORY}/translations/en.h.txt
|
||||||
|
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${RADIO_SRC_DIRECTORY}/lua_exports.inc
|
||||||
|
COMMAND make PCB=TARANIS lua_exports.inc
|
||||||
|
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
|
||||||
|
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||||
|
)
|
||||||
|
|
||||||
|
set(OPENTX_SRC_FILES
|
||||||
|
${RADIO_SRC_DIRECTORY}/bitmaps/9X/about.lbm
|
||||||
|
${RADIO_SRC_DIRECTORY}/bitmaps/Taranis/about.lbm
|
||||||
|
${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||||
|
${RADIO_SRC_DIRECTORY}/lua_exports.inc
|
||||||
|
opentxsimulator.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${PROJECT_SOURCE_DIR}
|
||||||
|
${PROJECT_SOURCE_DIR}/firmwares/opentx
|
||||||
|
${RADIO_SRC_DIRECTORY}
|
||||||
|
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||||
|
${RADIO_SRC_DIRECTORY}/lua/src
|
||||||
|
${RADIO_SRC_DIRECTORY}/thirdparty
|
||||||
|
)
|
||||||
|
|
||||||
|
if(DEFINED TRANSLATIONS)
|
||||||
|
set(COMMON_DEFINITIONS ${COMMON_DEFINITIONS} TRANSLATIONS_${TRANSLATIONS})
|
||||||
|
string(TOLOWER ${TRANSLATIONS} TRANSLATION_SUFFIX)
|
||||||
|
set(SUFFIX ${SUFFIX}-${TRANSLATION_SUFFIX})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(COMMON_DEFINITIONS
|
||||||
|
${COMMON_DEFINITIONS}
|
||||||
|
SUFFIX="${SUFFIX}"
|
||||||
|
HELI
|
||||||
|
GVARS
|
||||||
|
FLIGHT_MODES
|
||||||
|
PPM_CENTER_ADJUSTABLE
|
||||||
|
PPM_LIMITS_SYMETRICAL
|
||||||
|
OVERRIDE_CHANNEL_FUNCTION
|
||||||
|
FAI_CHOICE
|
||||||
|
)
|
||||||
|
|
||||||
|
set(COMMON_LIBRARIES
|
||||||
|
${QT_LIBRARIES}
|
||||||
|
${PTHREAD_LIBRARY}
|
||||||
|
${SDL_LIBRARY}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(opentx-9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||||
|
add_library(opentx-9xr${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||||
|
add_library(opentx-9x128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||||
|
add_library(opentx-9xr128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||||
|
add_library(opentx-gruvin9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||||
|
add_library(opentx-sky9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||||
|
add_library(opentx-taranis${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||||
|
add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||||
|
add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||||
|
|
||||||
|
# 9X with ATmega64
|
||||||
|
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||||
|
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 ${COMMON_DEFINITIONS})
|
||||||
|
target_link_libraries(opentx-9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||||
|
|
||||||
|
# 9XR with ATmega64
|
||||||
|
target_include_directories(opentx-9xr${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||||
|
target_compile_definitions(opentx-9xr${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM64 ${COMMON_DEFINITIONS})
|
||||||
|
target_link_libraries(opentx-9xr${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||||
|
|
||||||
|
# 9X with ATmega128
|
||||||
|
target_include_directories(opentx-9x128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||||
|
target_compile_definitions(opentx-9x128${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM128 ${COMMON_DEFINITIONS})
|
||||||
|
target_link_libraries(opentx-9x128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||||
|
|
||||||
|
# 9XR with ATmega128
|
||||||
|
target_include_directories(opentx-9xr128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||||
|
target_compile_definitions(opentx-9xr128${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM128 ${COMMON_DEFINITIONS})
|
||||||
|
target_link_libraries(opentx-9xr128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||||
|
|
||||||
|
# Gruvin9x
|
||||||
|
target_include_directories(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/gruvin9x)
|
||||||
|
target_compile_definitions(opentx-gruvin9x${SUFFIX}-simulator PRIVATE PCBGRUVIN9X CPUM2560 VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||||
|
target_link_libraries(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||||
|
|
||||||
|
# Sky9x
|
||||||
|
target_include_directories(opentx-sky9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
|
||||||
|
target_compile_definitions(opentx-sky9x${SUFFIX}-simulator PRIVATE PCBSKY9X CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||||
|
target_link_libraries(opentx-sky9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||||
|
|
||||||
|
# Taranis standard
|
||||||
|
target_include_directories(opentx-taranis${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||||
|
target_compile_definitions(opentx-taranis${SUFFIX}-simulator PRIVATE PCBTARANIS CPUARM CPUSTM32 VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||||
|
target_link_libraries(opentx-taranis${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||||
|
|
||||||
|
# Taranis Plus
|
||||||
|
target_include_directories(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||||
|
target_compile_definitions(opentx-taranisplus${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS CPUARM CPUSTM32 VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||||
|
target_link_libraries(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||||
|
|
||||||
|
# Taranis X9E
|
||||||
|
target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||||
|
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||||
|
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
352
companion/src/firmwares/opentx/opentxTaranisX9ESimulator.cpp → companion/src/firmwares/opentx/simulator/opentxsimulator.cpp
Executable file → Normal file
352
companion/src/firmwares/opentx/opentxTaranisX9ESimulator.cpp → companion/src/firmwares/opentx/simulator/opentxsimulator.cpp
Executable file → Normal file
|
@ -14,98 +14,109 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opentxTaranisX9ESimulator.h"
|
#include "opentxsimulator.h"
|
||||||
#include "opentxinterface.h"
|
#include <QDebug>
|
||||||
#include "appdata.h"
|
#include <stdio.h>
|
||||||
|
#include <exception>
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#define SIMU
|
#define SIMU
|
||||||
#define SIMU_EXCEPTIONS
|
#define SIMU_EXCEPTIONS
|
||||||
#define PCBTARANIS
|
|
||||||
#define CPUARM
|
|
||||||
#define CPUSTM32
|
|
||||||
#define STM32F40_41xxx
|
|
||||||
#define GUI
|
#define GUI
|
||||||
#define HELI
|
|
||||||
#define SPLASH
|
#define SPLASH
|
||||||
#define FLIGHT_MODES
|
|
||||||
#define FRSKY
|
#define FRSKY
|
||||||
#define FRSKY_HUB
|
#define FRSKY_HUB
|
||||||
#define FRSKY_SPORT
|
|
||||||
#define GPS
|
#define GPS
|
||||||
#define VARIO
|
#define VARIO
|
||||||
#define GAUGES
|
#define GAUGES
|
||||||
#define PPM_UNIT_PERCENT_PREC1
|
#define PPM_UNIT_PERCENT_PREC1
|
||||||
#define AUDIO
|
#define AUDIO
|
||||||
#define VOICE
|
|
||||||
#define PXX
|
#define PXX
|
||||||
#define DSM2
|
#define DSM2
|
||||||
#define DSM2_PPM
|
#define DSM2_PPM
|
||||||
#define DBLKEYS
|
#define DBLKEYS
|
||||||
#define AUTOSWITCH
|
#define AUTOSWITCH
|
||||||
#define GRAPHICS
|
#define GRAPHICS
|
||||||
#define SDCARD
|
|
||||||
#define RTCLOCK
|
|
||||||
#define VIRTUALINPUTS
|
|
||||||
#define CURVES
|
#define CURVES
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
#define RTCLOCK
|
||||||
#define XCURVES
|
#define XCURVES
|
||||||
#define GVARS
|
#define VIRTUALINPUTS
|
||||||
#define BOLD_FONT
|
|
||||||
#define PPM_CENTER_ADJUSTABLE
|
|
||||||
#define PPM_LIMITS_SYMETRICAL
|
|
||||||
#define FAI_CHOICE
|
|
||||||
#define LUA
|
#define LUA
|
||||||
#define LUA_MODEL_SCRIPTS
|
#define LUA_MODEL_SCRIPTS
|
||||||
|
#else
|
||||||
|
#define BUZZER
|
||||||
|
#define TEMPLATES
|
||||||
|
#endif
|
||||||
|
#define BOLD_FONT
|
||||||
#define HAPTIC
|
#define HAPTIC
|
||||||
#define REVPLUS
|
|
||||||
#define REV9E
|
|
||||||
#define OVERRIDE_CHANNEL_FUNCTION
|
|
||||||
#define TIMERS 3
|
|
||||||
#define THRTRACE
|
#define THRTRACE
|
||||||
|
|
||||||
#define EEPROM_VARIANT 3
|
#if defined(CPUARM)
|
||||||
#define FLAVOUR "taranis-x9e"
|
#define TIMERS 3
|
||||||
|
#else
|
||||||
|
#define TIMERS 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(PCBSKY9X)
|
||||||
|
#define ROTARY_ENCODERS 1
|
||||||
|
#elif defined(PCBGRUVIN9X)
|
||||||
|
#define ROTARY_ENCODERS 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CPUARM)
|
||||||
|
#define FRSKY_SPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef min
|
#undef min
|
||||||
#undef max
|
#undef max
|
||||||
|
|
||||||
#include <exception>
|
namespace NAMESPACE {
|
||||||
|
|
||||||
namespace Open9xX9E {
|
#if defined(CPUARM)
|
||||||
|
|
||||||
int taranisSimulatorBoard = 0;
|
|
||||||
inline int geteepromsize() {
|
|
||||||
return 32*1024;
|
|
||||||
}
|
|
||||||
#define EESIZE geteepromsize()
|
|
||||||
|
|
||||||
#include "radio/src/targets/taranis/board_taranis.cpp"
|
|
||||||
#include "radio/src/pulses/ppm_arm.cpp"
|
#include "radio/src/pulses/ppm_arm.cpp"
|
||||||
#include "radio/src/pulses/pxx_arm.cpp"
|
#include "radio/src/pulses/pxx_arm.cpp"
|
||||||
#include "radio/src/pulses/dsm2_arm.cpp"
|
#include "radio/src/pulses/dsm2_arm.cpp"
|
||||||
#include "radio/src/eeprom_common.cpp"
|
|
||||||
#include "radio/src/eeprom_conversions.cpp"
|
#include "radio/src/eeprom_conversions.cpp"
|
||||||
#include "radio/src/eeprom_rlc.cpp"
|
|
||||||
#include "radio/src/opentx.cpp"
|
|
||||||
|
|
||||||
// #include "radio/src/debug.cpp" // only included once in Taranis simulator because functions are exported as C and don't support namespaces
|
|
||||||
#include "radio/src/main_arm.cpp"
|
#include "radio/src/main_arm.cpp"
|
||||||
|
#include "radio/src/pulses/pulses_arm.cpp"
|
||||||
|
#include "radio/src/tasks_arm.cpp"
|
||||||
|
#include "radio/src/audio_arm.cpp"
|
||||||
|
#include "radio/src/telemetry/telemetry.cpp"
|
||||||
|
#include "radio/src/telemetry/frsky_sport.cpp"
|
||||||
|
#include "radio/src/sbus.cpp"
|
||||||
|
#else
|
||||||
|
#include "radio/src/main_avr.cpp"
|
||||||
|
#include "radio/src/audio_avr.cpp"
|
||||||
|
#include "radio/src/pulses/pulses_avr.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "radio/src/eeprom_common.cpp"
|
||||||
|
#if defined(PCBSKY9X)
|
||||||
|
#include "radio/src/eeprom_raw.cpp"
|
||||||
|
#else
|
||||||
|
#include "radio/src/eeprom_rlc.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "radio/src/opentx.cpp"
|
||||||
|
#include "radio/src/debug.cpp"
|
||||||
#include "radio/src/strhelpers.cpp"
|
#include "radio/src/strhelpers.cpp"
|
||||||
#include "radio/src/switches.cpp"
|
#include "radio/src/switches.cpp"
|
||||||
#include "radio/src/functions.cpp"
|
#include "radio/src/functions.cpp"
|
||||||
#include "radio/src/curves.cpp"
|
#include "radio/src/curves.cpp"
|
||||||
#include "radio/src/mixer.cpp"
|
#include "radio/src/mixer.cpp"
|
||||||
|
#if defined(SDCARD)
|
||||||
#include "radio/src/sdcard.cpp"
|
#include "radio/src/sdcard.cpp"
|
||||||
|
#endif
|
||||||
#include "radio/src/timers.cpp"
|
#include "radio/src/timers.cpp"
|
||||||
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
|
||||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
|
||||||
#include "radio/src/targets/taranis/rotenc_driver.cpp"
|
|
||||||
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
|
||||||
#include "radio/src/targets/taranis/uart3_driver.cpp"
|
|
||||||
#include "radio/src/pulses/pulses_arm.cpp"
|
|
||||||
#include "radio/src/tasks_arm.cpp"
|
|
||||||
#include "radio/src/stamp.cpp"
|
#include "radio/src/stamp.cpp"
|
||||||
#include "radio/src/maths.cpp"
|
#include "radio/src/maths.cpp"
|
||||||
#include "radio/src/vario.cpp"
|
#include "radio/src/vario.cpp"
|
||||||
|
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
#include "radio/src/bmp.cpp"
|
||||||
|
#include "radio/src/gui/Taranis/fonts.cpp"
|
||||||
#include "radio/src/gui/Taranis/widgets.cpp"
|
#include "radio/src/gui/Taranis/widgets.cpp"
|
||||||
#include "radio/src/gui/Taranis/navigation.cpp"
|
#include "radio/src/gui/Taranis/navigation.cpp"
|
||||||
#include "radio/src/gui/Taranis/popups.cpp"
|
#include "radio/src/gui/Taranis/popups.cpp"
|
||||||
|
@ -141,31 +152,109 @@ inline int geteepromsize() {
|
||||||
#include "radio/src/gui/Taranis/view_about.cpp"
|
#include "radio/src/gui/Taranis/view_about.cpp"
|
||||||
#include "radio/src/gui/Taranis/lcd.cpp"
|
#include "radio/src/gui/Taranis/lcd.cpp"
|
||||||
#include "radio/src/gui/Taranis/splash.cpp"
|
#include "radio/src/gui/Taranis/splash.cpp"
|
||||||
|
#else
|
||||||
|
#include "radio/src/gui/9X/fonts.cpp"
|
||||||
|
#include "radio/src/gui/9X/widgets.cpp"
|
||||||
|
#include "radio/src/gui/9X/navigation.cpp"
|
||||||
|
#include "radio/src/gui/9X/popups.cpp"
|
||||||
|
#include "radio/src/gui/9X/helpers.cpp"
|
||||||
|
#include "radio/src/gui/9X/menus.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_select.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_setup.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_heli.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_curves.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_limits.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_model_templates.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_general.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_general_setup.cpp"
|
||||||
|
#if defined(SDCARD)
|
||||||
|
#include "radio/src/gui/9X/menu_general_sdmanager.cpp"
|
||||||
|
#include "radio/src/gui/9X/view_text.cpp"
|
||||||
|
#endif
|
||||||
|
#include "radio/src/gui/9X/menu_general_trainer.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_general_version.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_general_diagkeys.cpp"
|
||||||
|
#include "radio/src/gui/9X/menu_general_diaganas.cpp"
|
||||||
|
#if defined(CPUARM)
|
||||||
|
#include "radio/src/gui/9X/menu_general_hardware.cpp"
|
||||||
|
#endif
|
||||||
|
#include "radio/src/gui/9X/menu_general_calib.cpp"
|
||||||
|
#include "radio/src/gui/9X/view_main.cpp"
|
||||||
|
#include "radio/src/gui/9X/view_statistics.cpp"
|
||||||
|
#include "radio/src/gui/9X/view_telemetry.cpp"
|
||||||
|
#if !defined(CPUM64)
|
||||||
|
#include "radio/src/gui/9X/view_about.cpp"
|
||||||
|
#endif
|
||||||
|
#include "radio/src/gui/9X/lcd.cpp"
|
||||||
|
#include "radio/src/gui/9X/splash.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(VIRTUALINPUTS)
|
||||||
|
#include "radio/src/templates.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(SDCARD)
|
||||||
#include "radio/src/logs.cpp"
|
#include "radio/src/logs.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(RTCLOCK)
|
||||||
#include "radio/src/rtc.cpp"
|
#include "radio/src/rtc.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BUZZER)
|
||||||
|
#include "radio/src/buzzer.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
#include "radio/src/targets/taranis/board_taranis.cpp"
|
||||||
#include "radio/src/targets/taranis/keys_driver.cpp"
|
#include "radio/src/targets/taranis/keys_driver.cpp"
|
||||||
#include "radio/src/keys.cpp"
|
|
||||||
#include "radio/src/bmp.cpp"
|
|
||||||
#include "radio/src/haptic.cpp"
|
|
||||||
#include "radio/src/sbus.cpp"
|
|
||||||
#include "radio/src/targets/taranis/haptic_driver.cpp"
|
|
||||||
// TODO Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
|
|
||||||
#undef SDCARD
|
|
||||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
|
||||||
#define SDCARD
|
|
||||||
#include "radio/src/translations.cpp"
|
|
||||||
#include "radio/src/gui/Taranis/fonts.cpp"
|
|
||||||
#include "radio/src/telemetry/telemetry.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
|
||||||
#include "radio/src/telemetry/frsky_d.cpp"
|
|
||||||
#include "radio/src/targets/taranis/audio_driver.cpp"
|
#include "radio/src/targets/taranis/audio_driver.cpp"
|
||||||
#include "radio/src/targets/taranis/telemetry_driver.cpp"
|
#include "radio/src/targets/taranis/telemetry_driver.cpp"
|
||||||
|
#include "radio/src/targets/taranis/haptic_driver.cpp"
|
||||||
|
#if defined(REV9E)
|
||||||
#include "radio/src/targets/taranis/top_lcd_driver.cpp"
|
#include "radio/src/targets/taranis/top_lcd_driver.cpp"
|
||||||
#include "radio/src/audio_arm.cpp"
|
#include "radio/src/targets/taranis/rotenc_driver.cpp"
|
||||||
|
#endif
|
||||||
|
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
||||||
|
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||||
|
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
||||||
|
#include "radio/src/targets/taranis/uart3_driver.cpp"
|
||||||
|
#elif defined(PCBSKY9X)
|
||||||
|
#include "radio/src/targets/sky9x/board_sky9x.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/pwr_driver.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/keys_driver.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/audio_driver.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/coproc_driver.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/haptic_driver.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/second_serial_driver.cpp"
|
||||||
|
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
||||||
|
#elif defined(PCBGRUVIN9X)
|
||||||
|
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
|
||||||
|
#include "radio/src/targets/gruvin9x/somo14d.cpp"
|
||||||
|
#else
|
||||||
|
#include "radio/src/targets/stock/board_stock.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "radio/src/keys.cpp"
|
||||||
|
#include "radio/src/haptic.cpp"
|
||||||
|
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||||
|
#include "radio/src/translations.cpp"
|
||||||
|
#include "radio/src/telemetry/frsky.cpp"
|
||||||
|
#include "radio/src/telemetry/frsky_d.cpp"
|
||||||
|
#include "radio/src/translations/tts_en.cpp"
|
||||||
|
|
||||||
|
#if defined(CPUARM)
|
||||||
#include "radio/src/translations/tts_cz.cpp"
|
#include "radio/src/translations/tts_cz.cpp"
|
||||||
#include "radio/src/translations/tts_de.cpp"
|
#include "radio/src/translations/tts_de.cpp"
|
||||||
#include "radio/src/translations/tts_en.cpp"
|
|
||||||
#include "radio/src/translations/tts_es.cpp"
|
#include "radio/src/translations/tts_es.cpp"
|
||||||
#include "radio/src/translations/tts_se.cpp"
|
#include "radio/src/translations/tts_se.cpp"
|
||||||
#include "radio/src/translations/tts_it.cpp"
|
#include "radio/src/translations/tts_it.cpp"
|
||||||
|
@ -174,6 +263,9 @@ inline int geteepromsize() {
|
||||||
#include "radio/src/translations/tts_sk.cpp"
|
#include "radio/src/translations/tts_sk.cpp"
|
||||||
#include "radio/src/translations/tts_pl.cpp"
|
#include "radio/src/translations/tts_pl.cpp"
|
||||||
#include "radio/src/translations/tts_hu.cpp"
|
#include "radio/src/translations/tts_hu.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(LUA)
|
||||||
#include "radio/src/lua_api.cpp"
|
#include "radio/src/lua_api.cpp"
|
||||||
#include "radio/src/lua/src/lapi.c"
|
#include "radio/src/lua/src/lapi.c"
|
||||||
#include "radio/src/lua/src/lcode.c"
|
#include "radio/src/lua/src/lcode.c"
|
||||||
|
@ -204,6 +296,7 @@ inline int geteepromsize() {
|
||||||
#include "radio/src/lua/src/lauxlib.c"
|
#include "radio/src/lua/src/lauxlib.c"
|
||||||
#include "radio/src/lua/src/ltablib.c"
|
#include "radio/src/lua/src/ltablib.c"
|
||||||
#include "radio/src/lua/src/lcorolib.c"
|
#include "radio/src/lua/src/lcorolib.c"
|
||||||
|
#endif
|
||||||
|
|
||||||
int16_t g_anas[NUM_STICKS+NUM_POTS];
|
int16_t g_anas[NUM_STICKS+NUM_POTS];
|
||||||
|
|
||||||
|
@ -222,89 +315,111 @@ uint8_t getStickMode()
|
||||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
void resetTrims()
|
void resetTrims()
|
||||||
{
|
{
|
||||||
GPIOE->IDR |= PIN_TRIM_LH_L | PIN_TRIM_LH_R | PIN_TRIM_LV_DN | PIN_TRIM_LV_UP;
|
GPIOE->IDR |= PIN_TRIM_LH_L | PIN_TRIM_LH_R | PIN_TRIM_LV_DN | PIN_TRIM_LV_UP;
|
||||||
GPIOC->IDR |= PIN_TRIM_RV_DN | PIN_TRIM_RV_UP | PIN_TRIM_RH_L | PIN_TRIM_RH_R;
|
GPIOC->IDR |= PIN_TRIM_RV_DN | PIN_TRIM_RV_UP | PIN_TRIM_RH_L | PIN_TRIM_RH_R;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void delay_01us(::uint16_t nb)
|
void delay_01us(::uint16_t nb)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
OpenTxSimulator::OpenTxSimulator()
|
||||||
|
|
||||||
using namespace Open9xX9E;
|
|
||||||
|
|
||||||
OpentxTaranisX9ESimulator::OpentxTaranisX9ESimulator()
|
|
||||||
{
|
{
|
||||||
taranisSimulatorBoard = GetEepromInterface()->getBoard();
|
|
||||||
QString path=g.profile[g.id()].sdPath()+"/";
|
|
||||||
int i=0;
|
|
||||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
|
||||||
simuSdDirectory[i]=path.at(i).toAscii();
|
|
||||||
}
|
|
||||||
simuSdDirectory[i]=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpentxTaranisX9ESimulator::timer10ms()
|
void OpenTxSimulator::setSdPath(const QString &sdPath)
|
||||||
|
{
|
||||||
|
#if defined(SDCARD)
|
||||||
|
strncpy(simuSdDirectory, sdPath.toAscii().constData(), sizeof(simuSdDirectory)-1);
|
||||||
|
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OpenTxSimulator::timer10ms()
|
||||||
{
|
{
|
||||||
#define TIMER10MS_IMPORT
|
#define TIMER10MS_IMPORT
|
||||||
#include "simulatorimport.h"
|
#include "simulatorimport.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
::uint8_t * OpentxTaranisX9ESimulator::getLcd()
|
::uint8_t * OpenTxSimulator::getLcd()
|
||||||
{
|
{
|
||||||
#define GETLCD_IMPORT
|
#define GETLCD_IMPORT
|
||||||
#include "simulatorimport.h"
|
#include "simulatorimport.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpentxTaranisX9ESimulator::lcdChanged(bool & lightEnable)
|
bool OpenTxSimulator::lcdChanged(bool & lightEnable)
|
||||||
{
|
{
|
||||||
#define LCDCHANGED_IMPORT
|
#define LCDCHANGED_IMPORT
|
||||||
#include "simulatorimport.h"
|
#include "simulatorimport.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::start(QByteArray & eeprom, bool tests)
|
void OpenTxSimulator::start(QByteArray & eeprom, bool tests)
|
||||||
{
|
{
|
||||||
memcpy(Open9xX9E::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9E::eeprom), eeprom.size()));
|
#if defined(PCBSKY9X)
|
||||||
|
g_rotenc[0] = 0;
|
||||||
|
#elif defined(PCBGRUVIN9X)
|
||||||
|
g_rotenc[0] = 0;
|
||||||
|
g_rotenc[1] = 0;
|
||||||
|
#endif
|
||||||
|
memcpy(NAMESPACE::eeprom, eeprom.data(), std::min<int>(sizeof(NAMESPACE::eeprom), eeprom.size()));
|
||||||
StartEepromThread(NULL);
|
StartEepromThread(NULL);
|
||||||
|
StartAudioThread();
|
||||||
StartMainThread(tests);
|
StartMainThread(tests);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::start(const char * filename, bool tests)
|
void OpenTxSimulator::start(const char * filename, bool tests)
|
||||||
{
|
{
|
||||||
|
#if defined(PCBSKY9X)
|
||||||
|
g_rotenc[0] = 0;
|
||||||
|
#elif defined(PCBGRUVIN9X)
|
||||||
|
g_rotenc[0] = 0;
|
||||||
|
g_rotenc[1] = 0;
|
||||||
|
#endif
|
||||||
StartEepromThread(filename);
|
StartEepromThread(filename);
|
||||||
|
#if defined(CPUARM)
|
||||||
|
StartAudioThread();
|
||||||
|
#endif
|
||||||
StartMainThread(tests);
|
StartMainThread(tests);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::stop()
|
void OpenTxSimulator::stop()
|
||||||
{
|
{
|
||||||
StopMainThread();
|
StopMainThread();
|
||||||
|
#if defined(CPUARM)
|
||||||
|
StopAudioThread();
|
||||||
|
#endif
|
||||||
StopEepromThread();
|
StopEepromThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::getValues(TxOutputs &outputs)
|
void OpenTxSimulator::getValues(TxOutputs &outputs)
|
||||||
{
|
{
|
||||||
#define GETVALUES_IMPORT
|
#define GETVALUES_IMPORT
|
||||||
#define g_chans512 channelOutputs
|
#define g_chans512 channelOutputs
|
||||||
#include "simulatorimport.h"
|
#include "simulatorimport.h"
|
||||||
|
#if defined(PCBSKY9X)
|
||||||
|
outputs.beep = g_beepCnt;
|
||||||
|
g_beepCnt = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::setValues(TxInputs &inputs)
|
void OpenTxSimulator::setValues(TxInputs &inputs)
|
||||||
{
|
{
|
||||||
#define SETVALUES_IMPORT
|
#define SETVALUES_IMPORT
|
||||||
#include "simulatorimport.h"
|
#include "simulatorimport.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::setTrim(unsigned int idx, int value)
|
void OpenTxSimulator::setTrim(unsigned int idx, int value)
|
||||||
{
|
{
|
||||||
idx = Open9xX9E::modn12x3[4*getStickMode() + idx];
|
idx = NAMESPACE::modn12x3[4*getStickMode() + idx];
|
||||||
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||||
setTrimValue(phase, idx, value);
|
setTrimValue(phase, idx, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::getTrims(Trims & trims)
|
void OpenTxSimulator::getTrims(Trims & trims)
|
||||||
{
|
{
|
||||||
::uint8_t phase = getFlightMode();
|
::uint8_t phase = getFlightMode();
|
||||||
trims.extended = hasExtendedTrims();
|
trims.extended = hasExtendedTrims();
|
||||||
|
@ -313,50 +428,93 @@ void OpentxTaranisX9ESimulator::getTrims(Trims & trims)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
::uint8_t idx = Open9xX9E::modn12x3[4*getStickMode() + i];
|
::uint8_t idx = NAMESPACE::modn12x3[4*getStickMode() + i];
|
||||||
::int16_t tmp = trims.values[i];
|
::int16_t tmp = trims.values[i];
|
||||||
trims.values[i] = trims.values[idx];
|
trims.values[i] = trims.values[idx];
|
||||||
trims.values[idx] = tmp;
|
trims.values[idx] = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::wheelEvent(::uint8_t steps)
|
void OpenTxSimulator::wheelEvent(int steps)
|
||||||
{
|
{
|
||||||
|
#if defined(REV9E)
|
||||||
if (steps == 255)
|
if (steps == 255)
|
||||||
x9de_rotenc -= 2;
|
x9de_rotenc -= 2;
|
||||||
else
|
else
|
||||||
x9de_rotenc += 2;
|
x9de_rotenc += 2;
|
||||||
|
#elif defined(PCBSKY9X)
|
||||||
|
g_rotenc[0] += steps*4;
|
||||||
|
#elif defined(PCBGRUVIN9X)
|
||||||
|
g_rotenc[0] += steps;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int OpentxTaranisX9ESimulator::getPhase()
|
unsigned int OpenTxSimulator::getPhase()
|
||||||
{
|
{
|
||||||
return getFlightMode();
|
return getFlightMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * OpentxTaranisX9ESimulator::getPhaseName(unsigned int phase)
|
const char * OpenTxSimulator::getPhaseName(unsigned int phase)
|
||||||
{
|
{
|
||||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||||
return buff;
|
return buff;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * OpentxTaranisX9ESimulator::getError()
|
const char * OpenTxSimulator::getError()
|
||||||
{
|
{
|
||||||
#define GETERROR_IMPORT
|
#define GETERROR_IMPORT
|
||||||
#include "simulatorimport.h"
|
#include "simulatorimport.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::sendTelemetry(::uint8_t * data, unsigned int len)
|
void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
|
||||||
{
|
{
|
||||||
|
#if defined(FRSKY_SPORT)
|
||||||
processSportPacket(data);
|
processSportPacket(data);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
void OpenTxSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
||||||
{
|
{
|
||||||
#define SETTRAINER_IMPORT
|
#define SETTRAINER_IMPORT
|
||||||
#include "simulatorimport.h"
|
#include "simulatorimport.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpentxTaranisX9ESimulator::installTraceHook(void (*callback)(const char *)) {
|
void OpenTxSimulator::installTraceHook(void (*callback)(const char *))
|
||||||
::traceCallback = callback;
|
{
|
||||||
|
traceCallback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
class OpenTxSimulatorFactory: public SimulatorFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OpenTxSimulatorFactory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual SimulatorInterface *create()
|
||||||
|
{
|
||||||
|
return new OpenTxSimulator();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual QString name()
|
||||||
|
{
|
||||||
|
return QString("opentx-" FLAVOUR SUFFIX);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual BoardEnum type()
|
||||||
|
{
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
return BOARD_TARANIS;
|
||||||
|
#else
|
||||||
|
return BOARD_STOCK;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" __declspec(dllexport) SimulatorFactory *registerSimu()
|
||||||
|
{
|
||||||
|
return new NAMESPACE::OpenTxSimulatorFactory();
|
||||||
}
|
}
|
|
@ -19,14 +19,55 @@
|
||||||
|
|
||||||
#include "simulatorinterface.h"
|
#include "simulatorinterface.h"
|
||||||
|
|
||||||
class RadioData;
|
#if defined(PCBTARANIS) && defined(REV9E)
|
||||||
class OpenTxEepromInterface;
|
#define FLAVOUR "taranisx9e"
|
||||||
|
#define NAMESPACE TaranisX9E
|
||||||
|
#define EEPROM_VARIANT 0
|
||||||
|
#elif defined(PCBTARANIS) && defined(REVPLUS)
|
||||||
|
#define FLAVOUR "taranisplus"
|
||||||
|
#define NAMESPACE TaranisPlus
|
||||||
|
#define EEPROM_VARIANT 0
|
||||||
|
#elif defined(PCBTARANIS)
|
||||||
|
#define FLAVOUR "taranis"
|
||||||
|
#define NAMESPACE Taranis
|
||||||
|
#define EEPROM_VARIANT 0
|
||||||
|
#elif defined(PCBSKY9X)
|
||||||
|
#define FLAVOUR "sky9x"
|
||||||
|
#define NAMESPACE Sky9X
|
||||||
|
#define EEPROM_VARIANT 0
|
||||||
|
#elif defined(PCBGRUVIN9X)
|
||||||
|
#define FLAVOUR "gruvin9x"
|
||||||
|
#define NAMESPACE Gruvin9X
|
||||||
|
#define EEPROM_VARIANT 0
|
||||||
|
#elif defined(PCB9XR) && defined(CPUM128)
|
||||||
|
#define FLAVOUR "9xr128"
|
||||||
|
#define NAMESPACE M128XR
|
||||||
|
#define EEPROM_VARIANT 0x8003
|
||||||
|
#elif defined(PCB9X) && defined(CPUM128)
|
||||||
|
#define FLAVOUR "9x128"
|
||||||
|
#define NAMESPACE M128
|
||||||
|
#define EEPROM_VARIANT 0x8003
|
||||||
|
#elif defined(PCB9XR) && defined(CPUM64)
|
||||||
|
#define FLAVOUR "9xr"
|
||||||
|
#define NAMESPACE M64XR
|
||||||
|
#define EEPROM_VARIANT 0x0003
|
||||||
|
#elif defined(PCB9X) && defined(CPUM64)
|
||||||
|
#define FLAVOUR "9x"
|
||||||
|
#define NAMESPACE M64
|
||||||
|
#define EEPROM_VARIANT 0x0003
|
||||||
|
#else
|
||||||
|
#error "Unknown board"
|
||||||
|
#endif
|
||||||
|
|
||||||
class OpentxTaranisSimulator : public SimulatorInterface {
|
namespace NAMESPACE {
|
||||||
|
|
||||||
|
class __declspec(dllexport) OpenTxSimulator : public SimulatorInterface {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
OpentxTaranisSimulator();
|
OpenTxSimulator();
|
||||||
|
|
||||||
|
virtual void setSdPath(const QString &sdPath);
|
||||||
|
|
||||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||||
|
|
||||||
|
@ -52,7 +93,7 @@ class OpentxTaranisSimulator : public SimulatorInterface {
|
||||||
|
|
||||||
virtual const char * getPhaseName(unsigned int phase);
|
virtual const char * getPhaseName(unsigned int phase);
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps);
|
virtual void wheelEvent(int steps);
|
||||||
|
|
||||||
virtual const char * getError();
|
virtual const char * getError();
|
||||||
|
|
||||||
|
@ -63,4 +104,6 @@ class OpentxTaranisSimulator : public SimulatorInterface {
|
||||||
virtual void installTraceHook(void (*callback)(const char *));
|
virtual void installTraceHook(void (*callback)(const char *));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
15
companion/src/firmwares/th9x/simulator/CMakeLists.txt
Normal file
15
companion/src/firmwares/th9x/simulator/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
|
||||||
|
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${PROJECT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(th9x-simulator th9xsimulator.cpp)
|
|
@ -48,8 +48,6 @@ class Th9xSimulator : public SimulatorInterface {
|
||||||
|
|
||||||
virtual unsigned int getPhase() { return 0; }
|
virtual unsigned int getPhase() { return 0; }
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps) { }
|
|
||||||
|
|
||||||
virtual const char * getError();
|
virtual const char * getError();
|
||||||
|
|
||||||
protected:
|
protected:
|
|
@ -17,7 +17,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "th9xinterface.h"
|
#include "th9xinterface.h"
|
||||||
#include "th9xeeprom.h"
|
#include "th9xeeprom.h"
|
||||||
#include "th9xsimulator.h"
|
#include "simulator/th9xsimulator.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "appdata.h"
|
#include "appdata.h"
|
||||||
|
|
||||||
|
|
|
@ -897,9 +897,8 @@ CompanionIcon::CompanionIcon(const QString &baseimage)
|
||||||
|
|
||||||
void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
|
void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
|
||||||
{
|
{
|
||||||
SimulatorInterface * si = GetCurrentFirmware()->getSimulator();
|
SimulatorInterface * si = GetCurrentFirmwareSimulator();
|
||||||
if (si) {
|
if (si) {
|
||||||
delete si;
|
|
||||||
RadioData * simuData = new RadioData(radioData);
|
RadioData * simuData = new RadioData(radioData);
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
if (modelIdx >= 0) {
|
if (modelIdx >= 0) {
|
||||||
|
@ -912,9 +911,9 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
|
||||||
BoardEnum board = GetCurrentFirmware()->getBoard();
|
BoardEnum board = GetCurrentFirmware()->getBoard();
|
||||||
SimulatorDialog * sd;
|
SimulatorDialog * sd;
|
||||||
if (IS_TARANIS(board))
|
if (IS_TARANIS(board))
|
||||||
sd = new SimulatorDialogTaranis(parent, flags);
|
sd = new SimulatorDialogTaranis(parent, si, flags);
|
||||||
else
|
else
|
||||||
sd = new SimulatorDialog9X(parent, flags);
|
sd = new SimulatorDialog9X(parent, si, flags);
|
||||||
QByteArray eeprom(GetEepromInterface()->getEEpromSize(), 0);
|
QByteArray eeprom(GetEepromInterface()->getEEpromSize(), 0);
|
||||||
GetEepromInterface()->save((uint8_t *)eeprom.data(), *simuData, GetCurrentFirmware()->getCapability(SimulatorVariant));
|
GetEepromInterface()->save((uint8_t *)eeprom.data(), *simuData, GetCurrentFirmware()->getCapability(SimulatorVariant));
|
||||||
delete simuData;
|
delete simuData;
|
||||||
|
|
|
@ -3,6 +3,7 @@ set(simulation_SRCS
|
||||||
telemetrysimu.cpp
|
telemetrysimu.cpp
|
||||||
trainersimu.cpp
|
trainersimu.cpp
|
||||||
debugoutput.cpp
|
debugoutput.cpp
|
||||||
|
simulatorinterface.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(simulation_UIS
|
set(simulation_UIS
|
||||||
|
|
|
@ -11,10 +11,11 @@
|
||||||
int SimulatorDialog::screenshotIdx = 0;
|
int SimulatorDialog::screenshotIdx = 0;
|
||||||
SimulatorDialog * traceCallbackInstance = 0;
|
SimulatorDialog * traceCallbackInstance = 0;
|
||||||
|
|
||||||
void traceCb(const char * text) {
|
void traceCb(const char * text)
|
||||||
|
{
|
||||||
// divert C callback into simulator instance
|
// divert C callback into simulator instance
|
||||||
if (traceCallbackInstance) {
|
if (traceCallbackInstance) {
|
||||||
traceCallbackInstance->traceCallback(text);
|
traceCallbackInstance->traceCallback(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,13 +47,13 @@ void SimulatorDialog::updateDebugOutput()
|
||||||
traceMutex.unlock();
|
traceMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
SimulatorDialog::SimulatorDialog(QWidget * parent, unsigned int flags):
|
SimulatorDialog::SimulatorDialog(QWidget * parent, SimulatorInterface *simulator, unsigned int flags):
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
flags(flags),
|
flags(flags),
|
||||||
dialP_4(NULL),
|
dialP_4(NULL),
|
||||||
timer(NULL),
|
timer(NULL),
|
||||||
lightOn(false),
|
lightOn(false),
|
||||||
simulator(NULL),
|
simulator(simulator),
|
||||||
lastPhase(-1),
|
lastPhase(-1),
|
||||||
beepVal(0),
|
beepVal(0),
|
||||||
TelemetrySimu(0),
|
TelemetrySimu(0),
|
||||||
|
@ -72,8 +73,8 @@ SimulatorDialog::SimulatorDialog(QWidget * parent, unsigned int flags):
|
||||||
|
|
||||||
uint32_t SimulatorDialog9X::switchstatus = 0;
|
uint32_t SimulatorDialog9X::switchstatus = 0;
|
||||||
|
|
||||||
SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, unsigned int flags):
|
SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, SimulatorInterface *simulator, unsigned int flags):
|
||||||
SimulatorDialog(parent, flags),
|
SimulatorDialog(parent, simulator, flags),
|
||||||
ui(new Ui::SimulatorDialog9X),
|
ui(new Ui::SimulatorDialog9X),
|
||||||
beepShow(0)
|
beepShow(0)
|
||||||
{
|
{
|
||||||
|
@ -149,8 +150,8 @@ SimulatorDialog9X::~SimulatorDialog9X()
|
||||||
|
|
||||||
uint32_t SimulatorDialogTaranis::switchstatus = 0;
|
uint32_t SimulatorDialogTaranis::switchstatus = 0;
|
||||||
|
|
||||||
SimulatorDialogTaranis::SimulatorDialogTaranis(QWidget * parent, unsigned int flags):
|
SimulatorDialogTaranis::SimulatorDialogTaranis(QWidget * parent, SimulatorInterface *simulator, unsigned int flags):
|
||||||
SimulatorDialog(parent, flags),
|
SimulatorDialog(parent, simulator, flags),
|
||||||
ui(new Ui::SimulatorDialogTaranis)
|
ui(new Ui::SimulatorDialogTaranis)
|
||||||
{
|
{
|
||||||
lcdWidth = 212;
|
lcdWidth = 212;
|
||||||
|
@ -435,7 +436,7 @@ void SimulatorDialog::initUi(T * ui)
|
||||||
windowName = tr("Simulating Radio (%1)").arg(GetCurrentFirmware()->getName());
|
windowName = tr("Simulating Radio (%1)").arg(GetCurrentFirmware()->getName());
|
||||||
setWindowTitle(windowName);
|
setWindowTitle(windowName);
|
||||||
|
|
||||||
simulator = GetCurrentFirmware()->getSimulator();
|
simulator->setSdPath(g.profile[g.id()].sdPath());
|
||||||
lcd->setData(simulator->getLcd(), lcdWidth, 64, lcdDepth);
|
lcd->setData(simulator->getLcd(), lcdWidth, 64, lcdDepth);
|
||||||
|
|
||||||
if (flags & SIMULATOR_FLAGS_STICK_MODE_LEFT) {
|
if (flags & SIMULATOR_FLAGS_STICK_MODE_LEFT) {
|
||||||
|
@ -449,7 +450,7 @@ void SimulatorDialog::initUi(T * ui)
|
||||||
|
|
||||||
setTrims();
|
setTrims();
|
||||||
|
|
||||||
int outputs = std::min(32,GetCurrentFirmware()->getCapability(Outputs));
|
int outputs = std::min(32, GetCurrentFirmware()->getCapability(Outputs));
|
||||||
if (outputs <= 16) {
|
if (outputs <= 16) {
|
||||||
// hide second Outputs tab
|
// hide second Outputs tab
|
||||||
tabWidget->removeTab(tabWidget->indexOf(ui->outputs2));
|
tabWidget->removeTab(tabWidget->indexOf(ui->outputs2));
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "modeledit/node.h"
|
#include "modeledit/node.h"
|
||||||
#include "eeprominterface.h"
|
|
||||||
#include "telemetrysimu.h"
|
#include "telemetrysimu.h"
|
||||||
#include "trainersimu.h"
|
#include "trainersimu.h"
|
||||||
#include "debugoutput.h"
|
#include "debugoutput.h"
|
||||||
|
@ -36,7 +35,7 @@ class SimulatorDialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SimulatorDialog(QWidget * parent = NULL, unsigned int flags=0);
|
explicit SimulatorDialog(QWidget * parent, SimulatorInterface *simulator, unsigned int flags=0);
|
||||||
virtual ~SimulatorDialog();
|
virtual ~SimulatorDialog();
|
||||||
|
|
||||||
void start(const char * filename);
|
void start(const char * filename);
|
||||||
|
@ -87,9 +86,7 @@ class SimulatorDialog : public QDialog
|
||||||
virtual void getValues() = 0;
|
virtual void getValues() = 0;
|
||||||
void setValues();
|
void setValues();
|
||||||
void centerSticks();
|
void centerSticks();
|
||||||
// void timerTick();
|
|
||||||
|
|
||||||
bool keyState(EnumKeys key);
|
|
||||||
int getValue(qint8 i);
|
int getValue(qint8 i);
|
||||||
bool getSwitch(int swtch, bool nc, qint8 level=0);
|
bool getSwitch(int swtch, bool nc, qint8 level=0);
|
||||||
void setTrims();
|
void setTrims();
|
||||||
|
@ -153,7 +150,7 @@ class SimulatorDialog9X: public SimulatorDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SimulatorDialog9X(QWidget * parent = NULL, unsigned int flags=0);
|
explicit SimulatorDialog9X(QWidget * parent, SimulatorInterface *simulator, unsigned int flags=0);
|
||||||
virtual ~SimulatorDialog9X();
|
virtual ~SimulatorDialog9X();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -178,7 +175,7 @@ class SimulatorDialogTaranis: public SimulatorDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SimulatorDialogTaranis(QWidget * parent = NULL, unsigned int flags=0);
|
explicit SimulatorDialogTaranis(QWidget * parent, SimulatorInterface *simulator, unsigned int flags=0);
|
||||||
virtual ~SimulatorDialogTaranis();
|
virtual ~SimulatorDialogTaranis();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -58,7 +58,8 @@ if (inputs.rotenc) simuSetKey(KEY_ENTER, true);
|
||||||
#ifdef GETVALUES_IMPORT
|
#ifdef GETVALUES_IMPORT
|
||||||
#undef GETVALUES_IMPORT
|
#undef GETVALUES_IMPORT
|
||||||
memset(outputs.chans, 0, sizeof(outputs.chans));
|
memset(outputs.chans, 0, sizeof(outputs.chans));
|
||||||
memcpy(outputs.chans, g_chans512, sizeof(g_chans512));
|
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<NUM_LOGICAL_SWITCH; i++)
|
||||||
#if defined(BOLD_FONT)
|
#if defined(BOLD_FONT)
|
||||||
outputs.vsw[i] = getSwitch(SWSRC_SW1+i);
|
outputs.vsw[i] = getSwitch(SWSRC_SW1+i);
|
||||||
|
|
61
companion/src/simulation/simulatorinterface.cpp
Normal file
61
companion/src/simulation/simulatorinterface.cpp
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
#include "simulatorinterface.h"
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QLibrary>
|
||||||
|
#include <QMap>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
QMap<QString, SimulatorFactory *> registered_simulators;
|
||||||
|
|
||||||
|
void registerSimulatorFactory(SimulatorFactory *factory)
|
||||||
|
{
|
||||||
|
qDebug() << "registering" << factory->name() << "simulator";
|
||||||
|
registered_simulators[factory->name()] = factory;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerSimulator(const QString &filename)
|
||||||
|
{
|
||||||
|
QLibrary lib(filename);
|
||||||
|
typedef SimulatorFactory * (*RegisterSimulator)();
|
||||||
|
RegisterSimulator registerSimulator = (RegisterSimulator)lib.resolve("registerSimu");
|
||||||
|
if (registerSimulator) {
|
||||||
|
SimulatorFactory *factory = registerSimulator();
|
||||||
|
registerSimulatorFactory(factory);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qWarning() << "Library error" << filename << lib.errorString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerSimulators()
|
||||||
|
{
|
||||||
|
QDir dir(".");
|
||||||
|
QStringList filters;
|
||||||
|
#if !defined __GNUC__
|
||||||
|
filters << "*-simulator.dll";
|
||||||
|
#else
|
||||||
|
filters << "*-simulator.so";
|
||||||
|
#endif
|
||||||
|
foreach(QString filename, dir.entryList(filters, QDir::Files)) {
|
||||||
|
registerSimulator(filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SimulatorFactory *getSimulatorFactory(const QString &name)
|
||||||
|
{
|
||||||
|
QString simuName = name;
|
||||||
|
while(1) {
|
||||||
|
qDebug() << "searching" << simuName << "simulator";
|
||||||
|
if (registered_simulators.contains(simuName)) {
|
||||||
|
return registered_simulators[simuName];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
int pos = simuName.lastIndexOf('-');
|
||||||
|
if (pos <= 0)
|
||||||
|
break;
|
||||||
|
simuName = simuName.mid(0, pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
|
@ -17,9 +17,23 @@
|
||||||
#ifndef simulator_interface_h
|
#ifndef simulator_interface_h
|
||||||
#define simulator_interface_h
|
#define simulator_interface_h
|
||||||
|
|
||||||
#include "eeprominterface.h"
|
#include "constants.h"
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <QString>
|
||||||
|
#include <QByteArray>
|
||||||
|
#include <QMap>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
struct TxInputs {
|
#if __GNUC__
|
||||||
|
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
|
||||||
|
#else
|
||||||
|
#include "../targets/windows/winbuild.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<class t> t LIMIT(t mi, t x, t ma) { return std::min(std::max(mi, x), ma); }
|
||||||
|
|
||||||
|
struct TxInputs
|
||||||
|
{
|
||||||
int sticks[NUM_STICKS]; /* lh lv rv rh */
|
int sticks[NUM_STICKS]; /* lh lv rv rh */
|
||||||
int pots[C9X_NUM_POTS];
|
int pots[C9X_NUM_POTS];
|
||||||
int switches[C9X_NUM_SWITCHES];
|
int switches[C9X_NUM_SWITCHES];
|
||||||
|
@ -28,33 +42,34 @@ struct TxInputs {
|
||||||
bool trims[8];
|
bool trims[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
class TxOutputs {
|
class TxOutputs
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
TxOutputs() {
|
TxOutputs() { memset(this, 0, sizeof(TxOutputs)); }
|
||||||
memset(this, 0, sizeof(TxOutputs));
|
int chans[C9X_NUM_CHNOUT];
|
||||||
}
|
|
||||||
|
|
||||||
int16_t chans[C9X_NUM_CHNOUT];
|
|
||||||
bool vsw[C9X_NUM_CSW];
|
bool vsw[C9X_NUM_CSW];
|
||||||
int16_t gvars[C9X_MAX_FLIGHT_MODES][C9X_MAX_GVARS];
|
int gvars[C9X_MAX_FLIGHT_MODES][C9X_MAX_GVARS];
|
||||||
unsigned int beep;
|
unsigned int beep;
|
||||||
// uint8_t phase;
|
// uint8_t phase;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Trims {
|
struct Trims
|
||||||
int16_t values[NUM_STICKS]; /* lh lv rv rh */
|
{
|
||||||
bool extended;
|
int values[NUM_STICKS]; /* lh lv rv rh */
|
||||||
|
bool extended;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SimulatorInterface {
|
class SimulatorInterface
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~SimulatorInterface() {};
|
virtual ~SimulatorInterface() {};
|
||||||
|
|
||||||
virtual void start(QByteArray & eeprom, bool tests=true) = 0;
|
virtual void setSdPath(const QString &sdPath) { };
|
||||||
|
|
||||||
virtual void start(const char * filename, bool tests=true) = 0;
|
virtual void start(QByteArray &eeprom, bool tests=true) = 0;
|
||||||
|
|
||||||
|
virtual void start(const char *filename, bool tests=true) = 0;
|
||||||
|
|
||||||
virtual void stop() = 0;
|
virtual void stop() = 0;
|
||||||
|
|
||||||
|
@ -62,7 +77,7 @@ class SimulatorInterface {
|
||||||
|
|
||||||
virtual uint8_t * getLcd() = 0;
|
virtual uint8_t * getLcd() = 0;
|
||||||
|
|
||||||
virtual bool lcdChanged(bool & lightEnable) = 0;
|
virtual bool lcdChanged(bool &lightEnable) = 0;
|
||||||
|
|
||||||
virtual void setValues(TxInputs &inputs) = 0;
|
virtual void setValues(TxInputs &inputs) = 0;
|
||||||
|
|
||||||
|
@ -70,13 +85,13 @@ class SimulatorInterface {
|
||||||
|
|
||||||
virtual void setTrim(unsigned int idx, int value) = 0;
|
virtual void setTrim(unsigned int idx, int value) = 0;
|
||||||
|
|
||||||
virtual void getTrims(Trims & trims) = 0;
|
virtual void getTrims(Trims &trims) = 0;
|
||||||
|
|
||||||
virtual unsigned int getPhase() = 0;
|
virtual unsigned int getPhase() = 0;
|
||||||
|
|
||||||
virtual const char * getPhaseName(unsigned int phase) = 0;
|
virtual const char * getPhaseName(unsigned int phase) = 0;
|
||||||
|
|
||||||
virtual void wheelEvent(uint8_t steps) = 0;
|
virtual void wheelEvent(int steps) { };
|
||||||
|
|
||||||
virtual const char * getError() = 0;
|
virtual const char * getError() = 0;
|
||||||
|
|
||||||
|
@ -87,4 +102,21 @@ class SimulatorInterface {
|
||||||
virtual void installTraceHook(void (*callback)(const char *)) = 0;
|
virtual void installTraceHook(void (*callback)(const char *)) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class SimulatorFactory {
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual ~SimulatorFactory() { }
|
||||||
|
|
||||||
|
virtual QString name() = 0;
|
||||||
|
|
||||||
|
virtual BoardEnum type() = 0;
|
||||||
|
|
||||||
|
virtual SimulatorInterface *create() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
void registerSimulators();
|
||||||
|
SimulatorFactory *getSimulatorFactory(const QString &name);
|
||||||
|
extern QMap<QString, SimulatorFactory *> registered_simulators;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "telemetrysimu.h"
|
#include "telemetrysimu.h"
|
||||||
#include "ui_telemetrysimu.h"
|
#include "ui_telemetrysimu.h"
|
||||||
|
#include "simulatorinterface.h"
|
||||||
#include "radio/src/telemetry/frsky.h"
|
#include "radio/src/telemetry/frsky.h"
|
||||||
|
|
||||||
TelemetrySimulator::TelemetrySimulator(QWidget * parent, SimulatorInterface * simulator):
|
TelemetrySimulator::TelemetrySimulator(QWidget * parent, SimulatorInterface * simulator):
|
||||||
|
@ -90,4 +91,4 @@ void TelemetrySimulator::generateTelemetryFrame()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
simulator->sendTelemetry(buffer, 9);
|
simulator->sendTelemetry(buffer, 9);
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,26 +98,26 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||||
|
|
||||||
registerEEpromInterfaces();
|
|
||||||
registerOpenTxFirmwares();
|
|
||||||
|
|
||||||
SimulatorDialog *dialog;
|
SimulatorDialog *dialog;
|
||||||
const char * eepromFileName;
|
QString eepromFileName;
|
||||||
QString fileName;
|
|
||||||
QByteArray path;
|
|
||||||
QDir eedir;
|
QDir eedir;
|
||||||
QFile file;
|
QFile file;
|
||||||
|
|
||||||
|
registerSimulators();
|
||||||
|
registerOpenTxFirmwares();
|
||||||
|
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setWindowTitle("Radio type");
|
msgBox.setWindowTitle("Radio type");
|
||||||
msgBox.setText("Which radio type do you want to simulate?");
|
msgBox.setText("Which radio type do you want to simulate?");
|
||||||
msgBox.setIcon(QMessageBox::Question);
|
msgBox.setIcon(QMessageBox::Question);
|
||||||
QAbstractButton *taranisButton = msgBox.addButton("Taranis", QMessageBox::ActionRole);
|
|
||||||
QAbstractButton *x9eButton = msgBox.addButton("Taranis X9E", QMessageBox::ActionRole);
|
foreach(SimulatorFactory *factory, registered_simulators) {
|
||||||
QAbstractButton *sky9xButton = msgBox.addButton("9X-Sky9X", QMessageBox::ActionRole);
|
QPushButton *button = msgBox.addButton(factory->name(), QMessageBox::ActionRole);
|
||||||
QAbstractButton *gruvinButton = msgBox.addButton("9X-Gruvin9X", QMessageBox::ActionRole);
|
button->adjustSize();
|
||||||
QAbstractButton *proButton = msgBox.addButton("9XR-Pro", QMessageBox::ActionRole);
|
button->setProperty("name", factory->name());
|
||||||
msgBox.addButton("9X-M128", QMessageBox::ActionRole);
|
}
|
||||||
|
msgBox.adjustSize();
|
||||||
|
|
||||||
QPushButton *exitButton = msgBox.addButton(QMessageBox::Close);
|
QPushButton *exitButton = msgBox.addButton(QMessageBox::Close);
|
||||||
|
|
||||||
eedir = QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation));
|
eedir = QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation));
|
||||||
|
@ -128,53 +128,32 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
|
|
||||||
if (msgBox.clickedButton() == exitButton)
|
QAbstractButton *button = msgBox.clickedButton();
|
||||||
|
if (button == exitButton) {
|
||||||
return 0;
|
return 0;
|
||||||
else if (msgBox.clickedButton() == taranisButton) {
|
|
||||||
current_firmware_variant = GetFirmware("opentx-taranis-haptic-lua-en");
|
|
||||||
fileName = eedir.filePath("eeprom-taranis.bin");
|
|
||||||
path = fileName.toAscii();
|
|
||||||
eepromFileName = path.data();
|
|
||||||
dialog = new SimulatorDialogTaranis();
|
|
||||||
}
|
|
||||||
else if (msgBox.clickedButton() == x9eButton) {
|
|
||||||
current_firmware_variant = GetFirmware("opentx-taranisx9e-mixersmon-lua-haptic-en");
|
|
||||||
fileName = eedir.filePath("eeprom-x9e.bin");
|
|
||||||
path = fileName.toAscii();
|
|
||||||
eepromFileName = path.data();
|
|
||||||
dialog = new SimulatorDialogTaranis();
|
|
||||||
}
|
|
||||||
else if (msgBox.clickedButton() == sky9xButton) {
|
|
||||||
current_firmware_variant = GetFirmware("opentx-sky9x-heli-templates-ppmca-gvars-symlimits-autosource-autoswitch-battgraph-bluetooth-en");
|
|
||||||
fileName = eedir.filePath("eeprom-sky9x.bin");
|
|
||||||
path = fileName.toAscii();
|
|
||||||
eepromFileName = path.data();
|
|
||||||
dialog = new SimulatorDialog9X();
|
|
||||||
}
|
|
||||||
else if (msgBox.clickedButton() == gruvinButton) {
|
|
||||||
current_firmware_variant = GetFirmware("opentx-gruvin9x-heli-templates-sdcard-voice-DSM2PPM-ppmca-gvars-symlimits-autosource-autoswitch-battgraph-ttsen-en");
|
|
||||||
fileName = eedir.filePath("eeprom-gruvin9x.bin");
|
|
||||||
path = fileName.toAscii();
|
|
||||||
eepromFileName = path.data();
|
|
||||||
dialog = new SimulatorDialog9X();
|
|
||||||
}
|
|
||||||
else if (msgBox.clickedButton() == proButton) {
|
|
||||||
current_firmware_variant = GetFirmware("opentx-9xrpro-heli-templates-ppmca-gvars-symlimits-autosource-autoswitch-battgraph-en");
|
|
||||||
fileName = eedir.filePath("eeprom-9xrpro.bin");
|
|
||||||
path = fileName.toAscii();
|
|
||||||
eepromFileName = path.data();
|
|
||||||
dialog = new SimulatorDialog9X();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
current_firmware_variant = GetFirmware("opentx-9x128-frsky-heli-templates-audio-voice-haptic-DSM2-ppmca-gvars-symlimits-autosource-autoswitch-battgraph-thrtrace-en");
|
QString firmwareId = button->property("name").toString();
|
||||||
fileName = eedir.filePath("eeprom-9x128.bin");
|
QString radioId;
|
||||||
path = fileName.toAscii();
|
int pos = firmwareId.indexOf("-");
|
||||||
eepromFileName = path.data();
|
if (pos > 0) {
|
||||||
dialog = new SimulatorDialog9X();
|
radioId = firmwareId.mid(pos+1);
|
||||||
|
pos = radioId.lastIndexOf("-");
|
||||||
|
if (pos > 0) {
|
||||||
|
radioId = radioId.mid(0, pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
current_firmware_variant = GetFirmware(firmwareId);
|
||||||
|
eepromFileName = QString("eeprom-%1.bin").arg(radioId);
|
||||||
|
SimulatorFactory *factory = getSimulatorFactory(firmwareId);
|
||||||
|
if (factory->type() == BOARD_TARANIS)
|
||||||
|
dialog = new SimulatorDialogTaranis(NULL, factory->create());
|
||||||
|
else
|
||||||
|
dialog = new SimulatorDialog9X(NULL, factory->create());
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog->show();
|
dialog->show();
|
||||||
dialog->start(eepromFileName);
|
dialog->start(eepromFileName.toAscii().constData());
|
||||||
|
|
||||||
int result = app.exec();
|
int result = app.exec();
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ Section "OpenTX Companion" SecDummy
|
||||||
File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt"
|
File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt"
|
||||||
File "Release\companion.exe"
|
File "Release\companion.exe"
|
||||||
File "Release\simulator.exe"
|
File "Release\simulator.exe"
|
||||||
|
File "Release\opentx-*-simulator.dll"
|
||||||
${!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
|
||||||
File "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll"
|
File "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll"
|
||||||
|
@ -187,6 +188,7 @@ Section "Uninstall"
|
||||||
Delete "$INSTDIR\license.txt"
|
Delete "$INSTDIR\license.txt"
|
||||||
Delete "$INSTDIR\companion.exe"
|
Delete "$INSTDIR\companion.exe"
|
||||||
Delete "$INSTDIR\simulator.exe"
|
Delete "$INSTDIR\simulator.exe"
|
||||||
|
Delete "$INSTDIR\opentx-*-simulator.dll"
|
||||||
Delete "$INSTDIR\pthreadVC2.dll"
|
Delete "$INSTDIR\pthreadVC2.dll"
|
||||||
Delete "$INSTDIR\xerces-c_3_1.dll"
|
Delete "$INSTDIR\xerces-c_3_1.dll"
|
||||||
Delete "$INSTDIR\SDL.dll"
|
Delete "$INSTDIR\SDL.dll"
|
||||||
|
|
|
@ -98,6 +98,8 @@ Section "OpenTX Simulator" SecDummy
|
||||||
|
|
||||||
File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt"
|
File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt"
|
||||||
File "Release\simulator.exe"
|
File "Release\simulator.exe"
|
||||||
|
File "Release\opentx-*-simulator.dll"
|
||||||
|
|
||||||
${!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
|
||||||
File "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll"
|
File "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll"
|
||||||
|
@ -181,6 +183,7 @@ Section "Uninstall"
|
||||||
Delete "$INSTDIR\Phonon4.dll"
|
Delete "$INSTDIR\Phonon4.dll"
|
||||||
Delete "$INSTDIR\Uninstall.exe"
|
Delete "$INSTDIR\Uninstall.exe"
|
||||||
Delete "$INSTDIR\lang\*.*"
|
Delete "$INSTDIR\lang\*.*"
|
||||||
|
Delete "$INSTDIR\opentx-*-simulator.dll"
|
||||||
|
|
||||||
RMDir "$INSTDIR\lang"
|
RMDir "$INSTDIR\lang"
|
||||||
RMDir "$INSTDIR"
|
RMDir "$INSTDIR"
|
||||||
|
|
|
@ -370,6 +370,10 @@ FONT2PNG = -$(PYTHON) ../util/font2png.py
|
||||||
TRANSLATE = -$(PYTHON) ../util/translate.py
|
TRANSLATE = -$(PYTHON) ../util/translate.py
|
||||||
VERSION = 2.0.99
|
VERSION = 2.0.99
|
||||||
|
|
||||||
|
THIRDPARTY = thirdparty
|
||||||
|
COOSDIR = $(THIRDPARTY)/CoOS
|
||||||
|
FATFSDIR = $(THIRDPARTY)/FatFs
|
||||||
|
|
||||||
SRC =
|
SRC =
|
||||||
CPPSRC =
|
CPPSRC =
|
||||||
INCDIRS = . translations
|
INCDIRS = . translations
|
||||||
|
@ -615,7 +619,7 @@ ifeq ($(PCB), GRUVIN9X)
|
||||||
SDCARD = NO
|
SDCARD = NO
|
||||||
BUZZER = NO
|
BUZZER = NO
|
||||||
THR_TRACE = YES
|
THR_TRACE = YES
|
||||||
INCDIRS += targets/gruvin9x targets/stock FatFs FatFs/option
|
INCDIRS += targets/gruvin9x targets/stock $(FATFSDIR) $(FATFSDIR)/option
|
||||||
BOARDSRC = main_avr.cpp targets/gruvin9x/board_gruvin9x.cpp
|
BOARDSRC = main_avr.cpp targets/gruvin9x/board_gruvin9x.cpp
|
||||||
EXTRABOARDSRC = targets/stock/lcd_driver.cpp targets/common_avr/telemetry_driver.cpp
|
EXTRABOARDSRC = targets/stock/lcd_driver.cpp targets/common_avr/telemetry_driver.cpp
|
||||||
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
|
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
|
||||||
|
@ -628,7 +632,7 @@ ifeq ($(PCB), GRUVIN9X)
|
||||||
CPPDEFS += -DRTCLOCK -DSDCARD
|
CPPDEFS += -DRTCLOCK -DSDCARD
|
||||||
CPPSRC += rtc.cpp sdcard.cpp logs.cpp targets/gruvin9x/rtc_driver.cpp
|
CPPSRC += rtc.cpp sdcard.cpp logs.cpp targets/gruvin9x/rtc_driver.cpp
|
||||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_sdmanager.cpp
|
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_sdmanager.cpp
|
||||||
EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/gruvin9x/diskio.cpp
|
EXTRABOARDSRC += $(FATFSDIR)/ff.c $(FATFSDIR)/fattime.c $(FATFSDIR)/option/ccsbcs.c targets/gruvin9x/diskio.cpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BUZZER), YES)
|
ifeq ($(BUZZER), YES)
|
||||||
|
@ -660,7 +664,7 @@ ifeq ($(PCB), MEGA2560)
|
||||||
SDCARD = NO
|
SDCARD = NO
|
||||||
BUZZER = YES
|
BUZZER = YES
|
||||||
THR_TRACE = YES
|
THR_TRACE = YES
|
||||||
INCDIRS += targets/mega2560 targets/stock FatFs FatFs/option
|
INCDIRS += targets/mega2560 targets/stock $(FATFSDIR) $(FATFSDIR)/option
|
||||||
BOARDSRC = main_avr.cpp targets/mega2560/board_mega2560.cpp
|
BOARDSRC = main_avr.cpp targets/mega2560/board_mega2560.cpp
|
||||||
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
|
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
|
||||||
PULSESSRC = pulses/pulses_avr.cpp
|
PULSESSRC = pulses/pulses_avr.cpp
|
||||||
|
@ -675,7 +679,7 @@ ifeq ($(PCB), MEGA2560)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(SDCARD), YES)
|
ifeq ($(SDCARD), YES)
|
||||||
EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/gruvin9x/diskio.cpp
|
EXTRABOARDSRC += $(FATFSDIR)/ff.c $(FATFSDIR)/fattime.c $(FATFSDIR)/option/ccsbcs.c targets/gruvin9x/diskio.cpp
|
||||||
CPPDEFS += -DSDCARD -DRTCLOCK
|
CPPDEFS += -DSDCARD -DRTCLOCK
|
||||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_sdmanager.cpp
|
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_sdmanager.cpp
|
||||||
CPPSRC += rtc.cpp sdcard.cpp logs.cpp targets/gruvin9x/rtc_driver.cpp
|
CPPSRC += rtc.cpp sdcard.cpp logs.cpp targets/gruvin9x/rtc_driver.cpp
|
||||||
|
@ -736,12 +740,12 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO))
|
||||||
ifeq ($(SPORT_FILE_LOG), YES)
|
ifeq ($(SPORT_FILE_LOG), YES)
|
||||||
CPPDEFS += -DSPORT_FILE_LOG
|
CPPDEFS += -DSPORT_FILE_LOG
|
||||||
endif
|
endif
|
||||||
INCDIRS += targets/sky9x CoOS CoOS/kernel CoOS/portable
|
INCDIRS += targets/sky9x $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_hardware.cpp gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
|
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_hardware.cpp gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
|
||||||
BOARDSRC = main_arm.cpp targets/sky9x/board_sky9x.cpp
|
BOARDSRC = main_arm.cpp targets/sky9x/board_sky9x.cpp
|
||||||
EXTRABOARDSRC = targets/sky9x/lcd_driver.cpp
|
EXTRABOARDSRC = targets/sky9x/lcd_driver.cpp
|
||||||
SRC += targets/sky9x/core_cm3.c targets/sky9x/board_lowlevel.c targets/sky9x/crt.c targets/sky9x/vectors_sam3s.c
|
SRC += targets/sky9x/core_cm3.c targets/sky9x/board_lowlevel.c targets/sky9x/crt.c targets/sky9x/vectors_sam3s.c
|
||||||
SRC += CoOS/kernel/core.c CoOS/kernel/hook.c CoOS/kernel/task.c CoOS/kernel/event.c CoOS/kernel/time.c CoOS/kernel/timer.c CoOS/kernel/flag.c CoOS/kernel/mutex.c CoOS/kernel/serviceReq.c CoOS/portable/GCC/port.c CoOS/portable/arch.c
|
SRC += $(COOSDIR)/kernel/core.c $(COOSDIR)/kernel/hook.c $(COOSDIR)/kernel/task.c $(COOSDIR)/kernel/event.c $(COOSDIR)/kernel/time.c $(COOSDIR)/kernel/timer.c $(COOSDIR)/kernel/flag.c $(COOSDIR)/kernel/mutex.c $(COOSDIR)/kernel/serviceReq.c $(COOSDIR)/portable/GCC/port.c $(COOSDIR)/portable/arch.c
|
||||||
SRC += targets/sky9x/usb/device/core/USBD_UDP.c targets/sky9x/usb/device/core/USBDDriver.c
|
SRC += targets/sky9x/usb/device/core/USBD_UDP.c targets/sky9x/usb/device/core/USBDDriver.c
|
||||||
SRC += targets/sky9x/usb/device/massstorage/MSDDriver.c targets/sky9x/usb/device/massstorage/MSDDStateMachine.c targets/sky9x/usb/device/massstorage/MSDLun.c targets/sky9x/usb/device/massstorage/MSDDriverDescriptors.c targets/sky9x/usb/device/massstorage/SBCMethods.c
|
SRC += targets/sky9x/usb/device/massstorage/MSDDriver.c targets/sky9x/usb/device/massstorage/MSDDStateMachine.c targets/sky9x/usb/device/massstorage/MSDLun.c targets/sky9x/usb/device/massstorage/MSDDriverDescriptors.c targets/sky9x/usb/device/massstorage/SBCMethods.c
|
||||||
SRC += targets/sky9x/usb/common/core/USBEndpointDescriptor.c targets/sky9x/usb/common/core/USBGenericRequest.c targets/sky9x/usb/common/core/USBFeatureRequest.c targets/sky9x/usb/common/core/USBInterfaceRequest.c targets/sky9x/usb/common/core/USBGetDescriptorRequest.c targets/sky9x/usb/common/core/USBSetAddressRequest.c targets/sky9x/usb/common/core/USBSetConfigurationRequest.c targets/sky9x/usb/common/core/USBConfigurationDescriptor.c targets/sky9x/usb/common/core/USBGenericDescriptor.c
|
SRC += targets/sky9x/usb/common/core/USBEndpointDescriptor.c targets/sky9x/usb/common/core/USBGenericRequest.c targets/sky9x/usb/common/core/USBFeatureRequest.c targets/sky9x/usb/common/core/USBInterfaceRequest.c targets/sky9x/usb/common/core/USBGetDescriptorRequest.c targets/sky9x/usb/common/core/USBSetAddressRequest.c targets/sky9x/usb/common/core/USBSetConfigurationRequest.c targets/sky9x/usb/common/core/USBConfigurationDescriptor.c targets/sky9x/usb/common/core/USBGenericDescriptor.c
|
||||||
|
@ -754,10 +758,10 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO))
|
||||||
BITMAPS += bitmaps/9X/splash.lbm bitmaps/9X/asterisk.lbm bitmaps/9X/about.lbm
|
BITMAPS += bitmaps/9X/splash.lbm bitmaps/9X/asterisk.lbm bitmaps/9X/about.lbm
|
||||||
ifeq ($(SDCARD), YES)
|
ifeq ($(SDCARD), YES)
|
||||||
CPPDEFS += -DSDCARD -DVOICE
|
CPPDEFS += -DSDCARD -DVOICE
|
||||||
INCDIRS += FatFs FatFs/option
|
INCDIRS += $(FATFSDIR) $(FATFSDIR)/option
|
||||||
CPPSRC += sdcard.cpp logs.cpp
|
CPPSRC += sdcard.cpp logs.cpp
|
||||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_sdmanager.cpp
|
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_sdmanager.cpp
|
||||||
EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/sky9x/diskio.cpp
|
EXTRABOARDSRC += $(FATFSDIR)/ff.c $(FATFSDIR)/fattime.c $(FATFSDIR)/option/ccsbcs.c targets/sky9x/diskio.cpp
|
||||||
endif
|
endif
|
||||||
ifeq ($(BUZZER), YES)
|
ifeq ($(BUZZER), YES)
|
||||||
CPPDEFS += -DBUZZER
|
CPPDEFS += -DBUZZER
|
||||||
|
@ -845,21 +849,24 @@ ifeq ($(PCB), TARANIS)
|
||||||
PPM_CENTER_ADJUSTABLE = YES
|
PPM_CENTER_ADJUSTABLE = YES
|
||||||
DSM2 = PPM
|
DSM2 = PPM
|
||||||
CPPDEFS += -DPCBTARANIS -DCPUARM -DCPUSTM32 -DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DEEPROM_VARIANT=0 -DAUDIO -DPXX
|
CPPDEFS += -DPCBTARANIS -DCPUARM -DCPUSTM32 -DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DEEPROM_VARIANT=0 -DAUDIO -DPXX
|
||||||
INCDIRS += targets/taranis CoOS CoOS/kernel CoOS/portable
|
INCDIRS += targets/taranis $(THIRDPARTY) $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||||
ifeq ($(PCBREV), REV9E)
|
ifeq ($(PCBREV), REV9E)
|
||||||
|
STM32LIBPATH = $(THIRDPARTY)/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries
|
||||||
CPPDEFS += -DHSE_VALUE=16800000
|
CPPDEFS += -DHSE_VALUE=16800000
|
||||||
CPPDEFS += -DSTM32F40_41xxx
|
CPPDEFS += -DSTM32F40_41xxx
|
||||||
EXTRAINCDIRS += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Include targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc
|
EXTRAINCDIRS += $(STM32LIBPATH)/CMSIS/Device/ST/STM32F4xx/Include $(STM32LIBPATH)/CMSIS/Include $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/inc
|
||||||
else
|
else
|
||||||
|
STM32LIBPATH= $(THIRDPARTY)/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries
|
||||||
CPPDEFS += -DHSE_VALUE=12000000
|
CPPDEFS += -DHSE_VALUE=12000000
|
||||||
EXTRAINCDIRS += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/include
|
EXTRAINCDIRS += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/inc $(STM32LIBPATH)/CMSIS/Device/ST/STM32F2xx/Include $(STM32LIBPATH)/CMSIS/include
|
||||||
endif
|
endif
|
||||||
EXTRAINCDIRS += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc
|
STM32USBPATH = $(THIRDPARTY)/STM32_USB-Host-Device_Lib_V2.1.0/Libraries
|
||||||
EXTRAINCDIRS += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc
|
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_OTG_Driver/inc $(STM32USBPATH)/STM32_USB_Device_Library/Core/inc
|
||||||
|
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/inc $(STM32USBPATH)/STM32_USB_Device_Library/Class/hid/inc
|
||||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_hardware.cpp
|
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_hardware.cpp
|
||||||
BOARDSRC = main_arm.cpp targets/taranis/board_taranis.cpp
|
BOARDSRC = main_arm.cpp targets/taranis/board_taranis.cpp
|
||||||
EXTRABOARDSRC += targets/taranis/configure_pins.cpp targets/taranis/lcd_driver.cpp targets/taranis/flash_driver.cpp targets/taranis/aspi.c targets/taranis/i2c.c targets/taranis/delays.c
|
EXTRABOARDSRC += targets/taranis/configure_pins.cpp targets/taranis/lcd_driver.cpp targets/taranis/flash_driver.cpp targets/taranis/aspi.c targets/taranis/i2c.c targets/taranis/delays.c
|
||||||
SRC += CoOS/kernel/core.c CoOS/kernel/hook.c CoOS/kernel/task.c CoOS/kernel/event.c CoOS/kernel/time.c CoOS/kernel/timer.c CoOS/kernel/flag.c CoOS/kernel/mutex.c CoOS/kernel/serviceReq.c CoOS/portable/GCC/port.c CoOS/portable/arch.c
|
SRC += $(COOSDIR)/kernel/core.c $(COOSDIR)/kernel/hook.c $(COOSDIR)/kernel/task.c $(COOSDIR)/kernel/event.c $(COOSDIR)/kernel/time.c $(COOSDIR)/kernel/timer.c $(COOSDIR)/kernel/flag.c $(COOSDIR)/kernel/mutex.c $(COOSDIR)/kernel/serviceReq.c $(COOSDIR)/portable/GCC/port.c $(COOSDIR)/portable/arch.c
|
||||||
SRC += targets/taranis/pwr_driver.c targets/taranis/usb_driver.c
|
SRC += targets/taranis/pwr_driver.c targets/taranis/usb_driver.c
|
||||||
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp eeprom_conversions.cpp
|
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp eeprom_conversions.cpp
|
||||||
PULSESSRC = pulses/pulses_arm.cpp pulses/ppm_arm.cpp pulses/pxx_arm.cpp
|
PULSESSRC = pulses/pulses_arm.cpp pulses/ppm_arm.cpp pulses/pxx_arm.cpp
|
||||||
|
@ -868,37 +875,37 @@ ifeq ($(PCB), TARANIS)
|
||||||
CPPSRC += bmp.cpp gui/$(GUIDIRECTORY)/view_channels.cpp gui/$(GUIDIRECTORY)/view_about.cpp gui/$(GUIDIRECTORY)/view_text.cpp loadboot.cpp debug.cpp
|
CPPSRC += bmp.cpp gui/$(GUIDIRECTORY)/view_channels.cpp gui/$(GUIDIRECTORY)/view_about.cpp gui/$(GUIDIRECTORY)/view_text.cpp loadboot.cpp debug.cpp
|
||||||
ifeq ($(PCBREV), REV9E)
|
ifeq ($(PCBREV), REV9E)
|
||||||
EXTRABOARDSRC += targets/taranis/top_lcd_driver.cpp
|
EXTRABOARDSRC += targets/taranis/top_lcd_driver.cpp
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
|
SRC += $(STM32LIBPATH)/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/misc.c
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/misc.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
|
||||||
SRC += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f40_41xxx.s
|
SRC += $(STM32LIBPATH)/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f40_41xxx.s
|
||||||
else
|
else
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c
|
SRC += $(STM32LIBPATH)/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/misc.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dbgmcu.c
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dbgmcu.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c
|
||||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
SRC += $(STM32LIBPATH)/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
||||||
endif
|
endif
|
||||||
SRC += targets/taranis/usb_bsp.c targets/taranis/usbd_desc.c
|
SRC += targets/taranis/usb_bsp.c targets/taranis/usbd_desc.c
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c
|
SRC += $(STM32USBPATH)/STM32_USB_OTG_Driver/src/usb_core.c
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c
|
SRC += $(STM32USBPATH)/STM32_USB_OTG_Driver/src/usb_dcd.c
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c
|
SRC += $(STM32USBPATH)/STM32_USB_OTG_Driver/src/usb_dcd_int.c
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Core/src/usbd_core.c
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Core/src/usbd_ioreq.c
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Core/src/usbd_req.c
|
||||||
EXTRABOARDSRC += targets/taranis/usbd_usr.cpp
|
EXTRABOARDSRC += targets/taranis/usbd_usr.cpp
|
||||||
SRC += targets/sky9x/syscalls.c
|
SRC += targets/sky9x/syscalls.c
|
||||||
ifeq ($(USB), JOYSTICK)
|
ifeq ($(USB), JOYSTICK)
|
||||||
|
@ -906,10 +913,10 @@ ifeq ($(PCB), TARANIS)
|
||||||
SRC += targets/taranis/usbd_hid_joystick.c
|
SRC += targets/taranis/usbd_hid_joystick.c
|
||||||
else
|
else
|
||||||
CPPDEFS += -DUSB_MASS_STORAGE
|
CPPDEFS += -DUSB_MASS_STORAGE
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
|
||||||
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
|
||||||
EXTRABOARDSRC += targets/taranis/usbd_storage_msd.cpp
|
EXTRABOARDSRC += targets/taranis/usbd_storage_msd.cpp
|
||||||
endif
|
endif
|
||||||
ifeq ($(NANO), YES)
|
ifeq ($(NANO), YES)
|
||||||
|
@ -932,17 +939,17 @@ ifeq ($(PCB), TARANIS)
|
||||||
lua/src/lobject.c lua/src/lopcodes.c lua/src/lparser.c lua/src/lstate.c lua/src/lstring.c lua/src/ltable.c lua/src/lrotable.c lua/src/ltm.c lua/src/lundump.c lua/src/lvm.c lua/src/lzio.c \
|
lua/src/lobject.c lua/src/lopcodes.c lua/src/lparser.c lua/src/lstate.c lua/src/lstring.c lua/src/ltable.c lua/src/lrotable.c lua/src/ltm.c lua/src/lundump.c lua/src/lvm.c lua/src/lzio.c \
|
||||||
lua/src/lbaselib.c lua/src/linit.c lua/src/lmathlib.c lua/src/lbitlib.c lua/src/loadlib.c lua/src/lauxlib.c lua/src/ltablib.c lua/src/lcorolib.c
|
lua/src/lbaselib.c lua/src/linit.c lua/src/lmathlib.c lua/src/lbitlib.c lua/src/loadlib.c lua/src/lauxlib.c lua/src/ltablib.c lua/src/lcorolib.c
|
||||||
SRC += $(LUASRC)
|
SRC += $(LUASRC)
|
||||||
LUADEP = lua_exports.cpp
|
LUADEP = lua_exports.inc
|
||||||
ifeq ($(USE_BIN_ALLOCATOR), YES)
|
ifeq ($(USE_BIN_ALLOCATOR), YES)
|
||||||
CPPDEFS += -DUSE_BIN_ALLOCATOR
|
CPPDEFS += -DUSE_BIN_ALLOCATOR
|
||||||
CPPSRC += bin_allocator.cpp
|
CPPSRC += bin_allocator.cpp
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/taranis/diskio.cpp
|
EXTRABOARDSRC += $(FATFSDIR)/ff.c $(FATFSDIR)/fattime.c $(FATFSDIR)/option/ccsbcs.c targets/taranis/diskio.cpp
|
||||||
CPPSRC += sdcard.cpp logs.cpp rtc.cpp targets/taranis/rtc_driver.cpp
|
CPPSRC += sdcard.cpp logs.cpp rtc.cpp targets/taranis/rtc_driver.cpp
|
||||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_sdmanager.cpp gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
|
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_sdmanager.cpp gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
|
||||||
CPPDEFS += -DSDCARD -DVOICE -DRTCLOCK
|
CPPDEFS += -DSDCARD -DVOICE -DRTCLOCK
|
||||||
INCDIRS += FatFs FatFs/option
|
INCDIRS += $(FATFSDIR) $(FATFSDIR)/option
|
||||||
ifeq ($(DSM2), PPM)
|
ifeq ($(DSM2), PPM)
|
||||||
CPPSRC += pulses/dsm2_arm.cpp
|
CPPSRC += pulses/dsm2_arm.cpp
|
||||||
endif
|
endif
|
||||||
|
@ -1372,12 +1379,11 @@ endif
|
||||||
|
|
||||||
# build bootloader
|
# build bootloader
|
||||||
ifeq ($(PCB), $(filter $(PCB), TARANIS))
|
ifeq ($(PCB), $(filter $(PCB), TARANIS))
|
||||||
bootloader.lbm: bootloader/bootloader_ramBoot.bin
|
bootloader.lbm: targets/taranis/bootloader/bootloader_ramBoot.bin
|
||||||
$(BIN2LBM) $^ $@
|
$(BIN2LBM) $^ $@
|
||||||
|
.PHONY targets/taranis/bootloader/bootloader_ramBoot.bin:
|
||||||
.PHONY bootloader/bootloader_ramBoot.bin:
|
|
||||||
@echo "Building bootloader..."
|
@echo "Building bootloader..."
|
||||||
$(MAKE) -C bootloader PCB=$(PCB) PCBREV=$(PCBREV) NANO=$(NANO)
|
$(MAKE) -C targets/taranis/bootloader PCB=$(PCB) PCBREV=$(PCBREV) NANO=$(NANO)
|
||||||
else ifeq ($(PCB), 9XRPRO)
|
else ifeq ($(PCB), 9XRPRO)
|
||||||
bootloader.lbm:
|
bootloader.lbm:
|
||||||
@echo "Fetching Mike's bootloader..."
|
@echo "Fetching Mike's bootloader..."
|
||||||
|
@ -1508,11 +1514,11 @@ else
|
||||||
PARSER = gcc -E -x c++
|
PARSER = gcc -E -x c++
|
||||||
endif
|
endif
|
||||||
|
|
||||||
lua_exports.cpp: myeeprom.h ../util/luaexport.py
|
lua_exports.inc: myeeprom.h ../util/luaexport.py
|
||||||
@echo "Generating a list of Lua exported constants in lua_exports.txt"
|
@echo "Generating a list of Lua exported constants in lua_exports.txt"
|
||||||
@$(PARSER) -DPCBTARANIS -DCPUARM -DCPUSTM32 -DLUA -DEXPORT myeeprom.h | grep LEXP > lua_exports.txt
|
@$(PARSER) -DPCBTARANIS -DCPUARM -DCPUSTM32 -DLUA -DEXPORT myeeprom.h | grep LEXP > lua_exports.txt
|
||||||
@echo "Parsing and generating C Lua exports in lua_exports.cpp"
|
@echo "Parsing and generating C Lua exports in lua_exports.inc"
|
||||||
@$(PYTHON) ../util/luaexport.py $(VERSION) lua_exports.txt lua_exports.cpp lua_fields.txt
|
@$(PYTHON) ../util/luaexport.py $(VERSION) lua_exports.txt lua_exports.inc lua_fields.txt
|
||||||
@rm lua_exports.txt
|
@rm lua_exports.txt
|
||||||
|
|
||||||
# Eye candy.
|
# Eye candy.
|
||||||
|
@ -1563,7 +1569,7 @@ ifeq ($(SIMU_AUDIO), YES)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(SIMU_DISKIO), YES)
|
ifeq ($(SIMU_DISKIO), YES)
|
||||||
CPPSRC += FatFs/ff.c FatFs/option/ccsbcs.c
|
CPPSRC += $(FATFSDIR)/ff.c $(FATFSDIR)/option/ccsbcs.c
|
||||||
SIMUDEFS += -DSIMU_DISKIO
|
SIMUDEFS += -DSIMU_DISKIO
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -1674,8 +1680,8 @@ clean_list :
|
||||||
$(REMOVE) bitmaps/*/*/*.lbm
|
$(REMOVE) bitmaps/*/*/*.lbm
|
||||||
$(REMOVE) fonts/*.lbm
|
$(REMOVE) fonts/*.lbm
|
||||||
$(REMOVE) fonts/*/*.lbm
|
$(REMOVE) fonts/*/*.lbm
|
||||||
$(REMOVE) lua_exports.txt lua_exports.cpp lua_fields.txt
|
$(REMOVE) lua_exports.txt lua_exports.inc lua_fields.txt
|
||||||
$(MAKE) -C bootloader clean
|
$(MAKE) -C targets/taranis/bootloader clean
|
||||||
|
|
||||||
#### Install
|
#### Install
|
||||||
|
|
||||||
|
|
|
@ -1,392 +0,0 @@
|
||||||
#
|
|
||||||
# !!!! Do NOT edit this makefile with an editor which replace tabs by spaces !!!!
|
|
||||||
#
|
|
||||||
##############################################################################################
|
|
||||||
#
|
|
||||||
# On command line:
|
|
||||||
#
|
|
||||||
# make all = Create project
|
|
||||||
#
|
|
||||||
# make clean = Clean project files.
|
|
||||||
#
|
|
||||||
# To rebuild project do "make clean" and "make all".
|
|
||||||
#
|
|
||||||
|
|
||||||
##############################################################################################
|
|
||||||
# Start of default section
|
|
||||||
#
|
|
||||||
|
|
||||||
TRGT = arm-none-eabi-
|
|
||||||
CC = $(TRGT)gcc
|
|
||||||
CP = $(TRGT)objcopy
|
|
||||||
CLSS = $(TRGT)objdump
|
|
||||||
AS = $(TRGT)as
|
|
||||||
#gcc -x assembler-with-cpp
|
|
||||||
BIN = $(CP) -O ihex
|
|
||||||
BINX = $(CP) -O binary
|
|
||||||
|
|
||||||
OBJDIR = .
|
|
||||||
|
|
||||||
ifeq ($(PCBREV), REV9E)
|
|
||||||
MCU = cortex-m4
|
|
||||||
else
|
|
||||||
MCU = cortex-m3
|
|
||||||
endif
|
|
||||||
|
|
||||||
# List all default C defines here, like -D_DEBUG=1
|
|
||||||
DDEFS =
|
|
||||||
|
|
||||||
# List all default ASM defines here, like -D_DEBUG=1
|
|
||||||
DADEFS =
|
|
||||||
|
|
||||||
# List all default directories to look for include files here
|
|
||||||
DINCDIR =
|
|
||||||
|
|
||||||
# List the default directory to look for the libraries here
|
|
||||||
DLIBDIR =
|
|
||||||
|
|
||||||
# List all default libraries here
|
|
||||||
DLIBS =
|
|
||||||
|
|
||||||
MEMORIES = sram
|
|
||||||
|
|
||||||
EXT = STD
|
|
||||||
|
|
||||||
#
|
|
||||||
# End of default section
|
|
||||||
##############################################################################################
|
|
||||||
|
|
||||||
##############################################################################################
|
|
||||||
# Start of user section
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Define project name and Ram/Flash mode here
|
|
||||||
PROJECT = bootloader
|
|
||||||
|
|
||||||
ifeq ($(PCB), TARANIS)
|
|
||||||
RUN_FROM_FLASH = 0
|
|
||||||
else
|
|
||||||
ifeq ($(PCB), X9D)
|
|
||||||
RUN_FROM_FLASH = 0
|
|
||||||
else
|
|
||||||
RUN_FROM_FLASH = 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# PCB revision
|
|
||||||
PCBREV =
|
|
||||||
|
|
||||||
EXTRAINCDIRS =
|
|
||||||
|
|
||||||
#
|
|
||||||
# Define linker script file here
|
|
||||||
#
|
|
||||||
ifeq ($(RUN_FROM_FLASH), 1)
|
|
||||||
ifeq ($(REVX), 1)
|
|
||||||
LDSCRIPT = sam3s8c_boot.ld
|
|
||||||
FULL_PRJ = $(PROJECT)_flash8
|
|
||||||
EXTRAINCDIRS += include
|
|
||||||
# EXTRAINCDIRS += ../
|
|
||||||
else
|
|
||||||
LDSCRIPT = sam3s4c_boot.ld
|
|
||||||
FULL_PRJ = $(PROJECT)_flash4
|
|
||||||
EXTRAINCDIRS += include
|
|
||||||
# EXTRAINCDIRS += ../
|
|
||||||
endif
|
|
||||||
TRGT = arm-none-eabi-
|
|
||||||
CPPDEFS += -DPCBSKY
|
|
||||||
UDEFS = -Dat91sam3s8
|
|
||||||
|
|
||||||
# If REVX board
|
|
||||||
ifeq ($(REVX), 1)
|
|
||||||
CPPDEFS += -DREVX
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPPDEFS += -DREVB
|
|
||||||
|
|
||||||
else
|
|
||||||
ifeq ($(PCB), TARANIS)
|
|
||||||
ARCH = ARM
|
|
||||||
LDSCRIPT = ../targets/taranis/stm32_ramBoot.ld
|
|
||||||
TRGT = arm-none-eabi-
|
|
||||||
CPPDEFS += -DHSE_VALUE=12000000
|
|
||||||
CPPDEFS += -DPCBTARANIS
|
|
||||||
FULL_PRJ = $(PROJECT)_ramBoot
|
|
||||||
ifeq ($(PCBREV), REV9E)
|
|
||||||
CPPDEFS += -DSTM32F40_41xxx
|
|
||||||
EXTRAINCDIRS += ../targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc
|
|
||||||
EXTRAINCDIRS += ../targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include
|
|
||||||
EXTRAINCDIRS += ../targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Include
|
|
||||||
else
|
|
||||||
EXTRAINCDIRS += ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc
|
|
||||||
EXTRAINCDIRS += ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include
|
|
||||||
EXTRAINCDIRS += ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/include
|
|
||||||
endif
|
|
||||||
EXTRAINCDIRS += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc
|
|
||||||
EXTRAINCDIRS += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc
|
|
||||||
EXTRAINCDIRS += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc
|
|
||||||
EXTRAINCDIRS += ../targets/taranis
|
|
||||||
EXTRAINCDIRS += ../fonts/std
|
|
||||||
EXTRAINCDIRS += ../
|
|
||||||
|
|
||||||
ifeq ($(PCBREV), REV4a)
|
|
||||||
CPPDEFS += -DREV4a
|
|
||||||
else ifeq ($(PCBREV), REVPLUS)
|
|
||||||
CPPDEFS += -DREVPLUS
|
|
||||||
HAPTIC = YES
|
|
||||||
else ifeq ($(PCBREV), REV9E)
|
|
||||||
CPPDEFS += -DREVPLUS -DREV9E
|
|
||||||
HAPTIC = YES
|
|
||||||
else
|
|
||||||
CPPDEFS += -DREV4
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# List all user C define here, like -D_DEBUG=1
|
|
||||||
|
|
||||||
# Define ASM defines here
|
|
||||||
UADEFS =
|
|
||||||
|
|
||||||
SRC =
|
|
||||||
|
|
||||||
ifeq ($(PCB), TARANIS)
|
|
||||||
ifeq ($(PCBREV), REV9E)
|
|
||||||
SRC += ../targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
|
|
||||||
SRC += ../targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
|
||||||
SRC += ../targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
|
||||||
SRC += ../targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
|
||||||
SRC += ../targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/src/misc.c
|
|
||||||
else
|
|
||||||
SRC += ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c
|
|
||||||
SRC += ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
|
|
||||||
SRC += ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
|
|
||||||
SRC += ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
|
|
||||||
SRC += ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c
|
|
||||||
endif
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
|
|
||||||
SRC += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
|
|
||||||
SRC += ../targets/taranis/i2c.c ../targets/taranis/delays.c
|
|
||||||
SRC += ../FatFs/ff.c ../FatFs/option/ccsbcs.c
|
|
||||||
SRC += ../targets/taranis/usbd_desc.c
|
|
||||||
SRC += ../targets/taranis/aspi.c
|
|
||||||
SRC += ../targets/taranis/usb_bsp.c
|
|
||||||
SRC += ../targets/taranis/usb_driver.c
|
|
||||||
SRC += ../targets/taranis/pwr_driver.c
|
|
||||||
SRC += init.c
|
|
||||||
|
|
||||||
CPPSRC = ../targets/taranis/lcd_driver.cpp \
|
|
||||||
../targets/taranis/configure_pins.cpp \
|
|
||||||
../targets/taranis/keys_driver.cpp \
|
|
||||||
../targets/taranis/flash_driver.cpp \
|
|
||||||
../targets/taranis/diskio.cpp \
|
|
||||||
../targets/taranis/usbd_usr.cpp \
|
|
||||||
../targets/taranis/usbd_storage_msd.cpp \
|
|
||||||
../gui/Taranis/lcd.cpp \
|
|
||||||
../keys.cpp \
|
|
||||||
../fonts.cpp \
|
|
||||||
../strhelpers.cpp \
|
|
||||||
boot.cpp
|
|
||||||
|
|
||||||
ifeq ($(PCBREV), REV9E)
|
|
||||||
CPPSRC += ../targets/taranis/rotenc_driver.cpp
|
|
||||||
endif
|
|
||||||
|
|
||||||
# List ASM source files here
|
|
||||||
|
|
||||||
ifeq ($(PCBREV), REV9E)
|
|
||||||
ASRC = ../targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f40_41xxx.s
|
|
||||||
else
|
|
||||||
ASRC = ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
|
||||||
endif
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
# List C source files here
|
|
||||||
SRC = core_cm3.c \
|
|
||||||
board_lowlevel.c \
|
|
||||||
crt.c \
|
|
||||||
usb/device/core/USBD_UDP.c usb/device/core/USBDDriver.c usb/device/core/USBDCallbacks.c \
|
|
||||||
usb/device/massstorage/MSDDriver.c usb/device/massstorage/MSDDStateMachine.c \
|
|
||||||
usb/device/massstorage/MSDLun.c usb/device/massstorage/MSDDriverDescriptors.c usb/device/massstorage/SBCMethods.c \
|
|
||||||
usb/common/core/USBEndpointDescriptor.c usb/common/core/USBGenericRequest.c \
|
|
||||||
usb/common/core/USBFeatureRequest.c usb/common/core/USBInterfaceRequest.c usb/common/core/USBGetDescriptorRequest.c \
|
|
||||||
usb/common/core/USBSetAddressRequest.c usb/common/core/USBSetConfigurationRequest.c \
|
|
||||||
usb/common/core/USBConfigurationDescriptor.c usb/common/core/USBGenericDescriptor.c \
|
|
||||||
MEDSdcard.c \
|
|
||||||
vectors_sam3s.c
|
|
||||||
|
|
||||||
CPPSRC = lcdboot.cpp \
|
|
||||||
ff.cpp \
|
|
||||||
diskio.cpp \
|
|
||||||
driversboot.cpp \
|
|
||||||
logicioboot.cpp \
|
|
||||||
sdcard_driver.cpp \
|
|
||||||
massstorage.cpp \
|
|
||||||
bootsamEeprom.cpp \
|
|
||||||
ff_lfn.cpp \
|
|
||||||
power.cpp \
|
|
||||||
boot.cpp
|
|
||||||
|
|
||||||
# List ASM source files here
|
|
||||||
ASRC =
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
# List all user directories here
|
|
||||||
UINCDIR = ./inc
|
|
||||||
# \
|
|
||||||
# ./cmsis/core \
|
|
||||||
# ./cmsis/device
|
|
||||||
|
|
||||||
# List the user directory to look for the libraries here
|
|
||||||
ULIBDIR =
|
|
||||||
|
|
||||||
# List all user libraries here
|
|
||||||
ULIBS =
|
|
||||||
|
|
||||||
# Define optimisation level here
|
|
||||||
OPT = -Os
|
|
||||||
|
|
||||||
#
|
|
||||||
# End of user defines
|
|
||||||
##############################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
VPATH = $(DIRS)
|
|
||||||
|
|
||||||
INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
|
|
||||||
LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
|
|
||||||
|
|
||||||
ifeq ($(RUN_FROM_FLASH), 0)
|
|
||||||
DEFS = $(DDEFS) $(UDEFS) -DRUN_FROM_FLASH=0
|
|
||||||
else
|
|
||||||
DEFS = $(DDEFS) $(UDEFS) -DRUN_FROM_FLASH=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ADEFS = $(DADEFS) $(UADEFS)
|
|
||||||
|
|
||||||
AXOBJS = $(ASRC:%.s=%.o)
|
|
||||||
CXOBJS = $(SRC:%.c=%.o)
|
|
||||||
CPPXOBJS = $(CPPSRC:%.cpp=%.o)
|
|
||||||
|
|
||||||
LIBS = $(DLIBS) $(ULIBS)
|
|
||||||
MCFLAGS = -mcpu=$(MCU)
|
|
||||||
|
|
||||||
ifeq ($(NANO), YES)
|
|
||||||
# use newlib-nano for linking
|
|
||||||
# NEWLIB_NANO_FLAGS = --specs=nano.specs -u _printf_float #use this version if printf for floats is needed!
|
|
||||||
NEWLIB_NANO_FLAGS = --specs=nano.specs
|
|
||||||
endif
|
|
||||||
|
|
||||||
#ASFLAGS = $(MCFLAGS) -g -gdwarf-2 -Wa,-amhls=$(OBJDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
|
|
||||||
CPFLAGS = $(MCFLAGS) $(OPT) -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm $(DEFS)
|
|
||||||
LDFLAGS = $(MCFLAGS) -mthumb -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(FULL_PRJ).map,--cref,--no-warn-mismatch $(LIBDIR) $(NEWLIB_NANO_FLAGS)
|
|
||||||
CPPFLAGS = $(MCFLAGS) $(OPT) -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -fverbose-asm $(DEFS)
|
|
||||||
|
|
||||||
CPPFLAGS += $(CPPDEFS)
|
|
||||||
CPFLAGS += $(CPPDEFS)
|
|
||||||
CPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
|
||||||
|
|
||||||
AOBJS = $(patsubst %,$(OBJDIR)/%,$(notdir $(AXOBJS) ))
|
|
||||||
COBJS = $(patsubst %,$(OBJDIR)/%,$(notdir $(CXOBJS) ))
|
|
||||||
CPPOBJS = $(patsubst %,$(OBJDIR)/%,$(notdir $(CPPXOBJS) ))
|
|
||||||
DIRS = $(sort $(dir $(AXOBJS) $(CXOBJS) $(CPPXOBJS) ) )
|
|
||||||
|
|
||||||
|
|
||||||
CPPDEFS += -DCPUARM
|
|
||||||
|
|
||||||
ifeq ($(PCB), TARANIS)
|
|
||||||
CPPDEFS += -DCPUSTM32
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPPDEFS += -DTIMERS=0
|
|
||||||
|
|
||||||
# If serial Debug required
|
|
||||||
ifeq ($(DEBUG), 1)
|
|
||||||
CPPDEFS += -DDEBUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPPDEFS += -DBOOT
|
|
||||||
|
|
||||||
# Generate dependency information
|
|
||||||
CPFLAGS += -MD -MP -MF .dep/$(@F).d
|
|
||||||
CPPFLAGS += -MD -MP -MF .dep/$(@F).d
|
|
||||||
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
|
||||||
|
|
||||||
#
|
|
||||||
# makefile rules
|
|
||||||
#
|
|
||||||
|
|
||||||
all: size_before $(OBJS) $(COBJS) $(CPPOBJS) $(FULL_PRJ).elf $(FULL_PRJ).hex $(FULL_PRJ).lss $(FULL_PRJ).bin size
|
|
||||||
|
|
||||||
#begin:
|
|
||||||
# @echo $(AXOBJS) $(CXOBJS) $(CPPXOBJS)
|
|
||||||
# @echo
|
|
||||||
# @echo $(OBJS) $(COBJS) $(CPPOBJS)
|
|
||||||
# @echo
|
|
||||||
# @echo $(DIRS)
|
|
||||||
|
|
||||||
size_before:
|
|
||||||
# arm-none-eabi-size $(FULL_PRJ).elf
|
|
||||||
@if test -f $(FULL_PRJ).elf; then arm-none-eabi-size $(FULL_PRJ).elf; fi
|
|
||||||
|
|
||||||
size:
|
|
||||||
# arm-none-eabi-size $(FULL_PRJ).elf
|
|
||||||
@if test -f $(FULL_PRJ).elf; then arm-none-eabi-size $(FULL_PRJ).elf; fi
|
|
||||||
|
|
||||||
$(CPPOBJS) : $(OBJDIR)/%.o : %.cpp
|
|
||||||
$(CC) -c $(CPPFLAGS) -fno-exceptions -I . $(INCDIR) $< -o $@
|
|
||||||
|
|
||||||
$(COBJS) : $(OBJDIR)/%.o : %.c
|
|
||||||
$(CC) -c $(CPFLAGS) -I . $(INCDIR) $< -o $@
|
|
||||||
|
|
||||||
|
|
||||||
$(AOBJS) : $(OBJDIR)/%.o : %.s
|
|
||||||
$(AS) -c $(ASFLAGS) $< -o $@
|
|
||||||
|
|
||||||
%elf: $(AOBJS) $(COBJS) $(CPPOBJS)
|
|
||||||
$(CC) $(AOBJS) $(COBJS) $(CPPOBJS) $(LDFLAGS) $(LIBS) -o $@
|
|
||||||
|
|
||||||
# Create extended listing file from ELF output file.
|
|
||||||
%.lss: %.elf
|
|
||||||
$(CLSS) -h -S $< > $@
|
|
||||||
|
|
||||||
%hex: %elf
|
|
||||||
$(BIN) $< $@
|
|
||||||
|
|
||||||
%bin: %elf
|
|
||||||
$(BINX) $< $@
|
|
||||||
|
|
||||||
# $(PROJECT)_flash8
|
|
||||||
# $(PROJECT)_flash4
|
|
||||||
# $(PROJECT)_ramBootS
|
|
||||||
# $(PROJECT)_ramBootT
|
|
||||||
|
|
||||||
clean:
|
|
||||||
-rm -f *.o
|
|
||||||
-rm -f *.elf
|
|
||||||
-rm -f *.map
|
|
||||||
-rm -f *.hex
|
|
||||||
-rm -f *.bin
|
|
||||||
-rm -f *.lss
|
|
||||||
-rm -fR .dep
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Include the dependency files, should be the last of the makefile
|
|
||||||
#
|
|
||||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
|
||||||
|
|
||||||
# *** EOF ***
|
|
|
@ -34,9 +34,12 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opentx.h"
|
extern "C" {
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "opentx.h"
|
||||||
|
|
||||||
#if (defined(DEBUG) && defined(CPUARM)) || defined(SIMU)
|
#if (defined(DEBUG) && defined(CPUARM)) || defined(SIMU)
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "../../opentx.h"
|
||||||
#include "timers.h"
|
#include "../../timers.h"
|
||||||
|
|
||||||
#if defined(REVPLUS) && defined(LCD_DUAL_BUFFER)
|
#if defined(REVPLUS) && defined(LCD_DUAL_BUFFER)
|
||||||
display_t displayBuf1[DISPLAY_BUF_SIZE];
|
display_t displayBuf1[DISPLAY_BUF_SIZE];
|
||||||
|
|
|
@ -144,7 +144,7 @@ void menuCommonCalib(uint8_t event)
|
||||||
for (int j=0; j<count; j++) {
|
for (int j=0; j<count; j++) {
|
||||||
for (int k=j+1; k<count; k++) {
|
for (int k=j+1; k<count; k++) {
|
||||||
if (reusableBuffer.calib.xpotsCalib[idx].steps[k] < reusableBuffer.calib.xpotsCalib[idx].steps[j]) {
|
if (reusableBuffer.calib.xpotsCalib[idx].steps[k] < reusableBuffer.calib.xpotsCalib[idx].steps[j]) {
|
||||||
swap(reusableBuffer.calib.xpotsCalib[idx].steps[j], reusableBuffer.calib.xpotsCalib[idx].steps[k]);
|
SWAP(reusableBuffer.calib.xpotsCalib[idx].steps[j], reusableBuffer.calib.xpotsCalib[idx].steps[k]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "lua_exports.cpp" // this line must be after lua headers
|
#include "lua_exports.inc" // this line must be after lua headers
|
||||||
|
|
||||||
#define lua_registernumber(L, n, i) (lua_pushnumber(L, (i)), lua_setglobal(L, (n)))
|
#define lua_registernumber(L, n, i) (lua_pushnumber(L, (i)), lua_setglobal(L, (n)))
|
||||||
#define lua_registerint(L, n, i) (lua_pushinteger(L, (i)), lua_setglobal(L, (n)))
|
#define lua_registerint(L, n, i) (lua_pushinteger(L, (i)), lua_setglobal(L, (n)))
|
||||||
|
|
|
@ -1010,9 +1010,7 @@ template<class t> FORCEINLINE t min(t a, t b) { return a<b?a:b; }
|
||||||
template<class t> FORCEINLINE t max(t a, t b) { return a>b?a:b; }
|
template<class t> FORCEINLINE t max(t a, t b) { return a>b?a:b; }
|
||||||
template<class t> FORCEINLINE t sgn(t a) { return a>0 ? 1 : (a < 0 ? -1 : 0); }
|
template<class t> FORCEINLINE t sgn(t a) { return a>0 ? 1 : (a < 0 ? -1 : 0); }
|
||||||
template<class t> FORCEINLINE t limit(t mi, t x, t ma) { return min(max(mi,x),ma); }
|
template<class t> FORCEINLINE t limit(t mi, t x, t ma) { return min(max(mi,x),ma); }
|
||||||
#if !defined(SWAP_DEFINED)
|
template<class t> void SWAP(t & a, t & b) { t tmp = b; b = a; a = tmp; }
|
||||||
template<class t> void swap(t & a, t & b) { t tmp = b; b = a; a = tmp; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint16_t isqrt32(uint32_t n);
|
uint16_t isqrt32(uint32_t n);
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "../../FatFs/diskio.h"
|
#include "FatFs/diskio.h"
|
||||||
#include "../../FatFs/ff.h"
|
#include "FatFs/ff.h"
|
||||||
|
|
||||||
|
|
||||||
#define LIST_NONE_SD_FILE 1
|
#define LIST_NONE_SD_FILE 1
|
||||||
|
|
||||||
|
|
|
@ -337,6 +337,8 @@ extern void rxPdcUsart( void (*pChProcess)(uint8_t x) );
|
||||||
|
|
||||||
#define WGM10 0
|
#define WGM10 0
|
||||||
#define WGM12 0
|
#define WGM12 0
|
||||||
|
#define COM1B1 0
|
||||||
|
#define FOC1B 0
|
||||||
#define CS10 0
|
#define CS10 0
|
||||||
#define DOR0 0
|
#define DOR0 0
|
||||||
#define UPE0 0
|
#define UPE0 0
|
||||||
|
@ -434,9 +436,10 @@ inline void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) {
|
||||||
|
|
||||||
#define configure_pins(...)
|
#define configure_pins(...)
|
||||||
|
|
||||||
extern "C" {
|
#if defined(SDCARD)
|
||||||
extern char simuSdDirectory[1024];
|
extern char simuSdDirectory[1024];
|
||||||
}
|
#endif
|
||||||
|
|
||||||
#define sdMountPoll()
|
#define sdMountPoll()
|
||||||
#define sdPoll10ms()
|
#define sdPoll10ms()
|
||||||
#define sd_card_ready() (true)
|
#define sd_card_ready() (true)
|
||||||
|
|
335
radio/src/targets/taranis/bootloader/Makefile
Executable file
335
radio/src/targets/taranis/bootloader/Makefile
Executable file
|
@ -0,0 +1,335 @@
|
||||||
|
#
|
||||||
|
# !!!! Do NOT edit this makefile with an editor which replace tabs by spaces !!!!
|
||||||
|
#
|
||||||
|
##############################################################################################
|
||||||
|
#
|
||||||
|
# On command line:
|
||||||
|
#
|
||||||
|
# make all = Create project
|
||||||
|
#
|
||||||
|
# make clean = Clean project files.
|
||||||
|
#
|
||||||
|
# To rebuild project do "make clean" and "make all".
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################################
|
||||||
|
# Start of default section
|
||||||
|
#
|
||||||
|
|
||||||
|
TRGT = arm-none-eabi-
|
||||||
|
CC = $(TRGT)gcc
|
||||||
|
CP = $(TRGT)objcopy
|
||||||
|
CLSS = $(TRGT)objdump
|
||||||
|
AS = $(TRGT)as
|
||||||
|
#gcc -x assembler-with-cpp
|
||||||
|
BIN = $(CP) -O ihex
|
||||||
|
BINX = $(CP) -O binary
|
||||||
|
|
||||||
|
OBJDIR = .
|
||||||
|
|
||||||
|
THIRDPARTY = ../../../thirdparty
|
||||||
|
|
||||||
|
ifeq ($(PCBREV), REV9E)
|
||||||
|
MCU = cortex-m4
|
||||||
|
STM32LIBPATH = $(THIRDPARTY)/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries
|
||||||
|
else
|
||||||
|
MCU = cortex-m3
|
||||||
|
STM32LIBPATH = $(THIRDPARTY)/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries
|
||||||
|
endif
|
||||||
|
|
||||||
|
# List all default C defines here, like -D_DEBUG=1
|
||||||
|
DDEFS =
|
||||||
|
|
||||||
|
# List all default ASM defines here, like -D_DEBUG=1
|
||||||
|
DADEFS =
|
||||||
|
|
||||||
|
# List all default directories to look for include files here
|
||||||
|
DINCDIR =
|
||||||
|
|
||||||
|
# List the default directory to look for the libraries here
|
||||||
|
DLIBDIR =
|
||||||
|
|
||||||
|
# List all default libraries here
|
||||||
|
DLIBS =
|
||||||
|
|
||||||
|
MEMORIES = sram
|
||||||
|
|
||||||
|
EXT = STD
|
||||||
|
|
||||||
|
#
|
||||||
|
# End of default section
|
||||||
|
##############################################################################################
|
||||||
|
|
||||||
|
##############################################################################################
|
||||||
|
# Start of user section
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Define project name and Ram/Flash mode here
|
||||||
|
PROJECT = bootloader
|
||||||
|
|
||||||
|
ifeq ($(PCB), TARANIS)
|
||||||
|
RUN_FROM_FLASH = 0
|
||||||
|
else
|
||||||
|
ifeq ($(PCB), X9D)
|
||||||
|
RUN_FROM_FLASH = 0
|
||||||
|
else
|
||||||
|
RUN_FROM_FLASH = 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# PCB revision
|
||||||
|
PCBREV =
|
||||||
|
|
||||||
|
EXTRAINCDIRS = $(THIRDPARTY)
|
||||||
|
|
||||||
|
STM32USBPATH = ../../../thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries
|
||||||
|
|
||||||
|
#
|
||||||
|
# Define linker script file here
|
||||||
|
#
|
||||||
|
ifeq ($(PCB), TARANIS)
|
||||||
|
ARCH = ARM
|
||||||
|
LDSCRIPT = ../stm32_ramBoot.ld
|
||||||
|
TRGT = arm-none-eabi-
|
||||||
|
CPPDEFS += -DHSE_VALUE=12000000
|
||||||
|
CPPDEFS += -DPCBTARANIS
|
||||||
|
FULL_PRJ = $(PROJECT)_ramBoot
|
||||||
|
ifeq ($(PCBREV), REV9E)
|
||||||
|
CPPDEFS += -DSTM32F40_41xxx
|
||||||
|
EXTRAINCDIRS += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/inc
|
||||||
|
EXTRAINCDIRS += $(STM32LIBPATH)/CMSIS/Device/ST/STM32F4xx/Include
|
||||||
|
EXTRAINCDIRS += $(STM32LIBPATH)/CMSIS/Include
|
||||||
|
else
|
||||||
|
EXTRAINCDIRS += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/inc
|
||||||
|
EXTRAINCDIRS += $(STM32LIBPATH)/CMSIS/Device/ST/STM32F2xx/Include
|
||||||
|
EXTRAINCDIRS += $(STM32LIBPATH)/CMSIS/include
|
||||||
|
endif
|
||||||
|
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_OTG_Driver/inc
|
||||||
|
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_Device_Library/Core/inc
|
||||||
|
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/inc
|
||||||
|
EXTRAINCDIRS += .. ../../.. ../../../fonts/std
|
||||||
|
ifeq ($(PCBREV), REV4a)
|
||||||
|
CPPDEFS += -DREV4a
|
||||||
|
else ifeq ($(PCBREV), REVPLUS)
|
||||||
|
CPPDEFS += -DREVPLUS
|
||||||
|
HAPTIC = YES
|
||||||
|
else ifeq ($(PCBREV), REV9E)
|
||||||
|
CPPDEFS += -DREVPLUS -DREV9E
|
||||||
|
HAPTIC = YES
|
||||||
|
else
|
||||||
|
CPPDEFS += -DREV4
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# List all user C define here, like -D_DEBUG=1
|
||||||
|
|
||||||
|
# Define ASM defines here
|
||||||
|
UADEFS =
|
||||||
|
|
||||||
|
SRC =
|
||||||
|
|
||||||
|
ifeq ($(PCBREV), REV9E)
|
||||||
|
SRC += $(STM32LIBPATH)/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
|
||||||
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
||||||
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
||||||
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
||||||
|
SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/misc.c
|
||||||
|
else
|
||||||
|
SRC += $(STM32LIBPATH)/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c
|
||||||
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
|
||||||
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
|
||||||
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
|
||||||
|
SRC += $(STM32LIBPATH)/STM32F2xx_StdPeriph_Driver/src/misc.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_OTG_Driver/src/usb_core.c
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_OTG_Driver/src/usb_dcd.c
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_OTG_Driver/src/usb_dcd_int.c
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Core/src/usbd_core.c
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Core/src/usbd_ioreq.c
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Core/src/usbd_req.c
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
|
||||||
|
SRC += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
|
||||||
|
SRC += ../i2c.c ../delays.c
|
||||||
|
SRC += $(THIRDPARTY)/FatFs/ff.c $(THIRDPARTY)/FatFs/option/ccsbcs.c
|
||||||
|
SRC += ../usbd_desc.c
|
||||||
|
SRC += ../aspi.c
|
||||||
|
SRC += ../usb_bsp.c
|
||||||
|
SRC += ../usb_driver.c
|
||||||
|
SRC += ../pwr_driver.c
|
||||||
|
SRC += init.c
|
||||||
|
|
||||||
|
CPPSRC = ../lcd_driver.cpp \
|
||||||
|
../configure_pins.cpp \
|
||||||
|
../keys_driver.cpp \
|
||||||
|
../flash_driver.cpp \
|
||||||
|
../diskio.cpp \
|
||||||
|
../usbd_usr.cpp \
|
||||||
|
../usbd_storage_msd.cpp \
|
||||||
|
../../../gui/Taranis/lcd.cpp \
|
||||||
|
../../../keys.cpp \
|
||||||
|
../../../fonts.cpp \
|
||||||
|
../../../strhelpers.cpp \
|
||||||
|
boot.cpp
|
||||||
|
|
||||||
|
ifeq ($(PCBREV), REV9E)
|
||||||
|
CPPSRC += ../rotenc_driver.cpp
|
||||||
|
endif
|
||||||
|
|
||||||
|
# List ASM source files here
|
||||||
|
|
||||||
|
ifeq ($(PCBREV), REV9E)
|
||||||
|
ASRC = $(STM32LIBPATH)/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f40_41xxx.s
|
||||||
|
else
|
||||||
|
ASRC = $(STM32LIBPATH)/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
||||||
|
endif
|
||||||
|
|
||||||
|
# List all user directories here
|
||||||
|
UINCDIR = ./inc
|
||||||
|
# \
|
||||||
|
# ./cmsis/core \
|
||||||
|
# ./cmsis/device
|
||||||
|
|
||||||
|
# List the user directory to look for the libraries here
|
||||||
|
ULIBDIR =
|
||||||
|
|
||||||
|
# List all user libraries here
|
||||||
|
ULIBS =
|
||||||
|
|
||||||
|
# Define optimisation level here
|
||||||
|
OPT = -Os
|
||||||
|
|
||||||
|
#
|
||||||
|
# End of user defines
|
||||||
|
##############################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
VPATH = $(DIRS)
|
||||||
|
|
||||||
|
INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
|
||||||
|
LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
|
||||||
|
|
||||||
|
ifeq ($(RUN_FROM_FLASH), 0)
|
||||||
|
DEFS = $(DDEFS) $(UDEFS) -DRUN_FROM_FLASH=0
|
||||||
|
else
|
||||||
|
DEFS = $(DDEFS) $(UDEFS) -DRUN_FROM_FLASH=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ADEFS = $(DADEFS) $(UADEFS)
|
||||||
|
|
||||||
|
AXOBJS = $(ASRC:%.s=%.o)
|
||||||
|
CXOBJS = $(SRC:%.c=%.o)
|
||||||
|
CPPXOBJS = $(CPPSRC:%.cpp=%.o)
|
||||||
|
|
||||||
|
LIBS = $(DLIBS) $(ULIBS)
|
||||||
|
MCFLAGS = -mcpu=$(MCU)
|
||||||
|
|
||||||
|
ifeq ($(NANO), YES)
|
||||||
|
# use newlib-nano for linking
|
||||||
|
# NEWLIB_NANO_FLAGS = --specs=nano.specs -u _printf_float #use this version if printf for floats is needed!
|
||||||
|
NEWLIB_NANO_FLAGS = --specs=nano.specs
|
||||||
|
endif
|
||||||
|
|
||||||
|
#ASFLAGS = $(MCFLAGS) -g -gdwarf-2 -Wa,-amhls=$(OBJDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
|
||||||
|
CPFLAGS = $(MCFLAGS) $(OPT) -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm $(DEFS)
|
||||||
|
LDFLAGS = $(MCFLAGS) -mthumb -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(FULL_PRJ).map,--cref,--no-warn-mismatch $(LIBDIR) $(NEWLIB_NANO_FLAGS)
|
||||||
|
CPPFLAGS = $(MCFLAGS) $(OPT) -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -fverbose-asm $(DEFS)
|
||||||
|
|
||||||
|
CPPFLAGS += $(CPPDEFS)
|
||||||
|
CPFLAGS += $(CPPDEFS)
|
||||||
|
CPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||||
|
|
||||||
|
AOBJS = $(patsubst %,$(OBJDIR)/%,$(notdir $(AXOBJS) ))
|
||||||
|
COBJS = $(patsubst %,$(OBJDIR)/%,$(notdir $(CXOBJS) ))
|
||||||
|
CPPOBJS = $(patsubst %,$(OBJDIR)/%,$(notdir $(CPPXOBJS) ))
|
||||||
|
DIRS = $(sort $(dir $(AXOBJS) $(CXOBJS) $(CPPXOBJS) ) )
|
||||||
|
|
||||||
|
|
||||||
|
CPPDEFS += -DCPUARM
|
||||||
|
|
||||||
|
ifeq ($(PCB), TARANIS)
|
||||||
|
CPPDEFS += -DCPUSTM32
|
||||||
|
endif
|
||||||
|
|
||||||
|
CPPDEFS += -DTIMERS=0
|
||||||
|
|
||||||
|
# If serial Debug required
|
||||||
|
ifeq ($(DEBUG), 1)
|
||||||
|
CPPDEFS += -DDEBUG
|
||||||
|
endif
|
||||||
|
|
||||||
|
CPPDEFS += -DBOOT
|
||||||
|
|
||||||
|
# Generate dependency information
|
||||||
|
CPFLAGS += -MD -MP -MF .dep/$(@F).d
|
||||||
|
CPPFLAGS += -MD -MP -MF .dep/$(@F).d
|
||||||
|
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||||
|
|
||||||
|
#
|
||||||
|
# makefile rules
|
||||||
|
#
|
||||||
|
|
||||||
|
all: size_before $(OBJS) $(COBJS) $(CPPOBJS) $(FULL_PRJ).elf $(FULL_PRJ).hex $(FULL_PRJ).lss $(FULL_PRJ).bin size
|
||||||
|
|
||||||
|
#begin:
|
||||||
|
# @echo $(AXOBJS) $(CXOBJS) $(CPPXOBJS)
|
||||||
|
# @echo
|
||||||
|
# @echo $(OBJS) $(COBJS) $(CPPOBJS)
|
||||||
|
# @echo
|
||||||
|
# @echo $(DIRS)
|
||||||
|
|
||||||
|
size_before:
|
||||||
|
# arm-none-eabi-size $(FULL_PRJ).elf
|
||||||
|
@if test -f $(FULL_PRJ).elf; then arm-none-eabi-size $(FULL_PRJ).elf; fi
|
||||||
|
|
||||||
|
size:
|
||||||
|
# arm-none-eabi-size $(FULL_PRJ).elf
|
||||||
|
@if test -f $(FULL_PRJ).elf; then arm-none-eabi-size $(FULL_PRJ).elf; fi
|
||||||
|
|
||||||
|
$(CPPOBJS) : $(OBJDIR)/%.o : %.cpp
|
||||||
|
$(CC) -c $(CPPFLAGS) -fno-exceptions -I . $(INCDIR) $< -o $@
|
||||||
|
|
||||||
|
$(COBJS) : $(OBJDIR)/%.o : %.c
|
||||||
|
$(CC) -c $(CPFLAGS) -I . $(INCDIR) $< -o $@
|
||||||
|
|
||||||
|
|
||||||
|
$(AOBJS) : $(OBJDIR)/%.o : %.s
|
||||||
|
$(AS) -c $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
|
%elf: $(AOBJS) $(COBJS) $(CPPOBJS)
|
||||||
|
$(CC) $(AOBJS) $(COBJS) $(CPPOBJS) $(LDFLAGS) $(LIBS) -o $@
|
||||||
|
|
||||||
|
# Create extended listing file from ELF output file.
|
||||||
|
%.lss: %.elf
|
||||||
|
$(CLSS) -h -S $< > $@
|
||||||
|
|
||||||
|
%hex: %elf
|
||||||
|
$(BIN) $< $@
|
||||||
|
|
||||||
|
%bin: %elf
|
||||||
|
$(BINX) $< $@
|
||||||
|
|
||||||
|
# $(PROJECT)_flash8
|
||||||
|
# $(PROJECT)_flash4
|
||||||
|
# $(PROJECT)_ramBootS
|
||||||
|
# $(PROJECT)_ramBootT
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-rm -f *.o
|
||||||
|
-rm -f *.elf
|
||||||
|
-rm -f *.map
|
||||||
|
-rm -f *.hex
|
||||||
|
-rm -f *.bin
|
||||||
|
-rm -f *.lss
|
||||||
|
-rm -fR .dep
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Include the dependency files, should be the last of the makefile
|
||||||
|
#
|
||||||
|
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||||
|
|
||||||
|
# *** EOF ***
|
18
radio/src/bootloader/boot.cpp → radio/src/targets/taranis/bootloader/boot.cpp
Normal file → Executable file
18
radio/src/bootloader/boot.cpp → radio/src/targets/taranis/bootloader/boot.cpp
Normal file → Executable file
|
@ -54,15 +54,15 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "board_taranis.h"
|
#include "board_taranis.h"
|
||||||
#include "../eeprom_rlc.h"
|
#include "eeprom_rlc.h"
|
||||||
#include "../pwr.h"
|
#include "pwr.h"
|
||||||
#include "../gui/Taranis/lcd.h"
|
#include "gui/Taranis/lcd.h"
|
||||||
#include "../keys.h"
|
#include "keys.h"
|
||||||
#include "../sdcard.h"
|
#include "sdcard.h"
|
||||||
#include "../FatFs/ff.h"
|
#include "FatFs/ff.h"
|
||||||
#include "../FatFs/diskio.h"
|
#include "FatFs/diskio.h"
|
||||||
#include "../translations/en.h"
|
#include "translations/en.h"
|
||||||
#include "../stamp-opentx.h"
|
#include "stamp-opentx.h"
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define BOOTLOADER_TITLE " Taranis BootLoader - " VERS_STR
|
#define BOOTLOADER_TITLE " Taranis BootLoader - " VERS_STR
|
0
radio/src/bootloader/init.c → radio/src/targets/taranis/bootloader/init.c
Normal file → Executable file
0
radio/src/bootloader/init.c → radio/src/targets/taranis/bootloader/init.c
Normal file → Executable file
|
@ -36,11 +36,11 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "board_taranis.h"
|
#include "board_taranis.h"
|
||||||
#include "../../FatFs/diskio.h"
|
#include "../../thirdparty/FatFs/diskio.h"
|
||||||
#include "../../FatFs/ff.h"
|
#include "../../thirdparty/FatFs/ff.h"
|
||||||
#include "../../CoOS/kernel/CoOS.h"
|
#include "../../thirdparty/CoOS/kernel/CoOS.h"
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
#include "debug.h"
|
#include "../../debug.h"
|
||||||
|
|
||||||
/* Definitions for MMC/SDC command */
|
/* Definitions for MMC/SDC command */
|
||||||
#define CMD0 (0x40+0) /* GO_IDLE_STATE */
|
#define CMD0 (0x40+0) /* GO_IDLE_STATE */
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "../../opentx.h"
|
#include "../../opentx.h"
|
||||||
#include "../../FatFs/diskio.h"
|
#include "../../thirdparty/FatFs/diskio.h"
|
||||||
#include "board_taranis.h"
|
#include "board_taranis.h"
|
||||||
|
|
||||||
#if defined(__cplusplus) && !defined(SIMU)
|
#if defined(__cplusplus) && !defined(SIMU)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue