mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Fri Jan 31 10:15:06 2014 +0000
Parent:
82:0b31dbcd4769
Child:
84:f54042cbc282
Commit message:
Synchronized with git revision 2665d5bac442dc1267d1bf5ff1eb6c90ccc7d0bf

Full URL: https://github.com/mbedmicro/mbed/commit/2665d5bac442dc1267d1bf5ff1eb6c90ccc7d0bf/

Added a new function (mbed_sdk_init) that can be used by the SDK itself to
do initializations before main() is called.

Changed in this revision

common/retarget.cpp Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/platform_init.c Show annotated file Show diff for this revision Revisions of this file
--- a/common/retarget.cpp	Fri Jan 31 10:00:06 2014 +0000
+++ b/common/retarget.cpp	Fri Jan 31 10:15:06 2014 +0000
@@ -398,15 +398,23 @@
 
 // ****************************************************************************
 // mbed_main is a function that is called before main()
+// mbed_sdk_init() is also a function that is called before main(), but unlike
+// mbed_main(), it is not meant for user code, but for the SDK itself to perform
+// initializations before main() is called.
 
 extern "C" WEAK void mbed_main(void);
 extern "C" WEAK void mbed_main(void) {
 }
 
+extern "C" WEAK void mbed_sdk_init(void);
+extern "C" WEAK void mbed_sdk_init(void) {
+}
+
 #if defined(TOOLCHAIN_ARM)
 extern "C" int $Super$$main(void);
 
 extern "C" int $Sub$$main(void) {
+    mbed_sdk_init();
     mbed_main();
     return $Super$$main();
 }
@@ -414,6 +422,7 @@
 extern "C" int __real_main(void);
 
 extern "C" int __wrap_main(void) {
+    mbed_sdk_init();
     mbed_main();
     return __real_main();
 }
@@ -424,6 +433,7 @@
 // code will call a function to setup argc and argv (__iar_argc_argv) if it is defined.
 // Since mbed doesn't use argc/argv, we use this function to call our mbed_main.
 extern "C" void __iar_argc_argv() {
+    mbed_sdk_init();
     mbed_main();
 }
 #endif
--- a/targets/hal/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/platform_init.c	Fri Jan 31 10:00:06 2014 +0000
+++ b/targets/hal/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/platform_init.c	Fri Jan 31 10:15:06 2014 +0000
@@ -3,7 +3,7 @@
 #include "wait_api.h"
 
  // called before main
-void mbed_main()
+void mbed_sdk_init()
 {
     gpio_t modemEn, modemRst, modemPwrOn, modemLvlOe, modemILvlOe, modemUsbDet;
     gpio_t gpsEn, gpsRst, led, modemRts;