diff --git a/TESTS/mbed_hal/sleep/main.cpp b/TESTS/mbed_hal/sleep/main.cpp index bfcee25c5d..cf469f9731 100644 --- a/TESTS/mbed_hal/sleep/main.cpp +++ b/TESTS/mbed_hal/sleep/main.cpp @@ -95,7 +95,7 @@ void sleep_usticker_test() TEST_ASSERT_TRUE(sleep_manager_can_deep_sleep()); } -#ifdef DEVICE_LPTICKER +#if DEVICE_LPTICKER /* Test that wake-up time from sleep should be less than 10 ms and * low power ticker interrupt can wake-up target from sleep. */ diff --git a/TESTS/mbed_hal/sleep/sleep_test_utils.h b/TESTS/mbed_hal/sleep/sleep_test_utils.h index b5f16b7627..59724014af 100644 --- a/TESTS/mbed_hal/sleep/sleep_test_utils.h +++ b/TESTS/mbed_hal/sleep/sleep_test_utils.h @@ -105,7 +105,7 @@ void us_ticker_isr(const ticker_data_t *const ticker_data) us_ticker_clear_interrupt(); } -#ifdef DEVICE_LPTICKER +#if DEVICE_LPTICKER void lp_ticker_isr(const ticker_data_t *const ticker_data) { lp_ticker_clear_interrupt(); diff --git a/TESTS/mbed_platform/stats_cpu/main.cpp b/TESTS/mbed_platform/stats_cpu/main.cpp index 51915d92d6..f4c77526fd 100644 --- a/TESTS/mbed_platform/stats_cpu/main.cpp +++ b/TESTS/mbed_platform/stats_cpu/main.cpp @@ -21,7 +21,7 @@ #include "mbed.h" -#if !defined(MBED_CPU_STATS_ENABLED) || !defined(DEVICE_LPTICKER) || !defined(DEVICE_SLEEP) +#if !defined(MBED_CPU_STATS_ENABLED) || !DEVICE_LPTICKER || !DEVICE_SLEEP #error [NOT_SUPPORTED] test not supported #endif diff --git a/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp index 445ab7978c..7fd590fc2f 100644 --- a/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifdef DEVICE_FLASH +#if DEVICE_FLASH #include "FlashIAPBlockDevice.h" #include "mbed_critical.h" diff --git a/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.h b/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.h index 0b6e68125b..3e83bb0b3a 100644 --- a/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.h +++ b/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.h @@ -17,7 +17,7 @@ #ifndef MBED_FLASHIAP_BLOCK_DEVICE_H #define MBED_FLASHIAP_BLOCK_DEVICE_H -#ifdef DEVICE_FLASH +#if DEVICE_FLASH #include "FlashIAP.h" #include "BlockDevice.h" diff --git a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp index 7b666ebcc2..aaaa3233df 100644 --- a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp @@ -136,7 +136,7 @@ */ /* If the target has no SPI support then SDCard is not supported */ -#ifdef DEVICE_SPI +#if DEVICE_SPI #include "SDBlockDevice.h" #include "platform/mbed_debug.h" diff --git a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h index de166e67a4..790f550367 100644 --- a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h +++ b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h @@ -18,7 +18,7 @@ #define MBED_SD_BLOCK_DEVICE_H /* If the target has no SPI support then SDCard is not supported */ -#ifdef DEVICE_SPI +#if DEVICE_SPI #include "BlockDevice.h" #include "drivers/SPI.h" diff --git a/components/storage/blockdevice/COMPONENT_SD/TESTS/filesystem/fopen/fopen.cpp b/components/storage/blockdevice/COMPONENT_SD/TESTS/filesystem/fopen/fopen.cpp index b1d64d9a87..3916616ad6 100644 --- a/components/storage/blockdevice/COMPONENT_SD/TESTS/filesystem/fopen/fopen.cpp +++ b/components/storage/blockdevice/COMPONENT_SD/TESTS/filesystem/fopen/fopen.cpp @@ -68,7 +68,7 @@ using namespace utest::v1; * <<< lines removed >>> */ -#if defined(DEVICE_SPI) && ( defined(MBED_CONF_APP_FSFAT_SDCARD_INSTALLED) || (MBED_CONF_SD_FSFAT_SDCARD_INSTALLED)) +#if DEVICE_SPI && ( defined(MBED_CONF_APP_FSFAT_SDCARD_INSTALLED) || (MBED_CONF_SD_FSFAT_SDCARD_INSTALLED)) static char fsfat_fopen_utest_msg_g[FSFAT_UTEST_MSG_BUF_SIZE]; #define FSFAT_FOPEN_TEST_MOUNT_PT_NAME "sd" #define FSFAT_FOPEN_TEST_MOUNT_PT_PATH "/" FSFAT_FOPEN_TEST_MOUNT_PT_NAME diff --git a/drivers/FlashIAP.cpp b/drivers/FlashIAP.cpp index 8ef6f6e1b0..3f67093900 100644 --- a/drivers/FlashIAP.cpp +++ b/drivers/FlashIAP.cpp @@ -29,7 +29,7 @@ #include "platform/ScopedRomWriteLock.h" -#ifdef DEVICE_FLASH +#if DEVICE_FLASH namespace mbed { diff --git a/drivers/MbedCRC.h b/drivers/MbedCRC.h index f5ee20a9ec..9e99e9049f 100644 --- a/drivers/MbedCRC.h +++ b/drivers/MbedCRC.h @@ -101,7 +101,7 @@ class MbedCRC { public: enum CrcMode { -#ifdef DEVICE_CRC +#if DEVICE_CRC HARDWARE = 0, #endif TABLE = 1, @@ -198,7 +198,7 @@ public: int32_t status = 0; switch (_mode) { -#ifdef DEVICE_CRC +#if DEVICE_CRC case HARDWARE: hal_crc_compute_partial((uint8_t *)buffer, size); *crc = 0; @@ -232,7 +232,7 @@ public: { MBED_ASSERT(crc != NULL); -#ifdef DEVICE_CRC +#if DEVICE_CRC if (_mode == HARDWARE) { lock(); crc_mbed_config_t config; @@ -264,7 +264,7 @@ public: { MBED_ASSERT(crc != NULL); -#ifdef DEVICE_CRC +#if DEVICE_CRC if (_mode == HARDWARE) { *crc = hal_crc_get_result(); unlock(); @@ -316,7 +316,7 @@ private: */ void lock() { -#ifdef DEVICE_CRC +#if DEVICE_CRC if (_mode == HARDWARE) { mbed_crc_mutex->lock(); } @@ -327,7 +327,7 @@ private: */ virtual void unlock() { -#ifdef DEVICE_CRC +#if DEVICE_CRC if (_mode == HARDWARE) { mbed_crc_mutex->unlock(); } @@ -503,7 +503,7 @@ private: { MBED_STATIC_ASSERT(width <= 32, "Max 32-bit CRC supported"); -#ifdef DEVICE_CRC +#if DEVICE_CRC if (POLY_32BIT_REV_ANSI == polynomial) { _crc_table = (uint32_t *)Table_CRC_32bit_Rev_ANSI; _mode = TABLE; diff --git a/drivers/QSPI.h b/drivers/QSPI.h index afddf60b80..e247e8f651 100644 --- a/drivers/QSPI.h +++ b/drivers/QSPI.h @@ -19,7 +19,7 @@ #include "platform/platform.h" -#if defined (DEVICE_QSPI) || defined(DOXYGEN_ONLY) +#if DEVICE_QSPI || defined(DOXYGEN_ONLY) #include "hal/qspi_api.h" #include "platform/PlatformMutex.h" diff --git a/features/cryptocell/FEATURE_CRYPTOCELL310/trng.c b/features/cryptocell/FEATURE_CRYPTOCELL310/trng.c index 5c3431d2e3..4f1c3991ee 100644 --- a/features/cryptocell/FEATURE_CRYPTOCELL310/trng.c +++ b/features/cryptocell/FEATURE_CRYPTOCELL310/trng.c @@ -18,7 +18,7 @@ * */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include #include "trng_api.h" diff --git a/features/device_key/TESTS/device_key/functionality/main.cpp b/features/device_key/TESTS/device_key/functionality/main.cpp index a88145d032..7be7afabf8 100644 --- a/features/device_key/TESTS/device_key/functionality/main.cpp +++ b/features/device_key/TESTS/device_key/functionality/main.cpp @@ -51,7 +51,7 @@ void generate_derived_key_consistency_32_byte_key_long_consistency_test(char *ke */ int inject_dummy_rot_key() { -#if !defined(DEVICE_TRNG) +#if !DEVICE_TRNG uint32_t key[DEVICE_KEY_16BYTE / sizeof(uint32_t)]; memcpy(key, "1234567812345678", DEVICE_KEY_16BYTE); diff --git a/features/device_key/source/DeviceKey.cpp b/features/device_key/source/DeviceKey.cpp index a76db59afb..d2125c6805 100644 --- a/features/device_key/source/DeviceKey.cpp +++ b/features/device_key/source/DeviceKey.cpp @@ -259,7 +259,7 @@ int DeviceKey::generate_key_by_random(uint32_t *output, size_t size) return DEVICEKEY_INVALID_PARAM; } -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG mbedtls_entropy_context *entropy = new mbedtls_entropy_context; mbedtls_entropy_init(entropy); memset(output, 0, size); diff --git a/features/device_key/source/DeviceKey.h b/features/device_key/source/DeviceKey.h index 2b6d3950ea..6ca024127e 100644 --- a/features/device_key/source/DeviceKey.h +++ b/features/device_key/source/DeviceKey.h @@ -24,7 +24,7 @@ // Whole class is not supported if entropy is not enabled // Flash device is required as Device Key is currently depending on it -#if !defined(DEVICE_FLASH) || !defined(COMPONENT_FLASHIAP) +#if !DEVICE_FLASH || !defined(COMPONENT_FLASHIAP) #undef DEVICEKEY_ENABLED #define DEVICEKEY_ENABLED 0 #endif diff --git a/features/mbedtls/platform/inc/platform_mbed.h b/features/mbedtls/platform/inc/platform_mbed.h index 0da5014e97..9ccaf08ab0 100644 --- a/features/mbedtls/platform/inc/platform_mbed.h +++ b/features/mbedtls/platform/inc/platform_mbed.h @@ -17,7 +17,7 @@ * This file is part of mbed TLS (https://tls.mbed.org) */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #define MBEDTLS_ENTROPY_HARDWARE_ALT #endif diff --git a/features/mbedtls/platform/src/mbed_trng.c b/features/mbedtls/platform/src/mbed_trng.c index e5a1cbbe1f..d4dd771c01 100644 --- a/features/mbedtls/platform/src/mbed_trng.c +++ b/features/mbedtls/platform/src/mbed_trng.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include "hal/trng_api.h" diff --git a/features/storage/nvstore/source/nvstore.h b/features/storage/nvstore/source/nvstore.h index ad8ad15bc2..2890437a9e 100644 --- a/features/storage/nvstore/source/nvstore.h +++ b/features/storage/nvstore/source/nvstore.h @@ -18,7 +18,7 @@ #define MBED_NVSTORE_H // These addresses need to be configured according to board (in mbed_lib.json) -#ifndef DEVICE_FLASH +#if !DEVICE_FLASH #undef NVSTORE_ENABLED #define NVSTORE_ENABLED 0 #endif diff --git a/features/unsupported/tests/utest/general/general.cpp b/features/unsupported/tests/utest/general/general.cpp index b5b665290e..95ad463fd4 100644 --- a/features/unsupported/tests/utest/general/general.cpp +++ b/features/unsupported/tests/utest/general/general.cpp @@ -64,7 +64,7 @@ TEST(C_String_Format, Sprintf_Negative_Integers) STRCMP_EQUAL(buffer, "-32768 -3214 -999 -100 -1 0 -1 -4231 -999 -4123 -32760 -99999"); } -#ifdef DEVICE_SEMIHOST +#if DEVICE_SEMIHOST #include "mbed_semihost_api.h" TEST_GROUP(Device_Semihost) diff --git a/hal/crc_api.h b/hal/crc_api.h index 161f27b7eb..c2b20cc8c7 100644 --- a/hal/crc_api.h +++ b/hal/crc_api.h @@ -52,7 +52,7 @@ typedef struct crc_mbed_config { bool reflect_out; } crc_mbed_config_t; -#ifdef DEVICE_CRC +#if DEVICE_CRC #ifdef __cplusplus extern "C" { diff --git a/hal/itm_api.h b/hal/itm_api.h index 8da26212f5..897f6fa792 100644 --- a/hal/itm_api.h +++ b/hal/itm_api.h @@ -20,7 +20,7 @@ #ifndef MBED_ITM_API_H #define MBED_ITM_API_H -#if defined(DEVICE_ITM) +#if DEVICE_ITM #include #include diff --git a/hal/mbed_itm_api.c b/hal/mbed_itm_api.c index 0744bb19c8..46d7e3dcc0 100644 --- a/hal/mbed_itm_api.c +++ b/hal/mbed_itm_api.c @@ -15,7 +15,7 @@ * limitations under the License. */ -#if defined(DEVICE_ITM) +#if DEVICE_ITM #include "hal/itm_api.h" #include "cmsis.h" @@ -131,4 +131,4 @@ void mbed_itm_send_block(uint32_t port, const void *data, size_t len) } } } -#endif // defined(DEVICE_ITM) +#endif // DEVICE_ITM diff --git a/hal/mbed_sleep_manager.c b/hal/mbed_sleep_manager.c index 987e91bf2e..c512e44ef7 100644 --- a/hal/mbed_sleep_manager.c +++ b/hal/mbed_sleep_manager.c @@ -36,13 +36,13 @@ static uint16_t deep_sleep_lock = 0U; static us_timestamp_t sleep_time = 0; static us_timestamp_t deep_sleep_time = 0; -#if defined(MBED_CPU_STATS_ENABLED) && defined(DEVICE_LPTICKER) +#if defined(MBED_CPU_STATS_ENABLED) && DEVICE_LPTICKER static ticker_data_t *sleep_ticker = NULL; #endif static inline us_timestamp_t read_us(void) { -#if defined(MBED_CPU_STATS_ENABLED) && defined(DEVICE_LPTICKER) +#if defined(MBED_CPU_STATS_ENABLED) && DEVICE_LPTICKER if (NULL == sleep_ticker) { sleep_ticker = (ticker_data_t *)get_lp_ticker_data(); } diff --git a/platform/mbed_stats.c b/platform/mbed_stats.c index b4a3d3de32..ffc464c6de 100644 --- a/platform/mbed_stats.c +++ b/platform/mbed_stats.c @@ -13,7 +13,7 @@ #warning Statistics are currently not supported without the rtos. #endif -#if defined(MBED_CPU_STATS_ENABLED) && (!defined(DEVICE_LPTICKER) || !defined(DEVICE_SLEEP)) +#if defined(MBED_CPU_STATS_ENABLED) && (!DEVICE_LPTICKER || !DEVICE_SLEEP) #warning CPU statistics are not supported without low power timer support. #endif @@ -21,7 +21,7 @@ void mbed_stats_cpu_get(mbed_stats_cpu_t *stats) { MBED_ASSERT(stats != NULL); memset(stats, 0, sizeof(mbed_stats_cpu_t)); -#if defined(MBED_CPU_STATS_ENABLED) && defined(DEVICE_LPTICKER) && defined(DEVICE_SLEEP) +#if defined(MBED_CPU_STATS_ENABLED) && DEVICE_LPTICKER && DEVICE_SLEEP stats->uptime = mbed_uptime(); stats->idle_time = mbed_time_idle(); stats->sleep_time = mbed_time_sleep(); diff --git a/rtos/TARGET_CORTEX/SysTimer.h b/rtos/TARGET_CORTEX/SysTimer.h index dd6b30cf33..e4c008e317 100644 --- a/rtos/TARGET_CORTEX/SysTimer.h +++ b/rtos/TARGET_CORTEX/SysTimer.h @@ -22,7 +22,7 @@ #ifndef MBED_SYS_TIMER_H #define MBED_SYS_TIMER_H -#if defined(DEVICE_LPTICKER) || defined(DOXYGEN_ONLY) +#if DEVICE_LPTICKER || defined(DOXYGEN_ONLY) #include "platform/NonCopyable.h" #include "drivers/TimerEvent.h" diff --git a/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp b/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp index 9c095396d0..aaf23db94a 100644 --- a/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp +++ b/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp @@ -35,7 +35,7 @@ extern "C" { using namespace mbed; -#if (defined(MBED_TICKLESS) && defined(DEVICE_LPTICKER)) +#if (defined(MBED_TICKLESS) && DEVICE_LPTICKER) #include "rtos/TARGET_CORTEX/SysTimer.h" @@ -138,7 +138,7 @@ extern "C" { core_util_critical_section_exit(); } -#endif // (defined(MBED_TICKLESS) && defined(DEVICE_LPTICKER)) +#endif // (defined(MBED_TICKLESS) && DEVICE_LPTICKER) static void (*idle_hook_fptr)(void) = &default_idle_hook;