Skip to content

Commit

Permalink
improve trio
Browse files Browse the repository at this point in the history
  • Loading branch information
zzeneg committed Nov 6, 2024
1 parent f6ef091 commit 8a22708
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion keyboards/trio/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{
"pin_a": "GP29",
"pin_b": "GP28",
"resolution": 4
"resolution": 2
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion keyboards/trio/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),

[_SYMBOL] = LAYOUT(
KC_AMPR, KC_ASTR, KC_LCBR, XXXXXXX, XXXXXXX, XXXXXXX, KC_DQUO, KC_TILD,
KC_AMPR, KC_ASTR, KC_LPRN, XXXXXXX, XXXXXXX, XXXXXXX, KC_DQUO, KC_TILD,
XXXXXXX, KC_RPRN, KC_DLR, KC_PERC, KC_CIRC, KC_LCBR, KC_RCBR, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI, XXXXXXX,
XXXXXXX, KC_EXLM, KC_AT, KC_HASH, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_PIPE, XXXXXXX,
_______, _______, _______, _______, _______, _______
Expand Down
23 changes: 17 additions & 6 deletions keyboards/trio/keymaps/hid/hid_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "lvgl_helpers.h"

uint16_t home_screen_timer = 0;
uint16_t volume_timer = 0;

/* screens */
static lv_obj_t *screen_home;
Expand Down Expand Up @@ -149,10 +150,16 @@ void display_process_raw_hid_data(uint8_t *data, uint8_t length) {

case _VOLUME:
dprintf("volume %d\n", data[1]);
lv_label_set_text_fmt(label_volume_home, "Vol: %02d%%", data[1]);
lv_label_set_text_fmt(label_volume_arc, "%02d", data[1]);
lv_arc_set_value(arc_volume, data[1]);
lv_scr_load(screen_volume);
if (lv_scr_act() != screen_volume) {
lv_scr_load(screen_volume);
}
lv_label_set_text_fmt(label_volume_home, "Vol: %d%%", data[1]);
lv_label_set_text_fmt(label_volume_arc, "%d", data[1]);
if (timer_elapsed(volume_timer) > 100) {
// arc rendering is slow, add delay to overcome issues with fast changing volume
volume_timer = timer_read();
lv_arc_set_value(arc_volume, data[1]);
}
start_home_screen_timer();
break;

Expand All @@ -165,15 +172,19 @@ void display_process_raw_hid_data(uint8_t *data, uint8_t length) {
read_string(data, string_data);
dprintf("media artist %s\n", string_data);
lv_label_set_text(label_media_artist, string_data);
lv_scr_load(screen_media);
if (lv_scr_act() != screen_media) {
lv_scr_load(screen_media);
}
start_home_screen_timer();
break;

case _MEDIA_TITLE:
read_string(data, string_data);
dprintf("media title %s\n", string_data);
lv_label_set_text(label_media_title, string_data);
lv_scr_load(screen_media);
if (lv_scr_act() != screen_media) {
lv_scr_load(screen_media);
}
start_home_screen_timer();
break;
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/trio/keymaps/hid/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),

[_SYMBOL] = LAYOUT(
KC_AMPR, KC_ASTR, KC_LCBR, XXXXXXX, XXXXXXX, XXXXXXX, KC_DQUO, KC_TILD,
KC_AMPR, KC_ASTR, KC_LPRN, XXXXXXX, XXXXXXX, XXXXXXX, KC_DQUO, KC_TILD,
XXXXXXX, KC_RPRN, KC_DLR, KC_PERC, KC_CIRC, KC_LCBR, KC_RCBR, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI, XXXXXXX,
XXXXXXX, KC_EXLM, KC_AT, KC_HASH, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_PIPE, XXXXXXX,
_______, _______, _______, _______, _______, _______
Expand Down

0 comments on commit 8a22708

Please sign in to comment.