Skip to content

Commit

Permalink
Fixed analog buttons, changed ASC Emulation to 1000Hz, added TT Solid…
Browse files Browse the repository at this point in the history
… mode
  • Loading branch information
veroxzik committed Jan 22, 2021
1 parent a9c817e commit 912c599
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
9 changes: 6 additions & 3 deletions roxy/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ auto konami_conf_desc = configuration_desc(1, 1, 0, 0xc0, 0,
// HID interface.
interface_desc(0, 0, 1, 0x03, 0x00, 0x00, 0,
hid_desc(0x111, 0, 1, 0x22, sizeof(report_desc)),
endpoint_desc(0x81, 0x03, 16, 4)
endpoint_desc(0x81, 0x03, 16, 1)
)
);

Expand Down Expand Up @@ -513,6 +513,9 @@ int main() {
(Turntable_Leds::Mode)rgb_config.tt_mode,
(Turntable_Leds::SpinType)(rgb_config.tt_spin & 0xF),
(Turntable_Leds::SpinDirection)((rgb_config.tt_spin >> 4) & 0xF));
if(rgb_config.tt_mode == Turntable_Leds::Solid) {
tt_leds.set_solid(rgb_config.tt_hue, rgb_config.tt_sat, rgb_config.tt_val);
}
tt_leds.set_brightness(config.rgb_brightness);
if(config.rgb_mode == 1) {
ws2812b.set_num_leds(rgb_config.tt_num_leds);
Expand Down Expand Up @@ -688,12 +691,12 @@ int main() {
}
}
for (int i = 0; i < 2; i++) {
if (last_axis_state[i] == 1 && mapping_config.axes_kb_map[2 * i] > 0) {
if (axis_state[i] == 1 && mapping_config.axes_kb_map[2 * i] > 0) {
nkro.set_key(mapping_config.axes_kb_map[2 * i]);
} else {
nkro.reset_key(mapping_config.axes_kb_map[2 * i]);
}
if (last_axis_state[i] == -1 && mapping_config.axes_kb_map[2 * i + 1] > 0) {
if (axis_state[i] == -1 && mapping_config.axes_kb_map[2 * i + 1] > 0) {
nkro.set_key(mapping_config.axes_kb_map[2 * i + 1]);
} else {
nkro.reset_key(mapping_config.axes_kb_map[2 * i + 1]);
Expand Down
18 changes: 10 additions & 8 deletions roxy/rgb/tt_led.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,16 @@ class Turntable_Leds {
}

bool update() {
if(mode == Solid) {
if(update_required) {
update_required = false;
return true;
} else {
return false;
}
}
// 2021-01-16 Known Issue: First array of Solid RGB is incorrect, so we can't rely on a single update.
// For now, just push updates at update_speed
// if(mode == Solid) {
// if(update_required) {
// update_required = false;
// return true;
// } else {
// return false;
// }
// }

if((Time::time() - last_update) < update_speed) {
return false;
Expand Down

0 comments on commit 912c599

Please sign in to comment.