mbed library sources: Modified to operate FRDM-KL25Z at 48MHz from internal 32kHz oscillator (nothing else changed).

Fork of mbed-src by mbed official

The only file that changed is: mbed-src-FLL48/targets/cmsis/TARGET_Freescale/TARGET_KL25Z/system_MKL25Z4.h

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Mon Sep 16 16:15:04 2013 +0100
Parent:
22:dbd009839d5e
Child:
24:75304dd5f5fb
Commit message:
Synchronized with git revision 96ea3db1b37e4f615584fba010d46f37056474ed

Changed in this revision

common/retarget.cpp Show annotated file Show diff for this revision Revisions of this file
targets/cmsis/TARGET_NXP/TARGET_LPC23XX/TOOLCHAIN_GCC_ARM/LPC2368.ld Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC23XX/analogin_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC23XX/analogout_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC23XX/ethernet_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC23XX/pinmap.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC23XX/pwmout_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/common/retarget.cpp	Fri Sep 13 14:22:58 2013 +0100
+++ b/common/retarget.cpp	Mon Sep 16 16:15:04 2013 +0100
@@ -439,13 +439,20 @@
 #undef errno
 extern "C" int errno;
 
+// For ARM7 only
+register unsigned char * stack_ptr __asm ("sp");
+
 // Dynamic memory allocation related syscall.
 extern "C" caddr_t _sbrk(int incr) {
     static unsigned char* heap = (unsigned char*)&__end__;
     unsigned char*        prev_heap = heap;
     unsigned char*        new_heap = heap + incr;
 
+#ifdef __get_MSP
     if (new_heap >= (unsigned char*)__get_MSP()) {
+#else
+    if (new_heap >= stack_ptr) {
+#endif
         errno = ENOMEM;
         return (caddr_t)-1;
     }
--- a/targets/cmsis/TARGET_NXP/TARGET_LPC23XX/TOOLCHAIN_GCC_ARM/LPC2368.ld	Fri Sep 13 14:22:58 2013 +0100
+++ b/targets/cmsis/TARGET_NXP/TARGET_LPC23XX/TOOLCHAIN_GCC_ARM/LPC2368.ld	Mon Sep 16 16:15:04 2013 +0100
@@ -143,6 +143,7 @@
     . = ALIGN( 8 ) ;
     __heap_start__ = . ;
     end = . ;
+    __end__ = . ;
 
     .stab    0 (NOLOAD) : { *(.stab) }
     .stabstr 0 (NOLOAD) : { *(.stabstr) }
--- a/targets/hal/TARGET_NXP/TARGET_LPC23XX/analogin_api.c	Fri Sep 13 14:22:58 2013 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC23XX/analogin_api.c	Mon Sep 16 16:15:04 2013 +0100
@@ -42,7 +42,7 @@
 
 void analogin_init(analogin_t *obj, PinName pin) {
     obj->adc = (ADCName)pinmap_peripheral(pin, PinMap_ADC);
-    if (obj->adc == (uint32_t)NC) {
+    if (obj->adc == (ADCName)NC) {
         error("ADC pin mapping failed");
     }
     
--- a/targets/hal/TARGET_NXP/TARGET_LPC23XX/analogout_api.c	Fri Sep 13 14:22:58 2013 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC23XX/analogout_api.c	Mon Sep 16 16:15:04 2013 +0100
@@ -25,7 +25,7 @@
 
 void analogout_init(dac_t *obj, PinName pin) {
     obj->dac = (DACName)pinmap_peripheral(pin, PinMap_DAC);
-    if (obj->dac == (uint32_t)NC) {
+    if (obj->dac == (DACName)NC) {
         error("DAC pin mapping failed");
     }
     
--- a/targets/hal/TARGET_NXP/TARGET_LPC23XX/ethernet_api.c	Fri Sep 13 14:22:58 2013 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC23XX/ethernet_api.c	Mon Sep 16 16:15:04 2013 +0100
@@ -697,7 +697,7 @@
     if(receive_idx == -1) {
       receive_idx = LPC_EMAC->RxConsumeIndex;
     } else {
-        while(!(rxstat[receive_idx].Info & RINFO_LAST_FLAG) && (receive_idx != LPC_EMAC->RxProduceIndex)) {
+        while(!(rxstat[receive_idx].Info & RINFO_LAST_FLAG) && ((uint32_t)receive_idx != LPC_EMAC->RxProduceIndex)) {
             receive_idx  = rinc(receive_idx, NUM_RX_FRAG);
         }
         unsigned int info =   rxstat[receive_idx].Info;
@@ -713,7 +713,7 @@
         LPC_EMAC->RxConsumeIndex = receive_idx;
     }
     
-    if(receive_idx == LPC_EMAC->RxProduceIndex) {
+    if((uint32_t)receive_idx == LPC_EMAC->RxProduceIndex) {
         receive_idx = -1;
         return 0;
     }
@@ -762,7 +762,7 @@
     void        *pdst, *psrc;
     int          doff = 0;
     
-    if(receive_idx == LPC_EMAC->RxProduceIndex || receive_idx == -1) {
+    if((uint32_t)receive_idx == LPC_EMAC->RxProduceIndex || receive_idx == -1) {
         return 0;
     }
     
--- a/targets/hal/TARGET_NXP/TARGET_LPC23XX/pinmap.c	Fri Sep 13 14:22:58 2013 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC23XX/pinmap.c	Mon Sep 16 16:15:04 2013 +0100
@@ -17,7 +17,7 @@
 #include "error.h"
 
 void pin_function(PinName pin, int function) {
-    if (pin == (uint32_t)NC) return;
+    if (pin == (PinName)NC) return;
     
     uint32_t pin_number = (uint32_t)pin - (uint32_t)P0_0;
     int index = pin_number >> 4;
@@ -28,7 +28,7 @@
 }
 
 void pin_mode(PinName pin, PinMode mode) {
-    if (pin == (uint32_t)NC) { return; }
+    if (pin == (PinName)NC) { return; }
     
     uint32_t pin_number = (uint32_t)pin - (uint32_t)P0_0;
     int index = pin_number >> 5;
--- a/targets/hal/TARGET_NXP/TARGET_LPC23XX/pwmout_api.c	Fri Sep 13 14:22:58 2013 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC23XX/pwmout_api.c	Mon Sep 16 16:15:04 2013 +0100
@@ -57,7 +57,7 @@
 void pwmout_init(pwmout_t* obj, PinName pin) {
     // determine the channel
     PWMName pwm = (PWMName)pinmap_peripheral(pin, PinMap_PWM);
-    if (pwm == (uint32_t)NC)
+    if (pwm == (PWMName)NC)
         error("PwmOut pin mapping failed");
     
     obj->pwm = pwm;