/* * Copyright (C) EdgeTX * * Based on code named * opentx - https://github.com/opentx/opentx * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x * * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html * * 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. */ #pragma once #include #include #include #define SWAP_DEFINED #include "edgetx.h" #include "model_init.h" #include "switches.h" #include "hal/switch_driver.h" #define CHANNEL_MAX (1024*256) extern int32_t lastAct; // from hal/adc_driver.cpp extern void anaResetFiltered(); extern void anaSetFiltered(uint8_t chan, uint16_t val); void doMixerCalculations(); extern const char * zchar2string(const char * zstring, int size); extern const char * nchar2string(const char * string, int size); #define EXPECT_ZSTREQ(c_string, z_string) EXPECT_STREQ(c_string, zchar2string(z_string, sizeof(z_string))) #define EXPECT_STRNEQ(c_string, n_string) EXPECT_STREQ(c_string, nchar2string(n_string, sizeof(n_string))) #if defined(PCBFRSKY) #define RADIO_RESET() \ g_eeGeneral.switchConfig = 0x00007bff #else #define RADIO_RESET() #endif inline void SYSTEM_RESET() { #if !defined(STORAGE_MODELSLIST) memset(modelHeaders, 0, sizeof(modelHeaders)); #endif generalDefault(); g_eeGeneral.templateSetup = 0; for (int i=0; i