From 0da6562c4df570729889690e21061229c5648b73 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 18 Jun 2022 14:37:51 -0700 Subject: Make default layer size 16-bit (#15286) Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> --- keyboards/crkbd/keymaps/jarred/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/crkbd/keymaps/jarred/keymap.c') diff --git a/keyboards/crkbd/keymaps/jarred/keymap.c b/keyboards/crkbd/keymaps/jarred/keymap.c index b938636c2a..3784eff2b8 100644 --- a/keyboards/crkbd/keymaps/jarred/keymap.c +++ b/keyboards/crkbd/keymaps/jarred/keymap.c @@ -84,7 +84,7 @@ const char *read_keylogs(void); char matrix_line_str[24]; const char *read_layer_state(void) { - uint8_t layer = biton32(layer_state); + uint8_t layer = get_highest_layer(layer_state); strcpy(matrix_line_str, "Layer: "); -- cgit v1.2.3 From f7aaed1b57d264a983d4890ce6ada930ce2f6368 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 31 Jul 2022 20:36:30 +0100 Subject: Migrate crkbd keymaps to oled driver (#17863) --- keyboards/crkbd/keymaps/jarred/keymap.c | 47 ++++++--------------------------- 1 file changed, 8 insertions(+), 39 deletions(-) (limited to 'keyboards/crkbd/keymaps/jarred/keymap.c') diff --git a/keyboards/crkbd/keymaps/jarred/keymap.c b/keyboards/crkbd/keymaps/jarred/keymap.c index 3784eff2b8..b0e181b37f 100644 --- a/keyboards/crkbd/keymaps/jarred/keymap.c +++ b/keyboards/crkbd/keymaps/jarred/keymap.c @@ -5,10 +5,6 @@ #include "lufa.h" #include "split_util.h" #endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif - #ifdef RGBLIGHT_ENABLE //Following line allows macro to read current RGB settings @@ -65,15 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -void matrix_init_user(void) { - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(); // turns on the display - #endif -} - -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED +#ifdef OLED_ENABLE // When add source files to SRC in rules.mk, you can use functions. const char *read_logo(void); @@ -142,37 +130,18 @@ const char *read_usb_state(void) { return matrix_line_str; } -void matrix_scan_user(void) { - iota_gfx_task(); -} - -void matrix_render_user(struct CharacterMatrix *matrix) { +bool oled_task_user(void) { if (is_keyboard_master()) { - matrix_write(matrix, read_layer_state()); - matrix_write(matrix, "\n"); - matrix_write(matrix, read_usb_state()); - matrix_write(matrix, "\n"); - matrix_write(matrix, read_keylogs()); - matrix_write(matrix, "\n"); + oled_write_ln(read_layer_state(), false); + oled_write_ln(read_usb_state(), false); + oled_write_ln(read_keylogs(), false); } else { - matrix_write(matrix, read_logo()); + oled_write(read_logo(), false); } + return false; } -void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - matrix_clear(&matrix); - matrix_render_user(&matrix); - matrix_update(&display, &matrix); -} -#endif//SSD1306OLED +#endif bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { -- cgit v1.2.3