1
0
Fork 0
This commit is contained in:
Cat /dev/Nulo 2022-05-02 13:48:32 -03:00
commit 1a3ee8ab8b
743 changed files with 28370 additions and 1931 deletions

3
.gitignore vendored
View file

@ -91,3 +91,6 @@ user_song_list.h
compile_commands.json
.clangd/
.cache/
# VIA(L) json files that don't belong in QMK repo
via*.json

View file

@ -11,13 +11,13 @@ QMK provides methods to read 5 of the LEDs defined in the HID spec:
* Kana
There are three ways to get the lock LED state:
* by specifying configuration options within `config.h`
* by implementing `bool led_update_kb(led_t led_state)` or `_user(led_t led_state)`; or
* by calling `led_t host_keyboard_led_state()`
* Configuration options in `config.h`
* Implement `led_update_*` function
* Call `led_t host_keyboard_led_state()`
!> `host_keyboard_led_state()` may already reflect a new value before `led_update_user()` is called.
!> The `host_keyboard_led_state()` may reflect an updated state before `led_update_user()` is called.
Two more deprecated functions exist that provide the LED state as a `uint8_t`:
Two deprecated functions that provide the LED state as `uint8_t`:
* `uint8_t led_set_kb(uint8_t usb_led)` and `_user(uint8_t usb_led)`
* `uint8_t host_keyboard_leds()`
@ -37,23 +37,20 @@ To configure the indicators, `#define` these in your `config.h`:
Unless you are designing your own keyboard, you generally should not need to change the above config options.
## `led_update_*()`
## LED update function
When the configuration options do not provide enough flexibility, the API hooks provided allow custom control of the LED behavior. These functions will be called when the state of one of those 5 LEDs changes. It receives the LED state as a struct parameter.
When the configuration options do not provide enough flexibility, the following callbacks allow custom control of the LED behavior. These functions will be called when one of those 5 LEDs changes state:
By convention, return `true` from `led_update_user()` to get the `led_update_kb()` hook to run its code, and
return `false` when you would prefer not to run the code in `led_update_kb()`.
* Keyboard/revision: `bool led_update_kb(led_t led_state)`
* Keymap: `bool led_update_user(led_t led_state)`
Some examples include:
Both receives LED state as a struct parameter. Returning `true` in `led_update_user()` will allow the keyboard level code in `led_update_kb()` to run as well. Returning `false` will override the keyboard level code, depending on how the keyboard level function is set up.
- overriding the LEDs to use them for something else like layer indication
- return `false` because you do not want the `_kb()` function to run, as it would override your layer behavior.
- play a sound when an LED turns on or off.
- return `true` because you want the `_kb` function to run, and this is in addition to the default LED behavior.
?> This boolean return type of `led_update_user` allows for overriding keyboard LED controls, and is thus recommended over the void `led_set_user` function.
?> Because the `led_set_*` functions return `void` instead of `bool`, they do not allow for overriding the keyboard LED control, and thus it's recommended to use `led_update_*` instead.
### Example of keyboard LED update implementation
### Example `led_update_kb()` Implementation
This is a template indicator function that can be implemented on keyboard level code:
```c
bool led_update_kb(led_t led_state) {
@ -74,9 +71,9 @@ bool led_update_kb(led_t led_state) {
}
```
### Example `led_update_user()` Implementation
### Example of user LED update implementation
This incomplete example would play a sound if Caps Lock is turned on or off. It returns `true`, because you also want the LEDs to maintain their state.
This is an incomplete example will play a sound if Caps Lock is turned on or off. It returns `true` to allow keyboard LED function to maintain their state.
```c
#ifdef AUDIO_ENABLE
@ -96,18 +93,17 @@ bool led_update_user(led_t led_state) {
}
```
### `led_update_*` Function Documentation
## Host keyboard LED state
* Keyboard/Revision: `bool led_update_kb(led_t led_state)`
* Keymap: `bool led_update_user(led_t led_state)`
The `host_keyboard_led_state()` function will report the LED state returned from the host computer as `led_t`. This is useful for reading the LED state outside `led_update_*`. For example, you can get the boolean state of Caps Lock from the host with:
## `host_keyboard_led_state()`
Call this function to get the last received LED state as a `led_t`. This is useful for reading the LED state outside `led_update_*`, e.g. in [`matrix_scan_user()`](#matrix-scanning-code).
```c
bool caps = host_keyboard_led_state().caps_lock;
```
## Setting Physical LED State
Some keyboard implementations provide convenience methods for setting the state of the physical LEDs.
Some keyboard implementations provide convenient methods for setting the state of the physical LEDs.
### Ergodox Boards

View file

@ -166,7 +166,7 @@ Send multiple bytes to the selected I2C device.
### `i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)`
Receive multiple bytes from the selected SPI device.
Receive multiple bytes from the selected I2C device.
#### Arguments

View file

@ -74,6 +74,7 @@ These headers are located in [`quantum/keymap_extras/`](https://github.com/qmk/q
|Swedish Pro (macOS, ISO) |`keymap_swedish_pro_osx_iso.h` | |
|Turkish (F) |`keymap_turkish_f.h` |`sendstring_turkish_f.h` |
|Turkish (Q) |`keymap_turkish_q.h` |`sendstring_turkish_q.h` |
|Ukrainian |`keymap_ukrainian.h` | |
There are also a few which are not quite language-specific, but useful if you are not using a QWERTY layout:

View file

@ -0,0 +1,23 @@
# QMK所采用的Git最佳实践
<!---
original document: 0.15.17:docs/newbs_git_best_practices.md
git diff 0.15.17 HEAD -- docs/newbs_git_best_practices.md | cat
-->
*译者注对于git相关的部分除广为接受的名词外会尽量保留git命令及各种术语的英文版本部分名词及关键部分会附带中文翻译*
## 或者讲,"怎么才能不害怕并喜欢上Git"
本节旨在以最佳方式指导新手在为QMK做贡献时获得流畅的体验。我们将进行一次完整的QMK贡献操作流程并在部分环节中详细讲述几种便捷的方法之后我们会故意搞砸一些东西并教导你如何回到正轨。
该章节做了如下假设:
1. 你已有Github账号且已[fork了qmk_firmware仓库](zh-cn/getting_started_github.md)到你的账号下。
2. 已完成了[构建环境](zh-cn/newbs_getting_started.md#set-up-your-environment)及[QMK](zh-cn/newbs_getting_started.md#set-up-qmk)配置。
---
- 第一节:[在你Fork的主干上频繁更新不要提交](zh-cn/newbs_git_using_your_master_branch.md)
- 第二节:[解决合并冲突](zh-cn/newbs_git_resolving_merge_conflicts.md)
- 第三节:[重新同步一个脱离同步状态的Git分支](zh-cn/newbs_git_resynchronize_a_branch.md)

View file

@ -0,0 +1,86 @@
# 解决合并冲突
<!---
original document: 0.15.17:docs/newbs_git_resolving_merge_conflicts.md
git diff 0.15.17 HEAD -- docs/newbs_git_resolving_merge_conflicts.md | cat
-->
有时在你致力于一个较长周期才能完成的分支时其它人提交的变更会与你提交的pull request中的变更发生冲突。我们将这种多个人编辑同一个模块同一个文件时产生的场景叫做 *合并冲突*
?> 本文中的场景基于[在你Fork的主干上频繁更新不要提交](zh-cn/newbs_git_using_your_master_branch.md)一文。如果你对那篇文章不熟悉,请先阅读它,再回来继续。
## 变基/衍合rebase
Git的*变基*操作会将提交历史中的提交节点摘除并回滚,然后统一提交到一个新节点上。在解决合并冲突时,可以通过对当前分支进行变基,来获取从分支拉取到当前时刻的所有变更。
从执行如下命令开始:
```
git fetch upstream
git rev-list --left-right --count HEAD...upstram/master
```
此处输入的 `git rev-list` 命令可以得到当前分支与QMK主干分支间的提交数量差。而先执行 `git fetch` 是为了确保我们有上游仓库upstream repo的最新状态。`git rev-list` 命令会返回两个数字:
```
$ git rev-list --left-right --count HEAD...upstream/master
7 35
```
第一个数字为当前分支自创建后新增的提交数量。第二个数字为当前分支创建后在 `upstream/master` 上的提交数量,而这部分就是我们当前分支上缺失的提交记录。
在我们了解了当前分支以及上游仓库的状态后,可以发起变基操作了:
```
git rebase upstream/master
```
这样可以让Git回滚该分支的提交然后基于QMK的主干版本重新应用这些提交。
*译注以下内容在中文Git下大同小异且仅作为示例不进行翻译*
```
$ git rebase upstream/master
First, rewinding head to replay your work on top of it...
Applying: Commit #1
Using index info to reconstruct a base tree...
M conflicting_file_1.txt
Falling back to patching base and 3-way merge...
Auto-merging conflicting_file_1.txt
CONFLICT (content): Merge conflict in conflicting_file_1.txt
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 Commit #1
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
```
以上内容是在告诉我们有合并冲突存在,并给出了冲突所在的文件名。在编辑器中打开该文件,可以在某处发现类似如下形式的内容:
```
<<<<<<< HEAD
<p>For help with any issues, email us at support@webhost.us.</p>
=======
<p>Need help? Email support@webhost.us.</p>
>>>>>>> Commit #1
```
`<<<<<<< HEAD` 标记了合并冲突的起始行,直至 `>>>>>>> Commit #1` 标记的结束行,中间通过 `=======` 分隔开冲突双方。其中 `HEAD` 部分为QMK主干上的版本标记了提交日志的部分为当前分支的本地提交。
由于Git存储的是*文件差异部分*而非整个文件所以当Git无法在文件中找到一个变更发生前的内容时就无法知道如何去进行文件变更重新编辑一下可以解决问题。在更改完成后保存文件。
```
<p>Need help? Email support@webhost.us.</p>
```
之后,执行:
```
git add conflicting_file_1.txt
git rebase --continue
```
Git即会记录对文件冲突做出的变更并继续处理剩余的提交直至全部完成。

View file

@ -0,0 +1,76 @@
# 重新同步已失去同步状态的Git分支
<!---
original document: 0.15.17:docs/newbs_git_resynchronize_a_branch.md
git diff 0.15.17 HEAD -- docs/newbs_git_resynchronize_a_branch.md | cat
-->
假设你在自己的 `master` 分支之上有提交并且想和QMK仓库进行同步可以通过 `git pull` 拉取QMK的 `master` 分支到你的库但同时Github也会提醒你当前分支相比 `qmk:master` 有几个领先的提交会在你向QMK发起pr时造成麻烦。
?> 本文中的场景基于[在你Fork的主干上频繁更新不要提交](zh-cn/newbs_git_using_your_master_branch.md)一文。如果你对那篇文章不熟悉,请先阅读它,再回来继续。
## 备份你在自己的主干分支上的所有变更(可选)
不会有人想把有用的成果弄丢的。如果你想将你的 `master` 分支上的变更另存一份,简便的方法是直接创建一个当前“脏” `master` 分支的副本:
```
git branch old_master master
```
现在 `master` 分支拥有了一个副本分支 `old_master`
## 重新同步分支
现在可以重新同步 `master` 分支了这里我们将QMK仓库设置为Git的远程仓库。通过执行 `git remote -v` 可以确认远程仓库配置,输出信息应类似于:
```
QMKuser ~/qmk_firmware (master)
$ git remote -v
origin https://github.com/<your_username>/qmk_firmware.git (fetch)
origin https://github.com/<your_username>/qmk_firmware.git (push)
upstream https://github.com/qmk/qmk_firmware.git (fetch)
upstream https://github.com/qmk/qmk_firmware.git (push)
```
如果你只能看到一个仓库:
```
QMKuser ~/qmk_firmware (master)
$ git remote -v
origin https://github.com/qmk/qmk_firmware.git (fetch)
origin https://github.com/qmk/qmk_firmware.git (push)
```
通过如下命令添加新的远程仓库:
```
git remote add upstream https://github.com/qmk/qmk_firmware.git
```
然后,重新将 `origin` 远程仓库设置为自己的fork
```
git remote set-url origin https://github.com/<your_username>/qmk_firmware.git
```
在两个远程仓库配置完毕后需要从QMK的 upstream 仓库中获取到更新,执行:
```
git fetch upstream
```
此时重新同步你的分支到QMK的版本
```
git reset --hard upstream/master
```
以上操作会更新你的本地仓库而你的Github远程仓库仍然处于未同步状态通过推送可以让其进入已同步状态。可以通过如下命令来指引Git强行覆盖掉那些仅在你远程仓库中存在的提交
```
git push --force-with-lease
```
!> **不要**在其它使用者也会提交的分支上执行 `git push --force-with-lease`,否则会覆盖掉他人的提交。
此时你的Github fork本地文件副本以及QMK仓库就是一致的了。之后再进行变更[在分支上!](zh-cn/newbs_git_using_your_master_branch.md#making-changes))和提交。

View file

@ -0,0 +1,79 @@
# 在你Fork的主干上频繁更新不要提交
<!---
original document: 0.15.17:docs/newbs_git_using_your_master_branch.md
git diff 0.15.17 HEAD -- docs/newbs_git_using_your_master_branch.md | cat
-->
我们强烈推荐所有QMK开发者无论在哪里做什么改动频繁更新你的 `master` 分支,但***不要***在其上提交。相对地将你所有的改动提交到开发分支上并提交一个pull request。
为了减少冲突 &mdash; 多人同时编辑同一个文件 &mdash; 保持你的 `master` 分支更新到最新,并在新创建的分支上进行开发。
## 更新master分支
为了保持 `master` 更新到最新推荐将QMK固件仓库"repo"设置为git远程仓库。打开Git命令行界面并键入
```
git remote add upstream https://github.com/qmk/qmk_firmware.git
```
?> 名称 `upstream` 部分可以任意这里给的是常用的你可以将QMK远程仓库名称改成你想要的。Git的 `remote` 命令语法为 `git remote add <name> <url>`, `<name>` 是远程仓库的简写名称这个名称可以在很多Git命令中使用包括但不限于 `fetch``pull` 及 `push`,以指定目标远程仓库。
要验证是否添加成功,可以执行 `git remote -v`,输出应该类似于:
```
$ git remote -v
origin https://github.com/<your_username>/qmk_firmware.git (fetch)
origin https://github.com/<your_username>/qmk_firmware.git (push)
upstream https://github.com/qmk/qmk_firmware.git (fetch)
upstream https://github.com/qmk/qmk_firmware.git (push)
```
在以上操作完成后,可以通过执行 `git fetch upstream` 来检查仓库是否有更新。该命令从QMK仓库拉取的分支branches及标签tags &mdash; 统称为“refs引用&mdash;现在也被称作 `upstream`上游。此时我们可以比对自己fork版本的 `origin` 与QMK维护的分支的差异了。
要更新你的fork的master分支执行以下指令每一行结束都需要按回车
```
git checkout master
git fetch upstream
git pull upstream master
git push origin master
```
以上操作会切换到 `master` 分支从QMK仓库拉取refs下载QMK `master` 分支的当前版本并上传至你的fork中。
## 进行编辑 :id=making-changes
要进行编辑,通过如下命令创建一个新分支:
```
git checkout -b dev_branch
git push --set-upstream origin dev_branch
```
以上操作会创建 `dev_branch` 新分支检出check out并保存到你的fork中。`--set-upstream` 参数用于告知git使用你的fork仓库来处理 `dev_branch` 分支下的 `git push``git pull` 命令且仅需要在第一次执行push命令时指定之后再次执行 `git push` 或是 `git pull` 都无需加入该参数了。
?> 在 `git push` 时,可以使用 `-u` 替代 `--set-upstram` &mdash; `-u``--set-upsream` 参数的别名。
你可以任意命名该分支,但仍建议对分支起一个可以描述将在该分支下要做的工作的名称。
默认情况下 `git checkout -b` 会基于你当前检出的分支作为新分支的基准。可以在后面追加已存在但未检出的分支名来指定新分支的基准:
```
git checkout -b dev_branch master
```
此时你便有了一个开发用分支可以打开编辑器并进行你期望的变更了。通常推荐提交大量的小规模提交commit这样在需要时会更容易地定位并回滚造成问题的提交。若要提交更改编辑并保存要更新的文件并将其添加到*暂存区staged area*,然后提交到分支中:
```
git add path/to/updated_file
git commit -m "My commit message."
```
`git add` 会将更改后的文件放到Git的*暂存区*也称作Git的“装载区”。这里留存着即将通过 `git commit` 所提交并保存到仓库中的变更。请使用确切的描述来填写提交日志,以便于快速了解改动内容。
?> 如果更改了多个文件,可以通过 `git add -- path/to/file1 path/to/file2 ...` 来添加所有项目。
## 发布变更
最后一步为上传你的变更到你的fork中。通过执行 `git push`Git将发布 `dev_branch` 分支的所有变更至你的fork中。

View file

@ -57,7 +57,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Mode setting comands */
#define FLASH_CMD_DP 0xB9 /* DP (Deep Power Down) */
#define FLASH_CMD_RDP 0xAB /* RDP (Release form Deep Power Down) */
#define FLASH_CMD_RDP 0xAB /* RDP (Release from Deep Power Down) */
/* Status register */
#define FLASH_FLAG_WIP 0x01 /* Write in progress bit */

View file

@ -74,21 +74,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
The sector size of the FLASH in bytes, as specified in the datasheet.
*/
#ifndef EXTERNAL_FLASH_SECTOR_SIZE
# define EXTERNAL_FLASH_SECTOR_SIZE (4 * 1024)
# define EXTERNAL_FLASH_SECTOR_SIZE (4 * 1024L)
#endif
/*
The block size of the FLASH in bytes, as specified in the datasheet.
*/
#ifndef EXTERNAL_FLASH_BLOCK_SIZE
# define EXTERNAL_FLASH_BLOCK_SIZE (64 * 1024)
# define EXTERNAL_FLASH_BLOCK_SIZE (64 * 1024L)
#endif
/*
The total size of the FLASH in bytes, as specified in the datasheet.
*/
#ifndef EXTERNAL_FLASH_SIZE
# define EXTERNAL_FLASH_SIZE (512 * 1024)
# define EXTERNAL_FLASH_SIZE (512 * 1024L)
#endif
/*

16
keyboards/1k/1k.c Normal file
View file

@ -0,0 +1,16 @@
/* Copyright 2020 zvecr<git@zvecr.com>
*
* 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 "1k.h"

33
keyboards/1k/1k.h Normal file
View file

@ -0,0 +1,33 @@
/* Copyright 2020 zvecr<git@zvecr.com>
*
* 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
#include "quantum.h"
/* This 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_ortho_1x1( \
K01 \
) \
{ \
{ K01 }, \
}

60
keyboards/1k/config.h Normal file
View file

@ -0,0 +1,60 @@
/* Copyright 2020 zvecr<git@zvecr.com>
*
* 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
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x0009
#define PRODUCT_ID 0x0001
#define DEVICE_VER 0x0001
#define MANUFACTURER MakotoKurauchi
#define PRODUCT 1K
/* matrix size */
#define MATRIX_ROWS 1
#define MATRIX_COLS 1
/*
* Keyboard Matrix Assignments
*
* On this board we have direct connection: no diodes.
*/
#define DIRECT_PINS {{ B0 }}
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
#define RGBLED_NUM 1
#define RGB_DI_PIN B2
// Save as much space as we can...
#define LAYER_STATE_8BIT
#define NO_ACTION_LAYER
#define NO_ACTION_TAPPING
#define NO_ACTION_ONESHOT
#define NO_RESET
// usbconfig.h overrides
#define USB_CFG_IOPORTNAME B
#define USB_CFG_DMINUS_BIT 3
#define USB_CFG_DPLUS_BIT 4
#define USB_COUNT_SOF 0
#define USB_INTR_CFG PCMSK
#define USB_INTR_CFG_SET (1<<USB_CFG_DPLUS_BIT)
#define USB_INTR_ENABLE_BIT PCIE
#define USB_INTR_PENDING_BIT PCIF
#define USB_INTR_VECTOR SIG_PIN_CHANGE

12
keyboards/1k/info.json Normal file
View file

@ -0,0 +1,12 @@
{
"keyboard_name": "1k",
"url": "",
"maintainer": "MakotoKurauchi",
"layouts": {
"LAYOUT_ortho_1x1": {
"layout": [
{"x":0, "y":0}
]
}
}
}

View file

@ -0,0 +1,25 @@
// Copyright 2022 Makoto Kurauchi (@MakotoKurauchi)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "rgblite.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_1x1(
RGB_HUI
)
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
case RGB_HUI:
rgblite_increase_hue();
break;
}
}
return true;
}
void keyboard_post_init_user(void) {
rgblite_increase_hue();
}

View file

@ -0,0 +1,23 @@
// Copyright 2022 Makoto Kurauchi (@MakotoKurauchi)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "ws2812.h"
#include "color.h"
static inline void rgblite_setrgb(RGB rgb) {
LED_TYPE leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
ws2812_setleds(leds, RGBLED_NUM);
}
static void rgblite_increase_hue(void) {
static uint8_t state = 0;
HSV hsv = { 255, 255, 255 };
hsv.h = state;
state = (state + 8) % 256;
rgblite_setrgb(hsv_to_rgb(hsv));
}

View file

@ -0,0 +1,2 @@
SRC += ws2812.c
SRC += color.c

View file

@ -0,0 +1,22 @@
// Copyright 2022 Makoto Kurauchi (@MakotoKurauchi)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "rgblite.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_1x1(
KC_MUTE
)
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
rgblite_increase_hue();
}
return true;
}
void keyboard_post_init_user(void) {
rgblite_increase_hue();
}

View file

@ -0,0 +1,23 @@
// Copyright 2022 Makoto Kurauchi (@MakotoKurauchi)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "ws2812.h"
#include "color.h"
static inline void rgblite_setrgb(RGB rgb) {
LED_TYPE leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
ws2812_setleds(leds, RGBLED_NUM);
}
static void rgblite_increase_hue(void) {
static uint8_t state = 0;
HSV hsv = { 255, 255, 255 };
hsv.h = state;
state = (state + 8) % 256;
rgblite_setrgb(hsv_to_rgb(hsv));
}

View file

@ -0,0 +1,3 @@
SRC += ws2812.c
SRC += color.c
EXTRAKEY_ENABLE = yes

View file

@ -0,0 +1,6 @@
// Copyright 2022 Makoto Kurauchi (@MakotoKurauchi)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define TAPPING_TERM 500

View file

@ -0,0 +1,22 @@
// Copyright 2022 Makoto Kurauchi (@MakotoKurauchi)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
enum layers {
_BASE = 0,
};
enum {
TD_AB = 0
};
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_AB] = ACTION_TAP_DANCE_DOUBLE(KC_A, KC_B)
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT_ortho_1x1(
TD(TD_AB)
)
};

View file

@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes

47
keyboards/1k/readme.md Normal file
View file

@ -0,0 +1,47 @@
# 1k
![1k](https://booth.pximg.net/aaeb2dda-e169-44c0-ba5a-5b42cc5c2627/i/3504781/c1708a8a-061b-4a6c-907d-72d0eab47d4a.png)
1% Custom mechanical keyboard. ATtiny85 powered, with 1*WS2812 LED, and the micronucleus bootloader.
**Note**: Due to limited firmware space, a _**lot**_ of features have to be disabled to get a functioning QMK based keyboard.
* Keyboard Maintainer: [MakotoKurauchi](https://github.com/MakotoKurauchi)
* Hardware Supported: 1k
* Hardware Availability: [booth](https://ninep.booth.pm/items/3504781)
Make example for this keyboard (after setting up your build environment):
make 1k:default
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).
## Flashing
### Prerequisites
```bash
git clone https://github.com/micronucleus/micronucleus.git
cd micronucleus/commandline/
sudo make install
```
On Linux, youll need proper privileges to access the MCU. You can either use sudo when flashing firmware, or place [these files](https://github.com/micronucleus/micronucleus/blob/master/commandline/49-micronucleus.rules) in /etc/udev/rules.d/. Once added run the following:
```bash
sudo udevadm control --reload-rules
sudo udevadm trigger
```
### Instructions
```bash
make 1k:default:flash
# or directly with...
micronucleus --run <firmware.hex>
```
### Recovery
* [Original Firmware](https://github.com/xiudi/Attiny85_vusb_pad_test)
* [Bootloader Repair](https://digistump.com/wiki/digispark/tutorials/proisp)

26
keyboards/1k/rules.mk Normal file
View file

@ -0,0 +1,26 @@
# MCU name
MCU = attiny85
# Bootloader selection
BOOTLOADER = custom
BOOTLOADER_SIZE = 1862
PROGRAM_CMD = micronucleus --run $(BUILD_DIR)/$(TARGET).hex
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = no # 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
# Save as much space as we can...
LTO_ENABLE = yes
GRAVE_ESC_ENABLE = no
MAGIC_ENABLE = no
SPACE_CADET_ENABLE = no

View file

@ -22,6 +22,8 @@
#define MATRIX_ROWS 4
#define MATRIX_COLS 4
#define MOUSEKEY_MOVE_DELTA 25
/*
* Keyboard Matrix Assignments
*
@ -37,6 +39,9 @@
#define MATRIX_ROW_PINS { D1, D2, D3, D4 }
#define MATRIX_COL_PINS { D5, D6, C2, D0 }
#define ENCODERS_PAD_A { B1, B3 }
#define ENCODERS_PAD_B { B2, B4 }
#define UNUSED_PINS
/* COL2ROW, ROW2COL */
@ -58,28 +63,62 @@
//#define BACKLIGHT_BREATHING
#define RGB_DI_PIN B5
#define DRIVER_LED_TOTAL 20
#ifdef RGB_DI_PIN
# define RGBLED_NUM 20
# 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
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
# define RGBLIGHT_LIMIT_VAL 255
#endif
#ifdef RGB_MATRIX_ENABLE
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255
// RGB Matrix Animation modes. Explicitly enabled
// For full list of effects, see:
// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects
# define ENABLE_RGB_MATRIX_ALPHAS_MODS
# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
# define ENABLE_RGB_MATRIX_BREATHING
# define ENABLE_RGB_MATRIX_BAND_SAT
# define ENABLE_RGB_MATRIX_BAND_VAL
# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
# define ENABLE_RGB_MATRIX_CYCLE_ALL
# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
# define ENABLE_RGB_MATRIX_DUAL_BEACON
# define ENABLE_RGB_MATRIX_RAINBOW_BEACON
# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
# define ENABLE_RGB_MATRIX_RAINDROPS
# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
# define ENABLE_RGB_MATRIX_HUE_BREATHING
# define ENABLE_RGB_MATRIX_HUE_PENDULUM
# define ENABLE_RGB_MATRIX_HUE_WAVE
# define ENABLE_RGB_MATRIX_PIXEL_RAIN
# define ENABLE_RGB_MATRIX_PIXEL_FLOW
# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
//# define ENABLE_RGB_MATRIX_TYPING_HEATMAP
//# define ENABLE_RGB_MATRIX_DIGITAL_RAIN
// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE
//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
# define ENABLE_RGB_MATRIX_SPLASH
//# define ENABLE_RGB_MATRIX_MULTISPLASH
//# define ENABLE_RGB_MATRIX_SOLID_SPLASH
//# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
#endif
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */

View file

@ -27,8 +27,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[1] = LAYOUT_ortho_4x4( /* Fn Layer */
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI,
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
RGB_SPD, RGB_SPI, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, RESET
),
};
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code_delay(KC_VOLU, 10);
} else {
tap_code_delay(KC_VOLD, 10);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
rgb_matrix_increase_hue();
} else {
rgb_matrix_decrease_hue();
}
}
return false;
}

View file

@ -0,0 +1,50 @@
/* Copyright 2022 MechMerlin
*
* 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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x4( /* Base */
KC_TRNS, KC_DELETE, KC_BACKSPACE, KC_MUTE,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PSLS,
MO(1), KC_P0, KC_PDOT, KC_BTN3
),
[1] = LAYOUT_ortho_4x4( /* Fn Layer */
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI,
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD,
RGB_SPD, RGB_SPI, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, RESET
),
};
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code_delay(KC_MS_RIGHT, 10);
} else {
tap_code_delay(KC_MS_LEFT, 10);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code_delay(KC_AUDIO_VOL_UP, 10);
} else {
tap_code_delay(KC_AUDIO_VOL_DOWN, 10);
}
}
return false;
}

View file

@ -0,0 +1 @@
# The default keymap for Super 16 V2

View file

@ -14,5 +14,8 @@ 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
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
ENCODER_ENABLE = yes

View file

@ -15,3 +15,27 @@
*/
#include "super16v2.h"
#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { {
// Key Matrix to LED Index
{ 3, 2, 1, 0 },
{ 7, 6, 5, 4 },
{ 11, 10, 9, 8 },
{ 15, 14, 13, 12 }
}, {
// LED Index to Physical Position
{ 28, 12 }, { 84, 12 }, { 140, 12 }, { 196, 12 },
{ 28, 28 }, { 84, 28 }, { 140, 28 }, { 196, 28 },
{ 28, 44 }, { 84, 44 }, { 140, 44 }, { 196, 44 },
{ 28, 60 }, { 84, 60 }, { 140, 60 }, { 196, 60 },
{ 168, 48 }, { 168, 16 }, { 58, 16 }, { 56, 48 }
}, {
// LED Index to Flag
4, 4, 4, 4,
4, 4, 4, 4,
4, 4, 4, 4,
4, 4, 4, 4,
2, 2, 2, 2,
} };
#endif

View file

@ -20,9 +20,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// main layer
[0] = LAYOUT_all(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, MO(1)),
// basic function layer
[1] = LAYOUT_all(

View file

@ -19,10 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// main layer
[0] = LAYOUT_all(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO,
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, MO(1)),
// basic function layer
[1] = LAYOUT_all(
@ -33,16 +33,16 @@ 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),
// extra layer for VIA
[2] = LAYOUT_all(
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, 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, 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),
// extra layer for VIA
[3] = LAYOUT_all(
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, 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, 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)
};
};

View file

@ -18,15 +18,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(CAPS_LOCK_ENABLE){
if(res) {
if(led_state.caps_lock){
rgblight_enable();
rgblight_mode(1);
rgblight_sethsv_noeeprom(CAPS_LOCK_COLOR);
}
else
rgblight_disable_noeeprom();
if (CAPS_LOCK_ENABLE && res) {
if(led_state.caps_lock) {
#ifdef CAPS_LOCK_COLOR
rgblight_sethsv_at(CAPS_LOCK_COLOR, 0);
#else
rgblight_sethsv_at(rgblight_get_hue(),rgblight_get_sat(),rgblight_get_val(), 0);
#endif
}
else{
rgblight_sethsv_at(HSV_OFF, 0);
}
}
return res;

View file

@ -16,9 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// defines to set RGB-led behaviour. Off by default
#define CAPS_LOCK_ENABLE false
#define CAPS_LOCK_COLOR HSV_ORANGE
#define CAPS_LOCK_ENABLE true
//#define CAPS_LOCK_COLOR HSV_ORANGE
#include "quantum.h"

View file

@ -19,12 +19,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (CAPS_LOCK_ENABLE && res) {
if (led_state.caps_lock){
rgblight_enable();
rgblight_mode(1);
rgblight_sethsv_noeeprom(CAPS_LOCK_COLOR);
} else {
rgblight_disable_noeeprom();
if(led_state.caps_lock) {
#ifdef CAPS_LOCK_COLOR
rgblight_sethsv_at(CAPS_LOCK_COLOR, 0);
#else
rgblight_sethsv_at(rgblight_get_hue(),rgblight_get_sat(),rgblight_get_val(), 0);
#endif
}
else{
rgblight_sethsv_at(HSV_OFF, 0);
}
}
return res;

View file

@ -16,9 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// defines to set RGB-led behaviour. Off by default
#define CAPS_LOCK_ENABLE false
#define CAPS_LOCK_COLOR HSV_ORANGE
#define CAPS_LOCK_ENABLE true
//#define CAPS_LOCK_COLOR HSV_ORANGE
#include "quantum.h"

View file

@ -0,0 +1,10 @@
{
"keyboard_name": "waffling80 Rev A",
"url": "",
"maintainer": "4pplet",
"layouts": {
"LAYOUT_all": {
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"F13", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"|", "x":13, "y":1.5}, {"label":"~", "x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"~", "x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"x":15.25, "y":3.5}, {"x":17.25, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"label":"Fn", "x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":2.25}, {"x":6, "y":5.5, "w":1.25}, {"x":7.25, "y":5.5, "w":2.75}, {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, {"label":"Menu", "x":11.25, "y":5.5, "w":1.25}, {"label":"Win", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}]
}
}
}

View file

@ -0,0 +1,38 @@
/*
Copyright 2022 Stefan Sundin "4pplet" <mail@4pplet.com>
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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// main layer
[0] = LAYOUT_all(
KC_ESC, KC_F1, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, KC_HOME, KC_PGUP,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , KC_END, KC_PGDN,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT,
MO(1), MO(1)), // extra keys for alps dual action switches
// basic function layer
[1] = LAYOUT_all(
QK_BOOT, 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, 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, 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), // extra keys for alps dual action switches
};

View file

@ -0,0 +1,56 @@
/*
Copyright 2022 Stefan Sundin "4pplet" <mail@4pplet.com>
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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// main layer
[0] = LAYOUT_all(
KC_ESC, KC_F1, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, KC_HOME, KC_PGUP,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , KC_END, KC_PGDN,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT,
MO(1), MO(1)), // extra keys for alps dual action switches
// basic function layer
[1] = LAYOUT_all(
RESET, 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, 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, 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), // extra keys for alps dual action switches
[2] = LAYOUT_all(
RESET, 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, 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, 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), // extra keys for alps dual action switches
[3] = LAYOUT_all(
RESET, 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, 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, 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) // extra keys for alps dual action switches
};

View file

@ -0,0 +1 @@
VIA_ENABLE = yes

View file

@ -0,0 +1,18 @@
# waffling80
A TKL PCB attempting a87 compatibility with different switch and layout-options.
* Keyboard Maintainer: [4pplet](https://github.com/4pplet)
* Hardware Supported: [waffling80](https://github.com/4pplet/waffling80)
Make example for this keyboard (after setting up your build environment):
make 4pplet/waffling80/rev_a:default
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).
How to enter bootloader (DFU):
* Tap the physical reset button or short the reset-header (labled RESET) on tha back of the PCB for keyboard to enter DFU. When in DFU, it's ready to flash the firmware.
Alternative option if the firmware is already pre-flashed:
* Unplug your keyboard, hold down the Spacebar and B at the same time, plug in your keyboard and wait a second before releasing the keys. The keyboard will enter DFU and is ready to flash the firmware.

View file

@ -0,0 +1,53 @@
/*
Copyright 2022 Stefan Sundin "4pplet" <mail@4pplet.com>
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
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x4444
#define PRODUCT_ID 0x0006
#define DEVICE_VER 0x0001
#define MANUFACTURER 4pplet
#define PRODUCT waffling80 Rev A
/* key matrix size */
#define MATRIX_ROWS 12
#define MATRIX_COLS 8
// ROWS: Top to bottom, COLS: Left to right
#define MATRIX_ROW_PINS {C4,C5,B4,B3,B1,B0,D6,D5,D3,D4,D1,D2}
#define MATRIX_COL_PINS {C6,C7,B7,B6,B5,B2,D0,C2}
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
#define QMK_ESC_OUTPUT C6 // usually COL
#define QMK_ESC_INPUT C4 // usually ROW
#define RGB_DI_PIN D7
#define RGBLED_NUM 2
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8

View file

@ -0,0 +1,18 @@
# waffling80
A TKL PCB attempting a87 and a88 compatibility with different switch and layout-options.
* Keyboard Maintainer: [4pplet](https://github.com/4pplet)
* Hardware Supported: [waffling80](https://github.com/4pplet/waffling80)
Make example for this keyboard (after setting up your build environment):
make 4pplet/waffling80/rev_a:default
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).
How to enter bootloader (DFU):
* Tap the physical reset button or short the reset-header (labled RESET) on tha back of the PCB for keyboard to enter DFU. When in DFU, it's ready to flash the firmware.
Alternative option if the firmware is already pre-flashed:
* Unplug your keyboard, hold down the Spacebar and B at the same time, plug in your keyboard and wait a second before releasing the keys. The keyboard will enter DFU and is ready to flash the firmware.

View file

@ -0,0 +1,47 @@
/*
Copyright 2022 Stefan Sundin "4pplet" <mail@4pplet.com>
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 "rev_a.h"
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (SCROLL_LOCK_ENABLE && res) {
if(led_state.scroll_lock) {
#ifdef SCROLL_LOCK_COLOR
rgblight_sethsv_at(SCROLL_LOCK_COLOR, 0);
#else
rgblight_sethsv_at(rgblight_get_hue(),rgblight_get_sat(),rgblight_get_val(), 0);
#endif
}
else {
rgblight_sethsv_at(HSV_OFF, 0);
}
}
if (CAPS_LOCK_ENABLE && res) {
if(led_state.caps_lock) {
#ifdef CAPS_LOCK_COLOR
rgblight_sethsv_at(CAPS_LOCK_COLOR, 1);
#else
rgblight_sethsv_at(rgblight_get_hue(),rgblight_get_sat(),rgblight_get_val(), 1);
#endif
}
else{
rgblight_sethsv_at(HSV_OFF, 1);
}
}
return res;
}

View file

@ -0,0 +1,50 @@
/*
Copyright 2022 Stefan Sundin "4pplet" <mail@4pplet.com>
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
#define CAPS_LOCK_ENABLE 1
#define SCROLL_LOCK_ENABLE 1
// If colors are defined, they will be static. If not defined, color for incicators can be set in VIA.
//#define CAPS_LOCK_COLOR HSV_GREEN
//#define SCROLL_LOCK_COLOR HSV_GREEN
#include "quantum.h"
#define LAYOUT_all( \
k00, k10, k01, k11, k02, k12, k03, k13, k04, k14, k05, k15, k06, k16, k07, k17, k37, \
k20, k30, k21, k31, k22, k32, k23, k33, k24, k34, k25, k35, k26, k36, k67, k27, k57, k97, \
k40, k50, k41, k51, k42, k52, k43, k53, k44, k54, k45, k55, k46, k56, k47, k77, kb7, \
k60, k70, k61, k71, k62, k72, k63, k73, k64, k74, k65, k75, k66, k76, \
k80, k90, k81, k91, k82, k92, k83, k93, k84, k94, k85, k95, k86, k96, k87, \
ka0, ka1, kb1, kb2, ka3, kb3, ka4, kb4, ka5, kb5, ka6, kb6, ka7, \
kb0, ka2 \
) \
{ \
{k00, k01, k02, k03, k04, k05, k06, k07}, \
{k10, k11, k12, k13, k14, k15, k16, k17}, \
{k20, k21, k22, k23, k24, k25, k26, k27}, \
{k30, k31, k32, k33, k34, k35, k36, k37}, \
{k40, k41, k42, k43, k44, k45, k46, k47}, \
{k50, k51, k52, k53, k54, k55, k56, k57}, \
{k60, k61, k62, k63, k64, k65, k66, k67}, \
{k70, k71, k72, k73, k74, k75, k76, k77}, \
{k80, k81, k82, k83, k84, k85, k86, k87}, \
{k90, k91, k92, k93, k94, k95, k96, k97}, \
{ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7}, \
{kb0, kb1, kb2, kb3, kb4, kb5, kb6, kb7} \
}

View file

@ -0,0 +1,18 @@
# MCU name
MCU = atmega32u2
# Bootloader selection
BOOTLOADER = atmel-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 = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output

View file

@ -9,7 +9,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_split_3x5_2(
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT,
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
LT(3,KC_TAB), KC_LSFT, KC_SPC, LT(1,KC_ENT)
),

View file

@ -0,0 +1,16 @@
/* Copyright 2019 Álvaro "Gondolindrim" Volpato
*
* 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 "alpha.h"

View file

@ -0,0 +1,39 @@
/* Copyright 2019 Álvaro "Gondolindrim" Volpato
*
* 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
#include "quantum.h"
/* This 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_ortho_4x12( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \
) \
{ \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B } \
}

View file

@ -0,0 +1,32 @@
/* Copyright 2020 Gondolindrim
*
* 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 "beta.h"
void board_init(void) {
setPinInput(B6);
setPinInput(B7);
}
#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if(!encoder_update_user(index, clockwise)) return false;
if (index == 0) {
if (clockwise) tap_code_delay(KC_VOLU, 10);
else tap_code_delay(KC_VOLD, 10);
}
return true;
}
#endif

View file

@ -0,0 +1,31 @@
/* Copyright 2020 Gondolindrim
*
* 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
#include "quantum.h"
#define LAYOUT_ortho_4x12( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \
)\
{\
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B } \
}

View file

@ -0,0 +1,25 @@
/* Copyright 2020 QMK
*
* 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
#define CH_CFG_ST_FREQUENCY 10000
#define CH_CFG_OPTIMIZE_SPEED FALSE
#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE
#include_next <chconf.h>

View file

@ -0,0 +1,66 @@
/*
Copyright 2020 Gondolindrim
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
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xAC11
#define PRODUCT_ID 0x5369 // For Shark+1
#define DEVICE_VER 0x0002
#define MANUFACTURER AcheronProject
#define PRODUCT SharkPCB rev. Beta
#define MATRIX_ROWS 4
#define MATRIX_COLS 12
#define MATRIX_COL_PINS { A5 , A10, C13, B9 , B8 , B5 , B4 , B3 , A15, A0 , A1 , A2 }
#define MATRIX_ROW_PINS { A8 , B14, A4 , A3 }
#define DIODE_DIRECTION COL2ROW
#define DEBOUNCE 5
#define LOCKING_SUPPORT_ENABLE
#define LOCKING_RESYNC_ENABLE
#define BACKLIGHT_PIN A6
#define BACKLIGHT_PWM_DRIVER PWMD3
#define BACKLIGHT_PWM_CHANNEL 1
#define BACKLIGHT_PAL_MODE 2
#define BACKLIGHT_LEVELS 20
#define BACKLIGHT_BREATHING
#define BREATHING_PERIOD 5
#define BACKLIGHT_ON_STATE 1
#define STM32_HSECLK 8000000
#define RGB_DI_PIN B15
#define RGBLED_NUM 24
#define RGBLIGHT_ANIMATIONS
#define WS2812_PWM_COMPLEMENTARY_OUTPUT
#define WS2812_PWM_DRIVER PWMD1
#define WS2812_PWM_CHANNEL 3
#define WS2812_PWM_PAL_MODE 1
#define WS2812_DMA_STREAM STM32_DMA2_STREAM5
#define WS2812_DMA_CHANNEL 6
#define ENCODERS_PAD_A { C15 }
#define ENCODERS_PAD_B { C14 }
#define EEPROM_I2C_24LC256

View file

@ -0,0 +1,24 @@
/* Copyright 2020 QMK
*
* 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
#define HAL_USE_PWM TRUE
#define HAL_USE_PAL TRUE
#define HAL_USE_I2C TRUE
#include_next <halconf.h>

View file

@ -0,0 +1,43 @@
/* Copyright 2019
*
* 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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x12(
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC,
KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT,
KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_ENT ,
KC_LCTL , KC_LALT , KC_LGUI , KC_NO , MO(1) , KC_SPC , KC_SPC , MO(2) , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT
),
[1] = LAYOUT_ortho_4x12(
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 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
),
[2] = LAYOUT_ortho_4x12(
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 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
),
[3] = LAYOUT_ortho_4x12(
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 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
)
};

View file

@ -0,0 +1,265 @@
/*
Copyright 2020 Álvaro "Gondolindrim" Volpato <alvaro.volpato@usp.br>
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
#include "config_common.h"
#define MEDIA_KEY_DELAY 10
#define ALT_TAB_DELAY 1000
// Persistent encoder modes: the current encoder mode is written into EEPROM memory, and retrieved at the keyboard initialization. This means the current encoder mode is persistent even if the keyboard is reset or turned off
#define PERSISTENT_ENCODER_MODES
#define ENCODER_MODE_CHANGE_DELAY 500
// Defining special keycodes
enum keyboard_keycodes {
ECLICK = SAFE_RANGE, // Encoder click
ALTTABF , // ALT-TAB forward
ALTTABB , // ALT-TAB backwards
ALTTABC , // For alt-tab-click
ENCMUP , // Encoder mode up
ENCMDN , // Encoder mode down
NEW_SAFE_RANGE
};
// Creates sample keyevents and keyrecords to be used in the processing of the custom keycodes. Their time should be resampled everytime they are used; their cols and rows are set to be "impossible", that is, outside the normal key matrix bounds.
const keyevent_t sample_pressed_keyevent = {
.key = (keypos_t){.row = 5, .col = 13},
.pressed = true,
.time = 0
};
keyrecord_t sample_pressed_keyrecord = {
.event = sample_pressed_keyevent
};
const keyevent_t sample_released_keyevent = {
.key = (keypos_t){.row = 5, .col = 13},
.pressed = false,
.time = 0
};
keyrecord_t sample_released_keyrecord = {
.event = sample_released_keyevent
};
// tap_process_record_user calls process_record_user with the pressed and released sample keyrecords with a delay of MEDIA_KEY_DELAY. The idea is to allow custom keycodes a simulation of a key press and release, allowing them to be treated in process_record_user. This, in turn, allows the custom keycodes to be used both in the encoder callback and the keyboard keymap.
uint16_t temp_timer = 0;
void tap_process_record_user(uint16_t keycode)
{
temp_timer = timer_read();
sample_pressed_keyrecord.event.time = timer_read();
process_record_user( keycode, &sample_pressed_keyrecord );
while (timer_elapsed(temp_timer) < MEDIA_KEY_DELAY);
sample_released_keyrecord.event.time = timer_read();
process_record_user( keycode, &sample_released_keyrecord );
}
// process_special_keycode is a function that distinguishes between the native keycodes and the ones custom-defined here. Normal keycodes are tapped, while keycodes in the SAFE_RANGE - NEW_SAFE_RANGE interval are treated with tap_process_record_user.
void process_special_keycode(uint16_t keycode) {
if (SAFE_RANGE <= keycode && keycode < NEW_SAFE_RANGE) tap_process_record_user(keycode);
else tap_code(keycode);
}
uint16_t encoder_click_delay = ENCODER_MODE_CHANGE_DELAY;
uint8_t startup_color[3] = {0xFF,0xFF,0xFF};
typedef struct _encoder_mode_t {
uint8_t indicator_color[3];
uint16_t clockwise_key[4];
uint16_t counterclockwise_key[4];
uint16_t clicked_key[4] ;
uint16_t hold_key;
} encoder_mode_t;
encoder_mode_t encoder_modes[] = {
{ .indicator_color = {0x22,0x00,0xFF} , .clockwise_key = {KC_VOLU, KC_VOLU, ENCMUP, KC_VOLU}, .counterclockwise_key = {KC_VOLD, KC_VOLD, ENCMDN, KC_VOLD}, .clicked_key = {KC_MUTE, KC_MPLY, KC_MUTE, KC_MUTE}, .hold_key = ENCMUP },
{ .indicator_color = {0x00,0x33,0xFF} , .clockwise_key = {KC_WH_D, KC_WH_D, ENCMUP, KC_WH_D}, .counterclockwise_key = {KC_WH_U, KC_WH_U, ENCMDN, KC_WH_U}, .clicked_key = {KC_BTN1, KC_BTN1, KC_BTN1, KC_BTN1}, .hold_key = ENCMUP },
{ .indicator_color = {0xFF,0x88,0x00} , .clockwise_key = {ALTTABF, ALTTABF, ENCMUP, ALTTABF}, .counterclockwise_key = {ALTTABB, ALTTABB, ENCMDN, ALTTABB}, .clicked_key = {ALTTABC, ALTTABC, ALTTABC, ALTTABC}, .hold_key = ENCMUP }
// Insert your custom encoder mode here
};
#define NUM_ENCODER_MODES (sizeof(encoder_modes)/sizeof(encoder_modes[0]))
// This counter is used to track what encoder mode is being used at a certain time
int encoder_mode_count = 0;
#ifdef PERSISTENT_ENCODER_MODES
typedef union {
uint32_t raw;
struct {
int user_encoder_mode_count;
};
} user_config_t;
user_config_t user_config;
#endif
void set_indicator_colors(uint8_t color[3]){
rgblight_setrgb(color[0], color[1], color[2]);
}
// Board init: RGB indicator is set to startup_color
void keyboard_pre_init_user(void){
set_indicator_colors(startup_color);
};
void keyboard_post_init_user(void){
#ifdef PERSISTENT_ENCODER_MODES
user_config.raw = eeconfig_read_user();
encoder_mode_count = user_config.user_encoder_mode_count ;
#else
encoder_mode_count = 0;
#endif
set_indicator_colors(encoder_modes[ encoder_mode_count ].indicator_color);
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x12(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, ECLICK ,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
KC_LCTL, KC_LALT, KC_LGUI, _______, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
[1] = LAYOUT_ortho_4x12(
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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[2] = LAYOUT_ortho_4x12(
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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[3] = LAYOUT_ortho_4x12(
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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
)
};
// ------------------------------------------------------------------------------------------------
bool is_alt_tab_active = false; // Flag to check if alt tab is active
uint32_t alt_tab_timer = 0; // Time trigger for alt tab
uint16_t mapped_code = 0;
uint32_t held_keycode_timer = 0;
int current_layer = 0 ; // Updated in layer_state_set_user each time a layer change is made
void cycle_encoder_mode(bool forward){
if (forward) encoder_mode_count++ ; // Shifts encoder mode forward
else encoder_mode_count-- ;
if (encoder_mode_count == -1) encoder_mode_count = NUM_ENCODER_MODES - 1;
// Shifts encoder mode backward
encoder_mode_count = encoder_mode_count % NUM_ENCODER_MODES ; // This makes sure encoder_mode_count keeps cycling between 0,1,...,NUM_ENCODER_MODES and doesnt eventually overflow
#ifdef PERSISTENT_ENCODER_MODES
user_config.user_encoder_mode_count = encoder_mode_count ;
eeconfig_update_user(user_config.raw);
#endif
set_indicator_colors( encoder_modes[ encoder_mode_count ].indicator_color ); // Set indicator color to the corresponding defined color
}
bool encoder_update_user(uint8_t index, bool clockwise) {
process_special_keycode(clockwise ? encoder_modes[ encoder_mode_count ].clockwise_key[ current_layer ] : encoder_modes[ encoder_mode_count ].counterclockwise_key[ current_layer ]);
return false;
}
uint32_t held_click_timer = 0;
bool is_click_held = false;
bool is_shift_held = false;
bool automatic_hold_cycle = false; // This flag registers if the encoder hold was automatically cycled
// This bool records if LALT is pressed or not. Due to the automatic disabling of the ALT-TAB of the ALTTABS custom keystroke, the automatic disabling can un-register KC_LALT even when the LALT key is phisically pressed. Hence there needs to be two bools: one that keebs track of the ALT-TAB activity and one that keeps track of LALT so that the automatic disabling will not disable LALT if it is phisically pressed.
bool is_lalt_pressed = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_LSFT:
case KC_RSFT:
if (record->event.pressed) is_shift_held = true;
else is_shift_held = false;
return true;
case ECLICK:
// Checks if the encoder has been pressed; if so, sets the corresponding flag and starts the corresponding timer
if (record->event.pressed) {
is_click_held = true;
held_click_timer = timer_read32();
// Checks if the encoder has been released: samples the duration of the encoder push; if this time was less than the encoder_click_delay, processes the clicked key. If it was bigger, processes the hold key. This behavior is adjusted using the ENCODER_MODE_CHANGE_DELAY macro. There is an exception made when automatic_hold_cycle is true; this means that the encoder push has been pressed enough to trigger a hold cycle. This case is taken care of in the housekeeping routine, where the held key is triggered and the timer reset. Hence the automatic_hold_cycle needs to be checked because without this check the function will trigger the clicked key after the hold cycle has been cycled more than once.
} else {
is_click_held = false;
if (timer_elapsed32(held_click_timer) < encoder_click_delay && !automatic_hold_cycle ) process_special_keycode( encoder_modes[ encoder_mode_count ].clicked_key[ current_layer ] ) ;
automatic_hold_cycle = false;
}
return true; // Skip all further processing of this key
case KC_LALT: // If this is not defined, if the encoder is activated in the alt-tab mode while the LALT key is pressed, the menu goes away.
if (record->event.pressed) is_lalt_pressed = true;
else is_lalt_pressed = false;
return true;
case ENCMUP:
case ENCMDN:
if (record->event.pressed) cycle_encoder_mode(keycode == ENCMUP); // If keycode == ENCMUP the expression returns true and the cycle function cycles the modes forward. If not, then cycles backwards.
return false;
case ALTTABF:
case ALTTABB:
if (record->event.pressed) {
if (!is_alt_tab_active) {
is_alt_tab_active = true;
register_code(KC_LALT);
}
tap_code16(keycode == ALTTABF ? KC_TAB : S(KC_TAB)); // Due to S(KC_TAB), the 16-bit tap_code16 is needed.
alt_tab_timer = timer_read32();
}
return true;
case ALTTABC:
if (record->event.pressed) {
if (is_alt_tab_active) {
if (!is_lalt_pressed) unregister_code(KC_LALT);
is_alt_tab_active = false;
}
}
return false;
default:
return true; // Process all other keycodes normally
}
}
void housekeeping_task_user(void) {
if (is_alt_tab_active) {
if (is_lalt_pressed) alt_tab_timer = timer_read32();
else if (timer_elapsed32(alt_tab_timer) > ALT_TAB_DELAY) {
unregister_code(KC_LALT);
is_alt_tab_active = false;
}
}
/* This piece of the code checks for the encoder push timer. If the encoder push interval was less than encoder_click_delay then it is automatically processed by process_record_user by triggering the current mode's click key. However, if the encoder push is held for more time than the defined delay, then the encoder hold "cycles", that is, gets activated and the timer needs to be reset. This does three things:
- (1) Sets the automatic_hold_cycle flag which prevents process_record_user from triggering the click key when the push is released
- (2) Processes the current mode's hold key in process_record_user
- (3) Resets the click timer
*/
if (is_click_held && timer_elapsed32(held_click_timer) > encoder_click_delay ){
automatic_hold_cycle = true;
process_special_keycode( encoder_modes[ encoder_mode_count ].hold_key );
held_click_timer = timer_read32();
}
}

View file

@ -0,0 +1 @@
VIA_ENABLE = yes

View file

@ -0,0 +1,43 @@
/* Copyright 2019
*
* 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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x12(
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC,
KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT,
KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_ENT ,
KC_LCTL , KC_LALT , KC_LGUI , KC_NO , MO(1) , KC_SPC , KC_SPC , MO(2) , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT
),
[1] = LAYOUT_ortho_4x12(
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 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
),
[2] = LAYOUT_ortho_4x12(
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 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
),
[3] = LAYOUT_ortho_4x12(
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 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
)
};

View file

@ -0,0 +1 @@
VIA_ENABLE = yes

View file

@ -0,0 +1,44 @@
/* Copyright 2020 QMK
*
* 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
#include_next <mcuconf.h>
#undef STM32_PLLM_VALUE
#undef STM32_PLLN_VALUE
#undef STM32_PLLP_VALUE
#undef STM32_PLLQ_VALUE
#undef STM32_PPRE1
#undef STM32_PPRE2
#define STM32_PLLM_VALUE 4
#define STM32_PLLN_VALUE 96
#define STM32_PLLP_VALUE 2
#define STM32_PLLQ_VALUE 4
#define STM32_PPRE1 STM32_PPRE1_DIV2
#define STM32_PPRE2 STM32_PPRE2_DIV1
#undef STM32_I2C_USE_I2C1
#define STM32_I2C_USE_I2C1 TRUE
#undef STM32_PWM_USE_ADVANCED
#define STM32_PWM_USE_ADVANCED TRUE
#undef STM32_PWM_USE_TIM3
#define STM32_PWM_USE_TIM3 TRUE
#undef STM32_PWM_USE_TIM1
#define STM32_PWM_USE_TIM1 TRUE

View file

@ -0,0 +1,26 @@
MCU = STM32F411
# 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 = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
BACKLIGHT_DRIVER = pwm
LTO_ENABLE = no
ENCODER_ENABLE = yes
LAYOUTS = ortho_4x12
EEPROM_DRIVER = i2c
# Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE

View file

@ -1,17 +1,46 @@
# Acheron Aχξρων 40-SM-O-MX-TH-WI (Codename "SharkPCB") QMK firmware
# SharkPCB QMK firmware
<p align="center">
<img align="middle" src="https://raw.githubusercontent.com/Gondolindrim/acheronLibrary/master/graphics/acheronLong.png" width="400">
</p>
![sharkpcb](https://acheronproject.com/images/shark/shark_beta_pic3_small.jpg)
This is the QMK firmware repository for the Shark, updated until [revision Alpha](https://github.com/Gondolindrim/SharkPCB/releases/tag/Alpha).
The SharkPCB is an open-source ortholinear 40% layout designed by Gondolindrim for the AcheronProject.
The SharkPCB is an Open-Hardware guidelines compliant PCB which files can be found at [this link](https://github.com/Gondolindrim/SharkPCB). Its designer and maintainer is [Gondolindrim](https://github.com/Gondolindrim).
* Keyboard Maintainer: [Gondolindrim](https://github.com/gondolindrim)
* Hardware Availability: you can get release Beta SharkPCBs using the JLCPCB manufacturer using the files at [its documentation](http:/acheronproject.com/pcbs/shark/shark/)
See the [AcheronDocs](https://gondolindrim.github.io/AcheronDocs/shark/intro.html) page for the SharkPCB full documentation.
## How to flash
Make example for this keyboard (after setting up your build environment):
### Enter bootloader
make acheron/shark:default
### Release Alpha:
The DFU state in the bootloader can be accessed in 2 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**: press the button on the back of the PCB
* **Keycode in layout**: press the key mapped to `RESET` if it is available (ESC key at layer 1 in the default layout)
### Release Beta:
The DFU state in the bootloader can be accessed 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**: press the button on the back of the PCB, for at least five seconds
* **Keycode in layout**: press the key mapped to `RESET` if it is available (ESC key at layer 1 in the default layout)
## Compile firmware
### Release Alpha
After accessing the DFU state in your PCB, build the default layout using:
make acheron/shark/alpha:default
### Release Beta
After accessing the DFU state in your PCB, build the default layout using:
make acheron/shark/beta:default
Then download the resulting binary `*bin` file using `dfu-util` or QMK Toolbox.
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).

View file

@ -1,16 +1,14 @@
/* Copyright 2019 Álvaro "Gondolindrim" Volpato
*
* 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/>.
*/
/* Copyright 2022 Álvaro "Gondolindrim" Volpato <gondolindrim@acheronproject.com>
*
* 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.
*/
#include "shark.h"

View file

@ -1,39 +1,9 @@
/* Copyright 2019 Álvaro "Gondolindrim" Volpato
*
* 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
#include "quantum.h"
/* This 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_ortho_4x12( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \
) \
{ \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B } \
}
#if defined(KEYBOARD_acheron_shark_alpha)
#include "alpha.h"
#elif defined(KEYBOARD_acheron_shark_beta)
#include "beta.h"
#endif

View file

@ -0,0 +1,19 @@
/* Copyright 2021 QMK
*
* 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
#define LAYER_STATE_8BIT

View file

@ -0,0 +1,103 @@
/* Copyright 2022 Efthimis Iosifidis <iosifidise@gmail.com>
*
* 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
enum layers {
_BASIC,
_FN,
};
#define KC_X0 LT(_FN, KC_ESC)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* _BASIC Layer
* ,-------------------------------------.
* | Toggle | Toggle | | |
* | Block | Line | Undo | Redo |
* | Comment | Comment | | |
* |---------+---------+--------+---------+
* | | | | TO |
* | Cut | Copy | Paste | _FN |
* | | | | |
* `-------------------------------------'
*/
[_BASIC] = LAYOUT_ortho_2x4(
RCS(KC_A), C(KC_SLASH), C(KC_Z), C(KC_Y),
C(KC_X), C(KC_C), C(KC_V), TO(_FN)
),
/* _FN Layer
* ,--------------------------------------------.
* | RGB | RGB | RGB | RGB |
* | Toggle | Mode | Mode | Snake |
* | | Forward | Reverse | Mode |
* |-----------+-----------+-----------+---------+
* | | Cycle | Toggle | TO |
* | BackLight | BackLight | BackLight | _BASIC |
* | Toggle | Levels | | |
* `--------------------------------------------'
*/
[_FN] = LAYOUT_ortho_2x4(
RGB_TOG, RGB_MOD, RGB_M_R, RGB_M_SN,
BL_TOGG, BL_STEP, BL_BRTG, TO(_BASIC)
)
};
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}
bool oled_task_user(void) {
// Host Keyboard Layer Status
oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
oled_write_P(PSTR("Active layer: "), false);
switch (get_highest_layer(layer_state)) {
case _BASIC:
oled_write_ln_P(PSTR("Basic"), false);
break;
case _FN:
oled_write_ln_P(PSTR("FN"), false);
break;
default:
// Or use the write_ln shortcut over adding '\n' to the end of your string
oled_write_ln_P(PSTR("N/A"), false);
}
// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_P(PSTR("Num Lock: "), false);
oled_write_ln_P(led_state.num_lock ? PSTR("On") : PSTR("Off"), false);
oled_write_P(PSTR("Caps Lock: "), false);
oled_write_ln_P(led_state.caps_lock ? PSTR("On") : PSTR("Off"), false);
oled_write_P(PSTR("Backlit: "), false);
oled_write_ln_P(is_backlight_enabled() ? PSTR("On") : PSTR("Off"), false);
#ifdef RGBLIGHT_ENABLE
static char rgbStatusLine1[26] = {0};
snprintf(rgbStatusLine1, sizeof(rgbStatusLine1), "RGB Mode: %d", rgblight_get_mode());
oled_write_ln(rgbStatusLine1, false);
static char rgbStatusLine2[26] = {0};
snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
oled_write_ln(rgbStatusLine2, false);
#endif
return false;
}
#endif

View file

@ -45,6 +45,7 @@ static uint8_t led_mcu_wakeup[11] = {0x7b, 0x10, 0x43, 0x10, 0x03, 0x00, 0x00, 0
ble_capslock_t ble_capslock = {._dummy = {0}, .caps_lock = false};
#ifdef RGB_MATRIX_ENABLE
static uint8_t led_enabled = 1;
static uint8_t current_rgb_row = 0;
#endif
@ -225,6 +226,68 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if(rgb_matrix_is_enabled()) ap2_led_disable();
else ap2_led_enable();
return true;
case KC_AP_RGB_VAI:
if (record->event.pressed) {
if (get_mods() & MOD_MASK_SHIFT) {
rgb_matrix_increase_hue();
return false;
} else if (get_mods() & MOD_MASK_CTRL) {
rgb_matrix_decrease_hue();
return false;
} else {
rgb_matrix_increase_val();
}
}
return true;
case KC_AP_RGB_VAD:
if (record->event.pressed) {
if (get_mods() & MOD_MASK_SHIFT) {
rgb_matrix_increase_sat();
return false;
} else if (get_mods() & MOD_MASK_CTRL) {
rgb_matrix_decrease_sat();
return false;
} else {
rgb_matrix_decrease_val();
}
}
return true;
case KC_AP_RGB_TOG:
if (record->event.pressed) {
if (get_mods() & MOD_MASK_SHIFT) {
rgb_matrix_increase_speed();
return false;
} else if (get_mods() & MOD_MASK_CTRL) {
rgb_matrix_decrease_speed();
return false;
} else {
if (led_enabled) {
ap2_led_disable();
rgb_matrix_disable();
led_enabled = 0;
} else {
ap2_led_enable();
rgb_matrix_enable();
led_enabled = 1;
}
return true;
}
}
return true;
case KC_AP_RGB_MOD:
if (record->event.pressed) {
if (get_mods() & MOD_MASK_CTRL) {
rgb_matrix_step_reverse();
return false;
} else {
rgb_matrix_step();
}
}
return true;
#endif
default:

View file

@ -58,6 +58,10 @@ enum AP2KeyCodes {
KC_AP_LED_PREV_PROFILE,
KC_AP_LED_NEXT_INTENSITY,
KC_AP_LED_SPEED,
KC_AP_RGB_VAI,
KC_AP_RGB_VAD,
KC_AP_RGB_TOG,
KC_AP_RGB_MOD,
AP2_SAFE_RANGE,
};

View file

@ -46,3 +46,6 @@
#define MATRIX_COL_PINS \
{ C4, C5, B10, B11, C0, A15, A8, A10, A11, A12, A13, A14, B2, B3 }
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
#define PERMISSIVE_HOLD

View file

@ -1 +0,0 @@
AnnePro2, ANSI C15 version.

View file

@ -1,12 +1,3 @@
# Anne Pro 2
SRC = \
matrix.c \
annepro2_ble.c \
ap2_led.c \
protocol.c \
rgb_driver.c \
config_led.c
# MCU
MCU = cortex-m0plus
ARMV = 6
@ -18,23 +9,44 @@ MCU_STARTUP = ht32f523xx
BOARD = ANNEPRO2_C15
# Options
# Bootloader selection
BOOTLOADER = custom
PROGRAM_CMD = annepro2_tools --boot $(BUILD_DIR)/$(TARGET).bin
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # 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
# Custom RGB matrix handling
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = custom
# Keys
CUSTOM_MATRIX = lite
NKRO_ENABLE = no
MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = yes
KEY_LOCK_ENABLE = no
LAYOUTS = 60_ansi
# Other featues
BOOTMAGIC_ENABLE = no
CONSOLE_ENABLE = no
COMMAND_ENABLE = no
# Other features
RAW_ENABLE = no
MIDI_ENABLE = no
VIRTSER_ENABLE = no
COMBO_ENABLE = no
BOOTLOADER = custom
PROGRAM_CMD = annepro2_tools --boot $(BUILD_DIR)/$(TARGET).bin
LAYOUTS = 60_ansi
# Anne Pro 2
SRC = \
matrix.c \
annepro2_ble.c \
ap2_led.c \
protocol.c \
rgb_driver.c \
config_led.c

View file

@ -44,3 +44,6 @@
// inputs (columns are sampled)
#define MATRIX_COL_PINS \
{ C4, C5, D0, B15, C11, A15, C12, C13, A8, A10, A11, A14, D2, D3 }
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
#define PERMISSIVE_HOLD

View file

@ -1 +0,0 @@
AnnePro2, ANSI C18 version.

View file

@ -1,12 +1,3 @@
# Anne Pro 2
SRC = \
matrix.c \
annepro2_ble.c \
ap2_led.c \
protocol.c \
rgb_driver.c \
config_led.c
# MCU
MCU = cortex-m0plus
ARMV = 6
@ -18,23 +9,44 @@ MCU_STARTUP = ht32f523xx
BOARD = ANNEPRO2_C18
# Options
# Bootloader selection
BOOTLOADER = custom
PROGRAM_CMD = annepro2_tools --boot $(BUILD_DIR)/$(TARGET).bin
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # 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
# Custom RGB matrix handling
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = custom
# Keys
CUSTOM_MATRIX = lite
NKRO_ENABLE = no
MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = yes
KEY_LOCK_ENABLE = no
LAYOUTS = 60_ansi
# Other featues
BOOTMAGIC_ENABLE = yes
CONSOLE_ENABLE = no
COMMAND_ENABLE = no
# Other features
RAW_ENABLE = no
MIDI_ENABLE = no
VIRTSER_ENABLE = no
COMBO_ENABLE = no
BOOTLOADER = custom
PROGRAM_CMD = annepro2_tools --boot $(BUILD_DIR)/$(TARGET).bin
LAYOUTS = 60_ansi
# Anne Pro 2
SRC = \
matrix.c \
annepro2_ble.c \
ap2_led.c \
protocol.c \
rgb_driver.c \
config_led.c

View file

@ -1,329 +1,75 @@
{
"keyboard_name": "Anne Pro 2",
"url": "https://openannepro.github.io/",
"maintainer": "community",
"maintainer": "bwisn",
"layouts": {
"LAYOUT_60_ansi": {
"layout": [
{
"label": "~",
"x": 0,
"y": 0
},
{
"label": "!",
"x": 1,
"y": 0
},
{
"label": "@",
"x": 2,
"y": 0
},
{
"label": "#",
"x": 3,
"y": 0
},
{
"label": "$",
"x": 4,
"y": 0
},
{
"label": "%",
"x": 5,
"y": 0
},
{
"label": "^",
"x": 6,
"y": 0
},
{
"label": "&",
"x": 7,
"y": 0
},
{
"label": "*",
"x": 8,
"y": 0
},
{
"label": "(",
"x": 9,
"y": 0
},
{
"label": ")",
"x": 10,
"y": 0
},
{
"label": "_",
"x": 11,
"y": 0
},
{
"label": "+",
"x": 12,
"y": 0
},
{
"label": "Backspace",
"x": 13,
"y": 0,
"w": 2
},
{
"label": "Tab",
"x": 0,
"y": 1,
"w": 1.5
},
{
"label": "Q",
"x": 1.5,
"y": 1
},
{
"label": "W",
"x": 2.5,
"y": 1
},
{
"label": "E",
"x": 3.5,
"y": 1
},
{
"label": "R",
"x": 4.5,
"y": 1
},
{
"label": "T",
"x": 5.5,
"y": 1
},
{
"label": "Y",
"x": 6.5,
"y": 1
},
{
"label": "U",
"x": 7.5,
"y": 1
},
{
"label": "I",
"x": 8.5,
"y": 1
},
{
"label": "O",
"x": 9.5,
"y": 1
},
{
"label": "P",
"x": 10.5,
"y": 1
},
{
"label": "{",
"x": 11.5,
"y": 1
},
{
"label": "}",
"x": 12.5,
"y": 1
},
{
"label": "|",
"x": 13.5,
"y": 1,
"w": 1.5
},
{
"label": "Caps Lock",
"x": 0,
"y": 2,
"w": 1.75
},
{
"label": "A",
"x": 1.75,
"y": 2
},
{
"label": "S",
"x": 2.75,
"y": 2
},
{
"label": "D",
"x": 3.75,
"y": 2
},
{
"label": "F",
"x": 4.75,
"y": 2
},
{
"label": "G",
"x": 5.75,
"y": 2
},
{
"label": "H",
"x": 6.75,
"y": 2
},
{
"label": "J",
"x": 7.75,
"y": 2
},
{
"label": "K",
"x": 8.75,
"y": 2
},
{
"label": "L",
"x": 9.75,
"y": 2
},
{
"label": ":",
"x": 10.75,
"y": 2
},
{
"label": "\"",
"x": 11.75,
"y": 2
},
{
"label": "Enter",
"x": 12.75,
"y": 2,
"w": 2.25
},
{
"label": "Shift",
"x": 0,
"y": 3,
"w": 2.25
},
{
"label": "Z",
"x": 2.25,
"y": 3
},
{
"label": "X",
"x": 3.25,
"y": 3
},
{
"label": "C",
"x": 4.25,
"y": 3
},
{
"label": "V",
"x": 5.25,
"y": 3
},
{
"label": "B",
"x": 6.25,
"y": 3
},
{
"label": "N",
"x": 7.25,
"y": 3
},
{
"label": "M",
"x": 8.25,
"y": 3
},
{
"label": "<",
"x": 9.25,
"y": 3
},
{
"label": ">",
"x": 10.25,
"y": 3
},
{
"label": "?",
"x": 11.25,
"y": 3
},
{
"label": "Shift",
"x": 12.25,
"y": 3,
"w": 2.75
},
{
"label": "Ctrl",
"x": 0,
"y": 4,
"w": 1.25
},
{
"label": "Win",
"x": 1.25,
"y": 4,
"w": 1.25
},
{
"label": "Alt",
"x": 2.5,
"y": 4,
"w": 1.25
},
{
"x": 3.75,
"y": 4,
"w": 6.25
},
{
"label": "Alt",
"x": 10,
"y": 4,
"w": 1.25
},
{
"label": "Win",
"x": 11.25,
"y": 4,
"w": 1.25
},
{
"label": "Menu",
"x": 12.5,
"y": 4,
"w": 1.25
},
{
"label": "Ctrl",
"x": 13.75,
"y": 4,
"w": 1.25
}
{"label":"~", "x":0, "y":0},
{"label":"!", "x":1, "y":0},
{"label":"@", "x":2, "y":0},
{"label":"#", "x":3, "y":0},
{"label":"$", "x":4, "y":0},
{"label":"%", "x":5, "y":0},
{"label":"^", "x":6, "y":0},
{"label":"&", "x":7, "y":0},
{"label":"*", "x":8, "y":0},
{"label":"(", "x":9, "y":0},
{"label":")", "x":10, "y":0},
{"label":"_", "x":11, "y":0},
{"label":"+", "x":12, "y":0},
{"label":"Backspace", "x":13, "y":0, "w":2},
{"label":"Tab", "x":0, "y":1, "w":1.5},
{"label":"Q", "x":1.5, "y":1},
{"label":"W", "x":2.5, "y":1},
{"label":"E", "x":3.5, "y":1},
{"label":"R", "x":4.5, "y":1},
{"label":"T", "x":5.5, "y":1},
{"label":"Y", "x":6.5, "y":1},
{"label":"U", "x":7.5, "y":1},
{"label":"I", "x":8.5, "y":1},
{"label":"O", "x":9.5, "y":1},
{"label":"P", "x":10.5, "y":1},
{"label":"{", "x":11.5, "y":1},
{"label":"}", "x":12.5, "y":1},
{"label":"|", "x":13.5, "y":1, "w":1.5},
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
{"label":"A", "x":1.75, "y":2},
{"label":"S", "x":2.75, "y":2},
{"label":"D", "x":3.75, "y":2},
{"label":"F", "x":4.75, "y":2},
{"label":"G", "x":5.75, "y":2},
{"label":"H", "x":6.75, "y":2},
{"label":"J", "x":7.75, "y":2},
{"label":"K", "x":8.75, "y":2},
{"label":"L", "x":9.75, "y":2},
{"label":":", "x":10.75, "y":2},
{"label":"\"", "x":11.75, "y":2},
{"label":"Enter", "x":12.75, "y":2, "w":2.25},
{"label":"Shift", "x":0, "y":3, "w":2.25},
{"label":"Z", "x":2.25, "y":3},
{"label":"X", "x":3.25, "y":3},
{"label":"C", "x":4.25, "y":3},
{"label":"V", "x":5.25, "y":3},
{"label":"B", "x":6.25, "y":3},
{"label":"N", "x":7.25, "y":3},
{"label":"M", "x":8.25, "y":3},
{"label":"<", "x":9.25, "y":3},
{"label":">", "x":10.25, "y":3},
{"label":"?", "x":11.25, "y":3},
{"label":"Shift", "x":12.25, "y":3, "w":2.75},
{"label":"Ctrl", "x":0, "y":4, "w":1.25},
{"label":"Win", "x":1.25, "y":4, "w":1.25},
{"label":"Alt", "x":2.5, "y":4, "w":1.25},
{"x":3.75, "y":4, "w":6.25},
{"label":"Alt", "x":10, "y":4, "w":1.25},
{"label":"Win", "x":11.25, "y":4, "w":1.25},
{"label":"Menu", "x":12.5, "y":4, "w":1.25},
{"label":"Ctrl", "x":13.75, "y":4, "w":1.25}
]
}
}

View file

@ -1,20 +0,0 @@
/* Copyright 2021 OpenAnnePro community
*
* 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
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
#define PERMISSIVE_HOLD

View file

@ -1,20 +0,0 @@
/* Copyright 2021 OpenAnnePro community
*
* 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
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
#define PERMISSIVE_HOLD

View file

@ -1,20 +0,0 @@
/* Copyright 2021 OpenAnnePro community
*
* 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
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
#define PERMISSIVE_HOLD

View file

@ -83,7 +83,7 @@ enum anne_pro_layers {
/*
* Layer FN2
* ,-----------------------------------------------------------------------------------------.
* | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | HUE | SAT | BRI | SPD | MOD | TOG | Bksp |
* | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | F7 | F8 | MOD | TOG | BRI- | BRI+ | Bksp |
* |-----------------------------------------------------------------------------------------+
* | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ |
* |-----------------------------------------------------------------------------------------+
@ -96,11 +96,11 @@ enum anne_pro_layers {
*
*/
[FN2] = LAYOUT_60_ansi( /* FN2 */
_______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, RGB_MOD, RGB_TOG, _______,
MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
_______, _______, _______, _______, _______, MO(FN1), MO(FN2), _______
_______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, _______, KC_AP_RGB_MOD, KC_AP_RGB_TOG, KC_AP_RGB_VAD, KC_AP_RGB_VAI, _______,
MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
_______, _______, _______, _______, _______, MO(FN1), MO(FN2), _______
),
};
// clang-format on

View file

@ -1,3 +0,0 @@
# Custom RGB matrix handling
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = custom

View file

@ -1,12 +1,10 @@
# Anne Pro 2 rev. C15 and C18 QMK firmware
## Introduction
An ANSI-layout 60% keyboard featuring Bluetooth support and per-key RGB lighting.
This is the QMK firmware repository for the Anne Pro 2 rev. C15 and C18 keyboard.
## Layouts
Keyboard has 60% ANSI standard layout.
* Keyboard Maintainer: [bwisn](https://github.com/bwisn)
* Hardware Supported: Anne Pro 2, [C15](c15/) and [C18](c18/) versions
* Hardware Availability: [annepro.net](https://www.annepro.net/), [Hexcore](https://www.hexcore.xyz/annepro2)
## How to compile
@ -25,26 +23,26 @@ If you want to compile the Anne Pro 2 C15 default keymap use:
If you want the executable instead of compiling it yourself, [download it here](https://ci.codetector.org/job/OpenAnnePro/job/AnnePro2-Tools/job/master/).
Windows and Linux versions are available. Otherwise, follow the steps below:
0. Install the latest stable `rust` toolchain using [rustup](https://rustup.rs/)
0. Also install [Visual Studio Community edition](https://visualstudio.microsoft.com/downloads/)
1. Install the latest stable `rust` toolchain using [rustup](https://rustup.rs/)
1. Also install [Visual Studio Community edition](https://visualstudio.microsoft.com/downloads/)
including the C/C++ module to prevent errors while compiling
0. Download or Clone the [AnnePro2-Tools](https://github.com/OpenAnnePro/AnnePro2-Tools) project.
0. Compile the tool using
```bash
cargo build --release
```
0. The compiled tool should be in `./target/release/annepro2_tools` (In later I will refer to this as `annepro2_tools`)
1. Download or Clone the [AnnePro2-Tools](https://github.com/OpenAnnePro/AnnePro2-Tools) project.
1. Compile the tool using
```bash
cargo build --release
```
The compiled tool should be in `./target/release/annepro2_tools` (In later I will refer to this as `annepro2_tools`)
### Flashing the firmware
0. Put the keyboard into DFU/IAP mode by unplugging the keyboard, then holding ESC while plugging it back in.
0. Run annepro2_tools with the firmware you just built.
**Please substitute with the correct paths and correct bin file if you chose another keymap profile**
```bash
annepro2_tools annepro2_c15_default.bin
```
1. Put the keyboard into DFU/IAP mode by unplugging the keyboard, then holding ESC while plugging it back in.
1. Run annepro2_tools with the firmware you just built.
**Please substitute with the correct paths and correct bin file if you chose another keymap profile.**
```bash
annepro2_tools annepro2_c15_default.bin
```
If the tool can't find the keyboard please double check you have the keyboard in IAP mode.
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).
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).

View file

@ -0,0 +1,25 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later
#include "avalanche.h"
#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }
if (index == 0) {
if (clockwise) {
tap_code_delay(KC_VOLU, 10);
} else {
tap_code_delay(KC_VOLD, 10);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_PGUP);
} else {
tap_code(KC_PGDOWN);
}
}
return true;
}
#endif

View file

@ -0,0 +1,14 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#ifdef KEYBOARD_avalanche_v1
#include "v1.h"
#elif KEYBOARD_avalanche_v2
#include "v2.h"
#elif KEYBOARD_avalanche_v3
#include "v3.h"
#endif
#include "quantum.h"

View file

@ -0,0 +1,6 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "config_common.h"

View file

@ -0,0 +1,27 @@
# Avalanche
![Avalanche v3.0](https://github.com/vlkv/avalanche/blob/master/images/avalanche_v3-0.jpg)
An open source ergonomic split keyboard with removable keys to support 40% and 60% configurations.
* Keyboard Maintainer: [Vitaly Volkov](https://github.com/vlkv)
* Hardware Supported: Avalanche PCB v1, v2, v3, Pro Micro 5V/16MHz and compatible.
* Hardware Availability: [Avalanche](https://github.com/vlkv/avalanche).
Make example for this keyboard (after setting up your build environment):
make avalanche/v1:default # for v1 PCBs
make avalanche/v2:default # for v2 PCBs
make avalanche/v3:default # for v3 PCBs
Flashing example for this keyboard:
make avalanche/v1:default:flash # for v1 PCBs
make avalanche/v2:default:flash # for v2 PCBs
make avalanche/v3:default:flash # for v3 PCBs
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
Briefly press the button along the inner edge of the PCB next to the microcontroller.

View file

@ -0,0 +1,22 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define VENDOR_ID 0xCEE2
#define PRODUCT_ID 0x0001
#define DEVICE_VER 0x0001
#define MANUFACTURER vitvlkv
#define PRODUCT Avalanche
#define MATRIX_ROWS 10
#define MATRIX_COLS 8
#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 }
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 }
#define DIODE_DIRECTION COL2ROW
#define SOFT_SERIAL_PIN D2
#define BACKLIGHT_PIN B0

View file

@ -0,0 +1,48 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later
/*
qmk compile -kb avalanche/v1 -km default
qmk flash -kb avalanche/v1 -km default
*/
#include QMK_KEYBOARD_H
enum layer {
LAYER_0,
LAYER_1,
LAYER_2,
};
#define FN_1 MO(LAYER_1)
#define FN_2 LT(LAYER_2, KC_SPC)
#define LFN_3 LSFT_T(KC_EQL)
#define RFN_3 RSFT_T(KC_MINS)
#define KC_QTSH RSFT_T(KC_QUOT)
#define EN_LALT LALT_T(KC_ENT)
#define EN_RALT RALT_T(KC_ENT)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[LAYER_0] = LAYOUT(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
KC_LGUI, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_CAPS, KC_LSCR, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QTSH, KC_RBRC,
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTL,
KC_GRV, LFN_3, FN_2, EN_LALT, EN_RALT, FN_1, RFN_3, KC_INS
),
[LAYER_1] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, KC_PGUP, KC_PSCR, _______,
_______, _______, KC_APP, XXXXXXX, KC_HOME, KC_END, KC_DEL, _______, _______, KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______, KC_F12,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, _______, _______, KC_HOME, KC_END, XXXXXXX, KC_PGDN, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
[LAYER_2] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
_______, KC_BSPC, KC_1, KC_2, KC_3, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, KC_PGUP, XXXXXXX, XXXXXXX,
_______, _______, KC_BSPC, KC_4, KC_5, KC_6, KC_DEL, _______, _______, KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______, KC_F12,
_______, KC_BSPC, KC_7, KC_8, KC_9, KC_0, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
};

View file

@ -0,0 +1,20 @@
# MCU name
MCU = atmega32u4
# Bootloader selection
BOOTLOADER = caterina
# 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 = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
SPLIT_KEYBOARD = yes

View file

@ -0,0 +1,4 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later
#include "avalanche.h"

View file

@ -0,0 +1,31 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "avalanche.h"
#include "quantum.h"
#define L__ KC_NO
#define R__ KC_NO
#define LAYOUT( \
L01, L02, L03, L04, L05, L06, R06, R05, R04, R03, R02, R01, \
L11, L12, L13, L14, L15, L16, R16, R15, R14, R13, R12, R11, \
L20, L21, L22, L23, L24, L25, L26, L27, R27, R26, R25, R24, R23, R22, R21, R20, \
L31, L32, L33, L34, L35, L36, L37, R37, R36, R35, R34, R33, R32, R31, \
L44, L45, L46, L47, R47, R46, R45, R44 \
) \
{ \
{ L__, L01, L02, L03, L04, L05, L06, L__}, \
{ L__, L11, L12, L13, L14, L15, L16, L__}, \
{ L20, L21, L22, L23, L24, L25, L26, L27}, \
{ L__, L31, L32, L33, L34, L35, L36, L37}, \
{ L__, L__, L__, L__, L44, L45, L46, L47}, \
{ R__, R01, R02, R03, R04, R05, R06, R__}, \
{ R__, R11, R12, R13, R14, R15, R16, R__}, \
{ R20, R21, R22, R23, R24, R25, R26, R27}, \
{ R__, R31, R32, R33, R34, R35, R36, R37}, \
{ R__, R__, R__, R__, R44, R45, R46, R47} \
}

View file

@ -0,0 +1,30 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define VENDOR_ID 0xCEE2
#define PRODUCT_ID 0x0002
#define DEVICE_VER 0x0002
#define MANUFACTURER vitvlkv
#define PRODUCT Avalanche
#define MATRIX_ROWS 10
#define MATRIX_COLS 7
#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 }
#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 }
#define DIODE_DIRECTION COL2ROW
#define SOFT_SERIAL_PIN D2
#define RGB_DI_PIN D3
#define RGBLED_NUM 12
#define RGBLED_SPLIT { 6, 6 }
#define RGBLIGHT_SPLIT
#define ENCODERS_PAD_A { B5 }
#define ENCODERS_PAD_B { F4 }
#define ENCODER_RESOLUTION 2

View file

@ -0,0 +1,56 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later
/*
qmk compile -kb avalanche/v2 -km default
qmk flash -kb avalanche/v2 -km default
*/
#include QMK_KEYBOARD_H
enum layer {
LAYER_0,
LAYER_1,
LAYER_2,
LAYER_3,
};
#define FN_1 MO(LAYER_1)
#define FN_2 LT(LAYER_2, KC_SPC)
#define FN_3 LT(LAYER_3, KC_INS)
#define LFN_3 LSFT_T(KC_EQL)
#define RFN_3 RSFT_T(KC_MINS)
#define EN_LALT LALT_T(KC_ENT)
#define EN_RALT RALT_T(KC_ENT)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[LAYER_0] = LAYOUT(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
KC_LGUI, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_RBRC,
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTL,
KC__MUTE,KC_GRV, LFN_3, FN_2, EN_LALT, EN_RALT, FN_1, RFN_3, FN_3, KC_LSCR
),
[LAYER_1] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
_______, KC_0, KC_1, KC_2, KC_3, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX,
_______, _______, KC_APP, KC_4, KC_5, KC_6, KC_DEL, _______, _______, KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_F12,
_______, KC_PSCR, KC_7, KC_8, KC_9, KC_0, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[LAYER_2] = LAYOUT(
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, XXXXXXX, KC_EXLM, KC_AT, KC_HASH, XXXXXXX, KC_LPRN,
_______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______, _______, KC_BSPC, KC_DLR, KC_PERC, KC_CIRC, XXXXXXX, XXXXXXX, KC_RPRN,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, KC_AMPR, KC_ASTR, XXXXXXX, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[LAYER_3] = LAYOUT(
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
};

Some files were not shown because too many files have changed in this diff Show more