Blackbox 32K code cleanup

Cleaning up some missed 32K specific code.
This commit is contained in:
Bruce Luckcuck 2020-02-04 18:30:30 -05:00
parent 42f18b2cbc
commit f29440957d
2 changed files with 2 additions and 21 deletions

View File

@ -1824,13 +1824,8 @@ void blackboxInit(void)
// an I-frame is written every 32ms
// blackboxUpdate() is run in synchronisation with the PID loop
// targetPidLooptime is 1000 for 1kHz loop, 500 for 2kHz loop etc, targetPidLooptime is rounded for short looptimes
if (targetPidLooptime == 31) { // rounded from 31.25us
blackboxIInterval = 1024;
} else if (targetPidLooptime == 63) { // rounded from 62.5us
blackboxIInterval = 512;
} else {
blackboxIInterval = (uint16_t)(32 * 1000 / targetPidLooptime);
}
blackboxIInterval = (uint16_t)(32 * 1000 / targetPidLooptime);
// by default p_ratio is 32 and a P-frame is written every 1ms
// if p_ratio is zero then no P-frames are logged
if (blackboxConfig()->p_ratio == 0) {

View File

@ -103,20 +103,6 @@ TEST(BlackboxTest, TestInitIntervals)
EXPECT_EQ(256, blackboxIInterval);
EXPECT_EQ(8, blackboxPInterval);
EXPECT_EQ(65536, blackboxSInterval);
// 16kHz PIDloop
targetPidLooptime = 63; // rounded from 62.5
blackboxInit();
EXPECT_EQ(512, blackboxIInterval); // note rounding
EXPECT_EQ(16, blackboxPInterval);
EXPECT_EQ(131072, blackboxSInterval);
// 32kHz PIDloop
targetPidLooptime = 31; // rounded from 31.25
blackboxInit();
EXPECT_EQ(1024, blackboxIInterval); // note rounding
EXPECT_EQ(32, blackboxPInterval);
EXPECT_EQ(262144, blackboxSInterval);
}
TEST(BlackboxTest, Test_500Hz)