Skip to content

Commit

Permalink
Permit 8kHz PID loop on F405 overclocked to 216MHz (betaflight#13356)
Browse files Browse the repository at this point in the history
* Permit 8kHz PID loop on F405 overclocked to 216MHz

* Update src/main/config/config.c

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
3 people authored Feb 8, 2024
1 parent 3726df1 commit 6999928
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/config/config.c
Original file line number Diff line number Diff line change
@@ -672,7 +672,12 @@ void validateAndFixGyroConfig(void)
/* If bidirectional DSHOT is being used on an F4 or G4 then force DSHOT300. The motor update restrictions then applied
* will automatically consider the loop time and adjust pid_process_denom appropriately
*/
if (motorConfig()->dev.useDshotTelemetry) {
if (true
#ifdef USE_PID_DENOM_OVERCLOCK_LEVEL
&& (systemConfig()->cpu_overclock < USE_PID_DENOM_OVERCLOCK_LEVEL)
#endif
&& motorConfig()->dev.useDshotTelemetry
) {
if (motorConfig()->dev.motorPwmProtocol == PWM_TYPE_DSHOT600) {
motorConfigMutable()->dev.motorPwmProtocol = PWM_TYPE_DSHOT300;
}
1 change: 1 addition & 0 deletions src/main/target/STM32F405/target.h
Original file line number Diff line number Diff line change
@@ -80,5 +80,6 @@
#define USE_EXTI

#define USE_PID_DENOM_CHECK
#define USE_PID_DENOM_OVERCLOCK_LEVEL 2

#define FLASH_PAGE_SIZE ((uint32_t)0x4000) // 16K sectors

0 comments on commit 6999928

Please sign in to comment.