Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Keyboard] Refactor Helix #22643

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Refactor Helix
initial rev3_5rows

initial rev3_4rows

initial rev2

initial pico

keyboard level things

fixup

readme & remove aliases

some small improvements

drashna's suggestions

remove songs

align oled code with original
  • Loading branch information
waffle87 committed Nov 27, 2024
commit 165e07e1d043f46d359c01e806b6d49e96a6b30c
39 changes: 0 additions & 39 deletions data/mappings/keyboard_aliases.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -248,45 +248,6 @@
"handwired/jscotto/scottostarter": {
"target": "handwired/scottokeebs/scottostarter"
},
"helix/pico/sc/back": {
"target": "helix/pico/sc"
},
"helix/pico/sc/under": {
"target": "helix/pico/sc"
},
"helix/rev2/back/oled": {
"target": "helix/rev2/back"
},
"helix/rev2/oled": {
"target": "helix/rev2"
},
"helix/rev2/oled/back": {
"target": "helix/rev2/back"
},
"helix/rev2/oled/under": {
"target": "helix/rev2/under"
},
"helix/rev2/sc/back": {
"target": "helix/rev2/sc"
},
"helix/rev2/sc/oled": {
"target": "helix/rev2/sc"
},
"helix/rev2/sc/oledback": {
"target": "helix/rev2/sc"
},
"helix/rev2/sc/oledunder": {
"target": "helix/rev2/sc"
},
"helix/rev2/sc/under": {
"target": "helix/rev2/sc"
},
"helix/rev2/under": {
"target": "helix/rev2/sc"
},
"helix/rev2/under/oled": {
"target": "helix/rev2/under"
},
"honeycomb": {
"target": "keyhive/honeycomb"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/*
This is the c configuration file for the keymap

Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
Copyright 2020 yushakobo

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
Expand All @@ -20,9 +17,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#pragma once

// place overrides here

#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(STARTUP_SOUND)
#define AUDIO_CLICKY
#endif
#define OLED_FONT_H "keyboards/helix/glcdfont.c"
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0.
// See gfxfont.h for newer custom bitmap font info.

// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include "progmem.h"

// Standard ASCII 5x7 font
Expand Down
149 changes: 149 additions & 0 deletions keyboards/helix/helix.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
/* Copyright 2020 yushakobo
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "helix.h"

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
waffle87 marked this conversation as resolved.
Show resolved Hide resolved
if (!process_record_user(keycode, record)) {
return false;
}
switch (keycode) {
case EISU:
if (record->event.pressed) {
if (is_mac_mode()) {
register_code(KC_LNG2);
} else {
tap_code16(LALT(KC_GRAVE));
}
} else {
unregister_code(KC_LNG2);
}
return false;
break;
case KANA:
if (record->event.pressed) {
if (is_mac_mode()) {
register_code(KC_LNG1);
} else {
tap_code16(LALT(KC_GRAVE));
}
} else {
unregister_code(KC_LNG1);
}
return false;
break;
case RGBRST:
#ifdef RGBLIGHT_ENABLE
if (record->event.pressed) {
eeconfig_update_rgblight_default();
rgblight_enable();
}
#endif
waffle87 marked this conversation as resolved.
Show resolved Hide resolved
break;
}
return true;
}

bool is_mac_mode(void) {
return keymap_config.swap_lalt_lgui == false;
}

void set_mac_mode(bool macmode) {
keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = !macmode;
eeconfig_update_keymap(keymap_config.raw);
}

#ifdef DIP_SWITCH_ENABLE
bool dip_switch_update_kb(uint8_t index, bool active) {
if (!dip_switch_update_user(index, active)) {
return false;
}
set_mac_mode(!active);
return true;
}
#endif

#ifdef OLED_ENABLE
void render_status(void) {
static const char os_logo[][6] PROGMEM = {{0x95, 0x96, '\n', 0x97, 0x98, 0}, {0xb5, 0xb6, '\n', 0xb7, 0xb8, 0}};
oled_write_P(os_logo[is_mac_mode()], false);

oled_write_P(PSTR(" "), false);

oled_write_P(PSTR("Layer: "), false);

switch (get_highest_layer(layer_state)) {
case 0:
oled_write_P(PSTR("Default\n"), false);
break;
case 1:
oled_write_P(PSTR("Lower\n"), false);
break;
case 2:
oled_write_P(PSTR("Raise\n"), false);
break;
case 3:
oled_write_P(PSTR("Adjust\n"), false);
break;
default:
oled_write_ln_P(PSTR("N/A"), false);
}

oled_write_P(PSTR("\n"), false);

// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
}

static void render_logo(void) {
static const char PROGMEM helix_logo[] = {
// clang-format off
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94,
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4,
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4,
0x0
// clang-format on
};
oled_write_P(helix_logo, false);
}

static void render_rgbled_status(void) {
// " LED %d:%d,%d,%d"
oled_write_P(PSTR(" LED"), false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(':', false);
oled_write(get_u8_str(rgblight_get_hue() / RGBLIGHT_HUE_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_sat() / RGBLIGHT_SAT_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_val() / RGBLIGHT_VAL_STEP, ' '), false);
}

bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}
if (is_keyboard_master()) {
render_status();
} else {
render_logo();
render_rgbled_status();
}
return false;
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@

#include "quantum.h"

enum custom_keycodes {
EISU = QK_KB_0,
KANA,
ADJUST,
RGBRST
};

bool is_mac_mode(void);
void set_mac_mode(bool macmode);
37 changes: 37 additions & 0 deletions keyboards/helix/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"manufacturer": "Yushakobo",
"maintainer": "MakotoKurauchi",
"development_board": "promicro",
"diode_direction": "COL2ROW",
"features": {
"bootmagic": true,
"mousekey": true,
"extrakey": true,
"rgblight": true
},
"build": {
"lto": true
},
"split": {
"enabled": true,
"soft_serial_pin": "D2"
},
"rgblight": {
"animations": {
"alternating": true,
"breathing": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"static_gradient": true
},
"sleep": true
},
"url": "https://github.com/MakotoKurauchi/helix",
"usb": {
"vid": "0x3265"
},
"ws2812": {
"pin": "D3"
}
}
1 change: 0 additions & 1 deletion keyboards/helix/pico/back/keyboard.json

This file was deleted.

1 change: 0 additions & 1 deletion keyboards/helix/pico/back/rules.mk

This file was deleted.

1 change: 0 additions & 1 deletion keyboards/helix/pico/base/keyboard.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,37 +1,19 @@
{
"keyboard_name": "HelixPico",
"manufacturer": "Yushakobo",
"url": "https://github.com/MakotoKurauchi/helix",
"maintainer": "MakotoKurauchi",
"usb": {
"vid": "0x3265",
"pid": "0x0001",
"device_version": "0.0.2"
},
"split": {
"enabled": true,
"soft_serial_pin": "D2"
},
"tapping": {
"term": 100
"matrix_pins": {
"cols": ["F4", "F5", "F6", "F7", "B1", "B3", "B2"],
"rows": ["D4", "C6", "D7", "E6"]
},
"rgblight": {
"brightness_steps": 4,
"hue_steps": 10,
"animations": {
"breathing": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"knight": true,
"christmas": true,
"static_gradient": true
}
"led_count": 25,
"max_brightness": 45
},
"ws2812": {
"pin": "D3"
"usb": {
"device_version": "0.0.2",
"pid": "0x0001"
},
"processor": "atmega32u4",
"bootloader": "caterina",
"layouts": {
"LAYOUT": {
"layout": [
Expand All @@ -41,50 +23,43 @@
{"matrix": [0, 3], "x": 3, "y": 0},
{"matrix": [0, 4], "x": 4, "y": 0},
{"matrix": [0, 5], "x": 5, "y": 0},

{"matrix": [4, 5], "x": 9, "y": 0},
{"matrix": [4, 4], "x": 10, "y": 0},
{"matrix": [4, 3], "x": 11, "y": 0},
{"matrix": [4, 2], "x": 12, "y": 0},
{"matrix": [4, 1], "x": 13, "y": 0},
{"matrix": [4, 0], "x": 14, "y": 0},

{"matrix": [1, 0], "x": 0, "y": 1},
{"matrix": [1, 1], "x": 1, "y": 1},
{"matrix": [1, 2], "x": 2, "y": 1},
{"matrix": [1, 3], "x": 3, "y": 1},
{"matrix": [1, 4], "x": 4, "y": 1},
{"matrix": [1, 5], "x": 5, "y": 1},

{"matrix": [5, 5], "x": 9, "y": 1},
{"matrix": [5, 4], "x": 10, "y": 1},
{"matrix": [5, 3], "x": 11, "y": 1},
{"matrix": [5, 2], "x": 12, "y": 1},
{"matrix": [5, 1], "x": 13, "y": 1},
{"matrix": [5, 0], "x": 14, "y": 1},

{"matrix": [2, 0], "x": 0, "y": 2},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [2, 3], "x": 3, "y": 2},
{"matrix": [2, 4], "x": 4, "y": 2},
{"matrix": [2, 5], "x": 5, "y": 2},

{"matrix": [6, 5], "x": 9, "y": 2},
{"matrix": [6, 4], "x": 10, "y": 2},
{"matrix": [6, 3], "x": 11, "y": 2},
{"matrix": [6, 2], "x": 12, "y": 2},
{"matrix": [6, 1], "x": 13, "y": 2},
{"matrix": [6, 0], "x": 14, "y": 2},

{"matrix": [3, 0], "x": 0, "y": 3},
{"matrix": [3, 1], "x": 1, "y": 3},
{"matrix": [3, 2], "x": 2, "y": 3},
{"matrix": [3, 3], "x": 3, "y": 3},
{"matrix": [3, 4], "x": 4, "y": 3},
{"matrix": [3, 5], "x": 5, "y": 3},
{"matrix": [3, 6], "x": 6, "y": 3},

{"matrix": [7, 6], "x": 8, "y": 3},
{"matrix": [7, 5], "x": 9, "y": 3},
{"matrix": [7, 4], "x": 10, "y": 3},
Expand Down
Loading