Apply suggestions from code review
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
This commit is contained in:
parent
a8e58ae21f
commit
b97737aa1b
3 changed files with 3 additions and 3 deletions
|
@ -36,7 +36,7 @@ static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding,
|
|||
|
||||
err = sensor_channel_get(sensor, SENSOR_CHAN_ROTATION, &value);
|
||||
|
||||
if (err) {
|
||||
if (err < 0) {
|
||||
LOG_WRN("Failed to get sensor rotation value: %d", err);
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding,
|
|||
|
||||
err = sensor_channel_get(sensor, SENSOR_CHAN_ROTATION, &value);
|
||||
|
||||
if (err) {
|
||||
if (err < 0) {
|
||||
LOG_WRN("Failed to get sensor rotation value: %d", err);
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ int zmk_keymap_sensor_triggered(uint8_t sensor_number, const struct device *sens
|
|||
continue;
|
||||
}
|
||||
|
||||
struct zmk_behavior_binding_event event = {.position = 0, .timestamp = timestamp};
|
||||
struct zmk_behavior_binding_event event = {.position = sensor_number, .timestamp = timestamp};
|
||||
ret = behavior_sensor_keymap_binding_triggered(binding, sensor, event);
|
||||
|
||||
if (ret > 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue