/* * Author - Bertrand Songis * * 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 "firmwares/er9x/er9xsimulator.h" #include "firmwares/er9x/er9xinterface.h" #define SIMU #define SIMU_EXCEPTIONS #define TELEMETRY_FRSKY #define PHASES #undef min #undef max #define NUM_POTS 3 #define SWSRC_SW1 DSW_SW1 #include namespace Er9x { #include "simpgmspace.h" #include "er9x.cpp" #include "stamp.cpp" #include "menus.cpp" #include "pers.cpp" #include "file.cpp" #include "lcd.cpp" #include "drivers.cpp" #include "simpgmspace.cpp" #include "templates.cpp" #include "frsky.cpp" #include "audio.cpp" uint8_t pxxFlag = 0; int16_t g_anas[7]; #define isBacklightEnable() (PORTB & (1<= 0) pin1 &= ~(mask1); else pin1 |= (mask1); \ if (state <= 0) pin2 &= ~(mask2); else pin2 |= (mask2); \ break; void simuSetSwitch(uint8_t swtch, int8_t state) { switch (swtch) { SWITCH_CASE(0, pinc, 1<save(&eeprom[0], radioData); StartMainThread(tests); } void Er9xSimulator::stop() { StopMainThread(); } void Er9xSimulator::getValues(TxOutputs &outputs) { #define GETVALUES_IMPORT #include "simulatorimport.h" outputs.beep = audio.busy(); } void Er9xSimulator::setValues(TxInputs &inputs) { #define SETVALUES_IMPORT #include "simulatorimport.h" } void Er9xSimulator::setTrim(unsigned int idx, int value) { Er9x::setTrim(idx, value); } void Er9xSimulator::getTrims(Trims & trims) { trims.extended = false; Er9x::getTrims(trims.values); } const char * Er9xSimulator::getError() { #define GETERROR_IMPORT #include "simulatorimport.h" }