Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
ce87656
Add new target DAKEFPVH743_SLIM
engineer-dakefpv Dec 16, 2025
59532ea
Fix the incorrect pins PC8 and PB7
engineer-dakefpv Dec 16, 2025
cebc906
Refactor OMNIBUSF4 targets into separate directories
sensei-hacker Dec 22, 2025
476a0cb
Clean up dead code and obsolete comments from OMNIBUS split
sensei-hacker Dec 22, 2025
c79e53a
Remove all dead code from OMNIBUSF4 directory
sensei-hacker Dec 22, 2025
e3d0bda
Fix critical OMNIBUSF4V3_ICM configuration bug and remove dead code
sensei-hacker Dec 22, 2025
dce7687
Remove outdated and misleading comments from OMNIBUS split
sensei-hacker Dec 22, 2025
2331e01
Remove dead code from OMNIBUSF4PRO/target.c
sensei-hacker Dec 22, 2025
0fead0f
Remove outdated comments and redundant conditional from OMNIBUS split
sensei-hacker Dec 22, 2025
e6dc927
Fix inconsistent indentation remnants in OMNIBUS split
sensei-hacker Dec 22, 2025
eca5746
Merge upstream/maintenance-9.x - resolve OMNIBUSF4V3_ICM conflicts
sensei-hacker Feb 25, 2026
eb20c74
update AET-H743-Basic - add bmi088 and bmi270 imu
do1234521 Mar 6, 2026
d6db20e
fix(gps): guard against NULL serial port when GPS provider changed wi…
daijoubu Jun 8, 2026
68f2797
Add BMI270 support to COREWINGF405WINGV2
sensei-hacker Jun 9, 2026
c0ba786
target/JHEMCUF435: fix UART7 ESC telemetry defaults
dtrbinh Jun 9, 2026
6c6df28
fix(gps): clamp negative uBlox nano field before millis conversion
daijoubu Jun 10, 2026
ea888d4
Add ICM42686P IMU support
bkleiner Jun 9, 2026
c499f5f
fix(sdcard): remove blocking delay from SDIO retry path
sensei-hacker Jun 23, 2026
2fda3e4
fix(sdcard): fix write-path state management in SDIO driver
sensei-hacker Jun 23, 2026
e172f87
docs(autotune): fix fixed-wing autotune docs to match actual behavior
sensei-hacker Jul 1, 2026
87ed42b
Fix build-SITL-Mac VLA-folding-constant error in log.c
sensei-hacker Jul 2, 2026
b757e48
Fix build-SITL-Mac VLA-folding-constant error in osd.c STATIC_ASSERT
sensei-hacker Jul 2, 2026
9426576
Merge pull request #11680 from sensei-hacker/fix-sitl-mac-vla-error-9.1
sensei-hacker Jul 2, 2026
f3527fe
docs(autotune): fix LIMIT mode wording per Qodo review
sensei-hacker Jul 2, 2026
ecef12e
Merge pull request #11677 from sensei-hacker/fix-autotune-docs
sensei-hacker Jul 2, 2026
1ffa80b
Fix int8_t overflow in AAF frequency selection for ICM-42688P/42686P
sensei-hacker Jul 2, 2026
449a645
Merge pull request #11682 from sensei-hacker/fix/icm42688-aaf-freq-ov…
sensei-hacker Jul 2, 2026
a68bb04
Merge pull request #11641 from dtrbinh/fix/jhemcuf435-uart7-missing-swap
sensei-hacker Jul 3, 2026
a75cf92
Merge pull request #11634 from daijoubu/fix/gps-provider-null-guard
sensei-hacker Jul 3, 2026
aa87bb2
Merge pull request #11674 from sensei-hacker/fix/sdio-retry-blocking-…
sensei-hacker Jul 3, 2026
015eeab
Merge pull request #11642 from daijoubu/fix/ublox-nano-rtc-offset
sensei-hacker Jul 3, 2026
cf48e6e
allow USE_UARTx_PIN_SWAP on H7
sensei-hacker Jul 6, 2026
028986c
DAKEFPVH743_SLIM: Fix DMA conflicts
sensei-hacker Jul 6, 2026
e6f3353
DAKEFPV H743 SLIM: Fix beeper and UART7
sensei-hacker Jul 6, 2026
63113da
Merge pull request #11177 from engineer-dakefpv/DAKEFPVH743_SLIM
sensei-hacker Jul 6, 2026
03e8de2
Merge pull request #11687 from sensei-hacker/USE_UARTx_PIN_SWAP-on-H7
sensei-hacker Jul 6, 2026
08cde84
Puya PY25Q128 - updated descriptions.
valeriyc Mar 5, 2026
42f7e52
SOLOGOODF722 - target
valeriyc Mar 2, 2026
2197875
SOLOGOODF722: add config.c for PINIO user boxes
sensei-hacker Jul 6, 2026
90c117d
Merge pull request #11196 from sensei-hacker/refactor/split-omnibusf4…
sensei-hacker Jul 6, 2026
7441bec
AETH743Basic Update BMI270 slow tag in target.c
sensei-hacker Jul 6, 2026
e5a84ed
Merge pull request #11689 from sensei-hacker/sologoodf722-target-91
sensei-hacker Jul 6, 2026
4263507
Merge pull request #11403 from do1234521/master
sensei-hacker Jul 6, 2026
db7e465
Update DAKEFPVF405 target to match current Betaflight config
sensei-hacker Jul 6, 2026
37dc6fe
Note CAMERA_CONTROL_PIN as a future PWM-PINIO migration candidate
sensei-hacker Jul 6, 2026
0631b6e
Clarify CAMERA_CONTROL_PIN comment: functional from 10.0, not permane…
sensei-hacker Jul 6, 2026
a7aff3b
Remove dead USE_IMU_ICM42688P block, document actual detection path
sensei-hacker Jul 6, 2026
4832784
Fix bf2inav.py gaps found while updating DAKEFPVF405
sensei-hacker Jul 6, 2026
6c942bf
Merge pull request #11690 from sensei-hacker/update-dakefpvf405-target
sensei-hacker Jul 6, 2026
b6fbebc
Add AXISFLYINGH743PRO target
sensei-hacker Jul 7, 2026
aff7794
Add LSM6DSV16X/LSM6DSK320X support to LSM6DXX accgyro driver
sensei-hacker Jul 7, 2026
0014dbc
bf2inav.py: update LSM6DSK320X support
sensei-hacker Jul 7, 2026
9f57c17
Merge pull request #11691 from sensei-hacker/fix-bf2inav-gaps
sensei-hacker Jul 7, 2026
a731ebb
Merge pull request #11694 from sensei-hacker/lsm6dsv16x-lsm6dsk320x-d…
sensei-hacker Jul 7, 2026
54b7177
Merge pull request #11638 from sensei-hacker/add/bmi270-corewingf405w…
sensei-hacker Jul 7, 2026
82090e4
Fix LED strip / ADC1 DMA conflict on DAKEFPVH743PRO
sensei-hacker Jul 7, 2026
3110497
Merge pull request #11696 from sensei-hacker/fix-dakefpvh743pro-led-a…
sensei-hacker Jul 7, 2026
cb36ba5
AXISFLYINGH743PRO: remove bogus timers, PINIO_FLAGS_INVERTED
sensei-hacker Jul 7, 2026
baabf43
AXISFLYINGH743PRO: set default features
sensei-hacker Jul 7, 2026
ec55b09
Converting Betaflight Targets.md: default_features
sensei-hacker Jul 7, 2026
27a7bb7
Merge branch 'release/9.1' into feature-axisflyingh743pro-target
sensei-hacker Jul 7, 2026
e519b69
Merge pull request #11693 from sensei-hacker/feature-axisflyingh743pr…
sensei-hacker Jul 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions docs/Autotune - fixedwing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,35 @@ Getting a good set of roll/pitch/yaw PIFF parameters for your aircraft is essent

## What AUTOTUNE does

The AUTOTUNE mode is a flight mode that acts on top of normal ANGLE/HORIZON/ACRO mode and uses changes in flight attitude input by the pilot to learn the tuning values for roll, pitch and yaw tuning.
AUTOTUNE is a modifier you enable on top of ANGLE, HORIZON or ACRO mode. It has no effect at all while flying in MANUAL mode - you can switch it on, but nothing will be tuned until you leave MANUAL. Where it is active, it uses the aircraft's response to your stick inputs to tune, for roll, pitch and yaw independently:

In general pilot needs to activate AUTOTUNE mode while in the air and then fly the plane for a few minutes. While flying the pilot needs to input as many sharp attitude changes as possible so that the autotune code can learn how the aircraft responds and figure out PIFF gains.
* **FeedForward (FF) gain** - in ANGLE, HORIZON or ACRO, whenever you give it enough hard stick input to learn from
* **Rate** (`roll_rate`/`pitch_rate`/`yaw_rate`) - only while flying in ACRO or HORIZON, and only if `fw_autotune_rate_adjustment` is not set to `FIXED` (see below). Rate is never adjusted while flying in ANGLE mode.

**AUTOTUNE never adjusts P or I gains, on any axis.** Tune P and I manually, either before or after using AUTOTUNE. This is a change from older INAV versions - if you're used to AUTOTUNE also setting P/I, that's no longer how it works.

In general the pilot needs to activate AUTOTUNE while in the air and then fly the plane for a few minutes. While flying the pilot needs to input as many sharp attitude changes as possible, on all three axes, so that the autotune code can learn how the aircraft responds. An axis that isn't given hard stick input won't be tuned - it's easy to spend a whole flight on hard rolls and pitches and forget yaw entirely.

## Before flying with AUTOTUNE

Before taking off you need to set up a few parameters for your airplane:

parameter | explanation
--------- | -----------
roll_rate | Maximum roll rate limit for your ariplane. Must not exceed physical limit of your plane
pitch_rate | Maximum pitch rate limit for your ariplane. Must not exceed physical limit of your plane
yaw_rate | Maximum yaw rate limit for your ariplane. Must not exceed physical limit of your plane
roll_rate | Starting roll rate for your airplane. Unless you set `fw_autotune_rate_adjustment` to `FIXED` (see below), AUTOTUNE will change this value while you fly - it's a starting point, not a ceiling it respects
pitch_rate | Starting pitch rate for your airplane. Same caveat as `roll_rate`
yaw_rate | Starting yaw rate for your airplane. Same caveat as `roll_rate`
fw_autotune_rate_adjustment | Controls whether/how AUTOTUNE changes `roll_rate`/`pitch_rate`/`yaw_rate` while tuning. `AUTO` (default) raises or lowers rates to match what the plane can achieve. `LIMIT` adjusts rates the same way but caps them at your starting value - it can still raise a rate it previously lowered, just never above where you started. `FIXED` leaves rates untouched - use this if you want AUTOTUNE to tune FeedForward only
fw_autotune_min_stick | Minimum stick deflection [%] (default 50) before AUTOTUNE starts recording a maneuver as tuning data
fw_autotune_max_rate_deflection | Target servo/mixer deflection [%] (default 90) AUTOTUNE aims for when calculating an achievable rate in `AUTO`/`LIMIT`
fw_p_level | Self-leveling strength. Bigger value means sharper response
fw_i_level | Self-leveling filtering. Usual value for airplanes is 1-5 Hz
max_angle_inclination_rll | Maximum roll angle in [0.1 deg] units
max_angle_inclination_pit | Maximum pitch angle in [0.1 deg] units
tpa_breakpoint | Cruise throttle (expected throttle that you would be flying most of the time)
tpa_rate | Amount of TPS curve to apply (usually should be in range 50-80 for most airplanes)

For most hobby-sized airplanes roll/pitch rate limits should be in range 70-120 deg/s (7-12 for `roll_rate` and `pitch_rate` values). Small and agile flying wings can reach 180-200 deg/s.
For most hobby-sized airplanes, starting roll/pitch rates in the range 70-120 deg/s (7-12 for `roll_rate` and `pitch_rate` values) work well. Small and agile flying wings can reach 180-200 deg/s. With the default `AUTO` setting, don't worry about getting this exactly right - AUTOTUNE will adjust it based on what your airplane actually does, down to a floor of 40 deg/s on roll/pitch and 10 deg/s on yaw, up to a ceiling of 720 deg/s.

Other things to check:

Expand All @@ -38,15 +46,16 @@ Other things to check:

Once you are all setup you can take off normally and switch to AUTOTUNE mode once you have gained altitude.

When you engage AUTOTUNE mode a few things will happen:
When you engage AUTOTUNE a few things will happen:

* The autotune system will immediately setup some default values for your roll, pitch and yaw P and I gains
* The autotune system will monitor requested roll and pitch rates (as determined by your transmitter stick movements). When the demanded roll or pitch rate exceeds certain threshold the autotune system will use the response of the aircraft to learn roll or pitch tuning values
* Every 5 seconds the autotune system will store the snapshot of parameters you have. When you switch out of AUTOTUNE mode the last remembered parameters are restored
* The autotune system will monitor requested roll, pitch and yaw rates (as determined by your transmitter stick movements, once deflection passes `fw_autotune_min_stick`). When the demanded rate on an axis exceeds that threshold the autotune system will use the response of the aircraft to learn FeedForward (and, depending on `fw_autotune_rate_adjustment` and mode, Rate) for that axis
* Every 5 seconds the autotune system will store a snapshot of the current values. When you switch out of AUTOTUNE the last snapshot is restored - so if you exit within 5 seconds of enabling it, nothing changes
* You may find the plane is quite sluggish when you first enter AUTOTUNE. You will find that as the tune progresses this will get better. Make sure your flight area has plenty of room for slow large-radius turns.
* Don't land in AUTOTUNE mode - during landing airplane doesn't reach it full performance which may be read by autotune system as insufficient gains.

The key to a successful autotune is to input rapid movements with the transmitter sticks. You should only do one of either roll or pitch at a time, and you should move the stick rapidly to the maximum deflection.
The key to a successful autotune is to input rapid movements with the transmitter sticks. You should only exercise one of roll, pitch or yaw at a time, and you should move the stick rapidly to the maximum deflection. Don't neglect yaw - it's easy to spend the whole flight on rolls and pitches and leave yaw untuned.

Fly in ACRO if you can - AUTOTUNE only learns Rate in modes where stick position maps directly to a commanded rotation rate (ACRO, and mostly HORIZON). In ANGLE mode the stick commands an angle instead, so AUTOTUNE will still tune FeedForward but will not touch Rate at all while you're in ANGLE. AUTOTUNE has no effect whatsoever in MANUAL mode - don't fly it there.

## Don't stop too early

Expand Down
28 changes: 10 additions & 18 deletions docs/development/Converting Betaflight Targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Locate your Flight Controller target config.h in BetaFlight's repo, eg.: [config

It is also advisable to record the output of the timer command from BetaFlight, as it will provide useful information on `timer` usage that can be used to adjust the generated target later.

The script generates `CAMERA_CONTROL_PIN` and PINIO `permanentId` wiring in `config.c` automatically when present in the source `config.h`.

```
# timer
timer B08 AF3
Expand Down Expand Up @@ -38,37 +40,27 @@ Using the BETAFPVF405 target mentioned above, to create the target now we need t
3. Create a target folder that will be used as the output folder for the `bf2inav.py` script, eg: `inav/src/main/targets/BETAFPVF405`
4. Navigate to the script folder in `inav/src/utils/`
5. `python3 ./bf2inav.py -i config.h -o ../main/target/BETAFPVF405/`
6. Edit generated `target.c` and chose the correct timer definitions to match Betaflight's timer definitions.
6. Edit generated `target.c` and chose the correct timer definitions to match Betaflight's timer definitions for motor, servo, and LED timers (not gyro).
```
timerHardware_t timerHardware[] = {
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0),
//DEF_TIM(TIM8, CH2N, PB0, TIM_USE_OUTPUT_AUTO, 0, 0),
//DEF_TIM(TIM1, CH2N, PB0, TIM_USE_OUTPUT_AUTO, 0, 0),

DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 0),
//DEF_TIM(TIM8, CH3N, PB1, TIM_USE_OUTPUT_AUTO, 0, 0),
//DEF_TIM(TIM1, CH3N, PB1, TIM_USE_OUTPUT_AUTO, 0, 0),

//DEF_TIM(TIM5, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 0),
//DEF_TIM(TIM9, CH2, PA3, TIM_USE_OUTPUT_AUTO, 0, 0),
DEF_TIM(TIM2, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 0),

//DEF_TIM(TIM5, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 0),
//DEF_TIM(TIM9, CH1, PA2, TIM_USE_OUTPUT_AUTO, 0, 0),
DEF_TIM(TIM2, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 0),

DEF_TIM(TIM8, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 0),
//DEF_TIM(TIM3, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 0),

DEF_TIM(TIM1, CH1, PA8, TIM_USE_OUTPUT_AUTO, 0, 0),

//DEF_TIM(TIM3, CH1, PB4, TIM_USE_BEEPER, 0, 0),

DEF_TIM(TIM4, CH1, PB6, TIM_USE_LED, 0, 0),

};
```
In this particular example, PA3, PA2 were changed to match Betaflight's mapping, and the timer PB4 was disabled, due to a timer conflict. Normal channels are prefered over N channels (CH1, over CH1N) or C channels in AT32 architectures.
7. Now update yout build scripts by running `cmake` and build the target you just created. The target name can be checked in the generated `CMakeLists.txt`, but should match the Betaflight target name.
Normal channels are prefered over N channels (CH1, over CH1N) or C channels in AT32 architectures.

The typical value to be set in target.h for DEFAULT_FEATURES is:
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)

7. Now update your build scripts by running `cmake` and build the target you just created. The target name can be checked in the generated `CMakeLists.txt`, but should match the Betaflight target name.

For information on how to build INAV, check the documents in the [docs/development](https://github.com/iNavFlight/inav/tree/master/docs/development) folder.
For information on how to build INAV, check the documents in the [docs/development](https://github.com/iNavFlight/inav/tree/master/docs/development) folder.
8 changes: 6 additions & 2 deletions src/main/common/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,12 @@ void _logBufferHex(logTopic_e topic, unsigned level, const void *buffer, size_t
{
// Print lines of up to maxBytes bytes. We need 5 characters per byte
// 0xAB[space|\n]
const size_t charsPerByte = 5;
const size_t maxBytes = 8;
// charsPerByte/maxBytes must be true compile-time constants (not `const`
// locals) so the buffer size below is a real constant expression, not a VLA.
enum {
charsPerByte = 5,
maxBytes = 8,
};
char buf[LOG_PREFIX_FORMATTED_SIZE + charsPerByte * maxBytes + 1]; // +1 for the null terminator
size_t bufPos = LOG_PREFIX_FORMATTED_SIZE;
const uint8_t *inputPtr = buffer;
Expand Down
55 changes: 41 additions & 14 deletions src/main/drivers/accgyro/accgyro_icm42605.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@
#define ICM426XX_RA_ACCEL_CONFIG_STATIC3 0x04 // User Bank 2
#define ICM426XX_RA_ACCEL_CONFIG_STATIC4 0x05 // User Bank 2

static bool is42688P = false;
typedef enum {
ICM42605_VARIANT_42605 = 0,
ICM42605_VARIANT_42686P,
ICM42605_VARIANT_42688P,
} icm42605Variant_e;

static icm42605Variant_e icm42605DetectedVariant = ICM42605_VARIANT_42605;

typedef struct aafConfig_s {
uint16_t freq;
Expand Down Expand Up @@ -145,7 +151,7 @@ static aafConfig_t aafLUT42605[] = { // see table in section 5.3 https://invens
{ 0, 0, 0, 0 }
};

static const aafConfig_t *getGyroAafConfig(bool is42688, const uint16_t desiredLpf);
static const aafConfig_t *getGyroAafConfig(icm42605Variant_e variant, const uint16_t desiredLpf);

static void setUserBank(const busDevice_t *dev, const uint8_t user_bank)
{
Expand Down Expand Up @@ -214,11 +220,16 @@ static void icm42605AccAndGyroInit(gyroDev_t *gyro)
busWrite(dev, ICM42605_RA_PWR_MGMT0, ICM42605_PWR_MGMT0_TEMP_DISABLE_OFF | ICM42605_PWR_MGMT0_ACCEL_MODE_LN | ICM42605_PWR_MGMT0_GYRO_MODE_LN);
delay(15);

uint8_t fsSel = 0;
if (icm42605DetectedVariant == ICM42605_VARIANT_42686P) {
fsSel = 1; // ICM-42686-P normal range: 2000 deg/s, 16G.
}

/* ODR and dynamic range */
busWrite(dev, ICM42605_RA_GYRO_CONFIG0, (0x00) << 5 | (config->gyroConfigValues[1] & 0x0F)); /* 2000 deg/s */
busWrite(dev, ICM42605_RA_GYRO_CONFIG0, fsSel << 5 | (config->gyroConfigValues[1] & 0x0F)); /* 2000 deg/s */
delay(15);

busWrite(dev, ICM42605_RA_ACCEL_CONFIG0, (0x00) << 5 | (config->gyroConfigValues[1] & 0x0F)); /* 16 G deg/s */
busWrite(dev, ICM42605_RA_ACCEL_CONFIG0, fsSel << 5 | (config->gyroConfigValues[1] & 0x0F)); /* 16 G deg/s */
delay(15);

/* LPF bandwidth */
Expand All @@ -228,14 +239,14 @@ static void icm42605AccAndGyroInit(gyroDev_t *gyro)

if (gyro->lpf != GYRO_LPF_NONE) {
// Configure gyro Anti-Alias Filter (see section 5.3 "ANTI-ALIAS FILTER")
const aafConfig_t *aafConfig = getGyroAafConfig(is42688P, gyro->lpf);
const aafConfig_t *aafConfig = getGyroAafConfig(icm42605DetectedVariant, gyro->lpf);

setUserBank(dev, ICM426XX_BANK_SELECT1);
busWrite(dev, ICM426XX_RA_GYRO_CONFIG_STATIC3, aafConfig->delt);
busWrite(dev, ICM426XX_RA_GYRO_CONFIG_STATIC4, aafConfig->deltSqr & 0xFF);
busWrite(dev, ICM426XX_RA_GYRO_CONFIG_STATIC5, (aafConfig->deltSqr >> 8) | (aafConfig->bitshift << 4));

aafConfig = getGyroAafConfig(is42688P, 256); // This was hard coded on BF
aafConfig = getGyroAafConfig(icm42605DetectedVariant, 256); // This was hard coded on BF
setUserBank(dev, ICM426XX_BANK_SELECT2);
busWrite(dev, ICM426XX_RA_ACCEL_CONFIG_STATIC2, aafConfig->delt << 1);
busWrite(dev, ICM426XX_RA_ACCEL_CONFIG_STATIC3, aafConfig->deltSqr & 0xFF);
Expand Down Expand Up @@ -289,12 +300,15 @@ static bool icm42605DeviceDetect(busDevice_t * dev)
busRead(dev, MPU_RA_WHO_AM_I, &tmp);

switch (tmp) {
/* ICM42605 and ICM42688P share the register structure*/
/* ICM42605, ICM42686P and ICM42688P share the register structure */
case ICM42605_WHO_AM_I_CONST:
is42688P = false;
icm42605DetectedVariant = ICM42605_VARIANT_42605;
return true;
case ICM42686P_WHO_AM_I_CONST:
icm42605DetectedVariant = ICM42605_VARIANT_42686P;
return true;
case ICM42688P_WHO_AM_I_CONST:
is42688P = true;
icm42605DetectedVariant = ICM42605_VARIANT_42688P;
return true;

default:
Expand Down Expand Up @@ -385,17 +399,30 @@ static uint16_t getAafFreq(const uint8_t gyroLpf)
}
}

static const aafConfig_t *getGyroAafConfig(bool is42688, const uint16_t desiredLpf)
static const char *icm42605VariantName(icm42605Variant_e variant)
{
switch (variant) {
case ICM42605_VARIANT_42686P:
return "42686P";
case ICM42605_VARIANT_42688P:
return "42688P";
case ICM42605_VARIANT_42605:
default:
return "42605";
}
}

static const aafConfig_t *getGyroAafConfig(icm42605Variant_e variant, const uint16_t desiredLpf)
{
uint16_t desiredFreq = getAafFreq(desiredLpf);
const aafConfig_t *aafConfigs = NULL;
if (is42688) {
if (variant == ICM42605_VARIANT_42686P || variant == ICM42605_VARIANT_42688P) {
aafConfigs = aafLUT42688;
} else {
aafConfigs = aafLUT42605;
}
int i;
int8_t selectedFreq = aafConfigs[0].freq;
uint16_t selectedFreq = aafConfigs[0].freq;
const aafConfig_t * candidate = &aafConfigs[0];

// Choose closest supported LPF value
Expand All @@ -406,8 +433,8 @@ static const aafConfig_t *getGyroAafConfig(bool is42688, const uint16_t desiredL
}
}

LOG_VERBOSE(GYRO, "ICM426%s AAF CONFIG { %d, %d } -> { %d }; delt: %d deltSqr: %d, shift: %d",
(is42688P ? "88" : "05"),
LOG_VERBOSE(GYRO, "ICM%s AAF CONFIG { %d, %d } -> { %d }; delt: %d deltSqr: %d, shift: %d",
icm42605VariantName(variant),
desiredLpf, desiredFreq,
candidate->freq,
candidate->delt, candidate->deltSqr, candidate->bitshift);
Expand Down
Loading
Loading