Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
4pplet committed Feb 25, 2021
2 parents 4822ba3 + 39694d5 commit 95d87c6
Show file tree
Hide file tree
Showing 1,059 changed files with 45,184 additions and 5,653 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ jobs:
bin/qmk pyformat
bin/qmk fileformat
- name: Commit files
uses: stefanzweifel/git-auto-commit-action@v4
- name: Become QMK Bot
run: |
git config user.name 'QMK Bot'
git config user.email 'hello@qmk.fm'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit_message: Format code according to conventions for $GITHUB_SHA
commit_user_name: QMK Bot
commit_user_email: hello@qmk.fm
commit_author: QMK Bot <hello@qmk.fm>
delete-branch: true
author: QMK Bot <hello@qmk.fm>
committer: QMK Bot <hello@qmk.fm>
commit-message: Format code according to conventions
title: '[CI] Format code according to conventions'
7 changes: 6 additions & 1 deletion common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SERIAL_PATH := $(QUANTUM_PATH)/serial_link

QUANTUM_SRC += \
$(QUANTUM_DIR)/quantum.c \
$(QUANTUM_DIR)/bitwise.c \
$(QUANTUM_DIR)/led.c \
$(QUANTUM_DIR)/keymap_common.c \
$(QUANTUM_DIR)/keycode_config.c
Expand All @@ -36,6 +37,11 @@ ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/api.c
endif

ifeq ($(strip $(COMMAND_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/command.c
OPT_DEFS += -DCOMMAND_ENABLE
endif

ifeq ($(strip $(AUDIO_ENABLE)), yes)
OPT_DEFS += -DAUDIO_ENABLE
MUSIC_ENABLE = yes
Expand Down Expand Up @@ -170,7 +176,6 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
endif
endif


LED_MATRIX_ENABLE ?= no
VALID_LED_MATRIX_TYPES := IS31FL3731 custom
# TODO: IS31FL3733 IS31FL3737 IS31FL3741
Expand Down
2 changes: 1 addition & 1 deletion docs/feature_haptic_feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Not all keycodes below will work depending on which haptic mechanism you have ch

First you will need a build a circuit to drive the solenoid through a mosfet as most MCU will not be able to provide the current needed to drive the coil in the solenoid.

[Wiring diagram provided by Adafruit](https://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf)
[Wiring diagram provided by Adafruit](https://cdn-shop.adafruit.com/product-files/412/solenoid_driver.pdf)


| Settings | Default | Description |
Expand Down
87 changes: 48 additions & 39 deletions docs/feature_led_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,58 @@ If you want to use RGB LED's you should use the [RGB Matrix Subsystem](feature_r

There is basic support for addressable LED matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:

LED_MATRIX_ENABLE = yes
LED_MATRIX_DRIVER = IS31FL3731

```make
LED_MATRIX_ENABLE = yes
LED_MATRIX_DRIVER = IS31FL3731
```

You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:

| Variable | Description | Default |
|----------|-------------|---------|
| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages | 100 |
| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
| `LED_DRIVER_COUNT` | (Required) How many LED driver IC's are present | |
| `LED_DRIVER_LED_COUNT` | (Required) How many LED lights are present across all drivers | |
| `DRIVER_LED_TOTAL` | (Required) How many LED lights are present across all drivers | |
| `LED_DRIVER_ADDR_1` | (Required) Address for the first LED driver | |
| `LED_DRIVER_ADDR_2` | (Optional) Address for the second LED driver | |
| `LED_DRIVER_ADDR_3` | (Optional) Address for the third LED driver | |
| `LED_DRIVER_ADDR_4` | (Optional) Address for the fourth LED driver | |

Here is an example using 2 drivers.

// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
// The address will vary depending on your wiring:
// 0b1110100 AD <-> GND
// 0b1110111 AD <-> VCC
// 0b1110101 AD <-> SCL
// 0b1110110 AD <-> SDA
#define LED_DRIVER_ADDR_1 0b1110100
#define LED_DRIVER_ADDR_2 0b1110110

#define LED_DRIVER_COUNT 2
#define LED_DRIVER_1_LED_COUNT 25
#define LED_DRIVER_2_LED_COUNT 24
#define LED_DRIVER_LED_COUNT LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL
```c
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
// The address will vary depending on your wiring:
// 0b1110100 AD <-> GND
// 0b1110111 AD <-> VCC
// 0b1110101 AD <-> SCL
// 0b1110110 AD <-> SDA
#define LED_DRIVER_ADDR_1 0b1110100
#define LED_DRIVER_ADDR_2 0b1110110

#define LED_DRIVER_COUNT 2
#define LED_DRIVER_1_LED_COUNT 25
#define LED_DRIVER_2_LED_COUNT 24
#define DRIVER_LED_TOTAL LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL
```
Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
/* Refer to IS31 manual for these locations
* driver
* | LED address
* | | */
{0, C3_3},
....
}
```c
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
/* Refer to IS31 manual for these locations
* driver
* | LED address
* | | */
{ 0, C1_1 },
{ 0, C1_15 },
// ...
}
```

Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731-simple.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` ).

Expand All @@ -66,26 +73,28 @@ All LED matrix keycodes are currently shared with the [backlight system](feature

Currently no LED matrix effects have been created.

## Custom layer effects
## Custom Layer Effects

Custom layer effects can be done by defining this in your `<keyboard>.c`:

void led_matrix_indicators_kb(void) {
led_matrix_set_index_value(index, value);
}
```c
void led_matrix_indicators_kb(void) {
led_matrix_set_index_value(index, value);
}
```
A similar function works in the keymap as `led_matrix_indicators_user`.
## Suspended state
## Suspended State
To use the suspend feature, add this to your `<keyboard>.c`:
void suspend_power_down_kb(void)
{
led_matrix_set_suspend_state(true);
}
```c
void suspend_power_down_kb(void) {
led_matrix_set_suspend_state(true);
}
void suspend_wakeup_init_kb(void)
{
led_matrix_set_suspend_state(false);
}
void suspend_wakeup_init_kb(void) {
led_matrix_set_suspend_state(false);
}
```
4 changes: 4 additions & 0 deletions docs/feature_pointing_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Once you have made the necessary changes to the mouse report, you need to send i

When the mouse report is sent, the x, y, v, and h values are set to 0 (this is done in `pointing_device_send()`, which can be overridden to avoid this behavior). This way, button states persist, but movement will only occur once. For further customization, both `pointing_device_init` and `pointing_device_task` can be overridden.

Additionally, by default, `pointing_device_send()` will only send a report when the report has actually changed. This prevents it from continuously sending mouse reports, which will keep the host system awake. This behavior can be changed by creating your own `pointing_device_send()` function.

Also, you use the `has_mouse_report_changed(new, old)` function to check to see if the report has changed.

In the following example, a custom key is used to click the mouse and scroll 127 units vertically and horizontally, then undo all of that when released - because that's a totally useful function. Listen, this is an example:

```c
Expand Down
Loading

0 comments on commit 95d87c6

Please sign in to comment.