Skip to content

Commit 9247131

Browse files
Tails86hathach
authored andcommitted
Avoid spamming out endpoint on connect
1 parent 4377080 commit 9247131

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/host/hid_controller/src/hid_app.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,10 @@ void hid_app_task(void)
167167
const uint32_t interval_ms = 200;
168168
static uint32_t start_ms = 0;
169169

170-
if ( board_millis() - start_ms >= interval_ms)
170+
uint32_t current_time_ms = board_millis();
171+
if ( current_time_ms - start_ms >= interval_ms)
171172
{
172-
start_ms += interval_ms;
173+
start_ms = current_time_ms;
173174

174175
sony_ds4_output_report_t output_report = {0};
175176
output_report.set_rumble = 1;

0 commit comments

Comments
 (0)