From 642bee3b6ea3386b90415c73bf234aa6eceb36e2 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 27 Sep 2024 13:12:01 +0100 Subject: [PATCH 01/14] Somei70 addition --- keyboards/somei70/config.h | 5 + keyboards/somei70/keyboard.json | 148 +++++++++++++++++++++ keyboards/somei70/keymaps/default/keymap.c | 126 ++++++++++++++++++ keyboards/somei70/keymaps/default/rules.mk | 3 + keyboards/somei70/readme.md | 23 ++++ keyboards/somei70/rules.mk | 1 + 6 files changed, 306 insertions(+) create mode 100644 keyboards/somei70/config.h create mode 100644 keyboards/somei70/keyboard.json create mode 100644 keyboards/somei70/keymaps/default/keymap.c create mode 100644 keyboards/somei70/keymaps/default/rules.mk create mode 100644 keyboards/somei70/readme.md create mode 100644 keyboards/somei70/rules.mk diff --git a/keyboards/somei70/config.h b/keyboards/somei70/config.h new file mode 100644 index 000000000000..1336a1f28b91 --- /dev/null +++ b/keyboards/somei70/config.h @@ -0,0 +1,5 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define OLED_BRIGHTNESS 100 diff --git a/keyboards/somei70/keyboard.json b/keyboards/somei70/keyboard.json new file mode 100644 index 000000000000..cdb235909b71 --- /dev/null +++ b/keyboards/somei70/keyboard.json @@ -0,0 +1,148 @@ +{ + "manufacturer": "gzowski", + "keyboard_name": "Somei70", + "maintainer": "gzowski", + "processor": "RP2040", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "extrakey": true, + "oled": true, + "mousekey": true, + "nkro": true, + "wpm": true, + "rgb_matrix": true + }, + "rgb_matrix": { + "animations": { + "gradient_left_right": true, + "breathing": true, + "band_sat": true, + "band_val": true, + "cycle_all": true, + "cycle_left_right": true, + "rainbow_moving_chevron": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "dual_beacon": true, + "rainbow_beacon": true, + "raindrops": true, + "jellybean_raindrops": true, + "hue_breathing": true, + "hue_pendulum": true, + "hue_wave": true, + }, + "led_flush_limit": 14, + "max_brightness": 200, + "led_process_limit": 5, + "sleep": true + "driver": "ws2812", + "layout": [ + {"flags": 4, "matrix": [0, 0], "x": 0, "y": 0}, + {"flags": 4, "matrix": [0, 1], "x": 16, "y": 0}, + {"flags": 4, "matrix": [0, 2], "x": 33, "y": 0}, + {"flags": 4, "matrix": [0, 3], "x": 49, "y": 0}, + {"flags": 4, "matrix": [0, 4], "x": 65, "y": 0}, + {"flags": 4, "matrix": [0, 5], "x": 81, "y": 0}, + {"flags": 4, "matrix": [0, 6], "x": 86, "y": 0}, + {"flags": 4, "matrix": [0, 7], "x": 102, "y": 0}, + {"flags": 4, "matrix": [0, 8], "x": 118, "y": 0}, + {"flags": 4, "matrix": [0, 9], "x": 134, "y": 0}, + {"flags": 4, "matrix": [0, 10], "x": 150, "y": 0}, + {"flags": 4, "matrix": [0, 11], "x": 166, "y": 0}, + {"flags": 4, "matrix": [0, 12], "x": 182, "y": 0}, + {"flags": 4, "matrix": [0, 13], "x": 206, "y": 0} + ] + }, + "matrix_pins": { + "cols": ["GP28", "GP27", "GP26", "GP22", "GP20", "GP23", "GP21", "GP16", "GP15", "GP14", "GP13", "GP12", "GP9", "GP8", "GP7"], + "rows": ["GP1", "GP29", "GP6", "GP5", "GP4"] + }, + "url": "https://github.com/gzowski/somei70", + "usb": { + "device_version": "1.0.0", + "pid": "0x6F64", + "vid": "0x73CA" + }, + "ws2812": { + "pin": "GP0", + "driver": "vendor" + }, + "layouts": { + "LAYOUT_5x15": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 13], "x": 13, "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": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + {"matrix": [1, 12], "x": 12, "y": 1}, + {"matrix": [1, 13], "x": 13, "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": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + {"matrix": [2, 12], "x": 12, "y": 2}, + {"matrix": [2, 13], "x": 13, "y": 2}, + {"matrix": [2, 14], "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": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3}, + {"matrix": [3, 12], "x": 12, "y": 3}, + {"matrix": [3, 13], "x": 13, "y": 3}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4}, + {"matrix": [4, 1], "x": 1, "y": 4}, + {"matrix": [4, 2], "x": 2, "y": 4}, + {"matrix": [4, 3], "x": 3, "y": 4}, + {"matrix": [4, 4], "x": 4, "y": 4}, + {"matrix": [4, 5], "x": 5, "y": 4}, + {"matrix": [4, 6], "x": 6, "y": 4}, + {"matrix": [4, 7], "x": 7, "y": 4}, + {"matrix": [4, 8], "x": 8, "y": 4}, + {"matrix": [4, 9], "x": 9, "y": 4}, + {"matrix": [4, 10], "x": 10, "y": 4}, + {"matrix": [4, 11], "x": 11, "y": 4}, + ] + } + } +} diff --git a/keyboards/somei70/keymaps/default/keymap.c b/keyboards/somei70/keymaps/default/keymap.c new file mode 100644 index 000000000000..0b95f0e53c57 --- /dev/null +++ b/keyboards/somei70/keymaps/default/keymap.c @@ -0,0 +1,126 @@ +// Copyright 2024 James Gzowski +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H +enum custom_layer { + _LAYERA, + _LAYERB, + _LAYERC +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_LAYERA] = LAYOUT_5x15( + KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC, + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, + KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,KC_MUTE,KC_ENT ,KC_RALT,MO(_LAYERB),KC_RCTL ,KC_LEFT,KC_DOWN, KC_RGHT +), + [_LAYERB] = LAYOUT_5x15( + KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, + KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, + KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______,KC_RCTL ,KC_LEFT,KC_DOWN, KC_RGHT +), + [_LAYERC] = LAYOUT_5x15( + KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, + KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, + KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______,KC_RCTL ,KC_LEFT,KC_DOWN, KC_RGHT +) +}; + +#ifdef OLED_ENABLE +static uint8_t oled_mode = 0; +static uint8_t esc_press_count = 0; +static uint16_t esc_timer = 0; + +//Stats display +void render_stats(void) { + char wpm_str[10]; + snprintf(wpm_str, sizeof(wpm_str), "WPM: %03u", get_current_wpm()); + oled_write_ln(wpm_str, false); + if (host_keyboard_led_state().caps_lock) { + oled_write_P(PSTR("CAPS: On "), false); + } else { + oled_write_P(PSTR("CAPS: Off "), false); + } + if (keymap_config.nkro) { + oled_write_ln("NKRO: On", false); + } else { + oled_write_ln("NKRO: Off", false); + } + uint8_t brightness = rgblight_get_val(); + char brightness_str[255]; + snprintf(brightness_str, sizeof(brightness_str), "LED Brightness: %03u", brightness); + oled_write_ln(brightness_str, false); + oled_write_ln(PSTR("P: 0x6F64 V: 0x73CA"), false); +} + +//Static images +static void render_caps(void) { + static const char PROGMEM my_caps[] = { + 0,128,192,192,248,120, 8, 8, 24, 24, 48, 96, 96,176, 24, 12, 4, 6, 6, 30, 60, 48, 48,240,240, 16, 16, 16, 16, 16, 16, 16, 16, 16,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 16, 16, 16,144,208,208,248,120, 24, 24, 24, 24, 48, 96, 96,176, 24, 12, 4, 6, 6, 30, 60, 48, 48,240,224, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 31, 56, 64,128,128,128,192,192,192,224,192,225,255,240,240,128,128, 64, 64, 48, 24, 7, 7, 6, 4,140,216,120, 48, 0, 0, 0,128,128,128,128,128, 0, 0, 0,240,248, 12, 12, 12, 12, 12, 28, 56, 0, 0,240,248,156, 12, 12, 12, 12,156,248,240, 0, 0,248,252,156, 12, 12, 12, 12,152,240, 0, 0, 32,112,216,140,140,140, 12, 12, 4, 0, 0, 0, 0,128,128,128,128,128, 0, 0, 0, 7, 31, 56, 64,128,128,128,192,192,192,224,192,225,255,240,240,128,128, 64, 64, 48, 24, 7, 7, 6, 4,140,216,120, 48, 0, + 0,224,240, 24, 4, 3, 1, 0, 0, 0, 0, 6,255,135, 7, 15, 31, 17, 49, 32, 32, 32, 96,224,224, 32, 48, 17, 27, 14, 4, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 15, 31, 48, 48, 48, 48, 48, 56, 28, 0, 0, 63, 63, 3, 1, 1, 1, 1, 3, 63, 63, 0, 0, 63, 63, 3, 3, 3, 3, 3, 1, 0, 0, 0, 16, 48, 48, 49, 49, 49, 27, 14, 4, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,224,240, 24, 4, 3, 1, 0, 0, 0, 0, 6,255,135, 7, 15, 31, 17, 49, 32, 32, 32, 96,224,224, 32, 48, 17, 27, 14, 4, 0, + 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96,120,124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96,120,124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(my_caps, sizeof(my_caps)); +} + +static void render_logo(void) { + static const char PROGMEM my_logo[] = { + 0,128,192,192,248,120, 8, 8, 24, 24, 48, 96, 96,176, 24, 12, 4, 6, 6, 30, 60, 48, 48,240,240, 16, 16, 16, 16, 16, 16, 16, 16, 16,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 16, 16, 16,144,208,208,248,120, 24, 24, 24, 24, 48, 96, 96,176, 24, 12, 4, 6, 6, 30, 60, 48, 48,240,224, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 31, 56, 64,128,128,128,192,192,192,224,192,225,255,240,240,128,128, 64, 64, 48, 24, 7, 7, 6, 4,140,216,120, 48, 0, 48,120,204,204,204,204,204,140, 8, 0, 0,240,248, 12, 12, 12, 12, 12,248,240, 0, 0,248,252, 24, 48, 96, 96, 48, 24,252,248, 0, 0,248,252,140,140,140, 12, 8, 0, 0,252,252, 0, 0, 8, 12, 12, 12, 12,252,248, 0, 0,240,248, 12, 12,140, 76,248,240, 0, 7, 31, 56, 64,128,128,128,192,192,192,224,192,225,255,240,240,128,128, 64, 64, 48, 24, 7, 7, 6, 4,140,216,120, 48, 0, + 0,224,240, 24, 4, 3, 1, 0, 0, 0, 0, 6,255,135, 7, 15, 31, 17, 49, 32, 32, 32, 96,224,224, 32, 48, 17, 27, 14, 4, 0, 16, 48, 48, 48, 48, 48, 48, 63, 15, 0, 0, 15, 31, 48, 48, 48, 48, 48, 31, 15, 0, 0, 63, 31, 0, 0, 0, 0, 0, 0, 31, 63, 0, 0, 31, 63, 49, 49, 49, 48, 16, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 15, 31, 50, 49, 48, 48, 31, 15, 0,224,240, 24, 4, 3, 1, 0, 0, 0, 0, 6,255,135, 7, 15, 31, 17, 49, 32, 32, 32, 96,224,224, 32, 48, 17, 27, 14, 4, 0, + 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96,120,124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96,120,124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(my_logo, sizeof(my_logo));} + +//Render chosen display +void render_oled_display(void) { + if (oled_mode == 0) { + if (host_keyboard_led_state().caps_lock) { + render_caps(); + } else { + render_logo(); + } + } else if (oled_mode == 1) { + render_stats(); + } +} + +//Rotate 180 degrees +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; + } + +bool oled_task_user(void) { + render_oled_display(); + return false; +} +#endif + +//Record keypress +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_ESC: + if (record->event.pressed) { + if (timer_elapsed(esc_timer) > 250) { + esc_press_count = 0; + } + esc_press_count++; + esc_timer = timer_read(); + + if (esc_press_count == 3) { + oled_clear(); + oled_mode = (oled_mode == 0) ? 1 : 0; + esc_press_count = 0; + } + } + break; + } + return true; +} + diff --git a/keyboards/somei70/keymaps/default/rules.mk b/keyboards/somei70/keymaps/default/rules.mk new file mode 100644 index 000000000000..842a2a32bca7 --- /dev/null +++ b/keyboards/somei70/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +OLED_ENABLE = yes +OLED_DRIVER = ssd1306 diff --git a/keyboards/somei70/readme.md b/keyboards/somei70/readme.md new file mode 100644 index 000000000000..21b80a841120 --- /dev/null +++ b/keyboards/somei70/readme.md @@ -0,0 +1,23 @@ +# Somei70 + +70 key alternative layout + +* Keyboard Maintainer: [James Gzowski](https://github.com/gzowski) +* Hardware Supported: Elite-Pi, Frood, 0xB2 Splinky or similar, requires D9-D15 pins +* Build Guide: [Somei70](https://github.com/gzowski/somei70) + +Make example for this keyboard (after setting up your build environment): + + make somei70:default + +Flashing example for this keyboard: + + make somei70: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 + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the PCB, if using a RP2040 press repeatidly to enter boot mode. +* **Hold down boot loader button on MCU** Hold down the boot loader button on the MCU while plugging in the keyboard diff --git a/keyboards/somei70/rules.mk b/keyboards/somei70/rules.mk new file mode 100644 index 000000000000..6e7633bfe015 --- /dev/null +++ b/keyboards/somei70/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank From 68f0b52b03c8d89df5ed07577709eb8a12935275 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 27 Sep 2024 13:45:58 +0100 Subject: [PATCH 02/14] Changes made, added VIA keymap, cleaned formatting --- keyboards/somei70/keyboard.json | 78 ++++---- keyboards/somei70/keymaps/default/keymap.c | 211 ++++++++++++--------- keyboards/somei70/keymaps/default/rules.mk | 1 - keyboards/somei70/rules.mk | 1 - 4 files changed, 160 insertions(+), 131 deletions(-) delete mode 100644 keyboards/somei70/rules.mk diff --git a/keyboards/somei70/keyboard.json b/keyboards/somei70/keyboard.json index cdb235909b71..b5f70eda1325 100644 --- a/keyboards/somei70/keyboard.json +++ b/keyboards/somei70/keyboard.json @@ -2,63 +2,63 @@ "manufacturer": "gzowski", "keyboard_name": "Somei70", "maintainer": "gzowski", - "processor": "RP2040", "bootloader": "rp2040", "diode_direction": "COL2ROW", "features": { "bootmagic": true, "extrakey": true, - "oled": true, "mousekey": true, "nkro": true, - "wpm": true, - "rgb_matrix": true + "oled": true, + "rgb_matrix": true, + "wpm": true + }, + "matrix_pins": { + "cols": ["GP28", "GP27", "GP26", "GP22", "GP20", "GP23", "GP21", "GP16", "GP15", "GP14", "GP13", "GP12", "GP9", "GP8", "GP7"], + "rows": ["GP1", "GP29", "GP6", "GP5", "GP4"] }, + "processor": "RP2040", "rgb_matrix": { "animations": { - "gradient_left_right": true, - "breathing": true, "band_sat": true, "band_val": true, + "breathing": true, "cycle_all": true, "cycle_left_right": true, - "rainbow_moving_chevron": true, "cycle_out_in": true, "cycle_out_in_dual": true, "dual_beacon": true, - "rainbow_beacon": true, - "raindrops": true, - "jellybean_raindrops": true, + "gradient_left_right": true, "hue_breathing": true, "hue_pendulum": true, "hue_wave": true, + "jellybean_raindrops": true, + "rainbow_beacon": true, + "rainbow_moving_chevron": true, + "raindrops": true }, + "driver": "ws2812", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 4}, + {"matrix": [0, 1], "x": 16, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 33, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 49, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 65, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 81, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 86, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 102, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 118, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 134, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 150, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 166, "y": 0, "flags": 4}, + {"matrix": [0, 12], "x": 182, "y": 0, "flags": 4}, + {"matrix": [0, 13], "x": 206, "y": 0, "flags": 4} + ], "led_flush_limit": 14, - "max_brightness": 200, "led_process_limit": 5, + "max_brightness": 200, "sleep": true - "driver": "ws2812", - "layout": [ - {"flags": 4, "matrix": [0, 0], "x": 0, "y": 0}, - {"flags": 4, "matrix": [0, 1], "x": 16, "y": 0}, - {"flags": 4, "matrix": [0, 2], "x": 33, "y": 0}, - {"flags": 4, "matrix": [0, 3], "x": 49, "y": 0}, - {"flags": 4, "matrix": [0, 4], "x": 65, "y": 0}, - {"flags": 4, "matrix": [0, 5], "x": 81, "y": 0}, - {"flags": 4, "matrix": [0, 6], "x": 86, "y": 0}, - {"flags": 4, "matrix": [0, 7], "x": 102, "y": 0}, - {"flags": 4, "matrix": [0, 8], "x": 118, "y": 0}, - {"flags": 4, "matrix": [0, 9], "x": 134, "y": 0}, - {"flags": 4, "matrix": [0, 10], "x": 150, "y": 0}, - {"flags": 4, "matrix": [0, 11], "x": 166, "y": 0}, - {"flags": 4, "matrix": [0, 12], "x": 182, "y": 0}, - {"flags": 4, "matrix": [0, 13], "x": 206, "y": 0} - ] }, - "matrix_pins": { - "cols": ["GP28", "GP27", "GP26", "GP22", "GP20", "GP23", "GP21", "GP16", "GP15", "GP14", "GP13", "GP12", "GP9", "GP8", "GP7"], - "rows": ["GP1", "GP29", "GP6", "GP5", "GP4"] - }, "url": "https://github.com/gzowski/somei70", "usb": { "device_version": "1.0.0", @@ -66,8 +66,8 @@ "vid": "0x73CA" }, "ws2812": { - "pin": "GP0", - "driver": "vendor" + "driver": "vendor", + "pin": "GP0" }, "layouts": { "LAYOUT_5x15": { @@ -82,7 +82,7 @@ {"matrix": [0, 7], "x": 7, "y": 0}, {"matrix": [0, 8], "x": 8, "y": 0}, {"matrix": [0, 9], "x": 9, "y": 0}, - {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, {"matrix": [0, 11], "x": 11, "y": 0}, {"matrix": [0, 12], "x": 12, "y": 0}, {"matrix": [0, 13], "x": 13, "y": 0}, @@ -114,8 +114,8 @@ {"matrix": [2, 11], "x": 11, "y": 2}, {"matrix": [2, 12], "x": 12, "y": 2}, {"matrix": [2, 13], "x": 13, "y": 2}, - {"matrix": [2, 14], "x": 14, "y": 2}, - {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [2, 14], "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}, @@ -130,7 +130,7 @@ {"matrix": [3, 12], "x": 12, "y": 3}, {"matrix": [3, 13], "x": 13, "y": 3}, {"matrix": [3, 14], "x": 14, "y": 3}, - {"matrix": [4, 0], "x": 0, "y": 4}, + {"matrix": [4, 0], "x": 0, "y": 4}, {"matrix": [4, 1], "x": 1, "y": 4}, {"matrix": [4, 2], "x": 2, "y": 4}, {"matrix": [4, 3], "x": 3, "y": 4}, @@ -141,7 +141,7 @@ {"matrix": [4, 8], "x": 8, "y": 4}, {"matrix": [4, 9], "x": 9, "y": 4}, {"matrix": [4, 10], "x": 10, "y": 4}, - {"matrix": [4, 11], "x": 11, "y": 4}, + {"matrix": [4, 11], "x": 11, "y": 4} ] } } diff --git a/keyboards/somei70/keymaps/default/keymap.c b/keyboards/somei70/keymaps/default/keymap.c index 0b95f0e53c57..b9224035091b 100644 --- a/keyboards/somei70/keymaps/default/keymap.c +++ b/keyboards/somei70/keymaps/default/keymap.c @@ -1,33 +1,34 @@ // Copyright 2024 James Gzowski // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H + enum custom_layer { - _LAYERA, - _LAYERB, - _LAYERC + _LAYERA, + _LAYERB, + _LAYERC }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_LAYERA] = LAYOUT_5x15( - KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC, - KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, + [_LAYERA] = LAYOUT_5x15( + KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC, + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, - KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,KC_MUTE,KC_ENT ,KC_RALT,MO(_LAYERB),KC_RCTL ,KC_LEFT,KC_DOWN, KC_RGHT + KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,KC_MUTE,KC_ENT ,KC_RALT,MO(_LAYERB) ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT ), - [_LAYERB] = LAYOUT_5x15( - KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, - KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, - KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, - KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, - KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______,KC_RCTL ,KC_LEFT,KC_DOWN, KC_RGHT + [_LAYERB] = LAYOUT_5x15( + KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, + KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, + KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______ ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT ), - [_LAYERC] = LAYOUT_5x15( - KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, - KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, - KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, - KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, - KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______,KC_RCTL ,KC_LEFT,KC_DOWN, KC_RGHT + [_LAYERC] = LAYOUT_5x15( + KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, + KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, + KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______ ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT ) }; @@ -37,90 +38,120 @@ static uint8_t esc_press_count = 0; static uint16_t esc_timer = 0; //Stats display -void render_stats(void) { - char wpm_str[10]; - snprintf(wpm_str, sizeof(wpm_str), "WPM: %03u", get_current_wpm()); - oled_write_ln(wpm_str, false); - if (host_keyboard_led_state().caps_lock) { - oled_write_P(PSTR("CAPS: On "), false); - } else { - oled_write_P(PSTR("CAPS: Off "), false); - } - if (keymap_config.nkro) { - oled_write_ln("NKRO: On", false); - } else { - oled_write_ln("NKRO: Off", false); - } - uint8_t brightness = rgblight_get_val(); - char brightness_str[255]; - snprintf(brightness_str, sizeof(brightness_str), "LED Brightness: %03u", brightness); - oled_write_ln(brightness_str, false); - oled_write_ln(PSTR("P: 0x6F64 V: 0x73CA"), false); +void render_stats(void) +{ + char wpm_str[10]; + snprintf(wpm_str, sizeof(wpm_str), "WPM: %03u", get_current_wpm()); + oled_write_ln(wpm_str, false); + if (host_keyboard_led_state().caps_lock) + { + oled_write_P(PSTR("CAPS: On "), false); + } + else + { + oled_write_P(PSTR("CAPS: Off "), false); + } + + if (keymap_config.nkro) + { + oled_write_ln("NKRO: On", false); + } + else + { + oled_write_ln("NKRO: Off", false); + } + + uint8_t brightness = rgblight_get_val(); + char brightness_str[255]; + snprintf(brightness_str, sizeof(brightness_str), "LED Brightness: %03u", brightness); + oled_write_ln(brightness_str, false); + oled_write_ln(PSTR("P: 0x6F64 V: 0x73CA"), false); } //Static images -static void render_caps(void) { - static const char PROGMEM my_caps[] = { - 0,128,192,192,248,120, 8, 8, 24, 24, 48, 96, 96,176, 24, 12, 4, 6, 6, 30, 60, 48, 48,240,240, 16, 16, 16, 16, 16, 16, 16, 16, 16,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 16, 16, 16,144,208,208,248,120, 24, 24, 24, 24, 48, 96, 96,176, 24, 12, 4, 6, 6, 30, 60, 48, 48,240,224, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 31, 56, 64,128,128,128,192,192,192,224,192,225,255,240,240,128,128, 64, 64, 48, 24, 7, 7, 6, 4,140,216,120, 48, 0, 0, 0,128,128,128,128,128, 0, 0, 0,240,248, 12, 12, 12, 12, 12, 28, 56, 0, 0,240,248,156, 12, 12, 12, 12,156,248,240, 0, 0,248,252,156, 12, 12, 12, 12,152,240, 0, 0, 32,112,216,140,140,140, 12, 12, 4, 0, 0, 0, 0,128,128,128,128,128, 0, 0, 0, 7, 31, 56, 64,128,128,128,192,192,192,224,192,225,255,240,240,128,128, 64, 64, 48, 24, 7, 7, 6, 4,140,216,120, 48, 0, - 0,224,240, 24, 4, 3, 1, 0, 0, 0, 0, 6,255,135, 7, 15, 31, 17, 49, 32, 32, 32, 96,224,224, 32, 48, 17, 27, 14, 4, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 15, 31, 48, 48, 48, 48, 48, 56, 28, 0, 0, 63, 63, 3, 1, 1, 1, 1, 3, 63, 63, 0, 0, 63, 63, 3, 3, 3, 3, 3, 1, 0, 0, 0, 16, 48, 48, 49, 49, 49, 27, 14, 4, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,224,240, 24, 4, 3, 1, 0, 0, 0, 0, 6,255,135, 7, 15, 31, 17, 49, 32, 32, 32, 96,224,224, 32, 48, 17, 27, 14, 4, 0, - 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96,120,124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96,120,124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, - }; - oled_write_raw_P(my_caps, sizeof(my_caps)); +static void render_caps(void) +{ + static + const char PROGMEM my_caps[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 240, 248, 12, 12, 12, 12, 12, 28, 56, 0, 0, 240, 248, 156, 12, 12, 12, 12, 156, 248, 240, 0, 0, 248, 252, 156, 12, 12, 12, 12, 152, 240, 0, 0, 32, 112, 216, 140, 140, 140, 12, 12, 4, 0, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, + 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 15, 31, 48, 48, 48, 48, 48, 56, 28, 0, 0, 63, 63, 3, 1, 1, 1, 1, 3, 63, 63, 0, 0, 63, 63, 3, 3, 3, 3, 3, 1, 0, 0, 0, 16, 48, 48, 49, 49, 49, 27, 14, 4, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, + 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, + }; + + oled_write_raw_P(my_caps, sizeof(my_caps)); } -static void render_logo(void) { - static const char PROGMEM my_logo[] = { - 0,128,192,192,248,120, 8, 8, 24, 24, 48, 96, 96,176, 24, 12, 4, 6, 6, 30, 60, 48, 48,240,240, 16, 16, 16, 16, 16, 16, 16, 16, 16,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 16, 16, 16,144,208,208,248,120, 24, 24, 24, 24, 48, 96, 96,176, 24, 12, 4, 6, 6, 30, 60, 48, 48,240,224, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 31, 56, 64,128,128,128,192,192,192,224,192,225,255,240,240,128,128, 64, 64, 48, 24, 7, 7, 6, 4,140,216,120, 48, 0, 48,120,204,204,204,204,204,140, 8, 0, 0,240,248, 12, 12, 12, 12, 12,248,240, 0, 0,248,252, 24, 48, 96, 96, 48, 24,252,248, 0, 0,248,252,140,140,140, 12, 8, 0, 0,252,252, 0, 0, 8, 12, 12, 12, 12,252,248, 0, 0,240,248, 12, 12,140, 76,248,240, 0, 7, 31, 56, 64,128,128,128,192,192,192,224,192,225,255,240,240,128,128, 64, 64, 48, 24, 7, 7, 6, 4,140,216,120, 48, 0, - 0,224,240, 24, 4, 3, 1, 0, 0, 0, 0, 6,255,135, 7, 15, 31, 17, 49, 32, 32, 32, 96,224,224, 32, 48, 17, 27, 14, 4, 0, 16, 48, 48, 48, 48, 48, 48, 63, 15, 0, 0, 15, 31, 48, 48, 48, 48, 48, 31, 15, 0, 0, 63, 31, 0, 0, 0, 0, 0, 0, 31, 63, 0, 0, 31, 63, 49, 49, 49, 48, 16, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 15, 31, 50, 49, 48, 48, 31, 15, 0,224,240, 24, 4, 3, 1, 0, 0, 0, 0, 6,255,135, 7, 15, 31, 17, 49, 32, 32, 32, 96,224,224, 32, 48, 17, 27, 14, 4, 0, - 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96,120,124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96,120,124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, - }; - oled_write_raw_P(my_logo, sizeof(my_logo));} +static void render_logo(void) +{ + static + const char PROGMEM my_logo[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 48, 120, 204, 204, 204, 204, 204, 140, 8, 0, 0, 240, 248, 12, 12, 12, 12, 12, 248, 240, 0, 0, 248, 252, 24, 48, 96, 96, 48, 24, 252, 248, 0, 0, 248, 252, 140, 140, 140, 12, 8, 0, 0, 252, 252, 0, 0, 8, 12, 12, 12, 12, 252, 248, 0, 0, 240, 248, 12, 12, 140, 76, 248, 240, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, + 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 16, 48, 48, 48, 48, 48, 48, 63, 15, 0, 0, 15, 31, 48, 48, 48, 48, 48, 31, 15, 0, 0, 63, 31, 0, 0, 0, 0, 0, 0, 31, 63, 0, 0, 31, 63, 49, 49, 49, 48, 16, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 15, 31, 50, 49, 48, 48, 31, 15, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, + 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, + }; + + oled_write_raw_P(my_logo, sizeof(my_logo)); +} //Render chosen display -void render_oled_display(void) { - if (oled_mode == 0) { - if (host_keyboard_led_state().caps_lock) { - render_caps(); - } else { - render_logo(); - } - } else if (oled_mode == 1) { - render_stats(); - } +void render_oled_display(void) +{ + if (oled_mode == 0) + { + if (host_keyboard_led_state().caps_lock) + { + render_caps(); + } + else + { + render_logo(); + } + } + else if (oled_mode == 1) + { + render_stats(); + } } //Rotate 180 degrees -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; - } +oled_rotation_t oled_init_user(oled_rotation_t rotation) +{ + return OLED_ROTATION_180; +} -bool oled_task_user(void) { - render_oled_display(); - return false; +bool oled_task_user(void) +{ + render_oled_display(); + return false; } #endif //Record keypress -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_ESC: - if (record->event.pressed) { - if (timer_elapsed(esc_timer) > 250) { - esc_press_count = 0; - } - esc_press_count++; - esc_timer = timer_read(); - - if (esc_press_count == 3) { - oled_clear(); - oled_mode = (oled_mode == 0) ? 1 : 0; - esc_press_count = 0; - } - } - break; - } - return true; -} +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { + case KC_ESC: + if (record->event.pressed) + { + if (timer_elapsed(esc_timer) > 250) + { + esc_press_count = 0; + } + + esc_press_count++; + esc_timer = timer_read(); + if (esc_press_count == 3) + { + oled_clear(); + oled_mode = (oled_mode == 0) ? 1 : 0; + esc_press_count = 0; + } + } + + break; + } + + return true; +} diff --git a/keyboards/somei70/keymaps/default/rules.mk b/keyboards/somei70/keymaps/default/rules.mk index 842a2a32bca7..9f96fccac345 100644 --- a/keyboards/somei70/keymaps/default/rules.mk +++ b/keyboards/somei70/keymaps/default/rules.mk @@ -1,3 +1,2 @@ -VIA_ENABLE = yes OLED_ENABLE = yes OLED_DRIVER = ssd1306 diff --git a/keyboards/somei70/rules.mk b/keyboards/somei70/rules.mk deleted file mode 100644 index 6e7633bfe015..000000000000 --- a/keyboards/somei70/rules.mk +++ /dev/null @@ -1 +0,0 @@ -# This file intentionally left blank From 190cb4bbd5d54e1ddda0b99e23eb4687e8aa0933 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 27 Sep 2024 13:54:52 +0100 Subject: [PATCH 03/14] keymap via --- keyboards/somei70/keymaps/default/keymap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/keyboards/somei70/keymaps/default/keymap.c b/keyboards/somei70/keymaps/default/keymap.c index b9224035091b..ab4378c76825 100644 --- a/keyboards/somei70/keymaps/default/keymap.c +++ b/keyboards/somei70/keymaps/default/keymap.c @@ -71,8 +71,7 @@ void render_stats(void) //Static images static void render_caps(void) { - static - const char PROGMEM my_caps[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, + static const char PROGMEM my_caps[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 240, 248, 12, 12, 12, 12, 12, 28, 56, 0, 0, 240, 248, 156, 12, 12, 12, 12, 156, 248, 240, 0, 0, 248, 252, 156, 12, 12, 12, 12, 152, 240, 0, 0, 32, 112, 216, 140, 140, 140, 12, 12, 4, 0, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 15, 31, 48, 48, 48, 48, 48, 56, 28, 0, 0, 63, 63, 3, 1, 1, 1, 1, 3, 63, 63, 0, 0, 63, 63, 3, 3, 3, 3, 3, 1, 0, 0, 0, 16, 48, 48, 49, 49, 49, 27, 14, 4, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, @@ -83,8 +82,7 @@ static void render_caps(void) static void render_logo(void) { - static - const char PROGMEM my_logo[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, + static const char PROGMEM my_logo[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 48, 120, 204, 204, 204, 204, 204, 140, 8, 0, 0, 240, 248, 12, 12, 12, 12, 12, 248, 240, 0, 0, 248, 252, 24, 48, 96, 96, 48, 24, 252, 248, 0, 0, 248, 252, 140, 140, 140, 12, 8, 0, 0, 252, 252, 0, 0, 8, 12, 12, 12, 12, 252, 248, 0, 0, 240, 248, 12, 12, 140, 76, 248, 240, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 16, 48, 48, 48, 48, 48, 48, 63, 15, 0, 0, 15, 31, 48, 48, 48, 48, 48, 31, 15, 0, 0, 63, 31, 0, 0, 0, 0, 0, 0, 31, 63, 0, 0, 31, 63, 49, 49, 49, 48, 16, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 15, 31, 50, 49, 48, 48, 31, 15, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, From 24ec28a6a49770d5ef7bf527c8f7b7688b27c0d4 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 27 Sep 2024 13:56:15 +0100 Subject: [PATCH 04/14] Create rules.mk --- keyboards/somei70/keymaps/via/rules.mk | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 keyboards/somei70/keymaps/via/rules.mk diff --git a/keyboards/somei70/keymaps/via/rules.mk b/keyboards/somei70/keymaps/via/rules.mk new file mode 100644 index 000000000000..842a2a32bca7 --- /dev/null +++ b/keyboards/somei70/keymaps/via/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +OLED_ENABLE = yes +OLED_DRIVER = ssd1306 From 6451e5494a10441cde209bdfe39bd45c15643828 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 27 Sep 2024 13:56:32 +0100 Subject: [PATCH 05/14] Add files via upload --- keyboards/somei70/keymaps/via/keymap.c | 157 +++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 keyboards/somei70/keymaps/via/keymap.c diff --git a/keyboards/somei70/keymaps/via/keymap.c b/keyboards/somei70/keymaps/via/keymap.c new file mode 100644 index 000000000000..b9224035091b --- /dev/null +++ b/keyboards/somei70/keymaps/via/keymap.c @@ -0,0 +1,157 @@ +// Copyright 2024 James Gzowski +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H + +enum custom_layer { + _LAYERA, + _LAYERB, + _LAYERC +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_LAYERA] = LAYOUT_5x15( + KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC, + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, + KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,KC_MUTE,KC_ENT ,KC_RALT,MO(_LAYERB) ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT +), + [_LAYERB] = LAYOUT_5x15( + KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, + KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, + KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______ ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT +), + [_LAYERC] = LAYOUT_5x15( + KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, + KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, + KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______ ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT +) +}; + +#ifdef OLED_ENABLE +static uint8_t oled_mode = 0; +static uint8_t esc_press_count = 0; +static uint16_t esc_timer = 0; + +//Stats display +void render_stats(void) +{ + char wpm_str[10]; + snprintf(wpm_str, sizeof(wpm_str), "WPM: %03u", get_current_wpm()); + oled_write_ln(wpm_str, false); + if (host_keyboard_led_state().caps_lock) + { + oled_write_P(PSTR("CAPS: On "), false); + } + else + { + oled_write_P(PSTR("CAPS: Off "), false); + } + + if (keymap_config.nkro) + { + oled_write_ln("NKRO: On", false); + } + else + { + oled_write_ln("NKRO: Off", false); + } + + uint8_t brightness = rgblight_get_val(); + char brightness_str[255]; + snprintf(brightness_str, sizeof(brightness_str), "LED Brightness: %03u", brightness); + oled_write_ln(brightness_str, false); + oled_write_ln(PSTR("P: 0x6F64 V: 0x73CA"), false); +} + +//Static images +static void render_caps(void) +{ + static + const char PROGMEM my_caps[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 240, 248, 12, 12, 12, 12, 12, 28, 56, 0, 0, 240, 248, 156, 12, 12, 12, 12, 156, 248, 240, 0, 0, 248, 252, 156, 12, 12, 12, 12, 152, 240, 0, 0, 32, 112, 216, 140, 140, 140, 12, 12, 4, 0, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, + 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 15, 31, 48, 48, 48, 48, 48, 56, 28, 0, 0, 63, 63, 3, 1, 1, 1, 1, 3, 63, 63, 0, 0, 63, 63, 3, 3, 3, 3, 3, 1, 0, 0, 0, 16, 48, 48, 49, 49, 49, 27, 14, 4, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, + 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, + }; + + oled_write_raw_P(my_caps, sizeof(my_caps)); +} + +static void render_logo(void) +{ + static + const char PROGMEM my_logo[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 48, 120, 204, 204, 204, 204, 204, 140, 8, 0, 0, 240, 248, 12, 12, 12, 12, 12, 248, 240, 0, 0, 248, 252, 24, 48, 96, 96, 48, 24, 252, 248, 0, 0, 248, 252, 140, 140, 140, 12, 8, 0, 0, 252, 252, 0, 0, 8, 12, 12, 12, 12, 252, 248, 0, 0, 240, 248, 12, 12, 140, 76, 248, 240, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, + 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 16, 48, 48, 48, 48, 48, 48, 63, 15, 0, 0, 15, 31, 48, 48, 48, 48, 48, 31, 15, 0, 0, 63, 31, 0, 0, 0, 0, 0, 0, 31, 63, 0, 0, 31, 63, 49, 49, 49, 48, 16, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 15, 31, 50, 49, 48, 48, 31, 15, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, + 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, + }; + + oled_write_raw_P(my_logo, sizeof(my_logo)); +} + +//Render chosen display +void render_oled_display(void) +{ + if (oled_mode == 0) + { + if (host_keyboard_led_state().caps_lock) + { + render_caps(); + } + else + { + render_logo(); + } + } + else if (oled_mode == 1) + { + render_stats(); + } +} + +//Rotate 180 degrees +oled_rotation_t oled_init_user(oled_rotation_t rotation) +{ + return OLED_ROTATION_180; +} + +bool oled_task_user(void) +{ + render_oled_display(); + return false; +} +#endif + +//Record keypress +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { + case KC_ESC: + if (record->event.pressed) + { + if (timer_elapsed(esc_timer) > 250) + { + esc_press_count = 0; + } + + esc_press_count++; + esc_timer = timer_read(); + + if (esc_press_count == 3) + { + oled_clear(); + oled_mode = (oled_mode == 0) ? 1 : 0; + esc_press_count = 0; + } + } + + break; + } + + return true; +} From 05fd86dd793edecccacd3bb98aefa1814030ddea Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 27 Sep 2024 14:02:29 +0100 Subject: [PATCH 06/14] Delete keyboards/somei70/keymaps/via directory --- keyboards/somei70/keymaps/via/keymap.c | 157 ------------------------- keyboards/somei70/keymaps/via/rules.mk | 3 - 2 files changed, 160 deletions(-) delete mode 100644 keyboards/somei70/keymaps/via/keymap.c delete mode 100644 keyboards/somei70/keymaps/via/rules.mk diff --git a/keyboards/somei70/keymaps/via/keymap.c b/keyboards/somei70/keymaps/via/keymap.c deleted file mode 100644 index b9224035091b..000000000000 --- a/keyboards/somei70/keymaps/via/keymap.c +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2024 James Gzowski -// SPDX-License-Identifier: GPL-2.0-or-later -#include QMK_KEYBOARD_H - -enum custom_layer { - _LAYERA, - _LAYERB, - _LAYERC -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_LAYERA] = LAYOUT_5x15( - KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC, - KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, - KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, - KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, - KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,KC_MUTE,KC_ENT ,KC_RALT,MO(_LAYERB) ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT -), - [_LAYERB] = LAYOUT_5x15( - KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, - KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, - KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, - KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, - KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______ ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT -), - [_LAYERC] = LAYOUT_5x15( - KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, - KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, - KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, - KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, - KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______ ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT -) -}; - -#ifdef OLED_ENABLE -static uint8_t oled_mode = 0; -static uint8_t esc_press_count = 0; -static uint16_t esc_timer = 0; - -//Stats display -void render_stats(void) -{ - char wpm_str[10]; - snprintf(wpm_str, sizeof(wpm_str), "WPM: %03u", get_current_wpm()); - oled_write_ln(wpm_str, false); - if (host_keyboard_led_state().caps_lock) - { - oled_write_P(PSTR("CAPS: On "), false); - } - else - { - oled_write_P(PSTR("CAPS: Off "), false); - } - - if (keymap_config.nkro) - { - oled_write_ln("NKRO: On", false); - } - else - { - oled_write_ln("NKRO: Off", false); - } - - uint8_t brightness = rgblight_get_val(); - char brightness_str[255]; - snprintf(brightness_str, sizeof(brightness_str), "LED Brightness: %03u", brightness); - oled_write_ln(brightness_str, false); - oled_write_ln(PSTR("P: 0x6F64 V: 0x73CA"), false); -} - -//Static images -static void render_caps(void) -{ - static - const char PROGMEM my_caps[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 240, 248, 12, 12, 12, 12, 12, 28, 56, 0, 0, 240, 248, 156, 12, 12, 12, 12, 156, 248, 240, 0, 0, 248, 252, 156, 12, 12, 12, 12, 152, 240, 0, 0, 32, 112, 216, 140, 140, 140, 12, 12, 4, 0, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, - 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 15, 31, 48, 48, 48, 48, 48, 56, 28, 0, 0, 63, 63, 3, 1, 1, 1, 1, 3, 63, 63, 0, 0, 63, 63, 3, 3, 3, 3, 3, 1, 0, 0, 0, 16, 48, 48, 49, 49, 49, 27, 14, 4, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, - 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, - }; - - oled_write_raw_P(my_caps, sizeof(my_caps)); -} - -static void render_logo(void) -{ - static - const char PROGMEM my_logo[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 48, 120, 204, 204, 204, 204, 204, 140, 8, 0, 0, 240, 248, 12, 12, 12, 12, 12, 248, 240, 0, 0, 248, 252, 24, 48, 96, 96, 48, 24, 252, 248, 0, 0, 248, 252, 140, 140, 140, 12, 8, 0, 0, 252, 252, 0, 0, 8, 12, 12, 12, 12, 252, 248, 0, 0, 240, 248, 12, 12, 140, 76, 248, 240, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, - 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 16, 48, 48, 48, 48, 48, 48, 63, 15, 0, 0, 15, 31, 48, 48, 48, 48, 48, 31, 15, 0, 0, 63, 31, 0, 0, 0, 0, 0, 0, 31, 63, 0, 0, 31, 63, 49, 49, 49, 48, 16, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 15, 31, 50, 49, 48, 48, 31, 15, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, - 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, - }; - - oled_write_raw_P(my_logo, sizeof(my_logo)); -} - -//Render chosen display -void render_oled_display(void) -{ - if (oled_mode == 0) - { - if (host_keyboard_led_state().caps_lock) - { - render_caps(); - } - else - { - render_logo(); - } - } - else if (oled_mode == 1) - { - render_stats(); - } -} - -//Rotate 180 degrees -oled_rotation_t oled_init_user(oled_rotation_t rotation) -{ - return OLED_ROTATION_180; -} - -bool oled_task_user(void) -{ - render_oled_display(); - return false; -} -#endif - -//Record keypress -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - switch (keycode) - { - case KC_ESC: - if (record->event.pressed) - { - if (timer_elapsed(esc_timer) > 250) - { - esc_press_count = 0; - } - - esc_press_count++; - esc_timer = timer_read(); - - if (esc_press_count == 3) - { - oled_clear(); - oled_mode = (oled_mode == 0) ? 1 : 0; - esc_press_count = 0; - } - } - - break; - } - - return true; -} diff --git a/keyboards/somei70/keymaps/via/rules.mk b/keyboards/somei70/keymaps/via/rules.mk deleted file mode 100644 index 842a2a32bca7..000000000000 --- a/keyboards/somei70/keymaps/via/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -VIA_ENABLE = yes -OLED_ENABLE = yes -OLED_DRIVER = ssd1306 From e4a8a85e573afcb23afc41035d98d94dc672ce83 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 27 Sep 2024 15:40:29 +0100 Subject: [PATCH 07/14] Fixed RGB and matrix --- keyboards/somei70/keyboard.json | 124 ++++++++++++++++---------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/keyboards/somei70/keyboard.json b/keyboards/somei70/keyboard.json index b5f70eda1325..c36669abbba3 100644 --- a/keyboards/somei70/keyboard.json +++ b/keyboards/somei70/keyboard.json @@ -42,17 +42,17 @@ {"matrix": [0, 0], "x": 0, "y": 0, "flags": 4}, {"matrix": [0, 1], "x": 16, "y": 0, "flags": 4}, {"matrix": [0, 2], "x": 33, "y": 0, "flags": 4}, - {"matrix": [0, 3], "x": 49, "y": 0, "flags": 4}, - {"matrix": [0, 4], "x": 65, "y": 0, "flags": 4}, - {"matrix": [0, 5], "x": 81, "y": 0, "flags": 4}, - {"matrix": [0, 6], "x": 86, "y": 0, "flags": 4}, - {"matrix": [0, 7], "x": 102, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 50, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 67, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 84, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 101, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 118, "y": 0, "flags": 4}, {"matrix": [0, 8], "x": 118, "y": 0, "flags": 4}, - {"matrix": [0, 9], "x": 134, "y": 0, "flags": 4}, - {"matrix": [0, 10], "x": 150, "y": 0, "flags": 4}, - {"matrix": [0, 11], "x": 166, "y": 0, "flags": 4}, - {"matrix": [0, 12], "x": 182, "y": 0, "flags": 4}, - {"matrix": [0, 13], "x": 206, "y": 0, "flags": 4} + {"matrix": [0, 9], "x": 135, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 152, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 169, "y": 0, "flags": 4}, + {"matrix": [0, 12], "x": 186, "y": 0, "flags": 4}, + {"matrix": [0, 13], "x": 211, "y": 0, "flags": 4} ], "led_flush_limit": 14, "led_process_limit": 5, @@ -87,61 +87,61 @@ {"matrix": [0, 12], "x": 12, "y": 0}, {"matrix": [0, 13], "x": 13, "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": [1, 6], "x": 6, "y": 1}, - {"matrix": [1, 7], "x": 7, "y": 1}, - {"matrix": [1, 8], "x": 8, "y": 1}, - {"matrix": [1, 9], "x": 9, "y": 1}, - {"matrix": [1, 10], "x": 10, "y": 1}, - {"matrix": [1, 11], "x": 11, "y": 1}, - {"matrix": [1, 12], "x": 12, "y": 1}, - {"matrix": [1, 13], "x": 13, "y": 1}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 13], "x": 13.5, "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": [2, 6], "x": 6, "y": 2}, - {"matrix": [2, 7], "x": 7, "y": 2}, - {"matrix": [2, 8], "x": 8, "y": 2}, - {"matrix": [2, 9], "x": 9, "y": 2}, - {"matrix": [2, 10], "x": 10, "y": 2}, - {"matrix": [2, 11], "x": 11, "y": 2}, - {"matrix": [2, 12], "x": 12, "y": 2}, - {"matrix": [2, 13], "x": 13, "y": 2}, - {"matrix": [2, 14], "x": 14, "y": 2}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 12], "x": 12.75, "y": 2}, + {"matrix": [2, 13], "x": 13.75, "y": 2}, + {"matrix": [2, 14], "x": 15, "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": [3, 7], "x": 7, "y": 3}, - {"matrix": [3, 8], "x": 8, "y": 3}, - {"matrix": [3, 9], "x": 9, "y": 3}, - {"matrix": [3, 10], "x": 10, "y": 3}, - {"matrix": [3, 11], "x": 11, "y": 3}, - {"matrix": [3, 12], "x": 12, "y": 3}, - {"matrix": [3, 13], "x": 13, "y": 3}, - {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 1], "x": 2, "y": 3}, + {"matrix": [3, 2], "x": 3, "y": 3}, + {"matrix": [3, 3], "x": 4, "y": 3}, + {"matrix": [3, 4], "x": 5, "y": 3}, + {"matrix": [3, 5], "x": 6, "y": 3}, + {"matrix": [3, 6], "x": 7, "y": 3}, + {"matrix": [3, 7], "x": 8, "y": 3}, + {"matrix": [3, 8], "x": 9, "y": 3}, + {"matrix": [3, 9], "x": 10, "y": 3}, + {"matrix": [3, 10], "x": 11, "y": 3}, + {"matrix": [3, 11], "x": 12, "y": 3}, + {"matrix": [3, 12], "x": 13, "y": 3}, + {"matrix": [3, 13], "x": 14, "y": 3}, + {"matrix": [3, 14], "x": 15, "y": 3}, {"matrix": [4, 0], "x": 0, "y": 4}, - {"matrix": [4, 1], "x": 1, "y": 4}, - {"matrix": [4, 2], "x": 2, "y": 4}, - {"matrix": [4, 3], "x": 3, "y": 4}, - {"matrix": [4, 4], "x": 4, "y": 4}, - {"matrix": [4, 5], "x": 5, "y": 4}, - {"matrix": [4, 6], "x": 6, "y": 4}, - {"matrix": [4, 7], "x": 7, "y": 4}, - {"matrix": [4, 8], "x": 8, "y": 4}, - {"matrix": [4, 9], "x": 9, "y": 4}, - {"matrix": [4, 10], "x": 10, "y": 4}, - {"matrix": [4, 11], "x": 11, "y": 4} + {"matrix": [4, 1], "x": 1.25, "y": 4}, + {"matrix": [4, 2], "x": 2.5, "y": 4}, + {"matrix": [4, 3], "x": 3.75, "y": 4}, + {"matrix": [4, 4], "x": 6, "y": 4}, + {"matrix": [4, 5], "x": 7.75, "y": 4}, + {"matrix": [4, 6], "x": 10, "y": 4}, + {"matrix": [4, 7], "x": 11, "y": 4}, + {"matrix": [4, 8], "x": 12, "y": 4}, + {"matrix": [4, 9], "x": 13, "y": 4}, + {"matrix": [4, 10], "x": 14, "y": 4}, + {"matrix": [4, 11], "x": 15, "y": 4} ] } } From d34406a867b511bef55c4f3207dabf4db52d9bcb Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Sat, 28 Sep 2024 14:06:59 +0100 Subject: [PATCH 08/14] Layout corrections and LED positions --- keyboards/somei70/keyboard.json | 164 ++++++++++++++++---------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/keyboards/somei70/keyboard.json b/keyboards/somei70/keyboard.json index c36669abbba3..70f57d5ff5cd 100644 --- a/keyboards/somei70/keyboard.json +++ b/keyboards/somei70/keyboard.json @@ -41,18 +41,18 @@ "layout": [ {"matrix": [0, 0], "x": 0, "y": 0, "flags": 4}, {"matrix": [0, 1], "x": 16, "y": 0, "flags": 4}, - {"matrix": [0, 2], "x": 33, "y": 0, "flags": 4}, - {"matrix": [0, 3], "x": 50, "y": 0, "flags": 4}, - {"matrix": [0, 4], "x": 67, "y": 0, "flags": 4}, - {"matrix": [0, 5], "x": 84, "y": 0, "flags": 4}, - {"matrix": [0, 6], "x": 101, "y": 0, "flags": 4}, - {"matrix": [0, 7], "x": 118, "y": 0, "flags": 4}, - {"matrix": [0, 8], "x": 118, "y": 0, "flags": 4}, - {"matrix": [0, 9], "x": 135, "y": 0, "flags": 4}, - {"matrix": [0, 10], "x": 152, "y": 0, "flags": 4}, - {"matrix": [0, 11], "x": 169, "y": 0, "flags": 4}, - {"matrix": [0, 12], "x": 186, "y": 0, "flags": 4}, - {"matrix": [0, 13], "x": 211, "y": 0, "flags": 4} + {"matrix": [0, 2], "x": 32, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 48, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 64, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 80, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 96, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 112, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 128, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 144, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 160, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 176, "y": 0, "flags": 4}, + {"matrix": [0, 12], "x": 192, "y": 0, "flags": 4}, + {"matrix": [0, 13], "x": 212, "y": 0, "flags": 4} ], "led_flush_limit": 14, "led_process_limit": 5, @@ -72,76 +72,76 @@ "layouts": { "LAYOUT_5x15": { "layout": [ - {"matrix": [0, 0], "x": 0, "y": 0}, - {"matrix": [0, 1], "x": 1, "y": 0}, - {"matrix": [0, 2], "x": 2, "y": 0}, - {"matrix": [0, 3], "x": 3, "y": 0}, - {"matrix": [0, 4], "x": 4, "y": 0}, - {"matrix": [0, 5], "x": 5, "y": 0}, - {"matrix": [0, 6], "x": 6, "y": 0}, - {"matrix": [0, 7], "x": 7, "y": 0}, - {"matrix": [0, 8], "x": 8, "y": 0}, - {"matrix": [0, 9], "x": 9, "y": 0}, - {"matrix": [0, 10], "x": 10, "y": 0}, - {"matrix": [0, 11], "x": 11, "y": 0}, - {"matrix": [0, 12], "x": 12, "y": 0}, - {"matrix": [0, 13], "x": 13, "y": 0}, - {"matrix": [1, 0], "x": 0, "y": 1}, - {"matrix": [1, 1], "x": 1.5, "y": 1}, - {"matrix": [1, 2], "x": 2.5, "y": 1}, - {"matrix": [1, 3], "x": 3.5, "y": 1}, - {"matrix": [1, 4], "x": 4.5, "y": 1}, - {"matrix": [1, 5], "x": 5.5, "y": 1}, - {"matrix": [1, 6], "x": 6.5, "y": 1}, - {"matrix": [1, 7], "x": 7.5, "y": 1}, - {"matrix": [1, 8], "x": 8.5, "y": 1}, - {"matrix": [1, 9], "x": 9.5, "y": 1}, - {"matrix": [1, 10], "x": 10.5, "y": 1}, - {"matrix": [1, 11], "x": 11.5, "y": 1}, - {"matrix": [1, 12], "x": 12.5, "y": 1}, - {"matrix": [1, 13], "x": 13.5, "y": 1}, - {"matrix": [2, 0], "x": 0, "y": 2}, - {"matrix": [2, 1], "x": 1.75, "y": 2}, - {"matrix": [2, 2], "x": 2.75, "y": 2}, - {"matrix": [2, 3], "x": 3.75, "y": 2}, - {"matrix": [2, 4], "x": 4.75, "y": 2}, - {"matrix": [2, 5], "x": 5.75, "y": 2}, - {"matrix": [2, 6], "x": 6.75, "y": 2}, - {"matrix": [2, 7], "x": 7.75, "y": 2}, - {"matrix": [2, 8], "x": 8.75, "y": 2}, - {"matrix": [2, 9], "x": 9.75, "y": 2}, - {"matrix": [2, 10], "x": 10.75, "y": 2}, - {"matrix": [2, 11], "x": 11.75, "y": 2}, - {"matrix": [2, 12], "x": 12.75, "y": 2}, - {"matrix": [2, 13], "x": 13.75, "y": 2}, - {"matrix": [2, 14], "x": 15, "y": 2}, - {"matrix": [3, 0], "x": 0, "y": 3}, - {"matrix": [3, 1], "x": 2, "y": 3}, - {"matrix": [3, 2], "x": 3, "y": 3}, - {"matrix": [3, 3], "x": 4, "y": 3}, - {"matrix": [3, 4], "x": 5, "y": 3}, - {"matrix": [3, 5], "x": 6, "y": 3}, - {"matrix": [3, 6], "x": 7, "y": 3}, - {"matrix": [3, 7], "x": 8, "y": 3}, - {"matrix": [3, 8], "x": 9, "y": 3}, - {"matrix": [3, 9], "x": 10, "y": 3}, - {"matrix": [3, 10], "x": 11, "y": 3}, - {"matrix": [3, 11], "x": 12, "y": 3}, - {"matrix": [3, 12], "x": 13, "y": 3}, - {"matrix": [3, 13], "x": 14, "y": 3}, - {"matrix": [3, 14], "x": 15, "y": 3}, - {"matrix": [4, 0], "x": 0, "y": 4}, - {"matrix": [4, 1], "x": 1.25, "y": 4}, - {"matrix": [4, 2], "x": 2.5, "y": 4}, - {"matrix": [4, 3], "x": 3.75, "y": 4}, - {"matrix": [4, 4], "x": 6, "y": 4}, - {"matrix": [4, 5], "x": 7.75, "y": 4}, - {"matrix": [4, 6], "x": 10, "y": 4}, - {"matrix": [4, 7], "x": 11, "y": 4}, - {"matrix": [4, 8], "x": 12, "y": 4}, - {"matrix": [4, 9], "x": 13, "y": 4}, - {"matrix": [4, 10], "x": 14, "y": 4}, - {"matrix": [4, 11], "x": 15, "y": 4} + {"label": "ESC", "matrix": [0, 0], "x": 0, "y": 0}, + {"label": "1", "matrix": [0, 1], "x": 1, "y": 0}, + {"label": "2", "matrix": [0, 2], "x": 2, "y": 0}, + {"label": "3", "matrix": [0, 3], "x": 3, "y": 0}, + {"label": "4", "matrix": [0, 4], "x": 4, "y": 0}, + {"label": "5", "matrix": [0, 5], "x": 5, "y": 0}, + {"label": "6", "matrix": [0, 6], "x": 6, "y": 0}, + {"label": "7", "matrix": [0, 7], "x": 7, "y": 0}, + {"label": "8", "matrix": [0, 8], "x": 8, "y": 0}, + {"label": "9", "matrix": [0, 9], "x": 9, "y": 0}, + {"label": "0", "matrix": [0, 10], "x": 10, "y": 0}, + {"label": "MINS", "matrix": [0, 11], "x": 11, "y": 0}, + {"label": "EQL", "matrix": [0, 12], "x": 12, "y": 0}, + {"label": "BSPC", "matrix": [0, 13], "x": 13, "y": 0, "w": 2}, + {"label": "TAB", "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"label": "Q", "matrix": [1, 1], "x": 1.5, "y": 1}, + {"label": "W", "matrix": [1, 2], "x": 2.5, "y": 1}, + {"label": "E", "matrix": [1, 3], "x": 3.5, "y": 1}, + {"label": "R", "matrix": [1, 4], "x": 4.5, "y": 1}, + {"label": "T", "matrix": [1, 5], "x": 5.5, "y": 1}, + {"label": "Y", "matrix": [1, 6], "x": 6.5, "y": 1}, + {"label": "U", "matrix": [1, 7], "x": 7.5, "y": 1}, + {"label": "I", "matrix": [1, 8], "x": 8.5, "y": 1}, + {"label": "O", "matrix": [1, 9], "x": 9.5, "y": 1}, + {"label": "P", "matrix": [1, 10], "x": 10.5, "y": 1}, + {"label": "LBRC", "matrix": [1, 11], "x": 11.5, "y": 1}, + {"label": "RBRC", "matrix": [1, 12], "x": 12.5, "y": 1}, + {"label": "BSLS", "matrix": [1, 13], "x": 13.5, "y": 1, "w": 1.5}, + {"label": "CAPS", "matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"label": "A", "matrix": [2, 1], "x": 1.75, "y": 2}, + {"label": "S", "matrix": [2, 2], "x": 2.75, "y": 2}, + {"label": "D", "matrix": [2, 3], "x": 3.75, "y": 2}, + {"label": "F", "matrix": [2, 4], "x": 4.75, "y": 2}, + {"label": "G", "matrix": [2, 5], "x": 5.75, "y": 2}, + {"label": "H", "matrix": [2, 6], "x": 6.75, "y": 2}, + {"label": "J", "matrix": [2, 7], "x": 7.75, "y": 2}, + {"label": "K", "matrix": [2, 8], "x": 8.75, "y": 2}, + {"label": "L", "matrix": [2, 9], "x": 9.75, "y": 2}, + {"label": "SCLN", "matrix": [2, 10], "x": 10.75, "y": 2}, + {"label": "QLOT", "matrix": [2, 11], "x": 11.75, "y": 2}, + {"label": "GRV", "matrix": [2, 12], "x": 12.75, "y": 2}, + {"label": "DEL", "matrix": [2, 13], "x": 13.75, "y": 2, "w": 1.25}, + {"label": "PGUP", "matrix": [2, 14], "x": 15, "y": 2}, + {"label": "LSFT", "matrix": [3, 0], "x": 0, "y": 3, "w": 2}, + {"label": "Z", "matrix": [3, 1], "x": 2, "y": 3}, + {"label": "X", "matrix": [3, 2], "x": 3, "y": 3}, + {"label": "C", "matrix": [3, 3], "x": 4, "y": 3}, + {"label": "V", "matrix": [3, 4], "x": 5, "y": 3}, + {"label": "B", "matrix": [3, 5], "x": 6, "y": 3}, + {"label": "N", "matrix": [3, 6], "x": 7, "y": 3}, + {"label": "M", "matrix": [3, 7], "x": 8, "y": 3}, + {"label": "COMM", "matrix": [3, 8], "x": 9, "y": 3}, + {"label": "DOT", "matrix": [3, 9], "x": 10, "y": 3}, + {"label": "SLSH", "matrix": [3, 10], "x": 11, "y": 3}, + {"label": "RSFT", "matrix": [3, 11], "x": 12, "y": 3}, + {"label": "INS", "matrix": [3, 12], "x": 13, "y": 3}, + {"label": "UP", "matrix": [3, 13], "x": 14, "y": 3}, + {"label": "PGDN", "matrix": [3, 14], "x": 15, "y": 3}, + {"label": "RCTL", "matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, + {"label": "LGUI", "matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, + {"label": "LALT", "matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, + {"label": "SPC", "matrix": [4, 3], "x": 3.75, "y": 4, "w": 2.25}, + {"label": "MUTE", "matrix": [4, 4], "x": 6, "y": 4, "w": 1.75}, + {"label": "ENT", "matrix": [4, 5], "x": 7.75, "y": 4, "w": 2.25}, + {"label": "RALT", "matrix": [4, 6], "x": 10, "y": 4}, + {"label": "MO(1)", "matrix": [4, 7], "x": 11, "y": 4}, + {"label": "RCTL", "matrix": [4, 8], "x": 12, "y": 4}, + {"label": "LEFT", "matrix": [4, 9], "x": 13, "y": 4}, + {"label": "DOWN", "matrix": [4, 10], "x": 14, "y": 4}, + {"label": "RGHT", "matrix": [4, 11], "x": 15, "y": 4} ] } } From 3fd5ef876aeb84b302fd04ba5e6fe8d6c982883e Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Thu, 31 Oct 2024 13:42:06 +0000 Subject: [PATCH 09/14] removal of rules.mk --- keyboards/somei70/keymaps/default/rules.mk | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 keyboards/somei70/keymaps/default/rules.mk diff --git a/keyboards/somei70/keymaps/default/rules.mk b/keyboards/somei70/keymaps/default/rules.mk deleted file mode 100644 index 9f96fccac345..000000000000 --- a/keyboards/somei70/keymaps/default/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -OLED_ENABLE = yes -OLED_DRIVER = ssd1306 From 3b2b695ec9537f31650cc9482f97c4a40a7dc126 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 1 Nov 2024 16:16:38 +0000 Subject: [PATCH 10/14] Moved OLED Settings to somei70.c, formatted C removed TABs, removed _LAYERC --- keyboards/somei70/keymaps/default/keymap.c | 164 ++------------------- keyboards/somei70/somei70.c | 85 +++++++++++ 2 files changed, 99 insertions(+), 150 deletions(-) create mode 100644 keyboards/somei70/somei70.c diff --git a/keyboards/somei70/keymaps/default/keymap.c b/keyboards/somei70/keymaps/default/keymap.c index ab4378c76825..f420caffe5fb 100644 --- a/keyboards/somei70/keymaps/default/keymap.c +++ b/keyboards/somei70/keymaps/default/keymap.c @@ -1,155 +1,19 @@ // Copyright 2024 James Gzowski // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H - -enum custom_layer { - _LAYERA, - _LAYERB, - _LAYERC -}; - +enum custom_layer { _LAYERA, _LAYERB }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_LAYERA] = LAYOUT_5x15( - KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC, - KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, - KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, - KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, - KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,KC_MUTE,KC_ENT ,KC_RALT,MO(_LAYERB) ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT +[_LAYERA] = LAYOUT_5x15( + KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS , KC_EQL , KC_BSPC, + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC , KC_RBRC, KC_BSLS, + KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT , KC_GRV , KC_DEL , KC_PGUP, + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT , KC_INS , KC_UP , KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_MUTE, KC_ENT, KC_RALT, MO(_LAYERB), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - [_LAYERB] = LAYOUT_5x15( - KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, - KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, - KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, - KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, - KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______ ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT -), - [_LAYERC] = LAYOUT_5x15( - KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR, - KC_TAB ,RGB_MOD ,RGB_VAD,RGB_VAI,RGB_SPD,RGB_SPI,RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS, - KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_GRV , KC_DEL, KC_PGUP, - KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,KC_INS , KC_UP , KC_PGDN, - KC_LCTL,KC_LGUI ,KC_LALT ,KC_SPC ,RGB_TOG,KC_ENT ,KC_RALT,_______ ,KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT -) -}; - -#ifdef OLED_ENABLE -static uint8_t oled_mode = 0; -static uint8_t esc_press_count = 0; -static uint16_t esc_timer = 0; - -//Stats display -void render_stats(void) -{ - char wpm_str[10]; - snprintf(wpm_str, sizeof(wpm_str), "WPM: %03u", get_current_wpm()); - oled_write_ln(wpm_str, false); - if (host_keyboard_led_state().caps_lock) - { - oled_write_P(PSTR("CAPS: On "), false); - } - else - { - oled_write_P(PSTR("CAPS: Off "), false); - } - - if (keymap_config.nkro) - { - oled_write_ln("NKRO: On", false); - } - else - { - oled_write_ln("NKRO: Off", false); - } - - uint8_t brightness = rgblight_get_val(); - char brightness_str[255]; - snprintf(brightness_str, sizeof(brightness_str), "LED Brightness: %03u", brightness); - oled_write_ln(brightness_str, false); - oled_write_ln(PSTR("P: 0x6F64 V: 0x73CA"), false); -} - -//Static images -static void render_caps(void) -{ - static const char PROGMEM my_caps[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 240, 248, 12, 12, 12, 12, 12, 28, 56, 0, 0, 240, 248, 156, 12, 12, 12, 12, 156, 248, 240, 0, 0, 248, 252, 156, 12, 12, 12, 12, 152, 240, 0, 0, 32, 112, 216, 140, 140, 140, 12, 12, 4, 0, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, - 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 15, 31, 48, 48, 48, 48, 48, 56, 28, 0, 0, 63, 63, 3, 1, 1, 1, 1, 3, 63, 63, 0, 0, 63, 63, 3, 3, 3, 3, 3, 1, 0, 0, 0, 16, 48, 48, 49, 49, 49, 27, 14, 4, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, - 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, - }; - - oled_write_raw_P(my_caps, sizeof(my_caps)); -} - -static void render_logo(void) -{ - static const char PROGMEM my_logo[] = { 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 48, 120, 204, 204, 204, 204, 204, 140, 8, 0, 0, 240, 248, 12, 12, 12, 12, 12, 248, 240, 0, 0, 248, 252, 24, 48, 96, 96, 48, 24, 252, 248, 0, 0, 248, 252, 140, 140, 140, 12, 8, 0, 0, 252, 252, 0, 0, 8, 12, 12, 12, 12, 252, 248, 0, 0, 240, 248, 12, 12, 140, 76, 248, 240, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, - 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 16, 48, 48, 48, 48, 48, 48, 63, 15, 0, 0, 15, 31, 48, 48, 48, 48, 48, 31, 15, 0, 0, 63, 31, 0, 0, 0, 0, 0, 0, 31, 63, 0, 0, 31, 63, 49, 49, 49, 48, 16, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 15, 31, 50, 49, 48, 48, 31, 15, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, - 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, - }; - - oled_write_raw_P(my_logo, sizeof(my_logo)); -} - -//Render chosen display -void render_oled_display(void) -{ - if (oled_mode == 0) - { - if (host_keyboard_led_state().caps_lock) - { - render_caps(); - } - else - { - render_logo(); - } - } - else if (oled_mode == 1) - { - render_stats(); - } -} - -//Rotate 180 degrees -oled_rotation_t oled_init_user(oled_rotation_t rotation) -{ - return OLED_ROTATION_180; -} - -bool oled_task_user(void) -{ - render_oled_display(); - return false; -} -#endif - -//Record keypress -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - switch (keycode) - { - case KC_ESC: - if (record->event.pressed) - { - if (timer_elapsed(esc_timer) > 250) - { - esc_press_count = 0; - } - - esc_press_count++; - esc_timer = timer_read(); - - if (esc_press_count == 3) - { - oled_clear(); - oled_mode = (oled_mode == 0) ? 1 : 0; - esc_press_count = 0; - } - } - - break; - } - - return true; -} +[_LAYERB] = LAYOUT_5x15( + KC_ESC , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PSCR, + KC_TAB , RGB_MOD, RGB_VAD, RGB_VAI, RGB_SPD, RGB_SPI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, KC_P , KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_GRV , KC_DEL , KC_PGUP, + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_INS , KC_UP , KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , RGB_TOG, KC_ENT , KC_RALT, _______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +)}; diff --git a/keyboards/somei70/somei70.c b/keyboards/somei70/somei70.c new file mode 100644 index 000000000000..1d79c85e5e81 --- /dev/null +++ b/keyboards/somei70/somei70.c @@ -0,0 +1,85 @@ +#include QMK_KEYBOARD_H +#ifdef OLED_ENABLE +static uint8_t oled_mode = 0; +static uint8_t esc_press_count = 0; +static uint16_t esc_timer = 0; +// Stats display +void render_stats(void) { + char wpm_str[10]; + snprintf(wpm_str, sizeof(wpm_str), "WPM: %03u", get_current_wpm()); + oled_write_ln(wpm_str, false); + if (host_keyboard_led_state().caps_lock) { + oled_write_P(PSTR("CAPS: On "), false); + } else { + oled_write_P(PSTR("CAPS: Off "), false); + } + if (keymap_config.nkro) { + oled_write_ln("NKRO: On", false); + } else { + oled_write_ln("NKRO: Off", false); + } + uint8_t brightness = rgblight_get_val(); + char brightness_str[255]; + snprintf(brightness_str, sizeof(brightness_str), "LED Brightness: %03u", brightness); + oled_write_ln(brightness_str, false); + oled_write_ln(PSTR("P: 0x6F64 V: 0x73CA"), false); +} +// Static images +static void render_caps(void) { + static const char PROGMEM my_caps[] = { + 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 240, + 248, 12, 12, 12, 12, 12, 28, 56, 0, 0, 240, 248, 156, 12, 12, 12, 12, 156, 248, 240, 0, 0, 248, 252, 156, 12, 12, 12, 12, 152, 240, 0, 0, 32, 112, 216, 140, 140, 140, 12, 12, 4, 0, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 15, 31, 48, 48, 48, 48, 48, 56, 28, 0, 0, 63, 63, 3, 1, 1, 1, 1, 3, 63, 63, 0, 0, 63, 63, 3, 3, 3, 3, 3, 1, 0, 0, 0, 16, 48, 48, 49, 49, 49, 27, 14, 4, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(my_caps, sizeof(my_caps)); +} +static void render_logo(void) { + static const char PROGMEM my_logo[] = { + 0, 128, 192, 192, 248, 120, 8, 8, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 240, 16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 16, 16, 16, 144, 208, 208, 248, 120, 24, 24, 24, 24, 48, 96, 96, 176, 24, 12, 4, 6, 6, 30, 60, 48, 48, 240, 224, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 48, 120, 204, 204, 204, 204, 204, 140, 8, 0, 0, + 240, 248, 12, 12, 12, 12, 12, 248, 240, 0, 0, 248, 252, 24, 48, 96, 96, 48, 24, 252, 248, 0, 0, 248, 252, 140, 140, 140, 12, 8, 0, 0, 252, 252, 0, 0, 8, 12, 12, 12, 12, 252, 248, 0, 0, 240, 248, 12, 12, 140, 76, 248, 240, 0, 7, 31, 56, 64, 128, 128, 128, 192, 192, 192, 224, 192, 225, 255, 240, 240, 128, 128, 64, 64, 48, 24, 7, 7, 6, 4, 140, 216, 120, 48, 0, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 16, 48, 48, 48, 48, 48, 48, 63, 15, 0, 0, 15, 31, 48, 48, 48, 48, 48, 31, 15, 0, 0, 63, 31, 0, 0, 0, 0, 0, 0, 31, 63, 0, 0, 31, 63, 49, 49, 49, 48, 16, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 63, 63, + 0, 0, 15, 31, 50, 49, 48, 48, 31, 15, 0, 224, 240, 24, 4, 3, 1, 0, 0, 0, 0, 6, 255, 135, 7, 15, 31, 17, 49, 32, 32, 32, 96, 224, 224, 32, 48, 17, 27, 14, 4, 0, 0, 3, 7, 6, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 11, 15, 14, 30, 60, 48, 32, 48, 48, 24, 12, 7, 7, 12, 16, 32, 96, 96, 120, 124, 60, 12, 15, 7, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(my_logo, sizeof(my_logo)); +} +// Render chosen display +void render_oled_display(void) { + if (oled_mode == 0) { + if (host_keyboard_led_state().caps_lock) { + render_caps(); + } else { + render_logo(); + } + } else if (oled_mode == 1) { + render_stats(); + } +} +// Rotate 180 degrees +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} +bool oled_task_user(void) { + render_oled_display(); + return false; +} +// Record keypress +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_ESC: + if (record->event.pressed) { + if (timer_elapsed(esc_timer) > 250) { + esc_press_count = 0; + } + esc_press_count++; + esc_timer = timer_read(); + + if (esc_press_count == 3) { + oled_clear(); + oled_mode = (oled_mode == 0) ? 1 : 0; + esc_press_count = 0; + } + } + break; + } + return true; +} +#endif From 08669c1eb84dc2d875612d442d8a0b83c982f7e4 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 1 Nov 2024 16:19:16 +0000 Subject: [PATCH 11/14] Forgot to include license header --- keyboards/somei70/somei70.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/somei70/somei70.c b/keyboards/somei70/somei70.c index 1d79c85e5e81..fc97bfcde39f 100644 --- a/keyboards/somei70/somei70.c +++ b/keyboards/somei70/somei70.c @@ -1,3 +1,5 @@ +// Copyright 2024 James Gzowski +// SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H #ifdef OLED_ENABLE static uint8_t oled_mode = 0; From 31b606e98bd1fae386edbeaf387bdd7403fa4d01 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Fri, 1 Nov 2024 16:36:41 +0000 Subject: [PATCH 12/14] Further changes as per suggestions, replaced _user for _kb within somei70.c --- keyboards/somei70/somei70.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/keyboards/somei70/somei70.c b/keyboards/somei70/somei70.c index fc97bfcde39f..11199d78c21e 100644 --- a/keyboards/somei70/somei70.c +++ b/keyboards/somei70/somei70.c @@ -56,15 +56,18 @@ void render_oled_display(void) { } } // Rotate 180 degrees -oled_rotation_t oled_init_user(oled_rotation_t rotation) { +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; } -bool oled_task_user(void) { +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } render_oled_display(); return false; } // Record keypress -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case KC_ESC: if (record->event.pressed) { @@ -82,6 +85,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } break; } - return true; + return process_record_user(keycode, record); } #endif From c0df5873f03b2013b6a549e731a99182303b39d3 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Wed, 27 Nov 2024 15:24:42 +0000 Subject: [PATCH 13/14] Updated keymap 'changes in Nov24' --- keyboards/somei70/keymaps/default/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/somei70/keymaps/default/keymap.c b/keyboards/somei70/keymaps/default/keymap.c index f420caffe5fb..2569b8b207f5 100644 --- a/keyboards/somei70/keymaps/default/keymap.c +++ b/keyboards/somei70/keymaps/default/keymap.c @@ -12,8 +12,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_LAYERB] = LAYOUT_5x15( KC_ESC , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PSCR, - KC_TAB , RGB_MOD, RGB_VAD, RGB_VAI, RGB_SPD, RGB_SPI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, KC_P , KC_LBRC, KC_RBRC, KC_BSLS, + KC_TAB , RM_NEXT, RM_VALD, RM_VALU, RM_SPDD, RM_SPDU, RM_HUED, RM_HUEU, RM_SATD, RM_SATU, KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_GRV , KC_DEL , KC_PGUP, KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_INS , KC_UP , KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , RGB_TOG, KC_ENT , KC_RALT, _______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , RM_TOGG, KC_ENT , KC_RALT, _______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT )}; From 5f42c716b060211e837506ab31df3a87274d9be1 Mon Sep 17 00:00:00 2001 From: James Gzowski Date: Tue, 10 Dec 2024 16:32:50 +0000 Subject: [PATCH 14/14] Requested changes --- keyboards/somei70/somei70.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/keyboards/somei70/somei70.c b/keyboards/somei70/somei70.c index 11199d78c21e..5521a6738470 100644 --- a/keyboards/somei70/somei70.c +++ b/keyboards/somei70/somei70.c @@ -7,9 +7,8 @@ static uint8_t esc_press_count = 0; static uint16_t esc_timer = 0; // Stats display void render_stats(void) { - char wpm_str[10]; - snprintf(wpm_str, sizeof(wpm_str), "WPM: %03u", get_current_wpm()); - oled_write_ln(wpm_str, false); + oled_write_P(PSTR("WPM: "), false); + oled_write_ln(get_u8_str(get_current_wpm(), '0'), false); if (host_keyboard_led_state().caps_lock) { oled_write_P(PSTR("CAPS: On "), false); } else { @@ -20,10 +19,8 @@ void render_stats(void) { } else { oled_write_ln("NKRO: Off", false); } - uint8_t brightness = rgblight_get_val(); - char brightness_str[255]; - snprintf(brightness_str, sizeof(brightness_str), "LED Brightness: %03u", brightness); - oled_write_ln(brightness_str, false); + oled_write_P(PSTR("LED Brightness: "), false); + oled_write_ln(get_u8_str(rgblight_get_val(), '0'), false); oled_write_ln(PSTR("P: 0x6F64 V: 0x73CA"), false); } // Static images