mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 04:16:35 +08:00
arch/xtensa/esp32: Show CPU activity on IDLE task and on interrupts.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
committed by
Xiang Xiao
parent
93def58b9d
commit
d31a0d8aca
@@ -22,13 +22,17 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/spinlock.h>
|
||||
#include <nuttx/power/pm.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "esp32_pm.h"
|
||||
#include "xtensa.h"
|
||||
@@ -45,6 +49,18 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Does the board support an IDLE LED to indicate that the board is in the
|
||||
* IDLE state?
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS_CPU_ACTIVITY
|
||||
# define BEGIN_IDLE() board_autoled_off(LED_CPU)
|
||||
# define END_IDLE()
|
||||
#else
|
||||
# define BEGIN_IDLE()
|
||||
# define END_IDLE()
|
||||
#endif
|
||||
|
||||
/* Values for the RTC Alarm to wake up from the PM_STANDBY mode
|
||||
* (which corresponds to ESP32 stop mode). If this alarm expires,
|
||||
* the logic in this file will wakeup from PM_STANDBY mode and
|
||||
@@ -266,9 +282,11 @@ void up_idle(void)
|
||||
* sleep in a reduced power mode until an interrupt occurs to save power
|
||||
*/
|
||||
|
||||
BEGIN_IDLE();
|
||||
#if XCHAL_HAVE_INTERRUPTS
|
||||
__asm__ __volatile__ ("waiti 0");
|
||||
#endif
|
||||
END_IDLE();
|
||||
|
||||
/* Perform IDLE mode power management */
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/irq.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "xtensa.h"
|
||||
|
||||
@@ -924,6 +926,10 @@ uint32_t *xtensa_int_decode(uint32_t cpuints, uint32_t *regs)
|
||||
int cpu;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS_CPU_ACTIVITY
|
||||
board_autoled_on(LED_CPU);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* Select PRO or APP CPU interrupt mapping table */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user