Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Adding new macro board called tapedeck #20161

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5fe2730
Tapedeck Intial Firmware
SamGowland Mar 17, 2023
b0a103e
info json
SamGowland Mar 17, 2023
bbdfc83
remove matrix in json
SamGowland Mar 17, 2023
44c0c35
license header
SamGowland Mar 17, 2023
f8d9340
Update keyboards/tapedeck/info.json
SamGowland Mar 17, 2023
986d3df
Update keyboards/tapedeck/rules.mk
SamGowland Mar 17, 2023
dabb858
Update keyboards/tapedeck/config.h
SamGowland Mar 17, 2023
ae6d17c
Update keyboards/tapedeck/keymaps/default/keymap.c
SamGowland Mar 17, 2023
268b166
Update keyboards/tapedeck/rules.mk
SamGowland Mar 17, 2023
0ef8e4b
Update keyboards/tapedeck/tapedeck.c
SamGowland Mar 17, 2023
46f10c2
update to info.json
SamGowland Mar 17, 2023
cb019f5
rgb
SamGowland Mar 17, 2023
cf54628
bad comma
SamGowland Mar 17, 2023
61c415e
Update keyboards/tapedeck/info.json
SamGowland Mar 17, 2023
62b4f47
Update keyboards/tapedeck/info.json
SamGowland Mar 17, 2023
907b3d8
Update keyboards/tapedeck/info.json
SamGowland Mar 17, 2023
9c3a9c3
Update keyboards/tapedeck/info.json
SamGowland Mar 17, 2023
083f2db
Update keyboards/tapedeck/keymaps/default/keymap.c
SamGowland Mar 17, 2023
13f312f
Update keyboards/tapedeck/keymaps/default/keymap.c
SamGowland Mar 17, 2023
f991ff6
Update keyboards/tapedeck/keymaps/default/keymap.c
SamGowland Mar 17, 2023
83d888e
Update keyboards/tapedeck/info.json
SamGowland Mar 17, 2023
8ff164b
Update keyboards/tapedeck/readme.md
SamGowland Mar 17, 2023
de298db
Update keyboards/tapedeck/info.json
SamGowland Mar 17, 2023
8cac909
Update keyboards/tapedeck/readme.md
SamGowland Mar 17, 2023
49bee45
Update keyboards/tapedeck/rules.mk
SamGowland Mar 17, 2023
e344a42
Update keyboards/tapedeck/info.json
SamGowland Mar 17, 2023
c7b4209
Update keyboards/tapedeck/keymaps/default/keymap.c
SamGowland Mar 17, 2023
8c23ede
volume in keyboard not keymap
SamGowland Mar 17, 2023
8311b4d
Update keyboards/tapedeck/info.json
SamGowland Mar 18, 2023
d970bbe
markdown no html
SamGowland Mar 18, 2023
ec38f42
Update keyboards/tapedeck/rules.mk
SamGowland Mar 19, 2023
359139c
Update keyboards/tapedeck/tapedeck.c
SamGowland Mar 20, 2023
2ade9be
Update keyboards/tapedeck/tapedeck.c
SamGowland Mar 20, 2023
e2333f4
enocder map enable
SamGowland Mar 20, 2023
45d39dc
brightness on second encoder by default
SamGowland Mar 21, 2023
d65f512
Update keyboards/tapedeck/keymaps/default/keymap.c
SamGowland Mar 21, 2023
161697c
Update keyboards/tapedeck/tapedeck.c
SamGowland Mar 21, 2023
5fba777
Update keyboards/tapedeck/tapedeck.c
SamGowland Mar 21, 2023
445016f
Update keyboards/tapedeck/tapedeck.c
SamGowland Mar 21, 2023
2814ca3
Update keyboards/tapedeck/tapedeck.c
SamGowland Mar 21, 2023
9b11d86
Update keyboards/tapedeck/info.json
SamGowland Mar 23, 2023
5e26d20
Update keyboards/tapedeck/info.json
SamGowland Mar 23, 2023
d737559
Update keyboards/tapedeck/keymaps/default/keymap.c
SamGowland Mar 23, 2023
7fa5304
encoder map enable move to keymaps
SamGowland Mar 23, 2023
4c26317
Update keyboards/tapedeck/config.h
SamGowland Mar 24, 2023
cb661f8
Update keyboards/tapedeck/info.json
SamGowland Mar 24, 2023
dee42a0
Only use the slider code if enabled.
SamGowland Mar 26, 2023
d8a0cc5
move to correct folder
SamGowland Apr 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions keyboards/tapedeck/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright 2023 Gowla
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

/* SLIDER */
#define POT_ENABLE

Comment on lines +19 to +21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there's a reason to leave this guard, this file should just be removed all together.

Suggested change
/* SLIDER */
#define POT_ENABLE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place to enable/disable slider was my thought.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except the implementation doesnt really allow that?

/* RGB Default */
# define RGB_MATRIX_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_MOOD

67 changes: 67 additions & 0 deletions keyboards/tapedeck/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"manufacturer": "Gowla",
"keyboard_name": "Tapedeck",
"maintainer": "Gowla",
"development_board": "promicro",
"diode_direction": "ROW2COL",
"encoder": {
"rotary": [
{
"pin_a": "F4",
"pin_b": "F5"
},
{
"pin_a": "F6",
"pin_b": "F7"
}
]
},
"features": {
"bootmagic": true,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgblight": true,
},
"matrix_pins": {
"cols": ["B5", "B4", "E6", "D7", "C6"],
"rows": ["B2", "B3", "B1"]
},
"rgblight": {
"led_count": 3,
"pin": "B6",
"animations": {
"knight": true,
"rainbow_swirl": true,
"rainbow_mood": true,
"rgb_test": true
}
},
"url": "https://github.com/SamGowland/Gowla-Macro-Boards",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0xFEED"
},
SamGowland marked this conversation as resolved.
Show resolved Hide resolved
"layouts": {
"LAYOUT": {
"layout": [
{ "label": "k00", "matrix": [0, 0], "x": 0, "y": 0 },
{ "label": "k01", "matrix": [0, 1], "x": 1, "y": 0 },
{ "label": "k02", "matrix": [0, 2], "x": 2, "y": 0 },
{ "label": "k03", "matrix": [0, 3], "x": 3, "y": 0 },
{ "label": "k04", "matrix": [0, 4], "x": 5, "y": 0.5 },
{ "label": "k10", "matrix": [1, 0], "x": 0, "y": 1 },
{ "label": "k11", "matrix": [1, 1], "x": 1, "y": 1 },
{ "label": "k12", "matrix": [1, 2], "x": 2, "y": 1 },
{ "label": "k13", "matrix": [1, 3], "x": 3, "y": 1 },
{ "label": "k14", "matrix": [1, 4], "x": 5, "y": 1.75 },
{ "label": "k20", "matrix": [2, 0], "x": 0, "y": 2 },
{ "label": "k21", "matrix": [2, 1], "x": 1, "y": 2 },
{ "label": "k22", "matrix": [2, 2], "x": 2, "y": 2 },
{ "label": "k23", "matrix": [2, 3], "x": 3, "y": 2 }
]
}
}
}
33 changes: 33 additions & 0 deletions keyboards/tapedeck/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Copyright 2023 Gowla
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

#define BASE 0

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT(
KC_ESC, KC_MNXT, KC_MPLY, KC_MNXT, KC_MPLY,
RGB_MODE_RAINBOW, RGB_MODE_RGBTEST, RGB_M_K, RGB_TOG, KC_MPLY,
KC_F1, KC_F2, KC_F3, KC_F14
)
};

SamGowland marked this conversation as resolved.
Show resolved Hide resolved
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[BASE] = { ENCODER_CCW_CW(KC_WH_D, KC_WH_U), ENCODER_CCW_CW(KC_BRID, KC_BRIU) }
};
#endif
4 changes: 4 additions & 0 deletions keyboards/tapedeck/keymaps/rules.mk
SamGowland marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Build Options
# change yes to no to disable
#
ENCODER_MAP_ENABLE = yes
33 changes: 33 additions & 0 deletions keyboards/tapedeck/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Gowla Tapedeck

![Image of Tapedeck](https://i.ibb.co/R3JVMjM/tapedeck.jpg)

4x4 12 Key Macro Board with 60MM Slider, RGB and 2 X Rotary Encoders. For use with QMK, designed and sold by Gowla.

* Keyboard Maintainer: [Gowla](https://github.com/SamGowland/)
* Hardware Supported: Pro Micro ATmega32U4, Cherry MX Switches, Alps 60MM Slider
* Hardware Availability: [Repo](https://github.com/SamGowland/Gowla-Macro-Boards)

Make example for this keyboard (after setting up your build environment):

make tapedeck:default

Flashing example for this keyboard:

make tapedeck: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).
SamGowland marked this conversation as resolved.
Show resolved Hide resolved

## Bootloader

Enter the bootloader in 3 ways:

* **Bootmagic reset**: Hold down the top-left key (underneath the Pro Micro) and plug in the keyboard. This will also clear EEPROM, so it is a good first step if the keyboard is misbehaving.
* **Physical reset**: Remove the back plate and short the `RST` and `GND` pins on the Pro Micro.
* **Keycode in layout**: There is no key mapped to `QK_BOOT` in the pre-created keymaps, but you may assign this key in any keymaps you create.

As a Pro Micro-compatible board, the Gowla Tapedeck uses `caterina` as its bootloader by default. Many popular Pro Micro alternatives like the Elite-C, Bit-C, Sea-Micro, Puchi-C etc should be flashed with a different bootloader such as `atmel-dfu`.

If the incorrect bootloader is specified, bootmagic reset and the `QK_BOOT` keycode will not work.

To avoid this problem, set the correct bootloader in your custom keymap's `rules.mk` file before compiling, or flash using an appropriate target (e.g. `make tapedeck:default:dfu`). See [flashing instructions and bootloader information](https://docs.qmk.fm/#/flashing) for more details.
4 changes: 4 additions & 0 deletions keyboards/tapedeck/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Build Options
# change yes to no to disable
#
QUANTUM_LIB_SRC += analog.c
87 changes: 87 additions & 0 deletions keyboards/tapedeck/tapedeck.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/* Copyright 2023 Gowla
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "quantum.h"

#ifdef POT_ENABLE
#include "analog.h"
#endif

bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) {
return false;
}
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_WH_U);
} else {
tap_code(KC_WH_D);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_BRIU);
} else {
tap_code(KC_BRID);
}
}
return true;
}

void keyboard_post_init_kb(void) {
#ifdef POT_ENABLE
analogReference(ADC_REF_POWER);
#endif
SamGowland marked this conversation as resolved.
Show resolved Hide resolved
keyboard_post_init_user();
}

#ifdef POT_ENABLE
int16_t pot_val = 0;
int16_t prev_val = 0;
int16_t val = 0;
uint8_t divisor = 0;

long map(long x, long in_min, long in_max, long out_min, long out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

void slider(void) {
if (divisor++) { // only run the slider function 1/256 times it's called
return;
}

pot_val = analogReadPin(D4);
val = map(pot_val, 0, 1023, 1, 50); // Windows Specific

if (( val > (prev_val + 1)) && val != prev_val){
int i;
for (i = prev_val; i < val; i++ )
{tap_code(KC_VOLU);}
}
if ((val < (prev_val - 1)) && val != prev_val){
int i;
for (i = val; i < prev_val; i++ )
{tap_code(KC_VOLD);}
}
prev_val = val;
}
#endif

void housekeeping_task_kb(void) {
#ifdef POT_ENABLE
slider();
#endif
}