mbed library sources

Dependents:   PA_Boost_test

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Wed Sep 03 13:30:08 2014 +0100
Parent:
306:1f0269907d8b
Commit message:
Synchronized with git revision 7aedd02f25c846ee1f22665ecc167585a8ad56bb

Full URL: https://github.com/mbedmicro/mbed/commit/7aedd02f25c846ee1f22665ecc167585a8ad56bb/

Changed in this revision

targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/system_nrf51822.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/system_nrf51822.c	Fri Aug 29 20:45:07 2014 +0100
+++ b/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/system_nrf51822.c	Wed Sep 03 13:30:08 2014 +0100
@@ -22,7 +22,7 @@
 #include "system_nrf51822.h"
 
 
-#define __SYSTEM_CLOCK      (16000000UL)     //!< nRF51 devices use a fixed System Clock Frequency of 16MHz
+#define __SYSTEM_CLOCK      (16000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
 
 static bool is_manual_peripheral_setup_needed(void);
 static bool is_disabled_in_debug_needed(void);
@@ -36,7 +36,6 @@
     uint32_t SystemCoreClock __attribute__((used)) = __SYSTEM_CLOCK;
 #endif
 
-
 void SystemCoreClockUpdate(void)
 {
     SystemCoreClock = __SYSTEM_CLOCK;
@@ -44,12 +43,16 @@
 
 void SystemInit(void)
 {
+    /* If desired, switch off the unused RAM to lower consumption by the use of RAMON register.
+       It can also be done in the application main() function. */
+
     // Prepare the peripherals for use as indicated by the PAN 26 "System: Manual setup is required
     // to enable the use of peripherals" found at Product Anomaly document for your device found at
     // https://www.nordicsemi.com/. The side effect of executing these instructions in the devices
     // that do not need it is that the new peripherals in the second generation devices (LPCOMP for
     // example) will not be available.
-    if (is_manual_peripheral_setup_needed()){
+    if (is_manual_peripheral_setup_needed())
+    {
         *(uint32_t volatile *)0x40000504 = 0xC007FFDF;
         *(uint32_t volatile *)0x40006C18 = 0x00008000;
     }
@@ -57,7 +60,8 @@
     // Disable PROTENSET registers under debug, as indicated by PAN 59 "MPU: Reset value of DISABLEINDEBUG
     // register is incorrect" found at Product Anomaly document four your device found at
     // https://www.nordicsemi.com/. There is no side effect of using these instruction if not needed.
-    if (is_disabled_in_debug_needed()){
+    if (is_disabled_in_debug_needed())
+    {
         NRF_MPU->DISABLEINDEBUG = MPU_DISABLEINDEBUG_DISABLEINDEBUG_Disabled << MPU_DISABLEINDEBUG_DISABLEINDEBUG_Pos;
     }