diff --git a/keyboards/clueboard/66_hotswap/66_hotswap.h b/keyboards/clueboard/66_hotswap/66_hotswap.h index 2ec44fef2e..a1ea44841f 100644 --- a/keyboards/clueboard/66_hotswap/66_hotswap.h +++ b/keyboards/clueboard/66_hotswap/66_hotswap.h @@ -4,6 +4,6 @@ #include "gen1.h" #endif -#ifdef KEYBOARD_clueboard_66_hotswap_gen2 - #include "gen2.h" +#ifdef KEYBOARD_clueboard_66_hotswap_prototype + #include "prototype.h" #endif diff --git a/keyboards/clueboard/66_hotswap/gen2/boards/GENERIC_STM32_F303XC/board.c b/keyboards/clueboard/66_hotswap/gen1/boards/GENERIC_STM32_F303XC/board.c similarity index 100% rename from keyboards/clueboard/66_hotswap/gen2/boards/GENERIC_STM32_F303XC/board.c rename to keyboards/clueboard/66_hotswap/gen1/boards/GENERIC_STM32_F303XC/board.c diff --git a/keyboards/clueboard/66_hotswap/gen2/boards/GENERIC_STM32_F303XC/board.h b/keyboards/clueboard/66_hotswap/gen1/boards/GENERIC_STM32_F303XC/board.h similarity index 100% rename from keyboards/clueboard/66_hotswap/gen2/boards/GENERIC_STM32_F303XC/board.h rename to keyboards/clueboard/66_hotswap/gen1/boards/GENERIC_STM32_F303XC/board.h diff --git a/keyboards/clueboard/66_hotswap/gen2/boards/GENERIC_STM32_F303XC/board.mk b/keyboards/clueboard/66_hotswap/gen1/boards/GENERIC_STM32_F303XC/board.mk similarity index 100% rename from keyboards/clueboard/66_hotswap/gen2/boards/GENERIC_STM32_F303XC/board.mk rename to keyboards/clueboard/66_hotswap/gen1/boards/GENERIC_STM32_F303XC/board.mk diff --git a/keyboards/clueboard/66_hotswap/gen2/bootloader_defs.h b/keyboards/clueboard/66_hotswap/gen1/bootloader_defs.h similarity index 100% rename from keyboards/clueboard/66_hotswap/gen2/bootloader_defs.h rename to keyboards/clueboard/66_hotswap/gen1/bootloader_defs.h diff --git a/keyboards/clueboard/66_hotswap/gen2/chconf.h b/keyboards/clueboard/66_hotswap/gen1/chconf.h similarity index 100% rename from keyboards/clueboard/66_hotswap/gen2/chconf.h rename to keyboards/clueboard/66_hotswap/gen1/chconf.h diff --git a/keyboards/clueboard/66_hotswap/gen1/config.h b/keyboards/clueboard/66_hotswap/gen1/config.h index d5d36d4a1c..aa1dfe0c5d 100644 --- a/keyboards/clueboard/66_hotswap/gen1/config.h +++ b/keyboards/clueboard/66_hotswap/gen1/config.h @@ -1,44 +1,139 @@ +/* + * Copyright 2017 skully + * + * 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 PRODUCT_ID 0x2390 +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC1ED +#define PRODUCT_ID 0x2391 #define DEVICE_VER 0x0001 +#define MANUFACTURER Clueboard /* key matrix size */ #define MATRIX_ROWS 10 #define MATRIX_COLS 8 -/* ROWS: Top to bottom, COLS: Left to right +/* + * 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 { B2, C7, C6, B6, B5, B0, B3, D5, D3, D2 } -#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, E6, B1 } -#define UNUSED_PINS +#define MATRIX_ROW_PINS { B11, A6, A3, A2, A1, B5, B6, C15, C14, C13 } +#define MATRIX_COL_PINS { B10, B2, B1, B0, A7, B4, B3, B7 } +#define UNUSED_PINS { A0, A8, A15, B12, B13, B14, B15 } +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 6 -/* Speaker configuration +/* 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 + +/* + * 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 B7_AUDIO -#define NO_MUSIC_MODE -#define AUDIO_CLICKY +//#define FORCE_NKRO + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) -/* Backlight configuration +/* + * Feature disable options + * These options are also useful to firmware size reduction. */ -#define BACKLIGHT_LEVELS 1 -/* Underlight configuration +/* 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + + /* Backlight configuration */ -#define RGB_DI_PIN D7 -#define RGBLED_NUM 26 // Number of LEDs -#define RGBLIGHT_HUE_STEP 32 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 -#define RGBLIGHT_EFFECT_BREATHE_MAX 200 -#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 666*2 -#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4 // How many LEDs wide to light up -#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 16 // The led to start at -#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 8 // How many LEDs to travel -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up +#define BACKLIGHT_LEVELS 1 + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 0b1110100 AD <-> GND +// 0b1110111 AD <-> VCC +// 0b1110101 AD <-> SCL +// 0b1110110 AD <-> SDA +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110110 // Not actually used... + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 71 +#define DRIVER_2_LED_TOTAL 0 +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL diff --git a/keyboards/clueboard/66_hotswap/gen1/gen1.c b/keyboards/clueboard/66_hotswap/gen1/gen1.c index 01f74bc50b..6c8eca8813 100644 --- a/keyboards/clueboard/66_hotswap/gen1/gen1.c +++ b/keyboards/clueboard/66_hotswap/gen1/gen1.c @@ -1,63 +1,187 @@ +/* Copyright 2017 Clueboard + * + * 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 "gen1.h" -#include -#include "backlight.h" -#include "print.h" void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); - - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< + * + * 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 "quantum.h" +/* + * These are shortcuts to help you work with the various layout options. If your + * keymap works with one of the LAYOUT_...() macros you are encouraged to use that + * and to contribute your keymap to the corresponding layout in + * `qmk_firmware/layouts/community`. + */ + /* Clueboard matrix layout * ,-----------------------------------------------------------. ,---. - * | 00| 01| 02| 03| 04| 05| 06| 07| 50| 51| 52| 53| 54| 56| | 57| + * | 00| 01| 02| 03| 04| 05| 06| 07| 50| 51| 52| 53| 54| 56 | | 57| * |-----------------------------------------------------------| |---| * | 10| 11| 12| 13| 14| 15| 16| 17| 60| 61| 62| 63| 64| 65| | 67| * |-----------------------------------------------------------| `---' * | 20| 21| 22| 23| 24| 25| 26| 27| 70| 71| 72| 73| 75| - * |-------------------------------------------------------------. - * | 30| 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 85| 86| - * |-----------------------------------------------------------------. - * | 40| 41| 42| 45| 46| 90| 92| 93| 94| 95| 96| 97| - * `-----------------------------------------------------------------' + * |--------------------------------------------------------------. + * | 30 | 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 85 |86| + * |------------------------------------------------------------------. + * | 40| 41| 42| 45| 46| 90| 92| 93| 94| 95|96| 97| + * `------------------------------------------------------------------' * ,-----------------------------------------------------------. ,---. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins| * |-----------------------------------------------------------| |---| * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del| * |-----------------------------------------------------------| `---' * |Caps | A| S| D| F| G| H| J| k| L| ;| '|Enter | - * |-------------------------------------------------------------. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up | - * |-----------------------------------------------------------------. - * |Ctrl|Alt |Gui | Space| Space|Gui |Alt |Fn |Ctrl|Lft|Dwn|Rgt| - * `-----------------------------------------------------------------' + * |--------------------------------------------------------------. + * |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift| Up| + * |------------------------------------------------------------------. + * |Ctrl|Alt|Gui | Space| Space|Gui |Alt |Fn |Ctrl|Left|Down|Rgt| + * `------------------------------------------------------------------' */ // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array #define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \ - k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \ - k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \ - k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \ - k40, k41, k42, k45, k46, k90, k92, k93, k94, k95, k96, k97 \ + k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k55, k57, \ + k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \ + k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \ + k30, k31, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k84, k85, k86, \ + k40, k41, k42, k45, k46, k90, k92, k93, k94, k95, k96, k97 \ ) { \ - { k00, k01, k02, k03, k04, k05, k06, k07 }, \ - { k10, k11, k12, k13, k14, k15, k16, k17 }, \ - { k20, k21, k22, k23, k24, k25, k26, k27 }, \ - { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ - { k40, k41, k42, KC_NO, KC_NO, k45, k46, KC_NO }, \ - { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \ - { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ - { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ - { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ - { k90, KC_NO, k92, k93, k94, k95, k96, k97 } \ + { k00, k01, k02, k03, k04, k05, k06, k07 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27 }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ + { k40, k41, k42, KC_NO, KC_NO, k45, k46, KC_NO }, \ + { k50, k51, k52, k53, k54, k55, KC_NO, k57 }, \ + { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ + { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ + { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ + { k90, KC_NO, k92, k93, k94, k95, k96, k97 } \ } #define LAYOUT_66_ansi( \ - k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \ - k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \ - k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \ - k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \ - k40, k41, k42, k46, k92, k93, k94, k95, k96, k97 \ + k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k55, k57, \ + k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \ + k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \ + k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \ + k40, k41, k42, k46, k92, k93, k94, k95, k96, k97 \ ) { \ - { k00, k01, k02, k03, k04, k05, k06, k07 }, \ - { k10, k11, k12, k13, k14, k15, k16, k17 }, \ - { k20, k21, k22, k23, k24, k25, k26, k27 }, \ - { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ - { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \ - { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \ - { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ - { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ - { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ - { KC_NO, KC_NO, k92, k93, k94, k95, k96, k97 } \ + { k00, k01, k02, k03, k04, k05, k06, k07 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27 }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ + { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \ + { k50, k51, k52, k53, k54, k55, KC_NO, k57 }, \ + { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ + { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ + { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ + { KC_NO, KC_NO, k92, k93, k94, k95, k96, k97 } \ } diff --git a/keyboards/clueboard/66_hotswap/gen2/halconf.h b/keyboards/clueboard/66_hotswap/gen1/halconf.h similarity index 99% rename from keyboards/clueboard/66_hotswap/gen2/halconf.h rename to keyboards/clueboard/66_hotswap/gen1/halconf.h index e617fdffc7..eda293c49b 100644 --- a/keyboards/clueboard/66_hotswap/gen2/halconf.h +++ b/keyboards/clueboard/66_hotswap/gen1/halconf.h @@ -76,7 +76,7 @@ * @brief Enables the I2C subsystem. */ #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE +#define HAL_USE_I2C TRUE #endif /** diff --git a/keyboards/clueboard/66_hotswap/gen2/info.json b/keyboards/clueboard/66_hotswap/gen1/info.json similarity index 100% rename from keyboards/clueboard/66_hotswap/gen2/info.json rename to keyboards/clueboard/66_hotswap/gen1/info.json diff --git a/keyboards/clueboard/66_hotswap/gen2/led.c b/keyboards/clueboard/66_hotswap/gen1/led.c similarity index 100% rename from keyboards/clueboard/66_hotswap/gen2/led.c rename to keyboards/clueboard/66_hotswap/gen1/led.c diff --git a/keyboards/clueboard/66_hotswap/gen2/matrix.c b/keyboards/clueboard/66_hotswap/gen1/matrix.c similarity index 99% rename from keyboards/clueboard/66_hotswap/gen2/matrix.c rename to keyboards/clueboard/66_hotswap/gen1/matrix.c index 21b50e9ec8..c3e59b5646 100644 --- a/keyboards/clueboard/66_hotswap/gen2/matrix.c +++ b/keyboards/clueboard/66_hotswap/gen1/matrix.c @@ -140,7 +140,7 @@ bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & (1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +# LED Configuration +#RGB_MATRIX_ENABLE = IS31FL3731 # Build Options # comment out to disable the options. # -BACKLIGHT_ENABLE = yes -BOOTMAGIC_ENABLE = no -MOUSEKEY_ENABLE = no -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = yes -COMMAND_ENABLE = no -NKRO_ENABLE = yes +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +#CUSTOM_MATRIX = yes # Custom matrix file AUDIO_ENABLE = yes -RGBLIGHT_ENABLE = yes -MIDI_ENABLE = no -UNICODE_ENABLE = no -BLUETOOTH_ENABLE = no +# SERIAL_LINK_ENABLE = yes diff --git a/keyboards/clueboard/66_hotswap/gen2/config.h b/keyboards/clueboard/66_hotswap/gen2/config.h deleted file mode 100644 index 0ec8fa9cd8..0000000000 --- a/keyboards/clueboard/66_hotswap/gen2/config.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2017 skully - * - * 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 . - */ - -#ifndef CONFIG_H -#define CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xC1ED -#define PRODUCT_ID 0x2391 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Clueboard - -/* key matrix size */ -#define MATRIX_ROWS 10 -#define MATRIX_COLS 8 - -/* - * 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) - * -*/ -/* Note: These are not used for arm boards. They're here purely as documentation. - * #define MATRIX_ROW_PINS { PB11, PA6, PA3, PA2, PA1, PB5, PB6, PC15, PC14, PC13 } - * #define MATRIX_COL_PINS { PB10, PB2, PB1, PB0, PA7, PB4, PB3, PB7 } - * #define UNUSED_PINS { A0, A8, A15, B12, B13, B14, B15 } - */ - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 6 - -/* Prevent modifiers from being stuck on after layer changes. */ -#define PREVENT_STUCK_MODIFIERS - -/* 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 - -/* - * 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 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* - * 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 -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif - - /* Backlight configuration - */ -#define BACKLIGHT_LEVELS 1 diff --git a/keyboards/clueboard/66_hotswap/gen2/gen2.c b/keyboards/clueboard/66_hotswap/gen2/gen2.c deleted file mode 100644 index db385e2c07..0000000000 --- a/keyboards/clueboard/66_hotswap/gen2/gen2.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2017 Clueboard - * - * 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 "gen2.h" - -void matrix_init_kb(void) { -} - -void matrix_scan_kb(void) { -} diff --git a/keyboards/clueboard/66_hotswap/gen2/rules.mk b/keyboards/clueboard/66_hotswap/gen2/rules.mk deleted file mode 100644 index 9861d05e61..0000000000 --- a/keyboards/clueboard/66_hotswap/gen2/rules.mk +++ /dev/null @@ -1,56 +0,0 @@ -# project specific files -SRC = matrix.c \ - led.c -LAYOUTS += 66_ansi - -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F3xx - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -MCU_LDSCRIPT = STM32F303xC - -# Startup code to use -# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f3xx - -# Board: it should exist either in /os/hal/boards/ -# or /boards -BOARD = GENERIC_STM32_F303XC - -# Cortex version -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -ARMV = 7 - -USE_FPU = yes - -# Vector table for application -# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ -# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB -# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 -OPT_DEFS = - -# Options to pass to dfu-util when flashing -DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave - -# Build Options -# comment out to disable the options. -# -BACKLIGHT_ENABLE = no -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover -CUSTOM_MATRIX = yes # Custom matrix file -AUDIO_ENABLE = yes -# SERIAL_LINK_ENABLE = yes diff --git a/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c b/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c index 94f2ec0c40..920742c618 100644 --- a/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c +++ b/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c @@ -6,6 +6,30 @@ #define _FL 1 #define _CL 2 +enum custom_keycodes { + S_BSKTC = SAFE_RANGE, + S_ODEJY, + S_RCKBY, + S_DOEDR, + S_SCALE, + S_ONEUP, + S_COIN, + S_SONIC, + S_ZELDA +}; + +#ifdef AUDIO_ENABLE + float song_basketcase[][2] = SONG(BASKET_CASE); + float song_ode_to_joy[][2] = SONG(ODE_TO_JOY); + float song_rock_a_bye_baby[][2] = SONG(ROCK_A_BYE_BABY); + float song_doe_a_deer[][2] = SONG(DOE_A_DEER); + float song_scale[][2] = SONG(MUSIC_SCALE_SOUND); + float song_coin[][2] = SONG(COIN_SOUND); + float song_one_up[][2] = SONG(ONE_UP_SOUND); + float song_sonic_ring[][2] = SONG(SONIC_RING); + float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE); +#endif + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: Base Layer (Default Layer) */ @@ -34,3 +58,64 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \ _______,_______,_______, RGB_MOD,RGB_MOD, _______,_______,MO(_FL),_______,RGB_HUD,RGB_SAD,RGB_HUI), }; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case S_BSKTC: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_basketcase); + } + return false; + case S_ODEJY: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_ode_to_joy); + } + return false; + case S_RCKBY: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_rock_a_bye_baby); + } + return false; + case S_DOEDR: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_doe_a_deer); + } + return false; + case S_SCALE: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_scale); + } + return false; + case S_ONEUP: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_one_up); + } + return false; + case S_COIN: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_coin); + } + return false; + case S_SONIC: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_sonic_ring); + } + return false; + case S_ZELDA: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_zelda_puzzle); + } + return false; + } + return true; +} diff --git a/keyboards/clueboard/66_hotswap/prototype/config.h b/keyboards/clueboard/66_hotswap/prototype/config.h new file mode 100644 index 0000000000..14188634b3 --- /dev/null +++ b/keyboards/clueboard/66_hotswap/prototype/config.h @@ -0,0 +1,51 @@ +#pragma once +#include "config_common.h" + +#define PRODUCT_ID 0x2390 +#define DEVICE_VER 0x0001 + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +// ROWS: Top to bottom, COLS: Left to right +/* Row pin configuration +* row: 0 1 2 3 4 5 6 7 8 9 +* pin: B2 C7 C6 B6 B5 B0 B3 D5 D3 D2 +*/ + +#define MATRIX_ROW_PINS { B2, C7, C6, B6, B5, B0, B3, D5, D3, D2 } +/* Column pin configuration + * col: 0 1 2 3 4 5 6 7 + * pin: F0 F1 F4 F5 F6 F7 E6 B1 + */ +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, E6, B1 } +#define UNUSED_PINS + +/* Speaker configuration + */ +#define B7_AUDIO +#define NO_MUSIC_MODE +#define AUDIO_CLICKY + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 1 + +/* Underlight configuration + */ +#define RGB_DI_PIN D7 +#define RGBLED_NUM 26 // Number of LEDs +#define RGBLIGHT_HUE_STEP 32 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +#define RGBLIGHT_EFFECT_BREATHE_MAX 200 +#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 666*2 +#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4 // How many LEDs wide to light up +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 16 // The led to start at +#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 8 // How many LEDs to travel +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up diff --git a/keyboards/clueboard/66_hotswap/prototype/prototype.c b/keyboards/clueboard/66_hotswap/prototype/prototype.c new file mode 100644 index 0000000000..991d4b8fae --- /dev/null +++ b/keyboards/clueboard/66_hotswap/prototype/prototype.c @@ -0,0 +1,63 @@ +#include "prototype.h" +#include +#include "backlight.h" +#include "print.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); + + // JTAG disable for PORT F. write JTD bit twice within four cycles. + MCUCR |= (1< - * - * 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 "quantum.h" -/* - * These are shortcuts to help you work with the various layout options. If your - * keymap works with one of the LAYOUT_...() macros you are encouraged to use that - * and to contribute your keymap to the corresponding layout in - * `qmk_firmware/layouts/community`. - */ - /* Clueboard matrix layout * ,-----------------------------------------------------------. ,---. * | 00| 01| 02| 03| 04| 05| 06| 07| 50| 51| 52| 53| 54| 56 | | 57| * |-----------------------------------------------------------| |---| * | 10| 11| 12| 13| 14| 15| 16| 17| 60| 61| 62| 63| 64| 65| | 67| * |-----------------------------------------------------------| `---' - * | 20| 21| 22| 23| 24| 25| 26| 27| 70| 71| 72| 73| 75| - * |--------------------------------------------------------------. - * | 30 | 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 85 |86| + * | 20| 21| 22| 23| 24| 25| 26| 27| 70| 71| 72| 73| 74| 75| + * |------------------------------------------------------------. + * | 30| 31| 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 84| 85|86| * |------------------------------------------------------------------. - * | 40| 41| 42| 45| 46| 90| 92| 93| 94| 95|96| 97| + * | 40| 41| 42| 43| 45| 46| 90| 92| 93| 94| 95| 96| 97| * `------------------------------------------------------------------' * ,-----------------------------------------------------------. ,---. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins| @@ -42,7 +20,7 @@ * |-----------------------------------------------------------| `---' * |Caps | A| S| D| F| G| H| J| k| L| ;| '|Enter | * |--------------------------------------------------------------. - * |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift| Up| + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /| \|Shift| Up| * |------------------------------------------------------------------. * |Ctrl|Alt|Gui | Space| Space|Gui |Alt |Fn |Ctrl|Left|Down|Rgt| * `------------------------------------------------------------------' @@ -60,12 +38,12 @@ { k00, k01, k02, k03, k04, k05, k06, k07 }, \ { k10, k11, k12, k13, k14, k15, k16, k17 }, \ { k20, k21, k22, k23, k24, k25, k26, k27 }, \ - { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37 }, \ { k40, k41, k42, KC_NO, KC_NO, k45, k46, KC_NO }, \ { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \ { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ - { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ + { k80, k81, k82, k83, k84, k85, k86, KC_NO }, \ { k90, KC_NO, k92, k93, k94, k95, k96, k97 } \ } diff --git a/keyboards/clueboard/66_hotswap/prototype/rules.mk b/keyboards/clueboard/66_hotswap/prototype/rules.mk new file mode 100644 index 0000000000..887592b373 --- /dev/null +++ b/keyboards/clueboard/66_hotswap/prototype/rules.mk @@ -0,0 +1,24 @@ +EXTRAFLAGS += -flto +LAYOUTS = 66_ansi +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = yes +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = no +NKRO_ENABLE = yes +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = yes +MIDI_ENABLE = no +UNICODE_ENABLE = no +BLUETOOTH_ENABLE = no