wangzhi-art commented on code in PR #15614:
URL: https://github.com/apache/nuttx/pull/15614#discussion_r1922027344


##########
arch/xtensa/src/esp32s2/esp32s2_rt_timer.c:
##########
@@ -188,8 +187,20 @@ static void start_rt_timer(struct rt_timer_s *timer,
       tmrwarn("WARN: Timer not in idle mode.\n"\
              "Only idle timer can be started!\n");
     }
+}
+
+static void start_rt_timer(struct rt_timer_s *timer,
+                           uint64_t timeout,
+                           bool repeat)
+{
+  irqstate_t flags;
+  struct esp32s2_rt_priv_s *priv = &g_rt_priv;
 
-  leave_critical_section(flags);
+  flags = spin_lock_irqsave(&priv->lock);
+  sched_lock();

Review Comment:
   Because there is tmrwarn() in func start_rt_timer_nolock(line 186), which 
may cause context switch.



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to