Maintool / mbed-src-v4

Fork of mbed-src by mbed official

Revision:
84:f54042cbc282
Parent:
80:66393a7b209d
Child:
100:0412b5443284
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/sleep.c	Fri Jan 31 10:15:06 2014 +0000
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/sleep.c	Mon Feb 03 09:30:05 2014 +0000
@@ -102,10 +102,17 @@
 // MCU SLEEP mode
 void sleep(void)
 {
+    // Disable us_ticker update interrupt
+    TIM_ITConfig(TIM9, TIM_IT_Update, DISABLE);
+
     // Enable PWR clock
     RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);    
+
     // Request to enter SLEEP mode with regulator ON
-    PWR_EnterSleepMode(PWR_Regulator_ON, PWR_SLEEPEntry_WFI); 
+    PWR_EnterSleepMode(PWR_Regulator_ON, PWR_SLEEPEntry_WFI);
+
+    // Re-enable us_ticker update interrupt
+    TIM_ITConfig(TIM9, TIM_IT_Update, ENABLE);
 }
 
 // MCU STOP mode (Regulator in LP mode, LSI, HSI and HSE OFF)