Add rgb status display; rebase to master

This commit is contained in:
Maurizio Porrato 2020-05-09 09:56:15 +01:00
parent 82462c5e44
commit eeca3ed9cc
3 changed files with 18 additions and 1 deletions

View File

@ -172,6 +172,7 @@ void matrix_init_user(void) {
// When add source files to SRC in rules.mk, you can use functions.
const char *read_layer_state(void);
const char *read_logo(void);
const char *read_rgb_info(void);
//void set_keylog(uint16_t keycode, keyrecord_t *record);
//const char *read_keylog(void);
//const char *read_keylogs(void);
@ -193,6 +194,7 @@ void matrix_render_user(struct CharacterMatrix *matrix) {
//matrix_write_ln(matrix, read_keylogs());
//matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui));
matrix_write_ln(matrix, read_host_led_state());
matrix_write_ln(matrix, read_rgb_info());
//matrix_write_ln(matrix, read_timelog());
} else {
matrix_write(matrix, read_logo());

View File

@ -0,0 +1,15 @@
#ifdef RGBLIGHT_ENABLE
#include QMK_KEYBOARD_H
#include <stdio.h>
extern rgblight_config_t rgblight_config;
char rbf_info_str[24];
const char *read_rgb_info(void) {
snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d",
rgblight_config.enable ? "on" : "- ", rgblight_config.mode,
rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
return rbf_info_str;
}
#endif

View File

@ -22,10 +22,10 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# If you want to change the display of OLED, you need to change here
SRC += ./lib/glcdfont.c \
./lib/rgb_state_reader.c \
layer_state_reader.c \
./lib/logo_reader.c \
host_led_state_reader.c \
rgb_state_reader.c \
# ./lib/keylogger.c \
# ./lib/mode_icon_reader.c \
# ./lib/timelogger.c \