diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/flash_api.c b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/flash_api.c index 95d291010e..e81d76a702 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/flash_api.c +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/flash_api.c @@ -38,7 +38,7 @@ * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -#ifdef DEVICE_FLASH +#if DEVICE_FLASH #include "flash_api.h" #include "flash_data.h" #include "mbed_critical.h" diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/gpio_irq_api.c b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/gpio_irq_api.c index 5fc3b59e2d..242e6fabdd 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/gpio_irq_api.c +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/gpio_irq_api.c @@ -43,7 +43,7 @@ #include "adi_gpio_def.h" #include "ADuCM302x_device.h" -#ifdef DEVICE_INTERRUPTIN +#if DEVICE_INTERRUPTIN #define MAX_GPIO_LINES 16 #define MAX_GPIO_PORTS ADI_GPIO_NUM_PORTS @@ -327,4 +327,4 @@ void gpio_irq_disable(gpio_irq_t *obj) channel_ids[port][pin_num].int_enable = 0; } -#endif // #ifdef DEVICE_INTERRUPTIN +#endif // #if DEVICE_INTERRUPTIN diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/sleep.c b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/sleep.c index daf5e06738..482bf0e98f 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/sleep.c +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/sleep.c @@ -40,7 +40,7 @@ #include "sleep_api.h" -#ifdef DEVICE_SLEEP +#if DEVICE_SLEEP #include "adi_pwr.h" #include "adi_pwr_def.h" @@ -218,4 +218,4 @@ void hal_deepsleep(void) pADI_CLKG0_CLK->CTL5 = 0; } -#endif // #ifdef DEVICE_SLEEP +#endif // #if DEVICE_SLEEP diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/trng_api.c b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/trng_api.c index a7c512ab63..4c06c43727 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/trng_api.c +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/trng_api.c @@ -38,7 +38,7 @@ * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include #include diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/flash_api.c b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/flash_api.c index c29cdb8255..5f9cfa52bb 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/flash_api.c +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/flash_api.c @@ -38,7 +38,7 @@ * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -#ifdef DEVICE_FLASH +#if DEVICE_FLASH #include "flash_api.h" #include "flash_data.h" #include "mbed_critical.h" diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/gpio_irq_api.c b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/gpio_irq_api.c index 93d637d28b..9fea1bb713 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/gpio_irq_api.c +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/gpio_irq_api.c @@ -42,7 +42,7 @@ #include "adi_gpio.h" #include "adi_gpio_def.h" -#ifdef DEVICE_INTERRUPTIN +#if DEVICE_INTERRUPTIN #define MAX_GPIO_LINES 16 #define MAX_GPIO_PORTS ADI_GPIO_NUM_PORTS @@ -326,4 +326,4 @@ void gpio_irq_disable(gpio_irq_t *obj) channel_ids[port][pin_num].int_enable = 0; } -#endif // #ifdef DEVICE_INTERRUPTIN +#endif // #if DEVICE_INTERRUPTIN diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/sleep.c b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/sleep.c index b6ea83f1ed..1be0aa0487 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/sleep.c +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/sleep.c @@ -40,7 +40,7 @@ #include "sleep_api.h" -#ifdef DEVICE_SLEEP +#if DEVICE_SLEEP #include "adi_pwr.h" #include "adi_pwr_def.h" @@ -253,4 +253,4 @@ void hal_deepsleep(void) pADI_CLKG0_CLK->CTL5 = 0; } -#endif // #ifdef DEVICE_SLEEP +#endif // #if DEVICE_SLEEP diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/trng_api.c b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/trng_api.c index cfab85645d..a272b9adcc 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/trng_api.c +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/trng_api.c @@ -38,7 +38,7 @@ * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include #include diff --git a/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/serial_api.c b/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/serial_api.c index 2ca86a6b63..34d34d5ef7 100644 --- a/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/serial_api.c +++ b/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/serial_api.c @@ -503,7 +503,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b enable_usart(obj); } -#ifdef DEVICE_SERIAL_FC +#if DEVICE_SERIAL_FC void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow) { diff --git a/targets/TARGET_Atmel/TARGET_SAM_CortexM4/serial_api.c b/targets/TARGET_Atmel/TARGET_SAM_CortexM4/serial_api.c index 9c08f58210..386559df17 100644 --- a/targets/TARGET_Atmel/TARGET_SAM_CortexM4/serial_api.c +++ b/targets/TARGET_Atmel/TARGET_SAM_CortexM4/serial_api.c @@ -283,7 +283,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b sysclk_enable_peripheral_clock(clockid); } -#ifdef DEVICE_SERIAL_FC +#if DEVICE_SERIAL_FC void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow) { @@ -783,4 +783,4 @@ void serial_rx_abort_asynch(serial_t *obj) pSERIAL_S(obj)->actrec = false; } -#endif \ No newline at end of file +#endif diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/PeripheralPins.h b/targets/TARGET_Cypress/TARGET_PSOC6/PeripheralPins.h index 07237af517..da01a569ea 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/PeripheralPins.h +++ b/targets/TARGET_Cypress/TARGET_PSOC6/PeripheralPins.h @@ -34,7 +34,7 @@ extern const PinMap PinMap_PWM_OUT[]; #endif //*** SERIAL *** -#ifdef DEVICE_SERIAL +#if DEVICE_SERIAL extern const PinMap PinMap_UART_TX[]; extern const PinMap PinMap_UART_RX[]; extern const PinMap PinMap_UART_RTS[]; @@ -42,7 +42,7 @@ extern const PinMap PinMap_UART_CTS[]; #endif //*** SPI *** -#ifdef DEVICE_SPI +#if DEVICE_SPI extern const PinMap PinMap_SPI_MOSI[]; extern const PinMap PinMap_SPI_MISO[]; extern const PinMap PinMap_SPI_SCLK[]; @@ -50,12 +50,12 @@ extern const PinMap PinMap_SPI_SSEL[]; #endif //*** ADC *** -#ifdef DEVICE_ANALOGIN +#if DEVICE_ANALOGIN extern const PinMap PinMap_ADC[]; #endif //*** DAC *** -#ifdef DEVICE_ANALOGOUT +#if DEVICE_ANALOGOUT extern const PinMap PinMap_DAC[]; #endif diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/objects.h b/targets/TARGET_Cypress/TARGET_PSOC6/objects.h index 8f98bebdb9..0ba07af1f7 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/objects.h +++ b/targets/TARGET_Cypress/TARGET_PSOC6/objects.h @@ -185,7 +185,7 @@ struct pwmout_s { }; #endif // DEVICE_PWMOUT -#ifdef DEVICE_ANALOGIN +#if DEVICE_ANALOGIN #include "cy_sar.h" struct analogin_s { @@ -196,7 +196,7 @@ struct analogin_s { }; #endif // DEVICE_ANALOGIN -#ifdef DEVICE_ANALOGOUT +#if DEVICE_ANALOGOUT #include "cy_ctdac.h" struct dac_s { @@ -206,7 +206,7 @@ struct dac_s { }; #endif // DEVICE_ANALOGOUT -#ifdef DEVICE_FLASH +#if DEVICE_FLASH struct flash_s { /* nothing to be stored for now */ void *dummy; diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/sleep_api.c b/targets/TARGET_Cypress/TARGET_PSOC6/sleep_api.c index e276d75ddb..f9f3f5e30c 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/sleep_api.c +++ b/targets/TARGET_Cypress/TARGET_PSOC6/sleep_api.c @@ -19,7 +19,7 @@ #include "device.h" #include "cy_syspm.h" -#ifdef DEVICE_SLEEP +#if DEVICE_SLEEP void hal_sleep(void) { diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/trng_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/trng_api.c index cd75aab832..acb7d00475 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/trng_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/trng_api.c @@ -22,7 +22,7 @@ * Reference: "K66 Sub-Family Reference Manual, Rev. 2", chapter 38 */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include #include "cmsis.h" diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW24D/trng_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW24D/trng_api.c index 71081979b1..432c6f02a7 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW24D/trng_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW24D/trng_api.c @@ -18,7 +18,7 @@ * */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include #include "cmsis.h" diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/trng_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/trng_api.c index 305f0cbc6c..e0a39a6bdb 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/trng_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/trng_api.c @@ -22,7 +22,7 @@ * Reference: "MKW41Z/31Z/21Z Reference Manual", chapter 43 */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include "fsl_trng.h" #include "trng_api.h" diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K22F/trng_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K22F/trng_api.c index 500ae00570..26297f7339 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K22F/trng_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K22F/trng_api.c @@ -18,7 +18,7 @@ * */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include #include "cmsis.h" diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/trng_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/trng_api.c index 745690d5cb..2c7807c8a5 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/trng_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/trng_api.c @@ -18,7 +18,7 @@ * */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include #include "cmsis.h" diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/mbed_crc_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/mbed_crc_api.c index 83b718c943..d61f0b1d05 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/mbed_crc_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/mbed_crc_api.c @@ -18,7 +18,7 @@ #include "drivers/fsl_crc.h" #include "platform/mbed_assert.h" -#ifdef DEVICE_CRC +#if DEVICE_CRC static crc_bits_t width; static uint32_t final_xor; diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/trng_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/trng_api.c index d1326d8d5a..a361fd3836 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/trng_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/trng_api.c @@ -22,7 +22,7 @@ * Reference: "K64 Sub-Family Reference Manual, Rev. 2", chapter 34 */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include #include "cmsis.h" diff --git a/targets/TARGET_GigaDevice/TARGET_GD32F30X/PeripheralPins.h b/targets/TARGET_GigaDevice/TARGET_GD32F30X/PeripheralPins.h index 14fe0e8621..f1a37901e7 100644 --- a/targets/TARGET_GigaDevice/TARGET_GD32F30X/PeripheralPins.h +++ b/targets/TARGET_GigaDevice/TARGET_GD32F30X/PeripheralPins.h @@ -27,12 +27,12 @@ extern const int GD_GPIO_MODE[]; extern const int GD_GPIO_SPEED[]; /* ADC */ -#ifdef DEVICE_ANALOGIN +#if DEVICE_ANALOGIN extern const PinMap PinMap_ADC[]; #endif /* DAC */ -#ifdef DEVICE_ANALOGOUT +#if DEVICE_ANALOGOUT extern const PinMap PinMap_DAC[]; #endif @@ -48,17 +48,17 @@ extern const PinMap PinMap_PWM[]; #endif /* SERIAL */ -#ifdef DEVICE_SERIAL +#if DEVICE_SERIAL extern const PinMap PinMap_UART_TX[]; extern const PinMap PinMap_UART_RX[]; -#ifdef DEVICE_SERIAL_FC +#if DEVICE_SERIAL_FC extern const PinMap PinMap_UART_RTS[]; extern const PinMap PinMap_UART_CTS[]; #endif #endif /* SPI */ -#ifdef DEVICE_SPI +#if DEVICE_SPI extern const PinMap PinMap_SPI_MOSI[]; extern const PinMap PinMap_SPI_MISO[]; extern const PinMap PinMap_SPI_SCLK[]; @@ -66,7 +66,7 @@ extern const PinMap PinMap_SPI_SSEL[]; #endif /* CAN */ -#ifdef DEVICE_CAN +#if DEVICE_CAN extern const PinMap PinMap_CAN_RD[]; extern const PinMap PinMap_CAN_TD[]; #endif diff --git a/targets/TARGET_Maxim/TARGET_MAX32600/rtc_api.c b/targets/TARGET_Maxim/TARGET_MAX32600/rtc_api.c index ad0d4b85dc..b0499578c2 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32600/rtc_api.c +++ b/targets/TARGET_Maxim/TARGET_MAX32600/rtc_api.c @@ -74,7 +74,7 @@ void rtc_init(void) MXC_PWRSEQ->reg0 |= MXC_F_PWRSEQ_REG0_PWR_RTCEN_RUN; // Prepare interrupt handlers -#ifdef DEVICE_LPTICKER +#if DEVICE_LPTICKER NVIC_SetVector(RTC0_IRQn, (uint32_t)lp_ticker_irq_handler); NVIC_EnableIRQ(RTC0_IRQn); #endif diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/TARGET_MCU_NRF51822_UNIFIED/analogin_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/TARGET_MCU_NRF51822_UNIFIED/analogin_api.c index 5788ec0479..e9e2d2a2b0 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/TARGET_MCU_NRF51822_UNIFIED/analogin_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/TARGET_MCU_NRF51822_UNIFIED/analogin_api.c @@ -19,7 +19,7 @@ #include "pinmap.h" #include "nrf_drv_adc.h" -#ifdef DEVICE_ANALOGIN +#if DEVICE_ANALOGIN #define ADC_10BIT_RANGE 0x3FF diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/flash_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/flash_api.c index ab1c28d8b7..0d9cfff2c4 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/flash_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/flash_api.c @@ -36,7 +36,7 @@ * */ -#if (defined(DEVICE_FLASH) && defined(DEVICE_LPTICKER)) +#if DEVICE_FLASH && DEVICE_LPTICKER #include "hal/flash_api.h" #include "hal/lp_ticker_api.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/i2c_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/i2c_api.c index cc5f9c962f..af9c64816d 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/i2c_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/i2c_api.c @@ -39,7 +39,7 @@ #include "i2c_api.h" -#if (defined(DEVICE_I2C) && defined(DEVICE_LPTICKER)) +#if DEVICE_I2C && DEVICE_LPTICKER #include "mbed_assert.h" #include "mbed_error.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/trng_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/trng_api.c index bf6df6421d..f003bc7d88 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/trng_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/trng_api.c @@ -36,7 +36,7 @@ * */ -#if (defined(DEVICE_TRNG) && defined(DEVICE_LPTICKER)) +#if DEVICE_TRNG && DEVICE_LPTICKER #include "hal/trng_api.h" #include "hal/lp_ticker_api.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/system_nrf52.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/system_nrf52.c index edb28370ec..e88f8ac626 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/system_nrf52.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/system_nrf52.c @@ -222,7 +222,7 @@ void SystemInit(void) * * The ITM has to be initialized before the SoftDevice which weren't guaranteed using the normal API. */ -#if defined (DEVICE_ITM) +#if DEVICE_ITM /* Enable SWO trace functionality */ CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; NRF_CLOCK->TRACECONFIG |= CLOCK_TRACECONFIG_TRACEMUX_Serial << CLOCK_TRACECONFIG_TRACEMUX_Pos; diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/system_nrf52840.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/system_nrf52840.c index 242cee7da5..27f1827177 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/system_nrf52840.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/system_nrf52840.c @@ -198,7 +198,7 @@ void SystemInit(void) * * The ITM has to be initialized before the SoftDevice which weren't guaranteed using the normal API. */ -#if defined (DEVICE_ITM) +#if DEVICE_ITM /* Enable SWO trace functionality */ CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; NRF_CLOCK->TRACECONFIG |= CLOCK_TRACECONFIG_TRACEMUX_Serial << CLOCK_TRACECONFIG_TRACEMUX_Pos; diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c index 4d2d8aba0e..5fc8fcf85f 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifdef DEVICE_ANALOGIN +#if DEVICE_ANALOGIN #include "hal/analogin_api.h" #include "pinmap.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/flash_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/flash_api.c index c5fce46be8..162a5aca86 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/flash_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/flash_api.c @@ -36,7 +36,7 @@ * */ -#if (defined(DEVICE_FLASH) && defined(DEVICE_LPTICKER)) +#if DEVICE_FLASH && DEVICE_LPTICKER #include "hal/flash_api.h" #include "hal/lp_ticker_api.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/i2c_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/i2c_api.c index 388059c62e..74253143de 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/i2c_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/i2c_api.c @@ -36,7 +36,7 @@ * */ -#if (defined(DEVICE_I2C) && defined(DEVICE_LPTICKER)) +#if DEVICE_I2C && DEVICE_LPTICKER /* I2C * * This HAL implementation uses the nrf_drv_twi.h API primarily but switches to TWI for the diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/itm_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/itm_api.c index ff390a3cf0..4e3437a6be 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/itm_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/itm_api.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#if defined(DEVICE_ITM) +#if DEVICE_ITM #include "hal/itm_api.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/trng_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/trng_api.c index 26aade19e7..d591022360 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/trng_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/trng_api.c @@ -36,7 +36,7 @@ * */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #if !defined(FEATURE_CRYPTOCELL310) #include "hal/trng_api.h" #include "hal/critical_section_api.h" diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/objects.h b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/objects.h index 7b99dd2f31..e78d3dfa77 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/objects.h +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/objects.h @@ -59,13 +59,13 @@ struct spi_s { uint8_t bits; }; -#if defined(DEVICE_FLASH) +#if DEVICE_FLASH struct flash_s { uint8_t dummy; }; #endif -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG struct trng_s { uint8_t dummy; }; diff --git a/targets/TARGET_ONSEMI/TARGET_NCS36510/exceptions.c b/targets/TARGET_ONSEMI/TARGET_NCS36510/exceptions.c index b125ecb42c..cf33119d9b 100644 --- a/targets/TARGET_ONSEMI/TARGET_NCS36510/exceptions.c +++ b/targets/TARGET_ONSEMI/TARGET_NCS36510/exceptions.c @@ -117,7 +117,7 @@ void fIrqUart2Handler(void) Uart2_Irq(); } -#ifdef DEVICE_RTC +#if DEVICE_RTC /** Call the RTC IRQ handler */ void fIrqRtcHandler(void) { diff --git a/targets/TARGET_ONSEMI/TARGET_NCS36510/rtc.c b/targets/TARGET_ONSEMI/TARGET_NCS36510/rtc.c index e174828949..5401693035 100644 --- a/targets/TARGET_ONSEMI/TARGET_NCS36510/rtc.c +++ b/targets/TARGET_ONSEMI/TARGET_NCS36510/rtc.c @@ -42,7 +42,7 @@ * */ -#ifdef DEVICE_RTC +#if DEVICE_RTC #include "rtc.h" #include "mbed_assert.h" diff --git a/targets/TARGET_RDA/TARGET_UNO_91H/trng_api.c b/targets/TARGET_RDA/TARGET_UNO_91H/trng_api.c index 66b939ec28..d81f650897 100644 --- a/targets/TARGET_RDA/TARGET_UNO_91H/trng_api.c +++ b/targets/TARGET_RDA/TARGET_UNO_91H/trng_api.c @@ -18,7 +18,7 @@ * */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include "cmsis.h" #include "trng_api.h" diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/trng_api_esp32.cpp b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/trng_api_esp32.cpp index 07d9e86376..c2fd9c6ca1 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/trng_api_esp32.cpp +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/trng_api_esp32.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include "drivers/I2C.h" #include "platform/mbed_wait_api.h" diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/trng_api.c b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/trng_api.c index de4cbd3571..ea2980e8dd 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/trng_api.c +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/trng_api.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include "trng_api.h" #if defined(TARGET_GR_LYCHEE) diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_MCU_RTL8195A/trng_api.c b/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_MCU_RTL8195A/trng_api.c index c708c2318b..39e82a47ff 100644 --- a/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_MCU_RTL8195A/trng_api.c +++ b/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_MCU_RTL8195A/trng_api.c @@ -21,7 +21,7 @@ #include "platform_stdlib.h" #endif -#ifdef DEVICE_TRNG +#if DEVICE_TRNG void trng_init(trng_t *obj) diff --git a/targets/TARGET_STM/PeripheralPins.h b/targets/TARGET_STM/PeripheralPins.h index d1d5f2ea84..b34df1236c 100644 --- a/targets/TARGET_STM/PeripheralPins.h +++ b/targets/TARGET_STM/PeripheralPins.h @@ -35,13 +35,13 @@ #include "PeripheralNames.h" //*** ADC *** -#ifdef DEVICE_ANALOGIN +#if DEVICE_ANALOGIN extern const PinMap PinMap_ADC[]; extern const PinMap PinMap_ADC_Internal[]; #endif //*** DAC *** -#ifdef DEVICE_ANALOGOUT +#if DEVICE_ANALOGOUT extern const PinMap PinMap_DAC[]; #endif @@ -57,17 +57,17 @@ extern const PinMap PinMap_PWM[]; #endif //*** SERIAL *** -#ifdef DEVICE_SERIAL +#if DEVICE_SERIAL extern const PinMap PinMap_UART_TX[]; extern const PinMap PinMap_UART_RX[]; -#ifdef DEVICE_SERIAL_FC +#if DEVICE_SERIAL_FC extern const PinMap PinMap_UART_RTS[]; extern const PinMap PinMap_UART_CTS[]; #endif #endif //*** SPI *** -#ifdef DEVICE_SPI +#if DEVICE_SPI extern const PinMap PinMap_SPI_MOSI[]; extern const PinMap PinMap_SPI_MISO[]; extern const PinMap PinMap_SPI_SCLK[]; @@ -75,12 +75,12 @@ extern const PinMap PinMap_SPI_SSEL[]; #endif //*** CAN *** -#ifdef DEVICE_CAN +#if DEVICE_CAN extern const PinMap PinMap_CAN_RD[]; extern const PinMap PinMap_CAN_TD[]; #endif -#ifdef DEVICE_QSPI +#if DEVICE_QSPI extern const PinMap PinMap_QSPI_DATA[]; extern const PinMap PinMap_QSPI_SCLK[]; extern const PinMap PinMap_QSPI_SSEL[]; diff --git a/targets/TARGET_STM/TARGET_STM32F0/can_device.h b/targets/TARGET_STM/TARGET_STM32F0/can_device.h index c1fa6fab6a..b65da93c33 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F0/can_device.h @@ -23,7 +23,7 @@ extern "C" { #endif -#ifdef DEVICE_CAN +#if DEVICE_CAN #define CAN_NUM 1 // Number of CAN peripherals present in the STM32 serie diff --git a/targets/TARGET_STM/TARGET_STM32F0/common_objects.h b/targets/TARGET_STM/TARGET_STM32F0/common_objects.h index 89b076ef07..1491acc4a8 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/common_objects.h +++ b/targets/TARGET_STM/TARGET_STM32F0/common_objects.h @@ -57,7 +57,7 @@ struct spi_s { PinName pin_mosi; PinName pin_sclk; PinName pin_ssel; -#ifdef DEVICE_SPI_ASYNCH +#if DEVICE_SPI_ASYNCH uint32_t event; uint8_t transfer_type; #endif diff --git a/targets/TARGET_STM/TARGET_STM32F0/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F0/i2c_device.h index 5c3ce009ef..b5891b8fba 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F0/i2c_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_I2C +#if DEVICE_I2C #if defined I2C1_BASE #define I2C1_EV_IRQn I2C1_IRQn diff --git a/targets/TARGET_STM/TARGET_STM32F0/pwmout_device.c b/targets/TARGET_STM/TARGET_STM32F0/pwmout_device.c index 9837b7be3d..45a7ddbdb4 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/pwmout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F0/pwmout_device.c @@ -31,7 +31,7 @@ #include "pwmout_api.h" #include "pwmout_device.h" -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT const pwm_apb_map_t pwm_apb_map_table[] = { #if defined(TIM2_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32F0/pwmout_device.h b/targets/TARGET_STM/TARGET_STM32F0/pwmout_device.h index 91837e6347..702285b81d 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/pwmout_device.h +++ b/targets/TARGET_STM/TARGET_STM32F0/pwmout_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT typedef enum { PWMOUT_ON_APB1 = 0, diff --git a/targets/TARGET_STM/TARGET_STM32F1/can_device.h b/targets/TARGET_STM/TARGET_STM32F1/can_device.h index 3a8438faed..5a670caa7d 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F1/can_device.h @@ -23,7 +23,7 @@ extern "C" { #endif -#ifdef DEVICE_CAN +#if DEVICE_CAN #define CAN_NUM 1 // Number of CAN peripherals present in the STM32 serie diff --git a/targets/TARGET_STM/TARGET_STM32F1/common_objects.h b/targets/TARGET_STM/TARGET_STM32F1/common_objects.h index b22a153b0c..827aa644de 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/common_objects.h +++ b/targets/TARGET_STM/TARGET_STM32F1/common_objects.h @@ -76,7 +76,7 @@ struct spi_s { PinName pin_mosi; PinName pin_sclk; PinName pin_ssel; -#ifdef DEVICE_SPI_ASYNCH +#if DEVICE_SPI_ASYNCH uint32_t event; uint8_t transfer_type; #endif diff --git a/targets/TARGET_STM/TARGET_STM32F1/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F1/i2c_device.h index 50d48118c9..678d56b01a 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F1/i2c_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_I2C +#if DEVICE_I2C /* Define IP version */ #define I2C_IP_VERSION_V1 diff --git a/targets/TARGET_STM/TARGET_STM32F1/pwmout_device.c b/targets/TARGET_STM/TARGET_STM32F1/pwmout_device.c index ab311a1e8b..c32153f508 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/pwmout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F1/pwmout_device.c @@ -31,7 +31,7 @@ #include "pwmout_api.h" #include "pwmout_device.h" -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT const pwm_apb_map_t pwm_apb_map_table[] = { #if defined(TIM1_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32F1/pwmout_device.h b/targets/TARGET_STM/TARGET_STM32F1/pwmout_device.h index 0d81dd547a..070149e480 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/pwmout_device.h +++ b/targets/TARGET_STM/TARGET_STM32F1/pwmout_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT typedef enum { PWMOUT_ON_APB1 = 0, diff --git a/targets/TARGET_STM/TARGET_STM32F2/can_device.h b/targets/TARGET_STM/TARGET_STM32F2/can_device.h index cb95b44ea8..151c02c72d 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F2/can_device.h @@ -23,7 +23,7 @@ extern "C" { #endif -#ifdef DEVICE_CAN +#if DEVICE_CAN #define CAN_NUM 2 // Number of CAN peripherals present in the STM32 serie diff --git a/targets/TARGET_STM/TARGET_STM32F2/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F2/i2c_device.h index 303976241f..9de8774188 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F2/i2c_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_I2C +#if DEVICE_I2C #define I2C_IP_VERSION_V1 diff --git a/targets/TARGET_STM/TARGET_STM32F2/objects.h b/targets/TARGET_STM/TARGET_STM32F2/objects.h index 7359e18a6c..845b17f352 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/objects.h +++ b/targets/TARGET_STM/TARGET_STM32F2/objects.h @@ -94,7 +94,7 @@ struct spi_s { PinName pin_mosi; PinName pin_sclk; PinName pin_ssel; -#ifdef DEVICE_SPI_ASYNCH +#if DEVICE_SPI_ASYNCH uint32_t event; uint8_t transfer_type; #endif @@ -137,7 +137,7 @@ struct pwmout_s { uint8_t inverted; }; -#ifdef DEVICE_CAN +#if DEVICE_CAN struct can_s { CAN_HandleTypeDef CanHandle; int index; diff --git a/targets/TARGET_STM/TARGET_STM32F2/pwmout_device.c b/targets/TARGET_STM/TARGET_STM32F2/pwmout_device.c index 49bae343a2..058d4c88d7 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/pwmout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F2/pwmout_device.c @@ -31,7 +31,7 @@ #include "pwmout_api.h" #include "pwmout_device.h" -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT const pwm_apb_map_t pwm_apb_map_table[] = { #if defined(TIM2_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32F2/pwmout_device.h b/targets/TARGET_STM/TARGET_STM32F2/pwmout_device.h index 0d81dd547a..070149e480 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/pwmout_device.h +++ b/targets/TARGET_STM/TARGET_STM32F2/pwmout_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT typedef enum { PWMOUT_ON_APB1 = 0, diff --git a/targets/TARGET_STM/TARGET_STM32F3/can_device.h b/targets/TARGET_STM/TARGET_STM32F3/can_device.h index 121999c681..6198c10984 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F3/can_device.h @@ -23,7 +23,7 @@ extern "C" { #endif -#ifdef DEVICE_CAN +#if DEVICE_CAN #define CAN_NUM 1 // Number of CAN peripherals present in the STM32 serie diff --git a/targets/TARGET_STM/TARGET_STM32F3/common_objects.h b/targets/TARGET_STM/TARGET_STM32F3/common_objects.h index b1d82d34e7..c2a227901b 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/common_objects.h +++ b/targets/TARGET_STM/TARGET_STM32F3/common_objects.h @@ -57,7 +57,7 @@ struct spi_s { PinName pin_mosi; PinName pin_sclk; PinName pin_ssel; -#ifdef DEVICE_SPI_ASYNCH +#if DEVICE_SPI_ASYNCH uint32_t event; uint8_t transfer_type; #endif diff --git a/targets/TARGET_STM/TARGET_STM32F3/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F3/i2c_device.h index 8e08f9d647..7ef29226aa 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F3/i2c_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_I2C +#if DEVICE_I2C #define I2C_IP_VERSION_V2 diff --git a/targets/TARGET_STM/TARGET_STM32F3/pwmout_device.c b/targets/TARGET_STM/TARGET_STM32F3/pwmout_device.c index d112a29c4e..cea9afaf06 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/pwmout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F3/pwmout_device.c @@ -31,7 +31,7 @@ #include "pwmout_api.h" #include "pwmout_device.h" -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT const pwm_apb_map_t pwm_apb_map_table[] = { #if defined(TIM2_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32F3/pwmout_device.h b/targets/TARGET_STM/TARGET_STM32F3/pwmout_device.h index 0d81dd547a..070149e480 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/pwmout_device.h +++ b/targets/TARGET_STM/TARGET_STM32F3/pwmout_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT typedef enum { PWMOUT_ON_APB1 = 0, diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp index 259038e1e3..3aa33c5108 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp @@ -411,7 +411,7 @@ int OdinWiFiInterface::scan(WiFiAccessPoint *res_list, unsigned count) return found_aps; } -#ifdef DEVICE_WIFI_AP +#if DEVICE_WIFI_AP nsapi_error_t OdinWiFiInterface::set_ap_network(const char *ip_address, const char *netmask, const char *gateway) { @@ -1044,10 +1044,6 @@ void OdinWiFiInterface::handle_wlan_status_started(wlan_status_started_s *start) start->info.macAddress[4], start->info.macAddress[5]); - if(!_wlan_initialized) { - //Initialize network stack interface without activating it - } - if (!_interface) { nsapi_error_t error_code = _stack.add_ethernet_interface(_emac, true, &_interface); if (error_code != NSAPI_ERROR_OK) { @@ -1058,16 +1054,9 @@ void OdinWiFiInterface::handle_wlan_status_started(wlan_status_started_s *start) } } - - #ifdef DEVICE_WIFI_AP - if(!_wlan_initialized) { - _wlan_initialized = true; - } - #else if (!_wlan_initialized) { _wlan_initialized = true; } - #endif // The OdinWifiInterface object is now fully initialized _state = S_STARTED; diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h index 5139d8a453..0d292cd3a7 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h @@ -18,7 +18,7 @@ #define ODIN_WIFI_INTERFACE_H #include "WiFiInterface.h" -#ifdef DEVICE_WIFI_AP +#if DEVICE_WIFI_AP #include "UbloxWiFiSoftAPInterface.h" #endif @@ -46,7 +46,7 @@ struct wlan_scan_indication_s; /** OdinWiFiInterface class * Implementation of the WiFiInterface for the ODIN-W2 module */ -#ifdef DEVICE_WIFI_AP +#if DEVICE_WIFI_AP class OdinWiFiInterface : public WiFiInterface, public UbloxWiFiSoftAPInterface, public EMACInterface #else class OdinWiFiInterface : public WiFiInterface, public EMACInterface @@ -141,7 +141,7 @@ public: */ virtual nsapi_error_t set_timeout(int ms); -#ifdef DEVICE_WIFI_AP +#if DEVICE_WIFI_AP /** Set IP config for access point * diff --git a/targets/TARGET_STM/TARGET_STM32F4/can_device.h b/targets/TARGET_STM/TARGET_STM32F4/can_device.h index 81485b0ef7..ba14e21933 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F4/can_device.h @@ -23,7 +23,7 @@ extern "C" { #endif -#ifdef DEVICE_CAN +#if DEVICE_CAN #if defined(CAN3_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32F4/common_objects.h b/targets/TARGET_STM/TARGET_STM32F4/common_objects.h index 3f39a9ce53..f4a7ef74f4 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/common_objects.h +++ b/targets/TARGET_STM/TARGET_STM32F4/common_objects.h @@ -76,7 +76,7 @@ struct spi_s { PinName pin_mosi; PinName pin_sclk; PinName pin_ssel; -#ifdef DEVICE_SPI_ASYNCH +#if DEVICE_SPI_ASYNCH uint32_t event; uint8_t transfer_type; #endif diff --git a/targets/TARGET_STM/TARGET_STM32F4/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F4/i2c_device.h index 50d48118c9..678d56b01a 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F4/i2c_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_I2C +#if DEVICE_I2C /* Define IP version */ #define I2C_IP_VERSION_V1 diff --git a/targets/TARGET_STM/TARGET_STM32F4/pwmout_device.c b/targets/TARGET_STM/TARGET_STM32F4/pwmout_device.c index 49bae343a2..058d4c88d7 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/pwmout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F4/pwmout_device.c @@ -31,7 +31,7 @@ #include "pwmout_api.h" #include "pwmout_device.h" -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT const pwm_apb_map_t pwm_apb_map_table[] = { #if defined(TIM2_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32F4/pwmout_device.h b/targets/TARGET_STM/TARGET_STM32F4/pwmout_device.h index 0d81dd547a..070149e480 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/pwmout_device.h +++ b/targets/TARGET_STM/TARGET_STM32F4/pwmout_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT typedef enum { PWMOUT_ON_APB1 = 0, diff --git a/targets/TARGET_STM/TARGET_STM32F7/can_device.h b/targets/TARGET_STM/TARGET_STM32F7/can_device.h index 729b36177a..6e0f174fea 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F7/can_device.h @@ -23,7 +23,7 @@ extern "C" { #endif -#ifdef DEVICE_CAN +#if DEVICE_CAN #if defined(CAN3_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32F7/common_objects.h b/targets/TARGET_STM/TARGET_STM32F7/common_objects.h index e479902f61..a59d41630b 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/common_objects.h +++ b/targets/TARGET_STM/TARGET_STM32F7/common_objects.h @@ -57,7 +57,7 @@ struct spi_s { PinName pin_mosi; PinName pin_sclk; PinName pin_ssel; -#ifdef DEVICE_SPI_ASYNCH +#if DEVICE_SPI_ASYNCH uint32_t event; uint8_t transfer_type; #endif diff --git a/targets/TARGET_STM/TARGET_STM32F7/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F7/i2c_device.h index c55ca94b2d..3bfbc23c86 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F7/i2c_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_I2C +#if DEVICE_I2C #define I2C_IP_VERSION_V2 diff --git a/targets/TARGET_STM/TARGET_STM32F7/pwmout_device.c b/targets/TARGET_STM/TARGET_STM32F7/pwmout_device.c index 49bae343a2..058d4c88d7 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/pwmout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F7/pwmout_device.c @@ -31,7 +31,7 @@ #include "pwmout_api.h" #include "pwmout_device.h" -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT const pwm_apb_map_t pwm_apb_map_table[] = { #if defined(TIM2_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32F7/pwmout_device.h b/targets/TARGET_STM/TARGET_STM32F7/pwmout_device.h index 0d81dd547a..070149e480 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/pwmout_device.h +++ b/targets/TARGET_STM/TARGET_STM32F7/pwmout_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT typedef enum { PWMOUT_ON_APB1 = 0, diff --git a/targets/TARGET_STM/TARGET_STM32L0/i2c_device.h b/targets/TARGET_STM/TARGET_STM32L0/i2c_device.h index ace2076fe1..88eb878b1a 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32L0/i2c_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_I2C +#if DEVICE_I2C #define I2C_IP_VERSION_V2 diff --git a/targets/TARGET_STM/TARGET_STM32L0/pwmout_device.c b/targets/TARGET_STM/TARGET_STM32L0/pwmout_device.c index eb2f0e0043..068df7f773 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/pwmout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L0/pwmout_device.c @@ -31,7 +31,7 @@ #include "pwmout_api.h" #include "pwmout_device.h" -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT const pwm_apb_map_t pwm_apb_map_table[] = { #if defined(TIM2_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32L0/pwmout_device.h b/targets/TARGET_STM/TARGET_STM32L0/pwmout_device.h index bdb493818d..3a27fc3f3d 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/pwmout_device.h +++ b/targets/TARGET_STM/TARGET_STM32L0/pwmout_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT #define PWMOUT_INVERTED_NOT_SUPPORTED diff --git a/targets/TARGET_STM/TARGET_STM32L1/common_objects.h b/targets/TARGET_STM/TARGET_STM32L1/common_objects.h index 93a1dde240..e25271a44d 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/common_objects.h +++ b/targets/TARGET_STM/TARGET_STM32L1/common_objects.h @@ -76,7 +76,7 @@ struct spi_s { PinName pin_mosi; PinName pin_sclk; PinName pin_ssel; -#ifdef DEVICE_SPI_ASYNCH +#if DEVICE_SPI_ASYNCH uint32_t event; uint8_t transfer_type; #endif diff --git a/targets/TARGET_STM/TARGET_STM32L1/i2c_device.h b/targets/TARGET_STM/TARGET_STM32L1/i2c_device.h index 50d48118c9..678d56b01a 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32L1/i2c_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_I2C +#if DEVICE_I2C /* Define IP version */ #define I2C_IP_VERSION_V1 diff --git a/targets/TARGET_STM/TARGET_STM32L1/pwmout_device.c b/targets/TARGET_STM/TARGET_STM32L1/pwmout_device.c index 3a73793727..8f219f505d 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/pwmout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L1/pwmout_device.c @@ -31,7 +31,7 @@ #include "pwmout_api.h" #include "pwmout_device.h" -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT const pwm_apb_map_t pwm_apb_map_table[] = { #if defined(TIM2_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32L1/pwmout_device.h b/targets/TARGET_STM/TARGET_STM32L1/pwmout_device.h index 822156a709..a3d22c6965 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/pwmout_device.h +++ b/targets/TARGET_STM/TARGET_STM32L1/pwmout_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT /* L1 HAL do not offer Output Compare idle nor inverted mode*/ #define PWMOUT_INVERTED_NOT_SUPPORTED diff --git a/targets/TARGET_STM/TARGET_STM32L4/can_device.h b/targets/TARGET_STM/TARGET_STM32L4/can_device.h index 997a1b1087..35932a68b5 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32L4/can_device.h @@ -23,7 +23,7 @@ extern "C" { #endif -#ifdef DEVICE_CAN +#if DEVICE_CAN #define CAN_NUM 1 // Number of CAN peripherals present in the STM32 serie diff --git a/targets/TARGET_STM/TARGET_STM32L4/common_objects.h b/targets/TARGET_STM/TARGET_STM32L4/common_objects.h index 043a2474ef..8f1beef3ad 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/common_objects.h +++ b/targets/TARGET_STM/TARGET_STM32L4/common_objects.h @@ -57,7 +57,7 @@ struct spi_s { PinName pin_mosi; PinName pin_sclk; PinName pin_ssel; -#ifdef DEVICE_SPI_ASYNCH +#if DEVICE_SPI_ASYNCH uint32_t event; uint8_t transfer_type; #endif diff --git a/targets/TARGET_STM/TARGET_STM32L4/i2c_device.h b/targets/TARGET_STM/TARGET_STM32L4/i2c_device.h index 8bb6f9c3de..a575269ad5 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32L4/i2c_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_I2C +#if DEVICE_I2C #define I2C_IP_VERSION_V2 diff --git a/targets/TARGET_STM/TARGET_STM32L4/pwmout_device.c b/targets/TARGET_STM/TARGET_STM32L4/pwmout_device.c index d4a805ec19..d82c3ededb 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/pwmout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L4/pwmout_device.c @@ -31,7 +31,7 @@ #include "pwmout_api.h" #include "pwmout_device.h" -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT const pwm_apb_map_t pwm_apb_map_table[] = { #if defined(TIM2_BASE) diff --git a/targets/TARGET_STM/TARGET_STM32L4/pwmout_device.h b/targets/TARGET_STM/TARGET_STM32L4/pwmout_device.h index 0d81dd547a..070149e480 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/pwmout_device.h +++ b/targets/TARGET_STM/TARGET_STM32L4/pwmout_device.h @@ -36,7 +36,7 @@ extern "C" { #endif -#ifdef DEVICE_PWMOUT +#if DEVICE_PWMOUT typedef enum { PWMOUT_ON_APB1 = 0, diff --git a/targets/TARGET_STM/mbed_crc_api.c b/targets/TARGET_STM/mbed_crc_api.c index fd113e3fec..2a17ee2a63 100644 --- a/targets/TARGET_STM/mbed_crc_api.c +++ b/targets/TARGET_STM/mbed_crc_api.c @@ -3,7 +3,7 @@ #include "platform/mbed_assert.h" -#ifdef DEVICE_CRC +#if DEVICE_CRC static CRC_HandleTypeDef current_state; static uint32_t final_xor; diff --git a/targets/TARGET_STM/stm_spi_api.c b/targets/TARGET_STM/stm_spi_api.c index fa6a0bb513..12e19361d7 100644 --- a/targets/TARGET_STM/stm_spi_api.c +++ b/targets/TARGET_STM/stm_spi_api.c @@ -530,7 +530,7 @@ int spi_busy(spi_t *obj) return ssp_busy(obj); } -#ifdef DEVICE_SPI_ASYNCH +#if DEVICE_SPI_ASYNCH typedef enum { SPI_TRANSFER_TYPE_NONE = 0, SPI_TRANSFER_TYPE_TX = 1, diff --git a/targets/TARGET_STM/trng_api.c b/targets/TARGET_STM/trng_api.c index 75aabafbb3..04a614add3 100644 --- a/targets/TARGET_STM/trng_api.c +++ b/targets/TARGET_STM/trng_api.c @@ -18,7 +18,7 @@ * */ -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG #include #include "cmsis.h" diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c index f9adc69bfc..3d8ee9e009 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c @@ -441,7 +441,7 @@ void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask) #endif //DEVICE_I2CSLAVE -#ifdef DEVICE_I2C_ASYNCH +#if DEVICE_I2C_ASYNCH #include "em_dma.h" #include "dma_api_HAL.h" diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/itm_api.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/itm_api.c index 0e04f8e327..4e28ae7d61 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/itm_api.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/itm_api.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#if defined(DEVICE_ITM) +#if DEVICE_ITM #include "hal/itm_api.h" #include "cmsis.h" diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/trng/trng_api.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/trng/trng_api.c index f9251ce2b5..89436b0898 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/trng/trng_api.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/trng/trng_api.c @@ -24,7 +24,7 @@ #include "trng_api.h" #include "sl_trng.h" -#if defined(DEVICE_TRNG) +#if DEVICE_TRNG static bool is_trng_enabled = false; void trng_init(trng_t *obj) diff --git a/tools/targets/STM32_gen_PeripheralPins.py b/tools/targets/STM32_gen_PeripheralPins.py index 5fddb018d3..0f0363124f 100644 --- a/tools/targets/STM32_gen_PeripheralPins.py +++ b/tools/targets/STM32_gen_PeripheralPins.py @@ -28,7 +28,7 @@ from argparse import RawTextHelpFormatter GENPINMAP_VERSION = "1.3" -ADD_DEVICE_IFDEF = 0 +ADD_DEVICE_IF = 0 ADD_QSPI_FEATURE = 1 mcu_file="" @@ -485,8 +485,8 @@ def print_list_header(comment, name, l, switch): s += "// You have to comment all PWM using TIM_MST defined in hal_tick.h file\n" s += "// or update python script (check TIM_MST_LIST) and re-run it\n" - if ADD_DEVICE_IFDEF: - s += "#ifdef DEVICE_%s\n" % switch + if ADD_DEVICE_IF: + s += "#if DEVICE_%s\n" % switch s += "MBED_WEAK const PinMap PinMap_%s[] = {\n" % name @@ -541,7 +541,7 @@ MBED_WEAK const PinMap PinMap_ADC_Internal[] = { {NC, NC, 0} }; """) - if ADD_DEVICE_IFDEF: + if ADD_DEVICE_IF: out_c_file.write( "#endif\n" ) def print_dac(): @@ -568,7 +568,7 @@ def print_dac(): out_c_file.write( """ {NC, NC, 0} }; """) - if ADD_DEVICE_IFDEF: + if ADD_DEVICE_IF: out_c_file.write( "#endif\n" ) def print_i2c(l): @@ -610,7 +610,7 @@ def print_i2c(l): out_c_file.write( """ {NC, NC, 0} }; """) - if ADD_DEVICE_IFDEF: + if ADD_DEVICE_IF: out_c_file.write( "#endif\n" ) def print_pwm(): @@ -662,7 +662,7 @@ def print_pwm(): out_c_file.write( """ {NC, NC, 0} }; """) - if ADD_DEVICE_IFDEF: + if ADD_DEVICE_IF: out_c_file.write( "#endif\n" ) def print_uart(l): @@ -703,7 +703,7 @@ def print_uart(l): out_c_file.write( """ {NC, NC, 0} }; """) - if ADD_DEVICE_IFDEF: + if ADD_DEVICE_IF: out_c_file.write( "#endif\n" ) def print_spi(l): @@ -741,7 +741,7 @@ def print_spi(l): out_c_file.write( """ {NC, NC, 0} }; """) - if ADD_DEVICE_IFDEF: + if ADD_DEVICE_IF: out_c_file.write( "#endif\n" ) def print_can(l): @@ -775,7 +775,7 @@ def print_can(l): out_c_file.write( """ {NC, NC, 0} }; """) - if ADD_DEVICE_IFDEF: + if ADD_DEVICE_IF: out_c_file.write( "#endif\n" ) def print_qspi(l): @@ -801,7 +801,7 @@ def print_qspi(l): out_c_file.write( """ {NC, NC, 0} }; """) - if ADD_DEVICE_IFDEF: + if ADD_DEVICE_IF: out_c_file.write( "#endif\n" ) def print_h_file(l, comment):