summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/device/hid_composite/src/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/device/hid_composite/src/main.c b/examples/device/hid_composite/src/main.c
index 958d8f4af..bc12d2a93 100644
--- a/examples/device/hid_composite/src/main.c
+++ b/examples/device/hid_composite/src/main.c
@@ -241,6 +241,14 @@ void hid_task(void)
// Poll every 10ms
const uint32_t interval_ms = 10;
static uint32_t start_ms = 0;
+ static uint32_t touch_ms = 0;
+ static bool touch_state = false;
+
+ if (board_millis() - touch_ms < 100) {
+ touch_ms = board_millis();
+ send_stylus_touch(0, 0, touch_state = !touch_state);
+ return;
+ }
if ( board_millis() - start_ms < interval_ms) return; // not enough time
start_ms += interval_ms;