diff options
| author | U-LANDSRAAD\drashna <drashna@live.com> | 2018-03-05 07:59:27 -0800 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-03-07 17:05:38 -0500 |
| commit | d27d8549132fb78601a6980bc6016011a4437b15 (patch) | |
| tree | 6e4fca6c61d92aa9a5bffba55edc2fe11d4fceb4 /docs | |
| parent | bec8d58ad8d8efc2095682f2aba7abc106c2464a (diff) | |
| download | qmk_firmware-d27d8549132fb78601a6980bc6016011a4437b15.tar.gz qmk_firmware-d27d8549132fb78601a6980bc6016011a4437b15.zip | |
Examples should all use _user functions for consistency
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/custom_quantum_functions.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index e7a45e0bf..ab3a72e5d 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md | |||
| @@ -98,10 +98,10 @@ This allows you to control the 5 LED's defined as part of the USB Keyboard spec. | |||
| 98 | * `USB_LED_COMPOSE` | 98 | * `USB_LED_COMPOSE` |
| 99 | * `USB_LED_KANA` | 99 | * `USB_LED_KANA` |
| 100 | 100 | ||
| 101 | ### Example `led_set_kb()` Implementation | 101 | ### Example `led_set_user()` Implementation |
| 102 | 102 | ||
| 103 | ``` | 103 | ``` |
| 104 | void led_set_kb(uint8_t usb_led) { | 104 | void led_set_user(uint8_t usb_led) { |
| 105 | if (usb_led & (1<<USB_LED_NUM_LOCK)) { | 105 | if (usb_led & (1<<USB_LED_NUM_LOCK)) { |
| 106 | PORTB |= (1<<0); | 106 | PORTB |= (1<<0); |
| 107 | } else { | 107 | } else { |
| @@ -144,9 +144,8 @@ Before a keyboard can be used the hardware must be initialized. QMK handles init | |||
| 144 | This example, at the keyboard level, sets up B1, B2, and B3 as LED pins. | 144 | This example, at the keyboard level, sets up B1, B2, and B3 as LED pins. |
| 145 | 145 | ||
| 146 | ``` | 146 | ``` |
| 147 | void matrix_init_kb(void) { | 147 | void matrix_init_user(void) { |
| 148 | // Call the keymap level matrix init. | 148 | // Call the keymap level matrix init. |
| 149 | matrix_init_user(); | ||
| 150 | 149 | ||
| 151 | // Set our LED pins as output | 150 | // Set our LED pins as output |
| 152 | DDRB |= (1<<1); | 151 | DDRB |= (1<<1); |
| @@ -176,3 +175,5 @@ This example has been deliberately omitted. You should understand enough about Q | |||
| 176 | This function gets called at every matrix scan, which is basically as often as the MCU can handle. Be careful what you put here, as it will get run a lot. | 175 | This function gets called at every matrix scan, which is basically as often as the MCU can handle. Be careful what you put here, as it will get run a lot. |
| 177 | 176 | ||
| 178 | You should use this function if you need custom matrix scanning code. It can also be used for custom status output (such as LED's or a display) or other functionality that you want to trigger regularly even when the user isn't typing. | 177 | You should use this function if you need custom matrix scanning code. It can also be used for custom status output (such as LED's or a display) or other functionality that you want to trigger regularly even when the user isn't typing. |
| 178 | |||
| 179 | |||
