refactor(sensors): Use "sensor index" consistently

This commit is contained in:
Peter Johanson
2023-05-16 22:27:01 -07:00
committed by Pete Johanson
parent 8b29f6d345
commit 3a91b32513
6 changed files with 40 additions and 42 deletions

View File

@@ -16,12 +16,12 @@
#define ZMK_SENSOR_EVENT_MAX_CHANNELS 1
struct zmk_sensor_event {
uint8_t sensor_position;
size_t channel_data_size;
struct zmk_sensor_channel_data channel_data[ZMK_SENSOR_EVENT_MAX_CHANNELS];
int64_t timestamp;
uint8_t sensor_index;
};
ZMK_EVENT_DECLARE(zmk_sensor_event);

View File

@@ -8,7 +8,6 @@
#include <zephyr/drivers/sensor.h>
#define _SENSOR_CHILD_LEN(node) 1 +
#define ZMK_KEYMAP_SENSORS_NODE DT_INST(0, zmk_keymap_sensors)
#define ZMK_KEYMAP_HAS_SENSORS DT_NODE_HAS_STATUS(ZMK_KEYMAP_SENSORS_NODE, okay)
#define ZMK_KEYMAP_SENSORS_BY_IDX(idx) DT_PHANDLE_BY_IDX(ZMK_KEYMAP_SENSORS_NODE, sensors, idx)
@@ -19,7 +18,7 @@
#define ZMK_KEYMAP_SENSORS_LEN 0
#endif
const struct zmk_sensor_config *zmk_sensors_get_config_at_position(uint8_t sensor_position);
const struct zmk_sensor_config *zmk_sensors_get_config_at_index(uint8_t sensor_index);
struct zmk_sensor_config {
uint16_t triggers_per_rotation;