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:
Wed Jul 02 09:30:07 2014 +0100
Parent:
247:135e3186a638
Child:
249:5706c6e2db45
Commit message:
Synchronized with git revision 69befae9498c49ad9a0883fd7fbf7cd29d2b3f09

Full URL: https://github.com/mbedmicro/mbed/commit/69befae9498c49ad9a0883fd7fbf7cd29d2b3f09/

[NUCLEO_L053R8] Fix ticker issue

Changed in this revision

targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/us_ticker.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/us_ticker.c	Tue Jul 01 15:00:09 2014 +0100
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/us_ticker.c	Wed Jul 02 09:30:07 2014 +0100
@@ -51,15 +51,15 @@
 static void tim_irq_handler(void) {
     uint16_t cval = TIM_MST->CNT;
 
-    if (__HAL_TIM_GET_ITSTATUS(&TimMasterHandle, TIM_IT_UPDATE) == SET) {
-        __HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_UPDATE);
-        __HAL_TIM_SetCounter(&TimMasterHandle, 0); // Reset counter !!!
+    // Clear Update interrupt flag
+    if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_UPDATE) == SET) {
+        __HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_UPDATE);
         SlaveCounter++;
     }
 
-    // Clear interrupt flag
-    if (__HAL_TIM_GET_ITSTATUS(&TimMasterHandle, TIM_IT_CC1) == SET) {
-        __HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC1);
+    // Clear CC1 interrupt flag
+    if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) {
+        __HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1);
         if (oc_rem_part > 0) {
             set_compare(oc_rem_part); // Finish the remaining time left
             oc_rem_part = 0;
@@ -147,5 +147,5 @@
 }
 
 void us_ticker_clear_interrupt(void) {
-    __HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC1);
+    __HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1);
 }