diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/analogout_api.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/analogout_api.c index 688aecd421..e5c780a31b 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/analogout_api.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/analogout_api.c @@ -25,7 +25,7 @@ #if DEVICE_ANALOGOUT #include "mbed_assert.h" -#include "error.h" +#include "mbed_error.h" #include "analogout_api.h" #include "pinmap.h" #include "pinmap_function.h" diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/device.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/device.h index 8114bdfef7..7dfd51e0b7 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/device.h +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/device.h @@ -23,6 +23,7 @@ #ifndef MBED_DEVICE_H #define MBED_DEVICE_H +#include "cmsis.h" #include "objects.h" #include "device_peripherals.h" diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/error.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/error.h deleted file mode 100644 index 2515ee4cbb..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/error.h +++ /dev/null @@ -1,74 +0,0 @@ -/***************************************************************************//** - * @file error.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#ifndef MBED_ERROR_H -#define MBED_ERROR_H - -/** To generate a fatal compile-time error, you can use the pre-processor #error directive. - * - * @code - * #error "That shouldn't have happened!" - * @endcode - * - * If the compiler evaluates this line, it will report the error and stop the compile. - * - * For example, you could use this to check some user-defined compile-time variables: - * - * @code - * #define NUM_PORTS 7 - * #if (NUM_PORTS > 4) - * #error "NUM_PORTS must be less than 4" - * #endif - * @endcode - * - * Reporting Run-Time Errors: - * To generate a fatal run-time error, you can use the mbed error() function. - * - * @code - * error("That shouldn't have happened!"); - * @endcode - * - * If the mbed running the program executes this function, it will print the - * message via the USB serial port, and then die with the blue lights of death! - * - * The message can use printf-style formatting, so you can report variables in the - * message too. For example, you could use this to check a run-time condition: - * - * @code - * if(x >= 5) { - * error("expected x to be less than 5, but got %d", x); - * } - * #endcode - */ - -#ifdef __cplusplus -extern "C" { -#endif - -void error(const char* format, ...); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/pinmap.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/pinmap.c index 4a9cfbb4ed..acc2f1a91b 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/pinmap.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/pinmap.c @@ -35,7 +35,7 @@ void pin_function(PinName pin, int function) void pin_mode(PinName pin, PinMode mode) { - MBED_ASSERT((0xFFFFFF00 |pin) != NC); + MBED_ASSERT(pin != NC); /* Enable GPIO clock if not already done */ if (!gpio_clock_inited) { diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/pinmap_function.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/pinmap_function.c index 512cc13e01..b70efa0eae 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/pinmap_function.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/pinmap_function.c @@ -23,7 +23,7 @@ #include "pinmap_function.h" #include "PinNames.h" -#include "error.h" +#include "mbed_error.h" /** * Get the value of the function field for a pin in a pinmap diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c index e3c713a09a..2bf2fb28f6 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c @@ -27,7 +27,6 @@ #include "mbed_assert.h" #include "pwmout_api.h" -#include "cmsis.h" #include "pinmap.h" #include "PeripheralPins.h" #include "device_peripherals.h" diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c index abf5ec45f2..12721ead25 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c @@ -26,7 +26,6 @@ #include "sleep_api.h" #include "sleepmodes.h" -#include "cmsis.h" #include "em_emu.h" #include "critical.h" diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c index 2b9c68ca0d..ad387d86ae 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c @@ -29,7 +29,7 @@ #include "PeripheralPins.h" #include "pinmap.h" #include "pinmap_function.h" -#include "error.h" +#include "mbed_error.h" #include "dma_api.h" #include "dma_api_HAL.h" diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/us_ticker.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/us_ticker.c index dd45950e80..33f055324d 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/us_ticker.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/us_ticker.c @@ -23,12 +23,10 @@ #include #include "us_ticker_api.h" -#include "cmsis.h" +#include "device.h" #include "mbed_assert.h" #include "em_cmu.h" #include "em_timer.h" -#include "device_peripherals.h" -#include "device.h" #include "clocking.h" #include "sleep_api.h" #include "sleepmodes.h"