mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Code Cleanup
More code cleanup and BUMP EEPROM Code Cleanup Fix loop trigger
This commit is contained in:
parent
70d04e46d0
commit
0501e5ff91
29 changed files with 7377 additions and 81207 deletions
|
@ -43,11 +43,10 @@ bool gyroSyncCheckUpdate(void) {
|
|||
return getMpuDataStatus(&gyro);
|
||||
}
|
||||
|
||||
void gyroUpdateSampleRate(uint32_t looptime, uint8_t lpf, uint8_t syncGyroToLoop) {
|
||||
void gyroUpdateSampleRate(uint8_t lpf) {
|
||||
int gyroSamplePeriod;
|
||||
int minLooptime;
|
||||
|
||||
if (syncGyroToLoop) {
|
||||
#if defined(SPRACINGF3) || defined(ALIENWIIF3) || defined(NAZE32PRO) || defined(STM32F3DISCOVERY) || defined(CHEBUZZF3) || defined(PORT103R) || defined(MOTOLAB) || defined(SPARKY)
|
||||
if (lpf == INV_FILTER_256HZ_NOLPF2) {
|
||||
gyroSamplePeriod = 125;
|
||||
|
@ -106,13 +105,8 @@ void gyroUpdateSampleRate(uint32_t looptime, uint8_t lpf, uint8_t syncGyroToLoop
|
|||
}
|
||||
}
|
||||
#endif
|
||||
looptime = constrain(looptime, minLooptime, 4000);
|
||||
mpuDividerDrops = (looptime + gyroSamplePeriod -1 ) / gyroSamplePeriod - 1;
|
||||
mpuDividerDrops = (minLooptime + gyroSamplePeriod -1 ) / gyroSamplePeriod - 1;
|
||||
targetLooptime = (mpuDividerDrops + 1) * gyroSamplePeriod;
|
||||
} else {
|
||||
mpuDividerDrops = 0;
|
||||
targetLooptime = looptime;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t gyroMPU6xxxGetDividerDrops(void) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue