Skip to content

Commit

Permalink
Fallback SOF timer
Browse files Browse the repository at this point in the history
Setup a timer to call manual_sof() again after 1050us in case we stop
getting SOFs from host.
  • Loading branch information
jfedor2 committed Dec 8, 2024
1 parent 1a0b770 commit 229d8b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions firmware/src/remapper_single.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,14 @@ void send_out_report() {
do_send_out_report();
}

static alarm_id_t fallback_sof_alarm = 0;

static int64_t __no_inline_not_in_flash_func(manual_sof)(alarm_id_t id, void* user_data) {
if (fallback_sof_alarm) {
cancel_alarm(fallback_sof_alarm);
}
fallback_sof_alarm = add_alarm_in_us(1050, manual_sof, NULL, false);

pio_usb_host_frame();
set_tick_pending();
return 0;
Expand Down

0 comments on commit 229d8b6

Please sign in to comment.