mbed w/ spi bug fig

Dependents:   display-puck

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Thu Jun 26 09:00:08 2014 +0100
Parent:
237:f3da66175598
Child:
239:8cadf13dff33
Commit message:
Synchronized with git revision f2f5409d12179efcc2696d5ba1fa299f0f9771f9

Full URL: https://github.com/mbedmicro/mbed/commit/f2f5409d12179efcc2696d5ba1fa299f0f9771f9/

[NUCLEO_F401RE] Fix issue with sleep and ST HAL tick timer

Changed in this revision

targets/hal/TARGET_STM/TARGET_NUCLEO_F401RE/sleep.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F401RE/sleep.c	Tue Jun 24 14:45:08 2014 +0100
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F401RE/sleep.c	Thu Jun 26 09:00:08 2014 +0100
@@ -36,8 +36,16 @@
 static TIM_HandleTypeDef TimMasterHandle;
 
 void sleep(void) {
+    TimMasterHandle.Instance = TIM5;
+
+    // Disable HAL tick interrupt
+    __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC2);
+
     // Request to enter SLEEP mode
     HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
+
+    // Enable HAL tick interrupt
+    __HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC2);
 }
 
 void deepsleep(void) {