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

Added my prototype keyboard K_Pro v1 TKL #23797

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

ksmosna
Copy link

@ksmosna ksmosna commented May 25, 2024

Description

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

keyboards/k_pro_v1_tkl/config.h Outdated Show resolved Hide resolved
keyboards/k_pro_v1_tkl/info.json Outdated Show resolved Hide resolved
Comment on lines 3 to 9
![k_pro_v1_tkl](imgur.com image replace me!)

*A short description of the keyboard/project*

* Keyboard Maintainer: [ksmosna](https://github.com/ksmosna)
* Hardware Supported: *The PCBs, controllers supported*
* Hardware Availability: *Links to where you can find this hardware*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fill these fields out.

Comment on lines 34 to 37
#define DRIVER_1_LED_TOTAL 59
#define DRIVER_2_LED_TOTAL 33
#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define DRIVER_1_LED_TOTAL 59
#define DRIVER_2_LED_TOTAL 33
#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)

Comment on lines 38 to 39
#define ENCODERS_PAD_A { B8 }
#define ENCODERS_PAD_B { B9 }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please migrate this to keyboard.json file.

Suggested change
#define ENCODERS_PAD_A { B8 }
#define ENCODERS_PAD_B { B9 }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is missing a license header.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename this file to keyboard.json.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is missing a license header.

Comment on lines 69 to 83

#ifdef OLED_ENABLE
bool oled_task_user(void) {
// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);

// Host Keyboard RGB backlight status
oled_write_P(PSTR("-----"), false);
oled_write_P(PSTR("Light"), false);
return false;
}
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If OLEDs are enabled at the keyboard level, there needs to be configuration for them at the keyboard level as well. This should be moved to the k_pro_v1_tkl.c file using the oled_task_kb() function.

Suggested change
#ifdef OLED_ENABLE
bool oled_task_user(void) {
// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
// Host Keyboard RGB backlight status
oled_write_P(PSTR("-----"), false);
oled_write_P(PSTR("Light"), false);
return false;
}
#endif

Comment on lines 39 to 53

#ifdef OLED_ENABLE
bool oled_task_user(void) {
// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);

// Host Keyboard RGB backlight status
oled_write_P(PSTR("-----"), false);
oled_write_P(PSTR("Light"), false);
return false;
}
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

Suggested change
#ifdef OLED_ENABLE
bool oled_task_user(void) {
// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
// Host Keyboard RGB backlight status
oled_write_P(PSTR("-----"), false);
oled_write_P(PSTR("Light"), false);
return false;
}
#endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is missing a license header.

Comment on lines 1 to 11
I2C_DRIVER_REQUIRED = yes

OLED_ENABLE = yes
OLED_DRIVER = ssd1306
OLED_TRANSPORT = i2c

RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = is31fl3733

ENCODER_ENABLE = yes
ENCODER_MAP_ENABLE = yes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
I2C_DRIVER_REQUIRED = yes
OLED_ENABLE = yes
OLED_DRIVER = ssd1306
OLED_TRANSPORT = i2c
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = is31fl3733
ENCODER_ENABLE = yes
ENCODER_MAP_ENABLE = yes
I2C_DRIVER_REQUIRED = yes
RGB_MATRIX_DRIVER = is31fl3733

"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"nkro": true
"nkro": true,
"rgb_matrix": true,
"encoder": true,
"oled": true

@github-actions github-actions bot added the via Adds via keymap and/or updates keyboard for via support label May 31, 2024
Copy link
Member

@drashna drashna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PB_# keycodes need to be switched out with QK_KB_# keycodes

uint32_t timer = 0;
uint8_t current_frame = 0;

static void render_logo(void) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could reduce the size significantly by removing the columns that are empty. I know it's not as much of a concern here (f411), but may be a good idea, in general.

};
if (!animation_finished && timer_elapsed(timer) > FRAME_DURATION) {
timer = timer_read();
oled_clear();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be necessary, at all.

char buffer[32];
switch (menu) {
case 0: // Main
const char* options[3] = {"RGB", "Brightness", "Animation"};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't progmem, so the code that you have below is wrong.

} else {
oled_write_P(PSTR(" "), false);
}
oled_write_P(options[i], false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
oled_write_P(options[i], false);
oled_write(options[i], false);

Comment on lines +616 to +617
snprintf(buffer, sizeof(buffer), "RGB: %s", rgb_matrix_is_enabled() ? "On" : "Off");
oled_write(buffer, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This avoids using sprintf, which is rather large in usage.

Suggested change
snprintf(buffer, sizeof(buffer), "RGB: %s", rgb_matrix_is_enabled() ? "On" : "Off");
oled_write(buffer, false);
oled_write_P(PSTR("RGB: "), false);
oled_write_P(rgb_matrix_is_enabled() ? PSTR("On") : PSTR("Off") , false);

Comment on lines +33 to +59
[1] = LAYOUT_tkl_ansi(
KC_NO, 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_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR, KC_SCRL, KC_PAUS,
KC_NO, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, KC_PGUP,
KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_DEL, KC_END, KC_PGDN,
KC_NO, 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_UP,
KC_NO, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[2] = LAYOUT_tkl_ansi(
KC_NO, 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_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR, KC_SCRL, KC_PAUS,
KC_NO, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, KC_PGUP,
KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_DEL, KC_END, KC_PGDN,
KC_NO, 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_UP,
KC_NO, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[3] = LAYOUT_tkl_ansi(
KC_NO, 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_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR, KC_SCRL, KC_PAUS,
KC_NO, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, KC_PGUP,
KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_DEL, KC_END, KC_PGDN,
KC_NO, 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_UP,
KC_NO, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all duplicates of the base layer. These should be removed.

Suggested change
[1] = LAYOUT_tkl_ansi(
KC_NO, 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_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR, KC_SCRL, KC_PAUS,
KC_NO, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, KC_PGUP,
KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_DEL, KC_END, KC_PGDN,
KC_NO, 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_UP,
KC_NO, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[2] = LAYOUT_tkl_ansi(
KC_NO, 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_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR, KC_SCRL, KC_PAUS,
KC_NO, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, KC_PGUP,
KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_DEL, KC_END, KC_PGDN,
KC_NO, 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_UP,
KC_NO, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[3] = LAYOUT_tkl_ansi(
KC_NO, 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_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR, KC_SCRL, KC_PAUS,
KC_NO, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, KC_PGUP,
KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_DEL, KC_END, KC_PGDN,
KC_NO, 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_UP,
KC_NO, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
)

Comment on lines +65 to +67
[1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
[2] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
[3] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
[2] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
[3] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},

@@ -0,0 +1,39 @@
# adler

![adler](imgur.com image replace me!)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this?

Comment on lines +5 to +6
#include "keycodes.h"
#include "i2c_master.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "keycodes.h"
#include "i2c_master.h"

Comment on lines +1 to +2
I2C_DRIVER_REQUIRED = yes
PROGRAMMABLE_BUTTON_ENABLE = yes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
I2C_DRIVER_REQUIRED = yes
PROGRAMMABLE_BUTTON_ENABLE = yes

i2c driver required setting isn't required.

Also, the programmable button feature isn't meant for macros or custom functionality. It's a host side thing.
https://docs.qmk.fm/features/programmable_button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid keyboard keymap via Adds via keymap and/or updates keyboard for via support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants