xiaoxiang781216 commented on code in PR #17573:
URL: https://github.com/apache/nuttx/pull/17573#discussion_r2667009917


##########
include/nuttx/arch.h:
##########
@@ -2450,6 +2450,25 @@ void up_ndelay(unsigned long nanoseconds);
  * architecture specific logic.
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: nxsched_hrtimer_start
+ *
+ * Description:
+ *   (Re)start the scheduler high-resolution timer with a new expiration
+ *   based on the specified tick interval.
+ *
+ * Input Parameters:
+ *   ticks - Number of scheduler ticks until expiration.
+ *
+ * Returned Value:
+ *   Zero on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_HRTIMER
+int nxsched_hrtimer_start(clock_t ticks);

Review Comment:
   why add to arch.h? let's move to private sched's header file



##########
sched/sched/sched_processtimer.c:
##########
@@ -44,11 +44,145 @@
 #include "sched/sched.h"
 #include "wdog/wdog.h"
 #include "clock/clock.h"
+#include "hrtimer/hrtimer.h"
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+#ifdef CONFIG_HRTIMER
+
+/* Scheduler-owned high-resolution timer instance.
+ *
+ * This timer acts as the time source for scheduler-related events:
+ *
+ *  - Periodic scheduler ticks in non-tickless mode
+ *  - Dynamic expiration points in tickless mode
+ *
+ * The timer is initialized lazily to avoid unnecessary setup when
+ * CONFIG_HRTIMER is enabled but not used immediately.
+ */
+
+static hrtimer_t g_nxsched_hrtimer;
+
+/* Indicates whether the scheduler hrtimer has been initialized.
+ *
+ * Initialization is performed on first invocation of
+ * nxsched_process_hrtimer().
+ */
+
+static bool g_sched_hrtimer_inited = false;

Review Comment:
   remove, don't need with https://github.com/apache/nuttx/pull/17784



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to