From a9c775b03d9725f217e4157950c5e31410d8dd10 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Fri, 18 Sep 2015 20:31:48 +0100 Subject: [PATCH 1/5] Delete unused FAILURE_MODE_COUNT value. --- src/main/drivers/system.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/drivers/system.h b/src/main/drivers/system.h index 67ea4a3f4a..e6b62d7305 100644 --- a/src/main/drivers/system.h +++ b/src/main/drivers/system.h @@ -52,4 +52,3 @@ typedef enum { FAILURE_FLASH_WRITE_FAILED } failureMode_e; -#define FAILURE_MODE_COUNT 4 From 0d391eccc483cfd4fde69ea0742ab7709eb531cf Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 19 Sep 2015 14:23:50 +0100 Subject: [PATCH 2/5] Remove some test code that was accidentally commited in c6f5b98a7916a369bcf9445d04feef4036dc3ce5 --- src/main/drivers/accgyro_mpu6050.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/drivers/accgyro_mpu6050.c b/src/main/drivers/accgyro_mpu6050.c index 8b71ad2cba..15d2c28fe7 100644 --- a/src/main/drivers/accgyro_mpu6050.c +++ b/src/main/drivers/accgyro_mpu6050.c @@ -439,10 +439,8 @@ static void mpu6050GyroInit(void) // Accel scale 8g (4096 LSB/g) ack = i2cWrite(MPU6050_ADDRESS, MPU_RA_ACCEL_CONFIG, INV_FSR_8G << 3); -// ack = i2cWrite(MPU6050_ADDRESS, MPU_RA_INT_PIN_CFG, -// 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0); // INT_PIN_CFG -- INT_LEVEL_HIGH, INT_OPEN_DIS, LATCH_INT_DIS, INT_RD_CLEAR_DIS, FSYNC_INT_LEVEL_HIGH, FSYNC_INT_DIS, I2C_BYPASS_EN, CLOCK_DIS ack = i2cWrite(MPU6050_ADDRESS, MPU_RA_INT_PIN_CFG, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0); // INT_PIN_CFG -- INT_LEVEL_HIGH, INT_OPEN_DIS, LATCH_INT_DIS, INT_RD_CLEAR_DIS, FSYNC_INT_LEVEL_HIGH, FSYNC_INT_DIS, I2C_BYPASS_EN, CLOCK_DIS + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0); // INT_PIN_CFG -- INT_LEVEL_HIGH, INT_OPEN_DIS, LATCH_INT_DIS, INT_RD_CLEAR_DIS, FSYNC_INT_LEVEL_HIGH, FSYNC_INT_DIS, I2C_BYPASS_EN, CLOCK_DIS #ifdef USE_MPU_DATA_READY_SIGNAL ack = i2cWrite(MPU6050_ADDRESS, MPU_RA_INT_ENABLE, MPU_RF_DATA_RDY_EN); From e0f4ddeccd344c14e896497b73d7f71ecabad26b Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 19 Sep 2015 14:26:09 +0100 Subject: [PATCH 3/5] Fix typo from c6f5b98a7916a369bcf9445d04feef4036dc3ce5. --- src/main/drivers/compass_ak8975.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/drivers/compass_ak8975.c b/src/main/drivers/compass_ak8975.c index 365e24968f..57260d86cb 100644 --- a/src/main/drivers/compass_ak8975.c +++ b/src/main/drivers/compass_ak8975.c @@ -129,7 +129,7 @@ bool ak8975Read(int16_t *magData) for (uint8_t i = 0; i < 6; i++) { ack = i2cRead(AK8975_MAG_I2C_ADDRESS, AK8975_MAG_REG_HXL + i, 1, &buf[i]); // read from AK8975_MAG_REG_HXL to AK8975_MAG_REG_HZH if (!ack) { - break false + return false } } #endif From 0d6d83925f6fa5e5f7c2ef1bc5afad1721ef079e Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 19 Sep 2015 14:30:27 +0100 Subject: [PATCH 4/5] Fix hmc5883 detection broken in c6f5b98a7916a369bcf9445d04feef4036dc3ce5 --- src/main/drivers/compass_hmc5883l.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/drivers/compass_hmc5883l.c b/src/main/drivers/compass_hmc5883l.c index a59186d51f..6911034a7d 100644 --- a/src/main/drivers/compass_hmc5883l.c +++ b/src/main/drivers/compass_hmc5883l.c @@ -310,7 +310,7 @@ bool hmc5883lRead(int16_t *magData) uint8_t buf[6]; bool ack = i2cRead(MAG_ADDRESS, MAG_DATA_REGISTER, 6, buf); - if (ack) { + if (!ack) { return false; } // During calibration, magGain is 1.0, so the read returns normal non-calibrated values. From bc7dfb5ff53e5be4b396d1b4709102f7bd5817be Mon Sep 17 00:00:00 2001 From: borisbstyle Date: Thu, 24 Sep 2015 13:56:40 +0200 Subject: [PATCH 5/5] Fix for changing PID's for users with Inflight Adjustments Users who upgraded from 1.9 and have inflight adjustments configured now experience changed PID's. Sometimes even to dangerous and unflyable situation. Sometimes rx boots slower than the FC This is because AUX channels go low and usually thats where they change things. IMO the new failsafe behaviour for AUX should be midrc default like before! cleanup --- src/main/config/config.c | 4 ++-- src/main/rx/rx.c | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/config/config.c b/src/main/config/config.c index 6189322f5a..481be5680f 100755 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -128,7 +128,7 @@ static uint32_t activeFeaturesLatch = 0; static uint8_t currentControlRateProfileIndex = 0; controlRateConfig_t *currentControlRateProfile; -static const uint8_t EEPROM_CONF_VERSION = 105; +static const uint8_t EEPROM_CONF_VERSION = 106; static void resetAccelerometerTrims(flightDynamicsTrims_t *accelerometerTrims) { @@ -413,7 +413,7 @@ static void resetConf(void) for (i = 0; i < MAX_SUPPORTED_RC_CHANNEL_COUNT; i++) { rxFailsafeChannelConfiguration_t *channelFailsafeConfiguration = &masterConfig.rxConfig.failsafe_channel_configurations[i]; - channelFailsafeConfiguration->mode = (i < NON_AUX_CHANNEL_COUNT) ? RX_FAILSAFE_MODE_AUTO : RX_FAILSAFE_MODE_HOLD; + channelFailsafeConfiguration->mode = RX_FAILSAFE_MODE_AUTO; channelFailsafeConfiguration->step = (i == THROTTLE) ? masterConfig.rxConfig.rx_min_usec : CHANNEL_VALUE_TO_RXFAIL_STEP(masterConfig.rxConfig.midrc); } diff --git a/src/main/rx/rx.c b/src/main/rx/rx.c index 67c184f9ff..32fad2449c 100644 --- a/src/main/rx/rx.c +++ b/src/main/rx/rx.c @@ -368,16 +368,13 @@ static uint16_t getRxfailValue(uint8_t channel) switch(channelFailsafeConfiguration->mode) { case RX_FAILSAFE_MODE_AUTO: switch (channel) { - case ROLL: - case PITCH: - case YAW: - return rxConfig->midrc; - case THROTTLE: if (feature(FEATURE_3D)) return rxConfig->midrc; else return rxConfig->rx_min_usec; + default: + return rxConfig->midrc; } /* no break */