Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Daisy port #2016

Merged
merged 13 commits into from
Nov 22, 2017
Prev Previous commit
Next Next commit
revised config files
  • Loading branch information
westfoxtrot committed Nov 17, 2017
commit 01db765f878ffbed5b88fdac6dde4fe942b2707b
20 changes: 1 addition & 19 deletions keyboards/daisy/config.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
Copyright 2017

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_H
#define CONFIG_H

Expand All @@ -26,7 +9,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEVICE_VER 0x501
#define MANUFACTURER K.T.E.C.
#define PRODUCT Daisy
#define DESCRIPTION qmk firmware for Daisy
#define DESCRIPTION qmk port for Daisy

/* key matrix size */
#define MATRIX_ROWS 4
Expand All @@ -50,7 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DIODE_DIRECTION COL2ROW

#define BACKLIGHT_PIN D0
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 6


Expand Down
33 changes: 10 additions & 23 deletions keyboards/daisy/daisy.c
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
#include "daisy.h"

void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up

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);
}

void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here

if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// output low
DDRC |= (1<<PC6);
PORTC &= ~(1<<PC6);
} else {
// Hi-Z
DDRC &= ~(1<<PC6);
PORTC &= ~(1<<PC6);
}
led_set_user(usb_led);
}
}
12 changes: 6 additions & 6 deletions keyboards/daisy/daisy.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
#include "quantum.h"

#define KEYMAP( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K3A, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \
K30, K31, K32, K33, K34, K36, K37, K38 \
K30, K31, K32, K34, K35, K37, K38, K39 \
) \
{ \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A }, \
{ K30, K31, K32, K33, K34, K36, K37, K38 } \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A }, \
{ K30, K31, K32, KC_NO, K34, K35, KC_NO, K37, K38, K39, K3A } \
}

#endif
36 changes: 31 additions & 5 deletions keyboards/daisy/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#include "daisy.h"
#include "daisy.h"
#include "action_layer.h"

//extern keymap_config_t keymap_config;
extern keymap_config_t keymap_config;

// Layer shorthand
#define _BL 0
#define _LW 1
#define _RS 2

enum layer_keycodes {
QWERTY = SAFE_RANGE, LOWER, RAISE
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Base Layer
Expand All @@ -18,15 +22,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |-----------------------------------------------------------------------|
* | LSHIFT | Z | X | C | V | B | N | M | ,< | .> | /? |
* |-----------------------------------------------------------------------|
* | LCTRL | LGUI | LALT | SPACE | BACKSPACE | FN1 | FN2 | RALT |
* | LCTRL | LGUI | LALT | SPACE | BACKSPACE | LW | RS | RALT |
* '-----------------------------------------------------------------------'
*/

[_BL] = KEYMAP(
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
GRAVE_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_BSPC, MO(_LW), MO(_RS), KC_RALT ),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_BSPC, LOWER, RAISE, KC_RALT ),


/* Function Layer
Expand Down Expand Up @@ -70,4 +74,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

const uint16_t PROGMEM fn_actions[] = {

};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LOWER:
if(record->event.pressed){
layer_on(_LW);
} else {
layer_off(_LW);
}
return false;
break;
case RAISE:
if(record->event.pressed){
layer_on(_RS);
} else {
layer_off(_RS);
}
return false;
break;
}
return true;
};
8 changes: 4 additions & 4 deletions keyboards/daisy/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4996
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
MOUSEKEY_ENABLE = no # 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
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend