mbed library sources

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Tue Apr 28 22:45:18 2015 +0100
Parent:
526:7c4bdfe6a168
Child:
528:8bb0742e5907
Commit message:
Synchronized with git revision 55891732d461662a2320cd6f0918ba66e7864ae9

Full URL: https://github.com/mbedmicro/mbed/commit/55891732d461662a2320cd6f0918ba66e7864ae9/

[Silicon Labs] Fix a bug preventing LEUART from being clocked correctly

Changed in this revision

targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_object.h Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/mbed_overrides.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_object.h	Tue Apr 28 13:00:10 2015 +0100
+++ b/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_object.h	Tue Apr 28 22:45:18 2015 +0100
@@ -17,6 +17,7 @@
 #define MBED_GPIO_OBJECT_H
 
 #include "em_gpio.h"
+#include "PinNames.h"
 
 #ifdef __cplusplus
 extern "C" {
--- a/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/mbed_overrides.c	Tue Apr 28 13:00:10 2015 +0100
+++ b/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/mbed_overrides.c	Tue Apr 28 22:45:18 2015 +0100
@@ -50,7 +50,12 @@
     CMU_ClockSelectSet(cmuClock_LFA, LFXO);
 #endif
 #ifdef CMU_LFBCLKSEL_REG
-    CMU_ClockSelectSet(cmuClock_LFB, LFXO);
+	  /* cmuClock_LFB (to date) only has LEUART peripherals.
+		*  Do NOT set it up here, as LEUARTs might have been initialized
+		*	 before this code is called. (Limitation of the override mechanism of ARMCC) 
+		*/
+		//TODO: Look for a more elegant fix.
+    //CMU_ClockSelectSet(cmuClock_LFB, LFXO);
 #endif
 #ifdef CMU_LFECLKSEL_REG
     CMU_ClockSelectSet(cmuClock_LFE, LFXO);
--- a/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c	Tue Apr 28 13:00:10 2015 +0100
+++ b/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c	Tue Apr 28 22:45:18 2015 +0100
@@ -408,6 +408,7 @@
     if(LEUART_REF_VALID(obj->serial.periph.leuart)) {
         // Set up LEUART clock tree to use high-speed clock)
         CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_CORELEDIV2);
+			  CMU_ClockEnable(cmuClock_LFB, true);
         CMU_ClockSelectSet(serial_get_clock(obj), cmuSelect_CORELEDIV2);
     }