From 81d601b72548de1b3eab70b6124252ac540cac41 Mon Sep 17 00:00:00 2001
From: Less/Rikki <86894501+lesshonor@users.noreply.github.com>
Date: Tue, 28 Nov 2023 21:24:02 -0500
Subject: [PATCH] refactor: projectcain/vault35 (#22558)
---
.../projectcain/vault35/atmega32u4/info.json | 45 +++++++
.../projectcain/vault35/atmega32u4/rules.mk | 1 +
keyboards/projectcain/vault35/config.h | 36 ------
keyboards/projectcain/vault35/info.json | 113 +++++++++++-------
.../vault35/keymaps/default/keymap.c | 39 +++---
.../vault35/keymaps/default/rules.mk | 3 +-
keyboards/projectcain/vault35/rules.mk | 14 +--
7 files changed, 141 insertions(+), 110 deletions(-)
create mode 100644 keyboards/projectcain/vault35/atmega32u4/info.json
create mode 100644 keyboards/projectcain/vault35/atmega32u4/rules.mk
delete mode 100644 keyboards/projectcain/vault35/config.h
diff --git a/keyboards/projectcain/vault35/atmega32u4/info.json b/keyboards/projectcain/vault35/atmega32u4/info.json
new file mode 100644
index 0000000000..9acd8ee34d
--- /dev/null
+++ b/keyboards/projectcain/vault35/atmega32u4/info.json
@@ -0,0 +1,45 @@
+{
+ "bootloader": "atmel-dfu",
+ "build": {
+ "lto": true
+ },
+ "encoder": {
+ "rotary": [
+ {"pin_a": "D7", "pin_b": "D6", "resolution": 2}
+ ]
+ },
+ "features": {
+ "bootmagic": true,
+ "extrakey": true,
+ "encoder": true,
+ "mousekey": true,
+ "nkro": true,
+ "rgblight": true
+ },
+ "matrix_pins": {
+ "cols": ["B1", "D3", "F0", "F1", "F4", "F5", "F6", "F7", "C6", "B6", "B5"],
+ "rows": ["B4", "D4", "B0", "C7"]
+ },
+ "processor": "atmega32u4",
+ "rgblight": {
+ "animations": {
+ "alternating": true,
+ "breathing": true,
+ "christmas": true,
+ "knight": true,
+ "rainbow_mood": true,
+ "rainbow_swirl": true,
+ "rgb_test": true,
+ "snake": true,
+ "static_gradient": true,
+ "twinkle": true
+ },
+ "brightness_steps": 8,
+ "led_count": 12,
+ "saturation_steps": 8,
+ "sleep": true
+ },
+ "ws2812": {
+ "pin": "D5"
+ }
+}
diff --git a/keyboards/projectcain/vault35/atmega32u4/rules.mk b/keyboards/projectcain/vault35/atmega32u4/rules.mk
new file mode 100644
index 0000000000..6e7633bfe0
--- /dev/null
+++ b/keyboards/projectcain/vault35/atmega32u4/rules.mk
@@ -0,0 +1 @@
+# This file intentionally left blank
diff --git a/keyboards/projectcain/vault35/config.h b/keyboards/projectcain/vault35/config.h
deleted file mode 100644
index 7abf6b197c..0000000000
--- a/keyboards/projectcain/vault35/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-Copyright 2021 projectcain
-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
-
-/* 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
-
-/*
- * 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
diff --git a/keyboards/projectcain/vault35/info.json b/keyboards/projectcain/vault35/info.json
index d23c4b2f46..5662cdbf6b 100644
--- a/keyboards/projectcain/vault35/info.json
+++ b/keyboards/projectcain/vault35/info.json
@@ -1,27 +1,22 @@
{
- "keyboard_name": "Vault35",
"manufacturer": "projectcain",
- "url": "",
+ "keyboard_name": "Vault35",
"maintainer": "projectcain",
- "usb": {
- "vid": "0xFEED",
- "pid": "0x6060",
- "device_version": "0.0.1"
- },
- "matrix_pins": {
- "cols": ["B1", "D3", "F0", "F1", "F4", "F5", "F6", "F7", "C6", "B6", "B5"],
- "rows": ["B4", "D4", "B0", "C7"]
- },
"diode_direction": "COL2ROW",
- "encoder": {
- "rotary": [
- {"pin_a": "D6", "pin_b": "D7", "resolution": 2}
- ]
+ "qmk": {
+ "locking": {
+ "enabled": true,
+ "resync": true
+ }
+ },
+ "url": "https://mechvault.net",
+ "usb": {
+ "device_version": "0.0.1",
+ "pid": "0x6060",
+ "vid": "0xFEED"
},
- "processor": "atmega32u4",
- "bootloader": "atmel-dfu",
"layouts": {
- "LAYOUT_split_4space": {
+ "LAYOUT_all": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1, "y": 0},
@@ -33,8 +28,7 @@
{"matrix": [0, 7], "x": 7, "y": 0},
{"matrix": [0, 8], "x": 8, "y": 0},
{"matrix": [0, 9], "x": 9, "y": 0},
- {"matrix": [0, 10], "x": 10, "y": 0},
-
+ {"matrix": [0, 10], "x": 10, "y": 0, "encoder": 0},
{"matrix": [1, 0], "x": 0, "y": 1, "w": 1.25},
{"matrix": [1, 1], "x": 1.25, "y": 1},
{"matrix": [1, 2], "x": 2.25, "y": 1},
@@ -45,7 +39,6 @@
{"matrix": [1, 7], "x": 7.25, "y": 1},
{"matrix": [1, 8], "x": 8.25, "y": 1},
{"matrix": [1, 9], "x": 9.25, "y": 1, "w": 1.75},
-
{"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
{"matrix": [2, 1], "x": 1.75, "y": 2},
{"matrix": [2, 2], "x": 2.75, "y": 2},
@@ -56,16 +49,16 @@
{"matrix": [2, 7], "x": 7.75, "y": 2},
{"matrix": [2, 8], "x": 8.75, "y": 2},
{"matrix": [2, 9], "x": 9.75, "y": 2, "w": 1.25},
-
{"matrix": [3, 1], "x": 1.5, "y": 3},
{"matrix": [3, 2], "x": 2.5, "y": 3, "w": 1.25},
- {"matrix": [3, 3], "x": 3.75, "y": 3, "w": 1.75},
- {"matrix": [3, 5], "x": 5.5, "y": 3, "w": 1.75},
- {"matrix": [3, 6], "x": 7.25, "y": 3, "w": 1.25},
- {"matrix": [3, 7], "x": 8.5, "y": 3}
+ {"matrix": [3, 3], "x": 3.75, "y": 3, "w": 1.5},
+ {"matrix": [3, 4], "x": 5.25, "y": 3},
+ {"matrix": [3, 5], "x": 6.25, "y": 3, "w": 1.5},
+ {"matrix": [3, 6], "x": 7.75, "y": 3, "w": 1.25},
+ {"matrix": [3, 7], "x": 9, "y": 3}
]
},
- "LAYOUT_split_3space": {
+ "LAYOUT_full_space": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1, "y": 0},
@@ -77,8 +70,7 @@
{"matrix": [0, 7], "x": 7, "y": 0},
{"matrix": [0, 8], "x": 8, "y": 0},
{"matrix": [0, 9], "x": 9, "y": 0},
- {"matrix": [0, 10], "x": 10, "y": 0},
-
+ {"matrix": [0, 10], "x": 10, "y": 0, "encoder": 0},
{"matrix": [1, 0], "x": 0, "y": 1, "w": 1.25},
{"matrix": [1, 1], "x": 1.25, "y": 1},
{"matrix": [1, 2], "x": 2.25, "y": 1},
@@ -89,7 +81,6 @@
{"matrix": [1, 7], "x": 7.25, "y": 1},
{"matrix": [1, 8], "x": 8.25, "y": 1},
{"matrix": [1, 9], "x": 9.25, "y": 1, "w": 1.75},
-
{"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
{"matrix": [2, 1], "x": 1.75, "y": 2},
{"matrix": [2, 2], "x": 2.75, "y": 2},
@@ -100,11 +91,8 @@
{"matrix": [2, 7], "x": 7.75, "y": 2},
{"matrix": [2, 8], "x": 8.75, "y": 2},
{"matrix": [2, 9], "x": 9.75, "y": 2, "w": 1.25},
-
{"matrix": [3, 1], "x": 1.5, "y": 3},
- {"matrix": [3, 3], "x": 2.5, "y": 3, "w": 2.25},
- {"matrix": [3, 4], "x": 4.75, "y": 3},
- {"matrix": [3, 5], "x": 5.75, "y": 3, "w": 2.75},
+ {"matrix": [3, 4], "x": 2.5, "y": 3, "w": 6},
{"matrix": [3, 7], "x": 8.5, "y": 3}
]
},
@@ -120,8 +108,7 @@
{"matrix": [0, 7], "x": 7, "y": 0},
{"matrix": [0, 8], "x": 8, "y": 0},
{"matrix": [0, 9], "x": 9, "y": 0},
- {"matrix": [0, 10], "x": 10, "y": 0},
-
+ {"matrix": [0, 10], "x": 10, "y": 0, "encoder": 0},
{"matrix": [1, 0], "x": 0, "y": 1, "w": 1.25},
{"matrix": [1, 1], "x": 1.25, "y": 1},
{"matrix": [1, 2], "x": 2.25, "y": 1},
@@ -132,7 +119,6 @@
{"matrix": [1, 7], "x": 7.25, "y": 1},
{"matrix": [1, 8], "x": 8.25, "y": 1},
{"matrix": [1, 9], "x": 9.25, "y": 1, "w": 1.75},
-
{"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
{"matrix": [2, 1], "x": 1.75, "y": 2},
{"matrix": [2, 2], "x": 2.75, "y": 2},
@@ -143,14 +129,13 @@
{"matrix": [2, 7], "x": 7.75, "y": 2},
{"matrix": [2, 8], "x": 8.75, "y": 2},
{"matrix": [2, 9], "x": 9.75, "y": 2, "w": 1.25},
-
{"matrix": [3, 1], "x": 1.5, "y": 3},
{"matrix": [3, 3], "x": 2.5, "y": 3, "w": 3},
{"matrix": [3, 5], "x": 5.5, "y": 3, "w": 3},
{"matrix": [3, 7], "x": 8.5, "y": 3}
]
},
- "LAYOUT_full_space": {
+ "LAYOUT_split_3space": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1, "y": 0},
@@ -162,8 +147,7 @@
{"matrix": [0, 7], "x": 7, "y": 0},
{"matrix": [0, 8], "x": 8, "y": 0},
{"matrix": [0, 9], "x": 9, "y": 0},
- {"matrix": [0, 10], "x": 10, "y": 0},
-
+ {"matrix": [0, 10], "x": 10, "y": 0, "encoder": 0},
{"matrix": [1, 0], "x": 0, "y": 1, "w": 1.25},
{"matrix": [1, 1], "x": 1.25, "y": 1},
{"matrix": [1, 2], "x": 2.25, "y": 1},
@@ -174,7 +158,6 @@
{"matrix": [1, 7], "x": 7.25, "y": 1},
{"matrix": [1, 8], "x": 8.25, "y": 1},
{"matrix": [1, 9], "x": 9.25, "y": 1, "w": 1.75},
-
{"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
{"matrix": [2, 1], "x": 1.75, "y": 2},
{"matrix": [2, 2], "x": 2.75, "y": 2},
@@ -185,9 +168,51 @@
{"matrix": [2, 7], "x": 7.75, "y": 2},
{"matrix": [2, 8], "x": 8.75, "y": 2},
{"matrix": [2, 9], "x": 9.75, "y": 2, "w": 1.25},
-
{"matrix": [3, 1], "x": 1.5, "y": 3},
- {"matrix": [3, 4], "x": 2.5, "y": 3, "w": 6},
+ {"matrix": [3, 3], "x": 2.5, "y": 3, "w": 2.25},
+ {"matrix": [3, 4], "x": 4.75, "y": 3},
+ {"matrix": [3, 5], "x": 5.75, "y": 3, "w": 2.75},
+ {"matrix": [3, 7], "x": 8.5, "y": 3}
+ ]
+ },
+ "LAYOUT_split_4space": {
+ "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": [0, 4], "x": 4, "y": 0},
+ {"matrix": [0, 5], "x": 5, "y": 0},
+ {"matrix": [0, 6], "x": 6, "y": 0},
+ {"matrix": [0, 7], "x": 7, "y": 0},
+ {"matrix": [0, 8], "x": 8, "y": 0},
+ {"matrix": [0, 9], "x": 9, "y": 0},
+ {"matrix": [0, 10], "x": 10, "y": 0, "encoder": 0},
+ {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.25},
+ {"matrix": [1, 1], "x": 1.25, "y": 1},
+ {"matrix": [1, 2], "x": 2.25, "y": 1},
+ {"matrix": [1, 3], "x": 3.25, "y": 1},
+ {"matrix": [1, 4], "x": 4.25, "y": 1},
+ {"matrix": [1, 5], "x": 5.25, "y": 1},
+ {"matrix": [1, 6], "x": 6.25, "y": 1},
+ {"matrix": [1, 7], "x": 7.25, "y": 1},
+ {"matrix": [1, 8], "x": 8.25, "y": 1},
+ {"matrix": [1, 9], "x": 9.25, "y": 1, "w": 1.75},
+ {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
+ {"matrix": [2, 1], "x": 1.75, "y": 2},
+ {"matrix": [2, 2], "x": 2.75, "y": 2},
+ {"matrix": [2, 3], "x": 3.75, "y": 2},
+ {"matrix": [2, 4], "x": 4.75, "y": 2},
+ {"matrix": [2, 5], "x": 5.75, "y": 2},
+ {"matrix": [2, 6], "x": 6.75, "y": 2},
+ {"matrix": [2, 7], "x": 7.75, "y": 2},
+ {"matrix": [2, 8], "x": 8.75, "y": 2},
+ {"matrix": [2, 9], "x": 9.75, "y": 2, "w": 1.25},
+ {"matrix": [3, 1], "x": 1.5, "y": 3},
+ {"matrix": [3, 2], "x": 2.5, "y": 3, "w": 1.25},
+ {"matrix": [3, 3], "x": 3.75, "y": 3, "w": 1.75},
+ {"matrix": [3, 5], "x": 5.5, "y": 3, "w": 1.75},
+ {"matrix": [3, 6], "x": 7.25, "y": 3, "w": 1.25},
{"matrix": [3, 7], "x": 8.5, "y": 3}
]
}
diff --git a/keyboards/projectcain/vault35/keymaps/default/keymap.c b/keyboards/projectcain/vault35/keymaps/default/keymap.c
index 5bb3a622b2..ec9f350218 100644
--- a/keyboards/projectcain/vault35/keymaps/default/keymap.c
+++ b/keyboards/projectcain/vault35/keymaps/default/keymap.c
@@ -1,19 +1,18 @@
-
- /* Copyright 2021 projectcain
- *
- * 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 2021 projectcain
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
#include QMK_KEYBOARD_H
enum layers{
@@ -64,3 +63,11 @@ combo_t key_combos[] = {
[KL_SLSH] = COMBO(kl_combo, S(KC_SLSH)),
[JK_MINUS] = COMBO(jk_combo, KC_MINUS)
};
+
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
+ [BASE] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
+ [NUM] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
+ [SYM] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }
+};
+#endif
diff --git a/keyboards/projectcain/vault35/keymaps/default/rules.mk b/keyboards/projectcain/vault35/keymaps/default/rules.mk
index ff681299e4..cbd8b4aa81 100644
--- a/keyboards/projectcain/vault35/keymaps/default/rules.mk
+++ b/keyboards/projectcain/vault35/keymaps/default/rules.mk
@@ -1 +1,2 @@
-COMBO_ENABLE = yes
\ No newline at end of file
+COMBO_ENABLE = yes
+ENCODER_MAP_ENABLE = yes
diff --git a/keyboards/projectcain/vault35/rules.mk b/keyboards/projectcain/vault35/rules.mk
index b03b6fa905..3cf3a331d8 100644
--- a/keyboards/projectcain/vault35/rules.mk
+++ b/keyboards/projectcain/vault35/rules.mk
@@ -1,13 +1 @@
-# 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 = no # Enable keyboard RGB underglow
-AUDIO_ENABLE = no # Audio output
-ENCODER_ENABLE = yes
+DEFAULT_FOLDER = projectcain/vault35/atmega32u4