changed feature to set variable

This commit is contained in:
Johannes Kasberger 2014-04-15 14:26:02 +02:00
parent 5377b39f36
commit 385c4387b7
5 changed files with 6 additions and 4 deletions

View File

@ -75,7 +75,6 @@ typedef enum {
FEATURE_POWERMETER = 1 << 12,
FEATURE_VARIO = 1 << 13,
FEATURE_3D = 1 << 14,
FEATURE_OVERCLOCK = 1 << 15,
} AvailableFeatures;
typedef enum {

View File

@ -54,7 +54,7 @@ static const char * const mixerNames[] = {
static const char * const featureNames[] = {
"PPM", "VBAT", "INFLIGHT_ACC_CAL", "SERIALRX", "MOTOR_STOP",
"SERVO_TILT", "SOFTSERIAL", "LED_RING", "GPS",
"FAILSAFE", "SONAR", "TELEMETRY", "POWERMETER", "VARIO", "3D", "OVERCLOCK",
"FAILSAFE", "SONAR", "TELEMETRY", "POWERMETER", "VARIO", "3D",
NULL
};
@ -113,6 +113,7 @@ typedef struct {
const clivalue_t valueTable[] = {
{ "looptime", VAR_UINT16, &mcfg.looptime, 0, 9000 },
{ "emf_avoidance", VAR_UINT8, &mcfg.emfAvoidance, 0, 1 },
{ "midrc", VAR_UINT16, &mcfg.midrc, 1200, 1700 },
{ "minthrottle", VAR_UINT16, &mcfg.minthrottle, 0, 2000 },
{ "maxthrottle", VAR_UINT16, &mcfg.maxthrottle, 0, 2000 },

View File

@ -13,7 +13,7 @@ master_t mcfg; // master config struct with data independent from profiles
config_t cfg; // profile config struct
const char rcChannelLetters[] = "AERT1234";
static const uint8_t EEPROM_CONF_VERSION = 62;
static const uint8_t EEPROM_CONF_VERSION = 63;
static uint32_t enabledSensors = 0;
static void resetConf(void);
@ -228,6 +228,7 @@ static void resetConf(void)
mcfg.softserial_1_inverted = 0;
mcfg.softserial_2_inverted = 0;
mcfg.looptime = 3500;
mcfg.emfAvoidance = 0;
mcfg.rssi_aux_channel = 0;
cfg.pidController = 0;

View File

@ -38,7 +38,7 @@ int main(void)
#endif
checkFirstTime(false);
readEEPROM();
systemInit(feature(FEATURE_OVERCLOCK));
systemInit(mcfg.emfAvoidance);
#ifdef USE_LAME_PRINTF
init_printf(NULL, _putc);
#endif

View File

@ -224,6 +224,7 @@ typedef struct master_t {
uint8_t mixerConfiguration;
uint32_t enabledFeatures;
uint16_t looptime; // imu loop time in us
uint8_t emfAvoidance; // change pll settings to avoid noise in the uhf band
motorMixer_t customMixer[MAX_MOTORS]; // custom mixtable
// motor/esc/servo related stuff