ps2avrgb: fix incorrect avr ports specified (for numlock and capslock LEDs) (#3453)

* Add M6-A keymap

* Update XD60 keymap

* Update XD60 keymap readme

* Update JJ40 and Let's Split keymaps

* Add readme for M6-A

* Fix typo, update JJ40 README

* Update jj40 readme

* Cleanup jj40 keymap

* Revert Let's Split QWERTY layer to default before #2010

* Update numpad layers

* Fix: Let's Split keymap getting stuck mods due to having keycodes assigned on the Raise layer

* Keep ASCII art consistent with keymap

* Staryu: initial port

* Add personal keymap

* Added and updated READMEs

* Fix: default keymap for staryu

* Rudimentary backlight support.

* Enabled mousekeys for default keymap

* use QMK_KEYBOARD_H and LAYOUT

* Update readme.md for NIU mini: flash using avrdude

* Fix missing linebreaks for Staryu README

* Update readme.md

* Update PS2AVRGB boards with new matrix.c

* Update canoe matrix.c; untested

* Fix canoe.c for building (needs matrix_scan_user and matrix_init_user)

* Add personal Iris keymap

* Update keymap

* Update keymap

* Update keymap, disable backlighting and underglow

* Move PrintScreen button

* Add README

* Update personal keymaps

* Add INS key

* Limit USB max power consumption, change Fn to MENU

* Remove Numpad layer (easy to accidentally toggle)

* Fix backlighting for ps2avrgb

* Update comments to refer to actual pin naming

* Possible fix for xyverz ortho keymap: define RGBLED_NUM

* Make led_set_user in backlight.c overridable

* Add changes to address points raised in code review, untested (don't have build env right now)
This commit is contained in:
Kenneth Aloysius 2018-07-24 02:11:56 +07:00 committed by Drashna Jaelre
parent 4e41812a67
commit f2bc70a264
13 changed files with 97 additions and 52 deletions

View file

@ -0,0 +1,2 @@
#pragma once
#define USB_MAX_POWER_CONSUMPTION 100

View file

@ -0,0 +1,29 @@
#include QMK_KEYBOARD_H
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
#define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_APP, KC_APP, KC_RCTL),
LAYOUT(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,
KC_CAPS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, RESET,
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______,
_______, KC_NO, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
} else {
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
}
}

View file

@ -0,0 +1,15 @@
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = yes
LAYOUTS = 60_ansi

View file

@ -17,10 +17,10 @@
#include <stdio.h> #include <stdio.h>
// Port D: digital pins of the AVR chipset // Port D: digital pins of the AVR chipset
#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) #define NUMLOCK_PORT (1 << 0) // D0
#define CAPSLOCK_PORT (1 << 2) // 2nd pin #define CAPSLOCK_PORT (1 << 1) // D1
#define BACKLIGHT_PORT (1 << 4) // 4th pin #define BACKLIGHT_PORT (1 << 4) // D4
#define SCROLLLOCK_PORT (1 << 6) // 6th pin #define SCROLLLOCK_PORT (1 << 6) // D6
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default
@ -43,6 +43,7 @@ extern backlight_config_t backlight_config;
// @Override // @Override
// turn LEDs on and off depending on USB caps/num/scroll lock states. // turn LEDs on and off depending on USB caps/num/scroll lock states.
__attribute__ ((weak))
void led_set_user(uint8_t usb_led) { void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) { if (usb_led & (1 << USB_LED_NUM_LOCK)) {
// turn on // turn on

View file

@ -3,7 +3,6 @@
#define _QWERTY 0 #define _QWERTY 0
#define _LOWER 1 #define _LOWER 1
#define _RAISE 2 #define _RAISE 2
#define _NUMPAD 3
enum custom_keycodes { enum custom_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
@ -15,14 +14,6 @@ void matrix_scan_user(void) {
// runs at every matrix scan. // runs at every matrix scan.
} }
// enum {
// TD_H_E = 0
// };
//
// qk_tap_dance_action_t tap_dance_actions[] = {
// [TD_H_E] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_END)
// };
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty /* Qwerty
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
@ -39,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
TO(_NUMPAD),KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ _______, KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
), ),
/* Lower /* Lower
@ -76,23 +67,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_END, KC_PGUP, KC_PGDN, _______, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_END, KC_PGUP, KC_PGDN, _______, \
_______, KC_MRWD, KC_MPLY, KC_MNXT, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ _______, KC_MRWD, KC_MPLY, KC_MNXT, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Numpad
* ,-----------------------------------------------------------------------------------.
* | Esc | 7 | 8 | 9 | * | / | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | <-- | 4 | 5 | 6 | + | - | | | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | 1 | 2 | 3 |Enter |Enter | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Qwerty| 0 | . | . |Enter |Enter | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = LAYOUT_2U_space( \
KC_ESC, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, _______, _______, _______, _______, _______, _______, \
KC_BSPC, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PMNS, _______, _______, _______, _______, _______, _______, \
_______, KC_P1, KC_P2, KC_P3, KC_PENT, KC_PENT, _______, _______, _______, _______, _______, _______, \
TO(_QWERTY),KC_P0, KC_PDOT, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______ \
) )
}; };

View file

@ -0,0 +1,17 @@
/* Numpad
* ,-----------------------------------------------------------------------------------.
* | Esc | 7 | 8 | 9 | * | / | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | <-- | 4 | 5 | 6 | + | - | | | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | 1 | 2 | 3 |Enter |Enter | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Qwerty| 0 | . | . |Enter |Enter | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = LAYOUT_2U_space( \
KC_ESC, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, _______, _______, _______, _______, _______, _______, \
KC_BSPC, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PMNS, _______, _______, _______, _______, _______, _______, \
_______, KC_P1, KC_P2, KC_P3, KC_PENT, KC_PENT, _______, _______, _______, _______, _______, _______, \
TO(_QWERTY),KC_P0, KC_PDOT, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______ \
)

View file

@ -9,10 +9,10 @@
#include <avr/interrupt.h> #include <avr/interrupt.h>
// Port D: digital pins of the AVR chipset // Port D: digital pins of the AVR chipset
#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) #define NUMLOCK_PORT (1 << 0) // D0
#define CAPSLOCK_PORT (1 << 2) // 2nd pin #define CAPSLOCK_PORT (1 << 1) // D1
#define BACKLIGHT_PORT (1 << 4) // 4th pin #define BACKLIGHT_PORT (1 << 4) // D4
#define SCROLLLOCK_PORT (1 << 6) // 6th pin #define SCROLLLOCK_PORT (1 << 6) // D6
/** /**
* References * References
@ -25,6 +25,7 @@
// @Override // @Override
// turn LEDs on and off depending on USB caps/num/scroll lock states. // turn LEDs on and off depending on USB caps/num/scroll lock states.
__attribute__ ((weak))
void led_set_user(uint8_t usb_led) { void led_set_user(uint8_t usb_led) {
/* It appears that these cause the v1 JJ40 PCB to hang. /* It appears that these cause the v1 JJ40 PCB to hang.
* I haven't looked into why, but I don't have any LEDs on my board anyway. */ * I haven't looked into why, but I don't have any LEDs on my board anyway. */

View file

@ -17,10 +17,10 @@
#include <stdio.h> #include <stdio.h>
// Port D: digital pins of the AVR chipset // Port D: digital pins of the AVR chipset
#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) #define NUMLOCK_PORT (1 << 0) // D0
#define CAPSLOCK_PORT (1 << 2) // 2nd pin #define CAPSLOCK_PORT (1 << 1) // D1
#define BACKLIGHT_PORT (1 << 4) // 4th pin #define BACKLIGHT_PORT (1 << 4) // D4
#define SCROLLLOCK_PORT (1 << 6) // 6th pin #define SCROLLLOCK_PORT (1 << 6) // D6
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default
@ -43,6 +43,7 @@ extern backlight_config_t backlight_config;
// @Override // @Override
// turn LEDs on and off depending on USB caps/num/scroll lock states. // turn LEDs on and off depending on USB caps/num/scroll lock states.
__attribute__ ((weak))
void led_set_user(uint8_t usb_led) { void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) { if (usb_led & (1 << USB_LED_NUM_LOCK)) {
// turn on // turn on

View file

@ -64,7 +64,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAYER0] = LAYOUT( \ [_LAYER0] = LAYOUT( \
KC_ESC, TO(_LAYER1), \ KC_ESC, TO(_LAYER1), \
KC_Z, KC_X, KC_SPACE \ KC_Z, KC_X, KC_ENT \
), ),
[_LAYER1] = LAYOUT( \ [_LAYER1] = LAYOUT( \
MUTE, TO(_LAYER2), \ MUTE, TO(_LAYER2), \

View file

@ -20,8 +20,8 @@
// Port D: digital pins of the AVR chipset // Port D: digital pins of the AVR chipset
//#define NUMLOCK_PORT (1 << 2) // 2nd pin of Port D (digital) //#define NUMLOCK_PORT (1 << 2) // 2nd pin of Port D (digital)
#define CAPSLOCK_PORT (1 << 1) // 1st pin #define CAPSLOCK_PORT (1 << 1) // 1st pin
#define BACKLIGHT_PORT (1 << 4) // 4th pin #define BACKLIGHT_PORT (1 << 4) // D4
//#define SCROLLLOCK_PORT (1 << 6) // 6th pin //#define SCROLLLOCK_PORT (1 << 6) // D6
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default
@ -44,6 +44,7 @@ extern backlight_config_t backlight_config;
// @Override // @Override
// turn LEDs on and off depending on USB caps/num/scroll lock states. // turn LEDs on and off depending on USB caps/num/scroll lock states.
__attribute__ ((weak))
void led_set_user(uint8_t usb_led) { void led_set_user(uint8_t usb_led) {
/* /*
if (usb_led & (1 << USB_LED_NUM_LOCK)) { if (usb_led & (1 << USB_LED_NUM_LOCK)) {

View file

@ -19,8 +19,8 @@
// Port D: digital pins of the AVR chipset // Port D: digital pins of the AVR chipset
#define NUMLOCK_PORT (1 << 0) // 0th pin of Port D (digital) #define NUMLOCK_PORT (1 << 0) // 0th pin of Port D (digital)
#define CAPSLOCK_PORT (1 << 1) // 1st pin #define CAPSLOCK_PORT (1 << 1) // 1st pin
#define BACKLIGHT_PORT (1 << 4) // 4th pin #define BACKLIGHT_PORT (1 << 4) // D4
//#define SCROLLLOCK_PORT (1 << 6) // 6th pin //#define SCROLLLOCK_PORT (1 << 6) // D6
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default
@ -43,6 +43,7 @@ extern backlight_config_t backlight_config;
// @Override // @Override
// turn LEDs on and off depending on USB caps/num/scroll lock states. // turn LEDs on and off depending on USB caps/num/scroll lock states.
__attribute__ ((weak))
void led_set_user(uint8_t usb_led) { void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) { if (usb_led & (1 << USB_LED_NUM_LOCK)) {
// turn on // turn on

View file

@ -17,10 +17,10 @@
#include <stdio.h> #include <stdio.h>
// Port D: digital pins of the AVR chipset // Port D: digital pins of the AVR chipset
#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) #define NUMLOCK_PORT (1 << 0) // D0
#define CAPSLOCK_PORT (1 << 2) // 2nd pin #define CAPSLOCK_PORT (1 << 1) // D1
#define BACKLIGHT_PORT (1 << 4) // 4th pin #define BACKLIGHT_PORT (1 << 4) // D4
#define SCROLLLOCK_PORT (1 << 6) // 6th pin #define SCROLLLOCK_PORT (1 << 6) // D6
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default
@ -43,6 +43,7 @@ extern backlight_config_t backlight_config;
// @Override // @Override
// turn LEDs on and off depending on USB caps/num/scroll lock states. // turn LEDs on and off depending on USB caps/num/scroll lock states.
__attribute__ ((weak))
void led_set_user(uint8_t usb_led) { void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) { if (usb_led & (1 << USB_LED_NUM_LOCK)) {
// turn on // turn on

View file

@ -18,6 +18,9 @@
#ifdef KEYBOARD_lets_split_rev2 #ifdef KEYBOARD_lets_split_rev2
#define RGBLED_NUM 8 #define RGBLED_NUM 8
#endif #endif
#ifdef KEYBOARD_jj40
#define RGBLED_NUM 5
#endif
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_HUE_STEP 8