From b9f8f2bc91e3635b36c3ca3922f5d7fdaaba1091 Mon Sep 17 00:00:00 2001 From: Aksel Skauge Mellbye Date: Mon, 16 Nov 2015 13:26:12 +0100 Subject: [PATCH 1/5] [EFM32] Declare spi_api.c helper functions as static. Fixes linker issue with gcc. --- .../targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c index 0355e89ba1..722dd9bdc3 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c @@ -50,7 +50,7 @@ static uint16_t fill_word = SPI_FILL_WORD; #define SPI_LEAST_ACTIVE_SLEEPMODE EM1 -inline CMU_Clock_TypeDef spi_get_clock_tree(spi_t *obj) +static inline CMU_Clock_TypeDef spi_get_clock_tree(spi_t *obj) { switch ((int)obj->spi.spi) { #ifdef USART0 @@ -71,7 +71,7 @@ inline CMU_Clock_TypeDef spi_get_clock_tree(spi_t *obj) } } -inline uint8_t spi_get_index(spi_t *obj) +static inline uint8_t spi_get_index(spi_t *obj) { uint8_t index = 0; switch ((int)obj->spi.spi) { From 4e217bacf976592b897942daf2a155fbc3c4317f Mon Sep 17 00:00:00 2001 From: Aksel Skauge Mellbye Date: Mon, 16 Nov 2015 13:26:44 +0100 Subject: [PATCH 2/5] [EFM32] Remove erroneous sleep() call from blocking spi_master_write. --- .../mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c index 722dd9bdc3..58a214bc13 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c @@ -359,7 +359,6 @@ int spi_master_write(spi_t *obj, int value) /* Wait for transmission of last byte */ while (!(obj->spi.spi->STATUS & USART_STATUS_TXC)) { - sleep(); // TODO_LP this might break other code, write should be separate from read? } return spi_read(obj); From c0253c1fa5fd54b54b9c937b573998e9c5312a98 Mon Sep 17 00:00:00 2001 From: Aksel Skauge Mellbye Date: Mon, 16 Nov 2015 13:27:35 +0100 Subject: [PATCH 3/5] [EFM32] Sleep: Remove EM4 entry, as there is no way of configuring EM4 wakeup in mbed. --- .../hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c index c1dd9941bf..f56d9257de 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c @@ -41,10 +41,7 @@ uint32_t sleep_block_counter[NUM_SLEEP_MODES] = {0}; /** * Sleep mode. - * Enter Energy Mode 1, which turns off the clock to the CPU. - * - * In EM1, the CPU is sleeping and the power consumption is only 50 μA/MHz. - * All peripherals, including DMA, PRS and memory system, are still available. + * Enter the lowest possible sleep mode that is not blocked by ongoing activity. */ void sleep(void) { @@ -57,13 +54,10 @@ void sleep(void) } else if (sleep_block_counter[2] > 0) { /* Blocked everything below EM2, enter EM2 */ EMU_EnterEM2(true); - } else if (sleep_block_counter[3] > 0) { + } else { /* Blocked everything below EM3, enter EM3 */ EMU_EnterEM3(true); - } else{ - /* Nothing is blocked, enter EM4 */ - EMU_EnterEM4(); - } + } /* Never enter EM4, as mbed has no way of configuring EM4 wakeup */ return; } From 13957043c7fa6ce51bfe13802e8ea41da29a1ef1 Mon Sep 17 00:00:00 2001 From: Aksel Skauge Mellbye Date: Mon, 16 Nov 2015 13:28:47 +0100 Subject: [PATCH 4/5] [EFM32] Fix serial_api bug selecting wrong peripheral for asynch IRQ handler. --- .../targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c index 55ac789ca3..cbc895781c 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c @@ -1693,14 +1693,14 @@ int serial_irq_handler_asynch(serial_t *obj) } }else{ if(obj->serial.periph.uart->IEN & USART_IEN_TXC){ - USART_IntDisable(obj->serial.periph.leuart,USART_IEN_TXC); + USART_IntDisable(obj->serial.periph.uart,USART_IEN_TXC); /* Clean up */ serial_dma_irq_fired[obj->serial.dmaOptionsTX.dmaChannel] = false; serial_tx_abort_asynch(obj); /* Notify CPP land of completion */ return SERIAL_EVENT_TX_COMPLETE & obj->serial.events; }else{ - USART_IntEnable(obj->serial.periph.leuart,USART_IEN_TXC); + USART_IntEnable(obj->serial.periph.uart,USART_IEN_TXC); } } } else { From d6ff1189e0df5346f65d0a32e2a24ccc9b7d8fd8 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Mon, 16 Nov 2015 13:24:46 -0600 Subject: [PATCH 5/5] Fixes issue where library is compiled multiple times during testing --- workspace_tools/test_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace_tools/test_api.py b/workspace_tools/test_api.py index f0ebb3bee0..9b10a66a55 100644 --- a/workspace_tools/test_api.py +++ b/workspace_tools/test_api.py @@ -395,7 +395,7 @@ class SingleTestRunner(object): # Detect which lib should be added to test # Some libs have to compiled like RTOS or ETH for lib in LIBRARIES: - if lib['build_dir'] in test.dependencies and lib['build_dir'] not in libraries: + if lib['build_dir'] in test.dependencies and lib['id'] not in libraries: libraries.append(lib['id'])