mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 04:15:26 +03:00
Taranis X9E Simulator - with rotary encoder
This commit is contained in:
parent
de43ce71df
commit
fa963041ef
29 changed files with 465 additions and 50 deletions
|
@ -129,6 +129,7 @@ set(common_SRCS
|
|||
firmwares/opentx/open9xSky9xeeprom.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
|
||||
|
|
|
@ -49,7 +49,8 @@ enum BoardEnum {
|
|||
BOARD_SKY9X,
|
||||
BOARD_9XRPRO,
|
||||
BOARD_TARANIS,
|
||||
BOARD_TARANIS_PLUS
|
||||
BOARD_TARANIS_PLUS,
|
||||
BOARD_TARANIS_X9E
|
||||
};
|
||||
|
||||
QString getBoardName(BoardEnum board);
|
||||
|
@ -59,8 +60,8 @@ QString getBoardName(BoardEnum board);
|
|||
#define IS_2560(board) (board==BOARD_GRUVIN9X || board==BOARD_MEGA2560)
|
||||
#define IS_SKY9X(board) (board==BOARD_SKY9X || board==BOARD_9XRPRO)
|
||||
#define IS_9XRPRO(board) (board==BOARD_9XRPRO)
|
||||
#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_PLUS)
|
||||
#define IS_TARANIS_PLUS(board) (board==BOARD_TARANIS_PLUS)
|
||||
#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_PLUS(board) (board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
|
||||
#define IS_ARM(board) (IS_TARANIS(board) || IS_SKY9X(board))
|
||||
|
||||
const uint8_t modn12x3[4][4]= {
|
||||
|
|
307
companion/src/firmwares/opentx/opentxTaranisX9ESimulator.cpp
Executable file
307
companion/src/firmwares/opentx/opentxTaranisX9ESimulator.cpp
Executable file
|
@ -0,0 +1,307 @@
|
|||
/*
|
||||
* 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 "opentxTaranisX9ESimulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBTARANIS
|
||||
#define CPUARM
|
||||
#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 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 EEPROM_VARIANT 3
|
||||
#define HAPTIC
|
||||
#define REVPLUS
|
||||
#define REV9E
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define NUM_POTS 5
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Open9xX9E {
|
||||
|
||||
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/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/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/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/Taranis/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_channels.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/gui/view_text.cpp"
|
||||
#include "radio/src/gui/view_about.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_taranis.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"
|
||||
// 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/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.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+5];
|
||||
|
||||
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 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()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * OpentxTaranisX9ESimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpentxTaranisX9ESimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpentxTaranisX9ESimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(Open9xX9E::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9E::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisX9ESimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisX9ESimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void OpentxTaranisX9ESimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpentxTaranisX9ESimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpentxTaranisX9ESimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xX9E::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpentxTaranisX9ESimulator::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 = Open9xX9E::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void OpentxTaranisX9ESimulator::wheelEvent(uint8_t steps)
|
||||
{
|
||||
if (steps == 255)
|
||||
x9de_rotenc -= 2;
|
||||
else
|
||||
x9de_rotenc += 2;
|
||||
}
|
||||
|
||||
unsigned int OpentxTaranisX9ESimulator::getPhase()
|
||||
{
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * OpentxTaranisX9ESimulator::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 * OpentxTaranisX9ESimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
61
companion/src/firmwares/opentx/opentxTaranisX9ESimulator.h
Executable file
61
companion/src/firmwares/opentx/opentxTaranisX9ESimulator.h
Executable file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* 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();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
|
@ -25,6 +25,7 @@
|
|||
#include "opentxGruvin9xsimulator.h"
|
||||
#include "opentxSky9xsimulator.h"
|
||||
#include "opentxTaranisSimulator.h"
|
||||
#include "opentxTaranisX9ESimulator.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
|
@ -67,6 +68,8 @@ const char * OpenTxEepromInterface::getName()
|
|||
return "OpenTX for FrSky Taranis";
|
||||
case BOARD_TARANIS_PLUS:
|
||||
return "OpenTX for FrSky Taranis Plus";
|
||||
case BOARD_TARANIS_X9E:
|
||||
return "OpenTX for FrSky Taranis X9E";
|
||||
case BOARD_SKY9X:
|
||||
return "OpenTX for Sky9x board / 9X";
|
||||
case BOARD_9XRPRO:
|
||||
|
@ -91,6 +94,7 @@ const int OpenTxEepromInterface::getEEpromSize()
|
|||
return EESIZE_9XRPRO;
|
||||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_TARANIS_X9E:
|
||||
return EESIZE_TARANIS;
|
||||
default:
|
||||
return 0;
|
||||
|
@ -375,6 +379,7 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
|||
switch(board) {
|
||||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_TARANIS_X9E:
|
||||
case BOARD_SKY9X:
|
||||
case BOARD_9XRPRO:
|
||||
version = 217;
|
||||
|
@ -617,7 +622,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
|||
case SoundPitch:
|
||||
return 1;
|
||||
case Haptic:
|
||||
return (board == BOARD_GRUVIN9X || IS_SKY9X(board) || board == BOARD_TARANIS_PLUS || id.contains("haptic"));
|
||||
return (board == BOARD_GRUVIN9X || IS_SKY9X(board) || IS_TARANIS_PLUS(board) || id.contains("haptic"));
|
||||
case ModelTrainerEnable:
|
||||
if (IS_ARM(board))
|
||||
return 1;
|
||||
|
@ -1013,6 +1018,7 @@ QString OpenTxFirmware::getFirmwareUrl()
|
|||
case BOARD_9XRPRO:
|
||||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_TARANIS_X9E:
|
||||
url.append(QString("/getfw.php?fw=%1.bin").arg(id));
|
||||
break;
|
||||
default:
|
||||
|
@ -1051,6 +1057,8 @@ SimulatorInterface * OpenTxFirmware::getSimulator()
|
|||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
return new OpentxTaranisSimulator();
|
||||
case BOARD_TARANIS_X9E:
|
||||
return new OpentxTaranisX9ESimulator();
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1281,11 +1289,19 @@ void registerOpenTxFirmwares()
|
|||
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
|
||||
openTx->addOption("SWR", QObject::tr("SWR value will be available for display/audio/alarms - Only available on latest Taranis+ production"));
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
default_firmware_variant = GetFirmware("opentx-taranis-en");
|
||||
/* Taranis X9E board */
|
||||
openTx = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("OpenTX for FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
default_firmware_variant = GetFirmware("opentx-taranisplus-en");
|
||||
current_firmware_variant = default_firmware_variant;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,10 @@ if (inputs.rotenc) pind |= 0x20;
|
|||
#ifdef PCBSKY9X
|
||||
if (inputs.rotenc) PIOB->PIO_PDSR &= ~0x40; else PIOB->PIO_PDSR |= 0x40;
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
if (inputs.rotenc) simuSetKey(KEY_ENTER, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef GETVALUES_IMPORT
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#ifndef _DISKIO_DEFINED
|
||||
#define _DISKIO_DEFINED
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -73,7 +73,7 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
|
|||
#define ATA_GET_MODEL 21 /* Get model name */
|
||||
#define ATA_GET_SN 22 /* Get serial number */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#ifndef _FATFS
|
||||
#define _FATFS 80376 /* Revision ID */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -334,7 +334,7 @@ int ff_del_syncobj (_SYNC_t sobj); /* Delete a sync object */
|
|||
#define ST_DWORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8); *((BYTE*)(ptr)+2)=(BYTE)((DWORD)(val)>>16); *((BYTE*)(ptr)+3)=(BYTE)((DWORD)(val)>>24)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -61,13 +61,13 @@ extern uint8_t g_ms100; // global to allow time set function to reset to zero
|
|||
|
||||
void rtcInit();
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
void rtcSetTime(struct gtm * tm);
|
||||
void gettime(struct gtm * tm);
|
||||
gtime_t gmktime (struct gtm *tm);
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -290,16 +290,16 @@ long Open9xSim::onTimeout(FXObject*, FXSelector, void*)
|
|||
SWITCH_KEY(F, 5, 3);
|
||||
SWITCH_KEY(G, 6, 3);
|
||||
SWITCH_KEY(H, 7, 3);
|
||||
SWITCH_KEY(I, 8, 3);
|
||||
SWITCH_KEY(J, 9, 3);
|
||||
SWITCH_KEY(K, 10, 3);
|
||||
SWITCH_KEY(L, 11, 3);
|
||||
SWITCH_KEY(M, 12, 3);
|
||||
SWITCH_KEY(N, 13, 3);
|
||||
SWITCH_KEY(O, 14, 3);
|
||||
SWITCH_KEY(P, 15, 3);
|
||||
SWITCH_KEY(Q, 16, 3);
|
||||
SWITCH_KEY(R, 17, 3);
|
||||
// SWITCH_KEY(I, 8, 3);
|
||||
// SWITCH_KEY(J, 9, 3);
|
||||
// SWITCH_KEY(K, 10, 3);
|
||||
// SWITCH_KEY(L, 11, 3);
|
||||
// SWITCH_KEY(M, 12, 3);
|
||||
// SWITCH_KEY(N, 13, 3);
|
||||
// SWITCH_KEY(O, 14, 3);
|
||||
// SWITCH_KEY(P, 15, 3);
|
||||
// SWITCH_KEY(Q, 16, 3);
|
||||
// SWITCH_KEY(R, 17, 3);
|
||||
#elif defined(PCBTARANIS)
|
||||
SWITCH_KEY(A, 0, 3);
|
||||
SWITCH_KEY(B, 1, 3);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#ifndef __STM32F2xx_GPIO_H
|
||||
#define __STM32F2xx_GPIO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -394,7 +394,7 @@ void GPIO_ToggleBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
|
|||
/* GPIO Alternate functions configuration function ****************************/
|
||||
void GPIO_PinAFConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#ifndef __STM32F2xx_I2C_H
|
||||
#define __STM32F2xx_I2C_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -681,7 +681,7 @@ void I2C_ClearFlag(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG);
|
|||
ITStatus I2C_GetITStatus(I2C_TypeDef* I2Cx, uint32_t I2C_IT);
|
||||
void I2C_ClearITPendingBit(I2C_TypeDef* I2Cx, uint32_t I2C_IT);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#ifndef __STM32F2xx_PWR_H
|
||||
#define __STM32F2xx_PWR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -149,7 +149,7 @@ void PWR_EnterSTANDBYMode(void);
|
|||
FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG);
|
||||
void PWR_ClearFlag(uint32_t PWR_FLAG);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef __STM32F2xx_RCC_H
|
||||
#define __STM32F2xx_RCC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -498,7 +498,7 @@ void RCC_ClearFlag(void);
|
|||
ITStatus RCC_GetITStatus(uint8_t RCC_IT);
|
||||
void RCC_ClearITPendingBit(uint8_t RCC_IT);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#ifndef __STM32F2xx_RTC_H
|
||||
#define __STM32F2xx_RTC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -633,7 +633,7 @@ void RTC_ClearFlag(uint32_t RTC_FLAG);
|
|||
ITStatus RTC_GetITStatus(uint32_t RTC_IT);
|
||||
void RTC_ClearITPendingBit(uint32_t RTC_IT);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#ifndef __STM32F2xx_SPI_H
|
||||
#define __STM32F2xx_SPI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -509,7 +509,7 @@ void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG);
|
|||
ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT);
|
||||
void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#ifndef __STM32F2xx_USART_H
|
||||
#define __STM32F2xx_USART_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -412,7 +412,7 @@ void USART_ClearFlag(USART_TypeDef* USARTx, uint16_t USART_FLAG);
|
|||
ITStatus USART_GetITStatus(USART_TypeDef* USARTx, uint16_t USART_IT);
|
||||
void USART_ClearITPendingBit(USART_TypeDef* USARTx, uint16_t USART_IT);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#ifndef _ASPI_H_
|
||||
#define _ASPI_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -37,7 +37,7 @@ extern "C" {
|
|||
void AspiCmd(u8 Command_Byte);
|
||||
void AspiData(u8 Para_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ void audioEnd()
|
|||
NVIC_DisableIRQ(DMA1_Stream5_IRQn) ;
|
||||
}
|
||||
|
||||
#ifndef SIMU
|
||||
#if !defined(SIMU)
|
||||
extern "C" void TIM6_DAC_IRQHandler()
|
||||
{
|
||||
DAC->CR &= ~DAC_CR_DMAEN1 ; // Stop DMA requests
|
||||
|
|
|
@ -36,11 +36,15 @@
|
|||
|
||||
#include "../../opentx.h"
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd_int.h"
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_bsp.h"
|
||||
#include "STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dbgmcu.h"
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
volatile uint32_t Tenms ; // TODO to remove everywhere / use a #define
|
||||
|
||||
|
@ -111,13 +115,13 @@ void interrupt5ms()
|
|||
#endif
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" void TIM8_TRG_COM_TIM14_IRQHandler()
|
||||
{
|
||||
TIM14->SR &= ~TIM_SR_UIF ;
|
||||
interrupt5ms() ;
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
void boardInit()
|
||||
{
|
||||
pwrInit();
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include "stddef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -65,7 +65,7 @@ extern "C" {
|
|||
#include "aspi.h"
|
||||
#include "i2c.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -197,7 +197,7 @@ extern volatile uint16_t Analog_values[];
|
|||
#define BATT_SCALE 150
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -234,7 +234,7 @@ void usbStart(void);
|
|||
void usbStop(void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -36,11 +36,15 @@
|
|||
|
||||
#include "../../opentx.h"
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd_int.h"
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_bsp.h"
|
||||
#include "STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dbgmcu.h"
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
void configure_pins( uint32_t pins, uint16_t config )
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#define WP_H do{I2C_EE_WP_GPIO->BSRRL = I2C_EE_WP;}while(0)
|
||||
#define WP_L do{I2C_EE_WP_GPIO->BSRRH = I2C_EE_WP;}while(0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -48,7 +48,7 @@ void I2C_EE_WaitEepromStandbyState(void);
|
|||
void I2C_set_volume(register uint8_t volume);
|
||||
uint8_t I2C_read_volume(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -335,6 +335,7 @@ static void disable_pa10_ppm()
|
|||
INTERNAL_RF_OFF();
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" void TIM1_CC_IRQHandler()
|
||||
{
|
||||
TIM1->DIER &= ~TIM_DIER_CC2IE ; // stop this interrupt
|
||||
|
@ -372,8 +373,9 @@ extern "C" void TIM1_UP_TIM10_IRQHandler()
|
|||
TIM1->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void init_pa7_pxx()
|
||||
void init_pa7_pxx()
|
||||
{
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
||||
|
@ -584,6 +586,7 @@ static void disable_pa7_ppm()
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" void TIM8_CC_IRQHandler()
|
||||
{
|
||||
TIM8->DIER &= ~TIM_DIER_CC2IE ; // stop this interrupt
|
||||
|
@ -630,4 +633,4 @@ extern "C" void TIM8_UP_TIM13_IRQHandler()
|
|||
TIM8->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "../opentx.h"
|
||||
#include "../../opentx.h"
|
||||
|
||||
void rotencInit()
|
||||
{
|
||||
|
|
|
@ -109,6 +109,7 @@ void stop_trainer_capture()
|
|||
NVIC_DisableIRQ(TIM3_IRQn) ; // Stop Interrupt
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" void TIM3_IRQHandler()
|
||||
{
|
||||
uint16_t capture = 0;
|
||||
|
@ -176,6 +177,7 @@ extern "C" void TIM3_IRQHandler()
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void init_cppm_on_heartbeat_capture(void)
|
||||
{
|
||||
|
@ -253,6 +255,7 @@ void stop_sbus_on_heartbeat_capture(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" void USART6_IRQHandler()
|
||||
{
|
||||
uint32_t status;
|
||||
|
@ -269,3 +272,4 @@ extern "C" void USART6_IRQHandler()
|
|||
status = USART6->SR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -128,6 +128,7 @@ void uart3Stop()
|
|||
USART_DeInit(USART3);
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" void USART3_IRQHandler(void)
|
||||
{
|
||||
// Send
|
||||
|
@ -161,4 +162,5 @@ extern "C" void USART3_IRQHandler(void)
|
|||
status = USART3->SR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include "../../FatFs/diskio.h"
|
||||
#include "board_taranis.h"
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/misc.h"
|
||||
#include "usbd_msc_mem.h"
|
||||
#include "usb_conf.h"
|
||||
|
@ -118,7 +120,10 @@ USBD_STORAGE_cb_TypeDef USBD_MICRO_SDIO_fops =
|
|||
USBD_STORAGE_cb_TypeDef *USBD_STORAGE_fops = &USBD_MICRO_SDIO_fops;
|
||||
|
||||
__IO uint32_t count = 0;
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t STORAGE_Init (uint8_t lun)
|
||||
{
|
||||
|
|
|
@ -427,7 +427,10 @@
|
|||
#define LEN_VSWITCHES "\003"
|
||||
#define LEN_VSRCRAW "\004"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
#define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 "
|
||||
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 ""SI\0 ""SJ\0 ""SK\0 ""SL\0 ""SM\0 ""SN\0 ""SO\0 ""SP\0 ""SQ\0 ""SR\0 "
|
||||
#elif defined(PCBTARANIS)
|
||||
#define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 "
|
||||
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 ""SI\0 ""SJ\0 ""SK\0 ""SL\0 ""SM\0 ""SN\0 "
|
||||
#elif defined(EXTRA_3POS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue