Compare commits

..

2 Commits

Author SHA1 Message Date
PurpleCloudX
2dc752e074 Fix potential null pointer dereference in bmx280_close 2024-11-25 22:43:58 +08:00
PurpleCloudX
744b34a9f3 Fix: Unable to parse symbol 'BMX280_STANDBY_20M' in bmx280_bits.h (Issue #5) 2024-11-25 21:23:52 +08:00
2 changed files with 2 additions and 2 deletions

@ -451,7 +451,7 @@ bmx280_t* bmx280_create_master(i2c_master_bus_handle_t bus_handle)
void bmx280_close(bmx280_t *bmx280)
{
#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);
#endif
free(bmx280);

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