Change gyro overflow handling to be based on runtime detected gyro (#5730)
commit087837ffea5881bb6189c3e93bc09fcbe80d9b21
authorBruce Luckcuck <github@etracer.net>
Sun, 22 Apr 2018 00:16:00 +0000 (21 20:16 -0400)
committerMichael Keller <github@ike.ch>
Sun, 22 Apr 2018 00:16:00 +0000 (22 12:16 +1200)
tree9eb18d533a7bc6dfcbcb2bfbbc76cc54c63ddb28
parent83a9af8571030edeaaae3cae28950909eecf4ce2
Change gyro overflow handling to be based on runtime detected gyro (#5730)

Previously the gyro_overflow_detect and fallback slew filter were based on target definitions to determine whether the flight controller had an affected gyro to enable protection. The problem is that some targets are available with multiple gyro options and if one of those options was an affected gyro then all flight controllers for that target would have the oveflow code enabled even if they had a non-affected gyro.  Also targets that include multiple gyros on-board and are selectable at runtime were not differentiated and forced overflow handling on even if the selected gyro was not affected.

For non-affected gyros the overflow handling code is not required and reduces recovery performance so it's not desirable to have it enabled when unnecessary.

In the case of dual-gyro targets if gyro_to_use = BOTH then if either is an affected gyro then overflow handling will be enabled.
src/main/drivers/accgyro/accgyro.h
src/main/sensors/gyro.c