diff --git a/libraries/mbed/api/InterruptManager.h b/libraries/mbed/api/InterruptManager.h index 6f3fa49c5d..4959a64699 100644 --- a/libraries/mbed/api/InterruptManager.h +++ b/libraries/mbed/api/InterruptManager.h @@ -13,19 +13,19 @@ namespace mbed { * @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 @@ public: /** 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 diff --git a/libraries/mbed/common/InterruptManager.cpp b/libraries/mbed/common/InterruptManager.cpp index 7bf41d15b5..6fe31f6531 100644 --- a/libraries/mbed/common/InterruptManager.cpp +++ b/libraries/mbed/common/InterruptManager.cpp @@ -58,7 +58,7 @@ pFunctionPointer_t InterruptManager::add_common(void (*function)(void), IRQn_Typ 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)) diff --git a/libraries/mbed/common/board.c b/libraries/mbed/common/board.c index ab24b09ec0..a9e749b811 100644 --- a/libraries/mbed/common/board.c +++ b/libraries/mbed/common/board.c @@ -30,7 +30,7 @@ WEAK void mbed_die(void) { 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 @@ WEAK void mbed_die(void) { gpio_write(&led_3, 0); gpio_write(&led_4, 1); #endif - + wait_ms(150); #if (DEVICE_ERROR_RED == 1) @@ -53,7 +53,7 @@ WEAK void mbed_die(void) { gpio_write(&led_3, 1); gpio_write(&led_4, 0); #endif - + wait_ms(150); } } diff --git a/libraries/mbed/common/gpio.c b/libraries/mbed/common/gpio.c index b9dc4b9f9c..3839e8bb2d 100644 --- a/libraries/mbed/common/gpio.c +++ b/libraries/mbed/common/gpio.c @@ -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); diff --git a/libraries/mbed/common/mbed_interface.c b/libraries/mbed/common/mbed_interface.c index 01c734c661..0055843e55 100644 --- a/libraries/mbed/common/mbed_interface.c +++ b/libraries/mbed/common/mbed_interface.c @@ -88,7 +88,7 @@ WEAK void mbed_mac_address(char *mac) { #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; diff --git a/libraries/mbed/common/pinmap_common.c b/libraries/mbed/common/pinmap_common.c index eef617fd45..10b981e784 100644 --- a/libraries/mbed/common/pinmap_common.c +++ b/libraries/mbed/common/pinmap_common.c @@ -22,7 +22,7 @@ void pinmap_pinout(PinName pin, const PinMap *map) { while (map->pin != NC) { if (map->pin == pin) { pin_function(pin, map->function); - + pin_mode(pin, PullNone); return; } diff --git a/libraries/mbed/common/retarget.cpp b/libraries/mbed/common/retarget.cpp index 35a815916c..168d319a97 100644 --- a/libraries/mbed/common/retarget.cpp +++ b/libraries/mbed/common/retarget.cpp @@ -126,7 +126,7 @@ extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) { // 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 @@ extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) { 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 @@ extern "C" caddr_t _sbrk(int incr) { errno = ENOMEM; return (caddr_t)-1; } - + heap = new_heap; return (caddr_t) prev_heap; } diff --git a/libraries/mbed/common/rtc_time.c b/libraries/mbed/common/rtc_time.c index d0114e2f51..0405e9adc3 100644 --- a/libraries/mbed/common/rtc_time.c +++ b/libraries/mbed/common/rtc_time.c @@ -21,7 +21,7 @@ #ifdef __cplusplus extern "C" { -#endif +#endif #if defined (__ICCARM__) time_t __time32(time_t *timer) #else @@ -60,4 +60,4 @@ clock_t clock() { #ifdef __cplusplus } -#endif +#endif diff --git a/libraries/mbed/common/us_ticker_api.c b/libraries/mbed/common/us_ticker_api.c index 5b5d780636..434f705938 100644 --- a/libraries/mbed/common/us_ticker_api.c +++ b/libraries/mbed/common/us_ticker_api.c @@ -22,13 +22,13 @@ static ticker_event_t *head = NULL; 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 @@ void us_ticker_irq_handler(void) { 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_irq_handler(void) { 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 @@ void us_ticker_insert_event(ticker_event_t *obj, unsigned int timestamp, uint32_ } /* 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 @@ void us_ticker_remove_event(ticker_event_t *obj) { p = p->next; } } - + __enable_irq(); }