Update behavior_sensor_rotate_key_press.c
This commit is contained in:
parent
99423e0ce5
commit
dc0e54158a
1 changed files with 3 additions and 10 deletions
|
@ -21,19 +21,12 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
|||
static int behavior_sensor_rotate_key_press_init(const struct device *dev) { return 0; };
|
||||
|
||||
static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding,
|
||||
const struct device *sensor, int64_t timestamp) {
|
||||
struct sensor_value value;
|
||||
int err;
|
||||
const struct sensor_value value, int64_t timestamp) {
|
||||
|
||||
uint32_t keycode;
|
||||
LOG_DBG("inc keycode 0x%02X dec keycode 0x%02X", binding->param1, binding->param2);
|
||||
|
||||
err = sensor_channel_get(sensor, SENSOR_CHAN_ROTATION, &value);
|
||||
|
||||
if (err) {
|
||||
LOG_WRN("Failed to ge sensor rotation value: %d", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
switch (value.val1) {
|
||||
case 1:
|
||||
keycode = binding->param1;
|
||||
|
|
Loading…
Add table
Reference in a new issue