mirror of
https://github.com/apache/nuttx.git
synced 2026-08-18 01:49:24 +08:00
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 <zhangyu117@xiaomi.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user