summaryrefslogtreecommitdiff
path: root/nuttx/configs/stm3210e-eval/src
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/configs/stm3210e-eval/src')
-rw-r--r--nuttx/configs/stm3210e-eval/src/up_lcd.c23
-rw-r--r--nuttx/configs/stm3210e-eval/src/up_pm.c2
2 files changed, 20 insertions, 5 deletions
diff --git a/nuttx/configs/stm3210e-eval/src/up_lcd.c b/nuttx/configs/stm3210e-eval/src/up_lcd.c
index 784adaa06..42da4864a 100644
--- a/nuttx/configs/stm3210e-eval/src/up_lcd.c
+++ b/nuttx/configs/stm3210e-eval/src/up_lcd.c
@@ -1169,24 +1169,39 @@ static void stm3210e_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstat
{
duty--;
}
- putreg16((uint16_t)duty, STM32_TIM1_CCR1);
+
+ putreg16((uint16_t)duty, STM32_TIM1_CCR1);
#endif
}
break;
case(PM_IDLE):
{
- /* Entering IDLE mode - Turn display off */
+ /* Entering IDLE mode - Reduce LCD light */
#ifdef CONFIG_LCD_PWM
- putreg16(0, STM32_TIM1_CCR1);
+ frac = (g_lcddev.power << 16) / CONFIG_LCD_MAXPOWER;
+ duty = (g_lcddev.reload * frac) >> 16;
+ if (duty > 0)
+ {
+ duty--;
+ }
+
+ /* Reduce the LCD light to 50% of the MAXPOWER */
+
+ duty >>= 1;
+ putreg16((uint16_t)duty, STM32_TIM1_CCR1);
#endif
}
break;
case(PM_STANDBY):
{
- /* Entering STANDBY mode - Logic for PM_STANDBY goes here */
+ /* Entering STANDBY mode - Turn display off */
+
+#ifdef CONFIG_LCD_PWM
+ putreg16(0, STM32_TIM1_CCR1);
+#endif
}
break;
diff --git a/nuttx/configs/stm3210e-eval/src/up_pm.c b/nuttx/configs/stm3210e-eval/src/up_pm.c
index dd8a79b1c..3aa60bf5a 100644
--- a/nuttx/configs/stm3210e-eval/src/up_pm.c
+++ b/nuttx/configs/stm3210e-eval/src/up_pm.c
@@ -93,7 +93,7 @@ void up_pminitialize(void)
pm_initialize();
-#ifdef CONFIG_PM_BUTTONS
+#if defined(CONFIG_IDLE_CUSTOM) && defined(CONFIG_PM_BUTTONS)
/* Initialize the buttons to wake up the system from low power modes */
up_pmbuttons();