1
0
Fork 0

[Keyboard] VIA Support: DO60 (#9622)

* fix up that vendor ID

* add a VIA enabled keymap

* use pragma once

* clean up indicator leds code

* remove unused header
This commit is contained in:
MechMerlin 2020-07-23 20:17:38 -07:00 committed by GitHub
parent a50c0049f6
commit 2cebac6f2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 40 deletions

View file

@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config_common.h" #include "config_common.h"
/* USB Device descriptor parameter */ /* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED #define VENDOR_ID 0x4453 // DS for Doyu Studios
#define PRODUCT_ID 0x6060 #define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001 #define DEVICE_VER 0x0001
#define MANUFACTURER Shopkey by Doyu Studio #define MANUFACTURER Shopkey by Doyu Studio

View file

@ -1,11 +1,4 @@
#include "do60.h" #include "do60.h"
#include "led.h"
//extern inline void do60_caps_led_on(void);
//extern inline void do60_bl_led_on(void);
//extern inline void do60_caps_led_off(void);
//extern inline void do60_bl_led_off(void);
extern inline void setdefaultrgb(void); extern inline void setdefaultrgb(void);
@ -18,33 +11,17 @@ void matrix_init_kb(void) {
setdefaultrgb(); setdefaultrgb();
}; };
void matrix_scan_kb(void) {
// Looping keyboard code goes here
// This runs every cycle (a lot)
matrix_scan_user();
};
void led_init_ports(void) { void led_init_ports(void) {
// Set caps lock LED pin as output // Set caps lock LED pin as output
DDRB |= (1 << 2); setPinOutput(B2);
// Default to off // Default to off
PORTB |= (1 << 2); writePinHigh(B2);
} }
void led_set_kb(uint8_t usb_led) { bool led_update_kb(led_t led_state) {
//if (usb_led & (1<<USB_LED_CAPS_LOCK)) { if(led_update_user(led_state)) {
// do60_caps_led_on(); writePin(B2, !led_state.caps_lock);
//} else {
// do60_caps_led_off();
//}
//led_set_user(usb_led);
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// Turn capslock on
PORTB &= ~(1<<2);
} else {
// Turn capslock off
PORTB |= (1<<2);
} }
return true;
} }

View file

@ -1,8 +1,6 @@
#ifndef DO60_H #pragma once
#define DO60_H
#include "quantum.h" #include "quantum.h"
#include "led.h"
/* DO60 LEDs /* DO60 LEDs
* GPIO pads * GPIO pads
@ -94,4 +92,3 @@ inline void setdefaultrgb(void){ rgblight_sethsv(100,100,100); }
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \
{ K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, K47, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \ { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, K47, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \
} }
#endif

View file

@ -19,8 +19,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, MO(1), KC_HOME, KC_PGDOWN,KC_END), KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, MO(1), KC_HOME, KC_PGDOWN,KC_END),
}; };
// Loop
void matrix_scan_user(void) {
// Empty
};

View file

@ -0,0 +1,35 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
[0] = LAYOUT_all(
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_GRV, 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_LBRC, KC_RBRC, KC_BSLS, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, 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_RSFT, KC_SLSH, KC_UP, KC_SLSH, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_BSPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT),
// 1: Function Layer
[1] = LAYOUT_all(
RESET, 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_NO, KC_NO, \
KC_NO, RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, BL_TOGG,BL_ON, BL_INC, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \
KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_RMOD, BL_STEP,BL_OFF, BL_DEC, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \
KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP, KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_RSFT, KC_NO , KC_PGUP, KC_INS, \
KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, MO(1), KC_HOME, KC_PGDOWN,KC_END),
[2] = LAYOUT_all(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS),
[3] = LAYOUT_all(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS),
};

View file

@ -0,0 +1,5 @@
![Uses this layout](https://i.redd.it/v64eqwsrk8jx.jpg)
All of the keys which CAN have a function should be assigned one.
The keys with KC_NO cannot be assigned a value

View file

@ -0,0 +1,2 @@
VIA_ENABLE = yes
LTO_ENABLE = yes