Also, thinking about the defines, I'm struggling to think of a reason
you would use IMU and IR together, so maybe just assume that (on top
of the actual define of ADC_CHANNEL_GYRO_P|Q|R) if an IMU is defined
and your AHRS is defined as INFRARED, then activate the gyros (and
maybe magnetometers?). Something like:
#ifdef (ADC_CHANNEL_GYRO_P || ( IMU && AHRS_INFRARED)) //i'm not sure
what the specific defines are for IMU and AHRS as infrared and if you
can even use more complex conditional group preprocessor macros in C
I removed the old gyro files and integrated it into the imu_analog subsystem. Makes things easier to have a consistent interface.
E.g. you use an analog roll gyro together with thermopiles: add the imu_analog subsystem and only configure the roll gyro (instead of all of them).
So USE_IMU is also defined... I added the checks for the gyro channels, because with IR + gyro you can't assume that even if you are using the IMU interface that you actually have all 3 axes...
Also you do that in ahrs_infrared.c there is obviously no need to check if you are using AHRS_INFRARED...