Skip to content

Commit ab1c2be

Browse files
authored
Merge pull request #8957 from InfernoEmbedded/fix-8913
Fix incorrect #ifdefs on DEVICE_FOO macros
2 parents 911720e + 2617c5d commit ab1c2be

File tree

45 files changed

+55
-55
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+55
-55
lines changed

TESTS/mbed_hal/sleep/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void sleep_usticker_test()
9595
TEST_ASSERT_TRUE(sleep_manager_can_deep_sleep());
9696
}
9797

98-
#ifdef DEVICE_LPTICKER
98+
#if DEVICE_LPTICKER
9999

100100
/* Test that wake-up time from sleep should be less than 10 ms and
101101
* low power ticker interrupt can wake-up target from sleep. */

TESTS/mbed_hal/sleep/sleep_test_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void us_ticker_isr(const ticker_data_t *const ticker_data)
105105
us_ticker_clear_interrupt();
106106
}
107107

108-
#ifdef DEVICE_LPTICKER
108+
#if DEVICE_LPTICKER
109109
void lp_ticker_isr(const ticker_data_t *const ticker_data)
110110
{
111111
lp_ticker_clear_interrupt();

TESTS/mbed_platform/stats_cpu/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include "mbed.h"
2323

24-
#if !defined(MBED_CPU_STATS_ENABLED) || !defined(DEVICE_LPTICKER) || !defined(DEVICE_SLEEP)
24+
#if !defined(MBED_CPU_STATS_ENABLED) || !DEVICE_LPTICKER || !DEVICE_SLEEP
2525
#error [NOT_SUPPORTED] test not supported
2626
#endif
2727

components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifdef DEVICE_FLASH
17+
#if DEVICE_FLASH
1818

1919
#include "FlashIAPBlockDevice.h"
2020
#include "mbed_critical.h"

components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef MBED_FLASHIAP_BLOCK_DEVICE_H
1818
#define MBED_FLASHIAP_BLOCK_DEVICE_H
1919

20-
#ifdef DEVICE_FLASH
20+
#if DEVICE_FLASH
2121

2222
#include "FlashIAP.h"
2323
#include "BlockDevice.h"

components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
*/
137137

138138
/* If the target has no SPI support then SDCard is not supported */
139-
#ifdef DEVICE_SPI
139+
#if DEVICE_SPI
140140

141141
#include "SDBlockDevice.h"
142142
#include "platform/mbed_debug.h"

components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define MBED_SD_BLOCK_DEVICE_H
1919

2020
/* If the target has no SPI support then SDCard is not supported */
21-
#ifdef DEVICE_SPI
21+
#if DEVICE_SPI
2222

2323
#include "BlockDevice.h"
2424
#include "drivers/SPI.h"

components/storage/blockdevice/COMPONENT_SD/TESTS/filesystem/fopen/fopen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ using namespace utest::v1;
6868
* <<< lines removed >>>
6969
*/
7070

71-
#if defined(DEVICE_SPI) && ( defined(MBED_CONF_APP_FSFAT_SDCARD_INSTALLED) || (MBED_CONF_SD_FSFAT_SDCARD_INSTALLED))
71+
#if DEVICE_SPI && ( defined(MBED_CONF_APP_FSFAT_SDCARD_INSTALLED) || (MBED_CONF_SD_FSFAT_SDCARD_INSTALLED))
7272
static char fsfat_fopen_utest_msg_g[FSFAT_UTEST_MSG_BUF_SIZE];
7373
#define FSFAT_FOPEN_TEST_MOUNT_PT_NAME "sd"
7474
#define FSFAT_FOPEN_TEST_MOUNT_PT_PATH "/" FSFAT_FOPEN_TEST_MOUNT_PT_NAME

drivers/AnalogIn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_ANALOGIN) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_ANALOGIN || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/analogin_api.h"
2525
#include "platform/SingletonPtr.h"

drivers/AnalogOut.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_ANALOGOUT) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_ANALOGOUT || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/analogout_api.h"
2525
#include "platform/PlatformMutex.h"

drivers/CAN.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_CAN) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_CAN || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/can_api.h"
2525
#include "platform/Callback.h"

drivers/Ethernet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "platform/platform.h"
2121
#include "platform/NonCopyable.h"
2222

23-
#if defined (DEVICE_ETHERNET) || defined(DOXYGEN_ONLY)
23+
#if DEVICE_ETHERNET || defined(DOXYGEN_ONLY)
2424

2525
namespace mbed {
2626
/** \addtogroup drivers */

drivers/FlashIAP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "platform/ScopedRomWriteLock.h"
3030

3131

32-
#ifdef DEVICE_FLASH
32+
#if DEVICE_FLASH
3333

3434
namespace mbed {
3535

drivers/FlashIAP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef MBED_FLASHIAP_H
2323
#define MBED_FLASHIAP_H
2424

25-
#if defined (DEVICE_FLASH) || defined(DOXYGEN_ONLY)
25+
#if DEVICE_FLASH || defined(DOXYGEN_ONLY)
2626

2727
#include "flash_api.h"
2828
#include "platform/SingletonPtr.h"

drivers/I2C.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "platform/platform.h"
2121
#include "hal/gpio_api.h"
2222

23-
#if defined (DEVICE_I2C) || defined(DOXYGEN_ONLY)
23+
#if DEVICE_I2C || defined(DOXYGEN_ONLY)
2424

2525
#include "hal/i2c_api.h"
2626
#include "platform/SingletonPtr.h"

drivers/I2CSlave.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_I2CSLAVE) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_I2CSLAVE || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/i2c_api.h"
2525

drivers/InterruptIn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_INTERRUPTIN || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/gpio_api.h"
2525
#include "hal/gpio_irq_api.h"

drivers/LowPowerTimeout.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_LPTICKER) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_LPTICKER || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/lp_ticker_api.h"
2525
#include "drivers/LowPowerTicker.h"

drivers/LowPowerTimer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "drivers/Timer.h"
2222
#include "platform/NonCopyable.h"
2323

24-
#if defined (DEVICE_LPTICKER) || defined(DOXYGEN_ONLY)
24+
#if DEVICE_LPTICKER || defined(DOXYGEN_ONLY)
2525

2626
#include "hal/lp_ticker_api.h"
2727

drivers/MbedCRC.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class MbedCRC {
101101

102102
public:
103103
enum CrcMode {
104-
#ifdef DEVICE_CRC
104+
#if DEVICE_CRC
105105
HARDWARE = 0,
106106
#endif
107107
TABLE = 1,
@@ -198,7 +198,7 @@ class MbedCRC {
198198
int32_t status = 0;
199199

200200
switch (_mode) {
201-
#ifdef DEVICE_CRC
201+
#if DEVICE_CRC
202202
case HARDWARE:
203203
hal_crc_compute_partial((uint8_t *)buffer, size);
204204
*crc = 0;
@@ -232,7 +232,7 @@ class MbedCRC {
232232
{
233233
MBED_ASSERT(crc != NULL);
234234

235-
#ifdef DEVICE_CRC
235+
#if DEVICE_CRC
236236
if (_mode == HARDWARE) {
237237
lock();
238238
crc_mbed_config_t config;
@@ -264,7 +264,7 @@ class MbedCRC {
264264
{
265265
MBED_ASSERT(crc != NULL);
266266

267-
#ifdef DEVICE_CRC
267+
#if DEVICE_CRC
268268
if (_mode == HARDWARE) {
269269
*crc = hal_crc_get_result();
270270
unlock();
@@ -316,7 +316,7 @@ class MbedCRC {
316316
*/
317317
void lock()
318318
{
319-
#ifdef DEVICE_CRC
319+
#if DEVICE_CRC
320320
if (_mode == HARDWARE) {
321321
mbed_crc_mutex->lock();
322322
}
@@ -327,7 +327,7 @@ class MbedCRC {
327327
*/
328328
virtual void unlock()
329329
{
330-
#ifdef DEVICE_CRC
330+
#if DEVICE_CRC
331331
if (_mode == HARDWARE) {
332332
mbed_crc_mutex->unlock();
333333
}
@@ -503,7 +503,7 @@ class MbedCRC {
503503
{
504504
MBED_STATIC_ASSERT(width <= 32, "Max 32-bit CRC supported");
505505

506-
#ifdef DEVICE_CRC
506+
#if DEVICE_CRC
507507
if (POLY_32BIT_REV_ANSI == polynomial) {
508508
_crc_table = (uint32_t *)Table_CRC_32bit_Rev_ANSI;
509509
_mode = TABLE;

drivers/PortIn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_PORTIN) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_PORTIN || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/port_api.h"
2525
#include "platform/mbed_critical.h"

drivers/PortInOut.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_PORTINOUT) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_PORTINOUT || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/port_api.h"
2525
#include "platform/mbed_critical.h"

drivers/PortOut.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_PORTOUT) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_PORTOUT || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/port_api.h"
2525
#include "platform/mbed_critical.h"

drivers/PwmOut.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_PWMOUT) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_PWMOUT || defined(DOXYGEN_ONLY)
2323
#include "hal/pwmout_api.h"
2424
#include "platform/mbed_critical.h"
2525
#include "platform/mbed_power_mgmt.h"

drivers/QSPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_QSPI) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_QSPI || defined(DOXYGEN_ONLY)
2323

2424
#include "hal/qspi_api.h"
2525
#include "platform/PlatformMutex.h"

drivers/RawSerial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_SERIAL) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_SERIAL || defined(DOXYGEN_ONLY)
2323

2424
#include "mbed_toolchain.h"
2525
#include "drivers/SerialBase.h"

drivers/SPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_SPI) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_SPI || defined(DOXYGEN_ONLY)
2323

2424
#include "platform/PlatformMutex.h"
2525
#include "hal/spi_api.h"

drivers/SPISlave.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "platform/platform.h"
2121
#include "platform/NonCopyable.h"
2222

23-
#if defined (DEVICE_SPISLAVE) || defined(DOXYGEN_ONLY)
23+
#if DEVICE_SPISLAVE || defined(DOXYGEN_ONLY)
2424

2525
#include "hal/spi_api.h"
2626

drivers/Serial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_SERIAL) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_SERIAL || defined(DOXYGEN_ONLY)
2323

2424
#include "platform/Stream.h"
2525
#include "SerialBase.h"

drivers/SerialBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "platform/platform.h"
2121

22-
#if defined (DEVICE_SERIAL) || defined(DOXYGEN_ONLY)
22+
#if DEVICE_SERIAL || defined(DOXYGEN_ONLY)
2323

2424
#include "platform/Callback.h"
2525
#include "hal/serial_api.h"

features/cryptocell/FEATURE_CRYPTOCELL310/trng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
*/
2020

21-
#if defined(DEVICE_TRNG)
21+
#if DEVICE_TRNG
2222

2323
#include <string.h>
2424
#include "trng_api.h"

features/device_key/TESTS/device_key/functionality/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void generate_derived_key_consistency_32_byte_key_long_consistency_test(char *ke
5151
*/
5252
int inject_dummy_rot_key()
5353
{
54-
#if !defined(DEVICE_TRNG)
54+
#if !DEVICE_TRNG
5555
uint32_t key[DEVICE_KEY_16BYTE / sizeof(uint32_t)];
5656

5757
memcpy(key, "1234567812345678", DEVICE_KEY_16BYTE);

features/device_key/source/DeviceKey.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ int DeviceKey::generate_key_by_random(uint32_t *output, size_t size)
259259
return DEVICEKEY_INVALID_PARAM;
260260
}
261261

262-
#if defined(DEVICE_TRNG)
262+
#if DEVICE_TRNG
263263
mbedtls_entropy_context *entropy = new mbedtls_entropy_context;
264264
mbedtls_entropy_init(entropy);
265265
memset(output, 0, size);

features/device_key/source/DeviceKey.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
// Whole class is not supported if entropy is not enabled
2626
// Flash device is required as Device Key is currently depending on it
27-
#if !defined(DEVICE_FLASH) || !defined(COMPONENT_FLASHIAP)
27+
#if !DEVICE_FLASH || !defined(COMPONENT_FLASHIAP)
2828
#undef DEVICEKEY_ENABLED
2929
#define DEVICEKEY_ENABLED 0
3030
#endif

features/mbedtls/platform/inc/platform_mbed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* This file is part of mbed TLS (https://tls.mbed.org)
1818
*/
1919

20-
#if defined(DEVICE_TRNG)
20+
#if DEVICE_TRNG
2121
#define MBEDTLS_ENTROPY_HARDWARE_ALT
2222
#endif
2323

features/mbedtls/platform/src/mbed_trng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#if defined(DEVICE_TRNG)
17+
#if DEVICE_TRNG
1818

1919
#include "hal/trng_api.h"
2020

features/storage/nvstore/source/nvstore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define MBED_NVSTORE_H
1919

2020
// These addresses need to be configured according to board (in mbed_lib.json)
21-
#ifndef DEVICE_FLASH
21+
#if !DEVICE_FLASH
2222
#undef NVSTORE_ENABLED
2323
#define NVSTORE_ENABLED 0
2424
#endif

features/unsupported/tests/utest/general/general.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ TEST(C_String_Format, Sprintf_Negative_Integers)
6464
STRCMP_EQUAL(buffer, "-32768 -3214 -999 -100 -1 0 -1 -4231 -999 -4123 -32760 -99999");
6565
}
6666

67-
#ifdef DEVICE_SEMIHOST
67+
#if DEVICE_SEMIHOST
6868
#include "mbed_semihost_api.h"
6969

7070
TEST_GROUP(Device_Semihost)

0 commit comments

Comments
 (0)