-
-
Notifications
You must be signed in to change notification settings - Fork 39.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial * reorder headers
- Loading branch information
Showing
8 changed files
with
93 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This file intentionally left blank |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,54 @@ | ||
// Copyright 2023 @boardsource | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include "quantum.h" | ||
__attribute__((weak)) void ui_init(void) {}; | ||
__attribute__((weak)) void ui_task(void) {}; | ||
|
||
#ifdef QUANTUM_PAINTER_ENABLE | ||
#include "qp.h" | ||
#include "qp_st7735.h" | ||
#include "graphics/thintel15.qff.c" | ||
|
||
static painter_device_t oled; | ||
static painter_font_handle_t font; | ||
|
||
__attribute__((weak)) void ui_init(void) { | ||
oled = qp_st7735_make_spi_device(128, 160, OLED_CS_PIN, OLED_DC_PIN, OLED_RST_PIN, 8, 0); | ||
font = qp_load_font_mem(font_thintel15); | ||
qp_init(oled, QP_ROTATION_0); | ||
qp_rect(oled, 0, 0, 130, 162, 0, 0, 0, true); | ||
qp_rect(oled, 20, 20, 108, 60, 55, 55, 55, true); | ||
qp_rect(oled, 20, 80, 108, 120, 55, 55, 55, true); | ||
qp_flush(oled); | ||
} | ||
|
||
__attribute__((weak)) void ui_task(void) { | ||
static const char *text = "Layer:"; | ||
int16_t width = qp_textwidth(font, text); | ||
qp_drawtext(oled, 20, 140, font, text); | ||
|
||
switch (get_highest_layer(layer_state)) { | ||
case 0: | ||
qp_drawtext(oled, (20 + width), 140, font, "QWERTY"); | ||
break; | ||
case 1: | ||
qp_drawtext(oled, (20 + width), 140, font, "SYMBOL"); | ||
break; | ||
case 2: | ||
qp_drawtext(oled, (20 + width), 140, font, "NUMBER"); | ||
break; | ||
default: | ||
qp_drawtext(oled, (20 + width), 140, font, "_PANIC_"); | ||
break; | ||
} | ||
} | ||
|
||
void keyboard_post_init_kb(void) { | ||
// Init the display | ||
ui_init(); | ||
keyboard_post_init_user(); | ||
} | ||
|
||
void housekeeping_task_kb(void) { | ||
// Draw the display | ||
ui_task(); | ||
housekeeping_task_user(); | ||
} | ||
#endif //QUANTUM_PAINTER_ENABLE | ||
#endif // QUANTUM_PAINTER_ENABLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.