PM update

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4941 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-07-14 19:38:14 +00:00
parent 0819c01cec
commit 17d4bfbf31
3 changed files with 20 additions and 6 deletions

View File

@ -488,7 +488,6 @@ CONFIG_PM_BUTTONS_NAME4="DOWN"
CONFIG_PM_BUTTONS_NAME5="LEFT" CONFIG_PM_BUTTONS_NAME5="LEFT"
CONFIG_PM_BUTTONS_NAME6="RIGHT" CONFIG_PM_BUTTONS_NAME6="RIGHT"
CONFIG_PM_BUTTONS_NAME7="UP" CONFIG_PM_BUTTONS_NAME7="UP"
CONFIG_PM_BUTTONS=1
# #
# Settings for NXFLAT # Settings for NXFLAT

View File

@ -1169,24 +1169,39 @@ static void stm3210e_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstat
{ {
duty--; duty--;
} }
putreg16((uint16_t)duty, STM32_TIM1_CCR1);
putreg16((uint16_t)duty, STM32_TIM1_CCR1);
#endif #endif
} }
break; break;
case(PM_IDLE): case(PM_IDLE):
{ {
/* Entering IDLE mode - Turn display off */ /* Entering IDLE mode - Reduce LCD light */
#ifdef CONFIG_LCD_PWM #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 #endif
} }
break; break;
case(PM_STANDBY): 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; break;

View File

@ -93,7 +93,7 @@ void up_pminitialize(void)
pm_initialize(); 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 */ /* Initialize the buttons to wake up the system from low power modes */
up_pmbuttons(); up_pmbuttons();