OLED overhaul

- adjusted and consolidated font after playing around
- cleaned up luna code so its easier to read and configure
- overhauled the layout, making it less busy but still functional
- adjusted the combos to move tab and add back mb1
This commit is contained in:
Victor 2024-06-20 23:29:16 -05:00
parent 409bf5b702
commit 8a520c259d
Failed to generate hash of commit
9 changed files with 275 additions and 560 deletions

View file

@ -2,16 +2,12 @@
#include "t4corun.h"
#define OLED_RENDER_KEYLOCK_NAME "Lock"
#define OLED_RENDER_MODS_NAME "Mods"
#define OLED_RENDER_FEATURE_NAME "Feat"
#define OLED_RENDER_WPM_NAME "Wpm"
#if defined(OLED_DISPLAY_128X64)
# define OLED_RENDER_DEFAULT_LAYER1 "QWERTY "
# define OLED_RENDER_DEFAULT_LAYER2 "COLEMAK DH"
# define OLED_RENDER_DEFAULT_LAYER3 "GAME "
# define OLED_RENDER_DEFAULT_LAYER1 "QWERTY :"
# define OLED_RENDER_DEFAULT_LAYER2 "COLEMAK DH:"
# define OLED_RENDER_DEFAULT_LAYER3 "GAME :"
# define OLED_RENDER_LAYER_1 "Base "
# define OLED_RENDER_LAYER_2 "Navigation"
# define OLED_RENDER_LAYER_3 "Number "
# define OLED_RENDER_LAYER_4 "Symbol "
@ -29,31 +25,36 @@
# define OLED_RENDER_LAYER_5 " Cfg "
#endif
// LUNA PET Variables
#if defined(WPM_ENABLE)
# define OLED_LUNA_X 0
# define OLED_LUNA_Y 13
# define OLED_LUNA_MIN_WALK_SPEED 10
# define OLED_LUNA_MIN_RUN_SPEED 40
# define OLED_LUNA_ANIM_FRAME_DURATION 200 // how long each frame lasts in ms
# define OLED_LUNA_ANIM_SIZE 96 // number of bytes in array. If you change sprites, minimize for adequate firmware size. max is 1024
#endif //WPM_ENABLE
void render_oled_128x64(void);
void render_oled_32x128(void);
void render_layer_state(void);
void render_layer_state_graphic(void);
void render_keylock_status(bool vertical);
void render_mod_status(bool vertical);
void render_feature_status(bool vertical);
void render_default_layer_state(uint8_t col, uint8_t line, bool moveCursor);
void render_layer_state(uint8_t col, uint8_t line, bool moveCursor);
void render_layer_state_list(uint8_t col, uint8_t line, bool moveCursor);
void render_keylock_status(uint8_t col, uint8_t line);
void render_mod_status(uint8_t col, uint8_t line);
void render_mod_status_vertical(uint8_t col, uint8_t line);
static const char PROGMEM scroll_off[] = {0xC0, 0};
static const char PROGMEM scroll_on[] = {0xC1, 0};
void render_klor_face_small(uint8_t col, uint8_t line);
static const char PROGMEM num_off[] = {0xC2, 0};
static const char PROGMEM num_on[] = {0xC3, 0};
static const char PROGMEM scroll_off[] = {0xC0, 0};
static const char PROGMEM scroll_on[] = {0xC1, 0};
static const char PROGMEM caps_off[] = {0xC4, 0};
static const char PROGMEM caps_on[] = {0xC5, 0};
static const char PROGMEM num_off[] = {0xC2, 0};
static const char PROGMEM num_on[] = {0xC3, 0};
static const char PROGMEM caps_off[] = {0xC4, 0};
static const char PROGMEM caps_on[] = {0xC5, 0};
static const char PROGMEM rgb_matrix_off[] = {0xCA, 0xCB, 0};
static const char PROGMEM rgb_matrix_on[] = {0xC8, 0xC9, 0};
static const char PROGMEM sound_off[] = {0xCE, 0xCF, 0};
static const char PROGMEM sound_on[] = {0xCC, 0xCD, 0};
static const char PROGMEM haptic_off[] = {0xD2, 0xD3, 0};
static const char PROGMEM haptic_on[] = {0xD0, 0xD1, 0};
static const char PROGMEM shift_off_upper[] = {0x80, 0x81, 0x82, 0};
static const char PROGMEM shift_off_lower[] = {0xA0, 0xA1, 0xA2, 0};
@ -75,66 +76,18 @@ static const char PROGMEM gui_off_lower[] = {0xB2, 0xB3, 0xB4, 0};
static const char PROGMEM gui_on_upper[] = {0x95, 0x96, 0x97, 0};
static const char PROGMEM gui_on_lower[] = {0xB5, 0xB6, 0xB7, 0};
static const char PROGMEM rgb_off[] = {0xC5, 0xC6, 0};
static const char PROGMEM rgb_on[] = {0xC7, 0xC8, 0};
static const char PROGMEM klor_small_face_1[] = {0x98, 0x99, 0x9A, 0x9B, 0x9C, 0};
static const char PROGMEM klor_small_face_2[] = {0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0};
static const char PROGMEM dragscr_off[] = {0xC9, 0xCA, 0};
static const char PROGMEM dragscr_on[] = {0xCB, 0xCC, 0};
static const char PROGMEM sound_off[] = {0x8F, 0x90, 0};
static const char PROGMEM sound_on[] = {0xAF, 0xB0, 0};
static const char PROGMEM haptic_off[] = {0x91, 0x92, 0};
static const char PROGMEM haptic_on[] = {0xB1, 0xB2, 0};
static const char PROGMEM lyr_cfg[] = {
0xE1, 0xD1, 0xD2, 0xD3, 0xE1,
0xE1, 0xBA, 0xBB, 0xBC, 0xE1,
0xE1, 0xB7, 0xB8, 0xB9, 0xE1,
0xE1, 0xD7, 0xD8, 0xD9, 0xE1, 0x00
static const char PROGMEM mod_sep[] = {0xC7, 0xC7, 0};
static const char PROGMEM sep_v[] = {
0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0
};
static const char PROGMEM lyr_sym[] = {
0xE1, 0x97, 0x98, 0x99, 0xE1,
0xE1, 0xDA, 0xDB, 0xDC, 0xE1,
0xE1, 0xB7, 0xB8, 0xB9, 0xE1,
0xE1, 0xD7, 0xD8, 0xD9, 0xE1, 0x00
static const char PROGMEM sep_short_v[] = {
0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0
};
static const char PROGMEM lyr_num[] = {
0xE1, 0x97, 0x98, 0x99, 0xE1,
0xE1, 0x9A, 0x9B, 0x9C, 0xE1,
0xE1, 0xBA, 0xBB, 0xBC, 0xE1,
0xE1, 0xD7, 0xD8, 0xD9, 0xE1, 0x00
};
static const char PROGMEM lyr_nav[] = {
0xE1, 0x97, 0x98, 0x99, 0xE1,
0xE1, 0xB7, 0xB8, 0xB9, 0xE1,
0xE1, 0xDA, 0xDB, 0xDC, 0xE1,
0xE1, 0xD7, 0xD8, 0xD9, 0xE1, 0x00
};
static const char PROGMEM lyr_def[] = {
0xE1, 0x97, 0x98, 0x99, 0xE1,
0xE1, 0xB7, 0xB8, 0xB9, 0xE1,
0xE1, 0x9A, 0x9B, 0x9C, 0xE1,
0xE1, 0xD4, 0xD5, 0xD6, 0xE1, 0x00
};
static const char PROGMEM qmk_logo_small[] = {
0xE1, 0x9D, 0x9E, 0x9F, 0xE1,
0xE1, 0xBD, 0xBE, 0xBF, 0xE1,
0xE1, 0xDD, 0xDE, 0xDF, 0xE1, 0x00
};
#if defined(OLED_DISPLAY_128X64)
static const char PROGMEM sep_v[] = {0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0};
static const char PROGMEM klor_small_face_1[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0xE1, 0};
static const char PROGMEM klor_small_face_2[] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xE1, 0};
static const char PROGMEM klor_face[] = {
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,
0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@ -168,6 +121,4 @@ static const char PROGMEM klor_face[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
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
};
#endif // OLED_DISPLAY_128X64
};