mbed library sources

Dependents:   bare

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Wed Mar 19 17:15:21 2014 +0000
Parent:
126:549ba18ddd81
Child:
128:4cda7c483b31
Commit message:
Synchronized with git revision 92d3e97e186ceaa812d103009822fb1a21d797de

Full URL: https://github.com/mbedmicro/mbed/commit/92d3e97e186ceaa812d103009822fb1a21d797de/

Merge after reverting the python scripts to generating hex file with UICR

Changed in this revision

common/board.c Show annotated file Show diff for this revision Revisions of this file
common/gpio.c Show annotated file Show diff for this revision Revisions of this file
targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NORDIC/TARGET_NRF51822/PinNames.h Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NORDIC/TARGET_NRF51822/device.h Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NORDIC/TARGET_NRF51822/us_ticker.c Show annotated file Show diff for this revision Revisions of this file
--- a/common/board.c	Wed Mar 19 16:00:09 2014 +0000
+++ b/common/board.c	Wed Mar 19 17:15:21 2014 +0000
@@ -19,11 +19,11 @@
 
 WEAK void mbed_die(void);
 WEAK void mbed_die(void) {
+#ifndef NRF51_H
 	__disable_irq();	// dont allow interrupts to disturb the flash pattern
-
+#endif
 #if   (DEVICE_ERROR_RED == 1)
     gpio_t led_red; gpio_init_out(&led_red, LED_RED);
-    
 #elif (DEVICE_ERROR_PATTERN == 1)
     gpio_t led_1; gpio_init_out(&led_1, LED1);
     gpio_t led_2; gpio_init_out(&led_2, LED2);
--- a/common/gpio.c	Wed Mar 19 16:00:09 2014 +0000
+++ b/common/gpio.c	Wed Mar 19 17:15:21 2014 +0000
@@ -17,9 +17,9 @@
 
 static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode)
 {
-    gpio_init(gpio, pin);
+    gpio_init(gpio, pin);    
+    gpio_dir(gpio, PIN_INPUT);
     gpio_mode(gpio, mode);
-    gpio_dir(gpio, PIN_INPUT);
 }
     
 static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int value)
--- a/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c	Wed Mar 19 16:00:09 2014 +0000
+++ b/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c	Wed Mar 19 17:15:21 2014 +0000
@@ -43,25 +43,12 @@
 }
 
 void SystemInit(void)
-{   
-    NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos);
-    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
-    }
-    //write FWID (NRF_UICR->FWID is readonly)
-    *(uint32_t *)0x10001010 = 0xFFFF0049;
-
-    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
-    }
-
-    NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos);
-    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
-    }
+{     
     // 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()){
         *(uint32_t volatile *)0x40000504 = 0xC007FFDF;
         *(uint32_t volatile *)0x40006C18 = 0x00008000;
--- a/targets/hal/TARGET_NORDIC/TARGET_NRF51822/PinNames.h	Wed Mar 19 16:00:09 2014 +0000
+++ b/targets/hal/TARGET_NORDIC/TARGET_NRF51822/PinNames.h	Wed Mar 19 17:15:21 2014 +0000
@@ -98,13 +98,13 @@
     P0_29 = p29,
     P0_30 = p30,
     
-    LED1 = p18,
-    LED2 = p19,
-    LED3 = p18,
-    LED4 = p19,
-
-    BUTTON0 = p16,
-    BUTTON1 = p17,
+    LED1    = p18,
+    LED2    = p19,
+    LED3    = p18,
+    LED4    = p19,
+    
+    BUTTON1 = p16,
+    BUTTON2 = p17,
         
     RX_PIN_NUMBER = p11,
     TX_PIN_NUMBER = p9,
--- a/targets/hal/TARGET_NORDIC/TARGET_NRF51822/device.h	Wed Mar 19 16:00:09 2014 +0000
+++ b/targets/hal/TARGET_NORDIC/TARGET_NRF51822/device.h	Wed Mar 19 17:15:21 2014 +0000
@@ -50,6 +50,8 @@
 
 #define DEVICE_STDIO_MESSAGES   0
 
+#define DEVICE_ERROR_PATTERN    1
+
 #include "objects.h"
 
 #endif
--- a/targets/hal/TARGET_NORDIC/TARGET_NRF51822/us_ticker.c	Wed Mar 19 16:00:09 2014 +0000
+++ b/targets/hal/TARGET_NORDIC/TARGET_NRF51822/us_ticker.c	Wed Mar 19 17:15:21 2014 +0000
@@ -28,8 +28,9 @@
 #ifdef __cplusplus
 extern "C" {
 #endif 
-void TIMER1_IRQHandler(void){
-    if ((US_TICKER_TIMER->EVENTS_COMPARE[1] != 0) && 
+void TIMER1_IRQHandler(void){ 
+
+     if ((US_TICKER_TIMER->EVENTS_COMPARE[1] != 0) && 
        ((US_TICKER_TIMER->INTENSET & TIMER_INTENSET_COMPARE1_Msk) != 0))
     {
 		US_TICKER_TIMER->EVENTS_COMPARE[1] = 0;