summaryrefslogtreecommitdiff
path: root/src/clock.c
diff options
context:
space:
mode:
authorRiceChen <[email protected]>2023-10-17 09:26:42 +0800
committerguo <[email protected]>2023-10-23 14:03:29 +0800
commitc4d649bdf5ca612d7483c776c12d97f42214f0df (patch)
tree180c82207756278c7050a0c8c1807e7ec0df4f3c /src/clock.c
parent144e662f42e0e6cb773de82edaeab5b1dc086334 (diff)
fix:only the main core detection rt_timer_check(), in SMP mode
Diffstat (limited to 'src/clock.c')
-rw-r--r--src/clock.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/clock.c b/src/clock.c
index b664e0d986..ac146192b7 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -15,6 +15,7 @@
* 2018-11-22 Jesven add per cpu tick
* 2020-12-29 Meco Man implement rt_tick_get_millisecond()
* 2021-06-01 Meco Man add critical section projection for rt_tick_increase()
+ * 2023-10-16 RiceChen fix: only the main core detection rt_timer_check(), in SMP mode
*/
#include <rthw.h>
@@ -123,6 +124,12 @@ void rt_tick_increase(void)
}
/* check timer */
+#ifdef RT_USING_SMP
+ if (rt_hw_cpu_id() != 0)
+ {
+ return;
+ }
+#endif
rt_timer_check();
}