diff options
| author | James Smith <[email protected]> | 2023-02-09 21:21:57 -0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-03-13 16:31:25 +0700 |
| commit | 9247131b1f6476c433ceb47d4746c9bc5baf8b65 (patch) | |
| tree | 5365b7fd141dd5b91de9a4a8a91536157c4f380a /examples/host | |
| parent | 43770802f9164f8bc3973719c25ba46ff4ba23ca (diff) | |
Avoid spamming out endpoint on connect
Diffstat (limited to 'examples/host')
| -rw-r--r-- | examples/host/hid_controller/src/hid_app.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/host/hid_controller/src/hid_app.c b/examples/host/hid_controller/src/hid_app.c index 114768ab7..76de97b41 100644 --- a/examples/host/hid_controller/src/hid_app.c +++ b/examples/host/hid_controller/src/hid_app.c @@ -167,9 +167,10 @@ void hid_app_task(void) const uint32_t interval_ms = 200; static uint32_t start_ms = 0; - if ( board_millis() - start_ms >= interval_ms) + uint32_t current_time_ms = board_millis(); + if ( current_time_ms - start_ms >= interval_ms) { - start_ms += interval_ms; + start_ms = current_time_ms; sony_ds4_output_report_t output_report = {0}; output_report.set_rumble = 1; |
