From cd22c5cfe0e5ce0634d737ebc379f20d527b3c85 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Tue, 28 Jun 2022 13:48:44 -0400 Subject: [PATCH 01/25] Initial config for matrix.c and keymap in sugar.h --- keyboards/mechwild/sugar/matrix.c | 169 ++++++++++++++++++++++++++++++ keyboards/mechwild/sugar/sugar.h | 46 ++++++++ 2 files changed, 215 insertions(+) create mode 100644 keyboards/mechwild/sugar/matrix.c create mode 100644 keyboards/mechwild/sugar/sugar.h diff --git a/keyboards/mechwild/sugar/matrix.c b/keyboards/mechwild/sugar/matrix.c new file mode 100644 index 000000000000..f845be670d49 --- /dev/null +++ b/keyboards/mechwild/sugar/matrix.c @@ -0,0 +1,169 @@ +#include QMK_KEYBOARD_H +#include "i2c_master.h" + +extern i2c_status_t mcp23018_status; +#define I2C_TIMEOUT 1000 + +// For a better understanding of the i2c protocol, this is a good read: +// https://www.robot-electronics.co.uk/i2c-tutorial + +// I2C address: +// http://ww1.microchip.com/downloads/en/devicedoc/22103a.pdf +// All address pins of the mcp23018 are connected to the ground +// | 0 | 1 | 0 | 0 | A2 | A1 | A0 | +// | 0 | 1 | 0 | 0 | 0 | 0 | 0 | +#define I2C_ADDR 0b0100000 +#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE) +#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ) + +// Register addresses with IOCON.BANK = 0 +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +#define ROW_POS { 0b01000000, 0b10000000, 0b01000000, 0b10000000, 0b00000100, 0b00010000, 0b00100000, 0b00000010, 0b00001000 } + +bool i2c_initialized = 0; +i2c_status_t mcp23018_status = I2C_ADDR; + +uint8_t init_mcp23018(void) { + print("starting init"); + mcp23018_status = I2C_ADDR; + + // I2C subsystem + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized = true; + wait_ms(I2C_TIMEOUT); + } + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + // This means: We are reading GPIOB 0-5 + // This means: we will write to GPIOA 0-7 and GPIOB 6&7 (in select_rows) + uint8_t buf[] = {IODIRA, 0b00000000, 0b00111111}; + mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, buf, sizeof(buf), I2C_TIMEOUT); + if (!mcp23018_status) { + // set pull-up + // - unused : on : 1 + // - input : on : 1 + // - driving : off : 0 + // This means: we will read all the bits on GPIOA + // This means: we will write to the pins 0-4 on GPIOB (in select_rows) + uint8_t pullup_buf[] = {GPPUA, 0b00000000, 0b00111111}; + mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, pullup_buf, sizeof(pullup_buf), I2C_TIMEOUT); + } + return mcp23018_status; +} + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; // debounced values + +static matrix_row_t read_cols(void); +static void select_row(uint8_t row); + +static uint8_t mcp23018_reset_loop; + +void matrix_init_custom(void) { + // initialize row and col + mcp23018_status = init_mcp23018(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } +} + + +void matrix_power_up(void) { + // initialize row and col + mcp23018_status = init_mcp23018(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } +} + + +// Reads and stores a row, returning +// whether a change occurred. +static inline bool store_matrix_row(matrix_row_t current_matrix[], uint8_t index) { + matrix_row_t temp = read_cols(index); + if (current_matrix[index] != temp) { + current_matrix[index] = temp; + return true; + } + return false; +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + dprint("Trying to reset MCP23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + dprint("MCP23018 Not responding\n"); + } else { + dprint("MCP23018 Attached\n"); + } + } + } + + bool changed = false; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + + changed |= store_matrix_row(current_matrix, i); + + } + + return changed; +} + + +static matrix_row_t read_cols(void) { + if (mcp23018_status) { // if there was an error + return 0; + } else { + uint8_t buf[] = {GPIOB}; + mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, buf, sizeof(buf), I2C_TIMEOUT); + // We read all the pins on GPIOB. + // The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero. + // The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys. + uint8_t data[] = {0}; + if (!mcp23018_status) { + mcp23018_status = i2c_receive(I2C_ADDR_READ, data, sizeof(data), I2C_TIMEOUT); + // takes the resulting data and sets the two rows in this buffer to 1 to + // ensure they don't get read as low cols if they are currently selected + data[0] |= 0b00000011 + // Since the pins connected to eact columns are sequential, and counting from zero up (col 0 -> GPIOB0...col 5 -> GPIOB5), the only transformation needed is a bitwise not to swap all zeroes and ones. + data[0] = ~(data[0]); + } + return data[0]; + } +} + + +static void select_row(uint8_t row) { + // select on mcp23017 + uint8_t row_pos[MATRIX_ROWS] = ROW_POS + if (mcp23018_status) { // if there was an error + // do nothing + } else { + // Select the desired row by writing a byte for the entire GPIOA bus where only the bit representing the row we want to select is a zero (write instruction) and every other bit is a one. + if (row > 1) { + uint8_t buf[] = {GPIOA, 0xFF & ~(row_pos[row])}; + } else { + uint8_t buf[] = {GPIOB, 0xFF & ~(row_pos[row])}; + } + mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, buf, sizeof(buf), I2C_TIMEOUT); + } +} diff --git a/keyboards/mechwild/sugar/sugar.h b/keyboards/mechwild/sugar/sugar.h new file mode 100644 index 000000000000..44c342fef60c --- /dev/null +++ b/keyboards/mechwild/sugar/sugar.h @@ -0,0 +1,46 @@ +/* Copyright 2022 Kyle McCreery + * + * 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" + +#define ___ KC_NO + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ +k00, k01, k02, k03, k04, k05, sw1, k06, k07, k08, k09, k0A, k0B, \ +k10, k11, k12, k13, k14, k15, sw5, sw2, k16, k17, k18, k19, k1A, k1B, \ +k20, k21, k22, k23, k24, k25, sw3, k26, k27, k28, k29, k2A, k2B, \ + sw4, k30, k31, k32, k33, k34, k35, k36, k37, k38, sw6 \ +) { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { sw4, k30, k31, k32, k33, ___ }, \ + { k06, k07, k08, k09, k0A, k0B }, \ + { k16, k17, k18, k19, k1A, k1B }, \ + { k26, k27, k28, k29, k2A, k2B }, \ + { k34, k35, k36, k37, k38, sw6 }, \ + { sw1, sw2, sw3, ___, ___, sw5 } \ +} From 441a850bd652218e772b4175a79510af77f959ab Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Sat, 2 Jul 2022 19:50:27 -0400 Subject: [PATCH 02/25] Initial matrix working with base firmware, no functionality outside of matrix currently. --- keyboards/mechwild/sugar/matrix.c | 169 ------------------ keyboards/mechwild/sugarglider/config.h | 24 +++ keyboards/mechwild/sugarglider/halconf.h | 9 + keyboards/mechwild/sugarglider/info.json | 27 +++ .../sugarglider/keymaps/default/keymap.c | 116 ++++++++++++ keyboards/mechwild/sugarglider/matrix.c | 91 ++++++++++ keyboards/mechwild/sugarglider/mcuconf.h | 9 + keyboards/mechwild/sugarglider/readme.md | 27 +++ keyboards/mechwild/sugarglider/rules.mk | 27 +++ keyboards/mechwild/sugarglider/sugarglider.c | 20 +++ .../sugar.h => sugarglider/sugarglider.h} | 17 +- 11 files changed, 352 insertions(+), 184 deletions(-) delete mode 100644 keyboards/mechwild/sugar/matrix.c create mode 100644 keyboards/mechwild/sugarglider/config.h create mode 100644 keyboards/mechwild/sugarglider/halconf.h create mode 100644 keyboards/mechwild/sugarglider/info.json create mode 100644 keyboards/mechwild/sugarglider/keymaps/default/keymap.c create mode 100644 keyboards/mechwild/sugarglider/matrix.c create mode 100644 keyboards/mechwild/sugarglider/mcuconf.h create mode 100644 keyboards/mechwild/sugarglider/readme.md create mode 100644 keyboards/mechwild/sugarglider/rules.mk create mode 100644 keyboards/mechwild/sugarglider/sugarglider.c rename keyboards/mechwild/{sugar/sugar.h => sugarglider/sugarglider.h} (60%) diff --git a/keyboards/mechwild/sugar/matrix.c b/keyboards/mechwild/sugar/matrix.c deleted file mode 100644 index f845be670d49..000000000000 --- a/keyboards/mechwild/sugar/matrix.c +++ /dev/null @@ -1,169 +0,0 @@ -#include QMK_KEYBOARD_H -#include "i2c_master.h" - -extern i2c_status_t mcp23018_status; -#define I2C_TIMEOUT 1000 - -// For a better understanding of the i2c protocol, this is a good read: -// https://www.robot-electronics.co.uk/i2c-tutorial - -// I2C address: -// http://ww1.microchip.com/downloads/en/devicedoc/22103a.pdf -// All address pins of the mcp23018 are connected to the ground -// | 0 | 1 | 0 | 0 | A2 | A1 | A0 | -// | 0 | 1 | 0 | 0 | 0 | 0 | 0 | -#define I2C_ADDR 0b0100000 -#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE) -#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ) - -// Register addresses with IOCON.BANK = 0 -#define IODIRA 0x00 // i/o direction register -#define IODIRB 0x01 -#define GPPUA 0x0C // GPIO pull-up resistor register -#define GPPUB 0x0D -#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) -#define GPIOB 0x13 -#define OLATA 0x14 // output latch register -#define OLATB 0x15 - -#define ROW_POS { 0b01000000, 0b10000000, 0b01000000, 0b10000000, 0b00000100, 0b00010000, 0b00100000, 0b00000010, 0b00001000 } - -bool i2c_initialized = 0; -i2c_status_t mcp23018_status = I2C_ADDR; - -uint8_t init_mcp23018(void) { - print("starting init"); - mcp23018_status = I2C_ADDR; - - // I2C subsystem - if (i2c_initialized == 0) { - i2c_init(); // on pins D(1,0) - i2c_initialized = true; - wait_ms(I2C_TIMEOUT); - } - - // set pin direction - // - unused : input : 1 - // - input : input : 1 - // - driving : output : 0 - // This means: We are reading GPIOB 0-5 - // This means: we will write to GPIOA 0-7 and GPIOB 6&7 (in select_rows) - uint8_t buf[] = {IODIRA, 0b00000000, 0b00111111}; - mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, buf, sizeof(buf), I2C_TIMEOUT); - if (!mcp23018_status) { - // set pull-up - // - unused : on : 1 - // - input : on : 1 - // - driving : off : 0 - // This means: we will read all the bits on GPIOA - // This means: we will write to the pins 0-4 on GPIOB (in select_rows) - uint8_t pullup_buf[] = {GPPUA, 0b00000000, 0b00111111}; - mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, pullup_buf, sizeof(pullup_buf), I2C_TIMEOUT); - } - return mcp23018_status; -} - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; // debounced values - -static matrix_row_t read_cols(void); -static void select_row(uint8_t row); - -static uint8_t mcp23018_reset_loop; - -void matrix_init_custom(void) { - // initialize row and col - mcp23018_status = init_mcp23018(); - - // initialize matrix state: all keys off - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - } -} - - -void matrix_power_up(void) { - // initialize row and col - mcp23018_status = init_mcp23018(); - - // initialize matrix state: all keys off - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - } -} - - -// Reads and stores a row, returning -// whether a change occurred. -static inline bool store_matrix_row(matrix_row_t current_matrix[], uint8_t index) { - matrix_row_t temp = read_cols(index); - if (current_matrix[index] != temp) { - current_matrix[index] = temp; - return true; - } - return false; -} - -bool matrix_scan_custom(matrix_row_t current_matrix[]) { - if (mcp23018_status) { // if there was an error - if (++mcp23018_reset_loop == 0) { - dprint("Trying to reset MCP23018\n"); - mcp23018_status = init_mcp23018(); - if (mcp23018_status) { - dprint("MCP23018 Not responding\n"); - } else { - dprint("MCP23018 Attached\n"); - } - } - } - - bool changed = false; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - - changed |= store_matrix_row(current_matrix, i); - - } - - return changed; -} - - -static matrix_row_t read_cols(void) { - if (mcp23018_status) { // if there was an error - return 0; - } else { - uint8_t buf[] = {GPIOB}; - mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, buf, sizeof(buf), I2C_TIMEOUT); - // We read all the pins on GPIOB. - // The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero. - // The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys. - uint8_t data[] = {0}; - if (!mcp23018_status) { - mcp23018_status = i2c_receive(I2C_ADDR_READ, data, sizeof(data), I2C_TIMEOUT); - // takes the resulting data and sets the two rows in this buffer to 1 to - // ensure they don't get read as low cols if they are currently selected - data[0] |= 0b00000011 - // Since the pins connected to eact columns are sequential, and counting from zero up (col 0 -> GPIOB0...col 5 -> GPIOB5), the only transformation needed is a bitwise not to swap all zeroes and ones. - data[0] = ~(data[0]); - } - return data[0]; - } -} - - -static void select_row(uint8_t row) { - // select on mcp23017 - uint8_t row_pos[MATRIX_ROWS] = ROW_POS - if (mcp23018_status) { // if there was an error - // do nothing - } else { - // Select the desired row by writing a byte for the entire GPIOA bus where only the bit representing the row we want to select is a zero (write instruction) and every other bit is a one. - if (row > 1) { - uint8_t buf[] = {GPIOA, 0xFF & ~(row_pos[row])}; - } else { - uint8_t buf[] = {GPIOB, 0xFF & ~(row_pos[row])}; - } - mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, buf, sizeof(buf), I2C_TIMEOUT); - } -} diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h new file mode 100644 index 000000000000..0eebe682f3fe --- /dev/null +++ b/keyboards/mechwild/sugarglider/config.h @@ -0,0 +1,24 @@ +// Copyright 2022 Kyle McCreery +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6D77 // mw = "MechWild" +#define PRODUCT_ID 0x1710 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MechWild +#define PRODUCT SugarGlider + +/* Matrix COL and ROW definitions */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 6 + + +/* status light pins */ +#define LED_NUM_LOCK_PIN B12 +#define LED_CAPS_LOCK_PIN B13 +#define LED_SCROLL_LOCK_PIN B14 +#define LED_PIN_ON_STATE 0 \ No newline at end of file diff --git a/keyboards/mechwild/sugarglider/halconf.h b/keyboards/mechwild/sugarglider/halconf.h new file mode 100644 index 000000000000..b4299dc58ff6 --- /dev/null +++ b/keyboards/mechwild/sugarglider/halconf.h @@ -0,0 +1,9 @@ +// Copyright 2022 Kyle McCreery +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define HAL_USE_I2C TRUE + +#include_next + diff --git a/keyboards/mechwild/sugarglider/info.json b/keyboards/mechwild/sugarglider/info.json new file mode 100644 index 000000000000..07f7680d9168 --- /dev/null +++ b/keyboards/mechwild/sugarglider/info.json @@ -0,0 +1,27 @@ +{ + "manufacturer": "Kyle McCreery", + "keyboard_name": "mechwild/sugarglider", + "maintainer": "kylemccreery", + "layouts": { + "LAYOUT_ortho_4x4": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1, "y": 0 }, + { "matrix": [0, 2], "x": 2, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1, "y": 1 }, + { "matrix": [1, 2], "x": 2, "y": 1 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1, "y": 2 }, + { "matrix": [2, 2], "x": 2, "y": 2 }, + { "matrix": [2, 3], "x": 3, "y": 2 }, + { "matrix": [3, 0], "x": 0, "y": 3 }, + { "matrix": [3, 1], "x": 1, "y": 3 }, + { "matrix": [3, 2], "x": 2, "y": 3 }, + { "matrix": [3, 3], "x": 3, "y": 3 } + ] + } + } +} \ No newline at end of file diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c new file mode 100644 index 000000000000..3c8bb315c401 --- /dev/null +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -0,0 +1,116 @@ +// Copyright 2022 Kyle McCreery +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +// Defines names for use in layer keycodes and the keymap + +void keyboard_post_init_user(void) { + // Customise these values to desired behaviour + //debug_enable=true; + //debug_matrix=true; + //debug_keyboard=true; + //debug_mouse=true; +} + + +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +/* +k00, k01, k02, k03, k04, k05, k30, k31, k32, k33, k34, k35, \ +k10, k11, k12, k13, k14, k15, k40, k41, k42, k43, k44, k45, \ +k20, k21, k22, k23, k24, k25, k50, k51, k52, k53, k54, k55, \ + k63, k64, k65, k60, k61, k62 \ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ENT, KC_H, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_H, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GESC, KC_H, KC_RGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_H, KC_LCTL, KC_LALT, MO(_LOWER), KC_H, KC_H, KC_H, MO(_RAISE), KC_SPC, KC_RSFT, KC_H + ), + + [_LOWER] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_TRNS, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [_RAISE] = LAYOUT( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_TRNS, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, TG(_QWERTY), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_RMOD, RGB_TOG, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_MOD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + + +#ifdef OLED_DRIVER_ENABLE + oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_90; // flips the display 90 degrees + } + + static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; + static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; + static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; + static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; + oled_set_cursor(0,0); + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); + } + + void oled_task_user(void) { + render_logo(); + oled_set_cursor(0,6); + + oled_write_ln_P(PSTR("Layer"), false); + + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_ln_P(PSTR("BASE"), false); + break; + case _LOWER: + oled_write_ln_P(PSTR("Lower"), false); + break; + case _RAISE: + oled_write_ln_P(PSTR("Raise"), false); + break; + case _ADJUST: + oled_write_ln_P(PSTR("Adjst"), false); + break; + default: + oled_write_ln_P(PSTR("Undef"), false); + } + oled_write_ln_P(PSTR(""), false); + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + } +#endif diff --git a/keyboards/mechwild/sugarglider/matrix.c b/keyboards/mechwild/sugarglider/matrix.c new file mode 100644 index 000000000000..796ba8967629 --- /dev/null +++ b/keyboards/mechwild/sugarglider/matrix.c @@ -0,0 +1,91 @@ +// Copyright 2022 Kyle McCreery +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "matrix.h" +#include "mcp23018.h" +#include "wait.h" +#include "debug.h" + +#define I2C_ADDR 0x20 +#define ROW_POS { 0b01000000, 0b10000000, 0b01000000, 0b10000000, 0b00000100, 0b00010000, 0b00100000, 0b00000010, 0b00001000 } + +static uint8_t mcp23018_errors = 0; + +static void mcp23018_init_cols(void) { + mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTA, ALL_INPUT); + mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTB, ALL_INPUT); +} + +static void mcp23018_scan(void) { + if (!mcp23018_errors) { + return; + } + + static uint16_t mcp23018_reset_loop = 0; + if (++mcp23018_reset_loop > 0x1FFF) { + // tuned to about 5s given the current scan rate + dprintf("trying to reset mcp23018\n"); + mcp23018_reset_loop = 0; + mcp23018_errors = 0; + mcp23018_init_cols(); + } +} + +static matrix_row_t read_cols(void) { + if (mcp23018_errors) { + return 0; + } + + uint8_t ret = 0xFF; // sets all to 1 + mcp23018_errors += !mcp23018_readPins(I2C_ADDR, mcp23018_PORTB, &ret); // will update with values 0 = pulled down by connection, 1 = pulled up by pullup resistors + + return (~ret) & 0b00111111; // Clears out the two row bits in the B buffer. +} + +static void select_row(uint8_t row) { + uint8_t row_pos[MATRIX_ROWS] = ROW_POS; + if (mcp23018_errors) { + // wait to mimic i2c interactions + wait_us(100); + return; + } + + if (row > 1) { + mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTB, ALL_INPUT); + mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTA, ~(row_pos[row])); + } else { + mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTA, ALL_INPUT); + mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTB, ~(row_pos[row])); + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selection to stabilize + select_row(current_row); + // Skip the wait_us(30); as i2c is slow enough to debounce the io changes + + current_matrix[current_row] = read_cols(); + + return (last_row_value != current_matrix[current_row]); +} + +void matrix_init_custom(void) { + mcp23018_init(I2C_ADDR); + mcp23018_init_cols(); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + mcp23018_scan(); + + bool changed = false; + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + changed |= read_cols_on_row(current_matrix, current_row); + } + return changed; +} diff --git a/keyboards/mechwild/sugarglider/mcuconf.h b/keyboards/mechwild/sugarglider/mcuconf.h new file mode 100644 index 000000000000..a9caeadf6db1 --- /dev/null +++ b/keyboards/mechwild/sugarglider/mcuconf.h @@ -0,0 +1,9 @@ +// Copyright 2022 Kyle McCreery +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE diff --git a/keyboards/mechwild/sugarglider/readme.md b/keyboards/mechwild/sugarglider/readme.md new file mode 100644 index 000000000000..623295bbf8f1 --- /dev/null +++ b/keyboards/mechwild/sugarglider/readme.md @@ -0,0 +1,27 @@ +# mechwild/sugarglider + +![mechwild/sugarglider](imgur.com image replace me!) + +*A short description of the keyboard/project* + +* Keyboard Maintainer: [Kyle McCreery](https://github.com/kylemccreery) +* Hardware Supported: *The PCBs, controllers supported* +* Hardware Availability: *Links to where you can find this hardware* + +Make example for this keyboard (after setting up your build environment): + + make mechwild/sugarglider:default + +Flashing example for this keyboard: + + make mechwild/sugarglider: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). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/mechwild/sugarglider/rules.mk b/keyboards/mechwild/sugarglider/rules.mk new file mode 100644 index 000000000000..0123a85b9377 --- /dev/null +++ b/keyboards/mechwild/sugarglider/rules.mk @@ -0,0 +1,27 @@ +# MCU name +MCU = STM32F401 +BOARD = BLACKPILL_STM32_F401 + +# Bootloader selection +BOOTLOADER = stm32-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = no # Encoder Enabled + +# custom matrix setup +CUSTOM_MATRIX = lite + +VPATH += drivers/gpio +SRC += mcp23018.c matrix.c +QUANTUM_LIB_SRC += i2c_master.c diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c new file mode 100644 index 000000000000..bf2cd744f96d --- /dev/null +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -0,0 +1,20 @@ +// Copyright 2022 Kyle McCreery +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "sugarglider.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + switch (index) { + case 0: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + } + return true; +} +#endif diff --git a/keyboards/mechwild/sugar/sugar.h b/keyboards/mechwild/sugarglider/sugarglider.h similarity index 60% rename from keyboards/mechwild/sugar/sugar.h rename to keyboards/mechwild/sugarglider/sugarglider.h index 44c342fef60c..bc6c95343b9e 100644 --- a/keyboards/mechwild/sugar/sugar.h +++ b/keyboards/mechwild/sugarglider/sugarglider.h @@ -1,18 +1,5 @@ -/* Copyright 2022 Kyle McCreery - * - * 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 . - */ +// Copyright 2022 Kyle McCreery +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once From 4018ca76c74a5be511f6fd7eb121b95283c114c7 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Mon, 4 Jul 2022 23:35:59 -0400 Subject: [PATCH 03/25] keeping puckbuddy here until finished the sugarglider code --- keyboards/mechwild/puckbuddy/config.h | 159 +++++++++ keyboards/mechwild/puckbuddy/glcdfont.c | 231 +++++++++++++ keyboards/mechwild/puckbuddy/halconf.h | 13 + keyboards/mechwild/puckbuddy/info.json | 25 ++ .../puckbuddy/keymaps/default/keymap.c | 60 ++++ .../mechwild/puckbuddy/keymaps/via/keymap.c | 60 ++++ .../mechwild/puckbuddy/keymaps/via/rules.mk | 1 + .../mechwild/puckbuddy/ld/STM32F401xE.ld | 88 +++++ keyboards/mechwild/puckbuddy/mcuconf.h | 12 + keyboards/mechwild/puckbuddy/post_rules.mk | 7 + keyboards/mechwild/puckbuddy/puckbuddy.c | 307 +++++++++++++++++ keyboards/mechwild/puckbuddy/puckbuddy.h | 55 +++ keyboards/mechwild/puckbuddy/readme.md | 27 ++ keyboards/mechwild/puckbuddy/rules.mk | 27 ++ keyboards/mechwild/sugarglider/config.h | 137 +++++++- keyboards/mechwild/sugarglider/glcdfont.c | 231 +++++++++++++ keyboards/mechwild/sugarglider/halconf.h | 5 +- .../sugarglider/keymaps/default/keymap.c | 12 +- .../mechwild/sugarglider/ld/STM32F401xE.ld | 88 +++++ keyboards/mechwild/sugarglider/matrix.c | 2 +- keyboards/mechwild/sugarglider/mcuconf.h | 5 +- keyboards/mechwild/sugarglider/post_rules.mk | 7 + keyboards/mechwild/sugarglider/rules.mk | 30 +- keyboards/mechwild/sugarglider/sugarglider.c | 317 ++++++++++++++++++ keyboards/mechwild/sugarglider/sugarglider.h | 27 ++ 25 files changed, 1909 insertions(+), 24 deletions(-) create mode 100644 keyboards/mechwild/puckbuddy/config.h create mode 100644 keyboards/mechwild/puckbuddy/glcdfont.c create mode 100644 keyboards/mechwild/puckbuddy/halconf.h create mode 100644 keyboards/mechwild/puckbuddy/info.json create mode 100644 keyboards/mechwild/puckbuddy/keymaps/default/keymap.c create mode 100644 keyboards/mechwild/puckbuddy/keymaps/via/keymap.c create mode 100644 keyboards/mechwild/puckbuddy/keymaps/via/rules.mk create mode 100644 keyboards/mechwild/puckbuddy/ld/STM32F401xE.ld create mode 100644 keyboards/mechwild/puckbuddy/mcuconf.h create mode 100644 keyboards/mechwild/puckbuddy/post_rules.mk create mode 100644 keyboards/mechwild/puckbuddy/puckbuddy.c create mode 100644 keyboards/mechwild/puckbuddy/puckbuddy.h create mode 100644 keyboards/mechwild/puckbuddy/readme.md create mode 100644 keyboards/mechwild/puckbuddy/rules.mk create mode 100644 keyboards/mechwild/sugarglider/glcdfont.c create mode 100644 keyboards/mechwild/sugarglider/ld/STM32F401xE.ld create mode 100644 keyboards/mechwild/sugarglider/post_rules.mk diff --git a/keyboards/mechwild/puckbuddy/config.h b/keyboards/mechwild/puckbuddy/config.h new file mode 100644 index 000000000000..fac68071bbad --- /dev/null +++ b/keyboards/mechwild/puckbuddy/config.h @@ -0,0 +1,159 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6D77 // mw = "MechWild" +#define PRODUCT_ID 0x170F +#define DEVICE_VER 0x0100 +#define MANUFACTURER MechWild +#define PRODUCT PuckBuddy + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +#ifdef UF2_BUILD +#define EXTERNAL_EEPROM_BYTE_COUNT 2048 +#define EXTERNAL_EEPROM_PAGE_SIZE 128 +#define EXTERNAL_EEPROM_ADDRESS_SIZE 1 +#define EXTERNAL_EEPROM_WRITE_TIME 0 +#define FEE_PAGE_BASE_ADDRESS 0x08008000 +#endif + +/* Define custom font */ +#define OLED_FONT_H "keyboards/mechwild/puckbuddy/glcdfont.c" + +/* allows the "key" button on the blackpill to toggle caps lock for user testing before soldering */ +#define DIP_SWITCH_PINS { A0 } + +/* status light pins using the on board LED for the blackpill */ +#define LED_CAPS_LOCK_PIN C13 +#define LED_PIN_ON_STATE 0 + +/* set the tapping term for glidepoint pad to register a tap click */ +//#define CIRQUE_PINNACLE_TAPPING_TERM 0 // This is set to 0 to disable it + +/* TAPPING_TERM value is used for the CIRQUE_PINNACLE_TAPPING_TERM as well by default + * defining it this way allows us to easily modify it with DYNAMIC_TAPPING_TERM_ENABLE + */ +#define TAPPING_TERM 0 + +/* + * 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 { B12, B13, B14, B15 } +#define MATRIX_COL_PINS { B10, A8, B4, B5 } +#define UNUSED_PINS + +/* spi config */ +#define SPI_DRIVER SPID1 +#define SPI_SCK_PIN A5 +#define SPI_SCK_PAL_MODE 5 +#define SPI_MOSI_PIN A7 +#define SPI_MOSI_PAL_MODE 5 +#define SPI_MISO_PIN A6 +#define SPI_MISO_PAL_MODE 5 +#define CIRQUE_PINNACLE_SPI_DIVISOR 8 +#define CIRQUE_PINNACLE_SPI_CS_PIN A4 + +/* encoder pins */ +#define ENCODERS_PAD_A { B1, B3 } +#define ENCODERS_PAD_B { B0, A15 } + +/* encoder resolution */ +#define ENCODER_RESOLUTION 4 +#define TAP_CODE_DELAY 10 + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* RGB settings, uncomment this define to enable RGB */ +#define RGB_DI_PIN A3 +#ifdef RGB_DI_PIN +# define RGBLED_NUM 3 +# 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 */ +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_KNIGHT +# define RGBLIGHT_EFFECT_CHRISTMAS +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +# define RGBLIGHT_EFFECT_RGB_TEST +# define RGBLIGHT_EFFECT_ALTERNATING +/*== customize breathing effect ==*/ +/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +/*==== use exp() and sin() ====*/ +//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* 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 + +/* Bootmagic Lite key configuration */ +//#define BOOTMAGIC_LITE_ROW 0 +//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/mechwild/puckbuddy/glcdfont.c b/keyboards/mechwild/puckbuddy/glcdfont.c new file mode 100644 index 000000000000..942f81dd060e --- /dev/null +++ b/keyboards/mechwild/puckbuddy/glcdfont.c @@ -0,0 +1,231 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "progmem.h" + +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF0, + 0x78, 0x1C, 0x0E, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x0E, 0x0C, 0x0C, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, + 0xC0, 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, + 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x07, 0x0E, 0x1C, + 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFC, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0x78, 0x1E, 0x00, + 0x00, 0x00, 0x00, 0xF8, 0xF8, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x00, 0x00, 0x00, 0xE0, 0xFE, 0xFF, + 0xFE, 0xF8, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0xFC, 0xFF, 0xFE, + 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x3E, + 0xE0, 0x80, 0x70, 0x0E, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x3C, 0xE0, + 0x80, 0x78, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x70, 0x30, 0x30, 0x30, 0xB0, 0xF0, + 0xF0, 0x00, 0xFE, 0xFF, 0x33, 0x31, + 0x31, 0x31, 0x31, 0x31, 0x31, 0x33, + 0x3F, 0x1C, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x08, 0x0C, 0x0E, 0x07, + 0x03, 0x03, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0xF8, 0xFE, 0x0F, + 0x07, 0x03, 0x03, 0x03, 0x03, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xE0, 0xF0, 0x38, 0x1F, 0x0F, 0x00, + 0x00, 0x00, 0x80, 0xE0, 0x70, 0x38, + 0x18, 0x18, 0x18, 0xFF, 0xFF, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0xC0, 0xF0, 0xFC, 0x7E, 0x4E, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, + 0x07, 0x1F, 0xFF, 0xFE, 0xF0, 0xC0, + 0xF8, 0xFF, 0x7F, 0x0F, 0x07, 0x7F, + 0xFF, 0xFE, 0xFC, 0x04, 0x04, 0x78, + 0x80, 0x00, 0x00, 0x00, 0xC0, 0x38, + 0x0C, 0x1C, 0x60, 0x80, 0x00, 0x00, + 0x00, 0xF0, 0x0C, 0x04, 0xF4, 0x1C, + 0x80, 0xC0, 0xFC, 0xE6, 0xC3, 0xC1, + 0xC1, 0xC3, 0xE6, 0xFC, 0xC0, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x03, 0x06, 0x0E, 0x0C, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0E, 0x07, 0x03, + 0x00, 0x00, 0x01, 0x03, 0x07, 0x06, + 0x0E, 0x0C, 0x0C, 0x0C, 0x06, 0x06, + 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1F, 0x0F, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x07, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0C, 0x06, 0x07, 0x03, 0x1F, 0x1F, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, + 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x06, + 0x06, 0x00, 0x00, 0x00, 0x1F, 0x1F, + 0x00, 0x01, 0x07, 0x0E, 0x18, 0x10, + 0x00, 0x00, 0x07, 0x1F, 0x18, 0x30, + 0x30, 0x30, 0x30, 0x1F, 0x0F, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x3C, 0x3C, 0x1C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1F, 0x1F, 0x1F, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x1F, 0x1F, + 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x1F, 0x1F, 0x1E, 0xF8, 0x00, + 0x0F, 0x70, 0x30, 0x0E, 0xC1, 0x38, + 0x07, 0x0E, 0x70, 0x83, 0x1C, 0x60, + 0x1E, 0x03, 0xC0, 0x3E, 0x01, 0x00, + 0x3F, 0x7F, 0xFF, 0xFF, 0xF9, 0xC0, + 0xC0, 0xF9, 0xFF, 0xFF, 0x7F, 0x3F, +}; diff --git a/keyboards/mechwild/puckbuddy/halconf.h b/keyboards/mechwild/puckbuddy/halconf.h new file mode 100644 index 000000000000..07e8cdd17b68 --- /dev/null +++ b/keyboards/mechwild/puckbuddy/halconf.h @@ -0,0 +1,13 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + + +#pragma once + +#define HAL_USE_I2C TRUE + +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next diff --git a/keyboards/mechwild/puckbuddy/info.json b/keyboards/mechwild/puckbuddy/info.json new file mode 100644 index 000000000000..2770335e17ac --- /dev/null +++ b/keyboards/mechwild/puckbuddy/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "MechWild PuckBuddy", + "url": "mechwild.com", + "maintainer": "Kyle McCreery", + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1.5, "y":0}, + {"label":"k02", "x":2.5, "y":0}, + {"label":"k03", "x":3.5, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k10", "x":0, "y":1.25}, + {"label":"k15", "x":5, "y":1.25}, + {"label":"k20", "x":0, "y":2.25}, + {"label":"k25", "x":5, "y":2.25}, + {"label":"k30", "x":0, "y":3.25}, + {"label":"k35", "x":5, "y":3.25}, + {"label":"k31", "x":1, "y":4.5}, + {"label":"k32", "x":2, "y":4.5}, + {"label":"k33", "x":3, "y":4.5}, + {"label":"k34", "x":4, "y":4.5}] + } + } +} diff --git a/keyboards/mechwild/puckbuddy/keymaps/default/keymap.c b/keyboards/mechwild/puckbuddy/keymaps/default/keymap.c new file mode 100644 index 000000000000..a61f170d90db --- /dev/null +++ b/keyboards/mechwild/puckbuddy/keymaps/default/keymap.c @@ -0,0 +1,60 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _BASE, + _FN1, + _FN2, + _FN3 +}; + +/* Physical Layout: + * /-------------------\ + * |ENC| 1 | 2 | 3 |ENC| + * |---+---'---'---+---| + * | 4 | | 5 | + * |---| |---| + * | 6 | | 7 | + * |---| |---| + * | 8 | | 9 | + * \-----,---,---,-----/ + * | A | B | C | D | + * \---'---'---'---/ + * + * Keymap Layout: + * ENC, 1, 2, 3, ENC, + * 4, 5, + * 6, 7, + * 8, A, B, C, D, 9, + * + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_MUTE, MO(_FN3), MO(_FN2), MO(_FN1), LGUI(KC_D), + MO(_FN2), KC_HOME, + MO(_FN3), KC_END, + KC_BTN3, KC_BTN1, KC_BTN2, KC_BTN2, KC_BTN1, DPI_FINE + ), + [_FN1] = LAYOUT( + RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, TAP_TOG, + DPI_UP, TAP_UP, + DPI_DN, TAP_DN, + KC_TRNS, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_TRNS + ), + [_FN2] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, + KC_TRNS, RGB_MOD, + KC_TRNS, RGB_RMOD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_FN3] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/mechwild/puckbuddy/keymaps/via/keymap.c b/keyboards/mechwild/puckbuddy/keymaps/via/keymap.c new file mode 100644 index 000000000000..a61f170d90db --- /dev/null +++ b/keyboards/mechwild/puckbuddy/keymaps/via/keymap.c @@ -0,0 +1,60 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _BASE, + _FN1, + _FN2, + _FN3 +}; + +/* Physical Layout: + * /-------------------\ + * |ENC| 1 | 2 | 3 |ENC| + * |---+---'---'---+---| + * | 4 | | 5 | + * |---| |---| + * | 6 | | 7 | + * |---| |---| + * | 8 | | 9 | + * \-----,---,---,-----/ + * | A | B | C | D | + * \---'---'---'---/ + * + * Keymap Layout: + * ENC, 1, 2, 3, ENC, + * 4, 5, + * 6, 7, + * 8, A, B, C, D, 9, + * + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_MUTE, MO(_FN3), MO(_FN2), MO(_FN1), LGUI(KC_D), + MO(_FN2), KC_HOME, + MO(_FN3), KC_END, + KC_BTN3, KC_BTN1, KC_BTN2, KC_BTN2, KC_BTN1, DPI_FINE + ), + [_FN1] = LAYOUT( + RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, TAP_TOG, + DPI_UP, TAP_UP, + DPI_DN, TAP_DN, + KC_TRNS, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_TRNS + ), + [_FN2] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, + KC_TRNS, RGB_MOD, + KC_TRNS, RGB_RMOD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_FN3] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/mechwild/puckbuddy/keymaps/via/rules.mk b/keyboards/mechwild/puckbuddy/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/mechwild/puckbuddy/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/mechwild/puckbuddy/ld/STM32F401xE.ld b/keyboards/mechwild/puckbuddy/ld/STM32F401xE.ld new file mode 100644 index 000000000000..daec7d858347 --- /dev/null +++ b/keyboards/mechwild/puckbuddy/ld/STM32F401xE.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * STM32F401xE memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000, len = 16k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ + flash1 (rx) : org = 0x08004000, len = 16k + flash2 (rx) : org = 0x08008000, len = 16k /* emulated eeprom */ + flash3 (rx) : org = 0x0800C000, len = 16k + flash4 (rx) : org = 0x08010000, len = 512k - 64k + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 96k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x00000000, len = 0 + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash4); +REGION_ALIAS("VECTORS_FLASH_LMA", flash4); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash4); +REGION_ALIAS("XTORS_FLASH_LMA", flash4); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash4); +REGION_ALIAS("TEXT_FLASH_LMA", flash4); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash4); +REGION_ALIAS("RODATA_FLASH_LMA", flash4); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash4); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash4); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash4); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash4); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* TinyUF2 bootloader reset support */ +_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ diff --git a/keyboards/mechwild/puckbuddy/mcuconf.h b/keyboards/mechwild/puckbuddy/mcuconf.h new file mode 100644 index 000000000000..f71868d78e63 --- /dev/null +++ b/keyboards/mechwild/puckbuddy/mcuconf.h @@ -0,0 +1,12 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE + +#undef STM32_SPI_USE_SPI1 +#define STM32_SPI_USE_SPI1 TRUE diff --git a/keyboards/mechwild/puckbuddy/post_rules.mk b/keyboards/mechwild/puckbuddy/post_rules.mk new file mode 100644 index 000000000000..ac527500d2fe --- /dev/null +++ b/keyboards/mechwild/puckbuddy/post_rules.mk @@ -0,0 +1,7 @@ +ifeq ($(strip $(BOOTLOADER)), tinyuf2) + ifndef EEPROM_DRIVER + MCU_LDSCRIPT = STM32F401xE + EEPROM_DRIVER = vendor + UF2_BUILD = yes + endif +endif \ No newline at end of file diff --git a/keyboards/mechwild/puckbuddy/puckbuddy.c b/keyboards/mechwild/puckbuddy/puckbuddy.c new file mode 100644 index 000000000000..b82d06f56516 --- /dev/null +++ b/keyboards/mechwild/puckbuddy/puckbuddy.c @@ -0,0 +1,307 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "puckbuddy.h" + +#ifndef GLIDEPOINT_DPI_OPTIONS +# define GLIDEPOINT_DPI_OPTIONS \ + { 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 3600, 4000 } +# ifndef GLIDEPOINT_DPI_DEFAULT +# define GLIDEPOINT_DPI_DEFAULT 1 +# endif +#endif +#ifndef GLIDEPOINT_DPI_DEFAULT +# define GLIDEPOINT_DPI_DEFAULT 1 +#endif + +keyboard_config_t keyboard_config; +uint16_t dpi_array[] = GLIDEPOINT_DPI_OPTIONS; +#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) + +void board_init(void) { + // B9 is configured as I2C1_SDA in the board file; that function must be + // disabled before using B7 as I2C1_SDA. + setPinInputHigh(B9); +} + +#ifdef DYNAMIC_TAPPING_TERM_ENABLE +void tap_modify(int change_value, bool tap_status) { + if (keyboard_config.dt_term_config < 0) { + keyboard_config.dt_term_config *= -1; + } + + keyboard_config.dt_term_config += change_value; + + if (tap_status == false ) { + keyboard_config.dt_term_config *= -1; + g_tapping_term = 0; + } else { + g_tapping_term = keyboard_config.dt_term_config; + } + eeconfig_update_kb(keyboard_config.raw); +} + +void tap_toggle(void) { + keyboard_config.dt_term_config *= -1; + if (keyboard_config.dt_term_config > 0) { + g_tapping_term = keyboard_config.dt_term_config; + } else { + g_tapping_term = 0; + } + eeconfig_update_kb(keyboard_config.raw); +} +#endif + +#ifdef DIP_SWITCH_ENABLE +bool dip_switch_update_kb(uint8_t index, bool active) { + if (!dip_switch_update_user(index, active)) { return false; } + switch (index) { + case 0: + if(active) { tap_code(KC_CLCK); } + break; + break; + } + return true; +} +#endif + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + switch (index) { + case 0: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + case 1: + if (clockwise) { + tap_code(KC_PGUP); + } else { + tap_code(KC_PGDN); + } + break; + } + return true; +} +#endif + +#ifdef OLED_ENABLE // OLED Functionality +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; // flips the display 180 degrees +} + +bool clear_screen = true; // used to manage singular screen clears to prevent display glitch +bool clear_screen_art = true; // used to manage singular screen clears to prevent display glitch +static void render_name(void) { // Render Puckbuddy "Get Puck'd" text + static const char PROGMEM name_1[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xB6, 0xB6, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x00}; + static const char PROGMEM name_2[] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xB6, 0xB6, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0x00}; + static const char PROGMEM name_3[] = {0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xB6, 0xB6, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0x00}; + oled_set_cursor(0,0); + oled_write_P(name_1, false); + oled_set_cursor(0,1); + oled_write_P(name_2, false); + oled_set_cursor(0,2); + oled_write_P(name_3, false); +} + +static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0x97, 0x98, 0x99, 0x9A,0x00}; + static const char PROGMEM logo_2[] = {0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0x00}; + static const char PROGMEM logo_3[] = {0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xB6, 0x00}; + static const char PROGMEM logo_4[] = {0xB6, 0xB6, 0xB6, 0x9B, 0x9C, 0x9D, 0x9E, 0x00}; + oled_set_cursor(0,0); + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); +} + +bool oled_task_kb(void) { + if(!oled_task_user()) { + return false; + } + if ( IS_HOST_LED_OFF(USB_LED_NUM_LOCK) && IS_HOST_LED_OFF(USB_LED_CAPS_LOCK) && IS_HOST_LED_OFF(USB_LED_SCROLL_LOCK) && get_highest_layer(layer_state) == 0 ) { + if (clear_screen_art == true) { + oled_clear(); + oled_render(); + clear_screen_art = false; + } + render_name(); + oled_set_cursor(0,3); +#ifdef POINTING_DEVICE_ENABLE + oled_write_P(PSTR(" DPI:"), false); + oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically + oled_write_P(PSTR(" TAP:"), false); + if (keyboard_config.dt_term_config < 0) { + oled_write_P(PSTR("Off "), false); + } else { + oled_write(get_u16_str(g_tapping_term, ' '), false); + } +#endif + clear_screen = true; + } else { + if (clear_screen == true) { + oled_clear(); + oled_render(); + clear_screen = false; + } + render_logo(); + oled_set_cursor(8,1); + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_P(PSTR("Layer 0"), false); + break; + case 1: + oled_write_P(PSTR("Layer 1"), false); + break; + case 2: + oled_write_P(PSTR("Layer 2"), false); + break; + case 3: + oled_write_P(PSTR("Layer 3"), false); + break; + default: + oled_write_P(PSTR("Layer ?"), false); // Should never display, here as a catchall + } + led_t led_state = host_keyboard_led_state(); + oled_set_cursor(8,0); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR") : PSTR(" "), false); +#ifdef POINTING_DEVICE_ENABLE + oled_set_cursor(8,2); + oled_write_P(PSTR("DPI:"), false); + oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically + oled_set_cursor(8,3); + oled_write_P(PSTR("TAP:"), false); + if (keyboard_config.dt_term_config < 0) { + oled_write_P(PSTR("Off "), false); + } else { + oled_write(get_u16_str(g_tapping_term, ' '), false); + } +#endif + clear_screen_art = true; + } + return true; +} +#endif + +bool process_record_kb(uint16_t keycode, keyrecord_t* record) { + switch(keycode) { +#ifdef POINTING_DEVICE_ENABLE + case DPI_UP: + if (record->event.pressed) { + keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE; + eeconfig_update_kb(keyboard_config.raw); + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); + } + return false; + case DPI_DN: + if (record->event.pressed) { + if (keyboard_config.dpi_config > 0) { + keyboard_config.dpi_config = (keyboard_config.dpi_config - 1) % DPI_OPTION_SIZE; + } else { + keyboard_config.dpi_config = DPI_OPTION_SIZE - 1; + } + eeconfig_update_kb(keyboard_config.raw); + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); + } + return false; + case DPI_FINE: + if (record->event.pressed) { + pointing_device_set_cpi(dpi_array[0]); + } else { + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); + } + return false; +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only include tap info keycodes if it is being configured dynamically + case TAP_UP: + if (record->event.pressed) { + tap_modify(DYNAMIC_TAPPING_TERM_INCREMENT, true); + } + return false; + case TAP_DN: + if (record->event.pressed) { + if (keyboard_config.dt_term_config > 0) { + tap_modify(-1 * DYNAMIC_TAPPING_TERM_INCREMENT, true); + } + } + return false; + case TAP_ON: + if (record->event.pressed) { + tap_modify(0, true); + } + return false; + case TAP_OFF: + if (record->event.pressed) { + tap_modify(0, false); + } + return false; + case TAP_TOG: + if (record->event.pressed) { + tap_toggle(); + } + return false; +#endif + } + return process_record_user(keycode, record); +} + +void pointing_device_init_kb(void) { +#ifdef POINTING_DEVICE_ENABLE + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); +#endif +} + +void eeconfig_init_kb(void) { +#ifdef POINTING_DEVICE_ENABLE + keyboard_config.dpi_config = GLIDEPOINT_DPI_DEFAULT; +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only set tap term from eeprom if it is being configured dynamically + keyboard_config.dt_term_config = TAPPING_TERM; +#endif + eeconfig_update_kb(keyboard_config.raw); + eeconfig_init_user(); +} + +void matrix_init_kb(void) { + // is safe to just read DPI setting since matrix init + // comes before pointing device init. + keyboard_config.raw = eeconfig_read_kb(); +#ifdef POINTING_DEVICE_ENABLE + if (keyboard_config.dpi_config > DPI_OPTION_SIZE) { + eeconfig_init_kb(); + } +#endif + matrix_init_user(); +} + +void keyboard_post_init_kb(void) { +#ifdef POINTING_DEVICE_ENABLE + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); +#endif +#ifdef RGBLIGHT_ENABLE + rgblight_toggle_noeeprom(); //double toggle post init removes the weirdness with rgb strips having a yellow first LED + rgblight_toggle_noeeprom(); +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE + tap_toggle(); // Need it to reevaluate this setting after initiating so that it is current after init + tap_toggle(); +#endif + keyboard_post_init_user(); +#ifdef OLED_ENABLE // purposefully after user post init to allow the RGB to startup first + wait_ms(200); // Avoids a startup issue where the oled renders and then turns off with blackpill + oled_on(); +#endif +} diff --git a/keyboards/mechwild/puckbuddy/puckbuddy.h b/keyboards/mechwild/puckbuddy/puckbuddy.h new file mode 100644 index 000000000000..89de464cd6ef --- /dev/null +++ b/keyboards/mechwild/puckbuddy/puckbuddy.h @@ -0,0 +1,55 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "quantum.h" + +#define ___ KC_NO + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k05,\ + k10, k15,\ + k20, k25,\ + k30, k31, k32, k33, k34, k35 \ +) { \ + { k00, k01, k05, k31 }, \ + { k10, k02, k15, k32 }, \ + { k20, k03, k25, k33 }, \ + { k30, ___, k35, k34 } \ +} + +typedef union { + uint32_t raw; + struct { + uint8_t dpi_config; + int16_t dt_term_config; + }; +} keyboard_config_t; + +extern keyboard_config_t keyboard_config; +extern uint16_t dpi_array[]; + +enum keyboard_keycodes { +#ifdef VIA_ENABLE + DPI_UP = USER00, +#else + DPI_UP = SAFE_RANGE, +#endif + DPI_DN, + DPI_FINE, + TAP_UP, + TAP_DN, + TAP_ON, + TAP_OFF, + TAP_TOG, + NEW_SAFE_RANGE +}; diff --git a/keyboards/mechwild/puckbuddy/readme.md b/keyboards/mechwild/puckbuddy/readme.md new file mode 100644 index 000000000000..276378a1e2cb --- /dev/null +++ b/keyboards/mechwild/puckbuddy/readme.md @@ -0,0 +1,27 @@ +# PuckBuddy + +![PuckBuddy](https://i.imgur.com/iSVAHJzh.png) + +A macropad with a Cirque Glidepoint Trackpad in the middle, powered by the STM32 Blackpill. + +* Keyboard Maintainer: [Kyle McCreery](https://github.com/kylemccreery) +* Hardware Supported: PuckBuddy v1.0 +* Hardware Availability: [PuckBuddy on MechWild](https://mechwild.com/product/puckbuddy/) + +Make example for this keyboard (after setting up your build environment): + + make mechwild/puckbuddy:default + +Flashing example for this keyboard: + + make mechwild/puckbuddy: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). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (assigned to the top left key) and plug in the keyboard while holding it. +* **Physical reset button**: Press and hold the boot0 button on the blackpill, tap and release the nrst button on the blackpill, then release the boot0 button. +* **Keycode in layout**: Press the key mapped to `RESET` if it is available. By default this is the top right key on layer 1. \ No newline at end of file diff --git a/keyboards/mechwild/puckbuddy/rules.mk b/keyboards/mechwild/puckbuddy/rules.mk new file mode 100644 index 000000000000..b7699320647b --- /dev/null +++ b/keyboards/mechwild/puckbuddy/rules.mk @@ -0,0 +1,27 @@ +# MCU name +MCU = STM32F401 + +# Bootloader selection +BOOTLOADER = stm32-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +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 +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Encoder Enabled +OLED_ENABLE = yes # OLED Enabled +OLED_DRIVER = SSD1306 # OLED Driver +DIP_SWITCH_ENABLE = yes # Dip Switch Enabled + +POINTING_DEVICE_ENABLE = yes # Pointing Device Enabled +POINTING_DEVICE_DRIVER = cirque_pinnacle_spi # Pointing Device Driver + +DYNAMIC_TAPPING_TERM_ENABLE = yes # Enable Dynamic Tapping Term to control the Tap term for the Cirque Pad easily diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h index 0eebe682f3fe..c3e967143df1 100644 --- a/keyboards/mechwild/sugarglider/config.h +++ b/keyboards/mechwild/sugarglider/config.h @@ -16,9 +16,136 @@ #define MATRIX_ROWS 9 #define MATRIX_COLS 6 +/* Status light pins */ +//#define LED_NUM_LOCK_PIN B12 +//#define LED_CAPS_LOCK_PIN B13 +//#define LED_SCROLL_LOCK_PIN B14 +//#define LED_PIN_ON_STATE 0 -/* status light pins */ -#define LED_NUM_LOCK_PIN B12 -#define LED_CAPS_LOCK_PIN B13 -#define LED_SCROLL_LOCK_PIN B14 -#define LED_PIN_ON_STATE 0 \ No newline at end of file +#define USB_POLLING_INTERVAL_MS 1 + +/* Memory definitions for UF2 builds */ +#ifdef UF2_BUILD +#define EXTERNAL_EEPROM_BYTE_COUNT 2048 +#define EXTERNAL_EEPROM_PAGE_SIZE 128 +#define EXTERNAL_EEPROM_ADDRESS_SIZE 1 +#define EXTERNAL_EEPROM_WRITE_TIME 0 +#define FEE_PAGE_BASE_ADDRESS 0x08008000 +#endif + +/* Define custom font */ +#define OLED_FONT_H "keyboards/mechwild/sugarglider/glcdfont.c" + +/* allows the "key" button on the blackpill to toggle caps lock for user testing before soldering */ +#define DIP_SWITCH_PINS { A0 } + +/* set the tapping term for glidepoint pad to register a tap click */ +//#define CIRQUE_PINNACLE_TAPPING_TERM 0 // This is set to 0 to disable it + +/* TAPPING_TERM value is used for the CIRQUE_PINNACLE_TAPPING_TERM as well by default + * defining it this way allows us to easily modify it with DYNAMIC_TAPPING_TERM_ENABLE + */ +#define TAPPING_TERM 0 + +/* spi config */ +#define SPI_DRIVER SPID1 +#define SPI_SCK_PIN A5 +#define SPI_SCK_PAL_MODE 5 +#define SPI_MOSI_PIN A7 +#define SPI_MOSI_PAL_MODE 5 +#define SPI_MISO_PIN A6 +#define SPI_MISO_PAL_MODE 5 +#define CIRQUE_PINNACLE_SPI_DIVISOR 8 +#define CIRQUE_PINNACLE_SPI_CS_PIN A3 + +/* encoder pins */ +#define ENCODERS_PAD_A { B0, B3, B9 } +#define ENCODERS_PAD_B { A2, A15, B8 } + +/* encoder resolution */ +#define ENCODER_RESOLUTION 4 +#define TAP_CODE_DELAY 0 + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* RGB settings, uncomment this define to enable RGB */ +//#define RGB_DI_PIN B5 +#ifdef RGB_DI_PIN +# define RGBLED_NUM 6 +# 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 */ +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_KNIGHT +# define RGBLIGHT_EFFECT_CHRISTMAS +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +# define RGBLIGHT_EFFECT_RGB_TEST +# define RGBLIGHT_EFFECT_ALTERNATING +/*== customize breathing effect ==*/ +/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +/*==== use exp() and sin() ====*/ +//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +// Debounce not used in this custom matrix implementation +//#define DEBOUNCE 5 + +/* 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 + +/* Bootmagic Lite key configuration */ +//#define BOOTMAGIC_LITE_ROW 0 +//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/mechwild/sugarglider/glcdfont.c b/keyboards/mechwild/sugarglider/glcdfont.c new file mode 100644 index 000000000000..942f81dd060e --- /dev/null +++ b/keyboards/mechwild/sugarglider/glcdfont.c @@ -0,0 +1,231 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "progmem.h" + +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF0, + 0x78, 0x1C, 0x0E, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x0E, 0x0C, 0x0C, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, + 0xC0, 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, + 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x07, 0x0E, 0x1C, + 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFC, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0x78, 0x1E, 0x00, + 0x00, 0x00, 0x00, 0xF8, 0xF8, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x00, 0x00, 0x00, 0xE0, 0xFE, 0xFF, + 0xFE, 0xF8, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0xFC, 0xFF, 0xFE, + 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x3E, + 0xE0, 0x80, 0x70, 0x0E, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x3C, 0xE0, + 0x80, 0x78, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x70, 0x30, 0x30, 0x30, 0xB0, 0xF0, + 0xF0, 0x00, 0xFE, 0xFF, 0x33, 0x31, + 0x31, 0x31, 0x31, 0x31, 0x31, 0x33, + 0x3F, 0x1C, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x08, 0x0C, 0x0E, 0x07, + 0x03, 0x03, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0xF8, 0xFE, 0x0F, + 0x07, 0x03, 0x03, 0x03, 0x03, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xE0, 0xF0, 0x38, 0x1F, 0x0F, 0x00, + 0x00, 0x00, 0x80, 0xE0, 0x70, 0x38, + 0x18, 0x18, 0x18, 0xFF, 0xFF, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0xC0, 0xF0, 0xFC, 0x7E, 0x4E, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, + 0x07, 0x1F, 0xFF, 0xFE, 0xF0, 0xC0, + 0xF8, 0xFF, 0x7F, 0x0F, 0x07, 0x7F, + 0xFF, 0xFE, 0xFC, 0x04, 0x04, 0x78, + 0x80, 0x00, 0x00, 0x00, 0xC0, 0x38, + 0x0C, 0x1C, 0x60, 0x80, 0x00, 0x00, + 0x00, 0xF0, 0x0C, 0x04, 0xF4, 0x1C, + 0x80, 0xC0, 0xFC, 0xE6, 0xC3, 0xC1, + 0xC1, 0xC3, 0xE6, 0xFC, 0xC0, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x03, 0x06, 0x0E, 0x0C, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0E, 0x07, 0x03, + 0x00, 0x00, 0x01, 0x03, 0x07, 0x06, + 0x0E, 0x0C, 0x0C, 0x0C, 0x06, 0x06, + 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1F, 0x0F, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x07, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0C, 0x06, 0x07, 0x03, 0x1F, 0x1F, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, + 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x06, + 0x06, 0x00, 0x00, 0x00, 0x1F, 0x1F, + 0x00, 0x01, 0x07, 0x0E, 0x18, 0x10, + 0x00, 0x00, 0x07, 0x1F, 0x18, 0x30, + 0x30, 0x30, 0x30, 0x1F, 0x0F, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x3C, 0x3C, 0x1C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1F, 0x1F, 0x1F, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x1F, 0x1F, + 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x1F, 0x1F, 0x1E, 0xF8, 0x00, + 0x0F, 0x70, 0x30, 0x0E, 0xC1, 0x38, + 0x07, 0x0E, 0x70, 0x83, 0x1C, 0x60, + 0x1E, 0x03, 0xC0, 0x3E, 0x01, 0x00, + 0x3F, 0x7F, 0xFF, 0xFF, 0xF9, 0xC0, + 0xC0, 0xF9, 0xFF, 0xFF, 0x7F, 0x3F, +}; diff --git a/keyboards/mechwild/sugarglider/halconf.h b/keyboards/mechwild/sugarglider/halconf.h index b4299dc58ff6..ec9f04c2ede8 100644 --- a/keyboards/mechwild/sugarglider/halconf.h +++ b/keyboards/mechwild/sugarglider/halconf.h @@ -5,5 +5,8 @@ #define HAL_USE_I2C TRUE -#include_next +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD +#include_next diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c index 3c8bb315c401..73070de9efb2 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -31,12 +31,12 @@ k20, k21, k22, k23, k24, k25, k50, k51, k52, k53, k54, k55, \ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ENT, KC_H, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_H, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, - KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GESC, KC_H, KC_RGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, - KC_H, KC_LCTL, KC_LALT, MO(_LOWER), KC_H, KC_H, KC_H, MO(_RAISE), KC_SPC, KC_RSFT, KC_H - ), - + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ENT, KC_NLCK, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_MUTE, KC_CLCK, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GESC, KC_SLCK, KC_RGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_MUTE, KC_LCTL, KC_LALT, MO(_LOWER), KC_H, KC_H, KC_H, MO(_RAISE), KC_SPC, KC_RSFT, KC_MUTE + ), + [_LOWER] = LAYOUT( KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_TRNS, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, diff --git a/keyboards/mechwild/sugarglider/ld/STM32F401xE.ld b/keyboards/mechwild/sugarglider/ld/STM32F401xE.ld new file mode 100644 index 000000000000..daec7d858347 --- /dev/null +++ b/keyboards/mechwild/sugarglider/ld/STM32F401xE.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * STM32F401xE memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000, len = 16k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ + flash1 (rx) : org = 0x08004000, len = 16k + flash2 (rx) : org = 0x08008000, len = 16k /* emulated eeprom */ + flash3 (rx) : org = 0x0800C000, len = 16k + flash4 (rx) : org = 0x08010000, len = 512k - 64k + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 96k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x00000000, len = 0 + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash4); +REGION_ALIAS("VECTORS_FLASH_LMA", flash4); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash4); +REGION_ALIAS("XTORS_FLASH_LMA", flash4); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash4); +REGION_ALIAS("TEXT_FLASH_LMA", flash4); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash4); +REGION_ALIAS("RODATA_FLASH_LMA", flash4); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash4); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash4); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash4); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash4); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* TinyUF2 bootloader reset support */ +_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ diff --git a/keyboards/mechwild/sugarglider/matrix.c b/keyboards/mechwild/sugarglider/matrix.c index 796ba8967629..0971e814e494 100644 --- a/keyboards/mechwild/sugarglider/matrix.c +++ b/keyboards/mechwild/sugarglider/matrix.c @@ -46,7 +46,7 @@ static void select_row(uint8_t row) { uint8_t row_pos[MATRIX_ROWS] = ROW_POS; if (mcp23018_errors) { // wait to mimic i2c interactions - wait_us(100); + //wait_us(100); return; } diff --git a/keyboards/mechwild/sugarglider/mcuconf.h b/keyboards/mechwild/sugarglider/mcuconf.h index a9caeadf6db1..f71868d78e63 100644 --- a/keyboards/mechwild/sugarglider/mcuconf.h +++ b/keyboards/mechwild/sugarglider/mcuconf.h @@ -1,4 +1,4 @@ -// Copyright 2022 Kyle McCreery +// Copyright 2022 Kyle McCreery (@kylemccreery) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -7,3 +7,6 @@ #undef STM32_I2C_USE_I2C1 #define STM32_I2C_USE_I2C1 TRUE + +#undef STM32_SPI_USE_SPI1 +#define STM32_SPI_USE_SPI1 TRUE diff --git a/keyboards/mechwild/sugarglider/post_rules.mk b/keyboards/mechwild/sugarglider/post_rules.mk new file mode 100644 index 000000000000..ac527500d2fe --- /dev/null +++ b/keyboards/mechwild/sugarglider/post_rules.mk @@ -0,0 +1,7 @@ +ifeq ($(strip $(BOOTLOADER)), tinyuf2) + ifndef EEPROM_DRIVER + MCU_LDSCRIPT = STM32F401xE + EEPROM_DRIVER = vendor + UF2_BUILD = yes + endif +endif \ No newline at end of file diff --git a/keyboards/mechwild/sugarglider/rules.mk b/keyboards/mechwild/sugarglider/rules.mk index 0123a85b9377..9f9efd04fb8a 100644 --- a/keyboards/mechwild/sugarglider/rules.mk +++ b/keyboards/mechwild/sugarglider/rules.mk @@ -8,16 +8,26 @@ BOOTLOADER = stm32-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = no # Encoder Enabled +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +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 +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Encoder Enabled +OLED_ENABLE = yes # OLED Enabled +OLED_DRIVER = SSD1306 # OLED Driver +DIP_SWITCH_ENABLE = yes # Dip Switch Enabled + +POINTING_DEVICE_ENABLE = yes # Pointing Device Enabled +POINTING_DEVICE_DRIVER = cirque_pinnacle_spi # Pointing Device Driver + +DYNAMIC_TAPPING_TERM_ENABLE = yes # Enable Dynamic Tapping Term to control the Tap term for the Cirque Pad easily + +DEBOUNCE_TYPE = sym_eager_pk # custom matrix setup CUSTOM_MATRIX = lite diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index bf2cd744f96d..7e90aee7f66c 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -3,6 +3,72 @@ #include "sugarglider.h" +#ifndef GLIDEPOINT_DPI_OPTIONS +# define GLIDEPOINT_DPI_OPTIONS \ + { 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 3600, 4000 } +# ifndef GLIDEPOINT_DPI_DEFAULT +# define GLIDEPOINT_DPI_DEFAULT 1 +# endif +#endif +#ifndef GLIDEPOINT_DPI_DEFAULT +# define GLIDEPOINT_DPI_DEFAULT 1 +#endif + +keyboard_config_t keyboard_config; +uint16_t dpi_array[] = GLIDEPOINT_DPI_OPTIONS; +#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) + +void board_init(void) { + // B9 is configured as I2C1_SDA in the board file; that function must be + // disabled before using B7 as I2C1_SDA. + setPinInputHigh(B9); + setPinOutput(B12); + setPinOutput(B13); + setPinOutput(B14); + setPinOutput(C13); +} + +#ifdef DYNAMIC_TAPPING_TERM_ENABLE +void tap_modify(int change_value, bool tap_status) { + if (keyboard_config.dt_term_config < 0) { + keyboard_config.dt_term_config *= -1; + } + + keyboard_config.dt_term_config += change_value; + + if (tap_status == false ) { + keyboard_config.dt_term_config *= -1; + g_tapping_term = 0; + } else { + g_tapping_term = keyboard_config.dt_term_config; + } + eeconfig_update_kb(keyboard_config.raw); +} + +void tap_toggle(void) { + keyboard_config.dt_term_config *= -1; + if (keyboard_config.dt_term_config > 0) { + g_tapping_term = keyboard_config.dt_term_config; + } else { + g_tapping_term = 0; + } + eeconfig_update_kb(keyboard_config.raw); +} +#endif + +#ifdef DIP_SWITCH_ENABLE +bool dip_switch_update_kb(uint8_t index, bool active) { + if (!dip_switch_update_user(index, active)) { return false; } + switch (index) { + case 0: + if(active) { tap_code(KC_CLCK); } + break; + break; + } + return true; +} +#endif + #ifdef ENCODER_ENABLE bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } @@ -14,7 +80,258 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { tap_code(KC_VOLD); } break; + case 1: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + case 2: + if (clockwise) { + tap_code(KC_PGUP); + } else { + tap_code(KC_PGDN); + } + break; } return true; } #endif + +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + // writePin sets the pin high for 1 and low for 0. + // In this example the pins are inverted, setting + // it low/0 turns it on, and high/1 turns the LED off. + // This behavior depends on whether the LED is between the pin + // and VCC or the pin and GND. + writePin(B12, !led_state.num_lock); + writePin(B13, !led_state.caps_lock); + writePin(B14, !led_state.scroll_lock); + writePin(C13, !led_state.caps_lock); + } + return res; +} + +#ifdef OLED_ENABLE // OLED Functionality +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; // flips the display 180 degrees +} + +bool clear_screen = true; // used to manage singular screen clears to prevent display glitch +bool clear_screen_art = true; // used to manage singular screen clears to prevent display glitch +static void render_name(void) { // Render Puckbuddy "Get Puck'd" text + static const char PROGMEM name_1[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xB6, 0xB6, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x00}; + static const char PROGMEM name_2[] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xB6, 0xB6, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0x00}; + static const char PROGMEM name_3[] = {0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xB6, 0xB6, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0x00}; + oled_set_cursor(0,0); + oled_write_P(name_1, false); + oled_set_cursor(0,1); + oled_write_P(name_2, false); + oled_set_cursor(0,2); + oled_write_P(name_3, false); +} + +static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0x97, 0x98, 0x99, 0x9A,0x00}; + static const char PROGMEM logo_2[] = {0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0x00}; + static const char PROGMEM logo_3[] = {0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xB6, 0x00}; + static const char PROGMEM logo_4[] = {0xB6, 0xB6, 0xB6, 0x9B, 0x9C, 0x9D, 0x9E, 0x00}; + oled_set_cursor(0,0); + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); +} + +bool oled_task_kb(void) { + if(!oled_task_user()) { + return false; + } + if ( IS_HOST_LED_OFF(USB_LED_NUM_LOCK) && IS_HOST_LED_OFF(USB_LED_CAPS_LOCK) && IS_HOST_LED_OFF(USB_LED_SCROLL_LOCK) && get_highest_layer(layer_state) == 0 ) { + if (clear_screen_art == true) { + oled_clear(); + oled_render(); + clear_screen_art = false; + } + render_name(); + oled_set_cursor(0,3); +#ifdef POINTING_DEVICE_ENABLE + oled_write_P(PSTR(" DPI:"), false); + oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically + oled_write_P(PSTR(" TAP:"), false); + if (keyboard_config.dt_term_config < 0) { + oled_write_P(PSTR("Off "), false); + } else { + oled_write(get_u16_str(g_tapping_term, ' '), false); + } +#endif + clear_screen = true; + } else { + if (clear_screen == true) { + oled_clear(); + oled_render(); + clear_screen = false; + } + render_logo(); + oled_set_cursor(8,1); + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_P(PSTR("Layer 0"), false); + break; + case 1: + oled_write_P(PSTR("Layer 1"), false); + break; + case 2: + oled_write_P(PSTR("Layer 2"), false); + break; + case 3: + oled_write_P(PSTR("Layer 3"), false); + break; + default: + oled_write_P(PSTR("Layer ?"), false); // Should never display, here as a catchall + } + led_t led_state = host_keyboard_led_state(); + oled_set_cursor(8,0); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR") : PSTR(" "), false); +#ifdef POINTING_DEVICE_ENABLE + oled_set_cursor(8,2); + oled_write_P(PSTR("DPI:"), false); + oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically + oled_set_cursor(8,3); + oled_write_P(PSTR("TAP:"), false); + if (keyboard_config.dt_term_config < 0) { + oled_write_P(PSTR("Off "), false); + } else { + oled_write(get_u16_str(g_tapping_term, ' '), false); + } +#endif + clear_screen_art = true; + } + return true; +} +#endif + +bool process_record_kb(uint16_t keycode, keyrecord_t* record) { + switch(keycode) { +#ifdef POINTING_DEVICE_ENABLE + case DPI_UP: + if (record->event.pressed) { + keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE; + eeconfig_update_kb(keyboard_config.raw); + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); + } + return false; + case DPI_DN: + if (record->event.pressed) { + if (keyboard_config.dpi_config > 0) { + keyboard_config.dpi_config = (keyboard_config.dpi_config - 1) % DPI_OPTION_SIZE; + } else { + keyboard_config.dpi_config = DPI_OPTION_SIZE - 1; + } + eeconfig_update_kb(keyboard_config.raw); + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); + } + return false; + case DPI_FINE: + if (record->event.pressed) { + pointing_device_set_cpi(dpi_array[0]); + } else { + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); + } + return false; +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only include tap info keycodes if it is being configured dynamically + case TAP_UP: + if (record->event.pressed) { + tap_modify(DYNAMIC_TAPPING_TERM_INCREMENT, true); + } + return false; + case TAP_DN: + if (record->event.pressed) { + if (keyboard_config.dt_term_config > 0) { + tap_modify(-1 * DYNAMIC_TAPPING_TERM_INCREMENT, true); + } + } + return false; + case TAP_ON: + if (record->event.pressed) { + tap_modify(0, true); + } + return false; + case TAP_OFF: + if (record->event.pressed) { + tap_modify(0, false); + } + return false; + case TAP_TOG: + if (record->event.pressed) { + tap_toggle(); + } + return false; +#endif + } + return process_record_user(keycode, record); +} + +void pointing_device_init_kb(void) { +#ifdef POINTING_DEVICE_ENABLE + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); +#endif +} + +void eeconfig_init_kb(void) { +#ifdef POINTING_DEVICE_ENABLE + keyboard_config.dpi_config = GLIDEPOINT_DPI_DEFAULT; +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only set tap term from eeprom if it is being configured dynamically + keyboard_config.dt_term_config = TAPPING_TERM; +#endif + eeconfig_update_kb(keyboard_config.raw); + eeconfig_init_user(); +} + +void matrix_init_kb(void) { + // is safe to just read DPI setting since matrix init + // comes before pointing device init. + keyboard_config.raw = eeconfig_read_kb(); +#ifdef POINTING_DEVICE_ENABLE + if (keyboard_config.dpi_config > DPI_OPTION_SIZE) { + eeconfig_init_kb(); + } +#endif + matrix_init_user(); +} + +void keyboard_post_init_kb(void) { +#ifdef POINTING_DEVICE_ENABLE + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); +#endif +#ifdef RGBLIGHT_ENABLE + rgblight_toggle_noeeprom(); //double toggle post init removes the weirdness with rgb strips having a yellow first LED + rgblight_toggle_noeeprom(); +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE + tap_toggle(); // Need it to reevaluate this setting after initiating so that it is current after init + tap_toggle(); +#endif + keyboard_post_init_user(); +#ifdef OLED_ENABLE // purposefully after user post init to allow the RGB to startup first + wait_ms(200); // Avoids a startup issue where the oled renders and then turns off with blackpill + oled_on(); +#endif +} + + + diff --git a/keyboards/mechwild/sugarglider/sugarglider.h b/keyboards/mechwild/sugarglider/sugarglider.h index bc6c95343b9e..f6fca42fe145 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.h +++ b/keyboards/mechwild/sugarglider/sugarglider.h @@ -31,3 +31,30 @@ k20, k21, k22, k23, k24, k25, sw3, k26, k27, k28, k29, k2A, k2B, \ { k34, k35, k36, k37, k38, sw6 }, \ { sw1, sw2, sw3, ___, ___, sw5 } \ } + +typedef union { + uint32_t raw; + struct { + uint8_t dpi_config; + int16_t dt_term_config; + }; +} keyboard_config_t; + +extern keyboard_config_t keyboard_config; +extern uint16_t dpi_array[]; + +enum keyboard_keycodes { +#ifdef VIA_ENABLE + DPI_UP = USER00, +#else + DPI_UP = SAFE_RANGE, +#endif + DPI_DN, + DPI_FINE, + TAP_UP, + TAP_DN, + TAP_ON, + TAP_OFF, + TAP_TOG, + NEW_SAFE_RANGE +}; From d2a085c8f7a36e98d3bffcf6691b0bc88ecb98e9 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Wed, 6 Jul 2022 00:24:45 -0400 Subject: [PATCH 04/25] working on config options --- .../sugarglider/keymaps/default/keymap.c | 27 +-- keyboards/mechwild/sugarglider/sugarglider.c | 214 +++++++++--------- 2 files changed, 121 insertions(+), 120 deletions(-) diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c index 73070de9efb2..b75d2ca20150 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -7,7 +7,7 @@ void keyboard_post_init_user(void) { // Customise these values to desired behaviour - //debug_enable=true; + debug_enable=true; //debug_matrix=true; //debug_keyboard=true; //debug_mouse=true; @@ -64,9 +64,9 @@ layer_state_t layer_state_set_user(layer_state_t state) { } -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_90; // flips the display 90 degrees + return OLED_ROTATION_270; // flips the display 270 degrees } static void render_logo(void) { // Render MechWild "MW" Logo @@ -84,24 +84,24 @@ layer_state_t layer_state_set_user(layer_state_t state) { oled_write_P(logo_4, false); } - void oled_task_user(void) { - render_logo(); + bool oled_task_user(void) { + render_logo(); oled_set_cursor(0,6); oled_write_ln_P(PSTR("Layer"), false); switch (get_highest_layer(layer_state)) { - case _QWERTY: - oled_write_ln_P(PSTR("BASE"), false); + case 0: + oled_write_ln_P(PSTR("Base"), false); break; - case _LOWER: - oled_write_ln_P(PSTR("Lower"), false); + case 1: + oled_write_ln_P(PSTR("FN 1"), false); break; - case _RAISE: - oled_write_ln_P(PSTR("Raise"), false); + case 2: + oled_write_ln_P(PSTR("FN 2"), false); break; - case _ADJUST: - oled_write_ln_P(PSTR("Adjst"), false); + case 3: + oled_write_ln_P(PSTR("FN 3"), false); break; default: oled_write_ln_P(PSTR("Undef"), false); @@ -112,5 +112,6 @@ layer_state_t layer_state_set_user(layer_state_t state) { oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + return false; } #endif diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index 7e90aee7f66c..ea02b06f4a28 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -115,113 +115,113 @@ bool led_update_kb(led_t led_state) { return res; } -#ifdef OLED_ENABLE // OLED Functionality -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; // flips the display 180 degrees -} - -bool clear_screen = true; // used to manage singular screen clears to prevent display glitch -bool clear_screen_art = true; // used to manage singular screen clears to prevent display glitch -static void render_name(void) { // Render Puckbuddy "Get Puck'd" text - static const char PROGMEM name_1[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xB6, 0xB6, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x00}; - static const char PROGMEM name_2[] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xB6, 0xB6, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0x00}; - static const char PROGMEM name_3[] = {0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xB6, 0xB6, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0x00}; - oled_set_cursor(0,0); - oled_write_P(name_1, false); - oled_set_cursor(0,1); - oled_write_P(name_2, false); - oled_set_cursor(0,2); - oled_write_P(name_3, false); -} - -static void render_logo(void) { // Render MechWild "MW" Logo - static const char PROGMEM logo_1[] = {0x97, 0x98, 0x99, 0x9A,0x00}; - static const char PROGMEM logo_2[] = {0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0x00}; - static const char PROGMEM logo_3[] = {0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xB6, 0x00}; - static const char PROGMEM logo_4[] = {0xB6, 0xB6, 0xB6, 0x9B, 0x9C, 0x9D, 0x9E, 0x00}; - oled_set_cursor(0,0); - oled_write_P(logo_1, false); - oled_set_cursor(0,1); - oled_write_P(logo_2, false); - oled_set_cursor(0,2); - oled_write_P(logo_3, false); - oled_set_cursor(0,3); - oled_write_P(logo_4, false); -} - -bool oled_task_kb(void) { - if(!oled_task_user()) { - return false; - } - if ( IS_HOST_LED_OFF(USB_LED_NUM_LOCK) && IS_HOST_LED_OFF(USB_LED_CAPS_LOCK) && IS_HOST_LED_OFF(USB_LED_SCROLL_LOCK) && get_highest_layer(layer_state) == 0 ) { - if (clear_screen_art == true) { - oled_clear(); - oled_render(); - clear_screen_art = false; - } - render_name(); - oled_set_cursor(0,3); -#ifdef POINTING_DEVICE_ENABLE - oled_write_P(PSTR(" DPI:"), false); - oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); -#endif -#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically - oled_write_P(PSTR(" TAP:"), false); - if (keyboard_config.dt_term_config < 0) { - oled_write_P(PSTR("Off "), false); - } else { - oled_write(get_u16_str(g_tapping_term, ' '), false); - } -#endif - clear_screen = true; - } else { - if (clear_screen == true) { - oled_clear(); - oled_render(); - clear_screen = false; - } - render_logo(); - oled_set_cursor(8,1); - switch (get_highest_layer(layer_state)) { - case 0: - oled_write_P(PSTR("Layer 0"), false); - break; - case 1: - oled_write_P(PSTR("Layer 1"), false); - break; - case 2: - oled_write_P(PSTR("Layer 2"), false); - break; - case 3: - oled_write_P(PSTR("Layer 3"), false); - break; - default: - oled_write_P(PSTR("Layer ?"), false); // Should never display, here as a catchall - } - led_t led_state = host_keyboard_led_state(); - oled_set_cursor(8,0); - oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); - oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); - oled_write_P(led_state.scroll_lock ? PSTR("SCR") : PSTR(" "), false); -#ifdef POINTING_DEVICE_ENABLE - oled_set_cursor(8,2); - oled_write_P(PSTR("DPI:"), false); - oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); -#endif -#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically - oled_set_cursor(8,3); - oled_write_P(PSTR("TAP:"), false); - if (keyboard_config.dt_term_config < 0) { - oled_write_P(PSTR("Off "), false); - } else { - oled_write(get_u16_str(g_tapping_term, ' '), false); - } -#endif - clear_screen_art = true; - } - return true; -} -#endif +//#ifdef OLED_ENABLE // OLED Functionality +//oled_rotation_t oled_init_user(oled_rotation_t rotation) { +// return OLED_ROTATION_180; // flips the display 180 degrees +//} +// +//bool clear_screen = true; // used to manage singular screen clears to prevent display glitch +//bool clear_screen_art = true; // used to manage singular screen clears to prevent display glitch +//static void render_name(void) { // Render Puckbuddy "Get Puck'd" text +// static const char PROGMEM name_1[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xB6, 0xB6, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x00}; +// static const char PROGMEM name_2[] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xB6, 0xB6, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0x00}; +// static const char PROGMEM name_3[] = {0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xB6, 0xB6, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0x00}; +// oled_set_cursor(0,0); +// oled_write_P(name_1, false); +// oled_set_cursor(0,1); +// oled_write_P(name_2, false); +// oled_set_cursor(0,2); +// oled_write_P(name_3, false); +//} +// +//static void render_logo(void) { // Render MechWild "MW" Logo +// static const char PROGMEM logo_1[] = {0x97, 0x98, 0x99, 0x9A,0x00}; +// static const char PROGMEM logo_2[] = {0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0x00}; +// static const char PROGMEM logo_3[] = {0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xB6, 0x00}; +// static const char PROGMEM logo_4[] = {0xB6, 0xB6, 0xB6, 0x9B, 0x9C, 0x9D, 0x9E, 0x00}; +// oled_set_cursor(0,0); +// oled_write_P(logo_1, false); +// oled_set_cursor(0,1); +// oled_write_P(logo_2, false); +// oled_set_cursor(0,2); +// oled_write_P(logo_3, false); +// oled_set_cursor(0,3); +// oled_write_P(logo_4, false); +//} +// +//bool oled_task_kb(void) { +// if(!oled_task_user()) { +// return false; +// } +// if ( IS_HOST_LED_OFF(USB_LED_NUM_LOCK) && IS_HOST_LED_OFF(USB_LED_CAPS_LOCK) && IS_HOST_LED_OFF(USB_LED_SCROLL_LOCK) && get_highest_layer(layer_state) == 0 ) { +// if (clear_screen_art == true) { +// oled_clear(); +// oled_render(); +// clear_screen_art = false; +// } +// render_name(); +// oled_set_cursor(0,3); +//#ifdef POINTING_DEVICE_ENABLE +// oled_write_P(PSTR(" DPI:"), false); +// oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); +//#endif +//#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically +// oled_write_P(PSTR(" TAP:"), false); +// if (keyboard_config.dt_term_config < 0) { +// oled_write_P(PSTR("Off "), false); +// } else { +// oled_write(get_u16_str(g_tapping_term, ' '), false); +// } +//#endif +// clear_screen = true; +// } else { +// if (clear_screen == true) { +// oled_clear(); +// oled_render(); +// clear_screen = false; +// } +// render_logo(); +// oled_set_cursor(8,1); +// switch (get_highest_layer(layer_state)) { +// case 0: +// oled_write_P(PSTR("Layer 0"), false); +// break; +// case 1: +// oled_write_P(PSTR("Layer 1"), false); +// break; +// case 2: +// oled_write_P(PSTR("Layer 2"), false); +// break; +// case 3: +// oled_write_P(PSTR("Layer 3"), false); +// break; +// default: +// oled_write_P(PSTR("Layer ?"), false); // Should never display, here as a catchall +// } +// led_t led_state = host_keyboard_led_state(); +// oled_set_cursor(8,0); +// oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); +// oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); +// oled_write_P(led_state.scroll_lock ? PSTR("SCR") : PSTR(" "), false); +//#ifdef POINTING_DEVICE_ENABLE +// oled_set_cursor(8,2); +// oled_write_P(PSTR("DPI:"), false); +// oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); +//#endif +//#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically +// oled_set_cursor(8,3); +// oled_write_P(PSTR("TAP:"), false); +// if (keyboard_config.dt_term_config < 0) { +// oled_write_P(PSTR("Off "), false); +// } else { +// oled_write(get_u16_str(g_tapping_term, ' '), false); +// } +//#endif +// clear_screen_art = true; +// } +// return true; +//} +//#endif bool process_record_kb(uint16_t keycode, keyrecord_t* record) { switch(keycode) { From d8de9af22102b714ab202a4d5a10a58a5893ae41 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Mon, 22 Aug 2022 21:43:26 -0400 Subject: [PATCH 05/25] Removing conflict old puckbuddy files --- keyboards/mechwild/puckbuddy/config.h | 159 --------- keyboards/mechwild/puckbuddy/glcdfont.c | 231 ------------- keyboards/mechwild/puckbuddy/halconf.h | 13 - keyboards/mechwild/puckbuddy/info.json | 25 -- .../puckbuddy/keymaps/default/keymap.c | 60 ---- .../mechwild/puckbuddy/keymaps/via/keymap.c | 60 ---- .../mechwild/puckbuddy/keymaps/via/rules.mk | 1 - .../mechwild/puckbuddy/ld/STM32F401xE.ld | 88 ----- keyboards/mechwild/puckbuddy/mcuconf.h | 12 - keyboards/mechwild/puckbuddy/post_rules.mk | 7 - keyboards/mechwild/puckbuddy/puckbuddy.c | 307 ------------------ keyboards/mechwild/puckbuddy/puckbuddy.h | 55 ---- keyboards/mechwild/puckbuddy/readme.md | 27 -- keyboards/mechwild/puckbuddy/rules.mk | 27 -- 14 files changed, 1072 deletions(-) delete mode 100644 keyboards/mechwild/puckbuddy/config.h delete mode 100644 keyboards/mechwild/puckbuddy/glcdfont.c delete mode 100644 keyboards/mechwild/puckbuddy/halconf.h delete mode 100644 keyboards/mechwild/puckbuddy/info.json delete mode 100644 keyboards/mechwild/puckbuddy/keymaps/default/keymap.c delete mode 100644 keyboards/mechwild/puckbuddy/keymaps/via/keymap.c delete mode 100644 keyboards/mechwild/puckbuddy/keymaps/via/rules.mk delete mode 100644 keyboards/mechwild/puckbuddy/ld/STM32F401xE.ld delete mode 100644 keyboards/mechwild/puckbuddy/mcuconf.h delete mode 100644 keyboards/mechwild/puckbuddy/post_rules.mk delete mode 100644 keyboards/mechwild/puckbuddy/puckbuddy.c delete mode 100644 keyboards/mechwild/puckbuddy/puckbuddy.h delete mode 100644 keyboards/mechwild/puckbuddy/readme.md delete mode 100644 keyboards/mechwild/puckbuddy/rules.mk diff --git a/keyboards/mechwild/puckbuddy/config.h b/keyboards/mechwild/puckbuddy/config.h deleted file mode 100644 index fac68071bbad..000000000000 --- a/keyboards/mechwild/puckbuddy/config.h +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x6D77 // mw = "MechWild" -#define PRODUCT_ID 0x170F -#define DEVICE_VER 0x0100 -#define MANUFACTURER MechWild -#define PRODUCT PuckBuddy - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 4 - -#ifdef UF2_BUILD -#define EXTERNAL_EEPROM_BYTE_COUNT 2048 -#define EXTERNAL_EEPROM_PAGE_SIZE 128 -#define EXTERNAL_EEPROM_ADDRESS_SIZE 1 -#define EXTERNAL_EEPROM_WRITE_TIME 0 -#define FEE_PAGE_BASE_ADDRESS 0x08008000 -#endif - -/* Define custom font */ -#define OLED_FONT_H "keyboards/mechwild/puckbuddy/glcdfont.c" - -/* allows the "key" button on the blackpill to toggle caps lock for user testing before soldering */ -#define DIP_SWITCH_PINS { A0 } - -/* status light pins using the on board LED for the blackpill */ -#define LED_CAPS_LOCK_PIN C13 -#define LED_PIN_ON_STATE 0 - -/* set the tapping term for glidepoint pad to register a tap click */ -//#define CIRQUE_PINNACLE_TAPPING_TERM 0 // This is set to 0 to disable it - -/* TAPPING_TERM value is used for the CIRQUE_PINNACLE_TAPPING_TERM as well by default - * defining it this way allows us to easily modify it with DYNAMIC_TAPPING_TERM_ENABLE - */ -#define TAPPING_TERM 0 - -/* - * 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 { B12, B13, B14, B15 } -#define MATRIX_COL_PINS { B10, A8, B4, B5 } -#define UNUSED_PINS - -/* spi config */ -#define SPI_DRIVER SPID1 -#define SPI_SCK_PIN A5 -#define SPI_SCK_PAL_MODE 5 -#define SPI_MOSI_PIN A7 -#define SPI_MOSI_PAL_MODE 5 -#define SPI_MISO_PIN A6 -#define SPI_MISO_PAL_MODE 5 -#define CIRQUE_PINNACLE_SPI_DIVISOR 8 -#define CIRQUE_PINNACLE_SPI_CS_PIN A4 - -/* encoder pins */ -#define ENCODERS_PAD_A { B1, B3 } -#define ENCODERS_PAD_B { B0, A15 } - -/* encoder resolution */ -#define ENCODER_RESOLUTION 4 -#define TAP_CODE_DELAY 10 - -/* COL2ROW, ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* RGB settings, uncomment this define to enable RGB */ -#define RGB_DI_PIN A3 -#ifdef RGB_DI_PIN -# define RGBLED_NUM 3 -# 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 */ -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_RAINBOW_MOOD -# define RGBLIGHT_EFFECT_RAINBOW_SWIRL -# define RGBLIGHT_EFFECT_SNAKE -# define RGBLIGHT_EFFECT_KNIGHT -# define RGBLIGHT_EFFECT_CHRISTMAS -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -# define RGBLIGHT_EFFECT_RGB_TEST -# define RGBLIGHT_EFFECT_ALTERNATING -/*== customize breathing effect ==*/ -/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ -//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 -/*==== use exp() and sin() ====*/ -//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 -//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 -#endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 5 - -/* 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 - -/* Bootmagic Lite key configuration */ -//#define BOOTMAGIC_LITE_ROW 0 -//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/mechwild/puckbuddy/glcdfont.c b/keyboards/mechwild/puckbuddy/glcdfont.c deleted file mode 100644 index 942f81dd060e..000000000000 --- a/keyboards/mechwild/puckbuddy/glcdfont.c +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "progmem.h" - -const unsigned char font[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, - 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, - 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, - 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, - 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, - 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, - 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, - 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, - 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, - 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, - 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, - 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, - 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, - 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, - 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, - 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, - 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, - 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, - 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, - 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, - 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, - 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, - 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, - 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, - 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, - 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, - 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, - 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, - 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, - 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, - 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, - 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, - 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, - 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, - 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, - 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, - 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, - 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, - 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, - 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, - 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, - 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, - 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, - 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, - 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, - 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, - 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, - 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, - 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, - 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, - 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, - 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, - 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, - 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, - 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, - 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, - 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, - 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, - 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, - 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, - 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, - 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, - 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, - 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, - 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, - 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, - 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, - 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, - 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, - 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, - 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, - 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, - 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, - 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF0, - 0x78, 0x1C, 0x0E, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x0E, 0x0C, 0x0C, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, - 0xC0, 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, - 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x07, 0x0E, 0x1C, - 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFC, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE0, 0x78, 0x1E, 0x00, - 0x00, 0x00, 0x00, 0xF8, 0xF8, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x00, 0x00, 0x00, 0xE0, 0xFE, 0xFF, - 0xFE, 0xF8, 0xC0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE0, 0xFC, 0xFF, 0xFE, - 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x3E, - 0xE0, 0x80, 0x70, 0x0E, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x07, 0x3C, 0xE0, - 0x80, 0x78, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, - 0x70, 0x30, 0x30, 0x30, 0xB0, 0xF0, - 0xF0, 0x00, 0xFE, 0xFF, 0x33, 0x31, - 0x31, 0x31, 0x31, 0x31, 0x31, 0x33, - 0x3F, 0x1C, 0x00, 0x00, 0x00, 0x00, - 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x08, 0x0C, 0x0E, 0x07, - 0x03, 0x03, 0x00, 0x00, 0x00, 0xFF, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0xF8, 0xFE, 0x0F, - 0x07, 0x03, 0x03, 0x03, 0x03, 0x02, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0xE0, 0xF0, 0x38, 0x1F, 0x0F, 0x00, - 0x00, 0x00, 0x80, 0xE0, 0x70, 0x38, - 0x18, 0x18, 0x18, 0xFF, 0xFF, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x40, 0xC0, 0xF0, 0xFC, 0x7E, 0x4E, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, - 0x07, 0x1F, 0xFF, 0xFE, 0xF0, 0xC0, - 0xF8, 0xFF, 0x7F, 0x0F, 0x07, 0x7F, - 0xFF, 0xFE, 0xFC, 0x04, 0x04, 0x78, - 0x80, 0x00, 0x00, 0x00, 0xC0, 0x38, - 0x0C, 0x1C, 0x60, 0x80, 0x00, 0x00, - 0x00, 0xF0, 0x0C, 0x04, 0xF4, 0x1C, - 0x80, 0xC0, 0xFC, 0xE6, 0xC3, 0xC1, - 0xC1, 0xC3, 0xE6, 0xFC, 0xC0, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x03, 0x06, 0x0E, 0x0C, 0x0C, 0x0C, - 0x0C, 0x0C, 0x0C, 0x0E, 0x07, 0x03, - 0x00, 0x00, 0x01, 0x03, 0x07, 0x06, - 0x0E, 0x0C, 0x0C, 0x0C, 0x06, 0x06, - 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1F, 0x0F, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x07, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, - 0x0C, 0x06, 0x07, 0x03, 0x1F, 0x1F, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, - 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x06, - 0x06, 0x00, 0x00, 0x00, 0x1F, 0x1F, - 0x00, 0x01, 0x07, 0x0E, 0x18, 0x10, - 0x00, 0x00, 0x07, 0x1F, 0x18, 0x30, - 0x30, 0x30, 0x30, 0x1F, 0x0F, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x3C, 0x3C, 0x1C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x1F, 0x1F, 0x1F, 0x07, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x1F, 0x1F, - 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x07, 0x1F, 0x1F, 0x1E, 0xF8, 0x00, - 0x0F, 0x70, 0x30, 0x0E, 0xC1, 0x38, - 0x07, 0x0E, 0x70, 0x83, 0x1C, 0x60, - 0x1E, 0x03, 0xC0, 0x3E, 0x01, 0x00, - 0x3F, 0x7F, 0xFF, 0xFF, 0xF9, 0xC0, - 0xC0, 0xF9, 0xFF, 0xFF, 0x7F, 0x3F, -}; diff --git a/keyboards/mechwild/puckbuddy/halconf.h b/keyboards/mechwild/puckbuddy/halconf.h deleted file mode 100644 index 07e8cdd17b68..000000000000 --- a/keyboards/mechwild/puckbuddy/halconf.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) -// SPDX-License-Identifier: GPL-2.0-or-later - - -#pragma once - -#define HAL_USE_I2C TRUE - -#define HAL_USE_SPI TRUE -#define SPI_USE_WAIT TRUE -#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD - -#include_next diff --git a/keyboards/mechwild/puckbuddy/info.json b/keyboards/mechwild/puckbuddy/info.json deleted file mode 100644 index 2770335e17ac..000000000000 --- a/keyboards/mechwild/puckbuddy/info.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "keyboard_name": "MechWild PuckBuddy", - "url": "mechwild.com", - "maintainer": "Kyle McCreery", - "layouts": { - "LAYOUT": { - "layout": [ - {"label":"k00", "x":0, "y":0}, - {"label":"k01", "x":1.5, "y":0}, - {"label":"k02", "x":2.5, "y":0}, - {"label":"k03", "x":3.5, "y":0}, - {"label":"k05", "x":5, "y":0}, - {"label":"k10", "x":0, "y":1.25}, - {"label":"k15", "x":5, "y":1.25}, - {"label":"k20", "x":0, "y":2.25}, - {"label":"k25", "x":5, "y":2.25}, - {"label":"k30", "x":0, "y":3.25}, - {"label":"k35", "x":5, "y":3.25}, - {"label":"k31", "x":1, "y":4.5}, - {"label":"k32", "x":2, "y":4.5}, - {"label":"k33", "x":3, "y":4.5}, - {"label":"k34", "x":4, "y":4.5}] - } - } -} diff --git a/keyboards/mechwild/puckbuddy/keymaps/default/keymap.c b/keyboards/mechwild/puckbuddy/keymaps/default/keymap.c deleted file mode 100644 index a61f170d90db..000000000000 --- a/keyboards/mechwild/puckbuddy/keymaps/default/keymap.c +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include QMK_KEYBOARD_H - -// Defines names for use in layer keycodes and the keymap -enum layer_names { - _BASE, - _FN1, - _FN2, - _FN3 -}; - -/* Physical Layout: - * /-------------------\ - * |ENC| 1 | 2 | 3 |ENC| - * |---+---'---'---+---| - * | 4 | | 5 | - * |---| |---| - * | 6 | | 7 | - * |---| |---| - * | 8 | | 9 | - * \-----,---,---,-----/ - * | A | B | C | D | - * \---'---'---'---/ - * - * Keymap Layout: - * ENC, 1, 2, 3, ENC, - * 4, 5, - * 6, 7, - * 8, A, B, C, D, 9, - * - */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT( - KC_MUTE, MO(_FN3), MO(_FN2), MO(_FN1), LGUI(KC_D), - MO(_FN2), KC_HOME, - MO(_FN3), KC_END, - KC_BTN3, KC_BTN1, KC_BTN2, KC_BTN2, KC_BTN1, DPI_FINE - ), - [_FN1] = LAYOUT( - RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, TAP_TOG, - DPI_UP, TAP_UP, - DPI_DN, TAP_DN, - KC_TRNS, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_TRNS - ), - [_FN2] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, - KC_TRNS, RGB_MOD, - KC_TRNS, RGB_RMOD, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), - [_FN3] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ) -}; diff --git a/keyboards/mechwild/puckbuddy/keymaps/via/keymap.c b/keyboards/mechwild/puckbuddy/keymaps/via/keymap.c deleted file mode 100644 index a61f170d90db..000000000000 --- a/keyboards/mechwild/puckbuddy/keymaps/via/keymap.c +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include QMK_KEYBOARD_H - -// Defines names for use in layer keycodes and the keymap -enum layer_names { - _BASE, - _FN1, - _FN2, - _FN3 -}; - -/* Physical Layout: - * /-------------------\ - * |ENC| 1 | 2 | 3 |ENC| - * |---+---'---'---+---| - * | 4 | | 5 | - * |---| |---| - * | 6 | | 7 | - * |---| |---| - * | 8 | | 9 | - * \-----,---,---,-----/ - * | A | B | C | D | - * \---'---'---'---/ - * - * Keymap Layout: - * ENC, 1, 2, 3, ENC, - * 4, 5, - * 6, 7, - * 8, A, B, C, D, 9, - * - */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT( - KC_MUTE, MO(_FN3), MO(_FN2), MO(_FN1), LGUI(KC_D), - MO(_FN2), KC_HOME, - MO(_FN3), KC_END, - KC_BTN3, KC_BTN1, KC_BTN2, KC_BTN2, KC_BTN1, DPI_FINE - ), - [_FN1] = LAYOUT( - RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, TAP_TOG, - DPI_UP, TAP_UP, - DPI_DN, TAP_DN, - KC_TRNS, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_TRNS - ), - [_FN2] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, - KC_TRNS, RGB_MOD, - KC_TRNS, RGB_RMOD, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), - [_FN3] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ) -}; diff --git a/keyboards/mechwild/puckbuddy/keymaps/via/rules.mk b/keyboards/mechwild/puckbuddy/keymaps/via/rules.mk deleted file mode 100644 index 1e5b99807cb7..000000000000 --- a/keyboards/mechwild/puckbuddy/keymaps/via/rules.mk +++ /dev/null @@ -1 +0,0 @@ -VIA_ENABLE = yes diff --git a/keyboards/mechwild/puckbuddy/ld/STM32F401xE.ld b/keyboards/mechwild/puckbuddy/ld/STM32F401xE.ld deleted file mode 100644 index daec7d858347..000000000000 --- a/keyboards/mechwild/puckbuddy/ld/STM32F401xE.ld +++ /dev/null @@ -1,88 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - * STM32F401xE memory setup. - */ -MEMORY -{ - flash0 (rx) : org = 0x08000000, len = 16k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ - flash1 (rx) : org = 0x08004000, len = 16k - flash2 (rx) : org = 0x08008000, len = 16k /* emulated eeprom */ - flash3 (rx) : org = 0x0800C000, len = 16k - flash4 (rx) : org = 0x08010000, len = 512k - 64k - flash5 (rx) : org = 0x00000000, len = 0 - flash6 (rx) : org = 0x00000000, len = 0 - flash7 (rx) : org = 0x00000000, len = 0 - ram0 (wx) : org = 0x20000000, len = 96k - ram1 (wx) : org = 0x00000000, len = 0 - ram2 (wx) : org = 0x00000000, len = 0 - ram3 (wx) : org = 0x00000000, len = 0 - ram4 (wx) : org = 0x00000000, len = 0 - ram5 (wx) : org = 0x00000000, len = 0 - ram6 (wx) : org = 0x00000000, len = 0 - ram7 (wx) : org = 0x00000000, len = 0 -} - -/* For each data/text section two region are defined, a virtual region - and a load region (_LMA suffix).*/ - -/* Flash region to be used for exception vectors.*/ -REGION_ALIAS("VECTORS_FLASH", flash4); -REGION_ALIAS("VECTORS_FLASH_LMA", flash4); - -/* Flash region to be used for constructors and destructors.*/ -REGION_ALIAS("XTORS_FLASH", flash4); -REGION_ALIAS("XTORS_FLASH_LMA", flash4); - -/* Flash region to be used for code text.*/ -REGION_ALIAS("TEXT_FLASH", flash4); -REGION_ALIAS("TEXT_FLASH_LMA", flash4); - -/* Flash region to be used for read only data.*/ -REGION_ALIAS("RODATA_FLASH", flash4); -REGION_ALIAS("RODATA_FLASH_LMA", flash4); - -/* Flash region to be used for various.*/ -REGION_ALIAS("VARIOUS_FLASH", flash4); -REGION_ALIAS("VARIOUS_FLASH_LMA", flash4); - -/* Flash region to be used for RAM(n) initialization data.*/ -REGION_ALIAS("RAM_INIT_FLASH_LMA", flash4); - -/* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts.*/ -REGION_ALIAS("MAIN_STACK_RAM", ram0); - -/* RAM region to be used for the process stack. This is the stack used by - the main() function.*/ -REGION_ALIAS("PROCESS_STACK_RAM", ram0); - -/* RAM region to be used for data segment.*/ -REGION_ALIAS("DATA_RAM", ram0); -REGION_ALIAS("DATA_RAM_LMA", flash4); - -/* RAM region to be used for BSS segment.*/ -REGION_ALIAS("BSS_RAM", ram0); - -/* RAM region to be used for the default heap.*/ -REGION_ALIAS("HEAP_RAM", ram0); - -/* Generic rules inclusion.*/ -INCLUDE rules.ld - -/* TinyUF2 bootloader reset support */ -_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ diff --git a/keyboards/mechwild/puckbuddy/mcuconf.h b/keyboards/mechwild/puckbuddy/mcuconf.h deleted file mode 100644 index f71868d78e63..000000000000 --- a/keyboards/mechwild/puckbuddy/mcuconf.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include_next - -#undef STM32_I2C_USE_I2C1 -#define STM32_I2C_USE_I2C1 TRUE - -#undef STM32_SPI_USE_SPI1 -#define STM32_SPI_USE_SPI1 TRUE diff --git a/keyboards/mechwild/puckbuddy/post_rules.mk b/keyboards/mechwild/puckbuddy/post_rules.mk deleted file mode 100644 index ac527500d2fe..000000000000 --- a/keyboards/mechwild/puckbuddy/post_rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(strip $(BOOTLOADER)), tinyuf2) - ifndef EEPROM_DRIVER - MCU_LDSCRIPT = STM32F401xE - EEPROM_DRIVER = vendor - UF2_BUILD = yes - endif -endif \ No newline at end of file diff --git a/keyboards/mechwild/puckbuddy/puckbuddy.c b/keyboards/mechwild/puckbuddy/puckbuddy.c deleted file mode 100644 index b82d06f56516..000000000000 --- a/keyboards/mechwild/puckbuddy/puckbuddy.c +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "puckbuddy.h" - -#ifndef GLIDEPOINT_DPI_OPTIONS -# define GLIDEPOINT_DPI_OPTIONS \ - { 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 3600, 4000 } -# ifndef GLIDEPOINT_DPI_DEFAULT -# define GLIDEPOINT_DPI_DEFAULT 1 -# endif -#endif -#ifndef GLIDEPOINT_DPI_DEFAULT -# define GLIDEPOINT_DPI_DEFAULT 1 -#endif - -keyboard_config_t keyboard_config; -uint16_t dpi_array[] = GLIDEPOINT_DPI_OPTIONS; -#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) - -void board_init(void) { - // B9 is configured as I2C1_SDA in the board file; that function must be - // disabled before using B7 as I2C1_SDA. - setPinInputHigh(B9); -} - -#ifdef DYNAMIC_TAPPING_TERM_ENABLE -void tap_modify(int change_value, bool tap_status) { - if (keyboard_config.dt_term_config < 0) { - keyboard_config.dt_term_config *= -1; - } - - keyboard_config.dt_term_config += change_value; - - if (tap_status == false ) { - keyboard_config.dt_term_config *= -1; - g_tapping_term = 0; - } else { - g_tapping_term = keyboard_config.dt_term_config; - } - eeconfig_update_kb(keyboard_config.raw); -} - -void tap_toggle(void) { - keyboard_config.dt_term_config *= -1; - if (keyboard_config.dt_term_config > 0) { - g_tapping_term = keyboard_config.dt_term_config; - } else { - g_tapping_term = 0; - } - eeconfig_update_kb(keyboard_config.raw); -} -#endif - -#ifdef DIP_SWITCH_ENABLE -bool dip_switch_update_kb(uint8_t index, bool active) { - if (!dip_switch_update_user(index, active)) { return false; } - switch (index) { - case 0: - if(active) { tap_code(KC_CLCK); } - break; - break; - } - return true; -} -#endif - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - case 1: - if (clockwise) { - tap_code(KC_PGUP); - } else { - tap_code(KC_PGDN); - } - break; - } - return true; -} -#endif - -#ifdef OLED_ENABLE // OLED Functionality -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; // flips the display 180 degrees -} - -bool clear_screen = true; // used to manage singular screen clears to prevent display glitch -bool clear_screen_art = true; // used to manage singular screen clears to prevent display glitch -static void render_name(void) { // Render Puckbuddy "Get Puck'd" text - static const char PROGMEM name_1[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xB6, 0xB6, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x00}; - static const char PROGMEM name_2[] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xB6, 0xB6, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0x00}; - static const char PROGMEM name_3[] = {0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xB6, 0xB6, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0x00}; - oled_set_cursor(0,0); - oled_write_P(name_1, false); - oled_set_cursor(0,1); - oled_write_P(name_2, false); - oled_set_cursor(0,2); - oled_write_P(name_3, false); -} - -static void render_logo(void) { // Render MechWild "MW" Logo - static const char PROGMEM logo_1[] = {0x97, 0x98, 0x99, 0x9A,0x00}; - static const char PROGMEM logo_2[] = {0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0x00}; - static const char PROGMEM logo_3[] = {0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xB6, 0x00}; - static const char PROGMEM logo_4[] = {0xB6, 0xB6, 0xB6, 0x9B, 0x9C, 0x9D, 0x9E, 0x00}; - oled_set_cursor(0,0); - oled_write_P(logo_1, false); - oled_set_cursor(0,1); - oled_write_P(logo_2, false); - oled_set_cursor(0,2); - oled_write_P(logo_3, false); - oled_set_cursor(0,3); - oled_write_P(logo_4, false); -} - -bool oled_task_kb(void) { - if(!oled_task_user()) { - return false; - } - if ( IS_HOST_LED_OFF(USB_LED_NUM_LOCK) && IS_HOST_LED_OFF(USB_LED_CAPS_LOCK) && IS_HOST_LED_OFF(USB_LED_SCROLL_LOCK) && get_highest_layer(layer_state) == 0 ) { - if (clear_screen_art == true) { - oled_clear(); - oled_render(); - clear_screen_art = false; - } - render_name(); - oled_set_cursor(0,3); -#ifdef POINTING_DEVICE_ENABLE - oled_write_P(PSTR(" DPI:"), false); - oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); -#endif -#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically - oled_write_P(PSTR(" TAP:"), false); - if (keyboard_config.dt_term_config < 0) { - oled_write_P(PSTR("Off "), false); - } else { - oled_write(get_u16_str(g_tapping_term, ' '), false); - } -#endif - clear_screen = true; - } else { - if (clear_screen == true) { - oled_clear(); - oled_render(); - clear_screen = false; - } - render_logo(); - oled_set_cursor(8,1); - switch (get_highest_layer(layer_state)) { - case 0: - oled_write_P(PSTR("Layer 0"), false); - break; - case 1: - oled_write_P(PSTR("Layer 1"), false); - break; - case 2: - oled_write_P(PSTR("Layer 2"), false); - break; - case 3: - oled_write_P(PSTR("Layer 3"), false); - break; - default: - oled_write_P(PSTR("Layer ?"), false); // Should never display, here as a catchall - } - led_t led_state = host_keyboard_led_state(); - oled_set_cursor(8,0); - oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); - oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); - oled_write_P(led_state.scroll_lock ? PSTR("SCR") : PSTR(" "), false); -#ifdef POINTING_DEVICE_ENABLE - oled_set_cursor(8,2); - oled_write_P(PSTR("DPI:"), false); - oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); -#endif -#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically - oled_set_cursor(8,3); - oled_write_P(PSTR("TAP:"), false); - if (keyboard_config.dt_term_config < 0) { - oled_write_P(PSTR("Off "), false); - } else { - oled_write(get_u16_str(g_tapping_term, ' '), false); - } -#endif - clear_screen_art = true; - } - return true; -} -#endif - -bool process_record_kb(uint16_t keycode, keyrecord_t* record) { - switch(keycode) { -#ifdef POINTING_DEVICE_ENABLE - case DPI_UP: - if (record->event.pressed) { - keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE; - eeconfig_update_kb(keyboard_config.raw); - pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); - } - return false; - case DPI_DN: - if (record->event.pressed) { - if (keyboard_config.dpi_config > 0) { - keyboard_config.dpi_config = (keyboard_config.dpi_config - 1) % DPI_OPTION_SIZE; - } else { - keyboard_config.dpi_config = DPI_OPTION_SIZE - 1; - } - eeconfig_update_kb(keyboard_config.raw); - pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); - } - return false; - case DPI_FINE: - if (record->event.pressed) { - pointing_device_set_cpi(dpi_array[0]); - } else { - pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); - } - return false; -#endif -#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only include tap info keycodes if it is being configured dynamically - case TAP_UP: - if (record->event.pressed) { - tap_modify(DYNAMIC_TAPPING_TERM_INCREMENT, true); - } - return false; - case TAP_DN: - if (record->event.pressed) { - if (keyboard_config.dt_term_config > 0) { - tap_modify(-1 * DYNAMIC_TAPPING_TERM_INCREMENT, true); - } - } - return false; - case TAP_ON: - if (record->event.pressed) { - tap_modify(0, true); - } - return false; - case TAP_OFF: - if (record->event.pressed) { - tap_modify(0, false); - } - return false; - case TAP_TOG: - if (record->event.pressed) { - tap_toggle(); - } - return false; -#endif - } - return process_record_user(keycode, record); -} - -void pointing_device_init_kb(void) { -#ifdef POINTING_DEVICE_ENABLE - pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); -#endif -} - -void eeconfig_init_kb(void) { -#ifdef POINTING_DEVICE_ENABLE - keyboard_config.dpi_config = GLIDEPOINT_DPI_DEFAULT; -#endif -#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only set tap term from eeprom if it is being configured dynamically - keyboard_config.dt_term_config = TAPPING_TERM; -#endif - eeconfig_update_kb(keyboard_config.raw); - eeconfig_init_user(); -} - -void matrix_init_kb(void) { - // is safe to just read DPI setting since matrix init - // comes before pointing device init. - keyboard_config.raw = eeconfig_read_kb(); -#ifdef POINTING_DEVICE_ENABLE - if (keyboard_config.dpi_config > DPI_OPTION_SIZE) { - eeconfig_init_kb(); - } -#endif - matrix_init_user(); -} - -void keyboard_post_init_kb(void) { -#ifdef POINTING_DEVICE_ENABLE - pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); -#endif -#ifdef RGBLIGHT_ENABLE - rgblight_toggle_noeeprom(); //double toggle post init removes the weirdness with rgb strips having a yellow first LED - rgblight_toggle_noeeprom(); -#endif -#ifdef DYNAMIC_TAPPING_TERM_ENABLE - tap_toggle(); // Need it to reevaluate this setting after initiating so that it is current after init - tap_toggle(); -#endif - keyboard_post_init_user(); -#ifdef OLED_ENABLE // purposefully after user post init to allow the RGB to startup first - wait_ms(200); // Avoids a startup issue where the oled renders and then turns off with blackpill - oled_on(); -#endif -} diff --git a/keyboards/mechwild/puckbuddy/puckbuddy.h b/keyboards/mechwild/puckbuddy/puckbuddy.h deleted file mode 100644 index 89de464cd6ef..000000000000 --- a/keyboards/mechwild/puckbuddy/puckbuddy.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "quantum.h" - -#define ___ KC_NO - -/* This is a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ -#define LAYOUT( \ - k00, k01, k02, k03, k05,\ - k10, k15,\ - k20, k25,\ - k30, k31, k32, k33, k34, k35 \ -) { \ - { k00, k01, k05, k31 }, \ - { k10, k02, k15, k32 }, \ - { k20, k03, k25, k33 }, \ - { k30, ___, k35, k34 } \ -} - -typedef union { - uint32_t raw; - struct { - uint8_t dpi_config; - int16_t dt_term_config; - }; -} keyboard_config_t; - -extern keyboard_config_t keyboard_config; -extern uint16_t dpi_array[]; - -enum keyboard_keycodes { -#ifdef VIA_ENABLE - DPI_UP = USER00, -#else - DPI_UP = SAFE_RANGE, -#endif - DPI_DN, - DPI_FINE, - TAP_UP, - TAP_DN, - TAP_ON, - TAP_OFF, - TAP_TOG, - NEW_SAFE_RANGE -}; diff --git a/keyboards/mechwild/puckbuddy/readme.md b/keyboards/mechwild/puckbuddy/readme.md deleted file mode 100644 index 276378a1e2cb..000000000000 --- a/keyboards/mechwild/puckbuddy/readme.md +++ /dev/null @@ -1,27 +0,0 @@ -# PuckBuddy - -![PuckBuddy](https://i.imgur.com/iSVAHJzh.png) - -A macropad with a Cirque Glidepoint Trackpad in the middle, powered by the STM32 Blackpill. - -* Keyboard Maintainer: [Kyle McCreery](https://github.com/kylemccreery) -* Hardware Supported: PuckBuddy v1.0 -* Hardware Availability: [PuckBuddy on MechWild](https://mechwild.com/product/puckbuddy/) - -Make example for this keyboard (after setting up your build environment): - - make mechwild/puckbuddy:default - -Flashing example for this keyboard: - - make mechwild/puckbuddy: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). - -## Bootloader - -Enter the bootloader in 3 ways: - -* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (assigned to the top left key) and plug in the keyboard while holding it. -* **Physical reset button**: Press and hold the boot0 button on the blackpill, tap and release the nrst button on the blackpill, then release the boot0 button. -* **Keycode in layout**: Press the key mapped to `RESET` if it is available. By default this is the top right key on layer 1. \ No newline at end of file diff --git a/keyboards/mechwild/puckbuddy/rules.mk b/keyboards/mechwild/puckbuddy/rules.mk deleted file mode 100644 index b7699320647b..000000000000 --- a/keyboards/mechwild/puckbuddy/rules.mk +++ /dev/null @@ -1,27 +0,0 @@ -# MCU name -MCU = STM32F401 - -# Bootloader selection -BOOTLOADER = stm32-dfu - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -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 -NKRO_ENABLE = no # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = yes # Encoder Enabled -OLED_ENABLE = yes # OLED Enabled -OLED_DRIVER = SSD1306 # OLED Driver -DIP_SWITCH_ENABLE = yes # Dip Switch Enabled - -POINTING_DEVICE_ENABLE = yes # Pointing Device Enabled -POINTING_DEVICE_DRIVER = cirque_pinnacle_spi # Pointing Device Driver - -DYNAMIC_TAPPING_TERM_ENABLE = yes # Enable Dynamic Tapping Term to control the Tap term for the Cirque Pad easily From 09f9cfe7122dbfed0cd0aa0f6fa7f4b09f046ef2 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Mon, 31 Oct 2022 12:04:35 -0400 Subject: [PATCH 06/25] cleaning up --- keyboards/mechwild/sugarglider/config.h | 4 ++-- keyboards/mechwild/sugarglider/sugarglider.c | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h index c3e967143df1..bd5039632499 100644 --- a/keyboards/mechwild/sugarglider/config.h +++ b/keyboards/mechwild/sugarglider/config.h @@ -59,8 +59,8 @@ #define CIRQUE_PINNACLE_SPI_CS_PIN A3 /* encoder pins */ -#define ENCODERS_PAD_A { B0, B3, B9 } -#define ENCODERS_PAD_B { A2, A15, B8 } +#define ENCODERS_PAD_B { B0, B3, B9, C15 } +#define ENCODERS_PAD_A { A2, A15, B8, C14 } /* encoder resolution */ #define ENCODER_RESOLUTION 4 diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index ea02b06f4a28..40ee6e5b1f7e 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -94,6 +94,13 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { tap_code(KC_PGDN); } break; + case 3: + if (clockwise) { + tap_code(KC_WH_U); + } else { + tap_code(KC_WH_D); + } + break; } return true; } From 730500201f4d58f78124dec4856c1d95dc929df6 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Wed, 15 Feb 2023 11:27:00 -0500 Subject: [PATCH 07/25] prepping for actual push --- keyboards/mechwild/sugarglider/config.h | 13 ++---- keyboards/mechwild/sugarglider/info.json | 13 ++++-- .../sugarglider/keymaps/default/keymap.c | 40 +++++++++---------- keyboards/mechwild/sugarglider/rules.mk | 2 +- keyboards/mechwild/sugarglider/sugarglider.c | 11 +++-- 5 files changed, 42 insertions(+), 37 deletions(-) diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h index bd5039632499..4a61da0bea6b 100644 --- a/keyboards/mechwild/sugarglider/config.h +++ b/keyboards/mechwild/sugarglider/config.h @@ -5,17 +5,12 @@ #include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x6D77 // mw = "MechWild" -#define PRODUCT_ID 0x1710 -#define DEVICE_VER 0x0001 -#define MANUFACTURER MechWild -#define PRODUCT SugarGlider - /* Matrix COL and ROW definitions */ #define MATRIX_ROWS 9 #define MATRIX_COLS 6 +#define OLED_DISPLAY_128X64 + /* Status light pins */ //#define LED_NUM_LOCK_PIN B12 //#define LED_CAPS_LOCK_PIN B13 @@ -70,9 +65,9 @@ #define DIODE_DIRECTION COL2ROW /* RGB settings, uncomment this define to enable RGB */ -//#define RGB_DI_PIN B5 +#define RGB_DI_PIN B5 #ifdef RGB_DI_PIN -# define RGBLED_NUM 6 +# define RGBLED_NUM 10 # define RGBLIGHT_HUE_STEP 8 # define RGBLIGHT_SAT_STEP 8 # define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/mechwild/sugarglider/info.json b/keyboards/mechwild/sugarglider/info.json index 07f7680d9168..6e78fddbf6de 100644 --- a/keyboards/mechwild/sugarglider/info.json +++ b/keyboards/mechwild/sugarglider/info.json @@ -1,7 +1,14 @@ { - "manufacturer": "Kyle McCreery", - "keyboard_name": "mechwild/sugarglider", - "maintainer": "kylemccreery", + "keyboard_name": "SugarGlider", + "manufacturer": "MechWild", + "url": "mechwild.com", + "maintainer": "Kyle McCreery", + "usb": { + "vid": "0x6D77", + "pid": "0x1710", + "device_version": "0.0.2" + }, + "layouts": { "LAYOUT_ortho_4x4": { "layout": [ diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c index b75d2ca20150..e91bd2e36569 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -31,9 +31,9 @@ k20, k21, k22, k23, k24, k25, k50, k51, k52, k53, k54, k55, \ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ENT, KC_NLCK, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_MUTE, KC_CLCK, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, - KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GESC, KC_SLCK, KC_RGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ENT, KC_NUM, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_MUTE, KC_CAPS, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, QK_GESC, KC_SCRL, KC_RGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MUTE, KC_LCTL, KC_LALT, MO(_LOWER), KC_H, KC_H, KC_H, MO(_RAISE), KC_SPC, KC_RSFT, KC_MUTE ), @@ -66,27 +66,27 @@ layer_state_t layer_state_set_user(layer_state_t state) { #ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_270; // flips the display 270 degrees + return OLED_ROTATION_180; // flips the display 270 degrees } - static void render_logo(void) { // Render MechWild "MW" Logo - static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; - static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; - static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; - static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; - oled_set_cursor(0,0); - oled_write_P(logo_1, false); - oled_set_cursor(0,1); - oled_write_P(logo_2, false); - oled_set_cursor(0,2); - oled_write_P(logo_3, false); - oled_set_cursor(0,3); - oled_write_P(logo_4, false); - } + //static void render_logo(void) { // Render MechWild "MW" Logo + // static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; + // static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; + // static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; + // static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; + // oled_set_cursor(0,0); + // oled_write_P(logo_1, false); + // oled_set_cursor(0,1); + // oled_write_P(logo_2, false); + // oled_set_cursor(0,2); + // oled_write_P(logo_3, false); + // oled_set_cursor(0,3); + // oled_write_P(logo_4, false); + //} bool oled_task_user(void) { - render_logo(); - oled_set_cursor(0,6); + //render_logo(); + oled_set_cursor(0,0); oled_write_ln_P(PSTR("Layer"), false); diff --git a/keyboards/mechwild/sugarglider/rules.mk b/keyboards/mechwild/sugarglider/rules.mk index 9f9efd04fb8a..f4978368a334 100644 --- a/keyboards/mechwild/sugarglider/rules.mk +++ b/keyboards/mechwild/sugarglider/rules.mk @@ -15,7 +15,7 @@ CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = yes # Encoder Enabled OLED_ENABLE = yes # OLED Enabled diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index 40ee6e5b1f7e..0c3e050817c4 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -25,6 +25,9 @@ void board_init(void) { setPinOutput(B12); setPinOutput(B13); setPinOutput(B14); + writePinLow(B12); + writePinLow(B13); + writePinLow(B14); setPinOutput(C13); } @@ -61,7 +64,7 @@ bool dip_switch_update_kb(uint8_t index, bool active) { if (!dip_switch_update_user(index, active)) { return false; } switch (index) { case 0: - if(active) { tap_code(KC_CLCK); } + if(active) { tap_code(KC_CAPS); } break; break; } @@ -114,9 +117,9 @@ bool led_update_kb(led_t led_state) { // it low/0 turns it on, and high/1 turns the LED off. // This behavior depends on whether the LED is between the pin // and VCC or the pin and GND. - writePin(B12, !led_state.num_lock); - writePin(B13, !led_state.caps_lock); - writePin(B14, !led_state.scroll_lock); + writePin(B12, led_state.num_lock); + writePin(B13, led_state.caps_lock); + writePin(B14, led_state.scroll_lock); writePin(C13, !led_state.caps_lock); } return res; From dceb9e81f8870dbdbf52468172f264cc2cd3b1f6 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Wed, 22 Feb 2023 15:24:40 -0500 Subject: [PATCH 08/25] prepping for final pr --- keyboards/mechwild/sugarglider/info.json | 74 +++++++++++++++++------- keyboards/mechwild/sugarglider/readme.md | 14 ++--- 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/keyboards/mechwild/sugarglider/info.json b/keyboards/mechwild/sugarglider/info.json index 6e78fddbf6de..703e36ad7d97 100644 --- a/keyboards/mechwild/sugarglider/info.json +++ b/keyboards/mechwild/sugarglider/info.json @@ -1,5 +1,5 @@ { - "keyboard_name": "SugarGlider", + "keyboard_name": "Sugar Glider", "manufacturer": "MechWild", "url": "mechwild.com", "maintainer": "Kyle McCreery", @@ -8,27 +8,61 @@ "pid": "0x1710", "device_version": "0.0.2" }, - "layouts": { - "LAYOUT_ortho_4x4": { + "LAYOUT": { "layout": [ - { "matrix": [0, 0], "x": 0, "y": 0 }, - { "matrix": [0, 1], "x": 1, "y": 0 }, - { "matrix": [0, 2], "x": 2, "y": 0 }, - { "matrix": [0, 3], "x": 3, "y": 0 }, - { "matrix": [1, 0], "x": 0, "y": 1 }, - { "matrix": [1, 1], "x": 1, "y": 1 }, - { "matrix": [1, 2], "x": 2, "y": 1 }, - { "matrix": [1, 3], "x": 3, "y": 1 }, - { "matrix": [2, 0], "x": 0, "y": 2 }, - { "matrix": [2, 1], "x": 1, "y": 2 }, - { "matrix": [2, 2], "x": 2, "y": 2 }, - { "matrix": [2, 3], "x": 3, "y": 2 }, - { "matrix": [3, 0], "x": 0, "y": 3 }, - { "matrix": [3, 1], "x": 1, "y": 3 }, - { "matrix": [3, 2], "x": 2, "y": 3 }, - { "matrix": [3, 3], "x": 3, "y": 3 } + { "matrix": [0, 0], "x":0, "y":0}, + { "matrix": [0, 1], "x":1, "y":0}, + { "matrix": [0, 2], "x":2, "y":0}, + { "matrix": [0, 3], "x":3, "y":0}, + { "matrix": [0, 4], "x":4, "y":0}, + { "matrix": [0, 5], "x":5, "y":0}, + { "matrix": [8, 0], "x":9, "y":0}, + { "matrix": [4, 0], "x":10.5, "y":0}, + { "matrix": [4, 1], "x":11.5, "y":0}, + { "matrix": [4, 2], "x":12.5, "y":0}, + { "matrix": [4, 3], "x":13.5, "y":0}, + { "matrix": [4, 4], "x":14.5, "y":0}, + { "matrix": [4, 5], "x":15.5, "y":0}, + { "matrix": [1, 0], "x":0, "y":1}, + { "matrix": [1, 1], "x":1, "y":1}, + { "matrix": [1, 2], "x":2, "y":1}, + { "matrix": [1, 3], "x":3, "y":1}, + { "matrix": [1, 4], "x":4, "y":1}, + { "matrix": [1, 5], "x":5, "y":1}, + { "matrix": [8, 5], "x":8, "y":1}, + { "matrix": [8, 1], "x":9, "y":1}, + { "matrix": [5, 0], "x":10.5, "y":1}, + { "matrix": [5, 1], "x":11.5, "y":1}, + { "matrix": [5, 2], "x":12.5, "y":1}, + { "matrix": [5, 3], "x":13.5, "y":1}, + { "matrix": [5, 4], "x":14.5, "y":1}, + { "matrix": [5, 5], "x":15.5, "y":1}, + { "matrix": [2, 0], "x":0, "y":2}, + { "matrix": [2, 1], "x":1, "y":2}, + { "matrix": [2, 2], "x":2, "y":2}, + { "matrix": [2, 3], "x":3, "y":2}, + { "matrix": [2, 4], "x":4, "y":2}, + { "matrix": [2, 5], "x":5, "y":2}, + { "matrix": [8, 2], "x":9, "y":2}, + { "matrix": [6, 0], "x":10.5, "y":2}, + { "matrix": [6, 1], "x":11.5, "y":2}, + { "matrix": [6, 2], "x":12.5, "y":2}, + { "matrix": [6, 3], "x":13.5, "y":2}, + { "matrix": [6, 4], "x":14.5, "y":2}, + { "matrix": [6, 5], "x":15.5, "y":2}, + { "matrix": [3, 0], "x":2.25, "y":3.5}, + { "matrix": [3, 1], "x":3.5, "y":3.5, "h":1.5}, + { "matrix": [3, 2], "x":4.5, "y":3.5, "h":1.5}, + { "matrix": [3, 3], "x":5.5, "y":3.5, "h":1.5}, + { "matrix": [3, 4], "x":6.75, "y":3.5}, + { "matrix": [7, 0], "x":7.75, "y":3.5}, + { "matrix": [7, 1], "x":8.75, "y":3.5}, + { "matrix": [7, 2], "x":10, "y":3.5, "h":1.5}, + { "matrix": [7, 3], "x":11, "y":3.5, "h":1.5}, + { "matrix": [7, 4], "x":12, "y":3.5, "h":1.5}, + { "matrix": [7, 5], "x":13.25, "y":3.5} ] } } -} \ No newline at end of file +} diff --git a/keyboards/mechwild/sugarglider/readme.md b/keyboards/mechwild/sugarglider/readme.md index 623295bbf8f1..df6942eed271 100644 --- a/keyboards/mechwild/sugarglider/readme.md +++ b/keyboards/mechwild/sugarglider/readme.md @@ -1,12 +1,12 @@ # mechwild/sugarglider -![mechwild/sugarglider](imgur.com image replace me!) +![mechwild/sugarglider](https://i.imgur.com/IYhOU3xh.jpg) -*A short description of the keyboard/project* +The Sugar Glider is an ergonomic keyboard with columnar stagger and a central touchpad, OLED, and status LEDs. * Keyboard Maintainer: [Kyle McCreery](https://github.com/kylemccreery) -* Hardware Supported: *The PCBs, controllers supported* -* Hardware Availability: *Links to where you can find this hardware* +* Hardware Supported: Sugar Glider v0.2 +* Hardware Availability: [Sugar Glider on MechWild](https://mechwild.com/product/sugar-glider/) Make example for this keyboard (after setting up your build environment): @@ -22,6 +22,6 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to Enter the bootloader in 3 ways: -* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard -* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead -* **Keycode in layout**: Press the key mapped to `RESET` if it is available +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (assigned to the top left key) and plug in the keyboard while holding it. +* **Physical reset button**: Press and hold the boot0 button on the blackpill, tap and release the nrst button on the blackpill, then release the boot0 button. +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available. By default this is the top right key on layer 1. From 363f8f356569e93282af54685000f7fd865b6e40 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Thu, 23 Feb 2023 09:31:05 -0500 Subject: [PATCH 09/25] more prep for pr --- keyboards/mechwild/sugarglider/f401/rules.mk | 6 ++++++ keyboards/mechwild/sugarglider/f411/rules.mk | 6 ++++++ keyboards/mechwild/sugarglider/rules.mk | 9 ++------- 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 keyboards/mechwild/sugarglider/f401/rules.mk create mode 100644 keyboards/mechwild/sugarglider/f411/rules.mk diff --git a/keyboards/mechwild/sugarglider/f401/rules.mk b/keyboards/mechwild/sugarglider/f401/rules.mk new file mode 100644 index 000000000000..1b21bbaf7705 --- /dev/null +++ b/keyboards/mechwild/sugarglider/f401/rules.mk @@ -0,0 +1,6 @@ +# MCU name +MCU = STM32F401 +BOARD = BLACKPILL_STM32_F401 + +# Bootloader selection +BOOTLOADER = stm32-dfu diff --git a/keyboards/mechwild/sugarglider/f411/rules.mk b/keyboards/mechwild/sugarglider/f411/rules.mk new file mode 100644 index 000000000000..c25a64f4b3b6 --- /dev/null +++ b/keyboards/mechwild/sugarglider/f411/rules.mk @@ -0,0 +1,6 @@ +# MCU name +MCU = STM32F411 +BOARD = BLACKPILL_STM32_F411 + +# Bootloader selection +BOOTLOADER = stm32-dfu diff --git a/keyboards/mechwild/sugarglider/rules.mk b/keyboards/mechwild/sugarglider/rules.mk index f4978368a334..9946c0788572 100644 --- a/keyboards/mechwild/sugarglider/rules.mk +++ b/keyboards/mechwild/sugarglider/rules.mk @@ -1,10 +1,3 @@ -# MCU name -MCU = STM32F401 -BOARD = BLACKPILL_STM32_F401 - -# Bootloader selection -BOOTLOADER = stm32-dfu - # Build Options # change yes to no to disable # @@ -35,3 +28,5 @@ CUSTOM_MATRIX = lite VPATH += drivers/gpio SRC += mcp23018.c matrix.c QUANTUM_LIB_SRC += i2c_master.c + +DEFAULT_FOLDER = mechwild/sugarglider/f401 From 08aaf9e3e556aa5823c46b2fe100caaeed4f0772 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Thu, 23 Feb 2023 09:58:57 -0500 Subject: [PATCH 10/25] updated license date to prep for pr --- keyboards/mechwild/sugarglider/config.h | 2 +- keyboards/mechwild/sugarglider/glcdfont.c | 2 +- keyboards/mechwild/sugarglider/halconf.h | 2 +- keyboards/mechwild/sugarglider/keymaps/default/keymap.c | 2 +- keyboards/mechwild/sugarglider/matrix.c | 2 +- keyboards/mechwild/sugarglider/mcuconf.h | 2 +- keyboards/mechwild/sugarglider/sugarglider.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h index 4a61da0bea6b..f1222ac8d033 100644 --- a/keyboards/mechwild/sugarglider/config.h +++ b/keyboards/mechwild/sugarglider/config.h @@ -1,4 +1,4 @@ -// Copyright 2022 Kyle McCreery +// Copyright 2023 Kyle McCreery // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/keyboards/mechwild/sugarglider/glcdfont.c b/keyboards/mechwild/sugarglider/glcdfont.c index 942f81dd060e..6a78af23cbce 100644 --- a/keyboards/mechwild/sugarglider/glcdfont.c +++ b/keyboards/mechwild/sugarglider/glcdfont.c @@ -1,4 +1,4 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) +// Copyright 2023 Kyle McCreery (@kylemccreery) // SPDX-License-Identifier: GPL-2.0-or-later #include "progmem.h" diff --git a/keyboards/mechwild/sugarglider/halconf.h b/keyboards/mechwild/sugarglider/halconf.h index ec9f04c2ede8..23a1dc04b397 100644 --- a/keyboards/mechwild/sugarglider/halconf.h +++ b/keyboards/mechwild/sugarglider/halconf.h @@ -1,4 +1,4 @@ -// Copyright 2022 Kyle McCreery +// Copyright 2023 Kyle McCreery // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c index e91bd2e36569..b41420f5430a 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -// Copyright 2022 Kyle McCreery +// Copyright 2023 Kyle McCreery // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H diff --git a/keyboards/mechwild/sugarglider/matrix.c b/keyboards/mechwild/sugarglider/matrix.c index 0971e814e494..fe7e5218543a 100644 --- a/keyboards/mechwild/sugarglider/matrix.c +++ b/keyboards/mechwild/sugarglider/matrix.c @@ -1,4 +1,4 @@ -// Copyright 2022 Kyle McCreery +// Copyright 2023 Kyle McCreery // SPDX-License-Identifier: GPL-2.0-or-later #include "matrix.h" diff --git a/keyboards/mechwild/sugarglider/mcuconf.h b/keyboards/mechwild/sugarglider/mcuconf.h index f71868d78e63..7fe577090926 100644 --- a/keyboards/mechwild/sugarglider/mcuconf.h +++ b/keyboards/mechwild/sugarglider/mcuconf.h @@ -1,4 +1,4 @@ -// Copyright 2022 Kyle McCreery (@kylemccreery) +// Copyright 2023 Kyle McCreery (@kylemccreery) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index 0c3e050817c4..9cd5ed2e021c 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -1,4 +1,4 @@ -// Copyright 2022 Kyle McCreery +// Copyright 2023 Kyle McCreery // SPDX-License-Identifier: GPL-2.0-or-later #include "sugarglider.h" From fe4fe97aec280a83f46c3a4a458bd1724e052253 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Thu, 23 Feb 2023 16:13:30 -0500 Subject: [PATCH 11/25] wip pr prep --- keyboards/mechwild/sugarglider/config.h | 4 +- keyboards/mechwild/sugarglider/glcdfont.c | 164 ++++++------- keyboards/mechwild/sugarglider/info.json | 2 +- .../sugarglider/keymaps/default/keymap.c | 128 +++++----- keyboards/mechwild/sugarglider/sugarglider.c | 232 ++++++++++-------- 5 files changed, 269 insertions(+), 261 deletions(-) diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h index f1222ac8d033..45cdcab07c46 100644 --- a/keyboards/mechwild/sugarglider/config.h +++ b/keyboards/mechwild/sugarglider/config.h @@ -18,6 +18,7 @@ //#define LED_PIN_ON_STATE 0 #define USB_POLLING_INTERVAL_MS 1 +#define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X /* Memory definitions for UF2 builds */ #ifdef UF2_BUILD @@ -41,7 +42,8 @@ * defining it this way allows us to easily modify it with DYNAMIC_TAPPING_TERM_ENABLE */ #define TAPPING_TERM 0 - +#define CIRQUE_PINNACLE_TAP_ENABLE +#define POINTING_DEVICE_GESTURES_SCROLL_ENABLE /* spi config */ #define SPI_DRIVER SPID1 #define SPI_SCK_PIN A5 diff --git a/keyboards/mechwild/sugarglider/glcdfont.c b/keyboards/mechwild/sugarglider/glcdfont.c index 6a78af23cbce..2a0353759d33 100644 --- a/keyboards/mechwild/sugarglider/glcdfont.c +++ b/keyboards/mechwild/sugarglider/glcdfont.c @@ -1,4 +1,4 @@ -// Copyright 2023 Kyle McCreery (@kylemccreery) +// Copyright 2023 Kyle McCreery // SPDX-License-Identifier: GPL-2.0-or-later #include "progmem.h" @@ -104,7 +104,7 @@ const unsigned char font[] PROGMEM = { 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, - 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7E, 0x00, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, @@ -132,100 +132,100 @@ const unsigned char font[] PROGMEM = { 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF0, - 0x78, 0x1C, 0x0E, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x0E, 0x0C, 0x0C, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, - 0xC0, 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, - 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x07, 0x0E, 0x1C, - 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFC, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE0, 0x78, 0x1E, 0x00, - 0x00, 0x00, 0x00, 0xF8, 0xF8, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0xE0, 0xFE, 0xFF, 0xFE, 0xF8, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFC, 0xFF, 0xFE, - 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3E, 0xE0, 0x80, 0x70, 0x0E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07, 0x3C, 0xE0, 0x80, 0x78, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, - 0x70, 0x30, 0x30, 0x30, 0xB0, 0xF0, - 0xF0, 0x00, 0xFE, 0xFF, 0x33, 0x31, - 0x31, 0x31, 0x31, 0x31, 0x31, 0x33, - 0x3F, 0x1C, 0x00, 0x00, 0x00, 0x00, - 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x08, 0x0C, 0x0E, 0x07, - 0x03, 0x03, 0x00, 0x00, 0x00, 0xFF, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0xF8, 0xFE, 0x0F, - 0x07, 0x03, 0x03, 0x03, 0x03, 0x02, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0xE0, 0xF0, 0x38, 0x1F, 0x0F, 0x00, - 0x00, 0x00, 0x80, 0xE0, 0x70, 0x38, - 0x18, 0x18, 0x18, 0xFF, 0xFF, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x40, 0xC0, 0xF0, 0xFC, 0x7E, 0x4E, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x07, 0x1F, 0xFF, 0xFE, 0xF0, 0xC0, - 0xF8, 0xFF, 0x7F, 0x0F, 0x07, 0x7F, - 0xFF, 0xFE, 0xFC, 0x04, 0x04, 0x78, - 0x80, 0x00, 0x00, 0x00, 0xC0, 0x38, - 0x0C, 0x1C, 0x60, 0x80, 0x00, 0x00, + 0xF8, 0xFF, 0xF7, 0x07, 0x07, 0x7F, + 0xFF, 0xFF, 0xF8, 0x00, 0xC0, 0x38, + 0x0C, 0x18, 0x60, 0x80, 0x00, 0x00, 0x00, 0xF0, 0x0C, 0x04, 0xF4, 0x1C, - 0x80, 0xC0, 0xFC, 0xE6, 0xC3, 0xC1, - 0xC1, 0xC3, 0xE6, 0xFC, 0xC0, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x03, 0x06, 0x0E, 0x0C, 0x0C, 0x0C, - 0x0C, 0x0C, 0x0C, 0x0E, 0x07, 0x03, - 0x00, 0x00, 0x01, 0x03, 0x07, 0x06, - 0x0E, 0x0C, 0x0C, 0x0C, 0x06, 0x06, - 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1F, 0x0F, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x07, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, - 0x0C, 0x06, 0x07, 0x03, 0x1F, 0x1F, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, - 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x06, - 0x06, 0x00, 0x00, 0x00, 0x1F, 0x1F, - 0x00, 0x01, 0x07, 0x0E, 0x18, 0x10, - 0x00, 0x00, 0x07, 0x1F, 0x18, 0x30, - 0x30, 0x30, 0x30, 0x1F, 0x0F, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x3C, 0x3C, 0x1C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1F, 0x1F, - 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x07, 0x1F, 0x1F, 0x1E, 0xF8, 0x00, - 0x0F, 0x70, 0x30, 0x0E, 0xC1, 0x38, + 0x0F, 0x01, 0x03, 0x06, 0xF8, 0x00, + 0x07, 0x7F, 0x3F, 0x0E, 0xC1, 0x38, 0x07, 0x0E, 0x70, 0x83, 0x1C, 0x60, 0x1E, 0x03, 0xC0, 0x3E, 0x01, 0x00, + 0x80, 0xC0, 0xFC, 0xE6, 0xC3, 0xC1, + 0xC1, 0xC3, 0xE6, 0xFC, 0xC0, 0x80, 0x3F, 0x7F, 0xFF, 0xFF, 0xF9, 0xC0, 0xC0, 0xF9, 0xFF, 0xFF, 0x7F, 0x3F, + 0x00, 0x80, 0x40, 0x40, 0xC0, 0xC0, + 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF8, 0x86, 0xC1, 0xC1, + 0x41, 0x41, 0x81, 0x01, 0x01, 0x01, + 0x02, 0x06, 0x18, 0x60, 0x80, 0x00, + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0E, 0xF1, 0x00, 0x00, 0x00, 0x00, + 0x81, 0xC7, 0xCF, 0xFF, 0xB1, 0x01, + 0x1F, 0x7F, 0x7F, 0x1F, 0x01, 0xB1, + 0xFF, 0xDF, 0xC7, 0x83, 0x01, 0x00, + 0x00, 0x00, 0xE0, 0xDF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x1C, + 0xE0, 0x00, 0x00, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x0B, 0x15, 0x22, 0x40, 0x41, + 0x80, 0x41, 0x7E, 0x0C, 0x0C, 0x1C, + 0x1C, 0x3C, 0x3C, 0x3C, 0x7C, 0x7C, + 0x7C, 0x78, 0x7B, 0xFE, 0xC6, 0x84, + 0x03, 0x0F, 0x0F, 0x0E, 0x0D, 0x07, + 0x50, 0x78, 0x78, 0x50, 0x07, 0x0F, + 0x0F, 0x0F, 0x0E, 0x07, 0x04, 0xC6, + 0xFE, 0x7B, 0x79, 0x7D, 0x7E, 0x7C, + 0x3C, 0x3C, 0x3C, 0x1C, 0x1C, 0x0C, + 0x3F, 0x46, 0x41, 0x80, 0x41, 0x40, + 0x21, 0x15, 0x0B, 0x04, 0x00, 0x00, + 0x01, 0x06, 0x38, 0xE0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x03, 0x02, 0x04, 0x08, 0x08, 0x08, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, + 0x08, 0x0C, 0x04, 0x02, 0x01, 0x00, + 0xF0, 0x1C, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xC7, 0x78, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xF0, 0xE0, 0xC0, + 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xE0, + 0xF8, 0xBF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1C, 0x3A, + 0x51, 0x21, 0x60, 0x40, 0x21, 0x33, + 0x1F, 0x07, 0x07, 0x07, 0x0F, 0x37, + 0x27, 0x27, 0x46, 0x46, 0x46, 0x46, + 0x4E, 0x4F, 0x4F, 0x4F, 0x47, 0x47, + 0x43, 0x41, 0x41, 0x23, 0x27, 0x1F, + 0x0F, 0x0F, 0x0F, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x0F, 0x17, 0x23, 0x41, + 0x40, 0x60, 0x21, 0x75, 0x3A, 0x14, + 0x00, 0x00, 0x00, 0xE0, 0xFE, 0xFF, + 0xFE, 0xF8, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0xFC, 0xFF, 0xFE, + 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF8, 0xFF, 0xF7, 0x07, + 0x07, 0x1F, 0xFF, 0xFE, 0xF0, 0xC0, + 0xF8, 0x3F, 0x8F, 0x0F, 0x3F, 0xFF, + 0xFF, 0xFE, 0x80, 0xF0, 0x0C, 0x04, + 0xF4, 0x1C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1F, 0x1F, 0x1F, 0x07, 0x06, + 0xF8, 0x00, 0x00, 0x73, 0x3F, 0x0F, + 0xC1, 0x38, 0x07, 0x0F, 0x70, 0x83, + 0x07, 0x7F, 0x1F, 0x03, 0xC0, 0x3F, + 0x01, 0x3E, 0xE0, 0x80, 0x70, 0x0E, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x3C, 0xE0, 0x80, 0x78, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; diff --git a/keyboards/mechwild/sugarglider/info.json b/keyboards/mechwild/sugarglider/info.json index 703e36ad7d97..dc4233d3645a 100644 --- a/keyboards/mechwild/sugarglider/info.json +++ b/keyboards/mechwild/sugarglider/info.json @@ -6,7 +6,7 @@ "usb": { "vid": "0x6D77", "pid": "0x1710", - "device_version": "0.0.2" + "device_version": "0.2.0" }, "layouts": { "LAYOUT": { diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c index b41420f5430a..6900885a6b36 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -7,7 +7,7 @@ void keyboard_post_init_user(void) { // Customise these values to desired behaviour - debug_enable=true; + //debug_enable=true; //debug_matrix=true; //debug_keyboard=true; //debug_mouse=true; @@ -21,36 +21,25 @@ enum layer_names { _ADJUST }; -/* -k00, k01, k02, k03, k04, k05, k30, k31, k32, k33, k34, k35, \ -k10, k11, k12, k13, k14, k15, k40, k41, k42, k43, k44, k45, \ -k20, k21, k22, k23, k24, k25, k50, k51, k52, k53, k54, k55, \ - k63, k64, k65, k60, k61, k62 \ -*/ - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ENT, KC_NUM, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_MUTE, KC_CAPS, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, - KC_Z, KC_X, KC_C, KC_V, KC_B, QK_GESC, KC_SCRL, KC_RGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ENT, TAP_UP, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_MUTE, TAP_DN, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, QK_GESC, MO(_LOWER), KC_RGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MUTE, KC_LCTL, KC_LALT, MO(_LOWER), KC_H, KC_H, KC_H, MO(_RAISE), KC_SPC, KC_RSFT, KC_MUTE ), - [_LOWER] = LAYOUT( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_TRNS, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, DPI_UP, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DPI_DN, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - [_RAISE] = LAYOUT( KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_TRNS, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(_QWERTY), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - [_ADJUST] = LAYOUT( KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_RMOD, RGB_TOG, @@ -63,55 +52,54 @@ layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } - -#ifdef OLED_ENABLE - oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; // flips the display 270 degrees - } - - //static void render_logo(void) { // Render MechWild "MW" Logo - // static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; - // static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; - // static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; - // static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; - // oled_set_cursor(0,0); - // oled_write_P(logo_1, false); - // oled_set_cursor(0,1); - // oled_write_P(logo_2, false); - // oled_set_cursor(0,2); - // oled_write_P(logo_3, false); - // oled_set_cursor(0,3); - // oled_write_P(logo_4, false); - //} - - bool oled_task_user(void) { - //render_logo(); - oled_set_cursor(0,0); - - oled_write_ln_P(PSTR("Layer"), false); - - switch (get_highest_layer(layer_state)) { - case 0: - oled_write_ln_P(PSTR("Base"), false); - break; - case 1: - oled_write_ln_P(PSTR("FN 1"), false); - break; - case 2: - oled_write_ln_P(PSTR("FN 2"), false); - break; - case 3: - oled_write_ln_P(PSTR("FN 3"), false); - break; - default: - oled_write_ln_P(PSTR("Undef"), false); - } - oled_write_ln_P(PSTR(""), false); - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); - oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); - oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); - return false; - } -#endif +//#ifdef OLED_ENABLE +// oled_rotation_t oled_init_user(oled_rotation_t rotation) { +// return OLED_ROTATION_180; // flips the display 270 degrees +// } +// +// //static void render_logo(void) { // Render MechWild "MW" Logo +// // static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; +// // static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; +// // static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; +// // static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; +// // oled_set_cursor(0,0); +// // oled_write_P(logo_1, false); +// // oled_set_cursor(0,1); +// // oled_write_P(logo_2, false); +// // oled_set_cursor(0,2); +// // oled_write_P(logo_3, false); +// // oled_set_cursor(0,3); +// // oled_write_P(logo_4, false); +// //} +// +// bool oled_task_user(void) { +// //render_logo(); +// oled_set_cursor(0,0); +// +// oled_write_ln_P(PSTR("Layer"), false); +// +// switch (get_highest_layer(layer_state)) { +// case 0: +// oled_write_ln_P(PSTR("Base"), false); +// break; +// case 1: +// oled_write_ln_P(PSTR("FN 1"), false); +// break; +// case 2: +// oled_write_ln_P(PSTR("FN 2"), false); +// break; +// case 3: +// oled_write_ln_P(PSTR("FN 3"), false); +// break; +// default: +// oled_write_ln_P(PSTR("Undef"), false); +// } +// oled_write_ln_P(PSTR(""), false); +// // Host Keyboard LED Status +// led_t led_state = host_keyboard_led_state(); +// oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); +// oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); +// oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); +// return false; +// } +//#endif diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index 9cd5ed2e021c..fa18834a5781 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -125,113 +125,131 @@ bool led_update_kb(led_t led_state) { return res; } -//#ifdef OLED_ENABLE // OLED Functionality -//oled_rotation_t oled_init_user(oled_rotation_t rotation) { -// return OLED_ROTATION_180; // flips the display 180 degrees -//} -// -//bool clear_screen = true; // used to manage singular screen clears to prevent display glitch -//bool clear_screen_art = true; // used to manage singular screen clears to prevent display glitch -//static void render_name(void) { // Render Puckbuddy "Get Puck'd" text -// static const char PROGMEM name_1[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xB6, 0xB6, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x00}; -// static const char PROGMEM name_2[] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xB6, 0xB6, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0x00}; -// static const char PROGMEM name_3[] = {0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xB6, 0xB6, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0x00}; -// oled_set_cursor(0,0); -// oled_write_P(name_1, false); -// oled_set_cursor(0,1); -// oled_write_P(name_2, false); -// oled_set_cursor(0,2); -// oled_write_P(name_3, false); -//} -// -//static void render_logo(void) { // Render MechWild "MW" Logo -// static const char PROGMEM logo_1[] = {0x97, 0x98, 0x99, 0x9A,0x00}; -// static const char PROGMEM logo_2[] = {0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0x00}; -// static const char PROGMEM logo_3[] = {0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xB6, 0x00}; -// static const char PROGMEM logo_4[] = {0xB6, 0xB6, 0xB6, 0x9B, 0x9C, 0x9D, 0x9E, 0x00}; -// oled_set_cursor(0,0); -// oled_write_P(logo_1, false); -// oled_set_cursor(0,1); -// oled_write_P(logo_2, false); -// oled_set_cursor(0,2); -// oled_write_P(logo_3, false); -// oled_set_cursor(0,3); -// oled_write_P(logo_4, false); -//} -// -//bool oled_task_kb(void) { -// if(!oled_task_user()) { -// return false; -// } -// if ( IS_HOST_LED_OFF(USB_LED_NUM_LOCK) && IS_HOST_LED_OFF(USB_LED_CAPS_LOCK) && IS_HOST_LED_OFF(USB_LED_SCROLL_LOCK) && get_highest_layer(layer_state) == 0 ) { -// if (clear_screen_art == true) { -// oled_clear(); -// oled_render(); -// clear_screen_art = false; -// } -// render_name(); -// oled_set_cursor(0,3); -//#ifdef POINTING_DEVICE_ENABLE -// oled_write_P(PSTR(" DPI:"), false); -// oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); -//#endif -//#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically -// oled_write_P(PSTR(" TAP:"), false); -// if (keyboard_config.dt_term_config < 0) { -// oled_write_P(PSTR("Off "), false); -// } else { -// oled_write(get_u16_str(g_tapping_term, ' '), false); -// } -//#endif -// clear_screen = true; -// } else { -// if (clear_screen == true) { -// oled_clear(); -// oled_render(); -// clear_screen = false; -// } -// render_logo(); -// oled_set_cursor(8,1); -// switch (get_highest_layer(layer_state)) { -// case 0: -// oled_write_P(PSTR("Layer 0"), false); -// break; -// case 1: -// oled_write_P(PSTR("Layer 1"), false); -// break; -// case 2: -// oled_write_P(PSTR("Layer 2"), false); -// break; -// case 3: -// oled_write_P(PSTR("Layer 3"), false); -// break; -// default: -// oled_write_P(PSTR("Layer ?"), false); // Should never display, here as a catchall -// } -// led_t led_state = host_keyboard_led_state(); -// oled_set_cursor(8,0); -// oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); -// oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); -// oled_write_P(led_state.scroll_lock ? PSTR("SCR") : PSTR(" "), false); -//#ifdef POINTING_DEVICE_ENABLE -// oled_set_cursor(8,2); -// oled_write_P(PSTR("DPI:"), false); -// oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); -//#endif -//#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically -// oled_set_cursor(8,3); -// oled_write_P(PSTR("TAP:"), false); -// if (keyboard_config.dt_term_config < 0) { -// oled_write_P(PSTR("Off "), false); -// } else { -// oled_write(get_u16_str(g_tapping_term, ' '), false); -// } -//#endif -// clear_screen_art = true; -// } -// return true; -//} -//#endif +#ifdef OLED_ENABLE // OLED Functionality +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; // flips the display 180 degrees +} + +bool clear_screen = true; // used to manage singular screen clears to prevent display glitch +bool clear_screen_art = true; // used to manage singular screen clears to prevent display glitch +static void render_sugarglider(void) { // Render sugarglider logo + static const char PROGMEM sgl_1[] = {0xDE, 0xDE, 0xDE, 0x98, 0x99, 0xDE, 0x9A, 0x9B, 0x9C, 0xDE, 0xDE, 0xDE, 0xDE, 0xDE, 0xCC, 0xCD, 0xCE, 0xCF, 0x00}; + static const char PROGMEM sgl_2[] = {0x9D, 0x9E, 0xDE, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xDE, 0xDE, 0xDE, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + static const char PROGMEM sgl_3[] = {0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xDE, 0xDE, 0xDE, 0xD5, 0xD6, 0xD7, 0xD8, 0x00}; + static const char PROGMEM sgl_4[] = {0xDE, 0xB2, 0xDE, 0xB3, 0xB4, 0xB5, 0xB6, 0xDE, 0xDE, 0xB7, 0xDE, 0xDE, 0xDE, 0xDE, 0xDE, 0xD9, 0xDA, 0xDB, 0x00}; + static const char PROGMEM sgl_5[] = {0xDE, 0xB8, 0xDE, 0xDE, 0xDE, 0xDE, 0xDE, 0xDE, 0xB9, 0x00}; + static const char PROGMEM sgl_6[] = {0xDE, 0xBA, 0xDE, 0xDE, 0xDE, 0xDE, 0xDE, 0xDE, 0xBB, 0xBC, 0x00}; + static const char PROGMEM sgl_7[] = {0xDE, 0xBD, 0xBE, 0xDE, 0xDE, 0xBF, 0xDE, 0xDE, 0xC0, 0xC1, 0x00}; + static const char PROGMEM sgl_8[] = {0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0x00}; + + oled_set_cursor(0,0); + oled_write_P(sgl_1, false); + oled_set_cursor(0,1); + oled_write_P(sgl_2, false); + oled_set_cursor(0,2); + oled_write_P(sgl_3, false); + oled_set_cursor(0,3); + oled_write_P(sgl_4, false); + oled_set_cursor(0,4); + oled_write_P(sgl_5, false); + oled_set_cursor(0,5); + oled_write_P(sgl_6, false); + oled_set_cursor(0,6); + oled_write_P(sgl_7, false); + oled_set_cursor(0,7); + oled_write_P(sgl_8, false); +} + +static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0xCC, 0xCD, 0xCE, 0xCF, 0x00}; + static const char PROGMEM logo_2[] = {0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + static const char PROGMEM logo_3[] = {0xD5, 0xD6, 0xD7, 0xD8, 0x00}; + static const char PROGMEM logo_4[] = {0xDE, 0xD9, 0xDA, 0xDB, 0x00}; + + oled_set_cursor(0,0); + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); +} + +bool oled_task_kb(void) { + if(!oled_task_user()) { + return false; + } + if ( IS_HOST_LED_OFF(USB_LED_NUM_LOCK) && IS_HOST_LED_OFF(USB_LED_CAPS_LOCK) && IS_HOST_LED_OFF(USB_LED_SCROLL_LOCK) && get_highest_layer(layer_state) == 0 ) { + if (clear_screen_art == true) { + oled_clear(); + oled_render(); + clear_screen_art = false; + } + render_sugarglider(); +#ifdef POINTING_DEVICE_ENABLE + oled_set_cursor(10,5); + oled_write_P(PSTR(" DPI:"), false); + oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically + oled_set_cursor(10,6); + oled_write_P(PSTR(" TAP:"), false); + if (keyboard_config.dt_term_config < 0) { + oled_write_P(PSTR("Off "), false); + } else { + oled_write(get_u16_str(g_tapping_term, ' '), false); + } +#endif + clear_screen = true; + } else { + if (clear_screen == true) { + oled_clear(); + oled_render(); + clear_screen = false; + } + render_logo(); + oled_set_cursor(8,1); + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_P(PSTR("Layer 0"), false); + break; + case 1: + oled_write_P(PSTR("Layer 1"), false); + break; + case 2: + oled_write_P(PSTR("Layer 2"), false); + break; + case 3: + oled_write_P(PSTR("Layer 3"), false); + break; + default: + oled_write_P(PSTR("Layer ?"), false); // Should never display, here as a catchall + } + led_t led_state = host_keyboard_led_state(); + oled_set_cursor(8,0); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR") : PSTR(" "), false); +#ifdef POINTING_DEVICE_ENABLE + oled_set_cursor(8,2); + oled_write_P(PSTR("DPI:"), false); + oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically + oled_set_cursor(8,3); + oled_write_P(PSTR("TAP:"), false); + if (keyboard_config.dt_term_config < 0) { + oled_write_P(PSTR("Off "), false); + } else { + oled_write(get_u16_str(g_tapping_term, ' '), false); + } +#endif + clear_screen_art = true; + } + return true; +} +#endif bool process_record_kb(uint16_t keycode, keyrecord_t* record) { switch(keycode) { From 2f820e271584ff2e8cbb66f13445c34991110b3f Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Fri, 24 Feb 2023 14:56:43 -0500 Subject: [PATCH 12/25] Preparing to rewrite values from config into info.json so saving off working files. --- keyboards/mechwild/sugarglider/config.h | 6 +- .../sugarglider/keymaps/default/keymap.c | 67 +++++++--- .../sugarglider/keymaps/default/rules.mk | 1 + .../mechwild/sugarglider/keymaps/via/keymap.c | 125 ++++++++++++++++++ .../mechwild/sugarglider/keymaps/via/rules.mk | 5 + keyboards/mechwild/sugarglider/rules.mk | 7 +- keyboards/mechwild/sugarglider/sugarglider.c | 27 ++-- 7 files changed, 209 insertions(+), 29 deletions(-) create mode 100644 keyboards/mechwild/sugarglider/keymaps/default/rules.mk create mode 100644 keyboards/mechwild/sugarglider/keymaps/via/keymap.c create mode 100644 keyboards/mechwild/sugarglider/keymaps/via/rules.mk diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h index 45cdcab07c46..03678044d9cb 100644 --- a/keyboards/mechwild/sugarglider/config.h +++ b/keyboards/mechwild/sugarglider/config.h @@ -11,6 +11,8 @@ #define OLED_DISPLAY_128X64 +#define POINTING_DEVICE_AUTO_MOUSE_ENABLE + /* Status light pins */ //#define LED_NUM_LOCK_PIN B12 //#define LED_CAPS_LOCK_PIN B13 @@ -56,8 +58,8 @@ #define CIRQUE_PINNACLE_SPI_CS_PIN A3 /* encoder pins */ -#define ENCODERS_PAD_B { B0, B3, B9, C15 } -#define ENCODERS_PAD_A { A2, A15, B8, C14 } +#define ENCODERS_PAD_A { B0, B3, B9, C15 } +#define ENCODERS_PAD_B { A2, A15, B8, C14 } /* encoder resolution */ #define ENCODER_RESOLUTION 4 diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c index 6900885a6b36..4fc4c0c706e1 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H +#include "keymap_steno.h" // Defines names for use in layer keycodes and the keymap @@ -18,40 +19,70 @@ enum layer_names { _QWERTY, _LOWER, _RAISE, - _ADJUST + _ADJUST, + _MOUSE, + _STENO }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ENT, TAP_UP, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_MUTE, TAP_DN, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, - KC_Z, KC_X, KC_C, KC_V, KC_B, QK_GESC, MO(_LOWER), KC_RGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, - KC_MUTE, KC_LCTL, KC_LALT, MO(_LOWER), KC_H, KC_H, KC_H, MO(_RAISE), KC_SPC, KC_RSFT, KC_MUTE + QK_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, TAP_UP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_MUTE, TAP_DN, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(_STENO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_MUTE, KC_LGUI, KC_LALT, MO(_LOWER), KC_MS_BTN1, TAP_TOG, KC_MS_BTN2, MO(_RAISE), KC_SPC, KC_RSFT, KC_MUTE ), [_LOWER] = LAYOUT( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, DPI_UP, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DPI_DN, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, 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_1, KC_2, KC_3, KC_4, KC_5, DPI_UP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TRNS, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DPI_DN, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [_RAISE] = LAYOUT( - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_TRNS, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, TG(_QWERTY), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, + KC_TRNS, KC_UNDS, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [_ADJUST] = LAYOUT( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_RMOD, RGB_TOG, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_MOD, 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_RMOD, RGB_TOG, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_MOD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_MOUSE] = LAYOUT( + 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, DPI_FINE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_STENO] = LAYOUT( + STN_RES1, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, KC_TRNS, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_RES2, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, KC_TRNS, KC_TRNS, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_MOD, KC_TRNS, + KC_TRNS, STN_A, STN_O, STN_N1, KC_TRNS, KC_TRNS, KC_TRNS, STN_N2, STN_E, STN_U, KC_TRNS ) }; - + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][4][2] = { + [_QWERTY] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_WH_U, KC_WH_D) }, + [_LOWER] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(DPI_UP, DPI_DN) }, + [_RAISE] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(KC_HOME, KC_END) }, + [_ADJUST] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU) }, + [_MOUSE] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU) }, + [_STENO] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_HOME, KC_END) } +}; +#endif + layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUSE); + set_auto_mouse_enable(true); +} + //#ifdef OLED_ENABLE // oled_rotation_t oled_init_user(oled_rotation_t rotation) { // return OLED_ROTATION_180; // flips the display 270 degrees diff --git a/keyboards/mechwild/sugarglider/keymaps/default/rules.mk b/keyboards/mechwild/sugarglider/keymaps/default/rules.mk new file mode 100644 index 000000000000..ee325681483f --- /dev/null +++ b/keyboards/mechwild/sugarglider/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/mechwild/sugarglider/keymaps/via/keymap.c b/keyboards/mechwild/sugarglider/keymaps/via/keymap.c new file mode 100644 index 000000000000..ab9f76b050bc --- /dev/null +++ b/keyboards/mechwild/sugarglider/keymaps/via/keymap.c @@ -0,0 +1,125 @@ +// Copyright 2023 Kyle McCreery +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +// Defines names for use in layer keycodes and the keymap +void keyboard_post_init_user(void) { + // Customise these values to desired behaviour + //debug_enable=true; + //debug_matrix=true; + //debug_keyboard=true; + //debug_mouse=true; +} + +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _MOUSE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + QK_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, TAP_UP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_MUTE, TAP_DN, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TRNS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_MUTE, KC_LGUI, KC_LALT, MO(_LOWER), KC_MS_BTN1, TAP_TOG, KC_MS_BTN2, MO(_RAISE), KC_SPC, KC_RSFT, KC_MUTE + ), + [_LOWER] = LAYOUT( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, DPI_UP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TRNS, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DPI_DN, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_RAISE] = LAYOUT( + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, + KC_TRNS, KC_UNDS, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_ADJUST] = LAYOUT( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_RMOD, RGB_TOG, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_MOD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_MOUSE] = LAYOUT( + 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, DPI_FINE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][4][2] = { + [_QWERTY] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_WH_U, KC_WH_D) }, + [_LOWER] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(DPI_UP, DPI_DN) }, + [_RAISE] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(KC_HOME, KC_END) }, + [_ADJUST] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU) }, + [_MOUSE] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU) } +}; +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUSE); + set_auto_mouse_enable(true); +} + +//#ifdef OLED_ENABLE +// oled_rotation_t oled_init_user(oled_rotation_t rotation) { +// return OLED_ROTATION_180; // flips the display 270 degrees +// } +// +// //static void render_logo(void) { // Render MechWild "MW" Logo +// // static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; +// // static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; +// // static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; +// // static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; +// // oled_set_cursor(0,0); +// // oled_write_P(logo_1, false); +// // oled_set_cursor(0,1); +// // oled_write_P(logo_2, false); +// // oled_set_cursor(0,2); +// // oled_write_P(logo_3, false); +// // oled_set_cursor(0,3); +// // oled_write_P(logo_4, false); +// //} +// +// bool oled_task_user(void) { +// //render_logo(); +// oled_set_cursor(0,0); +// +// oled_write_ln_P(PSTR("Layer"), false); +// +// switch (get_highest_layer(layer_state)) { +// case 0: +// oled_write_ln_P(PSTR("Base"), false); +// break; +// case 1: +// oled_write_ln_P(PSTR("FN 1"), false); +// break; +// case 2: +// oled_write_ln_P(PSTR("FN 2"), false); +// break; +// case 3: +// oled_write_ln_P(PSTR("FN 3"), false); +// break; +// default: +// oled_write_ln_P(PSTR("Undef"), false); +// } +// oled_write_ln_P(PSTR(""), false); +// // Host Keyboard LED Status +// led_t led_state = host_keyboard_led_state(); +// oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); +// oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); +// oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); +// return false; +// } +//#endif diff --git a/keyboards/mechwild/sugarglider/keymaps/via/rules.mk b/keyboards/mechwild/sugarglider/keymaps/via/rules.mk new file mode 100644 index 000000000000..6591ae365383 --- /dev/null +++ b/keyboards/mechwild/sugarglider/keymaps/via/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes + +# Steno needs to be disabled to allow endpoints for VIA +STENO_ENABLE = no # Enable stenography endpoint diff --git a/keyboards/mechwild/sugarglider/rules.mk b/keyboards/mechwild/sugarglider/rules.mk index 9946c0788572..36f29894d73c 100644 --- a/keyboards/mechwild/sugarglider/rules.mk +++ b/keyboards/mechwild/sugarglider/rules.mk @@ -8,7 +8,7 @@ CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = yes # Encoder Enabled OLED_ENABLE = yes # OLED Enabled @@ -30,3 +30,8 @@ SRC += mcp23018.c matrix.c QUANTUM_LIB_SRC += i2c_master.c DEFAULT_FOLDER = mechwild/sugarglider/f401 + +# Necessary for stenography functionality +STENO_ENABLE = yes # Enable stenography endpoint +NKRO_ENABLE = yes # Enable N-Key Rollover +KEYBOARD_SHARED_EP = yes # Needed to free up an endpoint in blackpill \ No newline at end of file diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index fa18834a5781..dbce98b94ebc 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -72,7 +72,7 @@ bool dip_switch_update_kb(uint8_t index, bool active) { } #endif -#ifdef ENCODER_ENABLE +#if defined(ENCODER_ENABLE) && ! defined(ENCODER_MAP_ENABLE) bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } switch (index) { @@ -125,14 +125,14 @@ bool led_update_kb(led_t led_state) { return res; } -#ifdef OLED_ENABLE // OLED Functionality +#if defined(OLED_ENABLE) && defined(OLED_DISPLAY_128X64) // Wide OLED Functionality oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; // flips the display 180 degrees } bool clear_screen = true; // used to manage singular screen clears to prevent display glitch bool clear_screen_art = true; // used to manage singular screen clears to prevent display glitch -static void render_sugarglider(void) { // Render sugarglider logo +static void render_sugarglider_wide(void) { // Render sugarglider logo static const char PROGMEM sgl_1[] = {0xDE, 0xDE, 0xDE, 0x98, 0x99, 0xDE, 0x9A, 0x9B, 0x9C, 0xDE, 0xDE, 0xDE, 0xDE, 0xDE, 0xCC, 0xCD, 0xCE, 0xCF, 0x00}; static const char PROGMEM sgl_2[] = {0x9D, 0x9E, 0xDE, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xDE, 0xDE, 0xDE, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; static const char PROGMEM sgl_3[] = {0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xDE, 0xDE, 0xDE, 0xD5, 0xD6, 0xD7, 0xD8, 0x00}; @@ -186,7 +186,7 @@ bool oled_task_kb(void) { oled_render(); clear_screen_art = false; } - render_sugarglider(); + render_sugarglider_wide(); #ifdef POINTING_DEVICE_ENABLE oled_set_cursor(10,5); oled_write_P(PSTR(" DPI:"), false); @@ -212,17 +212,25 @@ bool oled_task_kb(void) { oled_set_cursor(8,1); switch (get_highest_layer(layer_state)) { case 0: - oled_write_P(PSTR("Layer 0"), false); + oled_write_P(PSTR("Base Layer"), false); break; case 1: - oled_write_P(PSTR("Layer 1"), false); + oled_write_P(PSTR("Lower"), false); break; case 2: - oled_write_P(PSTR("Layer 2"), false); + oled_write_P(PSTR("Raise"), false); break; case 3: - oled_write_P(PSTR("Layer 3"), false); + oled_write_P(PSTR("Adjust"), false); break; + case 4: + oled_write_P(PSTR("Mouse Layer"), false); + break; +#ifdef STENO_ENABLE + case 5: + oled_write_P(PSTR("Steno Layer"), false); + break; +#endif default: oled_write_P(PSTR("Layer ?"), false); // Should never display, here as a catchall } @@ -327,6 +335,9 @@ void eeconfig_init_kb(void) { keyboard_config.dt_term_config = TAPPING_TERM; #endif eeconfig_update_kb(keyboard_config.raw); +#ifdef STENO_ENABLE + steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT +#endif eeconfig_init_user(); } From ea28dabc380087e1601307dfde4f9014d04f44c0 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Fri, 24 Feb 2023 17:52:38 -0500 Subject: [PATCH 13/25] z --- keyboards/mechwild/sugarglider/config.h | 109 ++---------------- keyboards/mechwild/sugarglider/f401/rules.mk | 3 - keyboards/mechwild/sugarglider/f411/rules.mk | 3 - keyboards/mechwild/sugarglider/info.json | 39 ++++++- .../sugarglider/keymaps/default/keymap.c | 62 ---------- .../mechwild/sugarglider/keymaps/via/keymap.c | 60 ---------- keyboards/mechwild/sugarglider/post_rules.mk | 2 +- keyboards/mechwild/sugarglider/rules.mk | 28 ++--- keyboards/mechwild/sugarglider/sugarglider.c | 89 ++++++++++++-- keyboards/mechwild/sugarglider/sugarglider.h | 29 +---- 10 files changed, 132 insertions(+), 292 deletions(-) diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h index 03678044d9cb..c242d734a598 100644 --- a/keyboards/mechwild/sugarglider/config.h +++ b/keyboards/mechwild/sugarglider/config.h @@ -5,20 +5,16 @@ #include "config_common.h" +#ifdef VIA_ENABLE +#define DYNAMIC_KEYMAP_LAYER_COUNT 5 +#endif + /* Matrix COL and ROW definitions */ #define MATRIX_ROWS 9 #define MATRIX_COLS 6 -#define OLED_DISPLAY_128X64 - +/* Cirque Touchpad Settings */ #define POINTING_DEVICE_AUTO_MOUSE_ENABLE - -/* Status light pins */ -//#define LED_NUM_LOCK_PIN B12 -//#define LED_CAPS_LOCK_PIN B13 -//#define LED_SCROLL_LOCK_PIN B14 -//#define LED_PIN_ON_STATE 0 - #define USB_POLLING_INTERVAL_MS 1 #define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X @@ -37,15 +33,13 @@ /* allows the "key" button on the blackpill to toggle caps lock for user testing before soldering */ #define DIP_SWITCH_PINS { A0 } -/* set the tapping term for glidepoint pad to register a tap click */ -//#define CIRQUE_PINNACLE_TAPPING_TERM 0 // This is set to 0 to disable it - /* TAPPING_TERM value is used for the CIRQUE_PINNACLE_TAPPING_TERM as well by default * defining it this way allows us to easily modify it with DYNAMIC_TAPPING_TERM_ENABLE */ #define TAPPING_TERM 0 #define CIRQUE_PINNACLE_TAP_ENABLE #define POINTING_DEVICE_GESTURES_SCROLL_ENABLE + /* spi config */ #define SPI_DRIVER SPID1 #define SPI_SCK_PIN A5 @@ -57,94 +51,5 @@ #define CIRQUE_PINNACLE_SPI_DIVISOR 8 #define CIRQUE_PINNACLE_SPI_CS_PIN A3 -/* encoder pins */ -#define ENCODERS_PAD_A { B0, B3, B9, C15 } -#define ENCODERS_PAD_B { A2, A15, B8, C14 } - -/* encoder resolution */ -#define ENCODER_RESOLUTION 4 -#define TAP_CODE_DELAY 0 - -/* COL2ROW, ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* RGB settings, uncomment this define to enable RGB */ -#define RGB_DI_PIN B5 -#ifdef RGB_DI_PIN -# define RGBLED_NUM 10 -# 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 */ -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_RAINBOW_MOOD -# define RGBLIGHT_EFFECT_RAINBOW_SWIRL -# define RGBLIGHT_EFFECT_SNAKE -# define RGBLIGHT_EFFECT_KNIGHT -# define RGBLIGHT_EFFECT_CHRISTMAS -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -# define RGBLIGHT_EFFECT_RGB_TEST -# define RGBLIGHT_EFFECT_ALTERNATING -/*== customize breathing effect ==*/ -/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ -//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 -/*==== use exp() and sin() ====*/ -//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 -//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 -#endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -// Debounce not used in this custom matrix implementation -//#define DEBOUNCE 5 - -/* 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. - * - */ +/* Force NKRO */ #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 - -/* Bootmagic Lite key configuration */ -//#define BOOTMAGIC_LITE_ROW 0 -//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/mechwild/sugarglider/f401/rules.mk b/keyboards/mechwild/sugarglider/f401/rules.mk index 1b21bbaf7705..a92d8a85c619 100644 --- a/keyboards/mechwild/sugarglider/f401/rules.mk +++ b/keyboards/mechwild/sugarglider/f401/rules.mk @@ -1,6 +1,3 @@ # MCU name MCU = STM32F401 BOARD = BLACKPILL_STM32_F401 - -# Bootloader selection -BOOTLOADER = stm32-dfu diff --git a/keyboards/mechwild/sugarglider/f411/rules.mk b/keyboards/mechwild/sugarglider/f411/rules.mk index c25a64f4b3b6..db1d4054fdf4 100644 --- a/keyboards/mechwild/sugarglider/f411/rules.mk +++ b/keyboards/mechwild/sugarglider/f411/rules.mk @@ -1,6 +1,3 @@ # MCU name MCU = STM32F411 BOARD = BLACKPILL_STM32_F411 - -# Bootloader selection -BOOTLOADER = stm32-dfu diff --git a/keyboards/mechwild/sugarglider/info.json b/keyboards/mechwild/sugarglider/info.json index dc4233d3645a..594830a176b6 100644 --- a/keyboards/mechwild/sugarglider/info.json +++ b/keyboards/mechwild/sugarglider/info.json @@ -1,13 +1,46 @@ { - "keyboard_name": "Sugar Glider", "manufacturer": "MechWild", - "url": "mechwild.com", - "maintainer": "Kyle McCreery", + "keyboard_name": "Sugar Glider", + "maintainer": "kylemccreery", + "url": "https://mechwild.com/product/sugar-glider/", + "bootloader": "stm32-dfu", + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true, + "encoder": true, + "rgblight": true, + "dip_switch": true, + "steno": true + }, "usb": { "vid": "0x6D77", "pid": "0x1710", "device_version": "0.2.0" }, + "diode_direction": "COL2ROW", + "rgblight": { + "led_count": 10, + "pin": "B5", + "max_brightness": 255, + "hue_steps": 8, + "saturation_steps": 8, + "brightness_steps": 8, + "animations": { + "all": true + } + }, + "encoder": { + "rotary": [ + { "pin_a": "B0", "pin_b": "A2", "resolution": 4 }, + { "pin_a": "B3", "pin_b": "A15", "resolution": 4 }, + { "pin_a": "B9", "pin_b": "B8", "resolution": 4 }, + { "pin_a": "C15", "pin_b": "C14", "resolution": 4 } + ] + }, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c index 4fc4c0c706e1..99a1363dcaa4 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -5,16 +5,6 @@ #include "keymap_steno.h" // Defines names for use in layer keycodes and the keymap - -void keyboard_post_init_user(void) { - // Customise these values to desired behaviour - //debug_enable=true; - //debug_matrix=true; - //debug_keyboard=true; - //debug_mouse=true; -} - - enum layer_names { _QWERTY, _LOWER, @@ -82,55 +72,3 @@ void pointing_device_init_user(void) { set_auto_mouse_layer(_MOUSE); set_auto_mouse_enable(true); } - -//#ifdef OLED_ENABLE -// oled_rotation_t oled_init_user(oled_rotation_t rotation) { -// return OLED_ROTATION_180; // flips the display 270 degrees -// } -// -// //static void render_logo(void) { // Render MechWild "MW" Logo -// // static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; -// // static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; -// // static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; -// // static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; -// // oled_set_cursor(0,0); -// // oled_write_P(logo_1, false); -// // oled_set_cursor(0,1); -// // oled_write_P(logo_2, false); -// // oled_set_cursor(0,2); -// // oled_write_P(logo_3, false); -// // oled_set_cursor(0,3); -// // oled_write_P(logo_4, false); -// //} -// -// bool oled_task_user(void) { -// //render_logo(); -// oled_set_cursor(0,0); -// -// oled_write_ln_P(PSTR("Layer"), false); -// -// switch (get_highest_layer(layer_state)) { -// case 0: -// oled_write_ln_P(PSTR("Base"), false); -// break; -// case 1: -// oled_write_ln_P(PSTR("FN 1"), false); -// break; -// case 2: -// oled_write_ln_P(PSTR("FN 2"), false); -// break; -// case 3: -// oled_write_ln_P(PSTR("FN 3"), false); -// break; -// default: -// oled_write_ln_P(PSTR("Undef"), false); -// } -// oled_write_ln_P(PSTR(""), false); -// // Host Keyboard LED Status -// led_t led_state = host_keyboard_led_state(); -// oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); -// oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); -// oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); -// return false; -// } -//#endif diff --git a/keyboards/mechwild/sugarglider/keymaps/via/keymap.c b/keyboards/mechwild/sugarglider/keymaps/via/keymap.c index ab9f76b050bc..630d67d7a5de 100644 --- a/keyboards/mechwild/sugarglider/keymaps/via/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/via/keymap.c @@ -4,14 +4,6 @@ #include QMK_KEYBOARD_H // Defines names for use in layer keycodes and the keymap -void keyboard_post_init_user(void) { - // Customise these values to desired behaviour - //debug_enable=true; - //debug_matrix=true; - //debug_keyboard=true; - //debug_mouse=true; -} - enum layer_names { _QWERTY, _LOWER, @@ -71,55 +63,3 @@ void pointing_device_init_user(void) { set_auto_mouse_layer(_MOUSE); set_auto_mouse_enable(true); } - -//#ifdef OLED_ENABLE -// oled_rotation_t oled_init_user(oled_rotation_t rotation) { -// return OLED_ROTATION_180; // flips the display 270 degrees -// } -// -// //static void render_logo(void) { // Render MechWild "MW" Logo -// // static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; -// // static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; -// // static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; -// // static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; -// // oled_set_cursor(0,0); -// // oled_write_P(logo_1, false); -// // oled_set_cursor(0,1); -// // oled_write_P(logo_2, false); -// // oled_set_cursor(0,2); -// // oled_write_P(logo_3, false); -// // oled_set_cursor(0,3); -// // oled_write_P(logo_4, false); -// //} -// -// bool oled_task_user(void) { -// //render_logo(); -// oled_set_cursor(0,0); -// -// oled_write_ln_P(PSTR("Layer"), false); -// -// switch (get_highest_layer(layer_state)) { -// case 0: -// oled_write_ln_P(PSTR("Base"), false); -// break; -// case 1: -// oled_write_ln_P(PSTR("FN 1"), false); -// break; -// case 2: -// oled_write_ln_P(PSTR("FN 2"), false); -// break; -// case 3: -// oled_write_ln_P(PSTR("FN 3"), false); -// break; -// default: -// oled_write_ln_P(PSTR("Undef"), false); -// } -// oled_write_ln_P(PSTR(""), false); -// // Host Keyboard LED Status -// led_t led_state = host_keyboard_led_state(); -// oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); -// oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); -// oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); -// return false; -// } -//#endif diff --git a/keyboards/mechwild/sugarglider/post_rules.mk b/keyboards/mechwild/sugarglider/post_rules.mk index ac527500d2fe..e1e3d82b70ff 100644 --- a/keyboards/mechwild/sugarglider/post_rules.mk +++ b/keyboards/mechwild/sugarglider/post_rules.mk @@ -4,4 +4,4 @@ ifeq ($(strip $(BOOTLOADER)), tinyuf2) EEPROM_DRIVER = vendor UF2_BUILD = yes endif -endif \ No newline at end of file +endif diff --git a/keyboards/mechwild/sugarglider/rules.mk b/keyboards/mechwild/sugarglider/rules.mk index 36f29894d73c..0f3f0ba2c406 100644 --- a/keyboards/mechwild/sugarglider/rules.mk +++ b/keyboards/mechwild/sugarglider/rules.mk @@ -1,29 +1,18 @@ # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -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 -NKRO_ENABLE = yes # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = yes # Encoder Enabled +WIDE_OLED_ENABLE = yes OLED_ENABLE = yes # OLED Enabled OLED_DRIVER = SSD1306 # OLED Driver -DIP_SWITCH_ENABLE = yes # Dip Switch Enabled +# Cirque touchpad settings POINTING_DEVICE_ENABLE = yes # Pointing Device Enabled POINTING_DEVICE_DRIVER = cirque_pinnacle_spi # Pointing Device Driver - DYNAMIC_TAPPING_TERM_ENABLE = yes # Enable Dynamic Tapping Term to control the Tap term for the Cirque Pad easily -DEBOUNCE_TYPE = sym_eager_pk - -# custom matrix setup +# Custom matrix setup CUSTOM_MATRIX = lite +DEBOUNCE_TYPE = sym_eager_pk VPATH += drivers/gpio SRC += mcp23018.c matrix.c @@ -32,6 +21,9 @@ QUANTUM_LIB_SRC += i2c_master.c DEFAULT_FOLDER = mechwild/sugarglider/f401 # Necessary for stenography functionality -STENO_ENABLE = yes # Enable stenography endpoint -NKRO_ENABLE = yes # Enable N-Key Rollover -KEYBOARD_SHARED_EP = yes # Needed to free up an endpoint in blackpill \ No newline at end of file +KEYBOARD_SHARED_EP = yes # Needed to free up an endpoint in blackpill + +# Checking if WIDE_OLED +ifeq ($(strip $(WIDE_OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_DISPLAY_128X64 +endif \ No newline at end of file diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index dbce98b94ebc..24cdebd0a0c6 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -112,15 +112,10 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { bool led_update_kb(led_t led_state) { bool res = led_update_user(led_state); if(res) { - // writePin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - writePin(B12, led_state.num_lock); - writePin(B13, led_state.caps_lock); - writePin(B14, led_state.scroll_lock); - writePin(C13, !led_state.caps_lock); + writePin(B12, led_state.num_lock); // Updates status LEDs + writePin(B13, led_state.caps_lock); // Updates status LEDs + writePin(B14, led_state.scroll_lock); // Updates status LEDs + writePin(C13, !led_state.caps_lock); // Updates status LEDs, this is the LED on the blackpill itself } return res; } @@ -257,6 +252,79 @@ bool oled_task_kb(void) { } return true; } +#elif defined(OLED_ENABLE) && ! defined(OLED_DISPLAY_128X64) +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_270; // flips the display 270 degrees +} + +static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0xCC, 0xCD, 0xCE, 0xCF, 0x00}; + static const char PROGMEM logo_2[] = {0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + static const char PROGMEM logo_3[] = {0xD5, 0xD6, 0xD7, 0xD8, 0x00}; + static const char PROGMEM logo_4[] = {0xDE, 0xD9, 0xDA, 0xDB, 0x00}; + + oled_set_cursor(0,0); + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); +} + +bool oled_task_kb(void) { + if(!oled_task_user()) { + return false; + } + render_logo(); + + oled_set_cursor(0,5); + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_P(PSTR("Base"), false); + break; + case 1: + oled_write_P(PSTR("Lower"), false); + break; + case 2: + oled_write_P(PSTR("Raise"), false); + break; + case 3: + oled_write_P(PSTR("Adjst"), false); + break; + case 4: + oled_write_P(PSTR("Mouse"), false); + break; +#ifdef STENO_ENABLE + case 5: + oled_write_P(PSTR("Steno"), false); + break; +#endif + default: + oled_write_P(PSTR("?????"), false); // Should never display, here as a catchall + } + led_t led_state = host_keyboard_led_state(); + oled_set_cursor(0,6); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); +#ifdef POINTING_DEVICE_ENABLE + oled_set_cursor(0,11); + oled_write_P(PSTR("DPI: "), false); + oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); +#endif +#ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically + oled_set_cursor(0,13); + oled_write_P(PSTR("TAP: "), false); + if (keyboard_config.dt_term_config < 0) { + oled_write_P(PSTR("Off "), false); + } else { + oled_write(get_u16_str(g_tapping_term, ' '), false); + } +#endif + return true; +} #endif bool process_record_kb(uint16_t keycode, keyrecord_t* record) { @@ -371,6 +439,3 @@ void keyboard_post_init_kb(void) { oled_on(); #endif } - - - diff --git a/keyboards/mechwild/sugarglider/sugarglider.h b/keyboards/mechwild/sugarglider/sugarglider.h index f6fca42fe145..f872bef9e78c 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.h +++ b/keyboards/mechwild/sugarglider/sugarglider.h @@ -1,37 +1,10 @@ -// Copyright 2022 Kyle McCreery +// Copyright 2023 Kyle McCreery // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include "quantum.h" -#define ___ KC_NO - -/* This is a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ -#define LAYOUT( \ -k00, k01, k02, k03, k04, k05, sw1, k06, k07, k08, k09, k0A, k0B, \ -k10, k11, k12, k13, k14, k15, sw5, sw2, k16, k17, k18, k19, k1A, k1B, \ -k20, k21, k22, k23, k24, k25, sw3, k26, k27, k28, k29, k2A, k2B, \ - sw4, k30, k31, k32, k33, k34, k35, k36, k37, k38, sw6 \ -) { \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { sw4, k30, k31, k32, k33, ___ }, \ - { k06, k07, k08, k09, k0A, k0B }, \ - { k16, k17, k18, k19, k1A, k1B }, \ - { k26, k27, k28, k29, k2A, k2B }, \ - { k34, k35, k36, k37, k38, sw6 }, \ - { sw1, sw2, sw3, ___, ___, sw5 } \ -} - typedef union { uint32_t raw; struct { From 9d5ed3e3d7583b483735393a8b12da0033f10c7f Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Fri, 24 Feb 2023 18:09:20 -0500 Subject: [PATCH 14/25] Moved wide oled check to post rules. --- keyboards/mechwild/sugarglider/post_rules.mk | 5 +++++ keyboards/mechwild/sugarglider/rules.mk | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/mechwild/sugarglider/post_rules.mk b/keyboards/mechwild/sugarglider/post_rules.mk index e1e3d82b70ff..ccda199b9233 100644 --- a/keyboards/mechwild/sugarglider/post_rules.mk +++ b/keyboards/mechwild/sugarglider/post_rules.mk @@ -5,3 +5,8 @@ ifeq ($(strip $(BOOTLOADER)), tinyuf2) UF2_BUILD = yes endif endif + +# Checking if WIDE_OLED +ifeq ($(strip $(WIDE_OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_DISPLAY_128X64 +endif \ No newline at end of file diff --git a/keyboards/mechwild/sugarglider/rules.mk b/keyboards/mechwild/sugarglider/rules.mk index 0f3f0ba2c406..8f475595c274 100644 --- a/keyboards/mechwild/sugarglider/rules.mk +++ b/keyboards/mechwild/sugarglider/rules.mk @@ -22,8 +22,3 @@ DEFAULT_FOLDER = mechwild/sugarglider/f401 # Necessary for stenography functionality KEYBOARD_SHARED_EP = yes # Needed to free up an endpoint in blackpill - -# Checking if WIDE_OLED -ifeq ($(strip $(WIDE_OLED_ENABLE)), yes) - OPT_DEFS += -DOLED_DISPLAY_128X64 -endif \ No newline at end of file From 6819df1dd1114e88468ba856fa8fd372902e01a4 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Fri, 24 Feb 2023 18:12:54 -0500 Subject: [PATCH 15/25] Update post_rules.mk --- keyboards/mechwild/sugarglider/post_rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/mechwild/sugarglider/post_rules.mk b/keyboards/mechwild/sugarglider/post_rules.mk index ccda199b9233..d34c02cf1f12 100644 --- a/keyboards/mechwild/sugarglider/post_rules.mk +++ b/keyboards/mechwild/sugarglider/post_rules.mk @@ -9,4 +9,4 @@ endif # Checking if WIDE_OLED ifeq ($(strip $(WIDE_OLED_ENABLE)), yes) OPT_DEFS += -DOLED_DISPLAY_128X64 -endif \ No newline at end of file +endif From c1805d77a66739d8d611eb9671f0f7ec44d343b3 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Sat, 25 Feb 2023 02:13:12 -0500 Subject: [PATCH 16/25] Apply suggestions from code review Co-authored-by: Drashna Jaelre --- keyboards/mechwild/sugarglider/config.h | 15 --------------- keyboards/mechwild/sugarglider/info.json | 11 ++++++++++- keyboards/mechwild/sugarglider/post_rules.mk | 7 ------- keyboards/mechwild/sugarglider/sugarglider.h | 7 +------ 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h index c242d734a598..4a946ec93277 100644 --- a/keyboards/mechwild/sugarglider/config.h +++ b/keyboards/mechwild/sugarglider/config.h @@ -3,29 +3,14 @@ #pragma once -#include "config_common.h" -#ifdef VIA_ENABLE #define DYNAMIC_KEYMAP_LAYER_COUNT 5 -#endif -/* Matrix COL and ROW definitions */ -#define MATRIX_ROWS 9 -#define MATRIX_COLS 6 /* Cirque Touchpad Settings */ #define POINTING_DEVICE_AUTO_MOUSE_ENABLE -#define USB_POLLING_INTERVAL_MS 1 #define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X -/* Memory definitions for UF2 builds */ -#ifdef UF2_BUILD -#define EXTERNAL_EEPROM_BYTE_COUNT 2048 -#define EXTERNAL_EEPROM_PAGE_SIZE 128 -#define EXTERNAL_EEPROM_ADDRESS_SIZE 1 -#define EXTERNAL_EEPROM_WRITE_TIME 0 -#define FEE_PAGE_BASE_ADDRESS 0x08008000 -#endif /* Define custom font */ #define OLED_FONT_H "keyboards/mechwild/sugarglider/glcdfont.c" diff --git a/keyboards/mechwild/sugarglider/info.json b/keyboards/mechwild/sugarglider/info.json index 594830a176b6..9d9ee27eb5c5 100644 --- a/keyboards/mechwild/sugarglider/info.json +++ b/keyboards/mechwild/sugarglider/info.json @@ -30,7 +30,16 @@ "saturation_steps": 8, "brightness_steps": 8, "animations": { - "all": true + "alternating": true, + "breathing": true, + "christmas": true, + "knight": true, + "rainbow_mood": true, + "rainbow_swirl": true, + "rgb_test": true, + "snake": true, + "static_gradient": true, + "twinkle": true } }, "encoder": { diff --git a/keyboards/mechwild/sugarglider/post_rules.mk b/keyboards/mechwild/sugarglider/post_rules.mk index d34c02cf1f12..e56a372434bb 100644 --- a/keyboards/mechwild/sugarglider/post_rules.mk +++ b/keyboards/mechwild/sugarglider/post_rules.mk @@ -1,10 +1,3 @@ -ifeq ($(strip $(BOOTLOADER)), tinyuf2) - ifndef EEPROM_DRIVER - MCU_LDSCRIPT = STM32F401xE - EEPROM_DRIVER = vendor - UF2_BUILD = yes - endif -endif # Checking if WIDE_OLED ifeq ($(strip $(WIDE_OLED_ENABLE)), yes) diff --git a/keyboards/mechwild/sugarglider/sugarglider.h b/keyboards/mechwild/sugarglider/sugarglider.h index f872bef9e78c..01e2131be6f6 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.h +++ b/keyboards/mechwild/sugarglider/sugarglider.h @@ -17,11 +17,7 @@ extern keyboard_config_t keyboard_config; extern uint16_t dpi_array[]; enum keyboard_keycodes { -#ifdef VIA_ENABLE - DPI_UP = USER00, -#else - DPI_UP = SAFE_RANGE, -#endif + DPI_UP = QK_KB, DPI_DN, DPI_FINE, TAP_UP, @@ -29,5 +25,4 @@ enum keyboard_keycodes { TAP_ON, TAP_OFF, TAP_TOG, - NEW_SAFE_RANGE }; From 973a3d1f4587f2d6fa90c36cf7419c1ddb0ee1f7 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Sat, 25 Feb 2023 02:13:34 -0500 Subject: [PATCH 17/25] Delete STM32F401xE.ld --- .../mechwild/sugarglider/ld/STM32F401xE.ld | 88 ------------------- 1 file changed, 88 deletions(-) delete mode 100644 keyboards/mechwild/sugarglider/ld/STM32F401xE.ld diff --git a/keyboards/mechwild/sugarglider/ld/STM32F401xE.ld b/keyboards/mechwild/sugarglider/ld/STM32F401xE.ld deleted file mode 100644 index daec7d858347..000000000000 --- a/keyboards/mechwild/sugarglider/ld/STM32F401xE.ld +++ /dev/null @@ -1,88 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - * STM32F401xE memory setup. - */ -MEMORY -{ - flash0 (rx) : org = 0x08000000, len = 16k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ - flash1 (rx) : org = 0x08004000, len = 16k - flash2 (rx) : org = 0x08008000, len = 16k /* emulated eeprom */ - flash3 (rx) : org = 0x0800C000, len = 16k - flash4 (rx) : org = 0x08010000, len = 512k - 64k - flash5 (rx) : org = 0x00000000, len = 0 - flash6 (rx) : org = 0x00000000, len = 0 - flash7 (rx) : org = 0x00000000, len = 0 - ram0 (wx) : org = 0x20000000, len = 96k - ram1 (wx) : org = 0x00000000, len = 0 - ram2 (wx) : org = 0x00000000, len = 0 - ram3 (wx) : org = 0x00000000, len = 0 - ram4 (wx) : org = 0x00000000, len = 0 - ram5 (wx) : org = 0x00000000, len = 0 - ram6 (wx) : org = 0x00000000, len = 0 - ram7 (wx) : org = 0x00000000, len = 0 -} - -/* For each data/text section two region are defined, a virtual region - and a load region (_LMA suffix).*/ - -/* Flash region to be used for exception vectors.*/ -REGION_ALIAS("VECTORS_FLASH", flash4); -REGION_ALIAS("VECTORS_FLASH_LMA", flash4); - -/* Flash region to be used for constructors and destructors.*/ -REGION_ALIAS("XTORS_FLASH", flash4); -REGION_ALIAS("XTORS_FLASH_LMA", flash4); - -/* Flash region to be used for code text.*/ -REGION_ALIAS("TEXT_FLASH", flash4); -REGION_ALIAS("TEXT_FLASH_LMA", flash4); - -/* Flash region to be used for read only data.*/ -REGION_ALIAS("RODATA_FLASH", flash4); -REGION_ALIAS("RODATA_FLASH_LMA", flash4); - -/* Flash region to be used for various.*/ -REGION_ALIAS("VARIOUS_FLASH", flash4); -REGION_ALIAS("VARIOUS_FLASH_LMA", flash4); - -/* Flash region to be used for RAM(n) initialization data.*/ -REGION_ALIAS("RAM_INIT_FLASH_LMA", flash4); - -/* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts.*/ -REGION_ALIAS("MAIN_STACK_RAM", ram0); - -/* RAM region to be used for the process stack. This is the stack used by - the main() function.*/ -REGION_ALIAS("PROCESS_STACK_RAM", ram0); - -/* RAM region to be used for data segment.*/ -REGION_ALIAS("DATA_RAM", ram0); -REGION_ALIAS("DATA_RAM_LMA", flash4); - -/* RAM region to be used for BSS segment.*/ -REGION_ALIAS("BSS_RAM", ram0); - -/* RAM region to be used for the default heap.*/ -REGION_ALIAS("HEAP_RAM", ram0); - -/* Generic rules inclusion.*/ -INCLUDE rules.ld - -/* TinyUF2 bootloader reset support */ -_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ From b5976e469405965339c09e088446789ace56432f Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Sat, 25 Feb 2023 02:58:07 -0500 Subject: [PATCH 18/25] More changes suggested by drashna. --- keyboards/mechwild/sugarglider/config.h | 5 +++-- keyboards/mechwild/sugarglider/post_rules.mk | 1 - keyboards/mechwild/sugarglider/sugarglider.c | 9 +++------ keyboards/mechwild/sugarglider/sugarglider.h | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h index 4a946ec93277..dc3a85a72822 100644 --- a/keyboards/mechwild/sugarglider/config.h +++ b/keyboards/mechwild/sugarglider/config.h @@ -3,15 +3,16 @@ #pragma once - #define DYNAMIC_KEYMAP_LAYER_COUNT 5 +/* Matrix COL and ROW definitions */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 6 /* Cirque Touchpad Settings */ #define POINTING_DEVICE_AUTO_MOUSE_ENABLE #define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X - /* Define custom font */ #define OLED_FONT_H "keyboards/mechwild/sugarglider/glcdfont.c" diff --git a/keyboards/mechwild/sugarglider/post_rules.mk b/keyboards/mechwild/sugarglider/post_rules.mk index e56a372434bb..c94ac22fabbc 100644 --- a/keyboards/mechwild/sugarglider/post_rules.mk +++ b/keyboards/mechwild/sugarglider/post_rules.mk @@ -1,4 +1,3 @@ - # Checking if WIDE_OLED ifeq ($(strip $(WIDE_OLED_ENABLE)), yes) OPT_DEFS += -DOLED_DISPLAY_128X64 diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index 24cdebd0a0c6..69b58eb060dc 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -64,7 +64,7 @@ bool dip_switch_update_kb(uint8_t index, bool active) { if (!dip_switch_update_user(index, active)) { return false; } switch (index) { case 0: - if(active) { tap_code(KC_CAPS); } + if(active != host_keyboard_led_state().caps_lock) { tap_code(KC_CAPS); } break; break; } @@ -121,7 +121,7 @@ bool led_update_kb(led_t led_state) { } #if defined(OLED_ENABLE) && defined(OLED_DISPLAY_128X64) // Wide OLED Functionality -oled_rotation_t oled_init_user(oled_rotation_t rotation) { +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; // flips the display 180 degrees } @@ -137,7 +137,6 @@ static void render_sugarglider_wide(void) { // Render sugarglider logo static const char PROGMEM sgl_7[] = {0xDE, 0xBD, 0xBE, 0xDE, 0xDE, 0xBF, 0xDE, 0xDE, 0xC0, 0xC1, 0x00}; static const char PROGMEM sgl_8[] = {0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0x00}; - oled_set_cursor(0,0); oled_write_P(sgl_1, false); oled_set_cursor(0,1); oled_write_P(sgl_2, false); @@ -161,7 +160,6 @@ static void render_logo(void) { // Render MechWild "MW" Logo static const char PROGMEM logo_3[] = {0xD5, 0xD6, 0xD7, 0xD8, 0x00}; static const char PROGMEM logo_4[] = {0xDE, 0xD9, 0xDA, 0xDB, 0x00}; - oled_set_cursor(0,0); oled_write_P(logo_1, false); oled_set_cursor(0,1); oled_write_P(logo_2, false); @@ -253,7 +251,7 @@ bool oled_task_kb(void) { return true; } #elif defined(OLED_ENABLE) && ! defined(OLED_DISPLAY_128X64) -oled_rotation_t oled_init_user(oled_rotation_t rotation) { +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_270; // flips the display 270 degrees } @@ -263,7 +261,6 @@ static void render_logo(void) { // Render MechWild "MW" Logo static const char PROGMEM logo_3[] = {0xD5, 0xD6, 0xD7, 0xD8, 0x00}; static const char PROGMEM logo_4[] = {0xDE, 0xD9, 0xDA, 0xDB, 0x00}; - oled_set_cursor(0,0); oled_write_P(logo_1, false); oled_set_cursor(0,1); oled_write_P(logo_2, false); diff --git a/keyboards/mechwild/sugarglider/sugarglider.h b/keyboards/mechwild/sugarglider/sugarglider.h index 01e2131be6f6..d1fa540985ad 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.h +++ b/keyboards/mechwild/sugarglider/sugarglider.h @@ -14,7 +14,7 @@ typedef union { } keyboard_config_t; extern keyboard_config_t keyboard_config; -extern uint16_t dpi_array[]; +extern uint16_t dpi_array[]; enum keyboard_keycodes { DPI_UP = QK_KB, @@ -24,5 +24,5 @@ enum keyboard_keycodes { TAP_DN, TAP_ON, TAP_OFF, - TAP_TOG, + TAP_TOG }; From 4ef95584ce4bc78a6c9780ec31a465ff093ccd14 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Mon, 27 Feb 2023 23:21:53 -0500 Subject: [PATCH 19/25] made changes to formatting to work with breaking merge --- keyboards/mechwild/sugarglider/sugarglider.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index 69b58eb060dc..399d414461b0 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -173,7 +173,7 @@ bool oled_task_kb(void) { if(!oled_task_user()) { return false; } - if ( IS_HOST_LED_OFF(USB_LED_NUM_LOCK) && IS_HOST_LED_OFF(USB_LED_CAPS_LOCK) && IS_HOST_LED_OFF(USB_LED_SCROLL_LOCK) && get_highest_layer(layer_state) == 0 ) { + if ( !(host_keyboard_led_state().num_lock || host_keyboard_led_state().caps_lock || host_keyboard_led_state().scroll_lock ) && get_highest_layer(layer_state) == 0 ) { if (clear_screen_art == true) { oled_clear(); oled_render(); @@ -205,19 +205,19 @@ bool oled_task_kb(void) { oled_set_cursor(8,1); switch (get_highest_layer(layer_state)) { case 0: - oled_write_P(PSTR("Base Layer"), false); + oled_write_P(PSTR("Base "), false); break; case 1: - oled_write_P(PSTR("Lower"), false); + oled_write_P(PSTR("Lower "), false); break; case 2: - oled_write_P(PSTR("Raise"), false); + oled_write_P(PSTR("Raise "), false); break; case 3: oled_write_P(PSTR("Adjust"), false); break; case 4: - oled_write_P(PSTR("Mouse Layer"), false); + oled_write_P(PSTR("Mouse "), false); break; #ifdef STENO_ENABLE case 5: @@ -279,7 +279,7 @@ bool oled_task_kb(void) { oled_set_cursor(0,5); switch (get_highest_layer(layer_state)) { case 0: - oled_write_P(PSTR("Base"), false); + oled_write_P(PSTR("Base "), false); break; case 1: oled_write_P(PSTR("Lower"), false); From ad2ddb47b3b74034d7a00a431b1d6b1375474aa8 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Fri, 3 Mar 2023 14:06:19 -0500 Subject: [PATCH 20/25] updating steno keymap defaults --- .../mechwild/sugarglider/keymaps/default/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c index 99a1363dcaa4..149d907a8ed6 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_LOWER] = LAYOUT( KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, DPI_UP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, - KC_TRNS, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DPI_DN, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, KC_TRNS, + KC_TRNS, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DPI_DN, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_SCLN, KC_SCLN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -45,11 +45,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, DPI_FINE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - [_STENO] = LAYOUT( - STN_RES1, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, KC_TRNS, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, - STN_RES2, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, KC_TRNS, KC_TRNS, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_MOD, KC_TRNS, - KC_TRNS, STN_A, STN_O, STN_N1, KC_TRNS, KC_TRNS, KC_TRNS, STN_N2, STN_E, STN_U, KC_TRNS + [_STENO] = LAYOUT( + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, KC_TRNS, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC, + STN_RES1, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, KC_TRNS, KC_TRNS, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_RES2, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, KC_TRNS, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + KC_TRNS, STN_N1, STN_A, STN_O, KC_TRNS, KC_TRNS, KC_TRNS, STN_E, STN_U, STN_N2, KC_TRNS ) }; From 2df6ebe6e636ee474eb806d372ad3f7a2556a55a Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Wed, 8 Mar 2023 09:56:21 -0500 Subject: [PATCH 21/25] Update keyboards/mechwild/sugarglider/sugarglider.h Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com> --- keyboards/mechwild/sugarglider/sugarglider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/mechwild/sugarglider/sugarglider.h b/keyboards/mechwild/sugarglider/sugarglider.h index d1fa540985ad..4d44b0e96600 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.h +++ b/keyboards/mechwild/sugarglider/sugarglider.h @@ -9,7 +9,7 @@ typedef union { uint32_t raw; struct { uint8_t dpi_config; - int16_t dt_term_config; + uint16_t dt_term_config; }; } keyboard_config_t; From 5cae8a598fe9c1c3f002b20bd328abe5013be00a Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Wed, 8 Mar 2023 10:57:53 -0500 Subject: [PATCH 22/25] Suggestions taken into account from code review. --- keyboards/mechwild/sugarglider/rules.mk | 3 +- keyboards/mechwild/sugarglider/sugarglider.c | 76 ++++++++----------- keyboards/mechwild/sugarglider/sugarglider.h | 2 +- .../sugarglider/wide_oled/f401/rules.mk | 3 + .../sugarglider/wide_oled/f411/rules.mk | 3 + .../mechwild/sugarglider/wide_oled/rules.mk | 6 ++ 6 files changed, 46 insertions(+), 47 deletions(-) create mode 100644 keyboards/mechwild/sugarglider/wide_oled/f401/rules.mk create mode 100644 keyboards/mechwild/sugarglider/wide_oled/f411/rules.mk create mode 100644 keyboards/mechwild/sugarglider/wide_oled/rules.mk diff --git a/keyboards/mechwild/sugarglider/rules.mk b/keyboards/mechwild/sugarglider/rules.mk index 8f475595c274..acf0b6f1f4cd 100644 --- a/keyboards/mechwild/sugarglider/rules.mk +++ b/keyboards/mechwild/sugarglider/rules.mk @@ -1,7 +1,6 @@ # Build Options # change yes to no to disable # -WIDE_OLED_ENABLE = yes OLED_ENABLE = yes # OLED Enabled OLED_DRIVER = SSD1306 # OLED Driver @@ -18,7 +17,7 @@ VPATH += drivers/gpio SRC += mcp23018.c matrix.c QUANTUM_LIB_SRC += i2c_master.c -DEFAULT_FOLDER = mechwild/sugarglider/f401 +DEFAULT_FOLDER = mechwild/sugarglider/wide_oled # Necessary for stenography functionality KEYBOARD_SHARED_EP = yes # Needed to free up an endpoint in blackpill diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c index 399d414461b0..76c6d2983202 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.c +++ b/keyboards/mechwild/sugarglider/sugarglider.c @@ -6,10 +6,8 @@ #ifndef GLIDEPOINT_DPI_OPTIONS # define GLIDEPOINT_DPI_OPTIONS \ { 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 3600, 4000 } -# ifndef GLIDEPOINT_DPI_DEFAULT -# define GLIDEPOINT_DPI_DEFAULT 1 -# endif #endif + #ifndef GLIDEPOINT_DPI_DEFAULT # define GLIDEPOINT_DPI_DEFAULT 1 #endif @@ -57,7 +55,7 @@ void tap_toggle(void) { } eeconfig_update_kb(keyboard_config.raw); } -#endif +#endif // ifdef DYNAMIC_TAPPING_TERM_ENABLE #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { @@ -120,7 +118,23 @@ bool led_update_kb(led_t led_state) { return res; } -#if defined(OLED_ENABLE) && defined(OLED_DISPLAY_128X64) // Wide OLED Functionality +#ifdef OLED_ENABLE +static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0xCC, 0xCD, 0xCE, 0xCF, 0x00}; + static const char PROGMEM logo_2[] = {0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + static const char PROGMEM logo_3[] = {0xD5, 0xD6, 0xD7, 0xD8, 0x00}; + static const char PROGMEM logo_4[] = {0xDE, 0xD9, 0xDA, 0xDB, 0x00}; + + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); +} + +#ifdef OLED_DISPLAY_128X64 // Wide OLED Functionality oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; // flips the display 180 degrees } @@ -154,37 +168,21 @@ static void render_sugarglider_wide(void) { // Render sugarglider logo oled_write_P(sgl_8, false); } -static void render_logo(void) { // Render MechWild "MW" Logo - static const char PROGMEM logo_1[] = {0xCC, 0xCD, 0xCE, 0xCF, 0x00}; - static const char PROGMEM logo_2[] = {0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - static const char PROGMEM logo_3[] = {0xD5, 0xD6, 0xD7, 0xD8, 0x00}; - static const char PROGMEM logo_4[] = {0xDE, 0xD9, 0xDA, 0xDB, 0x00}; - - oled_write_P(logo_1, false); - oled_set_cursor(0,1); - oled_write_P(logo_2, false); - oled_set_cursor(0,2); - oled_write_P(logo_3, false); - oled_set_cursor(0,3); - oled_write_P(logo_4, false); -} - bool oled_task_kb(void) { if(!oled_task_user()) { return false; } - if ( !(host_keyboard_led_state().num_lock || host_keyboard_led_state().caps_lock || host_keyboard_led_state().scroll_lock ) && get_highest_layer(layer_state) == 0 ) { + if ( !(host_keyboard_led_state().num_lock || host_keyboard_led_state().caps_lock || host_keyboard_led_state().scroll_lock ) && get_highest_layer(layer_state) == 0 ) { // If none of the status LEDs are active and also the active layer is the base layer if (clear_screen_art == true) { oled_clear(); oled_render(); clear_screen_art = false; } render_sugarglider_wide(); -#ifdef POINTING_DEVICE_ENABLE +#ifdef POINTING_DEVICE_ENABLE // only display dpi and tap info if pointing devices are active oled_set_cursor(10,5); oled_write_P(PSTR(" DPI:"), false); oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); -#endif #ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically oled_set_cursor(10,6); oled_write_P(PSTR(" TAP:"), false); @@ -193,9 +191,10 @@ bool oled_task_kb(void) { } else { oled_write(get_u16_str(g_tapping_term, ' '), false); } +#endif #endif clear_screen = true; - } else { + } else { // If any of the status LEDs are active or if the active layer is not the base layer if (clear_screen == true) { oled_clear(); oled_render(); @@ -232,11 +231,10 @@ bool oled_task_kb(void) { oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); oled_write_P(led_state.scroll_lock ? PSTR("SCR") : PSTR(" "), false); -#ifdef POINTING_DEVICE_ENABLE +#ifdef POINTING_DEVICE_ENABLE // only display dpi and tap info if pointing devices are active oled_set_cursor(8,2); oled_write_P(PSTR("DPI:"), false); oled_write(get_u16_str(dpi_array[keyboard_config.dpi_config], ' '), false); -#endif #ifdef DYNAMIC_TAPPING_TERM_ENABLE // only display tap info if it is being configured dynamically oled_set_cursor(8,3); oled_write_P(PSTR("TAP:"), false); @@ -245,30 +243,17 @@ bool oled_task_kb(void) { } else { oled_write(get_u16_str(g_tapping_term, ' '), false); } +#endif #endif clear_screen_art = true; } return true; } -#elif defined(OLED_ENABLE) && ! defined(OLED_DISPLAY_128X64) +#else // Using an OLED but not the wide OLED oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_270; // flips the display 270 degrees } -static void render_logo(void) { // Render MechWild "MW" Logo - static const char PROGMEM logo_1[] = {0xCC, 0xCD, 0xCE, 0xCF, 0x00}; - static const char PROGMEM logo_2[] = {0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - static const char PROGMEM logo_3[] = {0xD5, 0xD6, 0xD7, 0xD8, 0x00}; - static const char PROGMEM logo_4[] = {0xDE, 0xD9, 0xDA, 0xDB, 0x00}; - - oled_write_P(logo_1, false); - oled_set_cursor(0,1); - oled_write_P(logo_2, false); - oled_set_cursor(0,2); - oled_write_P(logo_3, false); - oled_set_cursor(0,3); - oled_write_P(logo_4, false); -} bool oled_task_kb(void) { if(!oled_task_user()) { @@ -322,7 +307,8 @@ bool oled_task_kb(void) { #endif return true; } -#endif +#endif // Not using wide OLED +#endif // ifdef OLED_ENABLE bool process_record_kb(uint16_t keycode, keyrecord_t* record) { switch(keycode) { @@ -356,7 +342,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { #ifdef DYNAMIC_TAPPING_TERM_ENABLE // only include tap info keycodes if it is being configured dynamically case TAP_UP: if (record->event.pressed) { - tap_modify(DYNAMIC_TAPPING_TERM_INCREMENT, true); + if (keyboard_config.dt_term_config < 5000) { + tap_modify(DYNAMIC_TAPPING_TERM_INCREMENT, true); + } } return false; case TAP_DN: @@ -381,7 +369,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { tap_toggle(); } return false; -#endif +#endif // ifdef } return process_record_user(keycode, record); } diff --git a/keyboards/mechwild/sugarglider/sugarglider.h b/keyboards/mechwild/sugarglider/sugarglider.h index 4d44b0e96600..d1fa540985ad 100644 --- a/keyboards/mechwild/sugarglider/sugarglider.h +++ b/keyboards/mechwild/sugarglider/sugarglider.h @@ -9,7 +9,7 @@ typedef union { uint32_t raw; struct { uint8_t dpi_config; - uint16_t dt_term_config; + int16_t dt_term_config; }; } keyboard_config_t; diff --git a/keyboards/mechwild/sugarglider/wide_oled/f401/rules.mk b/keyboards/mechwild/sugarglider/wide_oled/f401/rules.mk new file mode 100644 index 000000000000..a92d8a85c619 --- /dev/null +++ b/keyboards/mechwild/sugarglider/wide_oled/f401/rules.mk @@ -0,0 +1,3 @@ +# MCU name +MCU = STM32F401 +BOARD = BLACKPILL_STM32_F401 diff --git a/keyboards/mechwild/sugarglider/wide_oled/f411/rules.mk b/keyboards/mechwild/sugarglider/wide_oled/f411/rules.mk new file mode 100644 index 000000000000..db1d4054fdf4 --- /dev/null +++ b/keyboards/mechwild/sugarglider/wide_oled/f411/rules.mk @@ -0,0 +1,3 @@ +# MCU name +MCU = STM32F411 +BOARD = BLACKPILL_STM32_F411 diff --git a/keyboards/mechwild/sugarglider/wide_oled/rules.mk b/keyboards/mechwild/sugarglider/wide_oled/rules.mk new file mode 100644 index 000000000000..193169239b2f --- /dev/null +++ b/keyboards/mechwild/sugarglider/wide_oled/rules.mk @@ -0,0 +1,6 @@ +# Build Options +# change yes to no to disable +# +WIDE_OLED_ENABLE = yes + +DEFAULT_FOLDER = mechwild/sugarglider/wide_oled/f401 \ No newline at end of file From 69e4be0994457afefe49d0c65889356600e6afda Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Fri, 10 Mar 2023 11:56:23 -0500 Subject: [PATCH 23/25] The encoders are barely usable because of the i2c delay without adding an extra check in each scan. --- keyboards/mechwild/sugarglider/matrix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keyboards/mechwild/sugarglider/matrix.c b/keyboards/mechwild/sugarglider/matrix.c index fe7e5218543a..e50531df8af8 100644 --- a/keyboards/mechwild/sugarglider/matrix.c +++ b/keyboards/mechwild/sugarglider/matrix.c @@ -86,6 +86,9 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { bool changed = false; for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { changed |= read_cols_on_row(current_matrix, current_row); +#ifdef ENCODER_ENABLE + encoder_read(); +#endif } return changed; } From 01c96882f9c18eab0469bc4c29f74dca6325ba22 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Fri, 10 Mar 2023 11:59:21 -0500 Subject: [PATCH 24/25] Forgot to include encoder.h for the encoder scan rate fix. --- keyboards/mechwild/sugarglider/matrix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/mechwild/sugarglider/matrix.c b/keyboards/mechwild/sugarglider/matrix.c index e50531df8af8..96a16df542a3 100644 --- a/keyboards/mechwild/sugarglider/matrix.c +++ b/keyboards/mechwild/sugarglider/matrix.c @@ -5,6 +5,7 @@ #include "mcp23018.h" #include "wait.h" #include "debug.h" +#include "encoder.h" #define I2C_ADDR 0x20 #define ROW_POS { 0b01000000, 0b10000000, 0b01000000, 0b10000000, 0b00000100, 0b00010000, 0b00100000, 0b00000010, 0b00001000 } From f1935a70d208e85a536a1c2e8fd249e06dbaef92 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Sat, 11 Mar 2023 15:44:31 -0500 Subject: [PATCH 25/25] Apply suggestions from code review Co-authored-by: jack <0x6a73@protonmail.com> --- keyboards/mechwild/sugarglider/keymaps/default/keymap.c | 6 +----- keyboards/mechwild/sugarglider/keymaps/default/rules.mk | 1 + keyboards/mechwild/sugarglider/keymaps/via/keymap.c | 4 ---- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c index 149d907a8ed6..77541edf130c 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c @@ -19,7 +19,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { QK_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, TAP_UP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_MUTE, TAP_DN, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(_STENO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_MUTE, KC_LGUI, KC_LALT, MO(_LOWER), KC_MS_BTN1, TAP_TOG, KC_MS_BTN2, MO(_RAISE), KC_SPC, KC_RSFT, KC_MUTE + KC_MUTE, KC_LGUI, KC_LALT, TL_LOWR, KC_MS_BTN1, TAP_TOG, KC_MS_BTN2, TL_UPPR, KC_SPC, KC_RSFT, KC_MUTE ), [_LOWER] = LAYOUT( KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, DPI_UP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, @@ -64,10 +64,6 @@ const uint16_t PROGMEM encoder_map[][4][2] = { }; #endif -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -} - void pointing_device_init_user(void) { set_auto_mouse_layer(_MOUSE); set_auto_mouse_enable(true); diff --git a/keyboards/mechwild/sugarglider/keymaps/default/rules.mk b/keyboards/mechwild/sugarglider/keymaps/default/rules.mk index ee325681483f..14d46f300c22 100644 --- a/keyboards/mechwild/sugarglider/keymaps/default/rules.mk +++ b/keyboards/mechwild/sugarglider/keymaps/default/rules.mk @@ -1 +1,2 @@ ENCODER_MAP_ENABLE = yes +TRI_LAYER_ENABLE = yes diff --git a/keyboards/mechwild/sugarglider/keymaps/via/keymap.c b/keyboards/mechwild/sugarglider/keymaps/via/keymap.c index 630d67d7a5de..692af70359a3 100644 --- a/keyboards/mechwild/sugarglider/keymaps/via/keymap.c +++ b/keyboards/mechwild/sugarglider/keymaps/via/keymap.c @@ -55,10 +55,6 @@ const uint16_t PROGMEM encoder_map[][4][2] = { }; #endif -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -} - void pointing_device_init_user(void) { set_auto_mouse_layer(_MOUSE); set_auto_mouse_enable(true);