1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 13:55:18 +03:00

Add Experimental LPF parameter

This commit is contained in:
borisbstyle 2016-03-01 00:18:49 +01:00
parent 856ceee528
commit a2a58d8ccb
3 changed files with 7 additions and 3 deletions

View file

@ -44,7 +44,7 @@ bool gyroSyncCheckUpdate(void) {
void gyroUpdateSampleRate(uint8_t lpf, uint8_t gyroSyncDenominator) { void gyroUpdateSampleRate(uint8_t lpf, uint8_t gyroSyncDenominator) {
int gyroSamplePeriod; int gyroSamplePeriod;
if (!lpf) { if (!lpf || lpf == 7) {
gyroSamplePeriod = 125; gyroSamplePeriod = 125;
} else { } else {
gyroSamplePeriod = 1000; gyroSamplePeriod = 1000;

View file

@ -380,7 +380,11 @@ static const char * const lookupTableGyroLpf[] = {
"OFF", "OFF",
"188HZ", "188HZ",
"98HZ", "98HZ",
"42HZ" "42HZ",
"20HZ",
"10HZ",
"5HZ",
"EXPERIMENTAL"
}; };
static const char * const lookupTableAccHardware[] = { static const char * const lookupTableAccHardware[] = {

View file

@ -582,7 +582,7 @@ void init(void)
afatfs_init(); afatfs_init();
#endif #endif
if (masterConfig.gyro_lpf) { if (masterConfig.gyro_lpf > 0 && masterConfig.gyro_lpf < 7) {
masterConfig.pid_process_denom = 1; // When gyro set to 1khz always set pid speed 1:1 to sampling speed masterConfig.pid_process_denom = 1; // When gyro set to 1khz always set pid speed 1:1 to sampling speed
masterConfig.gyro_sync_denom = 1; masterConfig.gyro_sync_denom = 1;
} }