diff options
Diffstat (limited to 'nuttx/arch')
-rw-r--r-- | nuttx/arch/arm/src/lm3s/lm3s_internal.h | 4 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_pmstop.c | 12 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_serial.c | 28 |
3 files changed, 33 insertions, 11 deletions
diff --git a/nuttx/arch/arm/src/lm3s/lm3s_internal.h b/nuttx/arch/arm/src/lm3s/lm3s_internal.h index d9c8fd2e0..16e849b3f 100644 --- a/nuttx/arch/arm/src/lm3s/lm3s_internal.h +++ b/nuttx/arch/arm/src/lm3s/lm3s_internal.h @@ -284,6 +284,8 @@ # define GPIO_I2C1_SDA (GPIO_FUNC_PFODIO | GPIO_PORTA | 7) /* PA7: I2C1 data (I2C1SDA) */ # define GPIO_PWM1_2 (GPIO_FUNC_PFOUTPUT | GPIO_PORTB | 0) /* PB0: PWM Generator 1, PWM2 */ # define GPIO_PWM1_3 (GPIO_FUNC_PFOUTPUT | GPIO_PORTB | 1) /* PB1: PWM Generator 1, PWM3 */ +# define GPIO_USB0ID (GPIO_FUNC_PFINPUT | GPIO_PORTB | 0) /* PB0: USBID signal from the USB-On-the-Go */ +# define GPIO_USB0VBUS (GPIO_FUNC_PFODIO | GPIO_PORTB | 1) /* PB1: USB VBUS input signal from USB-OTG */ # define GPIO_I2C0_SCL (GPIO_FUNC_PFOUTPUT | GPIO_PORTB | 2) /* PB2: I2C0 clock (I2C0SCL) */ # define GPIO_I2C0_SDA (GPIO_FUNC_PFODIO | GPIO_PORTB | 3) /* PB3: I2C0 data (I2C0SDA) */ # define GPIO_CMP0_NIN (GPIO_FUNC_PFINPUT | GPIO_PORTB | 4) /* PB4: Analog comparator 0 negative input (C0-) */ @@ -292,7 +294,7 @@ # define GPIO_JTAG_TRST (GPIO_FUNC_PFINPUT | GPIO_PORTB | 7) /* PB7: JTAG ~TRST */ # define GPIO_JTAG_TCK (GPIO_FUNC_PFINPUT | GPIO_PORTC | 0) /* PC0: JTAG/SWD CLK */ # define GPIO_JTAG_SWCLK (GPIO_FUNC_PFINPUT | GPIO_PORTC | 0) /* PC0: JTAG/SWD CLK */ -# define GPIO_JTAG_TMS (GPIO_FUNC_PFIO | GPIO_PORTC | 1) /* PC1: JTAG TMS */ +# define GPIO_JTAG_TMS (GPIO_FUNC_PFINPUT | GPIO_PORTC | 1) /* PC1: JTAG TMS */ # define GPIO_JTAG_SWDIO (GPIO_FUNC_PFIO | GPIO_PORTC | 1) /* PC1: JTAG SWDIO */ # define GPIO_JTAG_TDI (GPIO_FUNC_PFINPUT | GPIO_PORTC | 2) /* PC2: JTAG TDI */ # define GPIO_JTAG_TDO (GPIO_FUNC_PFOUTPUT | GPIO_PORTC | 3) /* PC3: JTAG TDO */ diff --git a/nuttx/arch/arm/src/stm32/stm32_pmstop.c b/nuttx/arch/arm/src/stm32/stm32_pmstop.c index c68885611..9bd4af73a 100644 --- a/nuttx/arch/arm/src/stm32/stm32_pmstop.c +++ b/nuttx/arch/arm/src/stm32/stm32_pmstop.c @@ -107,8 +107,16 @@ int stm32_pmstop(bool lpds) regval |= NVIC_SYSCON_SLEEPDEEP; putreg32(regval, NVIC_SYSCON); - /* Sleep until the wakeup interrupt occurs (us WFE to wait for an event) */ + /* Sleep until the wakeup interrupt or event occurs */ - asm("WFI"); +#ifdef CONFIG_PM_WFE + /* Mode: SLEEP + Entry with WFE */ + + __asm("wfe"); +#else + /* Mode: SLEEP + Entry with WFI */ + + __asm("wfi"); +#endif return OK; } diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c index ab456eeb5..a5864acb6 100644 --- a/nuttx/arch/arm/src/stm32/stm32_serial.c +++ b/nuttx/arch/arm/src/stm32/stm32_serial.c @@ -132,8 +132,8 @@ /* Power management definitions */ -#if defined(CONFIG_PM) && !defined(CONFG_PM_SERIAL_ACTIVITY) -# define CONFG_PM_SERIAL_ACTIVITY 10 +#if defined(CONFIG_PM) && !defined(CONFIG_PM_SERIAL_ACTIVITY) +# define CONFIG_PM_SERIAL_ACTIVITY 10 #endif #ifdef USE_SERIALDRIVER @@ -1089,8 +1089,8 @@ static int up_interrupt_common(struct up_dev_s *priv) /* Report serial activity to the power management logic */ -#if defined(CONFIG_PM) && CONFG_PM_SERIAL_ACTIVITY > 0 - pm_activity(CONFG_PM_SERIAL_ACTIVITY); +#if defined(CONFIG_PM) && CONFIG_PM_SERIAL_ACTIVITY > 0 + pm_activity(CONFIG_PM_SERIAL_ACTIVITY); #endif /* Loop until there are no characters to be transferred or, @@ -1589,19 +1589,31 @@ static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate) switch (pmstate) { case(PM_NORMAL): - /* Logic for PM_NORMAL goes here */ + { + /* Logic for PM_NORMAL goes here */ + + } break; case(PM_IDLE): - /* Logic for PM_IDLE goes here */ + { + /* Logic for PM_IDLE goes here */ + + } break; case(PM_STANDBY): - /* Logic for PM_STANDBY goes here */ + { + /* Logic for PM_STANDBY goes here */ + + } break; case(PM_SLEEP): - /* Logic for PM_SLEEP goes here */ + { + /* Logic for PM_SLEEP goes here */ + + } break; default: |