mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Merge pull request #602 from martinbudden/bf_gyro_tidy
gyro sync and initialisation cleanup
This commit is contained in:
commit
9843d7ce2f
24 changed files with 87 additions and 115 deletions
|
@ -49,7 +49,6 @@
|
|||
#include "drivers/inverter.h"
|
||||
#include "drivers/flash_m25p16.h"
|
||||
#include "drivers/sonar_hcsr04.h"
|
||||
#include "drivers/gyro_sync.h"
|
||||
#include "drivers/sdcard.h"
|
||||
#include "drivers/usb_io.h"
|
||||
#include "drivers/transponder_ir.h"
|
||||
|
@ -625,7 +624,7 @@ void init(void)
|
|||
if (masterConfig.mixerMode == MIXER_GIMBAL) {
|
||||
accSetCalibrationCycles(CALIBRATING_ACC_CYCLES);
|
||||
}
|
||||
gyroSetCalibrationCycles(calculateCalibratingCycles());
|
||||
gyroSetCalibrationCycles();
|
||||
#ifdef BARO
|
||||
baroSetCalibrationCycles(CALIBRATING_BARO_CYCLES);
|
||||
#endif
|
||||
|
@ -693,12 +692,12 @@ void main_init(void)
|
|||
|
||||
/* Setup scheduler */
|
||||
schedulerInit();
|
||||
rescheduleTask(TASK_GYROPID, targetLooptime);
|
||||
rescheduleTask(TASK_GYROPID, gyro.targetLooptime);
|
||||
setTaskEnabled(TASK_GYROPID, true);
|
||||
|
||||
if(sensors(SENSOR_ACC)) {
|
||||
setTaskEnabled(TASK_ACCEL, true);
|
||||
switch(targetLooptime) { // Switch statement kept in place to change acc rates in the future
|
||||
switch(gyro.targetLooptime) { // Switch statement kept in place to change acc rates in the future
|
||||
case(500):
|
||||
case(375):
|
||||
case(250):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue