From f2ea65db6b8834dcb2a21462f43c1d89add6b101 Mon Sep 17 00:00:00 2001 From: Jonas Avellana <14019120+ninjonas@users.noreply.github.com> Date: Mon, 2 Sep 2019 08:40:01 -0600 Subject: [keymap] ninjonas userspace and keymaps for hotdox, lily58, & pinky3 (#6649) * [keyboard] introducing ninjonas userspace & keymaps for hotdox, lily58, and pinky3 * [fix(#6649)] removed M_EPRM and used builtin EEP_RST keycode as-per review. * [chore(#6649)] forgot to update keymap legend on lily58 --- users/ninjonas/ninjonas.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 users/ninjonas/ninjonas.c (limited to 'users/ninjonas/ninjonas.c') diff --git a/users/ninjonas/ninjonas.c b/users/ninjonas/ninjonas.c new file mode 100644 index 0000000000..6a77ecf8b0 --- /dev/null +++ b/users/ninjonas/ninjonas.c @@ -0,0 +1,68 @@ +/* Copyright 2019 @ninjonas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "ninjonas.h" + +layer_state_t layer_state_set_user (layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +// BEGIN: SSD1306OLED +// SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#if defined(KEYBOARD_lily58_rev1) & defined(PROTOCOL_LUFA) +extern uint8_t is_master; + +void matrix_init_user(void) { + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + iota_gfx_init(!has_usb()); // turns on the display +} + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +//void set_keylog(uint16_t keycode, keyrecord_t *record); // Moved to process_records.h +const char *read_keylog(void); +const char *read_keylogs(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + } else { + matrix_write(matrix, read_logo()); + } +} + +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 +// END: SSD1306OLED \ No newline at end of file -- cgit v1.2.3 From ff854565ce012a325ad04b09a7bcb7c8bb9d43c5 Mon Sep 17 00:00:00 2001 From: Jonas Avellana <14019120+ninjonas@users.noreply.github.com> Date: Wed, 25 Sep 2019 22:28:06 -0600 Subject: [Keymap] ninjonas keymap for crkbd & ninjonas userspace updates (#6797) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [keymap(crkbd)] introducing crkbd keymap on ninjonas profile * [keymap(crkbd)] introducing crkbd keymap on ninjonas profile * [refactor(crkbd)] reducing file size by selecting RGB animations * [refactor(crkbd)] added shiftit key * [refactor(crkbd)] added shiftit key * [chore(crkbd)] adding SLEEP_LED_ENABLE on rules.mk * [refactor(crkbd)] added keylog & removed static rainbow RGB * [feat(crkbd)] introduced em-dash '—' keymap * [feat(crkbd)] added screenshot functionality * [refactor(lily58,pinky3)] moving media keys * [refactor(lily58)] Added emdash key * [chore] removing NUMBERS & FUNCTIONS layers as they're useless * [chore] removing NUMBERS & FUNCTIONS layers as they're useless * [chore(crkbd,lily48)] Updating README.md * [feat] added K_LAPP & K_RAPP to mimic command + tab * [feat] added K_LAPP & K_RAPP to mimic command + tab * [fix(#6797)] resolving changes requested by @drashna * [fix(#6797)] first cut on using QMK OLED Driver * [fix(#6797)] cleaning up rules.mk * [fix(#6797)] making scrolling logo work * [fix(#6797)] Using OLED Driver for Lily58 * [fix(#6797)] Moved OLED driver implementation to ninjonas userspace * [fix(#6797)] Bringing back crkbd & lily58 logos * [fix(#6797)] Turning off OLED based off @drashna's workaround in #5982 * [fix(#6797)] whoops! forgot to checkin crkbd/config.h * [fix(#6797)] fixing issue with OLED randomly turning on * [fix(#6797)] using default glcdfont.c for lily58 & crkbd * [fix(#6797)] Using LINK_TIME_OPTIMIZATION_ENABLE rather than EXTRAFLAGS as per code review * [fix(#6797)] updating M_MALL macro as per code review by @fauxpark --- users/ninjonas/ninjonas.c | 50 +---------------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) (limited to 'users/ninjonas/ninjonas.c') diff --git a/users/ninjonas/ninjonas.c b/users/ninjonas/ninjonas.c index 6a77ecf8b0..49e12e4824 100644 --- a/users/ninjonas/ninjonas.c +++ b/users/ninjonas/ninjonas.c @@ -17,52 +17,4 @@ layer_state_t layer_state_set_user (layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -} - -// BEGIN: SSD1306OLED -// SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#if defined(KEYBOARD_lily58_rev1) & defined(PROTOCOL_LUFA) -extern uint8_t is_master; - -void matrix_init_user(void) { - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - iota_gfx_init(!has_usb()); // turns on the display -} - -// When add source files to SRC in rules.mk, you can use functions. -const char *read_layer_state(void); -const char *read_logo(void); -//void set_keylog(uint16_t keycode, keyrecord_t *record); // Moved to process_records.h -const char *read_keylog(void); -const char *read_keylogs(void); - -void matrix_scan_user(void) { - iota_gfx_task(); -} - -void matrix_render_user(struct CharacterMatrix *matrix) { - if (is_master) { - // If you want to change the display of OLED, you need to change here - matrix_write_ln(matrix, read_layer_state()); - matrix_write_ln(matrix, read_keylog()); - matrix_write_ln(matrix, read_keylogs()); - } else { - matrix_write(matrix, read_logo()); - } -} - -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 -// END: SSD1306OLED \ No newline at end of file +} \ No newline at end of file -- cgit v1.2.3