Skip to content

Commit

Permalink
Revert "Add encoder abstraction. (qmk#21548)"
Browse files Browse the repository at this point in the history
This reverts commit 9d9cdaa.

# Conflicts:
#	data/schemas/keyboard.jsonschema
#	keyboards/pica40/rev2/rev2.c
#	keyboards/planck/rev7/matrix.c
#	keyboards/ploopyco/mouse/config.h
#	keyboards/ploopyco/mouse/keyboard.json
#	keyboards/ploopyco/mouse/rules.mk
#	keyboards/ploopyco/ploopyco.c
#	keyboards/ploopyco/trackball/config.h
#	keyboards/ploopyco/trackball/info.json
#	keyboards/ploopyco/trackball/rules.mk
#	keyboards/ploopyco/trackball/trackball.c
#	keyboards/ploopyco/trackball_mini/config.h
#	keyboards/ploopyco/trackball_mini/info.json
#	keyboards/ploopyco/trackball_mini/rules.mk
#	keyboards/ploopyco/trackball_mini/trackball_mini.c
#	keyboards/ploopyco/trackball_thumb/config.h
#	keyboards/ploopyco/trackball_thumb/trackball_thumb.c
#	quantum/encoder.c
#	quantum/encoder.h
#	quantum/split_common/transaction_id_define.h
#	quantum/split_common/transactions.c
  • Loading branch information
ykeisuke committed Jun 4, 2024
1 parent 6d365dd commit e3cb6bb
Show file tree
Hide file tree
Showing 50 changed files with 1,474 additions and 1,123 deletions.
15 changes: 0 additions & 15 deletions builddefs/common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -898,24 +898,9 @@ ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
endif
endif

ENCODER_ENABLE ?= no
ENCODER_DRIVER ?= quadrature
VALID_ENCODER_DRIVER_TYPES := quadrature custom
ifeq ($(strip $(ENCODER_ENABLE)), yes)
ifeq ($(filter $(ENCODER_DRIVER),$(VALID_ENCODER_DRIVER_TYPES)),)
$(call CATASTROPHIC_ERROR,Invalid ENCODER_DRIVER,ENCODER_DRIVER="$(ENCODER_DRIVER)" is not a valid encoder driver)
endif
SRC += $(QUANTUM_DIR)/encoder.c
OPT_DEFS += -DENCODER_ENABLE
OPT_DEFS += -DENCODER_DRIVER_$(strip $(shell echo $(ENCODER_DRIVER) | tr '[:lower:]' '[:upper:]'))

COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/encoder
COMMON_VPATH += $(DRIVER_PATH)/encoder

ifneq ($(strip $(ENCODER_DRIVER)), custom)
SRC += encoder_$(strip $(ENCODER_DRIVER)).c
endif

ifeq ($(strip $(ENCODER_MAP_ENABLE)), yes)
OPT_DEFS += -DENCODER_MAP_ENABLE
endif
Expand Down
1 change: 0 additions & 1 deletion data/mappings/info_rules.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"DEBOUNCE_TYPE": {"info_key": "build.debounce_type"},
"EEPROM_DRIVER": {"info_key": "eeprom.driver"},
"ENCODER_ENABLE": {"info_key": "encoder.enabled", "value_type": "bool"},
"ENCODER_DRIVER": {"info_key": "encoder.driver"},
"FIRMWARE_FORMAT": {"info_key": "build.firmware_format"},
"HAPTIC_DRIVER": {"info_key": "haptic.driver"},
"KEYBOARD_SHARED_EP": {"info_key": "usb.shared_endpoint.keyboard", "value_type": "bool"},
Expand Down
123 changes: 35 additions & 88 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
"encoder_config": {
"type": "object",
"properties": {
"driver": {
"type": "string",
"enum": ["custom", "quadrature"]
},
"rotary": {
"type": "array",
"items": {
Expand All @@ -28,12 +24,14 @@
"dip_switch_config": {
"type": "object",
"properties": {
"pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}
"pins": {
"$ref": "qmk.definitions.v1#/mcu_pin_array"
}
}
}
},
},
"type": "object",
"not": {"required": ["vendorId", "productId"]}, // reject via keys...
"not": { "required": [ "vendorId", "productId" ] }, // reject via keys...
"properties": {
"keyboard_name": {"$ref": "qmk.definitions.v1#/text_identifier"},
"keyboard_folder": {"$ref": "qmk.definitions.v1#/keyboard"},
Expand Down Expand Up @@ -133,20 +131,8 @@
"clicky": {"type": "boolean"}
}
},
"driver": {
"type": "string",
"enum": ["dac_additive", "dac_basic", "pwm_software", "pwm_hardware"]
},
"macro_beep": {"type": "boolean"},
"pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"},
"power_control": {
"type": "object",
"additionalProperties": false,
"properties": {
"on_state": {"$ref": "qmk.definitions.v1#/bit"},
"pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}
}
},
"voices": {"type": "boolean"}
}
},
Expand All @@ -156,7 +142,7 @@
"properties": {
"driver": {
"type": "string",
"enum": ["custom", "pwm", "software", "timer"]
"enum": ["pwm", "software", "timer", "custom"]
},
"default": {
"type": "object",
Expand Down Expand Up @@ -328,8 +314,8 @@
},
"features": {
"$ref": "qmk.definitions.v1#/boolean_array",
"propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"},
"not": {"required": ["lto"]}
"propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" },
"not": { "required": [ "lto" ] }
},
"indicators": {
"type": "object",
Expand All @@ -354,9 +340,15 @@
"type": "object",
"additionalProperties": false,
"properties": {
"filename": {"type": "string"},
"c_macro": {"type": "boolean"},
"json_layout": {"type": "boolean"},
"filename": {
"type": "string"
},
"c_macro": {
"type": "boolean"
},
"json_layout": {
"type": "boolean"
},
"layout": {
"type": "array",
"items": {
Expand Down Expand Up @@ -391,15 +383,6 @@
}
}
},
"haptic": {
"type": "object",
"properties": {
"driver": {
"type": "string",
"enum": ["drv2605l", "solenoid"]
}
}
},
"leader_key": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -448,8 +431,10 @@
"properties": {
"animations": {
"type": "object",
"propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"},
"additionalProperties": {"type": "boolean"}
"propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
"additionalProperties": {
"type": "boolean"
}
},
"default": {
"type": "object",
Expand All @@ -461,25 +446,7 @@
"speed": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}
}
},
"driver": {
"type": "string",
"enum": [
"custom",
"is31fl3218",
"is31fl3236",
"is31fl3729",
"is31fl3731",
"is31fl3733",
"is31fl3736",
"is31fl3737",
"is31fl3741",
"is31fl3742a",
"is31fl3743a",
"is31fl3745",
"is31fl3746a",
"snled27351"
]
},
"driver": {"type": "string"},
"center_point": {
"type": "array",
"minItems": 2,
Expand Down Expand Up @@ -528,8 +495,10 @@
"properties": {
"animations": {
"type": "object",
"propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"},
"additionalProperties": {"type": "boolean"}
"propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
"additionalProperties": {
"type": "boolean"
}
},
"default": {
"type": "object",
Expand All @@ -543,27 +512,7 @@
"speed": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}
}
},
"driver": {
"type": "string",
"enum": [
"aw20216s",
"custom",
"is31fl3218",
"is31fl3236",
"is31fl3729",
"is31fl3731",
"is31fl3733",
"is31fl3736",
"is31fl3737",
"is31fl3741",
"is31fl3742a",
"is31fl3743a",
"is31fl3745",
"is31fl3746a",
"snled27351",
"ws2812"
]
},
"driver": {"type": "string"},
"center_point": {
"type": "array",
"minItems": 2,
Expand Down Expand Up @@ -615,8 +564,10 @@
"properties": {
"animations": {
"type": "object",
"propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"},
"additionalProperties": {"type": "boolean"}
"propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
"additionalProperties": {
"type": "boolean"
}
},
"brightness_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"},
"default": {
Expand Down Expand Up @@ -661,10 +612,7 @@
"$ref": "qmk.definitions.v1#/mcu_pin",
"$comment": "Deprecated: use ws2812.pin instead"
},
"rgbw": {
"type": "boolean",
"$comment": "Deprecated: use ws2812.rgbw instead"
},
"rgbw": {"type": "boolean"},
"saturation_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"},
"sleep": {"type": "boolean"},
"split": {"type": "boolean"},
Expand Down Expand Up @@ -805,7 +753,7 @@
"properties": {
"protocol": {
"type": "string",
"enum": ["custom", "i2c", "serial"]
"enum": ["custom", "i2c", "serial", "serial_usart"]
},
"sync": {
"type": "object",
Expand All @@ -822,7 +770,7 @@
"st7565": {"type": "boolean"},
"wpm": {"type": "boolean"}
}
},
}
"watchdog": {"type": "boolean"},
"watchdog_timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"},
"sync_matrix_state": {
Expand Down Expand Up @@ -901,7 +849,7 @@
}
},
"suspend_wakeup_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"},
"wait_for_enumeration": {"type": "boolean"}
"wait_for": {"type": "boolean"}
}
},
"qmk": {
Expand Down Expand Up @@ -940,7 +888,6 @@
"enum": ["bitbang", "custom", "i2c", "pwm", "spi", "vendor"]
},
"pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
"rgbw": {"type": "boolean"},
"i2c_address": {"$ref": "qmk.definitions.v1#/hex_number_2d"},
"i2c_timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}
}
Expand Down
Loading

0 comments on commit e3cb6bb

Please sign in to comment.