Skip to content

Commit b029c94

Browse files
committed
Modified example app.
1 parent 7e59b59 commit b029c94

File tree

1 file changed

+8
-0
lines changed
  • examples/device/hid_composite/src

1 file changed

+8
-0
lines changed

examples/device/hid_composite/src/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ void hid_task(void)
241241
// Poll every 10ms
242242
const uint32_t interval_ms = 10;
243243
static uint32_t start_ms = 0;
244+
static uint32_t touch_ms = 0;
245+
static bool touch_state = false;
246+
247+
if (board_millis() - touch_ms < 100) {
248+
touch_ms = board_millis();
249+
send_stylus_touch(0, 0, touch_state = !touch_state);
250+
return;
251+
}
244252

245253
if ( board_millis() - start_ms < interval_ms) return; // not enough time
246254
start_ms += interval_ms;

0 commit comments

Comments
 (0)