diff options
| author | hathach <[email protected]> | 2018-07-23 17:46:07 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-07-23 17:46:07 +0700 |
| commit | 3e209f9c20c9251e01af35da4d9e454fcc2f61dd (patch) | |
| tree | cb0c95b6356bb51bec84a18e79498b25495ea89c /src/common/timeout_timer.h | |
| parent | 262be103e0478fc70fcc4e392c5ad1ad60bc074b (diff) | |
enhance device hid
- add CFG_TUD_HID_ASCII_TO_KEYCODE_LOOKUP
- add tud_hid_keyboard_send_keycode(), tud_hid_keyboard_send_char(),
tud_hid_keyboard_send_string()
- add timeout_blocking_wait()
Diffstat (limited to 'src/common/timeout_timer.h')
| -rw-r--r-- | src/common/timeout_timer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/timeout_timer.h b/src/common/timeout_timer.h index aafc8cce2..5c62c6904 100644 --- a/src/common/timeout_timer.h +++ b/src/common/timeout_timer.h @@ -67,6 +67,15 @@ static inline bool timeout_expired(timeout_timer_t* tt) return ( tusb_hal_millis() - tt->start ) >= tt->interval;
}
+static inline void timeout_blocking_wait(uint32_t msec)
+{
+ timeout_timer_t tt;
+ timeout_set(&tt, msec);
+
+ // blocking delay
+ while ( !timeout_expired(&tt) ) { }
+}
+
#ifdef __cplusplus
}
#endif
|
