From 38073c3d44f5e1093a529803cb724b744af91160 Mon Sep 17 00:00:00 2001 From: takashicompany Date: Fri, 20 May 2022 13:38:00 +0900 Subject: [Keyboard] Add miniZone keyboard (#16644) Co-authored-by: Ryan Co-authored-by: Drashna Jaelre --- keyboards/takashicompany/minizone/minizone.c | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 keyboards/takashicompany/minizone/minizone.c (limited to 'keyboards/takashicompany/minizone/minizone.c') diff --git a/keyboards/takashicompany/minizone/minizone.c b/keyboards/takashicompany/minizone/minizone.c new file mode 100644 index 0000000000..5231c8c497 --- /dev/null +++ b/keyboards/takashicompany/minizone/minizone.c @@ -0,0 +1,55 @@ +// Copyright 2022 takashicompany (@takashicompany) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "minizone.h" + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return OLED_ROTATION_270; +} + +//Variable that stores the number of times the key was pressed +static uint16_t press_count = 0; + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + + // Increment the counter when a key is pressed + if (record->event.pressed) { + press_count++; + } + + return process_record_user(keycode, record); +} + +bool oled_task_kb(void) { + + if (!oled_task_user()) { return false; } + + static const char PROGMEM my_logo[] = { + 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x30, 0x30, 0xf0, 0xe0, 0x30, 0x30, 0xf0, 0xe0, 0x00, 0x00, 0xf6, + 0xf6, 0x00, 0x00, 0xf0, 0xf0, 0x20, 0x30, 0x30, 0xf0, 0xe0, 0x00, 0x00, 0xf6, 0xf6, 0x00, 0x00, + 0x00, 0xc0, 0x40, 0x4f, 0x4f, 0x40, 0x40, 0x4f, 0x4f, 0xc0, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x0f, + 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, + 0x00, 0x03, 0xc2, 0x32, 0x0e, 0x82, 0x60, 0x18, 0x06, 0x03, 0xc0, 0xe0, 0x30, 0x30, 0x30, 0xe0, + 0xc0, 0x00, 0xf0, 0xf0, 0x20, 0x30, 0x30, 0xf0, 0xe0, 0x00, 0xc0, 0xe0, 0xb0, 0xb0, 0xe0, 0xc0, + 0x1e, 0x13, 0x10, 0x10, 0x12, 0x13, 0x12, 0x12, 0x12, 0x1c, 0x03, 0x07, 0x0c, 0x0c, 0x0c, 0x07, + 0x03, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x03, 0x07, 0x0d, 0x0d, 0x0d, 0x09 + }; + + oled_write_raw_P(my_logo, sizeof(my_logo)); + oled_set_cursor(0, 5); + + oled_write_ln_P(PSTR("Layer"), false); + oled_write_ln(get_u8_str(get_highest_layer(layer_state), ' '), false); + + oled_write_ln_P(PSTR(" "), false); + oled_write_ln_P(PSTR(" "), false); + + oled_write_ln_P(PSTR("Count"), false); + oled_write_ln(get_u16_str(press_count, ' '), false); + + return false; + +} +#endif \ No newline at end of file -- cgit v1.2.3