diff --git a/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.c b/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.c index e3d05b9..04aa104 100644 --- a/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.c +++ b/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.c @@ -565,7 +565,7 @@ bool watch_peripherals_pressure_sensor_init(void) else APP_LOG_INFO("Inited BMP280"); - if(!BMP280_configure(BMP280_Forced, BMP280_Oversampling_x2, BMP280_Oversampling_x16, BMP280_Filter_x4, BMP280_Standby_4000MS)) + if(!BMP280_configure(BMP280_Forced, BMP280_Oversampling_x4, BMP280_Oversampling_x16, BMP280_Filter_OFF, BMP280_Standby_4000MS)) { APP_LOG_ERROR("Failed to configure BMP280"); return false; @@ -576,6 +576,18 @@ bool watch_peripherals_pressure_sensor_init(void) return true; } +bool watch_peripherals_pressure_sensor_select_profile(watch_peripherals_pressure_sensor_profile_e profile) +{ + switch(profile) + { + case WATCH_PERIPHERALS_PRESSURE_SENSOR_PROFILE_HIGH_PRECISION: + return BMP280_configure(BMP280_Forced, BMP280_Oversampling_x4, BMP280_Oversampling_x16, BMP280_Filter_x16, BMP280_Standby_4000MS); + case WATCH_PERIPHERALS_PRESSURE_SENSOR_PROFILE_LOW_POWER: + default: + return BMP280_configure(BMP280_Forced, BMP280_Oversampling_x4, BMP280_Oversampling_x16, BMP280_Filter_OFF, BMP280_Standby_4000MS); + } +} + float watch_peripherals_pressure_sensor_get_pressure(float * const temperature) { BMP280_trigger_measurement(); diff --git a/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.h b/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.h index 87f049b..af0df7b 100644 --- a/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.h +++ b/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.h @@ -174,6 +174,14 @@ bool watch_peripherals_magnetometer_power_mode_set(QMC5883L_Mode_Control_e mode_ bool watch_peripherals_pressure_sensor_init(void); +typedef enum watch_peripherals_pressure_sensor_profile +{ + WATCH_PERIPHERALS_PRESSURE_SENSOR_PROFILE_LOW_POWER = 0, + WATCH_PERIPHERALS_PRESSURE_SENSOR_PROFILE_HIGH_PRECISION, +} watch_peripherals_pressure_sensor_profile_e; + +bool watch_peripherals_pressure_sensor_select_profile(watch_peripherals_pressure_sensor_profile_e profile); + float watch_peripherals_pressure_sensor_get_pressure(float * const temperature); bool watch_peripherals_accelerometer_init(void);