diff options
Diffstat (limited to 'keymaps/onekey/f411_ls0x/keymap.c')
-rw-r--r-- | keymaps/onekey/f411_ls0x/keymap.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/keymaps/onekey/f411_ls0x/keymap.c b/keymaps/onekey/f411_ls0x/keymap.c index 75d65f3..584bce6 100644 --- a/keymaps/onekey/f411_ls0x/keymap.c +++ b/keymaps/onekey/f411_ls0x/keymap.c @@ -3,12 +3,11 @@ #include QMK_KEYBOARD_H #include "qp.h" #include "qp_surface.h" -#include "3270_11.qff.h" +#include "ls0xx.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_ortho_1x1(KC_A)}; -static painter_font_handle_t font; static painter_device_t display; static uint8_t framebuffer[SURFACE_REQUIRED_BUFFER_BYTE_SIZE( LS0XX_WIDTH, LS0XX_HEIGHT, 1)] = {0}; @@ -17,7 +16,15 @@ void keyboard_post_init_user(void) { display = qp_ls0xx_device_t_make_spi_device(LS0XX_WIDTH, LS0XX_HEIGHT, LS0XX_CS_PIN, LS0XX_SPI_DIVISOR, 0, framebuffer); - font = qp_load_font_mem(font_3270_11); qp_init(display, QP_ROTATION_0); - qp_drawtext(display, 0, 0, font, "foo bar baz"); +} + +void housekeeping_task_user(void) { + static uint32_t last_draw = 0; + if (timer_elapsed32(last_draw) > 33) { + last_draw = timer_read32(); + for (int i = 0; i < LS0XX_HEIGHT - 1; i += 8) + qp_rect(display, 0, i, 7, i + 7, 255, 255, 255, true); + qp_flush(display); + } } |