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.
Revision 221:8276e3a4886f, committed 2014-06-03
- Comitter:
- mbed_official
- Date:
- Tue Jun 03 11:30:07 2014 +0100
- Parent:
- 220:aa774fb95d17
- Child:
- 222:96162ccfbf43
- Commit message:
- Synchronized with git revision bcacbb9fbf3432829227430830cca4315b57c1b9
Full URL: https://github.com/mbedmicro/mbed/commit/bcacbb9fbf3432829227430830cca4315b57c1b9/
Changed in this revision
--- a/api/InterruptManager.h Tue Jun 03 10:30:56 2014 +0100 +++ b/api/InterruptManager.h Tue Jun 03 11:30:07 2014 +0100 @@ -13,19 +13,19 @@ * @code * #include "InterruptManager.h" * #include "mbed.h" - * + * * Ticker flipper; * DigitalOut led1(LED1); * DigitalOut led2(LED2); - * + * * void flip(void) { * led1 = !led1; * } - * + * * void handler(void) { * led2 = !led1; * } - * + * * int main() { * led1 = led2 = 0; * flipper.attach(&flip, 1.0); @@ -42,7 +42,7 @@ /** Destroy the current instance of the interrupt manager */ static void destroy(); - + /** Add a handler for an interrupt at the end of the handler list * * @param function the handler to add
--- a/common/InterruptManager.cpp Tue Jun 03 10:30:56 2014 +0100 +++ b/common/InterruptManager.cpp Tue Jun 03 11:30:07 2014 +0100 @@ -58,7 +58,7 @@ bool InterruptManager::remove_handler(pFunctionPointer_t handler, IRQn_Type irq) { int irq_pos = get_irq_index(irq); - + if (NULL == _chains[irq_pos]) return false; if (!_chains[irq_pos]->remove(handler))
--- a/common/board.c Tue Jun 03 10:30:56 2014 +0100 +++ b/common/board.c Tue Jun 03 11:30:07 2014 +0100 @@ -30,7 +30,7 @@ gpio_t led_3; gpio_init_out(&led_3, LED3); gpio_t led_4; gpio_init_out(&led_4, LED4); #endif - + while (1) { #if (DEVICE_ERROR_RED == 1) gpio_write(&led_red, 1); @@ -41,7 +41,7 @@ gpio_write(&led_3, 0); gpio_write(&led_4, 1); #endif - + wait_ms(150); #if (DEVICE_ERROR_RED == 1) @@ -53,7 +53,7 @@ gpio_write(&led_3, 1); gpio_write(&led_4, 0); #endif - + wait_ms(150); } }
--- a/common/gpio.c Tue Jun 03 10:30:56 2014 +0100 +++ b/common/gpio.c Tue Jun 03 11:30:07 2014 +0100 @@ -17,13 +17,13 @@ static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode) { - gpio_init(gpio, pin); - if (pin != NC) { + gpio_init(gpio, pin); + if (pin != NC) { gpio_dir(gpio, PIN_INPUT); gpio_mode(gpio, mode); } } - + static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int value) { gpio_init(gpio, pin);
--- a/common/mbed_interface.c Tue Jun 03 10:30:56 2014 +0100 +++ b/common/mbed_interface.c Tue Jun 03 11:30:07 2014 +0100 @@ -88,7 +88,7 @@ #if DEVICE_SEMIHOST char uid[DEVICE_ID_LENGTH + 1]; int i; - + // if we have a UID, extract the MAC if (mbed_interface_uid(uid) == 0) { char *p = uid;
--- a/common/pinmap_common.c Tue Jun 03 10:30:56 2014 +0100 +++ b/common/pinmap_common.c Tue Jun 03 11:30:07 2014 +0100 @@ -22,7 +22,7 @@ while (map->pin != NC) { if (map->pin == pin) { pin_function(pin, map->function); - + pin_mode(pin, PullNone); return; }
--- a/common/retarget.cpp Tue Jun 03 10:30:56 2014 +0100 +++ b/common/retarget.cpp Tue Jun 03 11:30:07 2014 +0100 @@ -126,7 +126,7 @@ // This is the workaround that the microlib author suggested us static int n = 0; if (!std::strcmp(name, ":tt")) return n++; - + #else /* Use the posix convention that stdin,out,err are filehandles 0,1,2. */ @@ -141,7 +141,7 @@ return 2; } #endif - + // find the first empty slot in filehandles unsigned int fh_i; for (fh_i = 0; fh_i < sizeof(filehandles)/sizeof(*filehandles); fh_i++) { @@ -466,7 +466,7 @@ errno = ENOMEM; return (caddr_t)-1; } - + heap = new_heap; return (caddr_t) prev_heap; }
--- a/common/rtc_time.c Tue Jun 03 10:30:56 2014 +0100 +++ b/common/rtc_time.c Tue Jun 03 11:30:07 2014 +0100 @@ -21,7 +21,7 @@ #ifdef __cplusplus extern "C" { -#endif +#endif #if defined (__ICCARM__) time_t __time32(time_t *timer) #else @@ -60,4 +60,4 @@ #ifdef __cplusplus } -#endif +#endif
--- a/common/us_ticker_api.c Tue Jun 03 10:30:56 2014 +0100 +++ b/common/us_ticker_api.c Tue Jun 03 11:30:07 2014 +0100 @@ -22,13 +22,13 @@ void us_ticker_set_handler(ticker_event_handler handler) { us_ticker_init(); - + event_handler = handler; } void us_ticker_irq_handler(void) { us_ticker_clear_interrupt(); - + /* Go through all the pending TimerEvents */ while (1) { if (head == NULL) { @@ -36,7 +36,7 @@ us_ticker_disable_interrupt(); return; } - + if ((int)(head->timestamp - us_ticker_read()) <= 0) { // This event was in the past: // point to the following one and execute its handler @@ -57,11 +57,11 @@ void us_ticker_insert_event(ticker_event_t *obj, unsigned int timestamp, uint32_t id) { /* disable interrupts for the duration of the function */ __disable_irq(); - + // initialise our data obj->timestamp = timestamp; obj->id = id; - + /* Go through the list until we either reach the end, or find an element this should come before (which is possibly the head). */ @@ -84,13 +84,13 @@ } /* if we're at the end p will be NULL, which is correct */ obj->next = p; - + __enable_irq(); } void us_ticker_remove_event(ticker_event_t *obj) { __disable_irq(); - + // remove this object from the list if (head == obj) { // first in the list, so just drop me @@ -109,6 +109,6 @@ p = p->next; } } - + __enable_irq(); }