Cospad QMK Configurator support and refactor (#3319)

* Refactor KEYMAP to LAYOUT standards

- Change KEYMAP to LAYOUT_ortho
- Added a new LAYOUT called LAYOUT_numpad

* Use the new LAYOUT_numpad macro

* Add QMK Configurator support

* Change LAYOUT names as per code review

* Change positioning of keys in the matrix

* fix compile issue
This commit is contained in:
MechMerlin 2018-07-05 10:43:15 -07:00 committed by Drashna Jaelre
parent e36cbdc786
commit 5953af3215
3 changed files with 48 additions and 19 deletions

View file

@ -40,13 +40,13 @@
*/ */
// The first section contains all of the arguments // The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array // The second converts the arguments into a two-dimensional array
#define KEYMAP( \ #define LAYOUT_ortho_6x4( \
k00, k01, k02, k03, \ k00, k01, k02, k03, \
k10, k11, k12, k13, \ k10, k11, k12, k13, \
k20, k21, k22, k23, \ k20, k21, k22, k23, \
k30, k31, k32, k33, \ k30, k31, k32, k33, \
k40, k41, k42, k43, \ k40, k41, k42, k43, \
k50, k51, k52, k53 \ k50, k51, k52, k53 \
) \ ) \
{ \ { \
{k00, k01, k02, k03}, \ {k00, k01, k02, k03}, \
@ -54,14 +54,27 @@
{k20, k21, k22, k23}, \ {k20, k21, k22, k23}, \
{k30, k31, k32, k33}, \ {k30, k31, k32, k33}, \
{k40, k41, k42, k43}, \ {k40, k41, k42, k43}, \
{k50, k51, k52, k53} \ {k50, k51, k52, k53} \
}
#define LAYOUT_numpad_6x4( \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, \
k30, k31, k32, k23, \
k40, k41, k42, \
k50, k52, k43 \
) \
{ \
{k00, k01, k02, k03}, \
{k10, k11, k12, k13}, \
{k20, k21, k22, k23}, \
{k30, k31, k32, KC_NO}, \
{k40, k41, k42, k43}, \
{k50, KC_NO, k52, KC_NO} \
} }
void matrix_init_user(void); void matrix_init_user(void);
void matrix_scan_user(void); void matrix_scan_user(void);
/*
inline void cospad_bl_led_on(void) { DDRF |= (1<<7); PORTF &= ~(1<<7); }
inline void cospad_bl_led_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); }
*/
inline void cospad_bl_led_on(void) { PORTF &= ~(1<<7); } inline void cospad_bl_led_on(void) { PORTF &= ~(1<<7); }
inline void cospad_bl_led_off(void) { PORTF |= (1<<7); } inline void cospad_bl_led_off(void) { PORTF |= (1<<7); }

View file

@ -0,0 +1,16 @@
{
"keyboard_name": "",
"url": "",
"maintainer": "qmk",
"width": 4,
"height": 6,
"layouts": {
"LAYOUT_numpad_6x4": {
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"Fn", "x":2, "y":0}, {"label":"Back", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"+", "x":3, "y":2, "h":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4, "h":2}, {"label":"0", "x":0, "y":5, "w":2}, {"label":".", "x":2, "y":5}]
},
"LAYOUT_ortho_6x4": {
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"Fn", "x":2, "y":0}, {"label":"Back", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"+", "x":3, "y":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"x":3, "y":3}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}, {"label":"0", "x":0, "y":5}, {"x":1, "y":5}, {"label":".", "x":2, "y":5}, {"x":3, "y":5}]
}
}
}

View file

@ -1,4 +1,4 @@
#include "cospad.h" #include QMK_KEYBOARD_H
#include "led.h" #include "led.h"
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
@ -31,13 +31,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-------------------' * `-------------------'
*/ */
[_BL] = KEYMAP( [_BL] = LAYOUT_numpad_6x4(
KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \ KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
KC_P7, KC_P8, KC_P9, KC_PPLS, \ KC_P7, KC_P8, KC_P9, \
KC_P4, KC_P5, KC_P6, KC_NO, \ KC_P4, KC_P5, KC_P6, KC_PPLS, \
KC_P1, KC_P2, KC_P3, KC_PENT, \ KC_P1, KC_P2, KC_P3, \
KC_P0, KC_NO, KC_PDOT, KC_NO), KC_P0, KC_PDOT, KC_PENT),
/* Keymap _FL: Function Layer /* Keymap _FL: Function Layer
* ,-------------------. * ,-------------------.
@ -54,13 +54,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | 0 |RST | | * | 0 |RST | |
* `-------------------' * `-------------------'
*/ */
[_FL] = KEYMAP( [_FL] = LAYOUT_numpad_6x4(
RGB_TOG, KC_TAB, KC_TRNS, KC_BSPC, \ RGB_TOG, KC_TAB, KC_TRNS, KC_BSPC, \
RGB_MOD, RGB_M_P, BL_TOGG, KC_PMNS, \ RGB_MOD, RGB_M_P, BL_TOGG, KC_PMNS, \
RGB_HUD, RGB_HUI, BL_ON, KC_PPLS, \ RGB_HUD, RGB_HUI, BL_ON, \
RGB_SAD, RGB_SAI, BL_OFF, KC_NO, \ RGB_SAD, RGB_SAI, BL_OFF, KC_PPLS, \
RGB_VAD, RGB_VAI, KC_P3, KC_PENT, \ RGB_VAD, RGB_VAI, KC_P3, \
KC_P0, KC_NO, RESET, KC_NO), KC_P0, RESET, KC_PENT),
}; };