Skip to content

Fix incorrect #ifdefs on DEVICE_FOO macros #8957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TESTS/mbed_hal/sleep/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion TESTS/mbed_hal/sleep/sleep_test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion TESTS/mbed_platform/stats_cpu/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#ifdef DEVICE_FLASH
#if DEVICE_FLASH

#include "FlashIAPBlockDevice.h"
#include "mbed_critical.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/AnalogIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_ANALOGIN) || defined(DOXYGEN_ONLY)
#if DEVICE_ANALOGIN || defined(DOXYGEN_ONLY)

#include "hal/analogin_api.h"
#include "platform/SingletonPtr.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/AnalogOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_ANALOGOUT) || defined(DOXYGEN_ONLY)
#if DEVICE_ANALOGOUT || defined(DOXYGEN_ONLY)

#include "hal/analogout_api.h"
#include "platform/PlatformMutex.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_CAN) || defined(DOXYGEN_ONLY)
#if DEVICE_CAN || defined(DOXYGEN_ONLY)

#include "hal/can_api.h"
#include "platform/Callback.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/Ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "platform/platform.h"
#include "platform/NonCopyable.h"

#if defined (DEVICE_ETHERNET) || defined(DOXYGEN_ONLY)
#if DEVICE_ETHERNET || defined(DOXYGEN_ONLY)

namespace mbed {
/** \addtogroup drivers */
Expand Down
2 changes: 1 addition & 1 deletion drivers/FlashIAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "platform/ScopedRomWriteLock.h"


#ifdef DEVICE_FLASH
#if DEVICE_FLASH

namespace mbed {

Expand Down
2 changes: 1 addition & 1 deletion drivers/FlashIAP.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef MBED_FLASHIAP_H
#define MBED_FLASHIAP_H

#if defined (DEVICE_FLASH) || defined(DOXYGEN_ONLY)
#if DEVICE_FLASH || defined(DOXYGEN_ONLY)

#include "flash_api.h"
#include "platform/SingletonPtr.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/I2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "platform/platform.h"
#include "hal/gpio_api.h"

#if defined (DEVICE_I2C) || defined(DOXYGEN_ONLY)
#if DEVICE_I2C || defined(DOXYGEN_ONLY)

#include "hal/i2c_api.h"
#include "platform/SingletonPtr.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/I2CSlave.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_I2CSLAVE) || defined(DOXYGEN_ONLY)
#if DEVICE_I2CSLAVE || defined(DOXYGEN_ONLY)

#include "hal/i2c_api.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/InterruptIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY)
#if DEVICE_INTERRUPTIN || defined(DOXYGEN_ONLY)

#include "hal/gpio_api.h"
#include "hal/gpio_irq_api.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/LowPowerTimeout.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_LPTICKER) || defined(DOXYGEN_ONLY)
#if DEVICE_LPTICKER || defined(DOXYGEN_ONLY)

#include "hal/lp_ticker_api.h"
#include "drivers/LowPowerTicker.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/LowPowerTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "drivers/Timer.h"
#include "platform/NonCopyable.h"

#if defined (DEVICE_LPTICKER) || defined(DOXYGEN_ONLY)
#if DEVICE_LPTICKER || defined(DOXYGEN_ONLY)

#include "hal/lp_ticker_api.h"

Expand Down
14 changes: 7 additions & 7 deletions drivers/MbedCRC.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class MbedCRC {

public:
enum CrcMode {
#ifdef DEVICE_CRC
#if DEVICE_CRC
HARDWARE = 0,
#endif
TABLE = 1,
Expand Down Expand Up @@ -198,7 +198,7 @@ class MbedCRC {
int32_t status = 0;

switch (_mode) {
#ifdef DEVICE_CRC
#if DEVICE_CRC
case HARDWARE:
hal_crc_compute_partial((uint8_t *)buffer, size);
*crc = 0;
Expand Down Expand Up @@ -232,7 +232,7 @@ class MbedCRC {
{
MBED_ASSERT(crc != NULL);

#ifdef DEVICE_CRC
#if DEVICE_CRC
if (_mode == HARDWARE) {
lock();
crc_mbed_config_t config;
Expand Down Expand Up @@ -264,7 +264,7 @@ class MbedCRC {
{
MBED_ASSERT(crc != NULL);

#ifdef DEVICE_CRC
#if DEVICE_CRC
if (_mode == HARDWARE) {
*crc = hal_crc_get_result();
unlock();
Expand Down Expand Up @@ -316,7 +316,7 @@ class MbedCRC {
*/
void lock()
{
#ifdef DEVICE_CRC
#if DEVICE_CRC
if (_mode == HARDWARE) {
mbed_crc_mutex->lock();
}
Expand All @@ -327,7 +327,7 @@ class MbedCRC {
*/
virtual void unlock()
{
#ifdef DEVICE_CRC
#if DEVICE_CRC
if (_mode == HARDWARE) {
mbed_crc_mutex->unlock();
}
Expand Down Expand Up @@ -503,7 +503,7 @@ class MbedCRC {
{
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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/PortIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_PORTIN) || defined(DOXYGEN_ONLY)
#if DEVICE_PORTIN || defined(DOXYGEN_ONLY)

#include "hal/port_api.h"
#include "platform/mbed_critical.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/PortInOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_PORTINOUT) || defined(DOXYGEN_ONLY)
#if DEVICE_PORTINOUT || defined(DOXYGEN_ONLY)

#include "hal/port_api.h"
#include "platform/mbed_critical.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/PortOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_PORTOUT) || defined(DOXYGEN_ONLY)
#if DEVICE_PORTOUT || defined(DOXYGEN_ONLY)

#include "hal/port_api.h"
#include "platform/mbed_critical.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/PwmOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_PWMOUT) || defined(DOXYGEN_ONLY)
#if DEVICE_PWMOUT || defined(DOXYGEN_ONLY)
#include "hal/pwmout_api.h"
#include "platform/mbed_critical.h"
#include "platform/mbed_power_mgmt.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/QSPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion drivers/RawSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_SERIAL) || defined(DOXYGEN_ONLY)
#if DEVICE_SERIAL || defined(DOXYGEN_ONLY)

#include "mbed_toolchain.h"
#include "drivers/SerialBase.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_SPI) || defined(DOXYGEN_ONLY)
#if DEVICE_SPI || defined(DOXYGEN_ONLY)

#include "platform/PlatformMutex.h"
#include "hal/spi_api.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/SPISlave.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "platform/platform.h"
#include "platform/NonCopyable.h"

#if defined (DEVICE_SPISLAVE) || defined(DOXYGEN_ONLY)
#if DEVICE_SPISLAVE || defined(DOXYGEN_ONLY)

#include "hal/spi_api.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/Serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_SERIAL) || defined(DOXYGEN_ONLY)
#if DEVICE_SERIAL || defined(DOXYGEN_ONLY)

#include "platform/Stream.h"
#include "SerialBase.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/SerialBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "platform/platform.h"

#if defined (DEVICE_SERIAL) || defined(DOXYGEN_ONLY)
#if DEVICE_SERIAL || defined(DOXYGEN_ONLY)

#include "platform/Callback.h"
#include "hal/serial_api.h"
Expand Down
2 changes: 1 addition & 1 deletion features/cryptocell/FEATURE_CRYPTOCELL310/trng.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

#if defined(DEVICE_TRNG)
#if DEVICE_TRNG

#include <string.h>
#include "trng_api.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion features/device_key/source/DeviceKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion features/device_key/source/DeviceKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion features/mbedtls/platform/inc/platform_mbed.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion features/mbedtls/platform/src/mbed_trng.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#if defined(DEVICE_TRNG)
#if DEVICE_TRNG

#include "hal/trng_api.h"

Expand Down
2 changes: 1 addition & 1 deletion features/storage/nvstore/source/nvstore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion features/unsupported/tests/utest/general/general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading