summaryrefslogtreecommitdiff
path: root/keyboards/boardsource/unicorne/unicorne.c
diff options
context:
space:
mode:
authorjack <0x6A73@pm.me>2023-07-20 17:57:08 -0600
committerGitHub <noreply@github.com>2023-07-20 17:57:08 -0600
commit327b40f5938bb589d6ed173d8fec72f35bde7231 (patch)
treefb37274f28ac77b8c33f180a18622dbc55546642 /keyboards/boardsource/unicorne/unicorne.c
parentd47c4630f819eb5057749d252e36edfd47262416 (diff)
[Keyboard] Add boardsource/unicorne (#21510)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Cole Smith <smithcole@protonmail.com>
Diffstat (limited to 'keyboards/boardsource/unicorne/unicorne.c')
-rw-r--r--keyboards/boardsource/unicorne/unicorne.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/keyboards/boardsource/unicorne/unicorne.c b/keyboards/boardsource/unicorne/unicorne.c
new file mode 100644
index 0000000000..0c443722e0
--- /dev/null
+++ b/keyboards/boardsource/unicorne/unicorne.c
@@ -0,0 +1,37 @@
+// Copyright 2023 jack (@waffle87)
+// SPDX-License-Identifier: GPL-2.0-or-later
+#include "unicorne.h"
+
+#ifdef OLED_ENABLE
+oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
+ if (!is_keyboard_master()) {
+ return OLED_ROTATION_180;
+ }
+ return rotation;
+}
+
+bool oled_task_kb(void) {
+ if (!oled_task_user()) {
+ return false;
+ }
+ if (is_keyboard_master()) {
+ switch (get_highest_layer(layer_state)) {
+ case 0:
+ oled_write_raw(layer_zero, sizeof(layer_zero));
+ break;
+ case 1:
+ oled_write_raw(layer_zero, sizeof(layer_zero));
+ break;
+ case 2:
+ oled_write_raw(layer_zero, sizeof(layer_zero));
+ break;
+ case 3:
+ oled_write_raw(layer_zero, sizeof(layer_zero));
+ break;
+ }
+ } else {
+ oled_write_raw(logo, sizeof(logo));
+ }
+ return false;
+}
+#endif