Commit Diff


commit - d6351fd95499fbd83d598597ae695a265d474106
commit + acaeb7149ca241a3083cec42cd67bd0451dee46c
blob - d19bce53209b00eeecbc3ed52c04f457eb15a1c6
blob + 8a7c306563473801db27622f0d934a57ea29a80c
--- keyboards/crkbd/keymaps/witcher/keymap.c
+++ keyboards/crkbd/keymaps/witcher/keymap.c
@@ -20,6 +20,10 @@ along with this program.  If not, see <http://www.gnu.
 #include QMK_KEYBOARD_H
 #include "keymap_german.h"
 
+#ifdef OLED_ENABLE
+#include "progmem.h"
+#endif // OLED_ENABLE
+
 #define GUI_ESC GUI_T(KC_ESC)
 
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -201,83 +205,6 @@ oled_rotation_t oled_init_user(oled_rotation_t rotatio
 #    define L_MAN_GERMAN 32
 #    define L_EXTRA 64
 
-void oled_render_layer_state(void) {
-	oled_write_P(PSTR("L: "), false);
-
-	switch (layer_state) {
-		case L_BASE:
-			oled_write_ln_P(PSTR("Base"), false);
-			break;
-		case L_SYMBOLS:
-			oled_write_ln_P(PSTR("Symbols"), false);
-			break;
-		case L_MAN:
-			oled_write_ln_P(PSTR("Media/Num"), false);
-			break;
-		case L_BASE_GERMAN:
-			oled_write_ln_P(PSTR("Base (German)"), false);
-			break;
-		case L_SYMBOLS_GERMAN:
-			oled_write_ln_P(PSTR("Symbols (German)"), false);
-			break;
-		case L_MAN_GERMAN:
-			oled_write_ln_P(PSTR("Media/Num (German)"), false);
-			break;
-		case L_EXTRA:
-		case L_EXTRA | L_SYMBOLS:
-		case L_EXTRA | L_MAN:
-		case L_EXTRA | L_SYMBOLS | L_MAN:
-		case L_EXTRA | L_SYMBOLS_GERMAN:
-		case L_EXTRA | L_MAN_GERMAN:
-		case L_EXTRA | L_SYMBOLS_GERMAN | L_MAN_GERMAN:
-			oled_write_ln_P(PSTR("Extra"), false);
-			break;
-		default:
-			oled_write_ln_P(PSTR("Unhandled!"), false);
-			break;
-	}
-}
-
-char keylog_str[24] = {};
-
-const char code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
-	'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
-	'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
-	'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',',
-	'.', '/', ' ', ' ', ' '};
-
-void set_keylog(uint16_t keycode, keyrecord_t *record) {
-	char name = ' ';
-	if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >=
-			QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
-		keycode = keycode & 0xFF;
-	}
-	if (keycode < 60) {
-		name = code_to_name[keycode];
-	}
-
-	// update keylog
-	snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c",
-			record->event.key.row, record->event.key.col, keycode, name);
-}
-
-void oled_render_keylog(void) { oled_write(keylog_str, false); }
-
-void render_bootmagic_status(bool status) {
-	/* Show Ctrl-Gui Swap options */
-	static const char PROGMEM logo[][2][3] = {
-		{{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
-		{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
-	};
-	if (status) {
-		oled_write_ln_P(logo[0][0], false);
-		oled_write_ln_P(logo[0][1], false);
-	} else {
-		oled_write_ln_P(logo[1][0], false);
-		oled_write_ln_P(logo[1][1], false);
-	}
-}
-
 void oled_render_logo(void) {
 	static const char PROGMEM crkbd_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84,
 		0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90,
@@ -288,10 +215,85 @@ void oled_render_logo(void) {
 	oled_write_P(crkbd_logo, false);
 }
 
+void oled_animate_lain(uint8_t frame) {
+	static const char PROGMEM lain_logo[][512] = {
+		{
+			// 'lain_mpv-shot0009', 128x32px
+			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, 0x60, 0x18, 0x04, 0x01, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x03, 0x01,
+			0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x24, 0x00, 0x24, 0x0c, 0x14,
+			0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x50, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x06, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x00, 0x60, 0x40, 0x00,
+			0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x24, 0x08, 0x85, 0x41,
+			0x20, 0x00, 0x00, 0x20, 0x18, 0x04, 0x04, 0x00, 0x00, 0x0c, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x18, 0x88, 0x00, 0x08,
+			0x18, 0x04, 0x40, 0xe0, 0x70, 0x11, 0x08, 0x00, 0xc0, 0x80, 0x22, 0x12, 0x58, 0x24, 0x14, 0x00,
+			0x00, 0x00, 0x02, 0x00, 0x40, 0xc0, 0x00, 0x80, 0x20, 0x78, 0xc2, 0x01, 0x00, 0x68, 0x01, 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, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x02, 0x00, 0x01,
+			0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x0b, 0x03, 0x00, 0x00, 0x14, 0x87, 0x04, 0x14, 0x08, 0x06,
+			0x06, 0x01, 0x40, 0x11, 0x0f, 0x01, 0x00, 0x78, 0x2c, 0x1f, 0x01, 0x00, 0xf0, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		},{
+			// 'lain_mpv-shot0011', 128x32px
+			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, 0x30, 0x08, 0x02, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x26, 0x00, 0x10, 0x06, 0x02, 0x00,
+			0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x41, 0x41, 0x40, 0x40, 0x01, 0x01, 0xa0, 0x62, 0x02, 0x04,
+			0x01, 0x03, 0x0c, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x8f, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0x40, 0x00, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x28, 0xc8, 0x10, 0x11, 0x80, 0x40,
+			0x00, 0x00, 0x80, 0x20, 0x18, 0x10, 0x00, 0x00, 0x0f, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+			0x20, 0x41, 0x00, 0x8a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x20, 0x80, 0x08, 0x10,
+			0x40, 0x00, 0xc0, 0xe0, 0x3c, 0x08, 0x84, 0x20, 0x80, 0x2a, 0x74, 0x80, 0x40, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x80, 0xc0, 0xc0, 0x40, 0x00, 0xa0, 0xc0, 0x00, 0xc0, 0x20, 0x00, 0x01, 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, 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, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x40, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x03, 0x00, 0x00,
+			0x00, 0x04, 0x03, 0x00, 0x00, 0x0e, 0x07, 0x01, 0x08, 0x16, 0x10, 0x84, 0x48, 0x18, 0x04, 0x04,
+			0x04, 0x03, 0x01, 0x06, 0x40, 0x42, 0x51, 0x28, 0x0e, 0x03, 0x7e, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		}
+	};
+
+	oled_write_raw_P(lain_logo[frame], sizeof(lain_logo[frame]));
+}
+
 bool oled_task_user(void) {
 	if (is_keyboard_master()) {
-		oled_render_layer_state();
-		oled_render_keylog();
+		oled_animate_lain((timer_read() / 1000) % 2);
 	} else {
 		oled_render_logo();
 	}
@@ -299,9 +301,6 @@ bool oled_task_user(void) {
 }
 
 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
-	if (record->event.pressed) {
-		set_keylog(keycode, record);
-	}
 	return true;
 }
 #endif  // OLED_ENABLE