From 385c4387b7432c7a7f0365570029eb6c8f132de6 Mon Sep 17 00:00:00 2001 From: Johannes Kasberger Date: Tue, 15 Apr 2014 14:26:02 +0200 Subject: [PATCH] changed feature to set variable --- src/board.h | 1 - src/cli.c | 3 ++- src/config.c | 3 ++- src/main.c | 2 +- src/mw.h | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/board.h b/src/board.h index c9c8c0df55..a41e734cd3 100755 --- a/src/board.h +++ b/src/board.h @@ -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 { diff --git a/src/cli.c b/src/cli.c index 9a18ebb2e4..643aa72501 100644 --- a/src/cli.c +++ b/src/cli.c @@ -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 }, diff --git a/src/config.c b/src/config.c index f859fed46c..13bf2e888f 100755 --- a/src/config.c +++ b/src/config.c @@ -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; diff --git a/src/main.c b/src/main.c index a3285a5063..5a886debdc 100755 --- a/src/main.c +++ b/src/main.c @@ -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 diff --git a/src/mw.h b/src/mw.h index 7a89cc63a1..4cb04116ea 100755 --- a/src/mw.h +++ b/src/mw.h @@ -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