clean up bsp, adde board_millis()

This commit is contained in:
hathach
2019-03-23 22:31:07 +07:00
parent d866999bf0
commit 29e075b8b9
14 changed files with 40 additions and 65 deletions

View File

@@ -150,10 +150,11 @@ void usb_hid_task(void* params)
(void) params;
// Poll every 10ms
static tu_timeout_t tm = { .start = 0, .interval = 10 };
const uint32_t interval_ms = 10;
static uint32_t start_ms = 0;
if ( !tu_timeout_expired(&tm) ) return; // not enough time
tu_timeout_reset(&tm);
if ( board_millis() < start_ms + interval_ms) return; // not enough time
start_ms += interval_ms;
uint32_t const btn = board_buttons();