aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzvecr <git@zvecr.com>2019-02-19 00:48:52 +0000
committerDrashna Jaelre <drashna@live.com>2019-02-18 16:48:52 -0800
commit9a64c6b82ef7fc46e35f7d8c35eeccf3961ba0bf (patch)
treeeb2b6f74648a3a9a2435f5f6c642599c0d843910
parent030faf951cb99840394c56803958f249383e9362 (diff)
downloadqmk_firmware-9a64c6b82ef7fc46e35f7d8c35eeccf3961ba0bf.tar.gz
qmk_firmware-9a64c6b82ef7fc46e35f7d8c35eeccf3961ba0bf.zip
[Keyboard] XD84 fixes for caps lock led, backlight and firmware size (#5178)
* Enable backlight * Enable Link Time Optimization * Enable caps lock led
-rw-r--r--keyboards/xd84/config.h8
-rw-r--r--keyboards/xd84/dev.md6
-rw-r--r--keyboards/xd84/keymaps/default/keymap.c2
-rw-r--r--keyboards/xd84/keymaps/default_iso/keymap.c2
-rw-r--r--keyboards/xd84/rules.mk4
-rw-r--r--keyboards/xd84/xd84.c29
6 files changed, 24 insertions, 27 deletions
diff --git a/keyboards/xd84/config.h b/keyboards/xd84/config.h
index b2f850c18..abb9f17a5 100644
--- a/keyboards/xd84/config.h
+++ b/keyboards/xd84/config.h
@@ -47,10 +47,8 @@
47/* COL2ROW, ROW2COL */ 47/* COL2ROW, ROW2COL */
48//#define DIODE_DIRECTION COL2ROW 48//#define DIODE_DIRECTION COL2ROW
49 49
50// TODO: NOT WORKING - original kimera code seems to suggest B6 or C7 in backlight.c
51// however tracing seems to suggest this is not true (as C7 is RGB)
52#define BACKLIGHT_PIN B5 50#define BACKLIGHT_PIN B5
53#define BACKLIGHT_LEVELS 3 51#define BACKLIGHT_LEVELS 10
54// #define BACKLIGHT_BREATHING 52// #define BACKLIGHT_BREATHING
55 53
56#define RGB_DI_PIN C7 54#define RGB_DI_PIN C7
@@ -239,3 +237,7 @@
239/* Bootmagic Lite key configuration */ 237/* Bootmagic Lite key configuration */
240// #define BOOTMAGIC_LITE_ROW 0 238// #define BOOTMAGIC_LITE_ROW 0
241// #define BOOTMAGIC_LITE_COLUMN 0 239// #define BOOTMAGIC_LITE_COLUMN 0
240
241// LTO options
242#define NO_ACTION_MACRO
243#define NO_ACTION_FUNCTION
diff --git a/keyboards/xd84/dev.md b/keyboards/xd84/dev.md
index 453edb366..536b01d06 100644
--- a/keyboards/xd84/dev.md
+++ b/keyboards/xd84/dev.md
@@ -4,6 +4,7 @@ Development docs covering the following:
4- Kimera core 4- Kimera core
5- RGB 5- RGB
6- Backlight 6- Backlight
7- Light Through Cat
7 8
8## Kimera core 9## Kimera core
9![Kimera core](https://gd2.alicdn.com/imgextra/i4/159916802/TB2qsIgdrJkpuFjy1zcXXa5FFXa_!!159916802.jpg) 10![Kimera core](https://gd2.alicdn.com/imgextra/i4/159916802/TB2qsIgdrJkpuFjy1zcXXa5FFXa_!!159916802.jpg)
@@ -77,7 +78,10 @@ Taken from [kimera-config.json](https://github.com/kairyu/tkg/blob/master/keyboa
77- Number of RGB LED 7 78- Number of RGB LED 7
78 79
79# Backlight 80# Backlight
80 TODO - not working 81- PIN B6
82
83# Light Through Cat
84 TODO - PWM C6
81 85
82## Assumptions 86## Assumptions
83### Pin/Port mappings 87### Pin/Port mappings
diff --git a/keyboards/xd84/keymaps/default/keymap.c b/keyboards/xd84/keymaps/default/keymap.c
index 4b9cf9fd2..b122fbddc 100644
--- a/keyboards/xd84/keymaps/default/keymap.c
+++ b/keyboards/xd84/keymaps/default/keymap.c
@@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22 22
23 [1] = LAYOUT_75_ansi( 23 [1] = LAYOUT_75_ansi(
24/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ 24/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */
25 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 25 _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
26/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */ 26/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */
27 _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 27 _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
28/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */ 28/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */
diff --git a/keyboards/xd84/keymaps/default_iso/keymap.c b/keyboards/xd84/keymaps/default_iso/keymap.c
index 18a0f06a8..87b4bfeea 100644
--- a/keyboards/xd84/keymaps/default_iso/keymap.c
+++ b/keyboards/xd84/keymaps/default_iso/keymap.c
@@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22 22
23 [1] = LAYOUT_75_iso( 23 [1] = LAYOUT_75_iso(
24/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ 24/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */
25 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 25 _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
26/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */ 26/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */
27 _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 27 _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
28/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */ 28/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */
diff --git a/keyboards/xd84/rules.mk b/keyboards/xd84/rules.mk
index 0806d092f..283d4babc 100644
--- a/keyboards/xd84/rules.mk
+++ b/keyboards/xd84/rules.mk
@@ -70,7 +70,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
70SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 70SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
71# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 71# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
72NKRO_ENABLE = no # USB Nkey Rollover 72NKRO_ENABLE = no # USB Nkey Rollover
73BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default 73BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
74RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow 74RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
75MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) 75MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
76UNICODE_ENABLE = no # Unicode 76UNICODE_ENABLE = no # Unicode
@@ -83,4 +83,6 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
83CUSTOM_MATRIX = yes 83CUSTOM_MATRIX = yes
84SRC = i2c_master.c custom_matrix_helper.c pca9555.c matrix.c 84SRC = i2c_master.c custom_matrix_helper.c pca9555.c matrix.c
85 85
86EXTRAFLAGS += -flto
87
86LAYOUTS = 75_ansi 75_iso \ No newline at end of file 88LAYOUTS = 75_ansi 75_iso \ No newline at end of file
diff --git a/keyboards/xd84/xd84.c b/keyboards/xd84/xd84.c
index f7048f325..eaf531421 100644
--- a/keyboards/xd84/xd84.c
+++ b/keyboards/xd84/xd84.c
@@ -15,29 +15,18 @@
15 */ 15 */
16#include "xd84.h" 16#include "xd84.h"
17 17
18void matrix_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // put your keyboard start-up code here 19 setPinOutput(B6);
20 // runs once when the firmware starts up
21 20
22 matrix_init_user(); 21 keyboard_pre_init_user();
23}
24
25void matrix_scan_kb(void) {
26 // put your looping keyboard code here
27 // runs every cycle (a lot)
28
29 matrix_scan_user();
30}
31
32bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
33 // put your per-action keyboard code here
34 // runs for every action, just before processing by the firmware
35
36 return process_record_user(keycode, record);
37} 22}
38 23
39void led_set_kb(uint8_t usb_led) { 24void led_set_kb(uint8_t usb_led) {
40 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here 25 if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
26 writePinLow(B6);
27 } else {
28 writePinHigh(B6);
29 }
41 30
42 led_set_user(usb_led); 31 led_set_user(usb_led);
43} 32}