diff --git a/docs/Settings.md b/docs/Settings.md index 874337ad2a8..b846c06deba 100644 --- a/docs/Settings.md +++ b/docs/Settings.md @@ -212,16 +212,6 @@ ADC channel to use for analog pitot tube (airspeed) sensor. If board doesn't hav --- -### align_acc - -When running on non-default hardware or adding support for new sensors/sensor boards, these values are used for sensor orientation. When carefully understood, these values can also be used to rotate (in 90deg steps) or flip the board. Possible values are: DEFAULT, CW0_DEG, CW90_DEG, CW180_DEG, CW270_DEG, CW0_DEG_FLIP, CW90_DEG_FLIP, CW180_DEG_FLIP, CW270_DEG_FLIP. - -| Default | Min | Max | -| --- | --- | --- | -| DEFAULT | | | - ---- - ### align_board_pitch Arbitrary board rotation in deci-degrees (0.1 degree), to allow mounting it sideways / upside down / rotated etc @@ -252,16 +242,6 @@ Arbitrary board rotation in deci-degrees (0.1 degree), to allow mounting it side --- -### align_gyro - -When running on non-default hardware or adding support for new sensors/sensor boards, these values are used for sensor orientation. When carefully understood, these values can also be used to rotate (in 90deg steps) or flip the board. Possible values are: DEFAULT, CW0_DEG, CW90_DEG, CW180_DEG, CW270_DEG, CW0_DEG_FLIP, CW90_DEG_FLIP, CW180_DEG_FLIP, CW270_DEG_FLIP. - -| Default | Min | Max | -| --- | --- | --- | -| DEFAULT | | | - ---- - ### align_mag When running on non-default hardware or adding support for new sensors/sensor boards, these values are used for sensor orientation. When carefully understood, these values can also be used to rotate (in 90deg steps) or flip the board. Possible values are: DEFAULT, CW0_DEG, CW90_DEG, CW180_DEG, CW270_DEG, CW0_DEG_FLIP, CW90_DEG_FLIP, CW180_DEG_FLIP, CW270_DEG_FLIP. diff --git a/src/main/fc/fc_msp.c b/src/main/fc/fc_msp.c index c5159bf4838..304d9bf42b2 100644 --- a/src/main/fc/fc_msp.c +++ b/src/main/fc/fc_msp.c @@ -1154,8 +1154,8 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF break; case MSP_SENSOR_ALIGNMENT: - sbufWriteU8(dst, gyroConfig()->gyro_align); - sbufWriteU8(dst, accelerometerConfig()->acc_align); + sbufWriteU8(dst, 0); // was gyroConfig()->gyro_align + sbufWriteU8(dst, 0); // was accelerometerConfig()->acc_align #ifdef USE_MAG sbufWriteU8(dst, compassConfig()->mag_align); #else @@ -2061,8 +2061,8 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src) case MSP_SET_SENSOR_ALIGNMENT: if (dataSize == 4) { - gyroConfigMutable()->gyro_align = sbufReadU8(src); - accelerometerConfigMutable()->acc_align = sbufReadU8(src); + sbufReadU8(src); // was gyroConfigMutable()->gyro_align + sbufReadU8(src); // was accelerometerConfigMutable()->acc_align #ifdef USE_MAG compassConfigMutable()->mag_align = sbufReadU8(src); #else diff --git a/src/main/fc/settings.yaml b/src/main/fc/settings.yaml index f1717aa6b94..08a33a22f04 100644 --- a/src/main/fc/settings.yaml +++ b/src/main/fc/settings.yaml @@ -216,12 +216,6 @@ groups: description: "This is the main loop time (in us). Changing this affects PID effect with some PID controllers (see PID section for details). A very conservative value of 3500us/285Hz should work for everyone. Setting it to zero does not limit loop time, so it will go as fast as possible." default_value: 1000 max: 9000 - - name: align_gyro - description: "When running on non-default hardware or adding support for new sensors/sensor boards, these values are used for sensor orientation. When carefully understood, these values can also be used to rotate (in 90deg steps) or flip the board. Possible values are: DEFAULT, CW0_DEG, CW90_DEG, CW180_DEG, CW270_DEG, CW0_DEG_FLIP, CW90_DEG_FLIP, CW180_DEG_FLIP, CW270_DEG_FLIP." - default_value: "DEFAULT" - field: gyro_align - type: uint8_t - table: alignment - name: gyro_hardware_lpf description: "Hardware lowpass filter for gyro. This value should never be changed without a very strong reason! If you have to set gyro lpf below 256HZ, it means the frame is vibrating too much, and that should be fixed first." default_value: "256HZ" @@ -386,12 +380,6 @@ groups: min: 1 max: 255 default_value: 1 - - name: align_acc - description: "When running on non-default hardware or adding support for new sensors/sensor boards, these values are used for sensor orientation. When carefully understood, these values can also be used to rotate (in 90deg steps) or flip the board. Possible values are: DEFAULT, CW0_DEG, CW90_DEG, CW180_DEG, CW270_DEG, CW0_DEG_FLIP, CW90_DEG_FLIP, CW180_DEG_FLIP, CW270_DEG_FLIP." - default_value: "DEFAULT" - field: acc_align - type: uint8_t - table: alignment - name: acc_hardware description: "Selection of acc hardware. See Wiki Sensor auto detect and hardware failure detection for more info" default_value: "AUTO" diff --git a/src/main/sensors/acceleration.c b/src/main/sensors/acceleration.c index d2ad6790000..9eb440f65ef 100644 --- a/src/main/sensors/acceleration.c +++ b/src/main/sensors/acceleration.c @@ -84,12 +84,11 @@ static EXTENDED_FASTRAM pt1Filter_t accVibeFilter[XYZ_AXIS_COUNT]; static EXTENDED_FASTRAM filterApplyFnPtr accNotchFilterApplyFn; static EXTENDED_FASTRAM void *accNotchFilter[XYZ_AXIS_COUNT]; -PG_REGISTER_WITH_RESET_FN(accelerometerConfig_t, accelerometerConfig, PG_ACCELEROMETER_CONFIG, 4); +PG_REGISTER_WITH_RESET_FN(accelerometerConfig_t, accelerometerConfig, PG_ACCELEROMETER_CONFIG, 5); void pgResetFn_accelerometerConfig(accelerometerConfig_t *instance) { RESET_CONFIG_2(accelerometerConfig_t, instance, - .acc_align = SETTING_ALIGN_ACC_DEFAULT, .acc_hardware = SETTING_ACC_HARDWARE_DEFAULT, .acc_lpf_hz = SETTING_ACC_LPF_HZ_DEFAULT, .acc_notch_hz = SETTING_ACC_NOTCH_HZ_DEFAULT, @@ -291,11 +290,6 @@ bool accInit(uint32_t targetLooptime) acc.extremes[axis].max = -100; } - // At this poinrt acc.dev.accAlign was set up by the driver from the busDev record - // If configuration says different - override - if (accelerometerConfig()->acc_align != ALIGN_DEFAULT) { - acc.dev.accAlign = accelerometerConfig()->acc_align; - } return true; } diff --git a/src/main/sensors/acceleration.h b/src/main/sensors/acceleration.h index 76f3a6ea5ce..88893a0ac7d 100644 --- a/src/main/sensors/acceleration.h +++ b/src/main/sensors/acceleration.h @@ -67,7 +67,6 @@ typedef struct acc_s { extern acc_t acc; typedef struct accelerometerConfig_s { - sensor_align_e acc_align; // acc alignment uint8_t acc_hardware; // Which acc hardware to use on boards with more than one device uint16_t acc_lpf_hz; // cutoff frequency for the low pass filter used on the acc z-axis for althold in Hz flightDynamicsTrims_t accZero; // Accelerometer offset diff --git a/src/main/sensors/gyro.c b/src/main/sensors/gyro.c index 276406664dd..d23779abdf5 100644 --- a/src/main/sensors/gyro.c +++ b/src/main/sensors/gyro.c @@ -97,13 +97,12 @@ EXTENDED_FASTRAM dynamicGyroNotchState_t dynamicGyroNotchState; #endif -PG_REGISTER_WITH_RESET_TEMPLATE(gyroConfig_t, gyroConfig, PG_GYRO_CONFIG, 3); +PG_REGISTER_WITH_RESET_TEMPLATE(gyroConfig_t, gyroConfig, PG_GYRO_CONFIG, 4); PG_RESET_TEMPLATE(gyroConfig_t, gyroConfig, .gyro_lpf = SETTING_GYRO_HARDWARE_LPF_DEFAULT, .gyro_anti_aliasing_lpf_hz = SETTING_GYRO_ANTI_ALIASING_LPF_HZ_DEFAULT, .gyro_anti_aliasing_lpf_type = SETTING_GYRO_ANTI_ALIASING_LPF_TYPE_DEFAULT, - .gyro_align = SETTING_ALIGN_GYRO_DEFAULT, .gyroMovementCalibrationThreshold = SETTING_MORON_THRESHOLD_DEFAULT, .looptime = SETTING_LOOPTIME_DEFAULT, #ifdef USE_DUAL_GYRO @@ -304,13 +303,7 @@ bool gyroInit(void) // initFn will initialize sampleRateIntervalUs to actual gyro sampling rate (if driver supports it). Calculate target looptime using that value gyro.targetLooptime = gyroDev[0].sampleRateIntervalUs; - - // At this poinrt gyroDev[0].gyroAlign was set up by the driver from the busDev record - // If configuration says different - override - if (gyroConfig()->gyro_align != ALIGN_DEFAULT) { - gyroDev[0].gyroAlign = gyroConfig()->gyro_align; - } - + gyroInitFilters(); #ifdef USE_DYNAMIC_FILTERS diff --git a/src/main/sensors/gyro.h b/src/main/sensors/gyro.h index 3bb99772cc7..88e15db8c80 100644 --- a/src/main/sensors/gyro.h +++ b/src/main/sensors/gyro.h @@ -53,7 +53,6 @@ typedef struct gyro_s { extern gyro_t gyro; typedef struct gyroConfig_s { - sensor_align_e gyro_align; // gyro alignment uint8_t gyroMovementCalibrationThreshold; // people keep forgetting that moving model while init results in wrong gyro offsets. and then they never reset gyro. so this is now on by default. uint16_t looptime; // imu loop time in us uint8_t gyro_lpf; // gyro LPF setting - values are driver specific, in case of invalid number, a reasonable default ~30-40HZ is chosen. diff --git a/src/main/target/BLUEJAYF4/CMakeLists.txt b/src/main/target/BLUEJAYF4/CMakeLists.txt index 2c93878cffb..dd197a14d07 100644 --- a/src/main/target/BLUEJAYF4/CMakeLists.txt +++ b/src/main/target/BLUEJAYF4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405xg(BLUEJAYF4) +target_stm32f405xg(BLUEJAYF4 SKIP_RELEASES) diff --git a/src/main/target/BLUEJAYF4/config.c b/src/main/target/BLUEJAYF4/config.c index bde1ed0396a..a66b6d443eb 100644 --- a/src/main/target/BLUEJAYF4/config.c +++ b/src/main/target/BLUEJAYF4/config.c @@ -27,8 +27,4 @@ // alternative defaults settings for BlueJayF4 targets void targetConfiguration(void) { - if (hardwareRevision == BJF4_REV1 || hardwareRevision == BJF4_REV2) { - gyroConfigMutable()->gyro_align = CW180_DEG; - accelerometerConfigMutable()->acc_align = CW180_DEG; - } }