zephyr/drivers/sensor
Avi Green a2190cc92b bmi160: bmi160_bus union bugfix
bmi160.c module defines DT_DRV_COMPAT, but bmi160_trigger.c doesn't.
This causes a catastrophic chain of events.
The bmi160.c module includes bmi160.h,
in which the macro DT_ANY_INST_ON_BUS_STATUS_OKAY
affects the size of bmi160_bus union.
So bmi160.c defines a bmi160_cfg struct which contains that union.
Now, in bmi160_trigger_init we get a pointer to that config struct.
The fact that this module now includes bmi160.h without
DT_DRV_COMPAT, causes it to think the union is empty.

That doesn't cause compilation error, just undefined behaviour,
In which you address an empty struct fields.

In general, I suggest that someone makes sure it doesn't happen
in other drivers as well. The problem presented here is general,
meaning that if an h file assumes someone defined DT_DRV_COMPAT
before and it doesn't,
it may lead to some weird behaviour, like the one described.

Signed-off-by: Avi Green <avigreen1978@yandex.com>
2022-03-11 07:05:12 -06:00
..
adt7420
adxl345
adxl362
adxl372
ak8975
amg88xx
ams_iAQcore
apds9960 kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
bma280
bmc150_magn kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
bme280 drivers: sensor: drop get_dev_data/get_dev_config usage 2022-01-19 18:16:02 +01:00
bme680 drivers: remove redundant data/config casts 2022-01-19 18:16:02 +01:00
bmg160
bmi160 bmi160: bmi160_bus union bugfix 2022-03-11 07:05:12 -06:00
bmi270 drivers: fix double promotion warnings 2021-11-24 17:14:25 -05:00
bmm150 kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
bmp388 drivers: sensor: drop DEV_DATA/DEV_CFG usage 2022-01-19 18:16:02 +01:00
bq274xx pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET 2022-01-18 12:14:06 -05:00
ccs811
dht
dps310
ens210 kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
fdc2x1x pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET 2022-01-18 12:14:06 -05:00
fxas21002
fxos8700 kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
grove kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
hmc5883l
hp206c
hts221 drivers/sensors: Enable 3-wire SPI access to HTS221 sensor driver 2021-11-19 11:50:38 +01:00
i3g4250d
icm42605 drivers: sensor: icm42605: fix default kconfig issues 2022-03-07 16:23:36 -06:00
iis2dh drivers: Apply SPI API change to relevant places 2021-11-19 11:50:38 +01:00
iis2dlpc
iis2iclx kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
iis2mdc drivers: Apply SPI API change to relevant places 2021-11-19 11:50:38 +01:00
iis3dhhc kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
ina23x drivers: sensor: ina23x: add support for INA237 2021-12-14 13:48:54 -06:00
ina219 include: sensor: sensor_value from double overflow 2022-02-24 13:45:29 -08:00
isl29035
ism330dhcx kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
ite_tach_it8xxx2 ITE drivers/sensor: add tachometer driver for it8xxx2_evb 2021-11-29 08:25:19 -05:00
lis2dh drivers: lis2dh: power management 2022-03-09 10:19:22 -06:00
lis2ds12 kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
lis2dw12
lis2mdl pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET 2022-01-18 12:14:06 -05:00
lis3mdl
lm75 drivers: remove redundant data/config casts 2022-01-19 18:16:02 +01:00
lm77 pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET 2022-01-18 12:14:06 -05:00
lps22hb
lps22hh drivers/sensor: lps22hh: Move odr Kconfig property into dts 2021-12-14 09:11:15 -06:00
lps25hb
lsm6ds0 kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
lsm6dsl kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
lsm6dso kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
lsm9ds0_gyro kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
lsm9ds0_mfd kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
lsm303dlhc_magn
max6675 drivers: sensor: max6675: convert to spi_dt_spec 2021-12-09 10:21:13 -06:00
max17055 drivers: avoid i2c_burst_write where possible 2021-12-22 12:14:42 +01:00
max17262 drivers: sensor: max17262: use instance based macros 2021-12-17 17:30:06 +01:00
max30101
max31875 drivers: sensors: Implement MAX31875 sensor 2022-02-24 08:49:40 -06:00
max44009
mchp_tach_xec
mcp9808
mcux_acmp
mhz19b drivers: sensor: Add MH-Z19B CO2 sensor driver 2021-12-20 18:47:47 +01:00
mpr
mpu6050
mpu9250 sensors: Implement MPU9250 driver 2022-01-14 12:33:04 +01:00
ms5607 drivers: Apply SPI API change to relevant places 2021-11-19 11:50:38 +01:00
ms5837
nrf5 drivers: nrf5: kconfig: add missing dependency for TEMP_NRF5 2021-12-01 16:10:59 +01:00
nuvoton_tach_npcx drivers: npcx: Drop DRV_CONFIG/DRV_DATA usage 2022-01-28 10:06:05 +01:00
nxp_kinetis_temp kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
opt3001
pms7003
qdec_nrfx pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET 2022-01-18 12:14:06 -05:00
qdec_sam drivers: qdec_sam: disable index signal 2022-01-28 10:07:06 +01:00
sbs_gauge drivers: remove redundant data/config casts 2022-01-19 18:16:02 +01:00
sgp40 pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET 2022-01-18 12:14:06 -05:00
sht3xd drivers: remove redundant data/config casts 2022-01-19 18:16:02 +01:00
sht4x
shtcx drivers: sensor: shtcx: fix 2021-11-29 18:18:42 -05:00
si7006
si7055
si7060
si7210 pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET 2022-01-18 12:14:06 -05:00
sm351lt
stm32_temp include: sensor: sensor_value from double overflow 2022-02-24 13:45:29 -08:00
stmemsc drivers/sensor: stmemsc: make use of i2c/spi dt APIs 2021-12-13 10:21:43 -06:00
stts751
sx9500
th02
ti_hdc
ti_hdc20xx
tmp007
tmp108 sample: sensor: tmp108: Add ti tmp108 sample 2021-12-17 21:15:25 +01:00
tmp112 drivers: avoid i2c_burst_write where possible 2021-12-22 12:14:42 +01:00
tmp116 sensor: eeprom: Add TMP116 EEPROM access 2021-12-08 07:51:46 -06:00
vcnl4040 kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
vl53l0x drivers: remove redundant data/config casts 2022-01-19 18:16:02 +01:00
wsen_itds drivers: use DT_INST_ENUM_IDX(_OR) macros 2021-11-18 19:12:07 -05:00
CMakeLists.txt drivers: sensors: Implement MAX31875 sensor 2022-02-24 08:49:40 -06:00
Kconfig kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
sensor_handlers.c
sensor_shell.c
shell_battery.c