Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

keyball44: first development firmware #130

Merged
merged 1 commit into from
Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/keyball44.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Keyball44 firmware

on:
push:
branches:
- '*'
tags:
- 'keyball44/v[0-9]+.[0-9]+.[0-9]+*'
pull_request:

jobs:

build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Setup QMK firmware
uses: ./.github/actions/setup-qmk

- name: Install a link to own source
run: ln -s $(pwd)/qmk_firmware/keyboards/keyball __qmk__/keyboards/keyball

- run: qmk compile -j 4 -kb keyball/keyball44 -km default
continue-on-error: true

- run: qmk compile -j 4 -kb keyball/keyball44 -km test
continue-on-error: true

- run: qmk compile -j 4 -kb keyball/keyball44 -km via
continue-on-error: true

- name: Archive firmwares
uses: actions/upload-artifact@v2
with:
name: keyball44-firmwares
path: __qmk__/*.hex

release:
name: Release
runs-on: ubuntu-latest
needs: [ build ]
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'keyball44/v')

steps:
- name: Download built firmwares
uses: actions/download-artifact@v2
with:
name: keyball44-firmwares
- name: List assets
run: ls -l *.hex
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: ${{ contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') }}
files: |
*.hex
fail_on_unmatched_files: true
generate_release_notes: true
append_body: true
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// keymap for development
// keymap for default
[0] = LAYOUT_universal(
KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,
KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_MINS ,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// keymap for development
// keymap for default (VIA)
[0] = LAYOUT_universal(
KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,
KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN ,
Expand Down
Empty file.
81 changes: 81 additions & 0 deletions qmk_firmware/keyboards/keyball/keyball44/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
Copyright 2022 @Yowkees
Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "config_common.h"

// USB Device descriptor parameters
#define VENDOR_ID 0x5957 // "YW" = Yowkees
#define PRODUCT_ID 0x0400
#define DEVICE_VER 0x0001
#define MANUFACTURER Yowkees
#define PRODUCT Keyball44

// Key matrix parameters
#define MATRIX_ROWS (4 * 2) // split keyboard
#define MATRIX_COLS 6
#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 }
#define MATRIX_MASKED
#define DEBOUNCE 5
#define DIODE_DIRECTION COL2ROW

// Split parameters
#define SOFT_SERIAL_PIN D2
#define SPLIT_HAND_MATRIX_GRID F7, D4
#define SPLIT_USB_DETECT
#define SPLIT_USB_TIMEOUT 500

#define SPLIT_TRANSACTION_IDS_KB KEYBALL_GET_INFO, KEYBALL_GET_MOTION, KEYBALL_SET_CPI

// RGB LED settings
#define RGB_DI_PIN D3
#ifdef RGBLIGHT_ENABLE
# define RGBLED_NUM 60
# define RGBLED_SPLIT { 30, 30 } // (30 + 29)
# ifndef RGBLIGHT_LIMIT_VAL
# define RGBLIGHT_LIMIT_VAL 150 // limitated for power consumption
# endif
# ifndef RGBLIGHT_VAL_STEP
# define RGBLIGHT_VAL_STEP 15
# endif
# ifndef RGBLIGHT_HUE_STEP
# define RGBLIGHT_HUE_STEP 17
# endif
# ifndef RGBLIGHT_SAT_STEP
# define RGBLIGHT_SAT_STEP 17
# endif
#endif
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_SPLIT { 30, 30 }
#endif

#ifndef OLED_FONT_H
# define OLED_FONT_H "keyboards/keyball/lib/glcdfont.c"
#endif

#if !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_32BIT)
# define LAYER_STATE_8BIT
#endif

// To squeeze firmware size
#undef LOCKING_SUPPORT_ENABLE
#undef LOCKING_RESYNC_ENABLE
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
46 changes: 46 additions & 0 deletions qmk_firmware/keyboards/keyball/keyball44/keyball44.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2022 @Yowkees
Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

#include "lib/keyball/keyball.h"

//////////////////////////////////////////////////////////////////////////////

// clang-format off
matrix_row_t matrix_mask[MATRIX_ROWS] = {
0b00111111,
0b00111111,
0b00111111,
0b00111110,
0b00111111,
0b00111111,
0b00111111,
0b00111110,
};
// clang-format on

void keyball_on_adjust_layout(keyball_adjust_t v) {
#ifdef RGBLIGHT_ENABLE
// adjust RGBLIGHT's clipping and effect ranges
uint8_t lednum_this = keyball.this_have_ball ? 29 : 30;
uint8_t lednum_that = !keyball.that_enable ? 0 : keyball.that_have_ball ? 29 : 30;
rgblight_set_clipping_range(is_keyboard_left() ? 0 : lednum_that, lednum_this);
rgblight_set_effect_range(0, lednum_this + lednum_that);
#endif
}
97 changes: 97 additions & 0 deletions qmk_firmware/keyboards/keyball/keyball44/keyball44.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
Copyright 2022 @Yowkees
Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "quantum.h"
#include "lib/keyball/keyball.h"

// clang-format off

#define LAYOUT_right_ball( \
L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \
L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \
L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, \
L31, L32, L33, L34, L35, R35, R34, R31 \
) \
{ \
{ L00, L01, L02, L03, L04, L05 }, \
{ L10, L11, L12, L13, L14, L15 }, \
{ L20, L21, L22, L23, L24, L25 }, \
{ KC_NO, L31, L32, L33, L34, L35 }, \
{ R00, R01, R02, R03, R04, R05 }, \
{ R10, R11, R12, R13, R14, R15 }, \
{ R20, R21, R22, R23, R24, R25 }, \
{ KC_NO, R31, KC_NO, KC_NO, R34, R35 }, \
}

#define LAYOUT_left_ball( \
L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \
L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \
L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, \
L31, L34, L35, R35, R34, R33, R32, R31 \
) \
{ \
{ L00, L01, L02, L03, L04, L05 }, \
{ L10, L11, L12, L13, L14, L15 }, \
{ L20, L21, L22, L23, L24, L25 }, \
{ KC_NO, L31, KC_NO, KC_NO, L34, L35 }, \
{ R00, R01, R02, R03, R04, R05 }, \
{ R10, R11, R12, R13, R14, R15 }, \
{ R20, R21, R22, R23, R24, R25 }, \
{ KC_NO, R31, R32, R33, R34, R35 }, \
}

#define LAYOUT_dual_ball( \
L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \
L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \
L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, \
L31, L34, L35, R35, R34, R31 \
) \
{ \
{ L00, L01, L02, L03, L04, L05 }, \
{ L10, L11, L12, L13, L14, L15 }, \
{ L20, L21, L22, L23, L24, L25 }, \
{ KC_NO, L31, KC_NO, KC_NO, L34, L35 }, \
{ R00, R01, R02, R03, R04, R05 }, \
{ R10, R11, R12, R13, R14, R15 }, \
{ R20, R21, R22, R23, R24, R25 }, \
{ KC_NO, R31, KC_NO, KC_NO, R34, R35 }, \
}

#define LAYOUT_no_ball( \
L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \
L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \
L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, \
L31, L32, L33, L34, L35, R35, R34, R33, R32, R31 \
) \
{ \
{ L00, L01, L02, L03, L04, L05 }, \
{ L10, L11, L12, L13, L14, L15 }, \
{ L20, L21, L22, L23, L24, L25 }, \
{ KC_NO, L31, L32, L33, L34, L35 }, \
{ R00, R01, R02, R03, R04, R05 }, \
{ R10, R11, R12, R13, R14, R15 }, \
{ R20, R21, R22, R23, R24, R25 }, \
{ KC_NO, R31, R32, R33, R34, R35 }, \
}

// clang-format on

#define LAYOUT LAYOUT_right_ball
#define LAYOUT_universal LAYOUT_no_ball
34 changes: 34 additions & 0 deletions qmk_firmware/keyboards/keyball/keyball44/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
This is the c configuration file for the keymap

Copyright 2022 @Yowkees
Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#ifdef RGBLIGHT_ENABLE
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
# define RGBLIGHT_EFFECT_CHRISTMAS
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_ALTERNATING
# define RGBLIGHT_EFFECT_TWINKLE
#endif