Skip to content

Commit

Permalink
Merge pull request #6127 from iNavFlight/dzikuvx-block-fast-blackbox
Browse files Browse the repository at this point in the history
Do not allow for Blackbox to work faster than 1kHz
  • Loading branch information
DzikuVx committed Sep 16, 2020
2 parents 46276f7 + 23b31a9 commit 456d8c4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/fc/fc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,15 @@ void init(void)
#endif

#ifdef USE_BLACKBOX

//Do not allow blackbox to be run faster that 1kHz. It can cause UAV to drop dead when digital ESC protocol is used
const uint32_t blackboxLooptime = getLooptime() * blackboxConfig()->rate_denom / blackboxConfig()->rate_num;

if (blackboxLooptime < 1000) {
blackboxConfigMutable()->rate_num = 1;
blackboxConfigMutable()->rate_denom = ceil(1000 / getLooptime());
}

// SDCARD and FLASHFS are used only for blackbox
// Make sure we only init what's necessary for blackbox
switch (blackboxConfig()->device) {
Expand Down

0 comments on commit 456d8c4

Please sign in to comment.