mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Revision:
174:8bb9f3a33240
Parent:
169:60881100c991
Child:
304:89b9c3a9a045
diff -r 033f1c328f6e -r 8bb9f3a33240 targets/hal/TARGET_STM/TARGET_NUCLEO_F103RB/us_ticker.c
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F103RB/us_ticker.c	Mon Apr 28 18:15:06 2014 +0100
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F103RB/us_ticker.c	Tue Apr 29 11:15:07 2014 +0100
@@ -59,14 +59,12 @@
         if (oc_rem_part > 0) {
             set_compare(oc_rem_part); // Finish the remaining time left
             oc_rem_part = 0;
-        }
-        else {
+        } else {
             if (oc_int_part > 0) {
                 set_compare(0xFFFF);
                 oc_rem_part = cval; // To finish the counter loop the next time
                 oc_int_part--;
-            }
-            else {
+            } else {
                 us_ticker_irq_handler();
             }
         }
@@ -75,13 +73,13 @@
 
 void us_ticker_init(void) {
     TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
-  
+
     if (us_ticker_inited) return;
     us_ticker_inited = 1;
-  
-    // Enable Timer clock
+
+    // Enable timer clock
     TIM_MST_RCC;
-  
+
     // Configure time base
     TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);
     TIM_TimeBaseStructure.TIM_Period = 0xFFFF;
@@ -89,15 +87,15 @@
     TIM_TimeBaseStructure.TIM_ClockDivision = 0;
     TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
     TIM_TimeBaseInit(TIM_MST, &TIM_TimeBaseStructure);
-    
+
     // Configure interrupts
     TIM_ITConfig(TIM_MST, TIM_IT_Update, ENABLE);
-    
+
     // Update interrupt used for 32-bit counter
     // Output compare interrupt used for timeout feature
     NVIC_SetVector(TIM_MST_IRQ, (uint32_t)tim_irq_handler);
     NVIC_EnableIRQ(TIM_MST_IRQ);
-  
+
     // Enable timer
     TIM_Cmd(TIM_MST, ENABLE);
 }
@@ -129,8 +127,7 @@
 
     if (delta <= 0) { // This event was in the past
         us_ticker_irq_handler();
-    }
-    else {
+    } else {
         oc_int_part = (uint32_t)(delta >> 16);
         oc_rem_part = (uint16_t)(delta & 0xFFFF);
         if (oc_rem_part <= (0xFFFF - cval)) {