From 3eda183adefb6950520859a4288c0bdcf04d0fe1 Mon Sep 17 00:00:00 2001 From: Vaarai Date: Thu, 26 Sep 2024 22:21:08 +0200 Subject: [PATCH 01/15] Add cornia keyboard --- keyboards/cornia/info.json | 11 ++ keyboards/cornia/keymaps/default/keymap.c | 83 ++++++++ keyboards/cornia/keymaps/fire/callback_oled.c | 32 +++ .../keymaps/fire/callback_pointing_device.c | 51 +++++ .../cornia/keymaps/fire/callback_record.c | 45 +++++ .../cornia/keymaps/fire/callback_system.c | 25 +++ keyboards/cornia/keymaps/fire/config.h | 44 +++++ keyboards/cornia/keymaps/fire/keymap.c | 96 +++++++++ keyboards/cornia/keymaps/fire/keymap.h | 48 +++++ keyboards/cornia/keymaps/fire/mcuconf.h | 25 +++ keyboards/cornia/keymaps/fire/oled_routines.c | 59 ++++++ keyboards/cornia/keymaps/fire/oled_routines.h | 36 ++++ keyboards/cornia/keymaps/fire/rules.mk | 37 ++++ keyboards/cornia/keymaps/fire/tap_dances.c | 88 +++++++++ keyboards/cornia/keymaps/fire/tap_dances.h | 30 +++ keyboards/cornia/readme.md | 62 ++++++ keyboards/cornia/rules.mk | 1 + keyboards/cornia/v0_6/config.h | 25 +++ keyboards/cornia/v0_6/keyboard.json | 139 +++++++++++++ keyboards/cornia/v1/config.h | 20 ++ keyboards/cornia/v1/keyboard.json | 186 ++++++++++++++++++ 21 files changed, 1143 insertions(+) create mode 100644 keyboards/cornia/info.json create mode 100644 keyboards/cornia/keymaps/default/keymap.c create mode 100644 keyboards/cornia/keymaps/fire/callback_oled.c create mode 100644 keyboards/cornia/keymaps/fire/callback_pointing_device.c create mode 100644 keyboards/cornia/keymaps/fire/callback_record.c create mode 100644 keyboards/cornia/keymaps/fire/callback_system.c create mode 100644 keyboards/cornia/keymaps/fire/config.h create mode 100644 keyboards/cornia/keymaps/fire/keymap.c create mode 100644 keyboards/cornia/keymaps/fire/keymap.h create mode 100644 keyboards/cornia/keymaps/fire/mcuconf.h create mode 100644 keyboards/cornia/keymaps/fire/oled_routines.c create mode 100644 keyboards/cornia/keymaps/fire/oled_routines.h create mode 100644 keyboards/cornia/keymaps/fire/rules.mk create mode 100644 keyboards/cornia/keymaps/fire/tap_dances.c create mode 100644 keyboards/cornia/keymaps/fire/tap_dances.h create mode 100644 keyboards/cornia/readme.md create mode 100644 keyboards/cornia/rules.mk create mode 100644 keyboards/cornia/v0_6/config.h create mode 100644 keyboards/cornia/v0_6/keyboard.json create mode 100644 keyboards/cornia/v1/config.h create mode 100644 keyboards/cornia/v1/keyboard.json diff --git a/keyboards/cornia/info.json b/keyboards/cornia/info.json new file mode 100644 index 000000000000..4b1ee0981977 --- /dev/null +++ b/keyboards/cornia/info.json @@ -0,0 +1,11 @@ +{ + "manufacturer": "Vaarai", + "maintainer": "Vaarai", + "url": "https://github.com/Vaarai/Cornia", + "usb": { + "vid": "0xFEED" + }, + "split": { + "enabled": true + } +} \ No newline at end of file diff --git a/keyboards/cornia/keymaps/default/keymap.c b/keyboards/cornia/keymaps/default/keymap.c new file mode 100644 index 000000000000..4a92879d7e05 --- /dev/null +++ b/keyboards/cornia/keymaps/default/keymap.c @@ -0,0 +1,83 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +/* Custom Keycodes (CK_xxx) */ +#define CK_LPAR LSFT(KC_9) +#define CK_RPAR LSFT(KC_0) +#define CK_LCBR LSFT(KC_LBRC) +#define CK_RCBR LSFT(KC_RBRC) +#define CK_QMRK LSFT(KC_SLSH) +#define CK_UNSC LSFT(KC_MINS) + +/* Layers definitions */ +enum layers { + _ALPHA, + _NAV, + _NUM, + _ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_ALPHA] = LAYOUT_split_3x6_3( + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTL, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LSFT,MO(_NAV), KC_SPC, KC_ENT,MO(_NUM), KC_RSFT + //`--------------------------' `--------------------------' + ), + + [_NAV] = LAYOUT_split_3x6_3( + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_RALT, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, _______, _______, _______,MO(_ADJUST),_______ + //`--------------------------' `--------------------------' + ), + + [_NUM] = LAYOUT_split_3x6_3( + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, KC_SLSH, CK_LCBR, CK_LPAR, KC_LBRC, KC_MINS, CK_UNSC, KC_RBRC, CK_RPAR, CK_RCBR, KC_BSLS, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, XXXXXXX, KC_GRV, CK_QMRK, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______,MO(_ADJUST),_______, _______, _______, KC_RGUI + //`--------------------------' `--------------------------' + ), + + [_ADJUST] = LAYOUT_split_3x6_3( + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, RGB_TOG, RGB_HUI, RGB_VAI, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + //|--------+--------+--------+--------+--------|--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, RGB_MOD, RGB_HUD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______ + //`--------------------------' `--------------------------' + ), +}; \ No newline at end of file diff --git a/keyboards/cornia/keymaps/fire/callback_oled.c b/keyboards/cornia/keymaps/fire/callback_oled.c new file mode 100644 index 000000000000..b8f292ea70d8 --- /dev/null +++ b/keyboards/cornia/keymaps/fire/callback_oled.c @@ -0,0 +1,32 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#include "./keymap.h" +#include "./oled_routines.h" + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_270; +} + +bool oled_task_user(void) { + oled_set_cursor(0, 0); + render_logo(); + oled_set_cursor(0, 7); + render_layer_status(); + return false; +} diff --git a/keyboards/cornia/keymaps/fire/callback_pointing_device.c b/keyboards/cornia/keymaps/fire/callback_pointing_device.c new file mode 100644 index 000000000000..5aa7392925af --- /dev/null +++ b/keyboards/cornia/keymaps/fire/callback_pointing_device.c @@ -0,0 +1,51 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#include "./keymap.h" + +/* Trackpad srolling speed adjustment */ +#define SCROLL_DIVISOR_H 8.0 +#define SCROLL_DIVISOR_V 8.0 + +bool set_scrolling = false; + +/* Variables to store accumulated scroll values */ +float scroll_accumulated_h = 0; +float scroll_accumulated_v = 0; + +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + /* Check if drag scrolling is active */ + if (set_scrolling) { + /* Calculate and accumulate scroll values based on mouse movement and divisors */ + scroll_accumulated_h += (float)mouse_report.x / SCROLL_DIVISOR_H; + scroll_accumulated_v += (float)mouse_report.y / SCROLL_DIVISOR_V; + + /* Assign integer parts of accumulated scroll values to the mouse report */ + mouse_report.h = (int8_t)scroll_accumulated_h; + mouse_report.v = (int8_t)scroll_accumulated_v; + + /* Update accumulated scroll values by subtracting the integer parts */ + scroll_accumulated_h -= (int8_t)scroll_accumulated_h; + scroll_accumulated_v -= (int8_t)scroll_accumulated_v; + + /* Clear the X and Y values of the mouse report */ + mouse_report.x = 0; + mouse_report.y = 0; + } + return mouse_report; +} diff --git a/keyboards/cornia/keymaps/fire/callback_record.c b/keyboards/cornia/keymaps/fire/callback_record.c new file mode 100644 index 000000000000..43f441c9a646 --- /dev/null +++ b/keyboards/cornia/keymaps/fire/callback_record.c @@ -0,0 +1,45 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#include "./keymap.h" + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case CK_RKJMP: /* Warframe rocket jump */ + if (record->event.pressed) { + SEND_STRING(SS_DOWN(X_C)); + } else { + SEND_STRING(SS_DOWN(X_SPC) SS_DELAY(50) SS_UP(X_C) SS_DELAY(50) SS_UP(X_SPC)); + } + return false; + case CK_DPII: /* Increase trackpad DPI */ + if (record->event.pressed) { + pointing_device_set_cpi(pointing_device_get_cpi()+100); + } + return false; + case CK_DPID: /* Decrease trackpad DPI */ + if (record->event.pressed) { + pointing_device_set_cpi(pointing_device_get_cpi()-100); + } + return false; + case CK_SCRL: /* Toggle set_scrolling when CK_SCRL key is pressed or released */ + set_scrolling = record->event.pressed; + return false; + } + return true; +} diff --git a/keyboards/cornia/keymaps/fire/callback_system.c b/keyboards/cornia/keymaps/fire/callback_system.c new file mode 100644 index 000000000000..018e74f5d7dd --- /dev/null +++ b/keyboards/cornia/keymaps/fire/callback_system.c @@ -0,0 +1,25 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#include "./keymap.h" +#include "./oled_routines.h" + +bool shutdown_user(bool jump_to_bootloader) { + render_boot(jump_to_bootloader); + return false; +} diff --git a/keyboards/cornia/keymaps/fire/config.h b/keyboards/cornia/keymaps/fire/config.h new file mode 100644 index 000000000000..938775745eda --- /dev/null +++ b/keyboards/cornia/keymaps/fire/config.h @@ -0,0 +1,44 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* I²C config */ +#define I2C_DRIVER I2CD1 +#define I2C1_SDA_PIN GP10 +#define I2C1_SCL_PIN GP11 + +/* Split */ +#define SPLIT_ACTIVITY_ENABLE +#define SPLIT_LAYER_STATE_ENABLE +#define SPLIT_LED_STATE_ENABLE +#define SPLIT_MODS_ENABLE + +/* OLED */ +#define OLED_TIMEOUT 60000 + +/* Trackpad */ +#define SPLIT_POINTING_ENABLE +#define POINTING_DEVICE_RIGHT +#define POINTING_DEVICE_ROTATION_90 +#define CIRQUE_PINNACLE_DIAMETER_MM 40 +#define CIRQUE_PINNACLE_TAP_ENABLE +#define CIRQUE_PINNACLE_CURVED_OVERLAY +#define CIRQUE_PINNACLE_POSITION_MODE CIRQUE_PINNACLE_RELATIVE_MODE +#define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X + +/* Tap dance */ +#define TAPPING_TERM 200 \ No newline at end of file diff --git a/keyboards/cornia/keymaps/fire/keymap.c b/keyboards/cornia/keymaps/fire/keymap.c new file mode 100644 index 000000000000..f102ac19a7d4 --- /dev/null +++ b/keyboards/cornia/keymaps/fire/keymap.c @@ -0,0 +1,96 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#include "./keymap.h" +#include "./tap_dances.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_ALPHA] = LAYOUT_split_3x6_3( /* Fire (Oxey) : https://bit.ly/layout-doc-v2 */ + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_ESC, KC_P, KC_L, KC_D, KC_G, KC_V, KC_Q, KC_F, KC_O, KC_U, KC_COMM, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_TAB, KC_N, KC_R, KC_T, KC_S, KC_Y, KC_J, KC_H, KC_A, KC_E, KC_I, KC_RALT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_X, KC_K, KC_C, KC_W, KC_Z, KC_B, KC_M, KC_QUOT, KC_SCLN, KC_DOT, KC_RCTL, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + TD(TD_SFT_CAPSW), MO(_NAV), KC_SPC, KC_ENT, MO(_NUM), TD(TD_SFT_CAPSW) + //`--------------------------' `--------------------------' + ), + + [_NAV] = LAYOUT_split_3x6_3( + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, XXXXXXX, XXXXXXX, CK_SCRL, C(KC_A), XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, + //|--------+--------+ GUI V +--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, C(KC_X), G(KC_V), C(KC_V), C(KC_C), C(KC_Z), KC_WH_U, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, _______, + //|ALT LEFT+--------+ ALT SFT+scrnshot+--------+--------| |--------+--------+--------+--------+--------+--------| + A(KC_LEFT),C(KC_S),S(KC_LALT), CK_SSHT,C(KC_F), C(KC_Y), KC_WH_D, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, _______, _______, _______,MO(_ADJUST),_______ + //`--------------------------' `--------------------------' + ), + + [_NUM] = LAYOUT_split_3x6_3( + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + //|--------+-- / ---+-- { ---+-- ( ---+-- [ ---+-- - ---| |--- _ --+--- ] --+-- ) ---+-- } ---+-- \ ---+--------| + _______, KC_SLSH, CK_LCBR, CK_LPAR, KC_LBRC, KC_MINS, CK_UNSC, KC_RBRC, CK_RPAR, CK_RCBR, KC_BSLS, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, XXXXXXX, KC_GRV, CK_QMRK, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______,MO(_ADJUST),_______, _______, _______, KC_RGUI + //`--------------------------' `--------------------------' + ), + + [_ADJUST] = LAYOUT_split_3x6_3( + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, RGB_TOG, RGB_HUI, RGB_VAI, CK_DPII, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + //|--------+--------+--------+--------+--------|--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, RGB_MOD, RGB_HUD, RGB_VAD, CK_DPID, XXXXXXX, TO(_G0), TO(_G1), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______ + //`--------------------------' `--------------------------' + ), + + /* Generic game */ + [_G0] = LAYOUT_split_3x6_3( + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, KC_LSFT, KC_A, KC_S, KC_D, KC_F, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LGUI, KC_LCTL, KC_Z, KC_X, KC_C, KC_V, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_SPC, KC_SPC, XXXXXXX, XXXXXXX, TG(_G0), XXXXXXX + //`--------------------------' `--------------------------' + ), + + /* Warframe */ + [_G1] = LAYOUT_split_3x6_3( + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_ESC, KC_TAB, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, KC_LSFT, KC_A, KC_W, KC_D, KC_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LGUI, KC_LCTL, XXXXXXX, KC_S, KC_X, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + CK_RKJMP, KC_SPC, XXXXXXX, XXXXXXX, TG(_G1), XXXXXXX + //`--------------------------' `--------------------------' + ), +}; \ No newline at end of file diff --git a/keyboards/cornia/keymaps/fire/keymap.h b/keyboards/cornia/keymaps/fire/keymap.h new file mode 100644 index 000000000000..c9224b07620d --- /dev/null +++ b/keyboards/cornia/keymaps/fire/keymap.h @@ -0,0 +1,48 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include QMK_KEYBOARD_H + +/* Trackpad srolling enablement flag */ +extern bool set_scrolling; + +/* Layers definitions */ +enum layers { + _ALPHA, + _NAV, + _NUM, + _ADJUST, + _G0, + _G1 +}; + +/* Custom Keycodes (CK_xxx) */ +#define CK_LPAR LSFT(KC_9) +#define CK_RPAR LSFT(KC_0) +#define CK_LCBR LSFT(KC_LBRC) +#define CK_RCBR LSFT(KC_RBRC) +#define CK_QMRK LSFT(KC_SLSH) +#define CK_SSHT LSG(KC_S) +#define CK_UNSC LSFT(KC_MINS) + +typedef enum { + CK_RKJMP = SAFE_RANGE, /* Warframe rocket/bullet jump */ + CK_DPII, + CK_DPID, + CK_SCRL, +} cornia_custom_keycodes_t; diff --git a/keyboards/cornia/keymaps/fire/mcuconf.h b/keyboards/cornia/keymaps/fire/mcuconf.h new file mode 100644 index 000000000000..a1bfd10d0ffd --- /dev/null +++ b/keyboards/cornia/keymaps/fire/mcuconf.h @@ -0,0 +1,25 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 FALSE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/cornia/keymaps/fire/oled_routines.c b/keyboards/cornia/keymaps/fire/oled_routines.c new file mode 100644 index 000000000000..cb8fea96d6a0 --- /dev/null +++ b/keyboards/cornia/keymaps/fire/oled_routines.c @@ -0,0 +1,59 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#include "./keymap.h" +#include "./oled_routines.h" + +void render_logo(void) { + static const char PROGMEM logo[] = OLED_LOGO_CORNIA; + oled_write_raw_P(logo, sizeof(logo)); +} + +void render_layer_status(void) { + switch (get_highest_layer(layer_state)) { + case _ALPHA: + oled_write_ln("ALPHA", 0); + break; + case _NAV: + oled_write_ln("NAV", 0); + break; + case _NUM: + oled_write_ln("NUM", 0); + break; + case _ADJUST: + oled_write_ln("ADJUS", 0); + break; + case _G0: + oled_write_ln("GAME0", 0); + break; + case _G1: + oled_write_ln("GAME1", 0); + break; + } +} + +void render_boot(bool bootloader) { + oled_clear(); + oled_set_cursor(0, 2); + if (bootloader) { + oled_write_P(PSTR("FLASH"), false); + } else { + oled_write_P(PSTR("RESET"), false); + } + oled_render_dirty(true); +} diff --git a/keyboards/cornia/keymaps/fire/oled_routines.h b/keyboards/cornia/keymaps/fire/oled_routines.h new file mode 100644 index 000000000000..1180a000adf0 --- /dev/null +++ b/keyboards/cornia/keymaps/fire/oled_routines.h @@ -0,0 +1,36 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include QMK_KEYBOARD_H +#include "./keymap.h" + +// 'Cornia', 32x32px +#define OLED_LOGO_CORNIA {\ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, \ + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xe0, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf8, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xfd, 0xe1, \ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0xc0, 0xf8, 0xff, 0xff, 0xff, 0x3f, 0x07, 0x00, 0x00, 0x00, 0x07, 0x3f, 0xff, 0xff, \ + 0xff, 0xf8, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x1e, 0x1f, 0x1f, 0x1f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, \ + 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x00 \ + } + +void render_logo(void); +void render_layer_status(void); +void render_boot(bool bootloader); diff --git a/keyboards/cornia/keymaps/fire/rules.mk b/keyboards/cornia/keymaps/fire/rules.mk new file mode 100644 index 000000000000..dedd42c4487c --- /dev/null +++ b/keyboards/cornia/keymaps/fire/rules.mk @@ -0,0 +1,37 @@ +# Copyright 2024 Vaarai +# +# 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 . + +SRC += oled_routines.c +SRC += callback_oled.c +SRC += callback_pointing_device.c +SRC += callback_record.c +SRC += callback_system.c +SRC += tap_dances.c + +MOUSEKEY_ENABLE = yes +CAPS_WORD_ENABLE = yes +TAP_DANCE_ENABLE = yes + +# OLED I²C configuration +OLED_ENABLE = yes +OLED_DRIVER = ssd1306 +OLED_TRANSPORT = i2c + +# Cirque Trackpad I²C configuration +POINTING_DEVICE_ENABLE = yes +POINTING_DEVICE_DRIVER = cirque_pinnacle_i2c + +# Add I²C HAL dependencies +OPT_DEFS += -DHAL_USE_I2C=TRUE diff --git a/keyboards/cornia/keymaps/fire/tap_dances.c b/keyboards/cornia/keymaps/fire/tap_dances.c new file mode 100644 index 000000000000..7713cdceae32 --- /dev/null +++ b/keyboards/cornia/keymaps/fire/tap_dances.c @@ -0,0 +1,88 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#include "./tap_dances.h" + +/* define a type containing as many tapdance states as you need */ +typedef enum { + SINGLE_TAP, + SINGLE_HOLD, + DOUBLE_TAP, + DOUBLE_HOLD, + OTHER_TAP +} td_state_t; + +/* Create a global instance of the tapdance state type */ +static td_state_t td_state; + +tap_dance_action_t tap_dance_actions[TAP_DANCE_ACTIONS_COUNT] = { + [TD_SFT_CAPSW] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_shift_capsword_finished, dance_shift_capsword_reset) +}; + +int cur_dance (tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) + { + return SINGLE_TAP; + } else { + return SINGLE_HOLD; + } + } + if (state->count == 2) + { + if (state->interrupted || !state->pressed) + { + return DOUBLE_TAP; + } else { + return DOUBLE_HOLD; + } + } else { + return OTHER_TAP; + } +} + +void dance_shift_capsword_finished (tap_dance_state_t *state, void *user_data) +{ + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + case SINGLE_HOLD: + register_code(KC_LSFT); + break; + case DOUBLE_TAP: + case DOUBLE_HOLD: + caps_word_on(); + break; + case OTHER_TAP: + break; + } +} + +void dance_shift_capsword_reset (tap_dance_state_t *state, void *user_data) +{ + switch (td_state) { + case SINGLE_TAP: + case SINGLE_HOLD: + unregister_code(KC_LSFT); + break; + case DOUBLE_TAP: + case DOUBLE_HOLD: + case OTHER_TAP: + break; + } +} \ No newline at end of file diff --git a/keyboards/cornia/keymaps/fire/tap_dances.h b/keyboards/cornia/keymaps/fire/tap_dances.h new file mode 100644 index 000000000000..ae38f8522aca --- /dev/null +++ b/keyboards/cornia/keymaps/fire/tap_dances.h @@ -0,0 +1,30 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include QMK_KEYBOARD_H + +/* Tap dances definitions */ +enum tap_dances { + TD_SFT_CAPSW, + TAP_DANCE_ACTIONS_COUNT /* Utility to get TD_xxx count */ +}; + +extern tap_dance_action_t tap_dance_actions[TAP_DANCE_ACTIONS_COUNT]; + +void dance_shift_capsword_finished (tap_dance_state_t *state, void *user_data); +void dance_shift_capsword_reset (tap_dance_state_t *state, void *user_data); diff --git a/keyboards/cornia/readme.md b/keyboards/cornia/readme.md new file mode 100644 index 000000000000..fd35d071c964 --- /dev/null +++ b/keyboards/cornia/readme.md @@ -0,0 +1,62 @@ +# Cornia Keyboard + +![Cornia v1](https://raw.githubusercontent.com/Vaarai/Cornia/refs/heads/main/images/Cornia_v1.jpg) + +A split keyboard with 3x6 column strongly staggered keys and 3 thumb keys + +Keyboard Maintainer: [Vaarai](https://github.com/Vaarai) +Hardware Supported: Cornia PCB, RP2040 / 0xCB-Helios +Hardware Availability: [PCB Data](https://github.com/Vaarai/Cornia) + +Make example for this keyboard (after setting up your build environment): +```sh + make cornia:default +``` + +Flashing example for this keyboard: +```sh + make cornia:default:flash +``` + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK ? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +The Cornia PCBs have a reset button on the bottom side near to the TRRS jack. + +To enter in to the bootloader you can either: +- Hold reset when plugging in that half of the keyboard. +- Double press reset if firmware was already flashed and if RP2040 is used +- Press NAV+NUM+ESC if firmware was already flashed no matter what controller is used + +## Keymaps + +Two keymaps are available for now, below are their [KLE](https://www.keyboard-layout-editor.com/) views: +- [Default QWERTY layout for Cornia keyboard](https://www.keyboard-layout-editor.com/#/gists/5af136790cefe4b35cdf02ca52c1fccc) +- [Fire layout for Cornia keyboard](https://www.keyboard-layout-editor.com/#/gists/a40345c92e1f3f326426ef890ebf4d1c) (Based on [Fire (Oxey)](https://docs.google.com/document/d/1Ic-h8UxGe5-Q0bPuYNgE3NoWiI8ekeadvSQ5YysrwII) layout) + +## Disable RGB Matrix + +The Corne Keyboard use the RGB Matrix feature by default. To disable it please make with the following command: +```sh + make cornia/v1_no_led:default +``` + +And flash with: +```sh + make cornia/v1_no_led:default:flash +``` + +## OLED Display & Cirque Trackpad + +The Corne Keyboard also support OLED Display and Cirque Trackpad through I²C, an implementation is available in `fire` keymap. + +To use it please make with the following command: +```sh + make cornia:fire +``` + +And flash with: +```sh + make cornia:fire:flash +``` \ No newline at end of file diff --git a/keyboards/cornia/rules.mk b/keyboards/cornia/rules.mk new file mode 100644 index 000000000000..d090f25d4b45 --- /dev/null +++ b/keyboards/cornia/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = cornia/v1 \ No newline at end of file diff --git a/keyboards/cornia/v0_6/config.h b/keyboards/cornia/v0_6/config.h new file mode 100644 index 000000000000..ab72146bd6c1 --- /dev/null +++ b/keyboards/cornia/v0_6/config.h @@ -0,0 +1,25 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* Select hand configuration */ +// #define MASTER_LEFT +#define MASTER_RIGHT +// #define EE_HANDS + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur. diff --git a/keyboards/cornia/v0_6/keyboard.json b/keyboards/cornia/v0_6/keyboard.json new file mode 100644 index 000000000000..68dcdbc44b34 --- /dev/null +++ b/keyboards/cornia/v0_6/keyboard.json @@ -0,0 +1,139 @@ +{ + "keyboard_name": "Cornia v0.6", + "usb": { + "pid": "0x0600", + "device_version": "0.6.0" + }, + "processor": "RP2040", + "bootloader": "rp2040", + "features": { + "extrakey": true, + "nkro": true, + "oled": true + }, + "split": { + "serial": { + "driver": "vendor", + "pin": "GP1" + }, + "transport": { + "sync": { + "matrix_state": true + } + } + }, + "diode_direction": "COL2ROW", + "matrix_pins": { + "cols": [ "GP29", "GP28", "GP27", "GP26", "GP22", "GP20" ], + "rows": [ "GP4", "GP5", "GP6", "GP7" ] + }, + "community_layouts": [ "split_3x6_3" ], + "layout_aliases": { + "LAYOUT": "LAYOUT_split_3x6_3" + }, + "layouts": { + "LAYOUT_split_3x6_3": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0.3}, + {"matrix": [0, 1], "x": 1, "y": 0.3}, + {"matrix": [0, 2], "x": 2, "y": 0.1}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0.1}, + {"matrix": [0, 5], "x": 5, "y": 0.2}, + {"matrix": [4, 5], "x": 9, "y": 0.2}, + {"matrix": [4, 4], "x": 10, "y": 0.1}, + {"matrix": [4, 3], "x": 11, "y": 0}, + {"matrix": [4, 2], "x": 12, "y": 0.1}, + {"matrix": [4, 1], "x": 13, "y": 0.3}, + {"matrix": [4, 0], "x": 14, "y": 0.3}, + {"matrix": [1, 0], "x": 0, "y": 1.3}, + {"matrix": [1, 1], "x": 1, "y": 1.3}, + {"matrix": [1, 2], "x": 2, "y": 1.1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1.1}, + {"matrix": [1, 5], "x": 5, "y": 1.2}, + {"matrix": [5, 5], "x": 9, "y": 1.2}, + {"matrix": [5, 4], "x": 10, "y": 1.1}, + {"matrix": [5, 3], "x": 11, "y": 1}, + {"matrix": [5, 2], "x": 12, "y": 1.1}, + {"matrix": [5, 1], "x": 13, "y": 1.3}, + {"matrix": [5, 0], "x": 14, "y": 1.3}, + {"matrix": [2, 0], "x": 0, "y": 2.3}, + {"matrix": [2, 1], "x": 1, "y": 2.3}, + {"matrix": [2, 2], "x": 2, "y": 2.1}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.1}, + {"matrix": [2, 5], "x": 5, "y": 2.2}, + {"matrix": [6, 5], "x": 9, "y": 2.2}, + {"matrix": [6, 4], "x": 10, "y": 2.1}, + {"matrix": [6, 3], "x": 11, "y": 2}, + {"matrix": [6, 2], "x": 12, "y": 2.1}, + {"matrix": [6, 1], "x": 13, "y": 2.3}, + {"matrix": [6, 0], "x": 14, "y": 2.3}, + {"matrix": [3, 3], "x": 4, "y": 3.7}, + {"matrix": [3, 4], "x": 5, "y": 3.7}, + {"matrix": [3, 5], "x": 6, "y": 3.2}, + {"matrix": [7, 5], "x": 8, "y": 3.2}, + {"matrix": [7, 4], "x": 9, "y": 3.7}, + {"matrix": [7, 3], "x": 10, "y": 3.7} + ] + } + }, + "ws2812": { + "driver": "vendor", + "pin": "GP0" + }, + "rgb_matrix": { + "driver": "ws2812", + "sleep": true, + "split_count": [21, 21], + "animations": { + "static_gradient": true, + "breathing": true + }, + "layout": [ + {"matrix": [3, 5], "x": 95, "y": 63, "flags": 1}, + {"matrix": [2, 5], "x": 85, "y": 39, "flags": 4}, + {"matrix": [1, 5], "x": 85, "y": 21, "flags": 4}, + {"matrix": [0, 5], "x": 85, "y": 4, "flags": 4}, + {"matrix": [0, 4], "x": 68, "y": 2, "flags": 4}, + {"matrix": [1, 4], "x": 68, "y": 19, "flags": 4}, + {"matrix": [2, 4], "x": 68, "y": 37, "flags": 4}, + {"matrix": [3, 4], "x": 80, "y": 58, "flags": 1}, + {"matrix": [3, 3], "x": 60, "y": 55, "flags": 1}, + {"matrix": [2, 3], "x": 50, "y": 35, "flags": 4}, + {"matrix": [1, 3], "x": 50, "y": 13, "flags": 4}, + {"matrix": [0, 3], "x": 50, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 33, "y": 3, "flags": 4}, + {"matrix": [1, 2], "x": 33, "y": 20, "flags": 4}, + {"matrix": [2, 2], "x": 33, "y": 37, "flags": 4}, + {"matrix": [2, 1], "x": 16, "y": 42, "flags": 4}, + {"matrix": [1, 1], "x": 16, "y": 24, "flags": 4}, + {"matrix": [0, 1], "x": 16, "y": 7, "flags": 4}, + {"matrix": [0, 0], "x": 0, "y": 7, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 24, "flags": 1}, + {"matrix": [2, 0], "x": 0, "y": 41, "flags": 1}, + {"matrix": [7, 5], "x": 129, "y": 63, "flags": 1}, + {"matrix": [6, 5], "x": 139, "y": 39, "flags": 4}, + {"matrix": [5, 5], "x": 139, "y": 21, "flags": 4}, + {"matrix": [4, 5], "x": 139, "y": 4, "flags": 4}, + {"matrix": [4, 4], "x": 156, "y": 2, "flags": 4}, + {"matrix": [5, 4], "x": 156, "y": 19, "flags": 4}, + {"matrix": [6, 4], "x": 156, "y": 37, "flags": 4}, + {"matrix": [7, 4], "x": 144, "y": 58, "flags": 1}, + {"matrix": [7, 3], "x": 164, "y": 55, "flags": 1}, + {"matrix": [6, 3], "x": 174, "y": 35, "flags": 4}, + {"matrix": [5, 3], "x": 174, "y": 13, "flags": 4}, + {"matrix": [4, 3], "x": 174, "y": 0, "flags": 4}, + {"matrix": [4, 2], "x": 191, "y": 3, "flags": 4}, + {"matrix": [5, 2], "x": 191, "y": 20, "flags": 4}, + {"matrix": [6, 2], "x": 191, "y": 37, "flags": 4}, + {"matrix": [6, 1], "x": 208, "y": 42, "flags": 4}, + {"matrix": [5, 1], "x": 208, "y": 24, "flags": 4}, + {"matrix": [4, 1], "x": 208, "y": 7, "flags": 4}, + {"matrix": [4, 0], "x": 224, "y": 7, "flags": 1}, + {"matrix": [5, 0], "x": 224, "y": 24, "flags": 1}, + {"matrix": [6, 0], "x": 224, "y": 41, "flags": 1} + ] + } +} diff --git a/keyboards/cornia/v1/config.h b/keyboards/cornia/v1/config.h new file mode 100644 index 000000000000..52086ac2eb20 --- /dev/null +++ b/keyboards/cornia/v1/config.h @@ -0,0 +1,20 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur. diff --git a/keyboards/cornia/v1/keyboard.json b/keyboards/cornia/v1/keyboard.json new file mode 100644 index 000000000000..b3c7db93e03d --- /dev/null +++ b/keyboards/cornia/v1/keyboard.json @@ -0,0 +1,186 @@ +{ + "keyboard_name": "Cornia v1", + "usb": { + "pid": "0x1000", + "device_version": "1.0.0" + }, + "processor": "RP2040", + "bootloader": "rp2040", + "features": { + "extrakey": true, + "nkro": true, + "rgb_matrix": true + }, + "split": { + "serial": { + "driver": "vendor", + "pin": "GP1" + }, + "transport": { + "sync": { + "matrix_state": true + } + }, + "handedness": { + "pin": "GP25" + } + }, + "matrix_pins": { + "direct":[ + ["GP27", "GP4", "GP28", "GP3", "GP29", "GP2"], + ["GP5", "GP26", "GP6", "GP22", "GP7", "GP20"], + ["GP8", "GP15", "GP9", "GP14", "GP12", "GP13"], + [ null, null, null, "GP16", "GP23", "GP21"] + ] + }, + "community_layouts": [ "split_3x6_3" ], + "layout_aliases": { + "LAYOUT": "LAYOUT_split_3x6_3" + }, + "layouts": { + "LAYOUT_split_3x6_3": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0.3}, + {"matrix": [0, 1], "x": 1, "y": 0.3}, + {"matrix": [0, 2], "x": 2, "y": 0.1}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0.1}, + {"matrix": [0, 5], "x": 5, "y": 0.2}, + {"matrix": [4, 5], "x": 9, "y": 0.2}, + {"matrix": [4, 4], "x": 10, "y": 0.1}, + {"matrix": [4, 3], "x": 11, "y": 0}, + {"matrix": [4, 2], "x": 12, "y": 0.1}, + {"matrix": [4, 1], "x": 13, "y": 0.3}, + {"matrix": [4, 0], "x": 14, "y": 0.3}, + {"matrix": [1, 0], "x": 0, "y": 1.3}, + {"matrix": [1, 1], "x": 1, "y": 1.3}, + {"matrix": [1, 2], "x": 2, "y": 1.1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1.1}, + {"matrix": [1, 5], "x": 5, "y": 1.2}, + {"matrix": [5, 5], "x": 9, "y": 1.2}, + {"matrix": [5, 4], "x": 10, "y": 1.1}, + {"matrix": [5, 3], "x": 11, "y": 1}, + {"matrix": [5, 2], "x": 12, "y": 1.1}, + {"matrix": [5, 1], "x": 13, "y": 1.3}, + {"matrix": [5, 0], "x": 14, "y": 1.3}, + {"matrix": [2, 0], "x": 0, "y": 2.3}, + {"matrix": [2, 1], "x": 1, "y": 2.3}, + {"matrix": [2, 2], "x": 2, "y": 2.1}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.1}, + {"matrix": [2, 5], "x": 5, "y": 2.2}, + {"matrix": [6, 5], "x": 9, "y": 2.2}, + {"matrix": [6, 4], "x": 10, "y": 2.1}, + {"matrix": [6, 3], "x": 11, "y": 2}, + {"matrix": [6, 2], "x": 12, "y": 2.1}, + {"matrix": [6, 1], "x": 13, "y": 2.3}, + {"matrix": [6, 0], "x": 14, "y": 2.3}, + {"matrix": [3, 3], "x": 4, "y": 3.7}, + {"matrix": [3, 4], "x": 5, "y": 3.7}, + {"matrix": [3, 5], "x": 6, "y": 3.2}, + {"matrix": [7, 5], "x": 8, "y": 3.2}, + {"matrix": [7, 4], "x": 9, "y": 3.7}, + {"matrix": [7, 3], "x": 10, "y": 3.7} + ] + } + }, + "ws2812": { + "driver": "vendor", + "pin": "GP0" + }, + "rgb_matrix": { + "driver": "ws2812", + "sleep": true, + "split_count": [21, 21], + "animations": { + "alphas_mods": true, + "band_pinwheel_sat": true, + "band_pinwheel_val": true, + "band_sat": true, + "band_spiral_sat": true, + "band_spiral_val": true, + "band_val": true, + "breathing": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "cycle_up_down": true, + "digital_rain": true, + "dual_beacon": true, + "gradient_left_right": true, + "gradient_up_down": true, + "hue_breathing": true, + "hue_pendulum": true, + "hue_wave": true, + "jellybean_raindrops": true, + "multisplash": true, + "pixel_flow": true, + "pixel_fractal": true, + "pixel_rain": true, + "rainbow_beacon": true, + "rainbow_moving_chevron": true, + "rainbow_pinwheels": true, + "raindrops": true, + "solid_multisplash": true, + "solid_reactive": true, + "solid_reactive_cross": true, + "solid_reactive_multicross": true, + "solid_reactive_multinexus": true, + "solid_reactive_multiwide": true, + "solid_reactive_nexus": true, + "solid_reactive_simple": true, + "solid_reactive_wide": true, + "solid_splash": true, + "splash": true, + "typing_heatmap": true + }, + "layout": [ + {"matrix": [3, 5], "x": 95, "y": 63, "flags": 1}, + {"matrix": [2, 5], "x": 85, "y": 39, "flags": 4}, + {"matrix": [1, 5], "x": 85, "y": 21, "flags": 4}, + {"matrix": [0, 5], "x": 85, "y": 4, "flags": 4}, + {"matrix": [0, 4], "x": 68, "y": 2, "flags": 4}, + {"matrix": [1, 4], "x": 68, "y": 19, "flags": 4}, + {"matrix": [2, 4], "x": 68, "y": 37, "flags": 4}, + {"matrix": [3, 4], "x": 80, "y": 58, "flags": 1}, + {"matrix": [3, 3], "x": 60, "y": 55, "flags": 1}, + {"matrix": [2, 3], "x": 50, "y": 35, "flags": 4}, + {"matrix": [1, 3], "x": 50, "y": 13, "flags": 4}, + {"matrix": [0, 3], "x": 50, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 33, "y": 3, "flags": 4}, + {"matrix": [1, 2], "x": 33, "y": 20, "flags": 4}, + {"matrix": [2, 2], "x": 33, "y": 37, "flags": 4}, + {"matrix": [2, 1], "x": 16, "y": 42, "flags": 4}, + {"matrix": [1, 1], "x": 16, "y": 24, "flags": 4}, + {"matrix": [0, 1], "x": 16, "y": 7, "flags": 4}, + {"matrix": [0, 0], "x": 0, "y": 7, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 24, "flags": 1}, + {"matrix": [2, 0], "x": 0, "y": 41, "flags": 1}, + {"matrix": [7, 5], "x": 129, "y": 63, "flags": 1}, + {"matrix": [6, 5], "x": 139, "y": 39, "flags": 4}, + {"matrix": [5, 5], "x": 139, "y": 21, "flags": 4}, + {"matrix": [4, 5], "x": 139, "y": 4, "flags": 4}, + {"matrix": [4, 4], "x": 156, "y": 2, "flags": 4}, + {"matrix": [5, 4], "x": 156, "y": 19, "flags": 4}, + {"matrix": [6, 4], "x": 156, "y": 37, "flags": 4}, + {"matrix": [7, 4], "x": 144, "y": 58, "flags": 1}, + {"matrix": [7, 3], "x": 164, "y": 55, "flags": 1}, + {"matrix": [6, 3], "x": 174, "y": 35, "flags": 4}, + {"matrix": [5, 3], "x": 174, "y": 13, "flags": 4}, + {"matrix": [4, 3], "x": 174, "y": 0, "flags": 4}, + {"matrix": [4, 2], "x": 191, "y": 3, "flags": 4}, + {"matrix": [5, 2], "x": 191, "y": 20, "flags": 4}, + {"matrix": [6, 2], "x": 191, "y": 37, "flags": 4}, + {"matrix": [6, 1], "x": 208, "y": 42, "flags": 4}, + {"matrix": [5, 1], "x": 208, "y": 24, "flags": 4}, + {"matrix": [4, 1], "x": 208, "y": 7, "flags": 4}, + {"matrix": [4, 0], "x": 224, "y": 7, "flags": 1}, + {"matrix": [5, 0], "x": 224, "y": 24, "flags": 1}, + {"matrix": [6, 0], "x": 224, "y": 41, "flags": 1} + ] + } +} From c4e097ff79a653f36450141070a7461f019ac060 Mon Sep 17 00:00:00 2001 From: Vaarai Date: Wed, 2 Oct 2024 00:19:19 +0200 Subject: [PATCH 02/15] Update Fire keymap --- .../cornia/keymaps/fire/callback_record.c | 30 ++++++++ keyboards/cornia/keymaps/fire/keymap.c | 16 ++--- keyboards/cornia/keymaps/fire/keymap.h | 9 +++ keyboards/cornia/keymaps/fire/tap_dances.c | 70 ++++++++++++++++++- keyboards/cornia/keymaps/fire/tap_dances.h | 17 +++++ keyboards/cornia/readme.md | 2 + 6 files changed, 134 insertions(+), 10 deletions(-) diff --git a/keyboards/cornia/keymaps/fire/callback_record.c b/keyboards/cornia/keymaps/fire/callback_record.c index 43f441c9a646..6b9ea45da6e5 100644 --- a/keyboards/cornia/keymaps/fire/callback_record.c +++ b/keyboards/cornia/keymaps/fire/callback_record.c @@ -17,6 +17,7 @@ #include QMK_KEYBOARD_H #include "./keymap.h" +#include "./tap_dances.h" bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { @@ -41,5 +42,34 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { set_scrolling = record->event.pressed; return false; } + /* Accented letters */ + if (accent_state != ACCENT_NONE && record->event.pressed) + { + switch (keycode) { + case KC_A: + SEND_STRING(SS_ACCENT_A_GRAVE); + return false; + case KC_C: + SEND_STRING(SS_ACCENT_C_CEDIL); + return false; + case KC_E: + switch (accent_state) { + case ACCENT_LEFT: + SEND_STRING(SS_ACCENT_E_ACUTE); break; + case ACCENT_RIGHT: + SEND_STRING(SS_ACCENT_E_GRAVE); break; + case ACCENT_NONE: + break; + } + return false; + case KC_O: + SEND_STRING(SS_ACCENT_O_CIRCU); + return false; + case KC_U: + SEND_STRING(SS_ACCENT_U_GRAVE); + return false; + } + accent_state = ACCENT_NONE; + } return true; } diff --git a/keyboards/cornia/keymaps/fire/keymap.c b/keyboards/cornia/keymaps/fire/keymap.c index f102ac19a7d4..76d912682ee5 100644 --- a/keyboards/cornia/keymaps/fire/keymap.c +++ b/keyboards/cornia/keymaps/fire/keymap.c @@ -24,21 +24,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| KC_ESC, KC_P, KC_L, KC_D, KC_G, KC_V, KC_Q, KC_F, KC_O, KC_U, KC_COMM, KC_BSPC, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_TAB, KC_N, KC_R, KC_T, KC_S, KC_Y, KC_J, KC_H, KC_A, KC_E, KC_I, KC_RALT, + KC_TAB, KC_N, KC_R, KC_T, KC_S, KC_Y, KC_J, KC_H, KC_A, KC_E, KC_I, KC_LALT, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| KC_LCTL, KC_X, KC_K, KC_C, KC_W, KC_Z, KC_B, KC_M, KC_QUOT, KC_SCLN, KC_DOT, KC_RCTL, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - TD(TD_SFT_CAPSW), MO(_NAV), KC_SPC, KC_ENT, MO(_NUM), TD(TD_SFT_CAPSW) + TD(TD_SFT_CAPSW), TD(TD_NAV_ACCENT), KC_SPC, KC_ENT, TD(TD_NUM_ACCENT), TD(TD_SFT_CAPSW) //`--------------------------' `--------------------------' ), [_NAV] = LAYOUT_split_3x6_3( //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, XXXXXXX, XXXXXXX, CK_SCRL, C(KC_A), XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, + _______, G(KC_L), XXXXXXX, CK_SCRL, C(KC_A), XXXXXXX, KC_BTN1, KC_BTN2, KC_BTN3, XXXXXXX, XXXXXXX, KC_DEL, //|--------+--------+ GUI V +--------+--------+--------| |--------+--------+--------+--------+--------+--------| _______, C(KC_X), G(KC_V), C(KC_V), C(KC_C), C(KC_Z), KC_WH_U, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, _______, //|ALT LEFT+--------+ ALT SFT+scrnshot+--------+--------| |--------+--------+--------+--------+--------+--------| - A(KC_LEFT),C(KC_S),S(KC_LALT), CK_SSHT,C(KC_F), C(KC_Y), KC_WH_D, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, + A(KC_LEFT),C(KC_S),S(KC_LALT), CK_SSHT,C(KC_F), C(KC_Y), KC_WH_D, KC_HOME, CK_SELL, CK_SELR, KC_END, _______, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| KC_LGUI, _______, _______, _______,MO(_ADJUST),_______ //`--------------------------' `--------------------------' @@ -84,13 +84,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Warframe */ [_G1] = LAYOUT_split_3x6_3( //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_ESC, KC_TAB, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_TAB, KC_ESC, KC_Q, KC_W, KC_1, KC_2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - XXXXXXX, KC_LSFT, KC_A, KC_W, KC_D, KC_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F, KC_LSFT, KC_A, KC_S, KC_D, KC_3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LGUI, KC_LCTL, XXXXXXX, KC_S, KC_X, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LGUI, KC_LCTL, KC_Z, KC_C, KC_X, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - CK_RKJMP, KC_SPC, XXXXXXX, XXXXXXX, TG(_G1), XXXXXXX + KC_SPC,CK_RKJMP, KC_5, XXXXXXX, TG(_G1), XXXXXXX //`--------------------------' `--------------------------' ), }; \ No newline at end of file diff --git a/keyboards/cornia/keymaps/fire/keymap.h b/keyboards/cornia/keymaps/fire/keymap.h index c9224b07620d..225d2b2fd84e 100644 --- a/keyboards/cornia/keymaps/fire/keymap.h +++ b/keyboards/cornia/keymaps/fire/keymap.h @@ -39,6 +39,8 @@ enum layers { #define CK_QMRK LSFT(KC_SLSH) #define CK_SSHT LSG(KC_S) #define CK_UNSC LSFT(KC_MINS) +#define CK_SELL LSFT(LCTL(KC_LEFT)) +#define CK_SELR LSFT(LCTL(KC_RIGHT)) typedef enum { CK_RKJMP = SAFE_RANGE, /* Warframe rocket/bullet jump */ @@ -46,3 +48,10 @@ typedef enum { CK_DPID, CK_SCRL, } cornia_custom_keycodes_t; + +#define SS_ACCENT_A_GRAVE SS_DOWN(X_LALT) SS_TAP(X_P1) SS_TAP(X_P3) SS_TAP(X_P3) SS_UP(X_LALT) /* à */ +#define SS_ACCENT_C_CEDIL SS_DOWN(X_LALT) SS_TAP(X_P1) SS_TAP(X_P3) SS_TAP(X_P5) SS_UP(X_LALT) /* ç */ +#define SS_ACCENT_E_ACUTE SS_DOWN(X_LALT) SS_TAP(X_P1) SS_TAP(X_P3) SS_TAP(X_P0) SS_UP(X_LALT) /* é */ +#define SS_ACCENT_E_GRAVE SS_DOWN(X_LALT) SS_TAP(X_P1) SS_TAP(X_P3) SS_TAP(X_P8) SS_UP(X_LALT) /* è */ +#define SS_ACCENT_O_CIRCU SS_DOWN(X_LALT) SS_TAP(X_P1) SS_TAP(X_P4) SS_TAP(X_P7) SS_UP(X_LALT) /* ô */ +#define SS_ACCENT_U_GRAVE SS_DOWN(X_LALT) SS_TAP(X_P0) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P9) SS_UP(X_LALT) /* ù */ diff --git a/keyboards/cornia/keymaps/fire/tap_dances.c b/keyboards/cornia/keymaps/fire/tap_dances.c index 7713cdceae32..63f991154978 100644 --- a/keyboards/cornia/keymaps/fire/tap_dances.c +++ b/keyboards/cornia/keymaps/fire/tap_dances.c @@ -17,6 +17,7 @@ #include QMK_KEYBOARD_H #include "./tap_dances.h" +#include "./keymap.h" /* define a type containing as many tapdance states as you need */ typedef enum { @@ -29,15 +30,18 @@ typedef enum { /* Create a global instance of the tapdance state type */ static td_state_t td_state; +accent_state_t accent_state = ACCENT_NONE; tap_dance_action_t tap_dance_actions[TAP_DANCE_ACTIONS_COUNT] = { - [TD_SFT_CAPSW] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_shift_capsword_finished, dance_shift_capsword_reset) + [TD_SFT_CAPSW] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_shift_capsword_finished, dance_shift_capsword_reset), + [TD_NAV_ACCENT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_nav_accent_finished, dance_nav_accent_reset), + [TD_NUM_ACCENT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_num_accent_finished, dance_num_accent_reset) }; int cur_dance (tap_dance_state_t *state) { if (state->count == 1) { if (state->interrupted || !state->pressed) - { + { return SINGLE_TAP; } else { return SINGLE_HOLD; @@ -85,4 +89,66 @@ void dance_shift_capsword_reset (tap_dance_state_t *state, void *user_data) case OTHER_TAP: break; } +} + +void dance_nav_accent_finished (tap_dance_state_t *state, void *user_data) +{ + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + case SINGLE_HOLD: + layer_on(_NAV); + break; + case DOUBLE_TAP: + case DOUBLE_HOLD: + accent_state = ACCENT_LEFT; + break; + case OTHER_TAP: + break; + } +} + +void dance_nav_accent_reset (tap_dance_state_t *state, void *user_data) +{ + switch (td_state) { + case SINGLE_TAP: + case SINGLE_HOLD: + layer_off(_NAV); + break; + case DOUBLE_TAP: + case DOUBLE_HOLD: + case OTHER_TAP: + break; + } +} + +void dance_num_accent_finished (tap_dance_state_t *state, void *user_data) +{ + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + case SINGLE_HOLD: + layer_on(_NUM); + break; + case DOUBLE_TAP: + case DOUBLE_HOLD: + accent_state = ACCENT_RIGHT; + break; + case OTHER_TAP: + break; + } +} + +void dance_num_accent_reset (tap_dance_state_t *state, void *user_data) +{ + switch (td_state) { + case SINGLE_TAP: + case SINGLE_HOLD: + layer_off(_NUM); + break; + case DOUBLE_TAP: + case DOUBLE_HOLD: + case OTHER_TAP: + break; + } } \ No newline at end of file diff --git a/keyboards/cornia/keymaps/fire/tap_dances.h b/keyboards/cornia/keymaps/fire/tap_dances.h index ae38f8522aca..082e81f3ce04 100644 --- a/keyboards/cornia/keymaps/fire/tap_dances.h +++ b/keyboards/cornia/keymaps/fire/tap_dances.h @@ -21,10 +21,27 @@ /* Tap dances definitions */ enum tap_dances { TD_SFT_CAPSW, + TD_NAV_ACCENT, + TD_NUM_ACCENT, TAP_DANCE_ACTIONS_COUNT /* Utility to get TD_xxx count */ }; +/* Accented letters */ +typedef enum { + ACCENT_NONE, + ACCENT_LEFT, + ACCENT_RIGHT +} accent_state_t; + +extern accent_state_t accent_state; + extern tap_dance_action_t tap_dance_actions[TAP_DANCE_ACTIONS_COUNT]; void dance_shift_capsword_finished (tap_dance_state_t *state, void *user_data); void dance_shift_capsword_reset (tap_dance_state_t *state, void *user_data); + +void dance_nav_accent_finished (tap_dance_state_t *state, void *user_data); +void dance_nav_accent_reset (tap_dance_state_t *state, void *user_data); + +void dance_num_accent_finished (tap_dance_state_t *state, void *user_data); +void dance_num_accent_reset (tap_dance_state_t *state, void *user_data); diff --git a/keyboards/cornia/readme.md b/keyboards/cornia/readme.md index fd35d071c964..772fdd66a972 100644 --- a/keyboards/cornia/readme.md +++ b/keyboards/cornia/readme.md @@ -5,7 +5,9 @@ A split keyboard with 3x6 column strongly staggered keys and 3 thumb keys Keyboard Maintainer: [Vaarai](https://github.com/Vaarai) + Hardware Supported: Cornia PCB, RP2040 / 0xCB-Helios + Hardware Availability: [PCB Data](https://github.com/Vaarai/Cornia) Make example for this keyboard (after setting up your build environment): From 1bb83c374d73c32bf42efde7b80fccba50af3918 Mon Sep 17 00:00:00 2001 From: Vaarai Date: Wed, 2 Oct 2024 21:09:14 +0200 Subject: [PATCH 03/15] [Cornia/Doc] Host image on imgur --- keyboards/cornia/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/cornia/readme.md b/keyboards/cornia/readme.md index 772fdd66a972..2cf7c8fde806 100644 --- a/keyboards/cornia/readme.md +++ b/keyboards/cornia/readme.md @@ -1,6 +1,6 @@ # Cornia Keyboard -![Cornia v1](https://raw.githubusercontent.com/Vaarai/Cornia/refs/heads/main/images/Cornia_v1.jpg) +![Cornia v1](https://imgur.com/3vRlvi3) A split keyboard with 3x6 column strongly staggered keys and 3 thumb keys From 018021058afd37d6f6eccbb654d35eadf6e4a192 Mon Sep 17 00:00:00 2001 From: Vaarai Date: Wed, 2 Oct 2024 21:10:37 +0200 Subject: [PATCH 04/15] [Cornia/config] Remove unnecessary defines --- keyboards/cornia/keymaps/fire/config.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/keyboards/cornia/keymaps/fire/config.h b/keyboards/cornia/keymaps/fire/config.h index 938775745eda..24cb4fade603 100644 --- a/keyboards/cornia/keymaps/fire/config.h +++ b/keyboards/cornia/keymaps/fire/config.h @@ -27,9 +27,6 @@ #define SPLIT_LED_STATE_ENABLE #define SPLIT_MODS_ENABLE -/* OLED */ -#define OLED_TIMEOUT 60000 - /* Trackpad */ #define SPLIT_POINTING_ENABLE #define POINTING_DEVICE_RIGHT @@ -39,6 +36,3 @@ #define CIRQUE_PINNACLE_CURVED_OVERLAY #define CIRQUE_PINNACLE_POSITION_MODE CIRQUE_PINNACLE_RELATIVE_MODE #define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X - -/* Tap dance */ -#define TAPPING_TERM 200 \ No newline at end of file From 71b58e22eebff674e03145bc2c0f9dabe68157c2 Mon Sep 17 00:00:00 2001 From: Vaarai Date: Wed, 2 Oct 2024 21:12:29 +0200 Subject: [PATCH 05/15] [Cornia] Move I2C stuff to keyboard level --- .../fire/oled_routines.h => cornia.c} | 14 +++-- keyboards/cornia/cornia.h | 21 +++++++ keyboards/cornia/keymaps/fire/callback_oled.c | 29 +++++++-- .../cornia/keymaps/fire/callback_system.c | 10 +++- keyboards/cornia/keymaps/fire/config.h | 5 -- keyboards/cornia/keymaps/fire/oled_routines.c | 59 ------------------- keyboards/cornia/keymaps/fire/rules.mk | 4 -- keyboards/cornia/v0_6/config.h | 5 ++ .../cornia/{keymaps/fire => v0_6}/mcuconf.h | 0 keyboards/cornia/v0_6/rules.mk | 17 ++++++ keyboards/cornia/v1/config.h | 5 ++ keyboards/cornia/v1/mcuconf.h | 25 ++++++++ keyboards/cornia/v1/rules.mk | 17 ++++++ 13 files changed, 131 insertions(+), 80 deletions(-) rename keyboards/cornia/{keymaps/fire/oled_routines.h => cornia.c} (89%) create mode 100644 keyboards/cornia/cornia.h delete mode 100644 keyboards/cornia/keymaps/fire/oled_routines.c rename keyboards/cornia/{keymaps/fire => v0_6}/mcuconf.h (100%) create mode 100644 keyboards/cornia/v0_6/rules.mk create mode 100644 keyboards/cornia/v1/mcuconf.h create mode 100644 keyboards/cornia/v1/rules.mk diff --git a/keyboards/cornia/keymaps/fire/oled_routines.h b/keyboards/cornia/cornia.c similarity index 89% rename from keyboards/cornia/keymaps/fire/oled_routines.h rename to keyboards/cornia/cornia.c index 1180a000adf0..3d8d90cf2927 100644 --- a/keyboards/cornia/keymaps/fire/oled_routines.h +++ b/keyboards/cornia/cornia.c @@ -14,10 +14,9 @@ * along with this program. If not, see . */ -#pragma once - #include QMK_KEYBOARD_H -#include "./keymap.h" + +#include "./cornia.h" // 'Cornia', 32x32px #define OLED_LOGO_CORNIA {\ @@ -31,6 +30,9 @@ 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x00 \ } -void render_logo(void); -void render_layer_status(void); -void render_boot(bool bootloader); +void cornia_render_logo(void) { +#ifdef OLED_ENABLE + static const char PROGMEM logo[] = OLED_LOGO_CORNIA; + oled_write_raw_P(logo, sizeof(logo)); +#endif +} diff --git a/keyboards/cornia/cornia.h b/keyboards/cornia/cornia.h new file mode 100644 index 000000000000..264ddd63930f --- /dev/null +++ b/keyboards/cornia/cornia.h @@ -0,0 +1,21 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include QMK_KEYBOARD_H + +void cornia_render_logo(void); diff --git a/keyboards/cornia/keymaps/fire/callback_oled.c b/keyboards/cornia/keymaps/fire/callback_oled.c index b8f292ea70d8..2c3422477b37 100644 --- a/keyboards/cornia/keymaps/fire/callback_oled.c +++ b/keyboards/cornia/keymaps/fire/callback_oled.c @@ -17,16 +17,37 @@ #include QMK_KEYBOARD_H #include "./keymap.h" -#include "./oled_routines.h" +#include "./cornia.h" oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } bool oled_task_user(void) { - oled_set_cursor(0, 0); - render_logo(); + /* Print cornia logo */ + cornia_render_logo(); + + /* Print layer status */ oled_set_cursor(0, 7); - render_layer_status(); + switch (get_highest_layer(layer_state)) { + case _ALPHA: + oled_write_ln("ALPHA", 0); + break; + case _NAV: + oled_write_ln("NAV", 0); + break; + case _NUM: + oled_write_ln("NUM", 0); + break; + case _ADJUST: + oled_write_ln("ADJUS", 0); + break; + case _G0: + oled_write_ln("GAME0", 0); + break; + case _G1: + oled_write_ln("GAME1", 0); + break; + } return false; } diff --git a/keyboards/cornia/keymaps/fire/callback_system.c b/keyboards/cornia/keymaps/fire/callback_system.c index 018e74f5d7dd..16f1980856f5 100644 --- a/keyboards/cornia/keymaps/fire/callback_system.c +++ b/keyboards/cornia/keymaps/fire/callback_system.c @@ -17,9 +17,15 @@ #include QMK_KEYBOARD_H #include "./keymap.h" -#include "./oled_routines.h" bool shutdown_user(bool jump_to_bootloader) { - render_boot(jump_to_bootloader); + oled_clear(); + oled_set_cursor(0, 2); + if (jump_to_bootloader) { + oled_write_P(PSTR("FLASH"), false); + } else { + oled_write_P(PSTR("RESET"), false); + } + oled_render_dirty(true); return false; } diff --git a/keyboards/cornia/keymaps/fire/config.h b/keyboards/cornia/keymaps/fire/config.h index 24cb4fade603..a40a881bf5be 100644 --- a/keyboards/cornia/keymaps/fire/config.h +++ b/keyboards/cornia/keymaps/fire/config.h @@ -16,11 +16,6 @@ #pragma once -/* I²C config */ -#define I2C_DRIVER I2CD1 -#define I2C1_SDA_PIN GP10 -#define I2C1_SCL_PIN GP11 - /* Split */ #define SPLIT_ACTIVITY_ENABLE #define SPLIT_LAYER_STATE_ENABLE diff --git a/keyboards/cornia/keymaps/fire/oled_routines.c b/keyboards/cornia/keymaps/fire/oled_routines.c deleted file mode 100644 index cb8fea96d6a0..000000000000 --- a/keyboards/cornia/keymaps/fire/oled_routines.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright 2024 Vaarai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -#include "./keymap.h" -#include "./oled_routines.h" - -void render_logo(void) { - static const char PROGMEM logo[] = OLED_LOGO_CORNIA; - oled_write_raw_P(logo, sizeof(logo)); -} - -void render_layer_status(void) { - switch (get_highest_layer(layer_state)) { - case _ALPHA: - oled_write_ln("ALPHA", 0); - break; - case _NAV: - oled_write_ln("NAV", 0); - break; - case _NUM: - oled_write_ln("NUM", 0); - break; - case _ADJUST: - oled_write_ln("ADJUS", 0); - break; - case _G0: - oled_write_ln("GAME0", 0); - break; - case _G1: - oled_write_ln("GAME1", 0); - break; - } -} - -void render_boot(bool bootloader) { - oled_clear(); - oled_set_cursor(0, 2); - if (bootloader) { - oled_write_P(PSTR("FLASH"), false); - } else { - oled_write_P(PSTR("RESET"), false); - } - oled_render_dirty(true); -} diff --git a/keyboards/cornia/keymaps/fire/rules.mk b/keyboards/cornia/keymaps/fire/rules.mk index dedd42c4487c..6253f6673d0b 100644 --- a/keyboards/cornia/keymaps/fire/rules.mk +++ b/keyboards/cornia/keymaps/fire/rules.mk @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -SRC += oled_routines.c SRC += callback_oled.c SRC += callback_pointing_device.c SRC += callback_record.c @@ -32,6 +31,3 @@ OLED_TRANSPORT = i2c # Cirque Trackpad I²C configuration POINTING_DEVICE_ENABLE = yes POINTING_DEVICE_DRIVER = cirque_pinnacle_i2c - -# Add I²C HAL dependencies -OPT_DEFS += -DHAL_USE_I2C=TRUE diff --git a/keyboards/cornia/v0_6/config.h b/keyboards/cornia/v0_6/config.h index ab72146bd6c1..4e2ac9ddab86 100644 --- a/keyboards/cornia/v0_6/config.h +++ b/keyboards/cornia/v0_6/config.h @@ -21,5 +21,10 @@ #define MASTER_RIGHT // #define EE_HANDS +/* I²C config */ +#define I2C_DRIVER I2CD1 +#define I2C1_SDA_PIN GP10 +#define I2C1_SCL_PIN GP11 + #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur. diff --git a/keyboards/cornia/keymaps/fire/mcuconf.h b/keyboards/cornia/v0_6/mcuconf.h similarity index 100% rename from keyboards/cornia/keymaps/fire/mcuconf.h rename to keyboards/cornia/v0_6/mcuconf.h diff --git a/keyboards/cornia/v0_6/rules.mk b/keyboards/cornia/v0_6/rules.mk new file mode 100644 index 000000000000..0a8e43f4efad --- /dev/null +++ b/keyboards/cornia/v0_6/rules.mk @@ -0,0 +1,17 @@ +# Copyright 2024 Vaarai +# +# 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 . + +# Add I²C HAL dependencies +OPT_DEFS += -DHAL_USE_I2C=TRUE diff --git a/keyboards/cornia/v1/config.h b/keyboards/cornia/v1/config.h index 52086ac2eb20..5fbfae2e26a5 100644 --- a/keyboards/cornia/v1/config.h +++ b/keyboards/cornia/v1/config.h @@ -16,5 +16,10 @@ #pragma once +/* I²C config */ +#define I2C_DRIVER I2CD1 +#define I2C1_SDA_PIN GP10 +#define I2C1_SCL_PIN GP11 + #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur. diff --git a/keyboards/cornia/v1/mcuconf.h b/keyboards/cornia/v1/mcuconf.h new file mode 100644 index 000000000000..a1bfd10d0ffd --- /dev/null +++ b/keyboards/cornia/v1/mcuconf.h @@ -0,0 +1,25 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 FALSE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/cornia/v1/rules.mk b/keyboards/cornia/v1/rules.mk new file mode 100644 index 000000000000..0a8e43f4efad --- /dev/null +++ b/keyboards/cornia/v1/rules.mk @@ -0,0 +1,17 @@ +# Copyright 2024 Vaarai +# +# 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 . + +# Add I²C HAL dependencies +OPT_DEFS += -DHAL_USE_I2C=TRUE From 5849acceaef04ed04c55a1fead904a7c9b5704cb Mon Sep 17 00:00:00 2001 From: Vaarai Date: Wed, 16 Oct 2024 00:54:57 +0200 Subject: [PATCH 06/15] [Cornia/config] Remove unnecessary defines & move all callbacks to keymap.c --- keyboards/cornia/cornia.c | 10 +- keyboards/cornia/cornia.h | 2 +- keyboards/cornia/keymaps/fire/callback_oled.c | 53 ------- .../keymaps/fire/callback_pointing_device.c | 51 ------- .../cornia/keymaps/fire/callback_record.c | 75 ---------- .../cornia/keymaps/fire/callback_system.c | 31 ---- keyboards/cornia/keymaps/fire/keymap.c | 134 +++++++++++++++++- keyboards/cornia/keymaps/fire/keymap.h | 4 + keyboards/cornia/keymaps/fire/rules.mk | 9 -- keyboards/cornia/v0_6/rules.mk | 17 --- keyboards/cornia/v1/keyboard.json | 1 + keyboards/cornia/v1/rules.mk | 17 --- 12 files changed, 146 insertions(+), 258 deletions(-) delete mode 100644 keyboards/cornia/keymaps/fire/callback_oled.c delete mode 100644 keyboards/cornia/keymaps/fire/callback_pointing_device.c delete mode 100644 keyboards/cornia/keymaps/fire/callback_record.c delete mode 100644 keyboards/cornia/keymaps/fire/callback_system.c delete mode 100644 keyboards/cornia/v0_6/rules.mk delete mode 100644 keyboards/cornia/v1/rules.mk diff --git a/keyboards/cornia/cornia.c b/keyboards/cornia/cornia.c index 3d8d90cf2927..aaa30fc0484a 100644 --- a/keyboards/cornia/cornia.c +++ b/keyboards/cornia/cornia.c @@ -16,8 +16,6 @@ #include QMK_KEYBOARD_H -#include "./cornia.h" - // 'Cornia', 32x32px #define OLED_LOGO_CORNIA {\ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, \ @@ -36,3 +34,11 @@ void cornia_render_logo(void) { oled_write_raw_P(logo, sizeof(logo)); #endif } + +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + cornia_render_logo(); + return true; +} diff --git a/keyboards/cornia/cornia.h b/keyboards/cornia/cornia.h index 264ddd63930f..2cee8d4a685f 100644 --- a/keyboards/cornia/cornia.h +++ b/keyboards/cornia/cornia.h @@ -16,6 +16,6 @@ #pragma once -#include QMK_KEYBOARD_H +#include "quantum.h" void cornia_render_logo(void); diff --git a/keyboards/cornia/keymaps/fire/callback_oled.c b/keyboards/cornia/keymaps/fire/callback_oled.c deleted file mode 100644 index 2c3422477b37..000000000000 --- a/keyboards/cornia/keymaps/fire/callback_oled.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright 2024 Vaarai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -#include "./keymap.h" -#include "./cornia.h" - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_270; -} - -bool oled_task_user(void) { - /* Print cornia logo */ - cornia_render_logo(); - - /* Print layer status */ - oled_set_cursor(0, 7); - switch (get_highest_layer(layer_state)) { - case _ALPHA: - oled_write_ln("ALPHA", 0); - break; - case _NAV: - oled_write_ln("NAV", 0); - break; - case _NUM: - oled_write_ln("NUM", 0); - break; - case _ADJUST: - oled_write_ln("ADJUS", 0); - break; - case _G0: - oled_write_ln("GAME0", 0); - break; - case _G1: - oled_write_ln("GAME1", 0); - break; - } - return false; -} diff --git a/keyboards/cornia/keymaps/fire/callback_pointing_device.c b/keyboards/cornia/keymaps/fire/callback_pointing_device.c deleted file mode 100644 index 5aa7392925af..000000000000 --- a/keyboards/cornia/keymaps/fire/callback_pointing_device.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2024 Vaarai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -#include "./keymap.h" - -/* Trackpad srolling speed adjustment */ -#define SCROLL_DIVISOR_H 8.0 -#define SCROLL_DIVISOR_V 8.0 - -bool set_scrolling = false; - -/* Variables to store accumulated scroll values */ -float scroll_accumulated_h = 0; -float scroll_accumulated_v = 0; - -report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { - /* Check if drag scrolling is active */ - if (set_scrolling) { - /* Calculate and accumulate scroll values based on mouse movement and divisors */ - scroll_accumulated_h += (float)mouse_report.x / SCROLL_DIVISOR_H; - scroll_accumulated_v += (float)mouse_report.y / SCROLL_DIVISOR_V; - - /* Assign integer parts of accumulated scroll values to the mouse report */ - mouse_report.h = (int8_t)scroll_accumulated_h; - mouse_report.v = (int8_t)scroll_accumulated_v; - - /* Update accumulated scroll values by subtracting the integer parts */ - scroll_accumulated_h -= (int8_t)scroll_accumulated_h; - scroll_accumulated_v -= (int8_t)scroll_accumulated_v; - - /* Clear the X and Y values of the mouse report */ - mouse_report.x = 0; - mouse_report.y = 0; - } - return mouse_report; -} diff --git a/keyboards/cornia/keymaps/fire/callback_record.c b/keyboards/cornia/keymaps/fire/callback_record.c deleted file mode 100644 index 6b9ea45da6e5..000000000000 --- a/keyboards/cornia/keymaps/fire/callback_record.c +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright 2024 Vaarai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -#include "./keymap.h" -#include "./tap_dances.h" - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case CK_RKJMP: /* Warframe rocket jump */ - if (record->event.pressed) { - SEND_STRING(SS_DOWN(X_C)); - } else { - SEND_STRING(SS_DOWN(X_SPC) SS_DELAY(50) SS_UP(X_C) SS_DELAY(50) SS_UP(X_SPC)); - } - return false; - case CK_DPII: /* Increase trackpad DPI */ - if (record->event.pressed) { - pointing_device_set_cpi(pointing_device_get_cpi()+100); - } - return false; - case CK_DPID: /* Decrease trackpad DPI */ - if (record->event.pressed) { - pointing_device_set_cpi(pointing_device_get_cpi()-100); - } - return false; - case CK_SCRL: /* Toggle set_scrolling when CK_SCRL key is pressed or released */ - set_scrolling = record->event.pressed; - return false; - } - /* Accented letters */ - if (accent_state != ACCENT_NONE && record->event.pressed) - { - switch (keycode) { - case KC_A: - SEND_STRING(SS_ACCENT_A_GRAVE); - return false; - case KC_C: - SEND_STRING(SS_ACCENT_C_CEDIL); - return false; - case KC_E: - switch (accent_state) { - case ACCENT_LEFT: - SEND_STRING(SS_ACCENT_E_ACUTE); break; - case ACCENT_RIGHT: - SEND_STRING(SS_ACCENT_E_GRAVE); break; - case ACCENT_NONE: - break; - } - return false; - case KC_O: - SEND_STRING(SS_ACCENT_O_CIRCU); - return false; - case KC_U: - SEND_STRING(SS_ACCENT_U_GRAVE); - return false; - } - accent_state = ACCENT_NONE; - } - return true; -} diff --git a/keyboards/cornia/keymaps/fire/callback_system.c b/keyboards/cornia/keymaps/fire/callback_system.c deleted file mode 100644 index 16f1980856f5..000000000000 --- a/keyboards/cornia/keymaps/fire/callback_system.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2024 Vaarai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -#include "./keymap.h" - -bool shutdown_user(bool jump_to_bootloader) { - oled_clear(); - oled_set_cursor(0, 2); - if (jump_to_bootloader) { - oled_write_P(PSTR("FLASH"), false); - } else { - oled_write_P(PSTR("RESET"), false); - } - oled_render_dirty(true); - return false; -} diff --git a/keyboards/cornia/keymaps/fire/keymap.c b/keyboards/cornia/keymaps/fire/keymap.c index 76d912682ee5..da7c58a47ad5 100644 --- a/keyboards/cornia/keymaps/fire/keymap.c +++ b/keyboards/cornia/keymaps/fire/keymap.c @@ -19,6 +19,13 @@ #include "./keymap.h" #include "./tap_dances.h" +/* Flag to enable/disable trackpad scroll */ +bool set_scrolling = false; + +/* Variables to store accumulated scroll values */ +float scroll_accumulated_h = 0; +float scroll_accumulated_v = 0; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ALPHA] = LAYOUT_split_3x6_3( /* Fire (Oxey) : https://bit.ly/layout-doc-v2 */ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| @@ -88,9 +95,132 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| KC_F, KC_LSFT, KC_A, KC_S, KC_D, KC_3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LGUI, KC_LCTL, KC_Z, KC_C, KC_X, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LGUI, KC_LCTL, KC_M, KC_Y, KC_X, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| KC_SPC,CK_RKJMP, KC_5, XXXXXXX, TG(_G1), XXXXXXX //`--------------------------' `--------------------------' ), -}; \ No newline at end of file +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case CK_RKJMP: /* Warframe rocket jump */ + if (record->event.pressed) { + SEND_STRING(SS_DOWN(X_C)); + } else { + SEND_STRING(SS_DOWN(X_SPC) SS_DELAY(50) SS_UP(X_C) SS_DELAY(50) SS_UP(X_SPC)); + } + return false; + case CK_DPII: /* Increase trackpad DPI */ + if (record->event.pressed) { + pointing_device_set_cpi(pointing_device_get_cpi()+100); + } + return false; + case CK_DPID: /* Decrease trackpad DPI */ + if (record->event.pressed) { + pointing_device_set_cpi(pointing_device_get_cpi()-100); + } + return false; + case CK_SCRL: /* Toggle set_scrolling when CK_SCRL key is pressed or released */ + set_scrolling = record->event.pressed; + return false; + } + /* Accented letters */ + if (accent_state != ACCENT_NONE && record->event.pressed) + { + switch (keycode) { + case KC_A: + SEND_STRING(SS_ACCENT_A_GRAVE); + break; + case KC_C: + SEND_STRING(SS_ACCENT_C_CEDIL); + break; + case KC_E: + switch (accent_state) { + case ACCENT_LEFT: + SEND_STRING(SS_ACCENT_E_ACUTE); break; + case ACCENT_RIGHT: + SEND_STRING(SS_ACCENT_E_GRAVE); break; + case ACCENT_NONE: + break; + } + break; + case KC_O: + SEND_STRING(SS_ACCENT_O_CIRCU); + break; + case KC_U: + SEND_STRING(SS_ACCENT_U_GRAVE); + break; + } + accent_state = ACCENT_NONE; + return false; + } + return true; +} + +bool shutdown_user(bool jump_to_bootloader) { + oled_clear(); + oled_set_cursor(0, 2); + if (jump_to_bootloader) { + oled_write_P(PSTR("FLASH"), false); + } else { + oled_write_P(PSTR("RESET"), false); + } + oled_render_dirty(true); + return false; +} + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_270; +} + +bool oled_task_user(void) { + /* Print cornia logo */ + cornia_render_logo(); + + /* Print layer status */ + oled_set_cursor(0, 7); + switch (get_highest_layer(layer_state)) { + case _ALPHA: + oled_write_ln("ALPHA", 0); + break; + case _NAV: + oled_write_ln("NAV", 0); + break; + case _NUM: + oled_write_ln("NUM", 0); + break; + case _ADJUST: + oled_write_ln("ADJUS", 0); + break; + case _G0: + oled_write_ln("GAME0", 0); + break; + case _G1: + oled_write_ln("GAME1", 0); + break; + } + return false; +} + +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + /* Check if drag scrolling is active */ + if (set_scrolling) { + /* Calculate and accumulate scroll values based on mouse movement and divisors */ + scroll_accumulated_h += (float)mouse_report.x / SCROLL_DIVISOR_H; + scroll_accumulated_v += (float)mouse_report.y / SCROLL_DIVISOR_V; + + /* Assign integer parts of accumulated scroll values to the mouse report */ + mouse_report.h = (int8_t)scroll_accumulated_h; + mouse_report.v = (int8_t)scroll_accumulated_v; + + /* Update accumulated scroll values by subtracting the integer parts */ + scroll_accumulated_h -= (int8_t)scroll_accumulated_h; + scroll_accumulated_v -= (int8_t)scroll_accumulated_v; + + /* Clear the X and Y values of the mouse report */ + mouse_report.x = 0; + mouse_report.y = 0; + } + return mouse_report; +} \ No newline at end of file diff --git a/keyboards/cornia/keymaps/fire/keymap.h b/keyboards/cornia/keymaps/fire/keymap.h index 225d2b2fd84e..13f007364b95 100644 --- a/keyboards/cornia/keymaps/fire/keymap.h +++ b/keyboards/cornia/keymaps/fire/keymap.h @@ -18,6 +18,10 @@ #include QMK_KEYBOARD_H +/* Trackpad srolling speed adjustment */ +#define SCROLL_DIVISOR_H 8.0 +#define SCROLL_DIVISOR_V 8.0 + /* Trackpad srolling enablement flag */ extern bool set_scrolling; diff --git a/keyboards/cornia/keymaps/fire/rules.mk b/keyboards/cornia/keymaps/fire/rules.mk index 6253f6673d0b..c465b97f9595 100644 --- a/keyboards/cornia/keymaps/fire/rules.mk +++ b/keyboards/cornia/keymaps/fire/rules.mk @@ -13,21 +13,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -SRC += callback_oled.c -SRC += callback_pointing_device.c -SRC += callback_record.c -SRC += callback_system.c SRC += tap_dances.c MOUSEKEY_ENABLE = yes CAPS_WORD_ENABLE = yes TAP_DANCE_ENABLE = yes -# OLED I²C configuration -OLED_ENABLE = yes -OLED_DRIVER = ssd1306 -OLED_TRANSPORT = i2c - # Cirque Trackpad I²C configuration POINTING_DEVICE_ENABLE = yes POINTING_DEVICE_DRIVER = cirque_pinnacle_i2c diff --git a/keyboards/cornia/v0_6/rules.mk b/keyboards/cornia/v0_6/rules.mk deleted file mode 100644 index 0a8e43f4efad..000000000000 --- a/keyboards/cornia/v0_6/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2024 Vaarai -# -# 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 . - -# Add I²C HAL dependencies -OPT_DEFS += -DHAL_USE_I2C=TRUE diff --git a/keyboards/cornia/v1/keyboard.json b/keyboards/cornia/v1/keyboard.json index b3c7db93e03d..8a4265e5037b 100644 --- a/keyboards/cornia/v1/keyboard.json +++ b/keyboards/cornia/v1/keyboard.json @@ -9,6 +9,7 @@ "features": { "extrakey": true, "nkro": true, + "oled": true, "rgb_matrix": true }, "split": { diff --git a/keyboards/cornia/v1/rules.mk b/keyboards/cornia/v1/rules.mk deleted file mode 100644 index 0a8e43f4efad..000000000000 --- a/keyboards/cornia/v1/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2024 Vaarai -# -# 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 . - -# Add I²C HAL dependencies -OPT_DEFS += -DHAL_USE_I2C=TRUE From 261dd0d7c1c76789612a67199ceb2138957524db Mon Sep 17 00:00:00 2001 From: Vaarai Date: Wed, 16 Oct 2024 01:05:38 +0200 Subject: [PATCH 07/15] [Cornia] Use tri-layer in default keymap --- keyboards/cornia/keymaps/default/keymap.c | 14 +++++++------- keyboards/cornia/keymaps/default/rules.mk | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 keyboards/cornia/keymaps/default/rules.mk diff --git a/keyboards/cornia/keymaps/default/keymap.c b/keyboards/cornia/keymaps/default/keymap.c index 4a92879d7e05..efb2a17be1ee 100644 --- a/keyboards/cornia/keymaps/default/keymap.c +++ b/keyboards/cornia/keymaps/default/keymap.c @@ -27,8 +27,8 @@ /* Layers definitions */ enum layers { _ALPHA, - _NAV, - _NUM, + _LOWER, + _UPPER, _ADJUST, }; @@ -41,11 +41,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTL, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LSFT,MO(_NAV), KC_SPC, KC_ENT,MO(_NUM), KC_RSFT + KC_LSFT, TL_LOWR, KC_SPC, KC_ENT, TL_UPPR, KC_RSFT //`--------------------------' `--------------------------' ), - [_NAV] = LAYOUT_split_3x6_3( + [_LOWER] = LAYOUT_split_3x6_3( //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| @@ -53,11 +53,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_RALT, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LGUI, _______, _______, _______,MO(_ADJUST),_______ + KC_LGUI, _______, _______, _______, _______, _______ //`--------------------------' `--------------------------' ), - [_NUM] = LAYOUT_split_3x6_3( + [_UPPER] = LAYOUT_split_3x6_3( //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| _______, XXXXXXX, KC_GRV, CK_QMRK, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - _______,MO(_ADJUST),_______, _______, _______, KC_RGUI + _______, _______, _______, _______, _______, KC_RGUI //`--------------------------' `--------------------------' ), diff --git a/keyboards/cornia/keymaps/default/rules.mk b/keyboards/cornia/keymaps/default/rules.mk new file mode 100644 index 000000000000..0a1e28e87077 --- /dev/null +++ b/keyboards/cornia/keymaps/default/rules.mk @@ -0,0 +1,16 @@ +# Copyright 2024 Vaarai +# +# 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 . + +TRI_LAYER_ENABLE = yes From 88c9c31c23a4fd33f85cde9e1a409b67dc9d18d6 Mon Sep 17 00:00:00 2001 From: Vaarai Date: Sat, 26 Oct 2024 09:29:49 +0200 Subject: [PATCH 08/15] [Cornia/makefiles] remove license headers & root makefile --- keyboards/cornia/keymaps/default/rules.mk | 15 --------------- keyboards/cornia/keymaps/fire/rules.mk | 15 --------------- keyboards/cornia/readme.md | 4 ++-- keyboards/cornia/rules.mk | 1 - 4 files changed, 2 insertions(+), 33 deletions(-) delete mode 100644 keyboards/cornia/rules.mk diff --git a/keyboards/cornia/keymaps/default/rules.mk b/keyboards/cornia/keymaps/default/rules.mk index 0a1e28e87077..7c9bf212a6f5 100644 --- a/keyboards/cornia/keymaps/default/rules.mk +++ b/keyboards/cornia/keymaps/default/rules.mk @@ -1,16 +1 @@ -# Copyright 2024 Vaarai -# -# 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 . - TRI_LAYER_ENABLE = yes diff --git a/keyboards/cornia/keymaps/fire/rules.mk b/keyboards/cornia/keymaps/fire/rules.mk index c465b97f9595..12a18cd21d5c 100644 --- a/keyboards/cornia/keymaps/fire/rules.mk +++ b/keyboards/cornia/keymaps/fire/rules.mk @@ -1,18 +1,3 @@ -# Copyright 2024 Vaarai -# -# 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 . - SRC += tap_dances.c MOUSEKEY_ENABLE = yes diff --git a/keyboards/cornia/readme.md b/keyboards/cornia/readme.md index 2cf7c8fde806..285c1d3c42dd 100644 --- a/keyboards/cornia/readme.md +++ b/keyboards/cornia/readme.md @@ -12,12 +12,12 @@ Hardware Availability: [PCB Data](https://github.com/Vaarai/Cornia) Make example for this keyboard (after setting up your build environment): ```sh - make cornia:default + make cornia/v1:default ``` Flashing example for this keyboard: ```sh - make cornia:default:flash + make cornia/v1:default:flash ``` See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK ? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cornia/rules.mk b/keyboards/cornia/rules.mk deleted file mode 100644 index d090f25d4b45..000000000000 --- a/keyboards/cornia/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = cornia/v1 \ No newline at end of file From 8753cd8fb82dacfaafe85c97e96d8d1415bf4b6b Mon Sep 17 00:00:00 2001 From: Vaarai Date: Mon, 11 Nov 2024 20:31:37 +0100 Subject: [PATCH 09/15] [Cornia] Put common configuration to top keyboard level --- keyboards/cornia/{v0_6 => }/config.h | 8 +- keyboards/cornia/cornia.c | 2 +- keyboards/cornia/info.json | 128 +++++++++++++++++++- keyboards/cornia/v0_6/keyboard.json | 127 -------------------- keyboards/cornia/v0_6/mcuconf.h | 25 ---- keyboards/cornia/v1/config.h | 25 ---- keyboards/cornia/v1/keyboard.json | 168 +-------------------------- keyboards/cornia/v1/mcuconf.h | 25 ---- 8 files changed, 136 insertions(+), 372 deletions(-) rename keyboards/cornia/{v0_6 => }/config.h (86%) delete mode 100644 keyboards/cornia/v0_6/mcuconf.h delete mode 100644 keyboards/cornia/v1/config.h delete mode 100644 keyboards/cornia/v1/mcuconf.h diff --git a/keyboards/cornia/v0_6/config.h b/keyboards/cornia/config.h similarity index 86% rename from keyboards/cornia/v0_6/config.h rename to keyboards/cornia/config.h index 4e2ac9ddab86..dc45a06ca7d1 100644 --- a/keyboards/cornia/v0_6/config.h +++ b/keyboards/cornia/config.h @@ -21,10 +21,16 @@ #define MASTER_RIGHT // #define EE_HANDS +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 FALSE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE + /* I²C config */ #define I2C_DRIVER I2CD1 #define I2C1_SDA_PIN GP10 #define I2C1_SCL_PIN GP11 #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior -#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur. +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur. \ No newline at end of file diff --git a/keyboards/cornia/cornia.c b/keyboards/cornia/cornia.c index aaa30fc0484a..9a0904733315 100644 --- a/keyboards/cornia/cornia.c +++ b/keyboards/cornia/cornia.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -#include QMK_KEYBOARD_H +#include "cornia.h" // 'Cornia', 32x32px #define OLED_LOGO_CORNIA {\ diff --git a/keyboards/cornia/info.json b/keyboards/cornia/info.json index 4b1ee0981977..7a8a88474a76 100644 --- a/keyboards/cornia/info.json +++ b/keyboards/cornia/info.json @@ -5,7 +5,133 @@ "usb": { "vid": "0xFEED" }, + "processor": "RP2040", + "bootloader": "rp2040", "split": { - "enabled": true + "enabled": true, + "serial": { + "driver": "vendor", + "pin": "GP1" + }, + "transport": { + "sync": { + "matrix_state": true + } + } + }, + "features": { + "extrakey": true, + "nkro": true, + "oled": true, + "rgb_matrix": true + }, + "community_layouts": [ "split_3x6_3" ], + "layout_aliases": { + "LAYOUT": "LAYOUT_split_3x6_3" + }, + "layouts": { + "LAYOUT_split_3x6_3": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0.3}, + {"matrix": [0, 1], "x": 1, "y": 0.3}, + {"matrix": [0, 2], "x": 2, "y": 0.1}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0.1}, + {"matrix": [0, 5], "x": 5, "y": 0.2}, + {"matrix": [4, 5], "x": 9, "y": 0.2}, + {"matrix": [4, 4], "x": 10, "y": 0.1}, + {"matrix": [4, 3], "x": 11, "y": 0}, + {"matrix": [4, 2], "x": 12, "y": 0.1}, + {"matrix": [4, 1], "x": 13, "y": 0.3}, + {"matrix": [4, 0], "x": 14, "y": 0.3}, + {"matrix": [1, 0], "x": 0, "y": 1.3}, + {"matrix": [1, 1], "x": 1, "y": 1.3}, + {"matrix": [1, 2], "x": 2, "y": 1.1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1.1}, + {"matrix": [1, 5], "x": 5, "y": 1.2}, + {"matrix": [5, 5], "x": 9, "y": 1.2}, + {"matrix": [5, 4], "x": 10, "y": 1.1}, + {"matrix": [5, 3], "x": 11, "y": 1}, + {"matrix": [5, 2], "x": 12, "y": 1.1}, + {"matrix": [5, 1], "x": 13, "y": 1.3}, + {"matrix": [5, 0], "x": 14, "y": 1.3}, + {"matrix": [2, 0], "x": 0, "y": 2.3}, + {"matrix": [2, 1], "x": 1, "y": 2.3}, + {"matrix": [2, 2], "x": 2, "y": 2.1}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.1}, + {"matrix": [2, 5], "x": 5, "y": 2.2}, + {"matrix": [6, 5], "x": 9, "y": 2.2}, + {"matrix": [6, 4], "x": 10, "y": 2.1}, + {"matrix": [6, 3], "x": 11, "y": 2}, + {"matrix": [6, 2], "x": 12, "y": 2.1}, + {"matrix": [6, 1], "x": 13, "y": 2.3}, + {"matrix": [6, 0], "x": 14, "y": 2.3}, + {"matrix": [3, 3], "x": 4, "y": 3.7}, + {"matrix": [3, 4], "x": 5, "y": 3.7}, + {"matrix": [3, 5], "x": 6, "y": 3.2}, + {"matrix": [7, 5], "x": 8, "y": 3.2}, + {"matrix": [7, 4], "x": 9, "y": 3.7}, + {"matrix": [7, 3], "x": 10, "y": 3.7} + ] + } + }, + "ws2812": { + "driver": "vendor", + "pin": "GP0" + }, + "rgb_matrix": { + "driver": "ws2812", + "sleep": true, + "split_count": [21, 21], + "animations": { + "static_gradient": true, + "breathing": true + }, + "layout": [ + {"matrix": [3, 5], "x": 95, "y": 63, "flags": 1}, + {"matrix": [2, 5], "x": 85, "y": 39, "flags": 4}, + {"matrix": [1, 5], "x": 85, "y": 21, "flags": 4}, + {"matrix": [0, 5], "x": 85, "y": 4, "flags": 4}, + {"matrix": [0, 4], "x": 68, "y": 2, "flags": 4}, + {"matrix": [1, 4], "x": 68, "y": 19, "flags": 4}, + {"matrix": [2, 4], "x": 68, "y": 37, "flags": 4}, + {"matrix": [3, 4], "x": 80, "y": 58, "flags": 1}, + {"matrix": [3, 3], "x": 60, "y": 55, "flags": 1}, + {"matrix": [2, 3], "x": 50, "y": 35, "flags": 4}, + {"matrix": [1, 3], "x": 50, "y": 13, "flags": 4}, + {"matrix": [0, 3], "x": 50, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 33, "y": 3, "flags": 4}, + {"matrix": [1, 2], "x": 33, "y": 20, "flags": 4}, + {"matrix": [2, 2], "x": 33, "y": 37, "flags": 4}, + {"matrix": [2, 1], "x": 16, "y": 42, "flags": 4}, + {"matrix": [1, 1], "x": 16, "y": 24, "flags": 4}, + {"matrix": [0, 1], "x": 16, "y": 7, "flags": 4}, + {"matrix": [0, 0], "x": 0, "y": 7, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 24, "flags": 1}, + {"matrix": [2, 0], "x": 0, "y": 41, "flags": 1}, + {"matrix": [7, 5], "x": 129, "y": 63, "flags": 1}, + {"matrix": [6, 5], "x": 139, "y": 39, "flags": 4}, + {"matrix": [5, 5], "x": 139, "y": 21, "flags": 4}, + {"matrix": [4, 5], "x": 139, "y": 4, "flags": 4}, + {"matrix": [4, 4], "x": 156, "y": 2, "flags": 4}, + {"matrix": [5, 4], "x": 156, "y": 19, "flags": 4}, + {"matrix": [6, 4], "x": 156, "y": 37, "flags": 4}, + {"matrix": [7, 4], "x": 144, "y": 58, "flags": 1}, + {"matrix": [7, 3], "x": 164, "y": 55, "flags": 1}, + {"matrix": [6, 3], "x": 174, "y": 35, "flags": 4}, + {"matrix": [5, 3], "x": 174, "y": 13, "flags": 4}, + {"matrix": [4, 3], "x": 174, "y": 0, "flags": 4}, + {"matrix": [4, 2], "x": 191, "y": 3, "flags": 4}, + {"matrix": [5, 2], "x": 191, "y": 20, "flags": 4}, + {"matrix": [6, 2], "x": 191, "y": 37, "flags": 4}, + {"matrix": [6, 1], "x": 208, "y": 42, "flags": 4}, + {"matrix": [5, 1], "x": 208, "y": 24, "flags": 4}, + {"matrix": [4, 1], "x": 208, "y": 7, "flags": 4}, + {"matrix": [4, 0], "x": 224, "y": 7, "flags": 1}, + {"matrix": [5, 0], "x": 224, "y": 24, "flags": 1}, + {"matrix": [6, 0], "x": 224, "y": 41, "flags": 1} + ] } } \ No newline at end of file diff --git a/keyboards/cornia/v0_6/keyboard.json b/keyboards/cornia/v0_6/keyboard.json index 68dcdbc44b34..5e4b96da21cf 100644 --- a/keyboards/cornia/v0_6/keyboard.json +++ b/keyboards/cornia/v0_6/keyboard.json @@ -4,136 +4,9 @@ "pid": "0x0600", "device_version": "0.6.0" }, - "processor": "RP2040", - "bootloader": "rp2040", - "features": { - "extrakey": true, - "nkro": true, - "oled": true - }, - "split": { - "serial": { - "driver": "vendor", - "pin": "GP1" - }, - "transport": { - "sync": { - "matrix_state": true - } - } - }, "diode_direction": "COL2ROW", "matrix_pins": { "cols": [ "GP29", "GP28", "GP27", "GP26", "GP22", "GP20" ], "rows": [ "GP4", "GP5", "GP6", "GP7" ] - }, - "community_layouts": [ "split_3x6_3" ], - "layout_aliases": { - "LAYOUT": "LAYOUT_split_3x6_3" - }, - "layouts": { - "LAYOUT_split_3x6_3": { - "layout": [ - {"matrix": [0, 0], "x": 0, "y": 0.3}, - {"matrix": [0, 1], "x": 1, "y": 0.3}, - {"matrix": [0, 2], "x": 2, "y": 0.1}, - {"matrix": [0, 3], "x": 3, "y": 0}, - {"matrix": [0, 4], "x": 4, "y": 0.1}, - {"matrix": [0, 5], "x": 5, "y": 0.2}, - {"matrix": [4, 5], "x": 9, "y": 0.2}, - {"matrix": [4, 4], "x": 10, "y": 0.1}, - {"matrix": [4, 3], "x": 11, "y": 0}, - {"matrix": [4, 2], "x": 12, "y": 0.1}, - {"matrix": [4, 1], "x": 13, "y": 0.3}, - {"matrix": [4, 0], "x": 14, "y": 0.3}, - {"matrix": [1, 0], "x": 0, "y": 1.3}, - {"matrix": [1, 1], "x": 1, "y": 1.3}, - {"matrix": [1, 2], "x": 2, "y": 1.1}, - {"matrix": [1, 3], "x": 3, "y": 1}, - {"matrix": [1, 4], "x": 4, "y": 1.1}, - {"matrix": [1, 5], "x": 5, "y": 1.2}, - {"matrix": [5, 5], "x": 9, "y": 1.2}, - {"matrix": [5, 4], "x": 10, "y": 1.1}, - {"matrix": [5, 3], "x": 11, "y": 1}, - {"matrix": [5, 2], "x": 12, "y": 1.1}, - {"matrix": [5, 1], "x": 13, "y": 1.3}, - {"matrix": [5, 0], "x": 14, "y": 1.3}, - {"matrix": [2, 0], "x": 0, "y": 2.3}, - {"matrix": [2, 1], "x": 1, "y": 2.3}, - {"matrix": [2, 2], "x": 2, "y": 2.1}, - {"matrix": [2, 3], "x": 3, "y": 2}, - {"matrix": [2, 4], "x": 4, "y": 2.1}, - {"matrix": [2, 5], "x": 5, "y": 2.2}, - {"matrix": [6, 5], "x": 9, "y": 2.2}, - {"matrix": [6, 4], "x": 10, "y": 2.1}, - {"matrix": [6, 3], "x": 11, "y": 2}, - {"matrix": [6, 2], "x": 12, "y": 2.1}, - {"matrix": [6, 1], "x": 13, "y": 2.3}, - {"matrix": [6, 0], "x": 14, "y": 2.3}, - {"matrix": [3, 3], "x": 4, "y": 3.7}, - {"matrix": [3, 4], "x": 5, "y": 3.7}, - {"matrix": [3, 5], "x": 6, "y": 3.2}, - {"matrix": [7, 5], "x": 8, "y": 3.2}, - {"matrix": [7, 4], "x": 9, "y": 3.7}, - {"matrix": [7, 3], "x": 10, "y": 3.7} - ] - } - }, - "ws2812": { - "driver": "vendor", - "pin": "GP0" - }, - "rgb_matrix": { - "driver": "ws2812", - "sleep": true, - "split_count": [21, 21], - "animations": { - "static_gradient": true, - "breathing": true - }, - "layout": [ - {"matrix": [3, 5], "x": 95, "y": 63, "flags": 1}, - {"matrix": [2, 5], "x": 85, "y": 39, "flags": 4}, - {"matrix": [1, 5], "x": 85, "y": 21, "flags": 4}, - {"matrix": [0, 5], "x": 85, "y": 4, "flags": 4}, - {"matrix": [0, 4], "x": 68, "y": 2, "flags": 4}, - {"matrix": [1, 4], "x": 68, "y": 19, "flags": 4}, - {"matrix": [2, 4], "x": 68, "y": 37, "flags": 4}, - {"matrix": [3, 4], "x": 80, "y": 58, "flags": 1}, - {"matrix": [3, 3], "x": 60, "y": 55, "flags": 1}, - {"matrix": [2, 3], "x": 50, "y": 35, "flags": 4}, - {"matrix": [1, 3], "x": 50, "y": 13, "flags": 4}, - {"matrix": [0, 3], "x": 50, "y": 0, "flags": 4}, - {"matrix": [0, 2], "x": 33, "y": 3, "flags": 4}, - {"matrix": [1, 2], "x": 33, "y": 20, "flags": 4}, - {"matrix": [2, 2], "x": 33, "y": 37, "flags": 4}, - {"matrix": [2, 1], "x": 16, "y": 42, "flags": 4}, - {"matrix": [1, 1], "x": 16, "y": 24, "flags": 4}, - {"matrix": [0, 1], "x": 16, "y": 7, "flags": 4}, - {"matrix": [0, 0], "x": 0, "y": 7, "flags": 1}, - {"matrix": [1, 0], "x": 0, "y": 24, "flags": 1}, - {"matrix": [2, 0], "x": 0, "y": 41, "flags": 1}, - {"matrix": [7, 5], "x": 129, "y": 63, "flags": 1}, - {"matrix": [6, 5], "x": 139, "y": 39, "flags": 4}, - {"matrix": [5, 5], "x": 139, "y": 21, "flags": 4}, - {"matrix": [4, 5], "x": 139, "y": 4, "flags": 4}, - {"matrix": [4, 4], "x": 156, "y": 2, "flags": 4}, - {"matrix": [5, 4], "x": 156, "y": 19, "flags": 4}, - {"matrix": [6, 4], "x": 156, "y": 37, "flags": 4}, - {"matrix": [7, 4], "x": 144, "y": 58, "flags": 1}, - {"matrix": [7, 3], "x": 164, "y": 55, "flags": 1}, - {"matrix": [6, 3], "x": 174, "y": 35, "flags": 4}, - {"matrix": [5, 3], "x": 174, "y": 13, "flags": 4}, - {"matrix": [4, 3], "x": 174, "y": 0, "flags": 4}, - {"matrix": [4, 2], "x": 191, "y": 3, "flags": 4}, - {"matrix": [5, 2], "x": 191, "y": 20, "flags": 4}, - {"matrix": [6, 2], "x": 191, "y": 37, "flags": 4}, - {"matrix": [6, 1], "x": 208, "y": 42, "flags": 4}, - {"matrix": [5, 1], "x": 208, "y": 24, "flags": 4}, - {"matrix": [4, 1], "x": 208, "y": 7, "flags": 4}, - {"matrix": [4, 0], "x": 224, "y": 7, "flags": 1}, - {"matrix": [5, 0], "x": 224, "y": 24, "flags": 1}, - {"matrix": [6, 0], "x": 224, "y": 41, "flags": 1} - ] } } diff --git a/keyboards/cornia/v0_6/mcuconf.h b/keyboards/cornia/v0_6/mcuconf.h deleted file mode 100644 index a1bfd10d0ffd..000000000000 --- a/keyboards/cornia/v0_6/mcuconf.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2024 Vaarai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include_next - -#undef RP_I2C_USE_I2C0 -#define RP_I2C_USE_I2C0 FALSE - -#undef RP_I2C_USE_I2C1 -#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/cornia/v1/config.h b/keyboards/cornia/v1/config.h deleted file mode 100644 index 5fbfae2e26a5..000000000000 --- a/keyboards/cornia/v1/config.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2024 Vaarai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -/* I²C config */ -#define I2C_DRIVER I2CD1 -#define I2C1_SDA_PIN GP10 -#define I2C1_SCL_PIN GP11 - -#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior -#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur. diff --git a/keyboards/cornia/v1/keyboard.json b/keyboards/cornia/v1/keyboard.json index 8a4265e5037b..90a54f288eb8 100644 --- a/keyboards/cornia/v1/keyboard.json +++ b/keyboards/cornia/v1/keyboard.json @@ -4,24 +4,8 @@ "pid": "0x1000", "device_version": "1.0.0" }, - "processor": "RP2040", - "bootloader": "rp2040", - "features": { - "extrakey": true, - "nkro": true, - "oled": true, - "rgb_matrix": true - }, "split": { - "serial": { - "driver": "vendor", - "pin": "GP1" - }, - "transport": { - "sync": { - "matrix_state": true - } - }, + "handedness": { "pin": "GP25" } @@ -33,155 +17,5 @@ ["GP8", "GP15", "GP9", "GP14", "GP12", "GP13"], [ null, null, null, "GP16", "GP23", "GP21"] ] - }, - "community_layouts": [ "split_3x6_3" ], - "layout_aliases": { - "LAYOUT": "LAYOUT_split_3x6_3" - }, - "layouts": { - "LAYOUT_split_3x6_3": { - "layout": [ - {"matrix": [0, 0], "x": 0, "y": 0.3}, - {"matrix": [0, 1], "x": 1, "y": 0.3}, - {"matrix": [0, 2], "x": 2, "y": 0.1}, - {"matrix": [0, 3], "x": 3, "y": 0}, - {"matrix": [0, 4], "x": 4, "y": 0.1}, - {"matrix": [0, 5], "x": 5, "y": 0.2}, - {"matrix": [4, 5], "x": 9, "y": 0.2}, - {"matrix": [4, 4], "x": 10, "y": 0.1}, - {"matrix": [4, 3], "x": 11, "y": 0}, - {"matrix": [4, 2], "x": 12, "y": 0.1}, - {"matrix": [4, 1], "x": 13, "y": 0.3}, - {"matrix": [4, 0], "x": 14, "y": 0.3}, - {"matrix": [1, 0], "x": 0, "y": 1.3}, - {"matrix": [1, 1], "x": 1, "y": 1.3}, - {"matrix": [1, 2], "x": 2, "y": 1.1}, - {"matrix": [1, 3], "x": 3, "y": 1}, - {"matrix": [1, 4], "x": 4, "y": 1.1}, - {"matrix": [1, 5], "x": 5, "y": 1.2}, - {"matrix": [5, 5], "x": 9, "y": 1.2}, - {"matrix": [5, 4], "x": 10, "y": 1.1}, - {"matrix": [5, 3], "x": 11, "y": 1}, - {"matrix": [5, 2], "x": 12, "y": 1.1}, - {"matrix": [5, 1], "x": 13, "y": 1.3}, - {"matrix": [5, 0], "x": 14, "y": 1.3}, - {"matrix": [2, 0], "x": 0, "y": 2.3}, - {"matrix": [2, 1], "x": 1, "y": 2.3}, - {"matrix": [2, 2], "x": 2, "y": 2.1}, - {"matrix": [2, 3], "x": 3, "y": 2}, - {"matrix": [2, 4], "x": 4, "y": 2.1}, - {"matrix": [2, 5], "x": 5, "y": 2.2}, - {"matrix": [6, 5], "x": 9, "y": 2.2}, - {"matrix": [6, 4], "x": 10, "y": 2.1}, - {"matrix": [6, 3], "x": 11, "y": 2}, - {"matrix": [6, 2], "x": 12, "y": 2.1}, - {"matrix": [6, 1], "x": 13, "y": 2.3}, - {"matrix": [6, 0], "x": 14, "y": 2.3}, - {"matrix": [3, 3], "x": 4, "y": 3.7}, - {"matrix": [3, 4], "x": 5, "y": 3.7}, - {"matrix": [3, 5], "x": 6, "y": 3.2}, - {"matrix": [7, 5], "x": 8, "y": 3.2}, - {"matrix": [7, 4], "x": 9, "y": 3.7}, - {"matrix": [7, 3], "x": 10, "y": 3.7} - ] - } - }, - "ws2812": { - "driver": "vendor", - "pin": "GP0" - }, - "rgb_matrix": { - "driver": "ws2812", - "sleep": true, - "split_count": [21, 21], - "animations": { - "alphas_mods": true, - "band_pinwheel_sat": true, - "band_pinwheel_val": true, - "band_sat": true, - "band_spiral_sat": true, - "band_spiral_val": true, - "band_val": true, - "breathing": true, - "cycle_all": true, - "cycle_left_right": true, - "cycle_out_in": true, - "cycle_out_in_dual": true, - "cycle_pinwheel": true, - "cycle_spiral": true, - "cycle_up_down": true, - "digital_rain": true, - "dual_beacon": true, - "gradient_left_right": true, - "gradient_up_down": true, - "hue_breathing": true, - "hue_pendulum": true, - "hue_wave": true, - "jellybean_raindrops": true, - "multisplash": true, - "pixel_flow": true, - "pixel_fractal": true, - "pixel_rain": true, - "rainbow_beacon": true, - "rainbow_moving_chevron": true, - "rainbow_pinwheels": true, - "raindrops": true, - "solid_multisplash": true, - "solid_reactive": true, - "solid_reactive_cross": true, - "solid_reactive_multicross": true, - "solid_reactive_multinexus": true, - "solid_reactive_multiwide": true, - "solid_reactive_nexus": true, - "solid_reactive_simple": true, - "solid_reactive_wide": true, - "solid_splash": true, - "splash": true, - "typing_heatmap": true - }, - "layout": [ - {"matrix": [3, 5], "x": 95, "y": 63, "flags": 1}, - {"matrix": [2, 5], "x": 85, "y": 39, "flags": 4}, - {"matrix": [1, 5], "x": 85, "y": 21, "flags": 4}, - {"matrix": [0, 5], "x": 85, "y": 4, "flags": 4}, - {"matrix": [0, 4], "x": 68, "y": 2, "flags": 4}, - {"matrix": [1, 4], "x": 68, "y": 19, "flags": 4}, - {"matrix": [2, 4], "x": 68, "y": 37, "flags": 4}, - {"matrix": [3, 4], "x": 80, "y": 58, "flags": 1}, - {"matrix": [3, 3], "x": 60, "y": 55, "flags": 1}, - {"matrix": [2, 3], "x": 50, "y": 35, "flags": 4}, - {"matrix": [1, 3], "x": 50, "y": 13, "flags": 4}, - {"matrix": [0, 3], "x": 50, "y": 0, "flags": 4}, - {"matrix": [0, 2], "x": 33, "y": 3, "flags": 4}, - {"matrix": [1, 2], "x": 33, "y": 20, "flags": 4}, - {"matrix": [2, 2], "x": 33, "y": 37, "flags": 4}, - {"matrix": [2, 1], "x": 16, "y": 42, "flags": 4}, - {"matrix": [1, 1], "x": 16, "y": 24, "flags": 4}, - {"matrix": [0, 1], "x": 16, "y": 7, "flags": 4}, - {"matrix": [0, 0], "x": 0, "y": 7, "flags": 1}, - {"matrix": [1, 0], "x": 0, "y": 24, "flags": 1}, - {"matrix": [2, 0], "x": 0, "y": 41, "flags": 1}, - {"matrix": [7, 5], "x": 129, "y": 63, "flags": 1}, - {"matrix": [6, 5], "x": 139, "y": 39, "flags": 4}, - {"matrix": [5, 5], "x": 139, "y": 21, "flags": 4}, - {"matrix": [4, 5], "x": 139, "y": 4, "flags": 4}, - {"matrix": [4, 4], "x": 156, "y": 2, "flags": 4}, - {"matrix": [5, 4], "x": 156, "y": 19, "flags": 4}, - {"matrix": [6, 4], "x": 156, "y": 37, "flags": 4}, - {"matrix": [7, 4], "x": 144, "y": 58, "flags": 1}, - {"matrix": [7, 3], "x": 164, "y": 55, "flags": 1}, - {"matrix": [6, 3], "x": 174, "y": 35, "flags": 4}, - {"matrix": [5, 3], "x": 174, "y": 13, "flags": 4}, - {"matrix": [4, 3], "x": 174, "y": 0, "flags": 4}, - {"matrix": [4, 2], "x": 191, "y": 3, "flags": 4}, - {"matrix": [5, 2], "x": 191, "y": 20, "flags": 4}, - {"matrix": [6, 2], "x": 191, "y": 37, "flags": 4}, - {"matrix": [6, 1], "x": 208, "y": 42, "flags": 4}, - {"matrix": [5, 1], "x": 208, "y": 24, "flags": 4}, - {"matrix": [4, 1], "x": 208, "y": 7, "flags": 4}, - {"matrix": [4, 0], "x": 224, "y": 7, "flags": 1}, - {"matrix": [5, 0], "x": 224, "y": 24, "flags": 1}, - {"matrix": [6, 0], "x": 224, "y": 41, "flags": 1} - ] } } diff --git a/keyboards/cornia/v1/mcuconf.h b/keyboards/cornia/v1/mcuconf.h deleted file mode 100644 index a1bfd10d0ffd..000000000000 --- a/keyboards/cornia/v1/mcuconf.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2024 Vaarai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include_next - -#undef RP_I2C_USE_I2C0 -#define RP_I2C_USE_I2C0 FALSE - -#undef RP_I2C_USE_I2C1 -#define RP_I2C_USE_I2C1 TRUE From cc83c5e42c6076de7de7291f1eef47b21daa836f Mon Sep 17 00:00:00 2001 From: Vaarai Date: Mon, 11 Nov 2024 20:38:22 +0100 Subject: [PATCH 10/15] [Cornia] Remove unecessary custom keycodes --- keyboards/cornia/keymaps/default/keymap.c | 12 ++---------- keyboards/cornia/keymaps/fire/keymap.c | 4 ++-- keyboards/cornia/keymaps/fire/keymap.h | 6 ------ 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/keyboards/cornia/keymaps/default/keymap.c b/keyboards/cornia/keymaps/default/keymap.c index efb2a17be1ee..caca7bc241bf 100644 --- a/keyboards/cornia/keymaps/default/keymap.c +++ b/keyboards/cornia/keymaps/default/keymap.c @@ -16,14 +16,6 @@ #include QMK_KEYBOARD_H -/* Custom Keycodes (CK_xxx) */ -#define CK_LPAR LSFT(KC_9) -#define CK_RPAR LSFT(KC_0) -#define CK_LCBR LSFT(KC_LBRC) -#define CK_RCBR LSFT(KC_RBRC) -#define CK_QMRK LSFT(KC_SLSH) -#define CK_UNSC LSFT(KC_MINS) - /* Layers definitions */ enum layers { _ALPHA, @@ -61,9 +53,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, KC_SLSH, CK_LCBR, CK_LPAR, KC_LBRC, KC_MINS, CK_UNSC, KC_RBRC, CK_RPAR, CK_RCBR, KC_BSLS, _______, + _______, KC_SLSH, KC_LCBR, KC_LPRN, KC_LBRC, KC_MINS, KC_UNDS, KC_RBRC, KC_RPRN, KC_RCBR, KC_BSLS, _______, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, XXXXXXX, KC_GRV, CK_QMRK, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, XXXXXXX, KC_GRV, KC_QUES, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, KC_RGUI //`--------------------------' `--------------------------' diff --git a/keyboards/cornia/keymaps/fire/keymap.c b/keyboards/cornia/keymaps/fire/keymap.c index da7c58a47ad5..83ee8cece125 100644 --- a/keyboards/cornia/keymaps/fire/keymap.c +++ b/keyboards/cornia/keymaps/fire/keymap.c @@ -55,9 +55,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, //|--------+-- / ---+-- { ---+-- ( ---+-- [ ---+-- - ---| |--- _ --+--- ] --+-- ) ---+-- } ---+-- \ ---+--------| - _______, KC_SLSH, CK_LCBR, CK_LPAR, KC_LBRC, KC_MINS, CK_UNSC, KC_RBRC, CK_RPAR, CK_RCBR, KC_BSLS, _______, + _______, KC_SLSH, KC_LCBR, KC_LPRN, KC_LBRC, KC_MINS, KC_UNDS, KC_RBRC, KC_RPRN, KC_RCBR, KC_BSLS, _______, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, XXXXXXX, KC_GRV, CK_QMRK, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, XXXXXXX, KC_GRV, KC_QUES, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| _______,MO(_ADJUST),_______, _______, _______, KC_RGUI //`--------------------------' `--------------------------' diff --git a/keyboards/cornia/keymaps/fire/keymap.h b/keyboards/cornia/keymaps/fire/keymap.h index 13f007364b95..719c2b97a85a 100644 --- a/keyboards/cornia/keymaps/fire/keymap.h +++ b/keyboards/cornia/keymaps/fire/keymap.h @@ -36,13 +36,7 @@ enum layers { }; /* Custom Keycodes (CK_xxx) */ -#define CK_LPAR LSFT(KC_9) -#define CK_RPAR LSFT(KC_0) -#define CK_LCBR LSFT(KC_LBRC) -#define CK_RCBR LSFT(KC_RBRC) -#define CK_QMRK LSFT(KC_SLSH) #define CK_SSHT LSG(KC_S) -#define CK_UNSC LSFT(KC_MINS) #define CK_SELL LSFT(LCTL(KC_LEFT)) #define CK_SELR LSFT(LCTL(KC_RIGHT)) From 4fe4ac150cff2eb4975c9791becec9240167960d Mon Sep 17 00:00:00 2001 From: Vaarai Date: Mon, 11 Nov 2024 20:38:59 +0100 Subject: [PATCH 11/15] [Cornia] Fix readme --- keyboards/cornia/readme.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/keyboards/cornia/readme.md b/keyboards/cornia/readme.md index 285c1d3c42dd..15591d22f973 100644 --- a/keyboards/cornia/readme.md +++ b/keyboards/cornia/readme.md @@ -37,18 +37,6 @@ Two keymaps are available for now, below are their [KLE](https://www.keyboard-la - [Default QWERTY layout for Cornia keyboard](https://www.keyboard-layout-editor.com/#/gists/5af136790cefe4b35cdf02ca52c1fccc) - [Fire layout for Cornia keyboard](https://www.keyboard-layout-editor.com/#/gists/a40345c92e1f3f326426ef890ebf4d1c) (Based on [Fire (Oxey)](https://docs.google.com/document/d/1Ic-h8UxGe5-Q0bPuYNgE3NoWiI8ekeadvSQ5YysrwII) layout) -## Disable RGB Matrix - -The Corne Keyboard use the RGB Matrix feature by default. To disable it please make with the following command: -```sh - make cornia/v1_no_led:default -``` - -And flash with: -```sh - make cornia/v1_no_led:default:flash -``` - ## OLED Display & Cirque Trackpad The Corne Keyboard also support OLED Display and Cirque Trackpad through I²C, an implementation is available in `fire` keymap. From 67630b656ff147281fe0b0919361f8d9c24a186e Mon Sep 17 00:00:00 2001 From: Vaarai Date: Mon, 2 Dec 2024 22:25:40 +0100 Subject: [PATCH 12/15] [Cornia] Fix RGB keycodes --- keyboards/cornia/keymaps/default/keymap.c | 4 ++-- keyboards/cornia/keymaps/fire/keymap.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/cornia/keymaps/default/keymap.c b/keyboards/cornia/keymaps/default/keymap.c index caca7bc241bf..1aa48d471ff8 100644 --- a/keyboards/cornia/keymaps/default/keymap.c +++ b/keyboards/cornia/keymaps/default/keymap.c @@ -65,9 +65,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - XXXXXXX, RGB_TOG, RGB_HUI, RGB_VAI, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + XXXXXXX, RM_TOGG, RM_HUEU, RM_VALU, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, //|--------+--------+--------+--------+--------|--------| |--------+--------+--------+--------+--------+--------| - XXXXXXX, RGB_MOD, RGB_HUD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, RM_NEXT, RM_HUED, RM_VALD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, _______ //`--------------------------' `--------------------------' diff --git a/keyboards/cornia/keymaps/fire/keymap.c b/keyboards/cornia/keymaps/fire/keymap.c index 83ee8cece125..9215c61f9cab 100644 --- a/keyboards/cornia/keymaps/fire/keymap.c +++ b/keyboards/cornia/keymaps/fire/keymap.c @@ -67,9 +67,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - XXXXXXX, RGB_TOG, RGB_HUI, RGB_VAI, CK_DPII, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + XXXXXXX, RM_TOGG, RM_HUEU, RM_VALU, CK_DPII, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, //|--------+--------+--------+--------+--------|--------| |--------+--------+--------+--------+--------+--------| - XXXXXXX, RGB_MOD, RGB_HUD, RGB_VAD, CK_DPID, XXXXXXX, TO(_G0), TO(_G1), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, RM_NEXT, RM_HUED, RM_VALD, CK_DPID, XXXXXXX, TO(_G0), TO(_G1), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, _______ //`--------------------------' `--------------------------' From a7083eee7d39de66d6b402ef7dcafb7ead375451 Mon Sep 17 00:00:00 2001 From: Vaarai Date: Mon, 2 Dec 2024 22:26:00 +0100 Subject: [PATCH 13/15] [Cornia] Fix config files --- keyboards/cornia/config.h | 6 ------ keyboards/cornia/info.json | 2 ++ keyboards/cornia/keymaps/fire/rules.mk | 1 - keyboards/cornia/mcuconf.h | 9 +++++++++ 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 keyboards/cornia/mcuconf.h diff --git a/keyboards/cornia/config.h b/keyboards/cornia/config.h index dc45a06ca7d1..dbf7031b6232 100644 --- a/keyboards/cornia/config.h +++ b/keyboards/cornia/config.h @@ -21,12 +21,6 @@ #define MASTER_RIGHT // #define EE_HANDS -#undef RP_I2C_USE_I2C0 -#define RP_I2C_USE_I2C0 FALSE - -#undef RP_I2C_USE_I2C1 -#define RP_I2C_USE_I2C1 TRUE - /* I²C config */ #define I2C_DRIVER I2CD1 #define I2C1_SDA_PIN GP10 diff --git a/keyboards/cornia/info.json b/keyboards/cornia/info.json index 7a8a88474a76..7c0b5aabf2c2 100644 --- a/keyboards/cornia/info.json +++ b/keyboards/cornia/info.json @@ -21,6 +21,8 @@ }, "features": { "extrakey": true, + "mousekey": true, + "bootmagic": true, "nkro": true, "oled": true, "rgb_matrix": true diff --git a/keyboards/cornia/keymaps/fire/rules.mk b/keyboards/cornia/keymaps/fire/rules.mk index 12a18cd21d5c..221d810975eb 100644 --- a/keyboards/cornia/keymaps/fire/rules.mk +++ b/keyboards/cornia/keymaps/fire/rules.mk @@ -1,6 +1,5 @@ SRC += tap_dances.c -MOUSEKEY_ENABLE = yes CAPS_WORD_ENABLE = yes TAP_DANCE_ENABLE = yes diff --git a/keyboards/cornia/mcuconf.h b/keyboards/cornia/mcuconf.h new file mode 100644 index 000000000000..1fe7fa047ac2 --- /dev/null +++ b/keyboards/cornia/mcuconf.h @@ -0,0 +1,9 @@ +#pragma once + +#include_next "mcuconf.h" + +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 FALSE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE \ No newline at end of file From 166c3ed0dd38131c143e88f021495c1f030ddc83 Mon Sep 17 00:00:00 2001 From: Vaarai Date: Mon, 2 Dec 2024 22:31:11 +0100 Subject: [PATCH 14/15] [Cornia] Fix readme --- keyboards/cornia/readme.md | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/keyboards/cornia/readme.md b/keyboards/cornia/readme.md index 15591d22f973..3051d010a9ff 100644 --- a/keyboards/cornia/readme.md +++ b/keyboards/cornia/readme.md @@ -1,24 +1,20 @@ # Cornia Keyboard -![Cornia v1](https://imgur.com/3vRlvi3) +![Cornia v1](https://i.imgur.com/3vRlvi3.jpeg) A split keyboard with 3x6 column strongly staggered keys and 3 thumb keys -Keyboard Maintainer: [Vaarai](https://github.com/Vaarai) - -Hardware Supported: Cornia PCB, RP2040 / 0xCB-Helios - -Hardware Availability: [PCB Data](https://github.com/Vaarai/Cornia) +* Keyboard Maintainer: [Vaarai](https://github.com/Vaarai) +* Hardware Supported: Cornia PCB, RP2040 / 0xCB-Helios +* Hardware Availability: [PCB Data](https://github.com/Vaarai/Cornia) Make example for this keyboard (after setting up your build environment): -```sh + make cornia/v1:default -``` Flashing example for this keyboard: -```sh + make cornia/v1:default:flash -``` See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK ? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). @@ -39,14 +35,12 @@ Two keymaps are available for now, below are their [KLE](https://www.keyboard-la ## OLED Display & Cirque Trackpad -The Corne Keyboard also support OLED Display and Cirque Trackpad through I²C, an implementation is available in `fire` keymap. +The Cornia Keyboard also support OLED Display and Cirque Trackpad through I²C, an implementation is available in `fire` keymap. To use it please make with the following command: -```sh - make cornia:fire -``` + + make cornia/v1:fire And flash with: -```sh - make cornia:fire:flash -``` \ No newline at end of file + + make cornia/v1:fire:flash \ No newline at end of file From 0deb08652ba1358e368243c1bda18798f0cc8663 Mon Sep 17 00:00:00 2001 From: Vaarai Date: Tue, 3 Dec 2024 08:48:42 +0100 Subject: [PATCH 15/15] [Cornia] Fix mcuconf.h license --- keyboards/cornia/mcuconf.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/keyboards/cornia/mcuconf.h b/keyboards/cornia/mcuconf.h index 1fe7fa047ac2..9c018283f8db 100644 --- a/keyboards/cornia/mcuconf.h +++ b/keyboards/cornia/mcuconf.h @@ -1,6 +1,22 @@ +/* Copyright 2024 Vaarai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #pragma once -#include_next "mcuconf.h" +#include_next #undef RP_I2C_USE_I2C0 #define RP_I2C_USE_I2C0 FALSE