From 282ddf5fa580fbc013c15add0f1f65d870deadd7 Mon Sep 17 00:00:00 2001 From: myles-parfeniuk Date: Mon, 18 Nov 2024 11:46:30 -0800 Subject: [PATCH] added flush packets to disable_report(), passes all tests --- source/BNO08x.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/BNO08x.cpp b/source/BNO08x.cpp index dec11ce..0fd6701 100644 --- a/source/BNO08x.cpp +++ b/source/BNO08x.cpp @@ -1056,7 +1056,7 @@ void BNO08x::enable_report(uint8_t report_ID, uint32_t time_between_reports, con } // flush the first few reports returned to ensure new data - flush_rx_packets(2); + flush_rx_packets(3); } /** @@ -1105,6 +1105,8 @@ void BNO08x::disable_report(uint8_t report_ID, const EventBits_t report_evt_grp_ host_int_timeout_ms = HOST_INT_TIMEOUT_DEFAULT_MS; gpio_intr_disable(imu_config.io_int); } + + flush_rx_packets(2); } }