mirror of https://github.com/zmkfirmware/zmk.git
fix(sensors): Initialize sensor data to 0 before fetching.
Be sure we don't get back any uninitialized data by initializing the channel data to 0 before calling into the sensor API.
This commit is contained in:
parent
1ed4d789c9
commit
e2754a7e7f
|
|
@ -73,7 +73,7 @@ static void trigger_sensor_data_for_position(uint32_t sensor_index) {
|
|||
return;
|
||||
}
|
||||
|
||||
struct sensor_value value;
|
||||
struct sensor_value value = {0};
|
||||
err = sensor_channel_get(item->dev, item->trigger.chan, &value);
|
||||
|
||||
if (err) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue