3 Commits

3 changed files with 10 additions and 9 deletions

13
Kconfig
View File

@@ -12,14 +12,15 @@ menu "BMX280 Options"
bool "I2C Master Driver (i2c_master.h)" bool "I2C Master Driver (i2c_master.h)"
help help
Use I2C Master Driver (i2c_master.h) for ESP-IDF >= 5.3. Use I2C Master Driver (i2c_master.h) for ESP-IDF >= 5.3.
config BMX280_I2C_CLK_SPEED_HZ
int "I2C Clock Speed (Hz)"
default 100000
range 1000 400000
help
Set the I2C clock speed in Hz.
endchoice endchoice
config BMX280_I2C_CLK_SPEED_HZ
int "I2C Clock Speed (Hz)"
default 100000
range 1000 400000
help
Set the I2C clock speed in Hz. Only applies to the new I2C Master driver.
choice BMX280_EXPECT_DEVICE choice BMX280_EXPECT_DEVICE
prompt "Installed Sensor Model" prompt "Installed Sensor Model"
help help

View File

@@ -451,7 +451,7 @@ bmx280_t* bmx280_create_master(i2c_master_bus_handle_t bus_handle)
void bmx280_close(bmx280_t *bmx280) void bmx280_close(bmx280_t *bmx280)
{ {
#if CONFIG_USE_I2C_MASTER_DRIVER #if CONFIG_USE_I2C_MASTER_DRIVER
if(bmx280->i2c_dev!=NULL) if(bmx280 != NULL && bmx280->i2c_dev != NULL)
i2c_master_bus_rm_device(bmx280->i2c_dev); i2c_master_bus_rm_device(bmx280->i2c_dev);
#endif #endif
free(bmx280); free(bmx280);

View File

@@ -126,7 +126,7 @@ typedef struct bmx280_config_t {
#elif (CONFIG_BMX280_DEFAULT_STANDBY_10M) #elif (CONFIG_BMX280_DEFAULT_STANDBY_10M)
#define BMX280_DEFAULT_STANDBY BME280_STANDBY_10M #define BMX280_DEFAULT_STANDBY BME280_STANDBY_10M
#else #else
#define BMX280_DEFAULT_STANDBY BMX280_STANDBY_20M #define BMX280_DEFAULT_STANDBY BME280_STANDBY_20M
#endif #endif
#if (CONFIG_BMX280_DEFAULT_IIR_NONE) #if (CONFIG_BMX280_DEFAULT_IIR_NONE)