[Keymap] Drashna Mouse keys and oled updates (#16556)
This commit is contained in:
parent
d8971d707e
commit
ff6c70415c
37 changed files with 776 additions and 465 deletions
|
@ -33,10 +33,10 @@ void matrix_init_user(void) {
|
|||
|
||||
__attribute__((weak)) void keyboard_post_init_keymap(void) {}
|
||||
void keyboard_post_init_user(void) {
|
||||
#if defined(RGBLIGHT_ENABLE)
|
||||
#if defined(CUSTOM_RGBLIGHT)
|
||||
keyboard_post_init_rgb_light();
|
||||
#endif
|
||||
#if defined(RGB_MATRIX_ENABLE)
|
||||
#if defined(CUSTOM_RGB_MATRIX)
|
||||
keyboard_post_init_rgb_matrix();
|
||||
#endif
|
||||
#if defined(SPLIT_KEYBOARD) && defined(SPLIT_TRANSACTION_IDS_USER)
|
||||
|
@ -104,8 +104,10 @@ void matrix_scan_user(void) {
|
|||
#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
|
||||
run_diablo_macro_check();
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE)
|
||||
#ifdef CAPS_WORD_ENABLE
|
||||
caps_word_task();
|
||||
#endif
|
||||
#if defined(CUSTOM_RGB_MATRIX)
|
||||
matrix_scan_rgb_matrix();
|
||||
#endif
|
||||
matrix_scan_secret();
|
||||
|
@ -126,12 +128,12 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
|||
}
|
||||
|
||||
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||
#if defined(POINTING_DEVICE_ENABLE)
|
||||
#if defined(CUSTOM_POINTING_DEVICE)
|
||||
state = layer_state_set_pointing(state);
|
||||
#endif
|
||||
#if defined(RGBLIGHT_ENABLE)
|
||||
#if defined(CUSTOM_RGBLIGHT)
|
||||
state = layer_state_set_rgb_light(state);
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
#endif // CUSTOM_RGBLIGHT
|
||||
#if defined(AUDIO_ENABLE) && !defined(__arm__)
|
||||
static bool is_gamepad_on = false;
|
||||
if (layer_state_cmp(state, _GAMEPAD) != is_gamepad_on) {
|
||||
|
@ -156,9 +158,9 @@ layer_state_t default_layer_state_set_user(layer_state_t s
|
|||
|
||||
state = default_layer_state_set_keymap(state);
|
||||
#if 0
|
||||
# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
# if defined(CUSTOM_RGBLIGHT) || defined(RGB_MATRIX_ENABLE)
|
||||
state = default_layer_state_set_rgb(state);
|
||||
# endif // RGBLIGHT_ENABLE
|
||||
# endif
|
||||
#endif
|
||||
return state;
|
||||
}
|
||||
|
|
|
@ -23,3 +23,6 @@ void matrix_init_unicode(void);
|
|||
#ifdef SPLIT_KEYBOARD
|
||||
void matrix_slave_scan_keymap(void);
|
||||
#endif
|
||||
#ifdef CAPS_WORD_ENABLE
|
||||
# include "keyrecords/caps_word.h"
|
||||
#endif
|
||||
|
|
|
@ -291,4 +291,6 @@
|
|||
# ifndef OLED_BRIGHTNESS
|
||||
# define OLED_BRIGHTNESS 50
|
||||
# endif
|
||||
# undef OLED_UPDATE_INTERVAL
|
||||
# define OLED_UPDATE_INTERVAL 100
|
||||
#endif
|
||||
|
|
|
@ -1,83 +1,139 @@
|
|||
// Copyright 2021 Google LLC.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "caps_word.h"
|
||||
|
||||
#ifndef IS_COMMAND
|
||||
# define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
|
||||
#endif
|
||||
static bool caps_word_active = false;
|
||||
|
||||
bool caps_word_enabled = false;
|
||||
bool caps_word_shifted = false;
|
||||
#if CAPS_WORD_IDLE_TIMEOUT > 0
|
||||
# if CAPS_WORD_IDLE_TIMEOUT < 100 || CAPS_WORD_IDLE_TIMEOUT > 30000
|
||||
// Constrain timeout to a sensible range. With the 16-bit timer, the longest
|
||||
// representable timeout is 32768 ms, rounded here to 30000 ms = half a minute.
|
||||
# error "caps_word: CAPS_WORD_IDLE_TIMEOUT must be between 100 and 30000 ms"
|
||||
# endif
|
||||
|
||||
static uint16_t idle_timer = 0;
|
||||
|
||||
void caps_word_task(void) {
|
||||
if (caps_word_active && timer_expired(timer_read(), idle_timer)) {
|
||||
caps_word_set(false);
|
||||
}
|
||||
}
|
||||
#endif // CAPS_WORD_IDLE_TIMEOUT > 0
|
||||
|
||||
/**
|
||||
* @brief Handler for Caps Word feature.
|
||||
*
|
||||
* This checks the keycodes, and applies shift to the correct keys, if and when needid.
|
||||
*
|
||||
* @param keycode Keycode from matrix
|
||||
* @param record keyrecord_t data structure
|
||||
* @return true Continue processing keycode and sent to host
|
||||
* @return false Stop processing keycode, and do not send to host
|
||||
*/
|
||||
bool process_caps_word(uint16_t keycode, keyrecord_t* record) {
|
||||
if (!caps_word_enabled) {
|
||||
#ifndef NO_ACTION_ONESHOT
|
||||
const uint8_t mods = get_mods() | get_oneshot_mods();
|
||||
#else
|
||||
const uint8_t mods = get_mods();
|
||||
#endif // NO_ACTION_ONESHOT
|
||||
|
||||
if (!caps_word_active) {
|
||||
// Pressing both shift keys at the same time enables caps word.
|
||||
if (IS_COMMAND()) {
|
||||
clear_mods();
|
||||
clear_oneshot_mods();
|
||||
caps_word_shifted = false;
|
||||
caps_word_enabled = true;
|
||||
if ((mods & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) {
|
||||
caps_word_set(true); // Activate Caps Word.
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
#if CAPS_WORD_IDLE_TIMEOUT > 0
|
||||
idle_timer = record->event.time + CAPS_WORD_IDLE_TIMEOUT;
|
||||
#endif // CAPS_WORD_IDLE_TIMEOUT > 0
|
||||
}
|
||||
|
||||
if (!record->event.pressed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!((get_mods() | get_oneshot_mods()) & ~MOD_MASK_SHIFT)) {
|
||||
if (!(mods & ~MOD_MASK_SHIFT)) {
|
||||
switch (keycode) {
|
||||
// Ignore MO, TO, TG, TT, and OSL layer switch keys.
|
||||
case QK_MOMENTARY ... QK_MOMENTARY_MAX:
|
||||
case QK_TO ... QK_TO_MAX:
|
||||
case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX:
|
||||
case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX:
|
||||
case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX:
|
||||
return true;
|
||||
|
||||
#ifndef NO_ACTION_TAPPING
|
||||
case QK_MOD_TAP ... QK_MOD_TAP_MAX:
|
||||
if (record->tap.count == 0) {
|
||||
// Deactivate if a mod becomes active through holding a mod-tap key.
|
||||
caps_word_set(false);
|
||||
return true;
|
||||
}
|
||||
keycode &= 0xff;
|
||||
break;
|
||||
|
||||
# ifndef NO_ACTION_LAYER
|
||||
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
|
||||
// Earlier return if this has not been considered tapped yet.
|
||||
# endif // NO_ACTION_LAYER
|
||||
if (record->tap.count == 0) {
|
||||
return true;
|
||||
}
|
||||
// Get the base tapping keycode of a mod- or layer-tap key.
|
||||
keycode &= 0xff;
|
||||
break;
|
||||
#endif // NO_ACTION_TAPPING
|
||||
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX:
|
||||
if (keycode > 0x56F0 || record->tap.count == 0) {
|
||||
return true;
|
||||
}
|
||||
keycode &= 0xff;
|
||||
break;
|
||||
#endif // SWAP_HANDS_ENABLE
|
||||
}
|
||||
|
||||
switch (keycode) {
|
||||
// Letter keys should be shifted.
|
||||
case KC_A ... KC_Z:
|
||||
if (!caps_word_shifted) {
|
||||
register_code(KC_LSFT);
|
||||
}
|
||||
caps_word_shifted = true;
|
||||
return true;
|
||||
|
||||
// Keycodes that continue caps word but shouldn't get shifted.
|
||||
case KC_1 ... KC_0:
|
||||
case KC_BSPC:
|
||||
case KC_MINS:
|
||||
case KC_UNDS:
|
||||
if (caps_word_shifted) {
|
||||
unregister_code(KC_LSFT);
|
||||
}
|
||||
caps_word_shifted = false;
|
||||
return true;
|
||||
|
||||
// Any other keycode disables caps word.
|
||||
if (caps_word_press_user(keycode)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Disable caps word.
|
||||
caps_word_enabled = false;
|
||||
if (caps_word_shifted) {
|
||||
unregister_code(KC_LSFT);
|
||||
}
|
||||
caps_word_shifted = false;
|
||||
caps_word_set(false); // Deactivate Caps Word.
|
||||
return true;
|
||||
}
|
||||
|
||||
void caps_word_set(bool active) {
|
||||
if (active != caps_word_active) {
|
||||
if (active) {
|
||||
clear_mods();
|
||||
#ifndef NO_ACTION_ONESHOT
|
||||
clear_oneshot_mods();
|
||||
#endif // NO_ACTION_ONESHOT
|
||||
#if CAPS_WORD_IDLE_TIMEOUT > 0
|
||||
idle_timer = timer_read() + CAPS_WORD_IDLE_TIMEOUT;
|
||||
#endif // CAPS_WORD_IDLE_TIMEOUT > 0
|
||||
} else if ((get_weak_mods() & MOD_BIT(KC_LSFT)) != 0) {
|
||||
// If the weak shift mod is still on, turn it off and send an update to
|
||||
// the host computer.
|
||||
del_weak_mods(MOD_BIT(KC_LSFT));
|
||||
send_keyboard_report();
|
||||
}
|
||||
|
||||
caps_word_active = active;
|
||||
caps_word_set_user(active);
|
||||
}
|
||||
}
|
||||
|
||||
bool caps_word_get(void) {
|
||||
return caps_word_active;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void caps_word_set_user(bool active) {}
|
||||
|
||||
__attribute__((weak)) bool caps_word_press_user(uint16_t keycode) {
|
||||
switch (keycode) {
|
||||
// Keycodes that continue Caps Word, with shift applied.
|
||||
case KC_A ... KC_Z:
|
||||
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key.
|
||||
return true;
|
||||
|
||||
// Keycodes that continue Caps Word, without shifting.
|
||||
case KC_1 ... KC_0:
|
||||
case KC_BSPC:
|
||||
case KC_MINS:
|
||||
case KC_UNDS:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false; // Deactivate Caps Word.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,4 +5,81 @@
|
|||
|
||||
#include "drashna.h"
|
||||
|
||||
// Call this function from `process_record_user()` to implement Caps Word.
|
||||
bool process_caps_word(uint16_t keycode, keyrecord_t* record);
|
||||
|
||||
// If CAPS_WORD_IDLE_TIMEOUT is set, call `caps_word_task()` from
|
||||
// `matrix_scan_user()` as described above.
|
||||
//
|
||||
// If CAPS_WORD_IDLE_TIMEOUT isn't set, calling this function has no effect (but
|
||||
// will still compile).
|
||||
#if CAPS_WORD_IDLE_TIMEOUT > 0
|
||||
void caps_word_task(void);
|
||||
#else
|
||||
static inline void caps_word_task(void) {}
|
||||
#endif
|
||||
|
||||
// Activates or deactivates Caps Word. For instance activate Caps Word with a
|
||||
// combo by defining a `COMBO_ACTION` that calls `caps_word_set(true)`:
|
||||
//
|
||||
// void process_combo_event(uint16_t combo_index, bool pressed) {
|
||||
// switch(combo_index) {
|
||||
// case CAPS_COMBO:
|
||||
// if (pressed) {
|
||||
// caps_word_set(true); // Activate Caps Word.
|
||||
// }
|
||||
// break;
|
||||
//
|
||||
// // Other combos...
|
||||
// }
|
||||
// }
|
||||
void caps_word_set(bool active);
|
||||
|
||||
// Returns whether Caps Word is currently active.
|
||||
bool caps_word_get(void);
|
||||
|
||||
// An optional callback that gets called when Caps Word turns on or off. This is
|
||||
// useful to represent the current Caps Word state, e.g. by setting an LED or
|
||||
// playing a sound. In your keymap, define
|
||||
//
|
||||
// void caps_word_set_user(bool active) {
|
||||
// if (active) {
|
||||
// // Do something when Caps Word activates.
|
||||
// } else {
|
||||
// // Do something when Caps Word deactivates.
|
||||
// }
|
||||
// }
|
||||
void caps_word_set_user(bool active);
|
||||
|
||||
// An optional callback which is called on every key press while Caps Word is
|
||||
// active. When the key should be shifted (that is, a letter key), the callback
|
||||
// should call `add_weak_mods(MOD_BIT(KC_LSFT))` to shift the key. The callback
|
||||
// also determines whether the key should continue Caps Word. Returning true
|
||||
// continues the current "word", while returning false is "word breaking" and
|
||||
// deactivates Caps Word. The default callback is
|
||||
//
|
||||
// bool caps_word_press_user(uint16_t keycode) {
|
||||
// switch (keycode) {
|
||||
// // Keycodes that continue Caps Word, with shift applied.
|
||||
// case KC_A ... KC_Z:
|
||||
// add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key.
|
||||
// return true;
|
||||
//
|
||||
// // Keycodes that continue Caps Word, without shifting.
|
||||
// case KC_1 ... KC_0:
|
||||
// case KC_BSPC:
|
||||
// case KC_MINS:
|
||||
// case KC_UNDS:
|
||||
// return true;
|
||||
//
|
||||
// default:
|
||||
// return false; // Deactivate Caps Word.
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// To customize, copy the above function into your keymap and add/remove
|
||||
// keycodes to the above cases.
|
||||
//
|
||||
// NOTE: Outside of this callback, you can use `caps_word_set(false)` to
|
||||
// deactivate Caps Word.
|
||||
bool caps_word_press_user(uint16_t keycode);
|
||||
|
|
|
@ -41,21 +41,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
#ifdef KEYLOGGER_ENABLE
|
||||
uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
|
||||
#endif // KEYLOGGER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
#if defined(OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER)
|
||||
process_record_user_oled(keycode, record);
|
||||
#endif // OLED
|
||||
|
||||
if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record)
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
#ifdef CUSTOM_RGB_MATRIX
|
||||
&& process_record_user_rgb_matrix(keycode, record)
|
||||
#endif
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#ifdef CUSTOM_RGBLIGHT
|
||||
&& process_record_user_rgb_light(keycode, record)
|
||||
#endif
|
||||
#ifdef CUSTOM_UNICODE_ENABLE
|
||||
&& process_record_unicode(keycode, record)
|
||||
#endif
|
||||
#if defined(POINTING_DEVICE_ENABLE)
|
||||
#if defined(CUSTOM_POINTING_DEVICE)
|
||||
&& process_record_pointing(keycode, record)
|
||||
#endif
|
||||
#ifdef CAPS_WORD_ENABLE
|
||||
|
@ -142,26 +142,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
break;
|
||||
case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
|
||||
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
#if defined(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX)
|
||||
if (record->event.pressed) {
|
||||
userspace_config.rgb_layer_change ^= 1;
|
||||
dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
|
||||
eeconfig_update_user(userspace_config.raw);
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
|
||||
# if defined(CUSTOM_RGBLIGHT) && defined(CUSTOM_RGB_MATRIX)
|
||||
rgblight_enable_noeeprom();
|
||||
# endif
|
||||
layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
|
||||
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
|
||||
# if defined(CUSTOM_RGBLIGHT) && defined(CUSTOM_RGB_MATRIX)
|
||||
} else {
|
||||
rgblight_disable_noeeprom();
|
||||
# endif
|
||||
}
|
||||
}
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
#endif // CUSTOM_RGBLIGHT
|
||||
break;
|
||||
|
||||
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
#if defined(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX)
|
||||
case RGB_TOG:
|
||||
// Split keyboards need to trigger on key-up for edge-case issue
|
||||
# ifndef SPLIT_KEYBOARD
|
||||
|
@ -169,10 +169,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
# else
|
||||
if (!record->event.pressed) {
|
||||
# endif
|
||||
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
|
||||
# if defined(CUSTOM_RGBLIGHT) && !defined(RGBLIGHT_DISABLE_KEYCODES)
|
||||
rgblight_toggle();
|
||||
# endif
|
||||
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
|
||||
# if defined(CUSTOM_RGB_MATRIX) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
|
||||
rgb_matrix_toggle();
|
||||
# endif
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
|
||||
if (record->event.pressed) {
|
||||
bool is_eeprom_updated;
|
||||
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
|
||||
# if defined(CUSTOM_RGBLIGHT) && !defined(RGBLIGHT_DISABLE_KEYCODES)
|
||||
// This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
userspace_config.rgb_layer_change = false;
|
||||
|
@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
is_eeprom_updated = true;
|
||||
}
|
||||
# endif
|
||||
# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
|
||||
# if defined(CUSTOM_RGB_MATRIX) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
|
||||
if (userspace_config.rgb_matrix_idle_anim) {
|
||||
userspace_config.rgb_matrix_idle_anim = false;
|
||||
dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
#pragma once
|
||||
#include "drashna.h"
|
||||
|
||||
#if defined(KEYBOARD_handwired_tractyl_manuform)
|
||||
#if defined(KEYBOARD_handwired_tractyl_manuform) && defined(POINTING_DEVICE_ENABLE)
|
||||
# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE
|
||||
#elif defined(KEYBOARD_bastardkb_charybdis)
|
||||
# define PLACEHOLDER_SAFE_RANGE CHARYBDIS_SAFE_RANGE
|
||||
#else
|
||||
# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE
|
||||
#endif
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "drashna.h"
|
||||
#include "process_unicode_common.h"
|
||||
|
||||
uint16_t typing_mode;
|
||||
uint16_t typing_mode = KC_NOMODE;
|
||||
|
||||
/**
|
||||
* @brief Registers the unicode keystrokes based on desired unicode
|
||||
|
@ -245,7 +245,7 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) {
|
|||
if (typing_mode != keycode) {
|
||||
typing_mode = keycode;
|
||||
} else {
|
||||
typing_mode = 0;
|
||||
typing_mode = KC_NOMODE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
#ifdef UNICODE_COMMON_ENABLE
|
||||
# include "process_unicode_common.h"
|
||||
#endif
|
||||
# ifdef AUDIO_CLICKY
|
||||
# include "process_clicky.h"
|
||||
# endif
|
||||
#include <string.h>
|
||||
|
||||
extern bool host_driver_disabled;
|
||||
|
@ -26,7 +29,9 @@ extern bool host_driver_disabled;
|
|||
uint32_t oled_timer = 0;
|
||||
char keylog_str[OLED_KEYLOGGER_LENGTH] = {0};
|
||||
static uint16_t log_timer = 0;
|
||||
#ifdef OLED_DISPLAY_VERBOSE
|
||||
static const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0};
|
||||
#endif
|
||||
|
||||
deferred_token kittoken;
|
||||
|
||||
|
@ -101,12 +106,6 @@ bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void update_log(void) {
|
||||
if (timer_elapsed(log_timer) > 750) {
|
||||
// add_keylog(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders keylogger buffer to oled
|
||||
*
|
||||
|
@ -448,20 +447,24 @@ void render_bootmagic_status(void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(POINTING_DEVICE_ENABLE)
|
||||
#if defined(CUSTOM_POINTING_DEVICE)
|
||||
extern bool tap_toggling;
|
||||
#endif
|
||||
|
||||
void render_user_status(void) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
bool is_audio_on = false, is_clicky_on = false;
|
||||
bool is_audio_on = false, l_is_clicky_on = false;
|
||||
# ifdef SPLIT_KEYBOARD
|
||||
|
||||
is_audio_on = user_state.audio_enable;
|
||||
is_clicky_on = user_state.audio_clicky_enable;
|
||||
is_audio_on = user_state.audio_enable;
|
||||
# ifdef AUDIO_CLICKY
|
||||
l_is_clicky_on = user_state.audio_clicky_enable;
|
||||
# endif
|
||||
# else
|
||||
is_audio_on = is_audio_on();
|
||||
is_clicky_on = is_clicky_on();
|
||||
# ifdef AUDIO_CLICKY
|
||||
l_is_clicky_on = is_clicky_on();
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if defined(OLED_DISPLAY_VERBOSE)
|
||||
|
@ -476,7 +479,7 @@ void render_user_status(void) {
|
|||
# if !defined(OLED_DISPLAY_VERBOSE)
|
||||
oled_write_P(PSTR(" "), false);
|
||||
# endif
|
||||
#elif defined(POINTING_DEVICE_ENABLE)
|
||||
#elif defined(CUSTOM_POINTING_DEVICE)
|
||||
static const char PROGMEM mouse_lock[3] = {0xF2, 0xF3, 0};
|
||||
oled_write_P(mouse_lock, tap_toggling);
|
||||
#endif
|
||||
|
@ -486,7 +489,7 @@ void render_user_status(void) {
|
|||
|
||||
# ifdef AUDIO_CLICKY
|
||||
static const char PROGMEM audio_clicky_status[2][3] = {{0xF4, 0xF5, 0}, {0xF6, 0xF7, 0}};
|
||||
oled_write_P(audio_clicky_status[is_clicky_on && is_audio_on], false);
|
||||
oled_write_P(audio_clicky_status[l_is_clicky_on && is_audio_on], false);
|
||||
# if !defined(OLED_DISPLAY_VERBOSE)
|
||||
oled_write_P(PSTR(" "), false);
|
||||
# endif
|
||||
|
@ -540,6 +543,7 @@ void render_wpm(uint8_t padding) {
|
|||
// vertical_offset = 0;
|
||||
|
||||
void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset) {
|
||||
#ifdef WPM_ENABLE
|
||||
static uint16_t timer = 0;
|
||||
static uint8_t x = OLED_DISPLAY_HEIGHT - 1;
|
||||
uint8_t currwpm = get_current_wpm();
|
||||
|
@ -588,6 +592,7 @@ void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset) {
|
|||
|
||||
timer = timer_read(); // refresh the timer for the next iteration
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(POINTING_DEVICE_ENABLE)
|
||||
|
@ -625,7 +630,7 @@ __attribute__((weak)) void oled_driver_render_logo_right(void) {
|
|||
|
||||
//#define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms
|
||||
// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing
|
||||
#define OLED_ANIM_SIZE 32 // number of bytes in array, minimize for adequate firmware size, max is 1024
|
||||
#define OLED_ANIM_SIZE 36
|
||||
#define OLED_ANIM_ROWS 4
|
||||
#define OLED_ANIM_MAX_FRAMES 3
|
||||
#if (OLED_SLEEP_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_WAKE_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_KAKI_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_RTOGI_FRAMES > OLED_ANIM_MAX_FRAMES)
|
||||
|
@ -645,247 +650,67 @@ void render_kitty(void) {
|
|||
// sleep frames
|
||||
{
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08,
|
||||
0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00,
|
||||
0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03,
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80,
|
||||
0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20,
|
||||
0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20,
|
||||
0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80,
|
||||
0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00,
|
||||
0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08,
|
||||
0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28,
|
||||
0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39,
|
||||
0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00
|
||||
}
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80, 0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80, 0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00, 0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
},
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0,
|
||||
0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10,
|
||||
0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38,
|
||||
0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80,
|
||||
0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00,
|
||||
0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08,
|
||||
0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28,
|
||||
0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39,
|
||||
0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00
|
||||
}
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0, 0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80, 0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
}
|
||||
},
|
||||
// wake frames
|
||||
{
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80,
|
||||
0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01,
|
||||
0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
|
||||
0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00,
|
||||
0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40,
|
||||
0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14,
|
||||
0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18,
|
||||
0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10,
|
||||
0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08
|
||||
}
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01, 0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 }
|
||||
},
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80,
|
||||
0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09,
|
||||
0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
|
||||
0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01,
|
||||
0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40,
|
||||
0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14,
|
||||
0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18,
|
||||
0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10,
|
||||
0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08
|
||||
}
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09, 0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01, 0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 }
|
||||
}
|
||||
},
|
||||
// kaki frames
|
||||
{
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40,
|
||||
0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08,
|
||||
0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60,
|
||||
0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00,
|
||||
0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
|
||||
0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00,
|
||||
0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40,
|
||||
0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14,
|
||||
0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18,
|
||||
0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10,
|
||||
0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00
|
||||
}
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60, 0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00, 0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
},
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x06, 0x1a, 0x22, 0xc2, 0x04, 0x04,
|
||||
0x04, 0x07, 0x00, 0xc0, 0x20, 0x10, 0x80, 0x80,
|
||||
0x01, 0x01, 0x02, 0xfc, 0xfe, 0x02, 0x3c, 0x20,
|
||||
0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d,
|
||||
0x55, 0x50, 0x94, 0xf0, 0x10, 0x09, 0x08, 0x00,
|
||||
0x80, 0x00, 0x06, 0x09, 0x1b, 0xee, 0x00, 0x00,
|
||||
0x00, 0x00, 0x81, 0xfe, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14,
|
||||
0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18,
|
||||
0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c,
|
||||
0x14, 0x16, 0x15, 0x14, 0x14, 0x14, 0x14, 0x08
|
||||
}
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x06, 0x1a, 0x22, 0xc2, 0x04, 0x04, 0x04, 0x07, 0x00, 0xc0, 0x20, 0x10, 0x80, 0x80, 0x01, 0x01, 0x02, 0xfc, 0xfe, 0x02, 0x3c, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x09, 0x08, 0x00, 0x80, 0x00, 0x06, 0x09, 0x1b, 0xee, 0x00, 0x00, 0x00, 0x00, 0x81, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x16, 0x15, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 }
|
||||
},
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x20, 0x40,
|
||||
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01,
|
||||
0x02, 0x04, 0x04, 0x03, 0x80, 0x40, 0x40, 0x20,
|
||||
0x00, 0x01, 0x02, 0x8c, 0x70, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d,
|
||||
0x55, 0x50, 0x94, 0xf0, 0x10, 0x0a, 0x0e, 0x1d,
|
||||
0x95, 0x24, 0x24, 0x27, 0x13, 0xe1, 0x01, 0x01,
|
||||
0x01, 0x01, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14,
|
||||
0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18,
|
||||
0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c,
|
||||
0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x08
|
||||
}
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, 0x02, 0x04, 0x04, 0x03, 0x80, 0x40, 0x40, 0x20, 0x00, 0x01, 0x02, 0x8c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x0a, 0x0e, 0x1d, 0x95, 0x24, 0x24, 0x27, 0x13, 0xe1, 0x01, 0x01, 0x01, 0x01, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 }
|
||||
}
|
||||
},
|
||||
// rtogi frames
|
||||
{
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02,
|
||||
0x01, 0x0f, 0x90, 0x10, 0x20, 0xf0, 0xf8, 0xf8
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
|
||||
0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08,
|
||||
0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0x88, 0xc7, 0xc4, 0x62, 0x23, 0x11, 0x3f
|
||||
},
|
||||
{
|
||||
0x80, 0x40, 0x20, 0x10, 0x88, 0xcc, 0x43, 0x80,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0,
|
||||
0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c,
|
||||
0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
},
|
||||
{
|
||||
0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04,
|
||||
0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
}
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x0f, 0x90, 0x10, 0x20, 0xf0, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0xc7, 0xc4, 0x62, 0x23, 0x11, 0x3f, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x80, 0x40, 0x20, 0x10, 0x88, 0xcc, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
},
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02,
|
||||
0x01, 0x1f, 0xa0, 0x20, 0x40, 0x80, 0x00, 0xf0
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
|
||||
0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08,
|
||||
0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x24,
|
||||
0x24, 0x28, 0x6b, 0x40, 0xa0, 0x99, 0x86, 0xff
|
||||
},
|
||||
{
|
||||
0x0f, 0x11, 0x22, 0x44, 0x48, 0x4c, 0x43, 0x80,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0,
|
||||
0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c,
|
||||
0x04, 0x06, 0x06, 0x06, 0x0e, 0x0e, 0x06, 0x01
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04,
|
||||
0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
}
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, 0xa0, 0x20, 0x40, 0x80, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x28, 0x6b, 0x40, 0xa0, 0x99, 0x86, 0xff, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x0f, 0x11, 0x22, 0x44, 0x48, 0x4c, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x06, 0x06, 0x06, 0x0e, 0x0e, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -899,7 +724,7 @@ void render_kitty(void) {
|
|||
|
||||
uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) {
|
||||
static uint32_t anim_frame_duration = 500;
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
#ifdef CUSTOM_POINTING_DEVICE
|
||||
if (tap_toggling) {
|
||||
animation_frame = (animation_frame + 1) % OLED_RTOGI_FRAMES;
|
||||
animation_type = 3;
|
||||
|
@ -953,7 +778,7 @@ void oled_driver_render_logo_left(void) {
|
|||
render_matrix_scan_rate(2);
|
||||
# endif
|
||||
oled_set_cursor(7, 2);
|
||||
# if defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)
|
||||
# if (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && defined(POINTING_DEVICE_ENABLE)
|
||||
render_pointing_dpi_status(charybdis_get_pointer_sniping_enabled() ? charybdis_get_pointer_sniping_dpi() : charybdis_get_pointer_default_dpi(), 1);
|
||||
|
||||
// credit and thanks to jaspertandy on discord for these images
|
||||
|
@ -1054,7 +879,6 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
|||
__attribute__((weak)) bool oled_task_keymap(void) { return true; }
|
||||
|
||||
bool oled_task_user(void) {
|
||||
update_log();
|
||||
|
||||
if (is_keyboard_master()) {
|
||||
#ifndef OLED_DISPLAY_TEST
|
||||
|
|
|
@ -26,8 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "keyboard.h"
|
||||
|
||||
// Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
|
||||
// for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf
|
||||
// for SH1107: https://www.displayfuture.com/Display/datasheet/controller/SH1107.pdf
|
||||
|
||||
// Fundamental Commands
|
||||
#define CONTRAST 0x81
|
||||
|
@ -97,17 +96,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#define OLED_ALL_BLOCKS_MASK (((((OLED_BLOCK_TYPE)1 << (OLED_BLOCK_COUNT - 1)) - 1) << 1) | 1)
|
||||
|
||||
#define OLED_IC_HAS_HORIZONTAL_MODE (OLED_IC == OLED_IC_SSD1306)
|
||||
#define OLED_IC_COM_PINS_ARE_COLUMNS (OLED_IC == OLED_IC_SH1107)
|
||||
|
||||
#ifndef OLED_COM_PIN_COUNT
|
||||
# if OLED_IC == OLED_IC_SH1106
|
||||
# define OLED_COM_PIN_COUNT 64
|
||||
# elif OLED_IC == OLED_IC_SH1107
|
||||
# define OLED_COM_PIN_COUNT 128
|
||||
# else
|
||||
# error Invalid OLED_IC value
|
||||
# endif
|
||||
# define OLED_COM_PIN_COUNT 128
|
||||
#endif
|
||||
|
||||
#ifndef OLED_COM_PIN_OFFSET
|
||||
|
@ -203,24 +193,12 @@ bool oled_init(oled_rotation_t rotation) {
|
|||
DISPLAY_CLOCK,
|
||||
0x80,
|
||||
MULTIPLEX_RATIO,
|
||||
#if OLED_IC_COM_PINS_ARE_COLUMNS
|
||||
OLED_DISPLAY_WIDTH - 1,
|
||||
#else
|
||||
OLED_DISPLAY_HEIGHT - 1,
|
||||
#endif
|
||||
DISPLAY_OFFSET,
|
||||
SH1107_DISPLAY_START_LINE,
|
||||
0x00,
|
||||
DISPLAY_START_LINE | 0x00,
|
||||
CHARGE_PUMP,
|
||||
0x14,
|
||||
#if (OLED_IC != OLED_IC_SH1106)
|
||||
// MEMORY_MODE is unsupported on SH1106 (Page Addressing only)
|
||||
MEMORY_MODE,
|
||||
0x00, // Horizontal addressing mode
|
||||
#elif OLED_IC == OLED_IC_SH1107
|
||||
// Page addressing mode
|
||||
SH1107_MEMORY_MODE_PAGE,
|
||||
#endif
|
||||
};
|
||||
if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) {
|
||||
print("oled_init cmd set 1 failed\n");
|
||||
|
@ -229,7 +207,11 @@ bool oled_init(oled_rotation_t rotation) {
|
|||
|
||||
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) {
|
||||
static const uint8_t PROGMEM display_normal[] = {
|
||||
I2C_CMD, SEGMENT_REMAP_INV, COM_SCAN_DEC, DISPLAY_OFFSET, OLED_COM_PIN_OFFSET,
|
||||
I2C_CMD,
|
||||
SEGMENT_REMAP_INV,
|
||||
COM_SCAN_DEC,
|
||||
DISPLAY_OFFSET,
|
||||
OLED_COM_PIN_OFFSET,
|
||||
};
|
||||
if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) {
|
||||
print("oled_init cmd normal rotation failed\n");
|
||||
|
@ -237,7 +219,11 @@ bool oled_init(oled_rotation_t rotation) {
|
|||
}
|
||||
} else {
|
||||
static const uint8_t PROGMEM display_flipped[] = {
|
||||
I2C_CMD, SEGMENT_REMAP, COM_SCAN_INC, DISPLAY_OFFSET, (OLED_COM_PIN_COUNT - OLED_COM_PIN_OFFSET) % OLED_COM_PIN_COUNT,
|
||||
I2C_CMD,
|
||||
SEGMENT_REMAP,
|
||||
COM_SCAN_INC,
|
||||
DISPLAY_OFFSET,
|
||||
(OLED_COM_PIN_COUNT - OLED_COM_PIN_OFFSET) % OLED_COM_PIN_COUNT,
|
||||
};
|
||||
if (I2C_TRANSMIT_P(display_flipped) != I2C_STATUS_SUCCESS) {
|
||||
print("display_flipped failed\n");
|
||||
|
@ -245,7 +231,18 @@ bool oled_init(oled_rotation_t rotation) {
|
|||
}
|
||||
}
|
||||
|
||||
static const uint8_t PROGMEM display_setup2[] = {I2C_CMD, COM_PINS, OLED_COM_PINS, CONTRAST, OLED_BRIGHTNESS, PRE_CHARGE_PERIOD, 0x22, VCOM_DETECT, 0x35, DISPLAY_ALL_ON_RESUME, NORMAL_DISPLAY, DEACTIVATE_SCROLL, DISPLAY_ON}; if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) {
|
||||
static const uint8_t PROGMEM display_setup2[] = {
|
||||
I2C_CMD, COM_PINS,
|
||||
OLED_COM_PINS,
|
||||
CONTRAST, OLED_BRIGHTNESS,
|
||||
PRE_CHARGE_PERIOD, 0x22,
|
||||
VCOM_DETECT, 0x35,
|
||||
DISPLAY_ALL_ON_RESUME,
|
||||
NORMAL_DISPLAY,
|
||||
DEACTIVATE_SCROLL,
|
||||
DISPLAY_ON
|
||||
};
|
||||
if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) {
|
||||
print("display_setup2 failed\n");
|
||||
return false;
|
||||
}
|
||||
|
@ -277,22 +274,11 @@ static void calc_bounds(uint8_t update_start, uint8_t *cmd_array) {
|
|||
// Calculate commands to set memory addressing bounds.
|
||||
uint8_t start_page = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH;
|
||||
uint8_t start_column = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH;
|
||||
#if !OLED_IC_HAS_HORIZONTAL_MODE
|
||||
// Commands for Page Addressing Mode. Sets starting page and column; has no end bound.
|
||||
// Column value must be split into high and low nybble and sent as two commands.
|
||||
cmd_array[0] = PAM_PAGE_ADDR | start_page;
|
||||
cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f);
|
||||
cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f);
|
||||
cmd_array[3] = NOP;
|
||||
cmd_array[4] = NOP;
|
||||
cmd_array[5] = NOP;
|
||||
#else
|
||||
// Commands for use in Horizontal Addressing mode.
|
||||
cmd_array[1] = start_column + OLED_COLUMN_OFFSET;
|
||||
cmd_array[4] = start_page;
|
||||
cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) % OLED_DISPLAY_WIDTH + cmd_array[1];
|
||||
cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) / OLED_DISPLAY_WIDTH - 1 + cmd_array[4];
|
||||
#endif
|
||||
}
|
||||
|
||||
static void calc_bounds_90(uint8_t update_start, uint8_t *cmd_array) {
|
||||
|
@ -310,19 +296,12 @@ static void calc_bounds_90(uint8_t update_start, uint8_t *cmd_array) {
|
|||
// Top page number for a block which is at the bottom edge of the screen.
|
||||
const uint8_t bottom_block_top_page = (height_in_pages - page_inc_per_block) % height_in_pages;
|
||||
|
||||
#if !OLED_IC_HAS_HORIZONTAL_MODE
|
||||
// Only the Page Addressing Mode is supported
|
||||
uint8_t start_page = bottom_block_top_page - (OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT / 8);
|
||||
uint8_t start_column = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8;
|
||||
cmd_array[0] = PAM_PAGE_ADDR | start_page;
|
||||
cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f);
|
||||
cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f);
|
||||
#else
|
||||
cmd_array[1] = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8 + OLED_COLUMN_OFFSET;
|
||||
cmd_array[4] = bottom_block_top_page - (OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT / 8);
|
||||
cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8 - 1 + cmd_array[1];
|
||||
cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) % OLED_DISPLAY_HEIGHT / 8 + cmd_array[4];
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t crot(uint8_t a, int8_t n) {
|
||||
|
@ -358,11 +337,7 @@ void oled_render(void) {
|
|||
}
|
||||
|
||||
// Set column & page position
|
||||
#if OLED_IC_HAS_HORIZONTAL_MODE
|
||||
static uint8_t display_start[] = {I2C_CMD, COLUMN_ADDR, 0, OLED_DISPLAY_WIDTH - 1, PAGE_ADDR, 0, OLED_DISPLAY_HEIGHT / 8 - 1};
|
||||
#else
|
||||
static uint8_t display_start[] = {I2C_CMD, PAM_PAGE_ADDR, PAM_SETCOLUMN_LSB, PAM_SETCOLUMN_MSB};
|
||||
#endif
|
||||
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
||||
calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start
|
||||
} else {
|
||||
|
@ -392,13 +367,6 @@ void oled_render(void) {
|
|||
rotate_90(&oled_buffer[OLED_BLOCK_SIZE * update_start + source_map[i]], &temp_buffer[target_map[i]]);
|
||||
}
|
||||
|
||||
#if OLED_IC_HAS_HORIZONTAL_MODE
|
||||
// Send render data chunk after rotating
|
||||
if (I2C_WRITE_REG(I2C_DATA, &temp_buffer[0], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) {
|
||||
print("oled_render90 data failed\n");
|
||||
return;
|
||||
}
|
||||
#else
|
||||
// For SH1106 or SH1107 the data chunk must be split into separate pieces for each page
|
||||
const uint8_t columns_in_block = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8;
|
||||
const uint8_t num_pages = OLED_BLOCK_SIZE / columns_in_block;
|
||||
|
@ -417,7 +385,6 @@ void oled_render(void) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Turn on display if it is off
|
||||
|
@ -825,7 +792,7 @@ void oled_task(void) {
|
|||
}
|
||||
#else
|
||||
oled_set_cursor(0, 0);
|
||||
oled_task_kb();
|
||||
oled_task_kbr();
|
||||
#endif
|
||||
|
||||
#if OLED_SCROLL_TIMEOUT > 0
|
||||
|
@ -856,5 +823,6 @@ void oled_task(void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
__attribute__((weak)) bool oled_task_kb(void) { return oled_task_user(); }
|
||||
__attribute__((weak)) bool oled_task_user(void) { return true; }
|
||||
|
|
|
@ -118,7 +118,7 @@ bool process_record_pointing(uint16_t keycode, keyrecord_t* record) {
|
|||
}
|
||||
|
||||
layer_state_t layer_state_set_pointing(layer_state_t state) {
|
||||
if (layer_state_cmp(state, _GAMEPAD) || layer_state_cmp(state, _DIABLO)) {
|
||||
if (layer_state_cmp(state, _GAMEPAD) || layer_state_cmp(state, _DIABLO) || layer_state_cmp(state, _DIABLOII)) {
|
||||
state |= ((layer_state_t)1 << _MOUSE);
|
||||
}
|
||||
return state;
|
||||
|
|
|
@ -37,10 +37,9 @@
|
|||
# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_REST_MODE
|
||||
#endif
|
||||
|
||||
#ifdef QMK_KEYS_PER_SCAN
|
||||
# undef QMK_KEYS_PER_SCAN
|
||||
#ifndef QMK_KEYS_PER_SCAN
|
||||
# define QMK_KEYS_PER_SCAN 8
|
||||
#endif
|
||||
#define QMK_KEYS_PER_SCAN 4
|
||||
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
// mouse movement config
|
||||
|
|
|
@ -24,7 +24,6 @@ static bool is_rgblight_startup;
|
|||
static HSV old_hsv;
|
||||
static uint8_t old_mode;
|
||||
deferred_token rgb_startup_token;
|
||||
# endif
|
||||
|
||||
uint32_t rgb_startup_animation(uint32_t triger_time, void *cb_arg) {
|
||||
if (is_rgblight_startup && is_keyboard_master()) {
|
||||
|
@ -45,6 +44,7 @@ uint32_t rgb_startup_animation(uint32_t triger_time, void *cb_arg) {
|
|||
}
|
||||
return is_rgblight_startup ? 10 : 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
void keyboard_post_init_rgb_light(void) {
|
||||
# if defined(RGBLIGHT_STARTUP_ANIMATION)
|
||||
|
@ -56,11 +56,11 @@ void keyboard_post_init_rgb_light(void) {
|
|||
old_mode = rgblight_get_mode();
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||
is_rgblight_startup = true;
|
||||
rgb_startup_token = defer_exec(300, rgb_startup_animation, NULL);
|
||||
# endif
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
layer_state_set_rgb_light(layer_state);
|
||||
}
|
||||
rgb_startup_token = defer_exec(300, rgb_startup_animation, NULL);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ CUSTOM_RGBLIGHT ?= yes
|
|||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||
ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes)
|
||||
SRC += $(USER_PATH)/rgb/rgb_stuff.c
|
||||
OPT_DEFS += -DCUSTOM_RGBLIGHT
|
||||
ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_NOEEPROM
|
||||
endif
|
||||
|
@ -67,6 +68,7 @@ CUSTOM_RGB_MATRIX ?= yes
|
|||
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
|
||||
ifeq ($(strip $(CUSTOM_RGB_MATRIX)), yes)
|
||||
SRC += $(USER_PATH)/rgb/rgb_matrix_stuff.c
|
||||
OPT_DEFS += -DCUSTOM_RGB_MATRIX
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -86,7 +88,7 @@ ifeq ($(strip $(OLED_ENABLE)), yes)
|
|||
QUANTUM_LIB_SRC += i2c_master.c
|
||||
endif
|
||||
ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes)
|
||||
OPT_DEFS += -DCUSTOM_OLED_DRIVER_CODE
|
||||
OPT_DEFS += -DCUSTOM_OLED_DRIVER
|
||||
SRC += $(USER_PATH)/oled/oled_stuff.c
|
||||
endif
|
||||
ifeq ($(strip $(OLED_DISPLAY_TEST)), yes)
|
||||
|
@ -99,6 +101,7 @@ CUSTOM_POINTING_DEVICE ?= yes
|
|||
ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
|
||||
ifeq ($(strip $(CUSTOM_POINTING_DEVICE)), yes)
|
||||
SRC += $(USER_PATH)/pointing/pointing.c
|
||||
OPT_DEFS += -DCUSTOM_POINTING_DEVICE
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ void user_config_sync(uint8_t initiator2target_buffer_size, const void* initiato
|
|||
void watchdog_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { watchdog_ping_done = true; }
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
#ifdef CUSTOM_OLED_DRIVER
|
||||
# include "oled/oled_stuff.h"
|
||||
void keylogger_string_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
|
||||
if (initiator2target_buffer_size == OLED_KEYLOGGER_LENGTH) {
|
||||
|
@ -71,7 +71,7 @@ void keyboard_post_init_transport_sync(void) {
|
|||
transaction_register_rpc(RPC_ID_USER_STATE_SYNC, user_state_sync);
|
||||
transaction_register_rpc(RPC_ID_USER_KEYMAP_SYNC, user_keymap_sync);
|
||||
transaction_register_rpc(RPC_ID_USER_CONFIG_SYNC, user_config_sync);
|
||||
#ifdef OLED_ENABLE
|
||||
#ifdef CUSTOM_OLED_DRIVER
|
||||
transaction_register_rpc(RPC_ID_USER_KEYLOG_STR, keylogger_string_sync);
|
||||
#endif
|
||||
|
||||
|
@ -92,7 +92,7 @@ void user_transport_update(void) {
|
|||
user_state.audio_enable = is_audio_on();
|
||||
user_state.audio_clicky_enable = is_clicky_on();
|
||||
#endif
|
||||
#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
|
||||
#if defined(CUSTOM_POINTING_DEVICE)
|
||||
user_state.tap_toggling = tap_toggling;
|
||||
#endif
|
||||
#ifdef UNICODE_COMMON_ENABLE
|
||||
|
@ -111,7 +111,7 @@ void user_transport_update(void) {
|
|||
#ifdef UNICODE_COMMON_ENABLE
|
||||
unicode_config.input_mode = user_state.unicode_mode;
|
||||
#endif
|
||||
#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
|
||||
#if defined(CUSTOM_POINTING_DEVICE)
|
||||
tap_toggling = user_state.tap_toggling;
|
||||
#endif
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
|
@ -127,7 +127,7 @@ void user_transport_sync(void) {
|
|||
static uint16_t last_keymap = 0;
|
||||
static uint32_t last_config = 0, last_sync[4], last_user_state = 0;
|
||||
bool needs_sync = false;
|
||||
#ifdef OLED_ENABLE
|
||||
#ifdef CUSTOM_OLED_DRIVER
|
||||
static char keylog_temp[OLED_KEYLOGGER_LENGTH] = {0};
|
||||
#endif
|
||||
|
||||
|
@ -187,7 +187,7 @@ void user_transport_sync(void) {
|
|||
needs_sync = false;
|
||||
}
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
#ifdef CUSTOM_OLED_DRIVER
|
||||
// Check if the state values are different
|
||||
if (memcmp(&keylog_str, &keylog_temp, OLED_KEYLOGGER_LENGTH)) {
|
||||
needs_sync = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue