Merge remote-tracking branch 'upstream/develop' into fl16-sleep-fix

This commit is contained in:
Daniel Schaefer 2023-07-21 08:34:44 +08:00
commit 1fe412facf
3814 changed files with 15612 additions and 19357 deletions

View File

@ -17,7 +17,6 @@ $(TEST)_INC := \
tests/test_common/common_config.h
$(TEST)_SRC := \
$(TMK_COMMON_SRC) \
$(QUANTUM_SRC) \
$(SRC) \
$(QUANTUM_PATH)/keymap_introspection.c \
@ -31,7 +30,7 @@ $(TEST)_SRC := \
tests/test_common/test_logger.cpp \
$(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp))
$(TEST)_DEFS := $(TMK_COMMON_DEFS) $(OPT_DEFS) "-DKEYMAP_C=\"keymap.c\""
$(TEST)_DEFS := $(OPT_DEFS) "-DKEYMAP_C=\"keymap.c\""
$(TEST)_CONFIG := $(TEST_PATH)/config.h

View File

@ -27,7 +27,6 @@ QMK_BIN ?= qmk
# Set the filename for the final firmware binary
KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD))
TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP)
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)
ifeq ($(strip $(DUMP_CI_METADATA)),yes)
$(info CI Metadata: KEYBOARD=$(KEYBOARD))
@ -44,7 +43,7 @@ endif
# Object files and generated keymap directory
# To put object files in current directory, use a dot (.), do NOT make
# this an empty or blank macro!
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
INTERMEDIATE_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
ifdef SKIP_VERSION
OPT_DEFS += -DSKIP_VERSION
@ -60,7 +59,7 @@ VERSION_H_FLAGS += --skip-git
endif
# Generate the board's version.h file.
$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(KEYMAP_OUTPUT)/src/version.h)
$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(INTERMEDIATE_OUTPUT)/src/version.h)
# Determine which subfolders exist.
KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD)
@ -121,7 +120,7 @@ MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
# Pull in rules from info.json
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_rules.mk)
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(INTERMEDIATE_OUTPUT)/src/info_rules.mk)
include $(INFO_RULES_MK)
# Check for keymap.json first, so we can regenerate keymap.c
@ -161,28 +160,28 @@ endif
# Have we found a keymap.json?
ifneq ("$(wildcard $(KEYMAP_JSON))", "")
KEYMAP_C := $(KEYMAP_OUTPUT)/src/keymap.c
KEYMAP_H := $(KEYMAP_OUTPUT)/src/config.h
KEYMAP_C := $(INTERMEDIATE_OUTPUT)/src/keymap.c
KEYMAP_H := $(INTERMEDIATE_OUTPUT)/src/config.h
# Load the keymap-level rules.mk if exists
-include $(KEYMAP_PATH)/rules.mk
# Load any rules.mk content from keymap.json
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --output $(KEYMAP_OUTPUT)/src/rules.mk $(KEYMAP_JSON))
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --output $(INTERMEDIATE_OUTPUT)/src/rules.mk $(KEYMAP_JSON))
include $(INFO_RULES_MK)
# Add rules to generate the keymap files - indentation here is important
$(KEYMAP_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
$(INTERMEDIATE_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON))
@$(BUILD_CMD)
$(KEYMAP_OUTPUT)/src/config.h: $(KEYMAP_JSON)
$(INTERMEDIATE_OUTPUT)/src/config.h: $(KEYMAP_JSON)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-config-h --quiet --output $(KEYMAP_H) $(KEYMAP_JSON))
@$(BUILD_CMD)
generated-files: $(KEYMAP_OUTPUT)/src/config.h $(KEYMAP_OUTPUT)/src/keymap.c
generated-files: $(INTERMEDIATE_OUTPUT)/src/config.h $(INTERMEDIATE_OUTPUT)/src/keymap.c
endif
@ -323,34 +322,34 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","")
INFO_JSON_FILES += $(KEYBOARD_PATH_5)/info.json
endif
CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h
KEYBOARD_SRC += $(KEYBOARD_OUTPUT)/src/default_keyboard.c
CONFIG_H += $(INTERMEDIATE_OUTPUT)/src/info_config.h
KEYBOARD_SRC += $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c
$(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
$(INTERMEDIATE_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_config.h)
$(eval CMD=$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --output $(INTERMEDIATE_OUTPUT)/src/info_config.h)
@$(BUILD_CMD)
$(KEYBOARD_OUTPUT)/src/default_keyboard.c: $(INFO_JSON_FILES)
$(INTERMEDIATE_OUTPUT)/src/default_keyboard.c: $(INFO_JSON_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-keyboard-c --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.c)
$(eval CMD=$(QMK_BIN) generate-keyboard-c --quiet --keyboard $(KEYBOARD) --output $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c)
@$(BUILD_CMD)
$(KEYBOARD_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES)
$(INTERMEDIATE_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --include $(FOUND_KEYBOARD_H) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.h)
$(eval CMD=$(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --include $(FOUND_KEYBOARD_H) --output $(INTERMEDIATE_OUTPUT)/src/default_keyboard.h)
@$(BUILD_CMD)
generated-files: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/default_keyboard.c $(KEYBOARD_OUTPUT)/src/default_keyboard.h
generated-files: $(INTERMEDIATE_OUTPUT)/src/info_config.h $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c $(INTERMEDIATE_OUTPUT)/src/default_keyboard.h
generated-files: $(KEYMAP_OUTPUT)/src/info_deps.d
generated-files: $(INTERMEDIATE_OUTPUT)/src/info_deps.d
$(KEYMAP_OUTPUT)/src/info_deps.d:
$(INTERMEDIATE_OUTPUT)/src/info_deps.d:
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-make-dependencies -kb $(KEYBOARD) -km $(KEYMAP) -o $(KEYMAP_OUTPUT)/src/info_deps.d)
$(eval CMD=$(QMK_BIN) generate-make-dependencies -kb $(KEYBOARD) -km $(KEYMAP) -o $(INTERMEDIATE_OUTPUT)/src/info_deps.d)
@$(BUILD_CMD)
-include $(KEYMAP_OUTPUT)/src/info_deps.d
-include $(INTERMEDIATE_OUTPUT)/src/info_deps.d
.INTERMEDIATE : generated-files
@ -423,8 +422,7 @@ VPATH += $(KEYMAP_PATH)
VPATH += $(USER_PATH)
VPATH += $(KEYBOARD_PATHS)
VPATH += $(COMMON_VPATH)
VPATH += $(KEYBOARD_OUTPUT)/src
VPATH += $(KEYMAP_OUTPUT)/src
VPATH += $(INTERMEDIATE_OUTPUT)/src
include $(BUILDDEFS_PATH)/common_features.mk
include $(BUILDDEFS_PATH)/generic_features.mk
@ -433,19 +431,17 @@ include $(PLATFORM_PATH)/common.mk
SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC))
SRC += $(TMK_COMMON_SRC)
OPT_DEFS += $(TMK_COMMON_DEFS)
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/bootloader.mk
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk
ifneq ($(strip $(PROTOCOL)),)
include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
PROTOCOL_KEY = $(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]'))
else
include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
PROTOCOL_KEY = $(PLATFORM_KEY)
endif
include $(TMK_PATH)/protocol/$(PROTOCOL_KEY)/$(PROTOCOL_KEY).mk
# Setup definitions based on the selected MCU
$(eval $(call add_qmk_prefix_defs,MCU_ORIG,MCU))
@ -471,17 +467,14 @@ PROJECT_CONFIG := $(CONFIG_H)
CONFIG_H += $(POST_CONFIG_H)
ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
$(KEYMAP_OUTPUT)_SRC := $(SRC)
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) \
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(KEYBOARD_OUTPUT)/src/default_keyboard.h\" \
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\"
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
$(KEYBOARD_OUTPUT)_SRC := $(PLATFORM_SRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
OUTPUTS := $(INTERMEDIATE_OUTPUT)
$(INTERMEDIATE_OUTPUT)_SRC := $(SRC) $(PLATFORM_SRC)
$(INTERMEDIATE_OUTPUT)_DEFS := $(OPT_DEFS) \
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(INTERMEDIATE_OUTPUT)/src/default_keyboard.h\" \
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \
$(PROJECT_DEFS)
$(INTERMEDIATE_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) $(PROJECT_INC)
$(INTERMEDIATE_OUTPUT)_CONFIG := $(CONFIG_H) $(PROJECT_CONFIG)
# Default target.
all: build check-size

View File

@ -565,18 +565,18 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
endif
COMMON_VPATH += $(QUANTUM_DIR)/backlight
COMMON_VPATH += $(DRIVER_PATH)/backlight
SRC += $(QUANTUM_DIR)/backlight/backlight.c
SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c
OPT_DEFS += -DBACKLIGHT_ENABLE
ifeq ($(strip $(BACKLIGHT_DRIVER)), custom)
OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
else
ifneq ($(strip $(BACKLIGHT_DRIVER)), custom)
SRC += $(QUANTUM_DIR)/backlight/backlight_driver_common.c
ifeq ($(strip $(BACKLIGHT_DRIVER)), pwm)
SRC += $(QUANTUM_DIR)/backlight/backlight_$(PLATFORM_KEY).c
ifeq ($(strip $(BACKLIGHT_DRIVER)), software)
SRC += $(DRIVER_PATH)/backlight/backlight_software.c
else
SRC += $(QUANTUM_DIR)/backlight/backlight_$(strip $(BACKLIGHT_DRIVER)).c
SRC += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/backlight_$(strip $(BACKLIGHT_DRIVER)).c
endif
endif
endif

View File

@ -176,7 +176,7 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@)
# For a ChibiOS build, ensure that the board files have the hook overrides injected
define BOARDSRC_INJECT_HOOKS
$(KEYBOARD_OUTPUT)/$(patsubst %.c,%.o,$(patsubst ./%,%,$1)): INIT_HOOK_CFLAGS += -include $(TOP_DIR)/tmk_core/protocol/chibios/init_hooks.h
$(INTERMEDIATE_OUTPUT)/$(patsubst %.c,%.o,$(patsubst ./%,%,$1)): INIT_HOOK_CFLAGS += -include $(TOP_DIR)/tmk_core/protocol/chibios/init_hooks.h
endef
$(foreach LOBJ, $(BOARDSRC), $(eval $(call BOARDSRC_INJECT_HOOKS,$(LOBJ))))

View File

@ -117,6 +117,7 @@
"RGBLIGHT_LAYER_BLINK": {"info_key": "rgblight.layers.blink", "value_type": "bool"},
"RGBLIGHT_LAYERS": {"info_key": "rgblight.layers.enabled", "value_type": "bool"},
"RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF": {"info_key": "rgblight.layers.override_rgb", "value_type": "bool"},
"RGBLIGHT_LED_MAP": {"info_key": "rgblight.led_map", "value_type": "array.int"},
"RGBLIGHT_LIMIT_VAL": {"info_key": "rgblight.max_brightness", "value_type": "int"},
"RGBLIGHT_MAX_LAYERS": {"info_key": "rgblight.layers.max", "value_type": "int"},
"RGBLIGHT_SAT_STEP": {"info_key": "rgblight.saturation_steps", "value_type": "int"},

View File

@ -212,6 +212,9 @@
"gmmk/pro/iso": {
"target": "gmmk/pro/rev1/iso"
},
"handwired/dactyl_manuform/6x6_kinesis": {
"target": "handwired/dactyl_kinesis"
},
"handwired/ferris": {
"target": "ferris/0_1"
},
@ -868,6 +871,9 @@
"hecomi/alpha": {
"target": "takashiski/hecomi/alpha"
},
"hfdkb/keyboard_sw/k83":{
"target": "inland/kb83"
},
"hid_liber": {
"target": "bpiphany/hid_liber"
},

View File

@ -71,6 +71,8 @@
"STM32F446",
"STM32G431",
"STM32G474",
"STM32H723",
"STM32H733",
"STM32L412",
"STM32L422",
"STM32L432",
@ -491,6 +493,11 @@
}
},
"led_count": {"$ref": "qmk.definitions.v1#/unsigned_int"},
"led_map": {
"type": "array",
"minItems": 2,
"items": {"$ref": "qmk.definitions.v1#/unsigned_int"}
},
"max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
"pin": {
"$ref": "qmk.definitions.v1#/mcu_pin",

View File

@ -119,6 +119,7 @@ This happens immediately after the previous `develop` branch is merged to `maste
* `git commit -m 'Branch point for <DATE> Breaking Change'`
* `git tag breakpoint_<YYYY>_<MM>_<DD>`
* `git push upstream breakpoint_<YYYY>_<MM>_<DD>`
* `git push upstream develop`
* All submodules under `lib` now need to be checked against their QMK-based forks:
* `git submodule foreach git log -n1`

View File

@ -43,6 +43,8 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s
* [STM32F446](https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html)
* [STM32G431](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x1.html)
* [STM32G474](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x4.html)
* [STM32H723](https://www.st.com/en/microcontrollers-microprocessors/stm32h723-733.html)
* [STM32H733](https://www.st.com/en/microcontrollers-microprocessors/stm32h723-733.html)
* [STM32L412](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html)
* [STM32L422](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html)
* [STM32L432](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html)

View File

@ -79,8 +79,8 @@ If you are not sure how to edit this file or are not comfortable with Python [op
The final piece of the puzzle is providing your new option to the build system. This is done by generating two files:
* `.build/obj_<keyboard>/src/info_config.h`
* `.build/obj_<keyboard>/src/rules.mk`
* `.build/obj_<keyboard>_<keymap>/src/info_config.h`
* `.build/obj_<keyboard>_<keymap>/src/rules.mk`
These two files are generated by the code here:

View File

@ -133,7 +133,17 @@ groups in the below fallback switch.
### NO_AUTO_SHIFT_SPECIAL (simple define)
Do not Auto Shift special keys, which include -\_, =+, [{, ]}, ;:, '", ,<, .>,
and /?
/?, and the KC_TAB.
### NO_AUTO_SHIFT_TAB (simple define)
Do not Auto Shift KC_TAB but leave Auto Shift enabled for the other special
characters.
### NO_AUTO_SHIFT_SYMBOLS (simple define)
Do not Auto Shift symbol keys, which include -\_, =+, [{, ]}, ;:, '", ,<, .>,
and /?.
### NO_AUTO_SHIFT_NUMERIC (simple define)
@ -143,9 +153,13 @@ Do not Auto Shift numeric keys, zero through nine.
Do not Auto Shift alpha characters, which include A through Z.
### AUTO_SHIFT_ENTER (simple define)
Auto Shift the enter key.
### Auto Shift Per Key
There are functions that allows you to determine which keys shold be autoshifted, much like the tap-hold keys.
There are functions that allows you to determine which keys should be autoshifted, much like the tap-hold keys.
The first of these, used to simply add a key to Auto Shift, is `get_custom_auto_shifted_key`:
@ -172,9 +186,15 @@ bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
case KC_1 ... KC_0:
# endif
# ifndef NO_AUTO_SHIFT_SPECIAL
# ifndef NO_AUTO_SHIFT_TAB
case KC_TAB:
case KC_MINUS ... KC_SLASH:
case KC_NONUS_BACKSLASH:
# endif
# ifndef NO_AUTO_SHIFT_SYMBOLS
case AUTO_SHIFT_SYMBOLS:
# endif
# endif
# ifdef AUTO_SHIFT_ENTER
case KC_ENT:
# endif
return true;
}
@ -192,6 +212,25 @@ Enables keyrepeat.
Disables automatically keyrepeating when `AUTO_SHIFT_TIMEOUT` is exceeded.
### AUTO_SHIFT_ALPHA (predefined key group)
A predefined group of keys representing A through Z.
### AUTO_SHIFT_NUMERIC (predefined key group)
A predefined group of keys representing 0 through 9. Note, these are defined as
1 through 0 since that is the order they normally appear in.
### AUTO_SHIFT_SYMBOLS (predefined key group)
A predefined group of keys representing symbolic characters which include -\_, =+, [{, ]}, ;:, '", ,<, .>,
and /?.
### AUTO_SHIFT_SPECIAL (predefined key group)
A predefined group of keys that combines AUTO_SHIFT_SYMBOLS and KC_TAB.
## Custom Shifted Values
Especially on small keyboards, the default shifted value for many keys is not

View File

@ -198,7 +198,9 @@ bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *t
### Apply Autocorrect
Additionally, `apply_autocorrect(uint8_t backspaces, const char *str)` allows for users to add additional handling to the autocorrection, or replace the functionality entirely. This passes on the number of backspaces needed to replace the words, as well as the replacement string (partial word, not the full word).
Additionally, `apply_autocorrect(uint8_t backspaces, const char *str, char *typo, char *correct)` allows for users to add additional handling to the autocorrection, or replace the functionality entirely. This passes on the number of backspaces needed to replace the words, as well as the replacement string (partial word, not the full word), and the typo and corrected strings (complete words).
?> Due to the way code works (no notion of words, just a stream of letters), the `typo` and `correct` strings are a best bet and could be "wrong". For example you may get `wordtpyo` & `wordtypo` instead of the expected `tpyo` & `typo`.
#### Apply Autocorrect Example
@ -209,7 +211,7 @@ This following example will play a sound when a typo is autocorrected and execut
float autocorrect_song[][2] = SONG(TERMINAL_SOUND);
#endif
bool apply_autocorrect(uint8_t backspaces, const char *str) {
bool apply_autocorrect(uint8_t backspaces, const char *str, char *typo, char *correct) {
#ifdef AUDIO_ENABLE
PLAY_SONG(autocorrect_song);
#endif
@ -223,14 +225,17 @@ bool apply_autocorrect(uint8_t backspaces, const char *str) {
?> In this callback function, `return false` will stop the normal processing of autocorrect, which requires manually handling of removing the "bad" characters and typing the new characters.
!> ***IMPORTANT***: `str` is a pointer to `PROGMEM` data for the autocorrection. If you return false, and want to send the string, this needs to use `send_string_P` and not `send_string` or `SEND_STRING`.
!> ***IMPORTANT***: `str` is a pointer to `PROGMEM` data for the autocorrection. If you return false, and want to send the string, this needs to use `send_string_P` and not `send_string` nor `SEND_STRING`.
You can also use `apply_autocorrect` to detect and display the event but allow internal code to execute the autocorrection with `return true`:
```c
bool apply_autocorrect(uint8_t backspaces, const char *str) {
bool apply_autocorrect(uint8_t backspaces, const char *str, char *typo, char *correct) {
#ifdef OLED_ENABLE
oled_write_P(PSTR("Auto-corrected"), false);
#endif
#ifdef CONSOLE_ENABLE
printf("'%s' was corrected to '%s'\n", typo, correct);
#endif
return true;
}

View File

@ -1,6 +1,6 @@
# HD44780 LCD Driver
# HD44780 LCD Driver :id=hd44780-lcd-driver
## Supported Hardware
## Supported Hardware :id=supported-hardware
LCD modules using [HD44780U](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf) IC or equivalent, communicating in 4-bit mode.
@ -11,7 +11,7 @@ LCD modules using [HD44780U](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf
To run these modules at 3.3V, an additional MAX660 voltage converter IC must be soldered on, along with two 10µF capacitors. See [this page](https://www.codrey.com/electronic-circuits/hack-your-16x2-lcd/) for more details.
## Usage
## Usage :id=usage
Add the following to your `rules.mk`:
@ -19,7 +19,7 @@ Add the following to your `rules.mk`:
HD44780_ENABLE = yes
```
## Basic Configuration
## Basic Configuration :id=basic-configuration
Add the following to your `config.h`:
@ -33,9 +33,9 @@ Add the following to your `config.h`:
|`HD44780_DISPLAY_LINES`|`2` |The number of visible lines on the display |
|`HD44780_WRAP_LINES` |*Not defined* |If defined, input characters will wrap to the next line |
## Examples
## Examples :id=examples
### Hello World
### Hello World :id=example-hello-world
Add the following to your `keymap.c`:
@ -46,7 +46,7 @@ void keyboard_post_init_user(void) {
}
```
### Custom Character Definition
### Custom Character Definition :id=example-custom-character
Up to eight custom characters can be defined. This data is stored in the Character Generator RAM (CGRAM), and is not persistent across power cycles.
@ -77,15 +77,15 @@ void keyboard_post_init_user(void) {
}
```
## API
## API :id=api
### `void hd44780_init(bool cursor, bool blink)`
### `void hd44780_init(bool cursor, bool blink)` :id=api-hd44780-init
Initialize the display.
This function should be called only once, before any of the other functions can be called.
#### Arguments
#### Arguments :id=api-hd44780-init-arguments
- `bool cursor`
Whether to show the cursor.
@ -94,7 +94,7 @@ This function should be called only once, before any of the other functions can
---
### `void hd44780_clear(void)`
### `void hd44780_clear(void)` :id=api-hd44780-clear
Clear the display.
@ -102,7 +102,7 @@ This function is called on init.
---
### `void hd44780_home(void)`
### `void hd44780_home(void)` :id=api-hd44780-home
Move the cursor to the home position.
@ -110,13 +110,13 @@ This function is called on init.
---
### `void hd44780_on(bool cursor, bool blink)`
### `void hd44780_on(bool cursor, bool blink)` :id=api-hd44780-on
Turn the display on, and/or set the cursor properties.
This function is called on init.
#### Arguments
#### Arguments :id=api-hd44780-on-arguments
- `bool cursor`
Whether to show the cursor.
@ -125,17 +125,17 @@ This function is called on init.
---
### `void hd44780_off(void)`
### `void hd44780_off(void)` :id=api-hd44780-off
Turn the display off.
---
### `void hd44780_set_cursor(uint8_t col, uint8_t line)`
### `void hd44780_set_cursor(uint8_t col, uint8_t line)` :id=api-hd44780-set-cursor
Move the cursor to the specified position on the display.
#### Arguments
#### Arguments :id=api-hd44780-set-cursor-arguments
- `uint8_t col`
The column number to move to, from 0 to 15 on 16x2 displays.
@ -144,48 +144,48 @@ Move the cursor to the specified position on the display.
---
### `void hd44780_putc(char c)`
### `void hd44780_putc(char c)` :id=api-hd44780-putc
Print a character to the display. The newline character `\n` will move the cursor to the start of the next line.
The exact character shown may depend on the ROM code of your particular display - refer to the datasheet for the full character set.
#### Arguments
#### Arguments :id=api-hd44780-putc-arguments
- `char c`
The character to print.
---
### `void hd44780_puts(const char *s)`
### `void hd44780_puts(const char *s)` :id=api-hd44780-puts
Print a string of characters to the display.
#### Arguments
#### Arguments :id=api-hd44780-puts-arguments
- `const char *s`
The string to print.
---
### `void hd44780_puts_P(const char *s)`
### `void hd44780_puts_P(const char *s)` :id=api-hd44780-puts-p
Print a string of characters from PROGMEM to the display.
On ARM devices, this function is simply an alias of `hd44780_puts()`.
#### Arguments
#### Arguments :id=api-hd44780-puts-p-arguments
- `const char *s`
The PROGMEM string to print (ie. `PSTR("Hello")`).
---
### `void hd44780_define_char(uint8_t index, uint8_t *data)`
### `void hd44780_define_char(uint8_t index, uint8_t *data)` :id=api-hd44780-define-char
Define a custom character.
#### Arguments
#### Arguments :id=api-hd44780-define-char-arguments
- `uint8_t index`
The index of the custom character to define, from 0 to 7.
@ -194,13 +194,13 @@ Define a custom character.
---
### `void hd44780_define_char_P(uint8_t index, const uint8_t *data)`
### `void hd44780_define_char_P(uint8_t index, const uint8_t *data)` :id=api-hd44780-define-char-p
Define a custom character from PROGMEM.
On ARM devices, this function is simply an alias of `hd44780_define_char()`.
#### Arguments
#### Arguments :id=api-hd44780-define-char-p-arguments
- `uint8_t index`
The index of the custom character to define, from 0 to 7.
@ -209,21 +209,21 @@ On ARM devices, this function is simply an alias of `hd44780_define_char()`.
---
### `bool hd44780_busy(void)`
### `bool hd44780_busy(void)` :id=api-hd44780-busy
Indicates whether the display is currently processing, and cannot accept instructions.
#### Return Value
#### Return Value :id=api-hd44780-busy-arguments
`true` if the display is busy.
---
### `void hd44780_write(uint8_t data, bool isData)`
### `void hd44780_write(uint8_t data, bool isData)` :id=api-hd44780-write
Write a byte to the display.
#### Arguments
#### Arguments :id=api-hd44780-write-arguments
- `uint8_t data`
The byte to send to the display.
@ -232,67 +232,67 @@ Write a byte to the display.
---
### `uint8_t hd44780_read(bool isData)`
### `uint8_t hd44780_read(bool isData)` :id=api-hd44780-read
Read a byte from the display.
#### Arguments
#### Arguments :id=api-hd44780-read-arguments
- `bool isData`
Whether to read the current cursor position, or the character at the cursor.
#### Return Value
#### Return Value :id=api-hd44780-read-return
If `isData` is `true`, the returned byte will be the character at the current DDRAM address. Otherwise, it will be the current DDRAM address and the busy flag.
---
### `void hd44780_command(uint8_t command)`
### `void hd44780_command(uint8_t command)` :id=api-hd44780-command
Send a command to the display. Refer to the datasheet and `hd44780.h` for the valid commands and defines.
This function waits for the display to clear the busy flag before sending the command.
#### Arguments
#### Arguments :id=api-hd44780-command-arguments
- `uint8_t command`
The command to send.
---
### `void hd44780_data(uint8_t data)`
### `void hd44780_data(uint8_t data)` :id=api-hd44780-data
Send a byte of data to the display.
This function waits for the display to clear the busy flag before sending the data.
#### Arguments
#### Arguments :id=api-hd44780-data-arguments
- `uint8_t data`
The byte of data to send.
---
### `void hd44780_set_cgram_address(uint8_t address)`
### `void hd44780_set_cgram_address(uint8_t address)` :id=api-hd44780-set-cgram-address
Set the CGRAM address.
This function is used when defining custom characters.
#### Arguments
#### Arguments :id=api-hd44780-set-cgram-address-arguments
- `uint8_t address`
The CGRAM address to move to, from `0x00` to `0x3F`.
---
### `void hd44780_set_ddram_address(uint8_t address)`
### `void hd44780_set_ddram_address(uint8_t address)` :id=api-hd44780-set-ddram-address
Set the DDRAM address.
This function is used when printing characters to the display, and setting the cursor.
#### Arguments
#### Arguments :id=api-hd44780-set-ddram-address-arguments
- `uint8_t address`
The DDRAM address to move to, from `0x00` to `0x7F`.

View File

@ -225,3 +225,30 @@ The duration of the key repeat delay is controlled with the `KEY_OVERRIDE_REPEAT
## Difference to Combos :id=difference-to-combos
Note that key overrides are very different from [combos](https://docs.qmk.fm/#/feature_combo). Combos require that you press down several keys almost _at the same time_ and can work with any combination of non-modifier keys. Key overrides work like keyboard shortcuts (e.g. `ctrl` + `z`): They take combinations of _multiple_ modifiers and _one_ non-modifier key to then perform some custom action. Key overrides are implemented with much care to behave just like normal keyboard shortcuts would in regards to the order of pressed keys, timing, and interacton with other pressed keys. There are a number of optional settings that can be used to really fine-tune the behavior of each key override as well. Using key overrides also does not delay key input for regular key presses, which inherently happens in combos and may be undesirable.
## Solution to the problem of flashing modifiers :id=neutralize-flashing-modifiers
If the programs you use bind an action to taps of modifier keys (e.g. tapping left GUI to bring up the applications menu or tapping left Alt to focus the menu bar), you may find that using key overrides with suppressed mods falsely triggers those actions. To counteract this, you can define a `DUMMY_MOD_NEUTRALIZER_KEYCODE` in `config.h` that will get sent in between the register and unregister events of a suppressed modifier. That way, the programs on your computer will no longer interpret the mod suppression induced by key overrides as a lone tap of a modifier key and will thus not falsely trigger the undesired action.
Naturally, for this technique to be effective, you must choose a `DUMMY_MOD_NEUTRALIZER_KEYCODE` for which no keyboard shortcuts are bound to. Recommended values are: `KC_RIGHT_CTRL` or `KC_F18`.
Please note that `DUMMY_MOD_NEUTRALIZER_KEYCODE` must be a basic, unmodified, HID keycode so values like `KC_NO`, `KC_TRANSPARENT` or `KC_PIPE` aka `S(KC_BACKSLASH)` are not permitted.
By default, only left Alt and left GUI are neutralized. If you want to change the list of applicable modifier masks, use the following in your `config.h`:
```c
#define MODS_TO_NEUTRALIZE { <mod_mask_1>, <mod_mask_2>, ... }
```
Examples:
```c
#define DUMMY_MOD_NEUTRALIZER_KEYCODE KC_RIGHT_CTRL
// Neutralize left alt and left GUI (Default value)
#define MODS_TO_NEUTRALIZE { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI) }
// Neutralize left alt, left GUI, right GUI and left Control+Shift
#define MODS_TO_NEUTRALIZE { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI), MOD_BIT(KC_RIGHT_GUI), MOD_BIT(KC_LEFT_CTRL)|MOD_BIT(KC_LEFT_SHIFT) }
```
!> Do not use `MOD_xxx` constants like `MOD_LSFT` or `MOD_RALT`, since they're 5-bit packed bit-arrays while `MODS_TO_NEUTRALIZE` expects a list of 8-bit packed bit-arrays. Use `MOD_BIT(<kc>)` or `MOD_MASK_xxx` instead.

View File

@ -139,7 +139,7 @@ Currently only 4 drivers are supported, but it would be trivial to support for m
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led __flash g_is31_leds[LED_MATRIX_LED_COUNT] = {
const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | LED address
@ -158,7 +158,7 @@ Eg `#define ISSI_MANUAL_SCALING 3`
Then Define the array listing all the LEDs you want to override in your `<keyboard>.c`:
```c
const is31_led __flash g_is31_scaling[ISSI_MANUAL_SCALING] = {
const is31_led PROGMEM g_is31_scaling[ISSI_MANUAL_SCALING] = {
* LED Index
* | Scaling
* | | */

View File

@ -67,6 +67,7 @@ This is the default mode. You can adjust the cursor and scrolling acceleration u
|`MOUSEKEY_TIME_TO_MAX` |30 |Time until maximum cursor speed is reached |
|`MOUSEKEY_WHEEL_DELAY` |10 |Delay between pressing a wheel key and wheel movement |
|`MOUSEKEY_WHEEL_INTERVAL` |80 |Time between wheel movements |
|`MOUSEKEY_WHEEL_DELTA` |1 |Wheel movement step size |
|`MOUSEKEY_WHEEL_MAX_SPEED` |8 |Maximum number of scroll steps per scroll action |
|`MOUSEKEY_WHEEL_TIME_TO_MAX`|40 |Time until maximum scroll speed is reached |
@ -101,7 +102,7 @@ This is an extension of the accelerated mode. The kinetic mode uses a quadratic
Tips:
* The smoothness of the cursor movement depends on the `MOUSEKEY_INTERVAL` setting. The shorter the interval is set the smoother the movement will be. Setting the value too low makes the cursor unresponsive. Lower settings are possible if the micro processor is fast enough. For example: At an interval of `8` milliseconds, `125` movements per second will be initiated. With a base speed of `1000` each movement will move the cursor by `8` pixels.
* Mouse wheel movements are implemented differently from cursor movements. While it's okay for the cursor to move multiple pixels at once for the mouse wheel this would lead to jerky movements. Instead, the mouse wheel operates at step size `2`. Setting mouse wheel speed is done by adjusting the number of wheel movements per second.
* Mouse wheel movements are implemented differently from cursor movements. While it's okay for the cursor to move multiple pixels at once for the mouse wheel this would lead to jerky movements. Instead, the mouse wheel operates at step size `1`. Setting mouse wheel speed is done by adjusting the number of wheel movements per second.
### Constant mode

View File

@ -386,7 +386,7 @@ Currently only 4 drivers are supported, but it would be trivial to support for m
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led __flash g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
@ -406,7 +406,7 @@ Eg `#define ISSI_MANUAL_SCALING 3`
Then Define the array listing all the LEDs you want to override in your `<keyboard>.c`:
```c
const is31_led __flash g_is31_scaling[ISSI_MANUAL_SCALING] = {
const is31_led PROGMEM g_is31_scaling[ISSI_MANUAL_SCALING] = {
* LED Index
* | R scaling
* | | G scaling

View File

@ -524,37 +524,6 @@ By defining `RGBLIGHT_LED_MAP` as in the example below, you can specify the LED
```
<img src="https://user-images.githubusercontent.com/2170248/55743725-08ad7a80-5a6e-11e9-83ed-126a2b0209fc.JPG" alt="simple mapped" width="50%"/>
For keyboards that use the RGB LEDs as a backlight for each key, you can also define it as in the example below.
```c
// config.h
#define RGBLED_NUM 30
/* RGB LED Conversion macro from physical array to electric array */
#define LED_LAYOUT( \
L00, L01, L02, L03, L04, L05, \
L10, L11, L12, L13, L14, L15, \
L20, L21, L22, L23, L24, L25, \
L30, L31, L32, L33, L34, L35, \
L40, L41, L42, L43, L44, L45 ) \
{ \
L05, L04, L03, L02, L01, L00, \
L10, L11, L12, L13, L14, L15, \
L25, L24, L23, L22, L21, L20, \
L30, L31, L32, L33, L34, L35, \
L46, L45, L44, L43, L42, L41 \
}
/* RGB LED logical order map */
/* Top->Bottom, Right->Left */
#define RGBLIGHT_LED_MAP LED_LAYOUT( \
25, 20, 15, 10, 5, 0, \
26, 21, 16, 11, 6, 1, \
27, 22, 17, 12, 7, 2, \
28, 23, 18, 13, 8, 3, \
29, 24, 19, 14, 9, 4 )
```
## Clipping Range

View File

@ -1,4 +1,4 @@
# Send String
# Send String :id=send-string
The Send String API is part of QMK's macro system. It allows for sequences of keystrokes to be sent automatically.
@ -6,7 +6,7 @@ The full ASCII character set is supported, along with all of the keycodes in the
?> Unicode characters are **not** supported with this API -- see the [Unicode](feature_unicode.md) feature instead.
## Usage
## Usage :id=usage
Send String is enabled by default, so there is usually no need for any special setup. However, if it is disabled, add the following to your `rules.mk`:
@ -14,7 +14,7 @@ Send String is enabled by default, so there is usually no need for any special s
SEND_STRING_ENABLE = yes
```
## Basic Configuration
## Basic Configuration :id=basic-configuration
Add the following to your `config.h`:
@ -23,7 +23,7 @@ Add the following to your `config.h`:
|`SENDSTRING_BELL`|*Not defined* |If the [Audio](feature_audio.md) feature is enabled, the `\a` character (ASCII `BEL`) will beep the speaker.|
|`BELL_SOUND` |`TERMINAL_SOUND`|The song to play when the `\a` character is encountered. By default, this is an eighth note of C5. |
## Keycodes
## Keycodes :id=keycodes
The Send String functions accept C string literals, but specific keycodes can be injected with the below macros. All of the keycodes in the [Basic Keycode range](keycodes_basic.md) are supported (as these are the only ones that will actually be sent to the host), but with an `X_` prefix instead of `KC_`.
@ -44,13 +44,13 @@ The following characters are also mapped to their respective keycodes for conven
|`\t` |`\x1B`|`TAB`|`KC_TAB` |
| |`\x7F`|`DEL`|`KC_DELETE` |
### Language Support
### Language Support :id=language-support
By default, Send String assumes your OS keyboard layout is set to US ANSI. If you are using a different keyboard layout, you can [override the lookup tables used to convert ASCII characters to keystrokes](reference_keymap_extras.md#sendstring-support).
## Examples
## Examples :id=examples
### Hello World
### Hello World :id=example-hello-world
A simple custom keycode which types out "Hello, world!" and the Enter key when pressed.
@ -70,7 +70,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
```
### Keycode Injection
### Keycode Injection :id=example-keycode-injection
This example types out opening and closing curly braces, then taps the left arrow key to move the cursor between the two.
@ -84,26 +84,26 @@ This example types Ctrl+A, then Ctrl+C, without releasing Ctrl.
SEND_STRING(SS_LCTL("ac"));
```
## API
## API :id=api
### `void send_string(const char *string)`
### `void send_string(const char *string)` :id=api-send-string
Type out a string of ASCII characters.
This function simply calls `send_string_with_delay(string, 0)`.
#### Arguments
#### Arguments :id=api-send-string-arguments
- `const char *string`
The string to type out.
---
### `void send_string_with_delay(const char *string, uint8_t interval)`
### `void send_string_with_delay(const char *string, uint8_t interval)` :id=api-send-string-with-delay
Type out a string of ASCII characters, with a delay between each character.
#### Arguments
#### Arguments :id=api-send-string-with-delay-arguments
- `const char *string`
The string to type out.
@ -112,26 +112,26 @@ Type out a string of ASCII characters, with a delay between each character.
---
### `void send_string_P(const char *string)`
### `void send_string_P(const char *string)` :id=api-send-string-p
Type out a PROGMEM string of ASCII characters.
On ARM devices, this function is simply an alias for `send_string_with_delay(string, 0)`.
#### Arguments
#### Arguments :id=api-send-string-p-arguments
- `const char *string`
The string to type out.
---
### `void send_string_with_delay_P(const char *string, uint8_t interval)`
### `void send_string_with_delay_P(const char *string, uint8_t interval)` :id=api-send-string-with-delay-p
Type out a PROGMEM string of ASCII characters, with a delay between each character.
On ARM devices, this function is simply an alias for `send_string_with_delay(string, interval)`.
#### Arguments
#### Arguments :id=api-send-string-with-delay-p-arguments
- `const char *string`
The string to type out.
@ -140,76 +140,76 @@ On ARM devices, this function is simply an alias for `send_string_with_delay(str
---
### `void send_char(char ascii_code)`
### `void send_char(char ascii_code)` :id=api-send-char
Type out an ASCII character.
#### Arguments
#### Arguments :id=api-send-char-arguments
- `char ascii_code`
The character to type.
---
### `void send_dword(uint32_t number)`
### `void send_dword(uint32_t number)` :id=api-send-dword
Type out an eight digit (unsigned 32-bit) hexadecimal value.
The format is `[0-9a-f]{8}`, eg. `00000000` through `ffffffff`.
#### Arguments
#### Arguments :id=api-send-dword-arguments
- `uint32_t number`
The value to type, from 0 to 4,294,967,295.
---
### `void send_word(uint16_t number)`
### `void send_word(uint16_t number)` :id=api-send-word
Type out a four digit (unsigned 16-bit) hexadecimal value.
The format is `[0-9a-f]{4}`, eg. `0000` through `ffff`.
#### Arguments
#### Arguments :id=api-send-word-arguments
- `uint16_t number`
The value to type, from 0 to 65,535.
---
### `void send_byte(uint8_t number)`
### `void send_byte(uint8_t number)` :id=api-send-bytes
Type out a two digit (8-bit) hexadecimal value.
The format is `[0-9a-f]{2}`, eg. `00` through `ff`.
#### Arguments
#### Arguments :id=api-send-byte-arguments
- `uint8_t number`
The value to type, from 0 to 255.
---
### `void send_nibble(uint8_t number)`
### `void send_nibble(uint8_t number)` :id=api-send-nibble
Type out a single hexadecimal digit.
The format is `[0-9a-f]{1}`, eg. `0` through `f`.
#### Arguments
#### Arguments :id=api-send-nibble-arguments
- `uint8_t number`
The value to type, from 0 to 15.
---
### `void tap_random_base64(void)`
### `void tap_random_base64(void)` :id=api-tap-random-base64
Type a pseudorandom character from the set `A-Z`, `a-z`, `0-9`, `+` and `/`.
---
### `SEND_STRING(string)`
### `SEND_STRING(string)` :id=api-send-string-macro
Shortcut macro for `send_string_with_delay_P(PSTR(string), 0)`.
@ -217,7 +217,7 @@ On ARM devices, this define evaluates to `send_string_with_delay(string, 0)`.
---
### `SEND_STRING_DELAY(string, interval)`
### `SEND_STRING_DELAY(string, interval)` :id=api-send-string-delay-macro
Shortcut macro for `send_string_with_delay_P(PSTR(string), interval)`.

View File

@ -42,7 +42,7 @@ Add the following to your `rules.mk`:
UNICODEMAP_ENABLE = yes
```
Then add `X(i)` keycodes to your keymap, where _i_ is the desired character's index in the mapping table. This can be a numeric value, but it's recommended to keep the indices in an enum and access them by name.
Then add `UM(i)` keycodes to your keymap, where _i_ is the desired character's index in the mapping table. This can be a numeric value, but it's recommended to keep the indices in an enum and access them by name.
```c
enum unicode_names {
@ -58,13 +58,13 @@ const uint32_t unicode_map[] PROGMEM = {
};
```
Then you can use `X(BANG)`, `X(SNEK)` etc. in your keymap.
Then you can use `UM(BANG)`, `UM(SNEK)` etc. in your keymap.
#### Lower and Upper Case
Characters often come in lower and upper case pairs, such as å and Å. To make inputting these characters easier, you can use `XP(i, j)` in your keymap, where _i_ and _j_ are the mapping table indices of the lower and upper case character, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the second (upper case) character will be inserted; otherwise, the first (lower case) version will appear.
Characters often come in lower and upper case pairs, such as å and Å. To make inputting these characters easier, you can use `UP(i, j)` in your keymap, where _i_ and _j_ are the mapping table indices of the lower and upper case character, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the second (upper case) character will be inserted; otherwise, the first (lower case) version will appear.
This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key by using `XP()`. This helps blend Unicode keys in with regular alphas.
This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key by using `UP()`. This helps blend Unicode keys in with regular alphas.
Due to keycode size constraints, _i_ and _j_ can each only refer to one of the first 128 characters in your `unicode_map`. In other words, 0 ≤ _i_ ≤ 127 and 0 ≤ _j_ ≤ 127. This is enough for most use cases, but if you'd like to customize the index calculation, you can override the [`unicodemap_index()`](https://github.com/qmk/qmk_firmware/blob/71f640d47ee12c862c798e1f56392853c7b1c1a8/quantum/process_keycode/process_unicodemap.c#L36) function. This also allows you to, say, check Ctrl instead of Shift/Caps.

View File

@ -322,6 +322,29 @@ Flashing sequence:
3. Flash a .bin file
4. Reset the device into application mode (may be done automatically)
## WB32 DFU
Some keyboards produced for several commercial brands (GMMK, Akko, MonsGeek, Inland) use this bootloader. The `wb32-dfu-updater` utility is bundled with [QMK MSYS](https://msys.qmk.fm/) and [Glorious's build of QMK Toolbox](https://www.gloriousgaming.com/blogs/guides-resources/gmmk-2-qmk-installation-guide). If neither of these flashing methods is available for your OS, you will likely need to [compile the CLI version from source](https://github.com/WestberryTech/wb32-dfu-updater).
The `info.json` setting for this bootloader is `wb32-dfu`.
Compatible flashers:
* [Glorious's build of QMK Toolbox](https://www.gloriousgaming.com/blogs/guides-resources/gmmk-2-qmk-installation-guide) (recommended GUI)
* [wb32-dfu-updater_cli](https://github.com/WestberryTech/wb32-dfu-updater) / `:flash` target in QMK (recommended command line)
```
wb32-dfu-updater_cli -t -s 0x8000000 -D <filename>
```
Flashing sequence:
1. Enter the bootloader using any of the following methods:
* Tap the `QK_BOOT` keycode
* Press the `RESET` button on the PCB
2. Wait for the OS to detect the device
3. Flash a .bin file
4. Reset the device into application mode (may be done automatically)
## tinyuf2
Keyboards may opt into supporting the tinyuf2 bootloader. This is currently only supported on F303/F401/F411.

View File

@ -109,7 +109,7 @@ This allows you to send Unicode characters using `UC(<code point>)` in your keym
`UNICODEMAP_ENABLE`
This allows you to send Unicode characters using `X(<map index>)` in your keymap. You will need to maintain a mapping table in your keymap file. All possible code points (up to `0x10FFFF`) are supported.
This allows you to send Unicode characters using `UM(<map index>)` in your keymap. You will need to maintain a mapping table in your keymap file. All possible code points (up to `0x10FFFF`) are supported.
`UCIS_ENABLE`

View File

@ -72,7 +72,7 @@ Configuration-wise, you'll need to set up the peripheral as per your MCU's datas
The following configuration values depend on the specific MCU in use.
### I2Cv1 :id=i2cv1
### I2Cv1 :id=arm-configuration-i2cv1
* STM32F1xx
* STM32F2xx
@ -88,7 +88,7 @@ See [this page](https://www.playembedded.org/blog/stm32-i2c-chibios/#7_I2Cv1_con
|`I2C1_CLOCK_SPEED` |`100000` |
|`I2C1_DUTY_CYCLE` |`STD_DUTY_CYCLE`|
### I2Cv2 :id=i2cv2
### I2Cv2 :id=arm-configuration-i2cv2
* STM32F0xx
* STM32F3xx
@ -105,9 +105,9 @@ See [this page](https://www.playembedded.org/blog/stm32-i2c-chibios/#8_I2Cv2_I2C
|`I2C1_TIMINGR_SCLH` |`38U` |
|`I2C1_TIMINGR_SCLL` |`129U` |
## Functions :id=functions
## API :id=api
### `void i2c_init(void)`
### `void i2c_init(void)` :id=api-i2c-init
Initialize the I2C driver. This function must be called only once, before any of the below functions can be called.
@ -126,28 +126,28 @@ void i2c_init(void) {
---
### `i2c_status_t i2c_start(uint8_t address, uint16_t timeout)`
### `i2c_status_t i2c_start(uint8_t address, uint16_t timeout)` :id=api-i2c-start
Start an I2C transaction.
#### Arguments
#### Arguments :id=api-i2c-start-arguments
- `uint8_t address`
The 7-bit I2C address of the device (ie. without the read/write bit - this will be set automatically).
- `uint16_t timeout`
The time in milliseconds to wait for a response from the target device.
#### Return Value
#### Return Value :id=api-i2c-start-return
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
---
### `i2c_status_t i2c_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout)`
### `i2c_status_t i2c_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout)` :id=api-i2c-transmit
Send multiple bytes to the selected I2C device.
#### Arguments
#### Arguments :id=api-i2c-transmit-arguments
- `uint8_t address`
The 7-bit I2C address of the device.
@ -158,17 +158,17 @@ Send multiple bytes to the selected I2C device.
- `uint16_t timeout`
The time in milliseconds to wait for a response from the target device.
#### Return Value
#### Return Value :id=api-i2c-transmit-return
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
---
### `i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)`
### `i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-receive
Receive multiple bytes from the selected I2C device.
#### Arguments
#### Arguments :id=api-i2c-receive-arguments
- `uint8_t address`
The 7-bit I2C address of the device.
@ -179,17 +179,17 @@ Receive multiple bytes from the selected I2C device.
- `uint16_t timeout`
The time in milliseconds to wait for a response from the target device.
#### Return Value
#### Return Value :id=api-i2c-receive-return
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
---
### `i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
### `i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-writereg
Writes to a register with an 8-bit address on the I2C device.
#### Arguments
#### Arguments :id=api-i2c-writereg-arguments
- `uint8_t devaddr`
The 7-bit I2C address of the device.
@ -202,17 +202,17 @@ Writes to a register with an 8-bit address on the I2C device.
- `uint16_t timeout`
The time in milliseconds to wait for a response from the target device.
#### Return Value
#### Return Value :id=api-i2c-writereg-return
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
---
### `i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
### `i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-writereg16
Writes to a register with a 16-bit address (big endian) on the I2C device.
#### Arguments
#### Arguments :id=api-i2c-writereg16-arguments
- `uint8_t devaddr`
The 7-bit I2C address of the device.
@ -225,17 +225,17 @@ Writes to a register with a 16-bit address (big endian) on the I2C device.
- `uint16_t timeout`
The time in milliseconds to wait for a response from the target device.
#### Return Value
#### Return Value :id=api-i2c-writereg16-return
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
---
### `i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
### `i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-readreg
Reads from a register with an 8-bit address on the I2C device.
#### Arguments
#### Arguments :id=api-i2c-readreg-arguments
- `uint8_t devaddr`
The 7-bit I2C address of the device.
@ -246,7 +246,7 @@ Reads from a register with an 8-bit address on the I2C device.
- `uint16_t timeout`
The time in milliseconds to wait for a response from the target device.
#### Return Value
#### Return Value :id=api-i2c-readreg-return
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
@ -256,7 +256,7 @@ Reads from a register with an 8-bit address on the I2C device.
Reads from a register with a 16-bit address (big endian) on the I2C device.
#### Arguments
#### Arguments :id=api-i2c-readreg16-arguments
- `uint8_t devaddr`
The 7-bit I2C address of the device.
@ -267,12 +267,12 @@ Reads from a register with a 16-bit address (big endian) on the I2C device.
- `uint16_t timeout`
The time in milliseconds to wait for a response from the target device.
#### Return Value
#### Return Value :id=api-i2c-readreg16-return
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
---
### `i2c_status_t i2c_stop(void)`
### `i2c_status_t i2c_stop(void)` :id=api-i2c-stop
Stop the current I2C transaction.

View File

@ -109,8 +109,8 @@ QMK が完全な `info.json` を生成するときはいつでも、`config.h`
パズルの最後のピースは、ビルドシステムに新しいオプションを提供することです。
これは、2つのファイルを生成することによって行われます。
* `.build/obj_<keyboard>/src/info_config.h`
* `.build/obj_<keyboard>/src/rules.mk`
* `.build/obj_<keyboard>_<keymap>/src/info_config.h`
* `.build/obj_<keyboard>_<keymap>/src/rules.mk`
この2つのファイルは、次のコードによって生成されます。

View File

@ -849,8 +849,8 @@ See also: [Unicode Support](feature_unicode.md)
|Key |Aliases |Description |
|----------------------------|---------|----------------------------------------------------------------|
|`UC(c)` | |Send Unicode code point `c`, up to `0x7FFF` |
|`X(i)` | |Send Unicode code point at index `i` in `unicode_map` |
|`XP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on|
|`UM(i)` | |Send Unicode code point at index `i` in `unicode_map` |
|`UP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on|
|`QK_UNICODE_MODE_NEXT` |`UC_NEXT`|Cycle through selected input modes |
|`QK_UNICODE_MODE_PREVIOUS` |`UC_PREV`|Cycle through selected input modes in reverse |
|`QK_UNICODE_MODE_MACOS` |`UC_MAC` |Switch to macOS input |

View File

@ -1,8 +1,8 @@
# SPI Master Driver
# SPI Master Driver :id=spi-master-driver
The SPI Master drivers used in QMK have a set of common functions to allow portability between MCUs.
## AVR Configuration
## AVR Configuration :id=avr-configuration
No special setup is required - just connect the `SS`, `SCK`, `MOSI` and `MISO` pins of your SPI devices to the matching pins on the MCU:
@ -16,7 +16,7 @@ No special setup is required - just connect the `SS`, `SCK`, `MOSI` and `MISO` p
You may use more than one slave select pin, not just the `SS` pin. This is useful when you have multiple devices connected and need to communicate with them individually.
`SPI_SS_PIN` can be passed to `spi_start()` to refer to `SS`.
## ChibiOS/ARM Configuration
## ChibiOS/ARM Configuration :id=arm-configuration
You'll need to determine which pins can be used for SPI -- as an example, STM32 parts generally have multiple SPI peripherals, labeled SPI1, SPI2, SPI3 etc.
@ -49,19 +49,19 @@ Configuration-wise, you'll need to set up the peripheral as per your MCU's datas
As per the AVR configuration, you may choose any other standard GPIO as a slave select pin, which should be supplied to `spi_start()`.
## Functions
## API :id=api
### `void spi_init(void)`
### `void spi_init(void)` :id=api-spi-init
Initialize the SPI driver. This function must be called only once, before any of the below functions can be called.
---
### `bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor)`
### `bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor)` :id=api-spi-start
Start an SPI transaction.
#### Arguments
#### Arguments :id=api-spi-start-arguments
- `pin_t slavePin`
The QMK pin to assert as the slave select pin, eg. `B4`.
@ -80,71 +80,71 @@ Start an SPI transaction.
- `uint16_t divisor`
The SPI clock divisor, will be rounded up to the nearest power of two. This number can be calculated by dividing the MCU's clock speed by the desired SPI clock speed. For example, an MCU running at 8 MHz wanting to talk to an SPI device at 4 MHz would set the divisor to `2`.
#### Return Value
#### Return Value :id=api-spi-start-return
`false` if the supplied parameters are invalid or the SPI peripheral is already in use, or `true`.
---
### `spi_status_t spi_write(uint8_t data)`
### `spi_status_t spi_write(uint8_t data)` :id=api-spi-write
Write a byte to the selected SPI device.
#### Arguments
#### Arguments :id=api-spi-write-arguments
- `uint8_t data`
The byte to write.
#### Return Value
#### Return Value :id=api-spi-write-return
`SPI_STATUS_TIMEOUT` if the timeout period elapses, or `SPI_STATUS_SUCCESS`.
---
### `spi_status_t spi_read(void)`
### `spi_status_t spi_read(void)` :id=api-spi-read
Read a byte from the selected SPI device.
#### Return Value
#### Return Value :id=api-spi-read-return
`SPI_STATUS_TIMEOUT` if the timeout period elapses, or the byte read from the device.
---
### `spi_status_t spi_transmit(const uint8_t *data, uint16_t length)`
### `spi_status_t spi_transmit(const uint8_t *data, uint16_t length)` :id=api-spi-transmit
Send multiple bytes to the selected SPI device.
#### Arguments
#### Arguments :id=api-spi-transmit-arguments
- `const uint8_t *data`
A pointer to the data to write from.
- `uint16_t length`
The number of bytes to write. Take care not to overrun the length of `data`.
#### Return Value
#### Return Value :id=api-spi-transmit-return
`SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_ERROR` if some other error occurs, otherwise `SPI_STATUS_SUCCESS`.
---
### `spi_status_t spi_receive(uint8_t *data, uint16_t length)`
### `spi_status_t spi_receive(uint8_t *data, uint16_t length)` :id=api-spi-receive
Receive multiple bytes from the selected SPI device.
#### Arguments
#### Arguments :id=api-spi-receive-arguments
- `uint8_t *data`
A pointer to the buffer to read into.
- `uint16_t length`
The number of bytes to read. Take care not to overrun the length of `data`.
#### Return Value
#### Return Value :id=api-spi-receive-return
`SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_ERROR` if some other error occurs, otherwise `SPI_STATUS_SUCCESS`.
---
### `void spi_stop(void)`
### `void spi_stop(void)` :id=api-spi-stop
End the current SPI transaction. This will deassert the slave select pin and reset the endianness, mode and divisor configured by `spi_start()`.

View File

@ -460,6 +460,31 @@ bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) {
}
```
If the programs you use bind an action to taps of modifier keys (e.g. tapping left GUI to bring up the applications menu or tapping left Alt to focus the menu bar), you may find that using retro-tapping falsely triggers those actions. To counteract this, you can define a `DUMMY_MOD_NEUTRALIZER_KEYCODE` in `config.h` that will get sent in between the register and unregister events of a held mod-tap key. That way, the programs on your computer will no longer interpret the mod suppression induced by retro-tapping as a lone tap of a modifier key and will thus not falsely trigger the undesired action.
Naturally, for this technique to be effective, you must choose a `DUMMY_MOD_NEUTRALIZER_KEYCODE` for which no keyboard shortcuts are bound to. Recommended values are: `KC_RIGHT_CTRL` or `KC_F18`.
Please note that `DUMMY_MOD_NEUTRALIZER_KEYCODE` must be a basic, unmodified, HID keycode so values like `KC_NO`, `KC_TRANSPARENT` or `KC_PIPE` aka `S(KC_BACKSLASH)` are not permitted.
By default, only left Alt and left GUI are neutralized. If you want to change the list of applicable modifier masks, use the following in your `config.h`:
```c
#define MODS_TO_NEUTRALIZE { <mod_mask_1>, <mod_mask_2>, ... }
```
Examples:
```c
#define DUMMY_MOD_NEUTRALIZER_KEYCODE KC_RIGHT_CTRL
// Neutralize left alt and left GUI (Default value)
#define MODS_TO_NEUTRALIZE { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI) }
// Neutralize left alt, left GUI, right GUI and left Control+Shift
#define MODS_TO_NEUTRALIZE { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI), MOD_BIT(KC_RIGHT_GUI), MOD_BIT(KC_LEFT_CTRL)|MOD_BIT(KC_LEFT_SHIFT) }
```
!> Do not use `MOD_xxx` constants like `MOD_LSFT` or `MOD_RALT`, since they're 5-bit packed bit-arrays while `MODS_TO_NEUTRALIZE` expects a list of 8-bit packed bit-arrays. Use `MOD_BIT(<kc>)` or `MOD_MASK_xxx` instead.
### Retro Shift
[Auto Shift,](feature_auto_shift.md) has its own version of `retro tapping` called `retro shift`. It is extremely similar to `retro tapping`, but holding the key past `AUTO_SHIFT_TIMEOUT` results in the value it sends being shifted. Other configurations also affect it differently; see [here](feature_auto_shift.md#retro-shift) for more information.

View File

@ -1,10 +1,10 @@
# UART Driver
# UART Driver :id=uart-driver
The UART drivers used in QMK have a set of common functions to allow portability between MCUs.
Currently, this driver does not support enabling hardware flow control (the `RTS` and `CTS` pins) if available, but may do so in future.
## AVR Configuration
## AVR Configuration :id=avr-configuration
No special setup is required - just connect the `RX` and `TX` pins of your UART device to the opposite pins on the MCU:
@ -16,7 +16,7 @@ No special setup is required - just connect the `RX` and `TX` pins of your UART
|ATmega32A |`D1`|`D0`|*n/a*|*n/a*|
|ATmega328/P |`D1`|`D0`|*n/a*|*n/a*|
## ChibiOS/ARM Configuration
## ChibiOS/ARM Configuration :id=arm-configuration
You'll need to determine which pins can be used for UART -- as an example, STM32 parts generally have multiple UART peripherals, labeled USART1, USART2, USART3 etc.
@ -47,45 +47,45 @@ Configuration-wise, you'll need to set up the peripheral as per your MCU's datas
|`#define SD1_RTS_PIN` |The pin to use for RTS |`A12` |
|`#define SD1_RTS_PAL_MODE`|The alternate function mode for RTS |`7` |
## Functions
## API :id=api
### `void uart_init(uint32_t baud)`
### `void uart_init(uint32_t baud)` :id=api-uart-init
Initialize the UART driver. This function must be called only once, before any of the below functions can be called.
#### Arguments
#### Arguments :id=api-uart-init-arguments
- `uint32_t baud`
The baud rate to transmit and receive at. This may depend on the device you are communicating with. Common values are 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200.
---
### `void uart_write(uint8_t data)`
### `void uart_write(uint8_t data)` :id=api-uart-write
Transmit a single byte.
#### Arguments
#### Arguments :id=api-uart-write-arguments
- `uint8_t data`
The byte to write.
---
### `uint8_t uart_read(void)`
### `uint8_t uart_read(void)` :id=api-uart-read
Receive a single byte.
#### Return Value
#### Return Value :id=api-uart-read-return
The byte read from the receive buffer. This function will block if the buffer is empty (ie. no data to read).
---
### `void uart_transmit(const uint8_t *data, uint16_t length)`
### `void uart_transmit(const uint8_t *data, uint16_t length)` :id=api-uart-transmit
Transmit multiple bytes.
#### Arguments
#### Arguments :id=api-uart-transmit-arguments
- `const uint8_t *data`
A pointer to the data to write from.
@ -94,11 +94,11 @@ Transmit multiple bytes.
---
### `void uart_receive(char *data, uint16_t length)`
### `void uart_receive(char *data, uint16_t length)` :id=api-uart-receive
Receive multiple bytes.
#### Arguments
#### Arguments :id=api-uart-receive-arguments
- `uint8_t *data`
A pointer to the buffer to read into.
@ -107,10 +107,10 @@ Receive multiple bytes.
---
### `bool uart_available(void)`
### `bool uart_available(void)` :id=api-uart-available
Return whether the receive buffer contains data. Call this function to determine if `uart_read()` will return data immediately.
#### Return Value
#### Return Value :id=api-uart-available-return
`true` if the receive buffer length is non-zero.

View File

@ -1,6 +1,6 @@
#include "quantum.h"
#include "backlight.h"
#include "backlight_driver_common.h"
#include "util.h"
#ifdef BACKLIGHT_BREATHING
# error "Backlight breathing is not available for software PWM. Please disable."

View File

@ -16,7 +16,7 @@
*/
#include "apa102.h"
#include "quantum.h"
#include "gpio.h"
#ifndef APA102_NOPS
# if defined(__AVR__)

View File

@ -145,6 +145,9 @@ void AW20216_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
aw_led led;
memcpy_P(&led, (&g_aw_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
}
g_pwm_buffer[led.driver][led.r] = red;
g_pwm_buffer[led.driver][led.g] = green;
g_pwm_buffer[led.driver][led.b] = blue;

View File

@ -151,6 +151,9 @@ void CKLED2001_set_value(int index, uint8_t value) {
if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_ckled2001_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.v] == value) {
return;
}
g_pwm_buffer[led.driver][led.v] = value;
g_pwm_buffer_update_required[led.driver] = true;
}

View File

@ -150,6 +150,9 @@ void CKLED2001_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_ckled2001_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
}
g_pwm_buffer[led.driver][led.r] = red;
g_pwm_buffer[led.driver][led.g] = green;
g_pwm_buffer[led.driver][led.b] = blue;

View File

@ -72,6 +72,9 @@ void IS31FL3218_init(void) {
}
void IS31FL3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
if (g_pwm_buffer[index * 3 + 0] == red && g_pwm_buffer[index * 3 + 1] == green && g_pwm_buffer[index * 3 + 2] == blue) {
return;
}
g_pwm_buffer[index * 3 + 0] = red;
g_pwm_buffer[index * 3 + 1] = green;
g_pwm_buffer[index * 3 + 2] = blue;

View File

@ -196,6 +196,10 @@ void IS31FL3731_set_value(int index, uint8_t value) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
// Subtract 0x24 to get the second index of g_pwm_buffer
if (g_pwm_buffer[led.driver][led.v - 0x24] == value) {
return;
}
g_pwm_buffer[led.driver][led.v - 0x24] = value;
g_pwm_buffer_update_required[led.driver] = true;
}

View File

@ -184,6 +184,9 @@ void IS31FL3731_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
// Subtract 0x24 to get the second index of g_pwm_buffer
if (g_pwm_buffer[led.driver][led.r - 0x24] == red && g_pwm_buffer[led.driver][led.g - 0x24] == green && g_pwm_buffer[led.driver][led.b - 0x24] == blue) {
return;
}
g_pwm_buffer[led.driver][led.r - 0x24] = red;
g_pwm_buffer[led.driver][led.g - 0x24] = green;
g_pwm_buffer[led.driver][led.b - 0x24] = blue;

View File

@ -193,9 +193,13 @@ void IS31FL3733_init(uint8_t addr, uint8_t sync) {
}
void IS31FL3733_set_value(int index, uint8_t value) {
is31_led led;
if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
is31_led led = g_is31_leds[index];
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.v] == value) {
return;
}
g_pwm_buffer[led.driver][led.v] = value;
g_pwm_buffer_update_required[led.driver] = true;
}
@ -208,7 +212,8 @@ void IS31FL3733_set_value_all(uint8_t value) {
}
void IS31FL3733_set_led_control_register(uint8_t index, bool value) {
is31_led led = g_is31_leds[index];
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
uint8_t control_register = led.v / 8;
uint8_t bit_value = led.v % 8;

View File

@ -30,7 +30,7 @@ typedef struct is31_led {
uint8_t v;
} __attribute__((packed)) is31_led;
extern const is31_led __flash g_is31_leds[LED_MATRIX_LED_COUNT];
extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT];
void IS31FL3733_init(uint8_t addr, uint8_t sync);
bool IS31FL3733_write_register(uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -189,6 +189,9 @@ void IS31FL3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
}
g_pwm_buffer[led.driver][led.r] = red;
g_pwm_buffer[led.driver][led.g] = green;
g_pwm_buffer[led.driver][led.b] = blue;

View File

@ -169,6 +169,9 @@ void IS31FL3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
}
g_pwm_buffer[led.driver][led.r] = red;
g_pwm_buffer[led.driver][led.g] = green;
g_pwm_buffer[led.driver][led.b] = blue;

View File

@ -176,6 +176,9 @@ void IS31FL3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
}
g_pwm_buffer[led.driver][led.r] = red;
g_pwm_buffer[led.driver][led.g] = green;
g_pwm_buffer[led.driver][led.b] = blue;

View File

@ -180,10 +180,13 @@ void IS31FL3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
}
g_pwm_buffer_update_required[led.driver] = true;
g_pwm_buffer[led.driver][led.r] = red;
g_pwm_buffer[led.driver][led.g] = green;
g_pwm_buffer[led.driver][led.b] = blue;
g_pwm_buffer_update_required[led.driver] = true;
}
}

View File

@ -133,19 +133,28 @@ void IS31FL_common_update_pwm_register(uint8_t addr, uint8_t index) {
#ifdef ISSI_MANUAL_SCALING
void IS31FL_set_manual_scaling_buffer(void) {
is31_led led;
is31_led scale;
for (int i = 0; i < ISSI_MANUAL_SCALING; i++) {
is31_led scale = g_is31_scaling[i];
memcpy_P(&scale, (&g_is31_scaling[i]), sizeof(scale));
# ifdef RGB_MATRIX_ENABLE
if (scale.driver >= 0 && scale.driver < RGB_MATRIX_LED_COUNT) {
is31_led led = g_is31_leds[scale.driver];
memcpy_P(&led, (&g_is31_leds[scale.driver]), sizeof(led));
if (g_scaling_buffer[led.driver][led.r] = scale.r && g_scaling_buffer[led.driver][led.g] = scale.g && g_scaling_buffer[led.driver][led.b] = scale.b) {
return;
}
g_scaling_buffer[led.driver][led.r] = scale.r;
g_scaling_buffer[led.driver][led.g] = scale.g;
g_scaling_buffer[led.driver][led.b] = scale.b;
# elif defined(LED_MATRIX_ENABLE)
if (scale.driver >= 0 && scale.driver < LED_MATRIX_LED_COUNT) {
is31_led led = g_is31_leds[scale.driver];
memcpy_P(&led, (&g_is31_leds[scale.driver]), sizeof(led));
if (g_scaling_buffer[led.driver][led.v] == scale.v) {
return;
}
g_scaling_buffer[led.driver][led.v] = scale.v;
# endif
g_scaling_buffer_update_required[led.driver] = true;
@ -169,7 +178,8 @@ void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index) {
// Colour is set by adjusting PWM register
void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
is31_led led = g_is31_leds[index];
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
g_pwm_buffer[led.driver][led.r] = red;
g_pwm_buffer[led.driver][led.g] = green;
@ -186,7 +196,8 @@ void IS31FL_RGB_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
// Setup Scaling register that decides the peak current of each LED
void IS31FL_RGB_set_scaling_buffer(uint8_t index, bool red, bool green, bool blue) {
is31_led led = g_is31_leds[index];
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
if (red) {
g_scaling_buffer[led.driver][led.r] = ISSI_SCAL_RED;
} else {
@ -208,7 +219,8 @@ void IS31FL_RGB_set_scaling_buffer(uint8_t index, bool red, bool green, bool blu
#elif defined(LED_MATRIX_ENABLE)
// LED Matrix Specific scripts
void IS31FL_simple_set_scaling_buffer(uint8_t index, bool value) {
is31_led led = g_is31_leds[index];
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
if (value) {
g_scaling_buffer[led.driver][led.v] = ISSI_SCAL_LED;
} else {
@ -219,7 +231,9 @@ void IS31FL_simple_set_scaling_buffer(uint8_t index, bool value) {
void IS31FL_simple_set_brightness(int index, uint8_t value) {
if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
is31_led led = g_is31_leds[index];
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
g_pwm_buffer[led.driver][led.v] = value;
g_pwm_buffer_update_required[led.driver] = true;
}

View File

@ -43,7 +43,7 @@ typedef struct is31_led {
uint8_t b;
} __attribute__((packed)) is31_led;
extern const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT];
extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT];
#elif defined(LED_MATRIX_ENABLE)
typedef struct is31_led {
@ -51,11 +51,11 @@ typedef struct is31_led {
uint8_t v;
} __attribute__((packed)) is31_led;
extern const is31_led __flash g_is31_leds[LED_MATRIX_LED_COUNT];
extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT];
#endif
#ifdef ISSI_MANUAL_SCALING
extern const is31_led __flash g_is31_scaling[];
extern const is31_led PROGMEM g_is31_scaling[];
void IS31FL_set_manual_scaling_buffer(void);
#endif

View File

@ -19,8 +19,8 @@
#define ILI9XXX_CMD_SLEEP_OFF 0x11 // Exist sleep mode
#define ILI9XXX_CMD_PARTIAL_ON 0x12 // Enter partial mode
#define ILI9XXX_CMD_PARTIAL_OFF 0x13 // Exit partial mode
#define ILI9XXX_CMD_INVERT_ON 0x20 // Enter inverted mode
#define ILI9XXX_CMD_INVERT_OFF 0x21 // Exit inverted mode
#define ILI9XXX_CMD_INVERT_OFF 0x20 // Exit inverted mode
#define ILI9XXX_CMD_INVERT_ON 0x21 // Enter inverted mode
#define ILI9XXX_SET_GAMMA 0x26 // Set gamma params
#define ILI9XXX_CMD_DISPLAY_OFF 0x28 // Disable display
#define ILI9XXX_CMD_DISPLAY_ON 0x29 // Enable display

View File

@ -191,13 +191,12 @@ static inline void ps2_mouse_convert_report_to_hid(report_mouse_t *mouse_report)
#ifdef PS2_MOUSE_INVERT_BUTTONS
// swap left & right buttons
uint8_t needs_left = mouse_report->buttons & PS2_MOUSE_BTN_RIGHT;
uint8_t needs_right = mouse_report->buttons & PS2_MOUSE_BTN_LEFT;
mouse_report->buttons = (mouse_report->buttons & ~(PS2_MOUSE_BTN_MASK)) | (needs_left ? PS2_MOUSE_BTN_LEFT : 0) | (needs_right ? PS2_MOUSE_BTN_RIGHT : 0);
#else
bool needs_left = mouse_report->buttons & (1 << PS2_MOUSE_BTN_RIGHT);
bool needs_right = mouse_report->buttons & (1 << PS2_MOUSE_BTN_LEFT);
mouse_report->buttons = (mouse_report->buttons & ~((1 << PS2_MOUSE_BTN_LEFT) | (1 << PS2_MOUSE_BTN_RIGHT))) | (needs_left << PS2_MOUSE_BTN_LEFT) | (needs_right << PS2_MOUSE_BTN_RIGHT);
#endif
// remove sign and overflow flags
mouse_report->buttons &= PS2_MOUSE_BTN_MASK;
#endif
#ifdef PS2_MOUSE_INVERT_X
mouse_report->x = -mouse_report->x;

View File

@ -10,7 +10,7 @@
#pragma once
#include "quantum.h" //to get is_keyboard_left
#include "keyboard.h"
#include <stdint.h>
#include "spi_master.h"
#include "util.h"

View File

@ -18,7 +18,6 @@
/* underglow */
#define RGBLED_NUM 24
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL

View File

@ -10,6 +10,7 @@
"pin": "B6"
},
"rgblight": {
"led_count": 24,
"max_brightness": 185
}
}

View File

@ -18,13 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// clang-format off
#define TAP_CODE_DELAY 10
#define RGBLED_NUM 4
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL

View File

@ -18,9 +18,18 @@
{"pin_a": "F6", "pin_b": "F5"}
]
},
"qmk": {
"tap_keycode_delay": 10
},
"qmk_lufa_bootloader": {
"led": "B0"
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 4,
"sleep": true
},
"ws2812": {
"pin": "D3"
},

View File

@ -16,8 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define TAP_CODE_DELAY 10
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */

View File

@ -18,6 +18,9 @@
{"pin_a": "D0", "pin_b": "D1"}
]
},
"qmk": {
"tap_keycode_delay": 10
},
"processor": "atmega328p",
"bootloader": "usbasploader",
"layout_aliases": {

View File

@ -16,13 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define RGBLED_NUM 4 // Number of LEDs connected
#define RGBLIGHT_HUE_STEP 10 // The number of steps to cycle through the hue by
#define RGBLIGHT_SAT_STEP 17 // The number of steps to increment the saturation by
#define RGBLIGHT_VAL_STEP 17 // The number of steps to increment the brightness by
#define RGBLIGHT_SLEEP // RGB will switch off when host goes to sleep
#define RGBLIGHT_EFFECT_BREATHING // Enable all additional RGB animation modes
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL

View File

@ -11,6 +11,11 @@
"bootmagic": {
"matrix": [1, 0]
},
"rgblight": {
"hue_steps": 10,
"led_count": 4,
"sleep": true
},
"ws2812": {
"pin": "D3"
},

View File

@ -18,8 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.*/
#define SSD1306OLED
#define RGBLED_NUM 4
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL

View File

@ -8,6 +8,9 @@
"pid": "0x7C99",
"device_version": "0.0.1"
},
"rgblight": {
"led_count": 4
},
"ws2812": {
"pin": "B7"
},

View File

@ -15,8 +15,6 @@
*/
#pragma once
#define RGBLED_NUM 1
// Save as much space as we can...
#define LAYER_STATE_8BIT
#define NO_ACTION_LAYER

View File

@ -8,6 +8,9 @@
"pid": "0x0001",
"device_version": "0.0.1"
},
"rgblight": {
"led_count": 1
},
"ws2812": {
"pin": "B2"
},

View File

@ -27,11 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
#define RGBLED_NUM 14
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_SLEEP
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE

View File

@ -18,6 +18,12 @@
"levels": 5,
"breathing": true
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 14,
"sleep": true
},
"ws2812": {
"pin": "F0"
},

View File

@ -34,7 +34,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
#define RGBLED_NUM 14
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8

View File

@ -20,6 +20,11 @@
"caps_lock": "B6",
"on_state": 0
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 14
},
"ws2812": {
"pin": "F0"
},

View File

@ -16,7 +16,3 @@
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
#define RGBLED_NUM 16
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8

View File

@ -17,6 +17,11 @@
"pin": "B6",
"levels": 5
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 16
},
"ws2812": {
"pin": "E2"
},

View File

@ -18,12 +18,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
} else {
setPinInput(B2);
writePinLow(B2);
}
return false;
}

View File

@ -18,12 +18,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
} else {
setPinInput(B2);
writePinLow(B2);
}
return false;
}

View File

@ -71,42 +71,12 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _raise, _rgb, _adjust);
}
// scan matrix
void matrix_scan_user(void) {
}
// support for standard mod state keys (caps lock, scroll lock, etc.)
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
} else {
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
return false;
}

View File

@ -18,12 +18,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
} else {
setPinInput(B2);
writePinLow(B2);
}
return false;
}

View File

@ -6,7 +6,6 @@
#define DYNAMIC_KEYMAP_LAYER_COUNT 10
#define RGB_MATRIX_LED_COUNT 16
#define RGBLED_NUM 16
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_MATRIX_KEYPRESSES
#define RGB_DISABLE_WHEN_USB_SUSPENDED

View File

@ -17,13 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
# define RGBLED_NUM 16 // Add 12 if attaching the RGB LED ring
# define RGB_MATRIX_LED_COUNT RGBLED_NUM
# define RGB_MATRIX_LED_COUNT 16
# ifdef RGBLIGHT_ENABLE
# define RGBLIGHT_HUE_STEP 8
# define RGBLIGHT_SAT_STEP 8
# define RGBLIGHT_VAL_STEP 8
# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL

View File

@ -11,6 +11,12 @@
"ws2812": {
"pin": "D3"
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 16,
"sleep": true
},
"rgb_matrix": {
"driver": "WS2812"
},

View File

@ -17,7 +17,3 @@
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
#define RGBLED_NUM 1
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8

View File

@ -3,6 +3,11 @@
"pid": "0x0161",
"device_version": "0.0.1"
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 1
},
"ws2812": {
"pin": "B1"
},

View File

@ -19,7 +19,6 @@
#define DYNAMIC_KEYMAP_LAYER_COUNT 10
#define RGB_MATRIX_LED_COUNT 20
#define RGBLED_NUM 20
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_DISABLE_WHEN_USB_SUSPENDED

View File

@ -17,11 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define RGBLED_NUM 6
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL

View File

@ -13,6 +13,12 @@
{"pin_a": "B5", "pin_b": "B4"}
]
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 6,
"sleep": true
},
"ws2812": {
"pin": "C7"
},

View File

@ -17,11 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define RGBLED_NUM 8
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL

View File

@ -13,6 +13,12 @@
{"pin_a": "F5", "pin_b": "F6"}
]
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 8,
"sleep": true
},
"ws2812": {
"pin": "B3"
},

View File

@ -17,11 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
# define RGBLED_NUM 5
# define RGBLIGHT_HUE_STEP 8
# define RGBLIGHT_SAT_STEP 8
# define RGBLIGHT_VAL_STEP 8
# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL

View File

@ -14,6 +14,12 @@
{"pin_a": "B3", "pin_b": "B1"}
]
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 5,
"sleep": true
},
"ws2812": {
"pin": "D3"
},

View File

@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 100
/* Select hand configuration */
#define MASTER_LEFT

View File

@ -8,6 +8,12 @@
"split": {
"soft_serial_pin": "D2"
},
"tapping": {
"term": 100
},
"rgblight": {
"hue_steps": 10
},
"ws2812": {
"pin": "D3"
},

View File

@ -34,7 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef RGBLED_CONT
#define RGBLED_NUM 60
#define RGBLED_SPLIT { 30, 30 }
// #define RGBLIGHT_LED_MAP {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}
#else
#define RGBLED_NUM 30
#endif
@ -72,8 +71,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
#define RGBLIGHT_VAL_STEP 4
#endif
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
// USB_MAX_POWER_CONSUMPTION value

View File

@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 100
/* Select hand configuration */
#define MASTER_LEFT

View File

@ -8,6 +8,12 @@
"split": {
"soft_serial_pin": "D2"
},
"tapping": {
"term": 100
},
"rgblight": {
"hue_steps": 10
},
"ws2812": {
"pin": "D3"
},

View File

@ -34,7 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef RGBLED_CONT
#define RGBLED_NUM 60
#define RGBLED_SPLIT { 30, 30 }
// #define RGBLIGHT_LED_MAP {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}
#else
#define RGBLED_NUM 30
#endif
@ -72,8 +71,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
#define RGBLIGHT_VAL_STEP 4
#endif
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
// USB_MAX_POWER_CONSUMPTION value

View File

@ -18,5 +18,4 @@
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_ALTERNATING
# define RGBLIGHT_EFFECT_TWINKLE
#define RGBLED_NUM 3
#endif

View File

@ -18,6 +18,9 @@
{"pin_a": "D0", "pin_b": "D1", "resolution": 1}
]
},
"rgblight": {
"led_count": 3
},
"ws2812": {
"pin": "C6"
},

View File

@ -59,16 +59,17 @@ void keyboard_pre_init_user(void) {
setPinOutput(B0);
}
void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.num_lock) {
writePinLow(D5);
} else {
writePinHigh(D5);
}
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
if (led_state.caps_lock) {
writePinLow(B0);
} else {
writePinHigh(B0);
}
return false;
}

View File

@ -199,9 +199,6 @@ void music_scale_user(void)
#endif
void matrix_scan_user(void) {
}
//Tap Dance Definitions
tap_dance_action_t tap_dance_actions[] = {
//Tap once for Esc, twice for Caps Lock
@ -211,40 +208,3 @@ tap_dance_action_t tap_dance_actions[] = {
[TD_A_TAB] = ACTION_TAP_DANCE_DOUBLE(KC_A, KC_TAB),
[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC)
};
// don't know what this is doing...
/*
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
DDRD |= (1 << 5); PORTD &= ~(1 << 5);
} else {
DDRD &= ~(1 << 5); PORTD &= ~(1 << 5);
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 0); PORTB &= ~(1 << 0);
} else {
DDRB &= ~(1 << 0); PORTB &= ~(1 << 0);
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}
*/

View File

@ -17,7 +17,3 @@
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_ALTERNATING
# define RGBLIGHT_EFFECT_TWINKLE
#define RGBLED_NUM 8 // Number of LEDs
// #define RGBLIGHT_HUE_STEP 10
// #define RGBLIGHT_SAT_STEP 17
// #define RGBLIGHT_VAL_STEP 17

View File

@ -17,6 +17,9 @@
"pin": "B5",
"levels": 4
},
"rgblight": {
"led_count": 8
},
"ws2812": {
"pin": "B4"
},

View File

@ -157,11 +157,11 @@ void dynamic_macro_record_end_user(int8_t direction) {
// Custom Caps Lock backlight behaviour
// ------------------------------------
void led_set_user(uint8_t usb_led) {
bool led_update_user(led_t led_state) {
// This exists because I don't like the backlight to turn OFF when the Caps Lock is ON.
// That is, this will turn the backlight ON (at half the brightness) when the Caps Lock is ON as well.
static bool prev_is_caps_on;
bool is_caps_on = IS_LED_ON(usb_led, USB_LED_CAPS_LOCK);
bool is_caps_on = led_state.caps_lock;
if (prev_is_caps_on != is_caps_on) {
prev_is_caps_on = is_caps_on;
@ -178,7 +178,7 @@ void led_set_user(uint8_t usb_led) {
}
// Turn on the Pro Micro's on-board LEDs for Caps Lock
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
if (led_state.caps_lock) {
// Set to low
setPinOutput(B0);
writePinLow(B0);
@ -189,6 +189,7 @@ void led_set_user(uint8_t usb_led) {
setPinInput(B0);
setPinInput(D5);
}
return false;
}
// Backlight idle timeout feature

View File

@ -35,11 +35,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
void led_set_user(uint8_t usb_led){
bool led_update_user(led_t led_state){
//turn on the Pro Micro's on board LEDs for CAPS LOCK
if(IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)){
if(led_state.caps_lock){
//set led pins to low
setPinOutput(B0);
writePinLow(B0);
@ -50,4 +48,5 @@ void led_set_user(uint8_t usb_led){
setPinInput(B0);
setPinInput(D5);
}
return false;
}

View File

@ -28,4 +28,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_ALTERNATING
# define RGBLIGHT_EFFECT_TWINKLE
#define RGBLED_NUM 6 // Number of LEDs

View File

@ -8,6 +8,9 @@
"pid": "0x0007",
"device_version": "0.0.1"
},
"rgblight": {
"led_count": 6
},
"ws2812": {
"pin": "D3"
},

View File

@ -27,10 +27,6 @@
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
#define RGBLED_NUM 10
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE

View File

@ -16,6 +16,11 @@
"backlight": {
"pin": "B5"
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 10
},
"ws2812": {
"pin": "B4"
},

View File

@ -17,7 +17,3 @@
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
#define RGBLED_NUM 30
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8

Some files were not shown because too many files have changed in this diff Show More