]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
[Keyboard] XD84 fixes for caps lock led, backlight and firmware size (#5178)
authorzvecr <git@zvecr.com>
Tue, 19 Feb 2019 00:48:52 +0000 (00:48 +0000)
committerDrashna Jaelre <drashna@live.com>
Tue, 19 Feb 2019 00:48:52 +0000 (16:48 -0800)
* Enable backlight

* Enable Link Time Optimization

* Enable caps lock led

keyboards/xd84/config.h
keyboards/xd84/dev.md
keyboards/xd84/keymaps/default/keymap.c
keyboards/xd84/keymaps/default_iso/keymap.c
keyboards/xd84/rules.mk
keyboards/xd84/xd84.c

index b2f850c184dfea08516401958ddaaab3b379da32..abb9f17a580b34620ecb7e6a6a34c3a8a346301c 100644 (file)
 /* COL2ROW, ROW2COL */
 //#define DIODE_DIRECTION COL2ROW
 
-// TODO: NOT WORKING - original kimera code seems to suggest B6 or C7 in backlight.c
-//                     however tracing seems to suggest this is not true (as C7 is RGB)
 #define BACKLIGHT_PIN B5
-#define BACKLIGHT_LEVELS 3
+#define BACKLIGHT_LEVELS 10
 // #define BACKLIGHT_BREATHING
 
 #define RGB_DI_PIN C7
 /* Bootmagic Lite key configuration */
 // #define BOOTMAGIC_LITE_ROW 0
 // #define BOOTMAGIC_LITE_COLUMN 0
+
+// LTO options
+#define NO_ACTION_MACRO
+#define NO_ACTION_FUNCTION
index 453edb366792151aa6e67a97a1d0a933a60925f0..536b01d06ba5adb557fdd4fc84e1a7bbc556a248 100644 (file)
@@ -4,6 +4,7 @@ Development docs covering the following:
 - Kimera core
 - RGB
 - Backlight
+- Light Through Cat
 
 ## Kimera core
 ![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
 - Number of RGB LED 7
 
 # Backlight
-    TODO - not working
+- PIN B6
+
+# Light Through Cat
+    TODO - PWM C6
 
 ## Assumptions
 ### Pin/Port mappings
index 4b9cf9fd24df0bcc4095ca63aa57240a0e0d5957..b122fbddc3048a1b1b46ffd6bd26fec3198acbb8 100644 (file)
@@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 
   [1] = LAYOUT_75_ansi(
 /* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */
-    _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
+    _______,  BL_TOGG,  BL_STEP,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
 /* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */
          _______,  RGB_TOG,  RGB_MOD,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,            _______,
 /* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */
index 18a0f06a82873d724e769ea148fab2ce8a52709a..87b4bfeea1d4e05c7be423b066cdc92ba13f671f 100644 (file)
@@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 
   [1] = LAYOUT_75_iso(
 /* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */
-    _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
+    _______,  BL_TOGG,  BL_STEP,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
 /* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */
          _______,  RGB_TOG,  RGB_MOD,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,            _______,
 /* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */
index 0806d092ff2d0906b3d601ae226a70365f09827c..283d4babc7a76c2532e400a5598aa2bbba941d7b 100644 (file)
@@ -70,7 +70,7 @@ COMMAND_ENABLE = no         # Commands for debug and configuration
 SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
 # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
 NKRO_ENABLE = no            # USB Nkey Rollover
-BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality on B7 by default
+BACKLIGHT_ENABLE = yes      # Enable keyboard backlight functionality on B7 by default
 RGBLIGHT_ENABLE = yes       # Enable keyboard RGB underglow
 MIDI_ENABLE = no            # MIDI support (+2400 to 4200, depending on config)
 UNICODE_ENABLE = no         # Unicode
@@ -83,4 +83,6 @@ HD44780_ENABLE = no           # Enable support for HD44780 based LCDs (+400)
 CUSTOM_MATRIX = yes
 SRC = i2c_master.c custom_matrix_helper.c pca9555.c matrix.c
 
+EXTRAFLAGS += -flto
+
 LAYOUTS = 75_ansi 75_iso
\ No newline at end of file
index f7048f3252dc7d93ca3f4262cc952d1e2a27fa37..eaf531421b64bb3544bfe97a49125dddf62ed8f7 100644 (file)
  */
 #include "xd84.h"
 
-void matrix_init_kb(void) {
-       // put your keyboard start-up code here
-       // runs once when the firmware starts up
+void keyboard_pre_init_kb(void) {
+  setPinOutput(B6);
 
-       matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-       // put your looping keyboard code here
-       // runs every cycle (a lot)
-
-       matrix_scan_user();
-}
-
-bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
-       // put your per-action keyboard code here
-       // runs for every action, just before processing by the firmware
-
-       return process_record_user(keycode, record);
+  keyboard_pre_init_user();
 }
 
 void led_set_kb(uint8_t usb_led) {
-       // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
+  if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
+    writePinLow(B6);
+  } else {
+    writePinHigh(B6);
+  }
 
-       led_set_user(usb_led);
+  led_set_user(usb_led);
 }