From 0a102cb0d1367caad534ecc24e294db2745be417 Mon Sep 17 00:00:00 2001 From: Manodya Rasanjana <119348799+ManodyaRasanjana@users.noreply.github.com> Date: Mon, 27 Nov 2023 21:30:58 +0530 Subject: [PATCH] Update SparkFun_BMI270_Arduino_Library.cpp Add "BMI2_DISABLE" option for "enableAdvancedPowerSave()" function --- src/SparkFun_BMI270_Arduino_Library.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/SparkFun_BMI270_Arduino_Library.cpp b/src/SparkFun_BMI270_Arduino_Library.cpp index 255c951..952442f 100644 --- a/src/SparkFun_BMI270_Arduino_Library.cpp +++ b/src/SparkFun_BMI270_Arduino_Library.cpp @@ -377,7 +377,15 @@ int8_t BMI270::setGyroFilterBandwidth(uint8_t bandwidthParam) /// @return Error code (0 is success, negative is failure, positive is warning) int8_t BMI270::enableAdvancedPowerSave(bool enable) { - return bmi2_set_adv_power_save(BMI2_ENABLE, &sensor); + if (enable) + { + return bmi2_set_adv_power_save(BMI2_ENABLE, &sensor); + } + else + { + return bmi2_set_adv_power_save(BMI2_DISABLE, &sensor); + } + } /// @brief Disables advanced power save mode