From 6276f54752e98ab1f99eaff5c077c52bf29e5c81 Mon Sep 17 00:00:00 2001 From: Albert Y <76888457+filterpaper@users.noreply.github.com> Date: Thu, 25 Mar 2021 19:52:53 +0800 Subject: [PATCH 1/2] Add suspend wake functions for The Mark:65's RGB Matrix (#12245) * Add suspend wake functions for RGB Matrix * Add USB suspend definition to config.h Co-authored-by: filterpaper --- keyboards/boardsource/the_mark/config.h | 1 + keyboards/boardsource/the_mark/the_mark.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/keyboards/boardsource/the_mark/config.h b/keyboards/boardsource/the_mark/config.h index cb64c3a69..7af2c302f 100644 --- a/keyboards/boardsource/the_mark/config.h +++ b/keyboards/boardsource/the_mark/config.h @@ -58,6 +58,7 @@ along with this program. If not, see . #ifdef RGB_MATRIX_ENABLE #define DRIVER_LED_TOTAL 24 // Number of LEDs #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 +#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended #endif /* diff --git a/keyboards/boardsource/the_mark/the_mark.c b/keyboards/boardsource/the_mark/the_mark.c index bb37974f6..9bc1f5b46 100644 --- a/keyboards/boardsource/the_mark/the_mark.c +++ b/keyboards/boardsource/the_mark/the_mark.c @@ -35,4 +35,15 @@ led_config_t g_led_config = { { LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL } }; + + +void suspend_power_down_kb(void) { + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) { + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} #endif From c4d05010cb4dad42740d67003bf66b67e10fe854 Mon Sep 17 00:00:00 2001 From: Blake Date: Thu, 25 Mar 2021 11:53:30 +0000 Subject: [PATCH 2/2] Add Daisy, a macropad with dual rotary encoders + update Scarlet readme.md (#12221) * Daisy first commit buggy * buggy still underglow crash * Daisy V1 * ReadMe Updates --- keyboards/draytronics/daisy/config.h | 112 ++++++++++++++++++ keyboards/draytronics/daisy/daisy.c | 19 +++ keyboards/draytronics/daisy/daisy.h | 33 ++++++ keyboards/draytronics/daisy/info.json | 25 ++++ .../daisy/keymaps/default/keymap.c | 51 ++++++++ keyboards/draytronics/daisy/readme.md | 20 ++++ keyboards/draytronics/daisy/rules.mk | 23 ++++ keyboards/draytronics/scarlet/readme.md | 4 +- 8 files changed, 285 insertions(+), 2 deletions(-) create mode 100644 keyboards/draytronics/daisy/config.h create mode 100644 keyboards/draytronics/daisy/daisy.c create mode 100644 keyboards/draytronics/daisy/daisy.h create mode 100644 keyboards/draytronics/daisy/info.json create mode 100644 keyboards/draytronics/daisy/keymaps/default/keymap.c create mode 100644 keyboards/draytronics/daisy/readme.md create mode 100644 keyboards/draytronics/daisy/rules.mk diff --git a/keyboards/draytronics/daisy/config.h b/keyboards/draytronics/daisy/config.h new file mode 100644 index 000000000..b524f8902 --- /dev/null +++ b/keyboards/draytronics/daisy/config.h @@ -0,0 +1,112 @@ +/*Copyright 2021 Blake Drayson / Draytronics + +Contact info@draytronics.co.uk + +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 . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x4454 //DT for DrayTronics +#define PRODUCT_ID 0x4441 //DA for Daisy +#define DEVICE_VER 0x0100 //Version 1 +#define MANUFACTURER Draytronics +#define PRODUCT DAISY + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ + +#define MATRIX_ROW_PINS { B0, C0, C1} +#define MATRIX_COL_PINS { C2, C3, C4, C5 } +#define UNUSED_PINS + +#define ENCODERS_PAD_A { B1, D0 } +#define ENCODERS_PAD_B { B2, D1 } +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW +#define TAP_CODE_DELAY 10 +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is useful for the Windows task manager shortcut (ctrl+shift+esc). + */ +//#define GRAVE_ESC_CTRL_OVERRIDE +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ +/* disable debug print */ +//#define NO_DEBUG +/* disable print */ +//#define NO_PRINT +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +/* disable these deprecated features by default */ +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +//Underglow +#define RGB_DI_PIN D4 // Underglow led pin +#ifdef RGB_DI_PIN + #define RGBLED_NUM 4 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ + /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +#endif diff --git a/keyboards/draytronics/daisy/daisy.c b/keyboards/draytronics/daisy/daisy.c new file mode 100644 index 000000000..149cb3d0c --- /dev/null +++ b/keyboards/draytronics/daisy/daisy.c @@ -0,0 +1,19 @@ +/*Copyright 2021 Blake Drayson / Draytronics + +Contact info@draytronics.co.uk + +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 . +*/ + +#include "daisy.h" diff --git a/keyboards/draytronics/daisy/daisy.h b/keyboards/draytronics/daisy/daisy.h new file mode 100644 index 000000000..f6f9b69d8 --- /dev/null +++ b/keyboards/draytronics/daisy/daisy.h @@ -0,0 +1,33 @@ +/*Copyright 2021 Blake Drayson / Draytronics + +Contact info@draytronics.co.uk + +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 . +*/ + +#pragma once + +#define _x_ KC_NO + +#include "quantum.h" + +#define LAYOUT_daisy( \ + K00, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23 \ +) { \ +{ K00, _x_, _x_, K03, }, \ +{ K10, K11, K12, K13, }, \ +{ K20, K21, K22, K23, }, \ +} diff --git a/keyboards/draytronics/daisy/info.json b/keyboards/draytronics/daisy/info.json new file mode 100644 index 000000000..4fee49466 --- /dev/null +++ b/keyboards/draytronics/daisy/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "Draytronics DAISY", + "url": "https://www.draytronics.co.uk/daisy", + "maintainer": "ghostseven", + "width": 4, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"", "x":0, "y":0}, + {"label":"", "x":3, "y":0}, + + {"label":"", "x":0, "y":1}, + {"label":"", "x":1, "y":1}, + {"label":"", "x":2, "y":1}, + {"label":"", "x":3, "y":1}, + + {"label":"", "x":0, "y":2}, + {"label":"", "x":1, "y":2}, + {"label":"", "x":2, "y":2}, + {"label":"", "x":3, "y":1, "h":2} + ] + } + } +} diff --git a/keyboards/draytronics/daisy/keymaps/default/keymap.c b/keyboards/draytronics/daisy/keymaps/default/keymap.c new file mode 100644 index 000000000..396fcd9dd --- /dev/null +++ b/keyboards/draytronics/daisy/keymaps/default/keymap.c @@ -0,0 +1,51 @@ +/*Copyright 2021 Blake Drayson / Draytronics + +Contact info@draytronics.co.uk + +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 . +*/ + +#include QMK_KEYBOARD_H +#define _BASE 0 // Base layer +#define _CODE 1 // Code layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_daisy( + KC_MUTE, KC_HOME, + MO(_CODE), KC_MPRV, KC_MNXT, KC_MPLY, + C(KC_LEFT), C(KC_UP), C(KC_DOWN), C(KC_RIGHT) + ), + [_CODE] = LAYOUT_daisy( + KC_MUTE, KC_END, + _______, RGB_MOD, RGB_VAI, RGB_TOG, + G(S(KC_5)), G(A(KC_ESC)), G(KC_F), RESET + ) +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + else if (index == 1) { + if (clockwise) { + tap_code(KC_PGUP); + } else { + tap_code(KC_PGDN); + } + } +} diff --git a/keyboards/draytronics/daisy/readme.md b/keyboards/draytronics/daisy/readme.md new file mode 100644 index 000000000..6e8dd007a --- /dev/null +++ b/keyboards/draytronics/daisy/readme.md @@ -0,0 +1,20 @@ +# DAISY +![daisy](https://www.draytronics.co.uk/wp-content/uploads/2020/12/repository-open-graph-template-1.png) + +An open source macro pad with rotary encoders and under glow, designed to be easily built with (mostly) through hole components. More info / kits / PCB designs available at [draytronics.co.uk/daisy](https://www.draytronics.co.uk/daisy) + +* Keyboard Maintainer: [Blake Drayson](https://github.com/ghostseven) +* Hardware Supported: DAISY PCB / ATMega328P +* Hardware Availability: [draytronics.co.uk](https://draytronics.co.uk) + +Make example for this keyboard (after setting up your build environment): + + make draytronics/daisy:default + +Flashing example for this keyboard: + + make draytronics/daisy:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +VIA design config file avaliable [here](https://www.draytronics.co.uk/f_daisy/draytronics_daisy_via_config.json) diff --git a/keyboards/draytronics/daisy/rules.mk b/keyboards/draytronics/daisy/rules.mk new file mode 100644 index 000000000..f826ee618 --- /dev/null +++ b/keyboards/draytronics/daisy/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega328p + +# Bootloader selection +BOOTLOADER = USBasp + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +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 +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Rotary encoder support diff --git a/keyboards/draytronics/scarlet/readme.md b/keyboards/draytronics/scarlet/readme.md index 4a548ec8d..a1ba2e330 100644 --- a/keyboards/draytronics/scarlet/readme.md +++ b/keyboards/draytronics/scarlet/readme.md @@ -2,11 +2,11 @@ ![scarlet](https://www.draytronics.co.uk/wp-content/uploads/2020/10/Scarlet-PCB-Compared-Combined.png) -A open source 17 key numpad keyboard, designed to be easily built at home with through hole components. More info / kits / PCB designs available at [draytronics.co.uk/scarlet](draytronics.co.uk) +A open source 17 key numpad keyboard, designed to be easily built at home with through hole components. More info / kits / PCB designs available at [draytronics.co.uk/scarlet](https://draytronics.co.uk) * Keyboard Maintainer: [Blake Drayson](https://github.com/ghostseven) * Hardware Supported: SCARLET PCB / ATMega32A -* Hardware Availability: [draytronics.co.uk](draytronics.co.uk) +* Hardware Availability: [draytronics.co.uk](https://draytronics.co.uk) Make example for this keyboard (after setting up your build environment):