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.git


The following commit(s) were added to refs/heads/master by this push:
     new e9e93c3b2c9 arch/tricore: idle donot depend on illd
e9e93c3b2c9 is described below

commit e9e93c3b2c95247fef9597288f2dfcb411e43350
Author: zhangyu117 <[email protected]>
AuthorDate: Mon Jul 13 10:01:39 2026 +0800

    arch/tricore: idle donot depend on illd
    
    Replace the iLLD Ifx_Ssw_infiniteLoop() helper in the idle path with
    a self-contained 'loopu' instruction wrapper (tricore_idle_loop()).
    The 'loopu' (loop unconditional) instruction branches back to itself
    until an interrupt is taken, which is the standard TriCore low-power
    idle sequence; the GNU and Tasking assemblers spell the backward
    label differently, so the macro dispatches on the toolchain.
    
    This removes the arch/tricore idle path's dependency on the Infineon
    iLLD/Ssw layer.  No behavior change: the loop is still interrupted by
    any IRQ that causes a context switch away from the idle task.
    
    Signed-off-by: zhangyu117 <[email protected]>
---
 arch/tricore/src/common/tricore_idle.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/arch/tricore/src/common/tricore_idle.c 
b/arch/tricore/src/common/tricore_idle.c
index 4f654f55b24..402f8d04cf6 100644
--- a/arch/tricore/src/common/tricore_idle.c
+++ b/arch/tricore/src/common/tricore_idle.c
@@ -32,6 +32,16 @@
 
 #include "tricore_internal.h"
 
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#if defined(__TASKING__)
+#  define tricore_idle_loop() __asm__ volatile ("1: loopu 1p")
+#else
+#  define tricore_idle_loop() __asm__ volatile ("1: loopu 1b")
+#endif
+
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -67,10 +77,7 @@ void up_idle(void)
   board_autoled_off(LED_CPU);
 #endif
 
-  /* This would be an appropriate place to put some MCU-specific logic to
-   * sleep in a reduced power mode until an interrupt occurs to save power
-   */
+  tricore_idle_loop();
 
-  Ifx_Ssw_infiniteLoop();
 #endif
 }

Reply via email to