mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-25 04:43:02 +00:00
c97ec805cd
* initial unsplit keyboard * move shared code * unsplit: fix underglow led x,y & remove unecessary code * unsplit: remove split code & tidy readme * unsplit: limit brightness & community layout * rename keyboard * the_q: tidy keymap & readme * lulu: remove accidental build target * rename file
46 lines
1020 B
C
46 lines
1020 B
C
// Copyright 2022 Cole Smith <cole@boadsource.xyz>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#include "quantum.h"
|
|
#include "lib/oled.h"
|
|
|
|
#ifdef ENCODER_ENABLE
|
|
bool encoder_update_kb(uint8_t index, bool clockwise) {
|
|
if (!encoder_update_user(index, clockwise)) { return false; }
|
|
if (index == 0) {
|
|
if (clockwise) {
|
|
tap_code(KC_VOLU);
|
|
} else {
|
|
tap_code(KC_VOLD);
|
|
}
|
|
} else if (index == 1) {
|
|
if (clockwise) {
|
|
tap_code(KC_PGDN);
|
|
} else {
|
|
tap_code(KC_PGUP);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
#endif
|
|
|
|
#ifdef OLED_ENABLE
|
|
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
|
|
if (!is_keyboard_master()) {
|
|
return OLED_ROTATION_180;
|
|
}
|
|
return rotation;
|
|
}
|
|
|
|
bool oled_task_kb(void) {
|
|
if (!oled_task_user()) {
|
|
return false;
|
|
}
|
|
if (is_keyboard_master()) {
|
|
render_layer_state();
|
|
} else {
|
|
oled_write_raw_P(bs_logo_img, sizeof(bs_logo_img));
|
|
}
|
|
return false;
|
|
}
|
|
#endif
|