This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit be1b47a8aee5ef2e6ba01d05ea6082bf9f646b1a
Author: pengyiqiang <[email protected]>
AuthorDate: Wed Jun 24 21:31:28 2026 +0800

    graphics/input: Fill timestamps in generated touch points.
    
    Set each generated touch point timestamp from CLOCK_MONOTONIC in
    microseconds so consumers receive event timing along with the touch
    coordinates. Initialize the field to zero if the clock cannot be read.
    
    Assisted-by: OpenCode:claude-opus-5-5
    Signed-off-by: pengyiqiang <[email protected]>
---
 graphics/input/generator/input_gen_event.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/graphics/input/generator/input_gen_event.c 
b/graphics/input/generator/input_gen_event.c
index 51219d51b..a969f931e 100644
--- a/graphics/input/generator/input_gen_event.c
+++ b/graphics/input/generator/input_gen_event.c
@@ -28,6 +28,7 @@
 
 #include <nuttx/debug.h>
 #include <stdint.h>
+#include <time.h>
 #include <unistd.h>
 
 #include "input_gen_internal.h"
@@ -559,10 +560,18 @@ int input_gen_mouse_wheel(input_gen_ctx_t ctx, int16_t 
wheel)
 void input_gen_fill_point(FAR struct touch_point_s *point,
                           int16_t x, int16_t y, uint8_t flags)
 {
+  struct timespec ts;
+
   point->x = x;
   point->y = y;
   point->h = 1;
   point->w = 1;
+  point->timestamp = 0;
+
+  if (clock_gettime(CLOCK_MONOTONIC, &ts) == OK)
+    {
+      point->timestamp = (uint64_t)ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
+    }
 
   if (flags & TOUCH_UP)
     {

Reply via email to