Skip to content

Commit

Permalink
fix: Rename new prop to triggers-per-rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Dec 2, 2021
1 parent a774573 commit 0838fa9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,18 @@ endmenu
#Basic Keyboard Setup
endmenu

menu "Encoders"

config ZMK_ENCODERS_DEFAULT_TRIGGERS_PER_ROTATION
int "Default behavior triggers per rotation"
help
Unless overridden for a specific behavior in the keymap/devicetree, this value
determines how many times to trigger the bound behavior per full rotation.
For tactile encoders with detents, this usually should match the number of
detents per rotation of the encoder.
default 30

endmenu
menu "Display/LED Options"

rsource "src/display/Kconfig"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ properties:
label:
type: string
required: true
activation-resolution:
triggers-per-rotation:
type: int
required: false
"#sensor-binding-cells":
Expand Down
2 changes: 1 addition & 1 deletion app/src/behaviors/behavior_sensor_rotate_key_press.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static const struct behavior_driver_api behavior_sensor_rotate_key_press_driver_
#define KP_INST(n) \
static const struct behavior_sensor_rotate_key_press_cfg \
behavior_sensor_rotate_key_press_cfg_##n = { \
.activation_resolution = DT_INST_PROP_OR(n, activation_resolution, 1)}; \
.activation_resolution = (360 / DT_INST_PROP_OR(n, triggers_per_rotation, CONFIG_ZMK_ENCODERS_DEFAULT_TRIGGERS_PER_ROTATION))}; \
static struct behavior_sensor_rotate_key_press_sensor_data \
behavior_sensor_rotate_key_press_sensor_data_##n; \
DEVICE_DT_INST_DEFINE(n, behavior_sensor_rotate_key_press_init, device_pm_control_nop, \
Expand Down

0 comments on commit 0838fa9

Please sign in to comment.