diff --git a/targets/TARGET_ARM_FM/TARGET_FVP_MPS2/i2c_api.c b/targets/TARGET_ARM_FM/TARGET_FVP_MPS2/i2c_api.c index 8fb4e7a0752..17fad0f8099 100644 --- a/targets/TARGET_ARM_FM/TARGET_FVP_MPS2/i2c_api.c +++ b/targets/TARGET_ARM_FM/TARGET_FVP_MPS2/i2c_api.c @@ -14,6 +14,9 @@ * limitations under the License. */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "mbed_error.h" @@ -607,3 +610,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/i2c_api.c b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/i2c_api.c index dbd360d962f..09d755c565c 100644 --- a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/i2c_api.c +++ b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/i2c_api.c @@ -14,6 +14,9 @@ * limitations under the License. */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "mbed_error.h" #include "mbed_wait_api.h" @@ -291,3 +294,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_ARM_SSG/TARGET_IOTSS/i2c_api.c b/targets/TARGET_ARM_SSG/TARGET_IOTSS/i2c_api.c index 9cb12e7d275..0335eb2bca9 100644 --- a/targets/TARGET_ARM_SSG/TARGET_IOTSS/i2c_api.c +++ b/targets/TARGET_ARM_SSG/TARGET_IOTSS/i2c_api.c @@ -14,6 +14,9 @@ * limitations under the License. */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "mbed_error.h" @@ -541,3 +544,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_ARM_SSG/TARGET_MPS2/i2c_api.c b/targets/TARGET_ARM_SSG/TARGET_MPS2/i2c_api.c index 5f79605f57e..a9e957b711e 100644 --- a/targets/TARGET_ARM_SSG/TARGET_MPS2/i2c_api.c +++ b/targets/TARGET_ARM_SSG/TARGET_MPS2/i2c_api.c @@ -14,6 +14,9 @@ * limitations under the License. */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "mbed_error.h" @@ -551,3 +554,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/i2c_api.c b/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/i2c_api.c index a5d6b5188d6..53e88606b8c 100644 --- a/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/i2c_api.c +++ b/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/i2c_api.c @@ -16,6 +16,8 @@ #include "mbed_assert.h" #include "i2c_api.h" +#if DEVICE_I2C + #include #include "cmsis.h" @@ -1013,3 +1015,5 @@ void i2c_abort_asynch(i2c_t *obj) } #endif + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Atmel/TARGET_SAM_CortexM4/i2c_api.c b/targets/TARGET_Atmel/TARGET_SAM_CortexM4/i2c_api.c index 80e7ae81db7..49b8540af79 100644 --- a/targets/TARGET_Atmel/TARGET_SAM_CortexM4/i2c_api.c +++ b/targets/TARGET_Atmel/TARGET_SAM_CortexM4/i2c_api.c @@ -13,11 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "i2c_api.h" + +#if DEVICE_I2C #include "device.h" #include "buffer.h" #include "dma_api.h" -#include "i2c_api.h" #include "PeripheralPins.h" #include "twi.h" #include "pdc.h" @@ -733,3 +735,5 @@ void i2c_abort_asynch(i2c_t *obj) } #endif + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/i2c_api.c b/targets/TARGET_Cypress/TARGET_PSOC6/i2c_api.c index 513130da3b1..9bdd7ceafc6 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/i2c_api.c +++ b/targets/TARGET_Cypress/TARGET_PSOC6/i2c_api.c @@ -16,13 +16,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "mbed_assert.h" +#include "i2c_api.h" + +#if DEVICE_I2C #include "cmsis.h" -#include "mbed_assert.h" #include "mbed_error.h" #include "PeripheralPins.h" #include "pinmap.h" -#include "i2c_api.h" + #include "psoc6_utils.h" #include "cy_sysclk.h" @@ -652,3 +655,5 @@ void i2c_abort_asynch(i2c_t *obj_in) } #endif // DEVICE_ASYNCH + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/i2c_api.c b/targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/i2c_api.c index d3ef55c693d..c18f1f98926 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/i2c_api.c +++ b/targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/i2c_api.c @@ -14,13 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "mbed_assert.h" +#include "i2c_api.h" + +#if DEVICE_I2C #include "cmsis.h" -#include "mbed_assert.h" #include "mbed_error.h" #include "PeripheralPins.h" #include "pinmap.h" -#include "i2c_api.h" #include "psoc6_utils.h" #include "cy_sysclk.h" @@ -566,3 +568,5 @@ void i2c_abort_asynch(i2c_t *obj_in) } #endif // DEVICE_ASYNCH + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Freescale/TARGET_K20XX/i2c_api.c b/targets/TARGET_Freescale/TARGET_K20XX/i2c_api.c index 92b6b50555b..6e3b8596a1e 100644 --- a/targets/TARGET_Freescale/TARGET_K20XX/i2c_api.c +++ b/targets/TARGET_Freescale/TARGET_K20XX/i2c_api.c @@ -16,6 +16,8 @@ #include "mbed_assert.h" #include "i2c_api.h" +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "clk_freqs.h" @@ -390,3 +392,5 @@ void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask) { obj->i2c->A1 = address & 0xfe; } #endif + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Freescale/TARGET_KLXX/i2c_api.c b/targets/TARGET_Freescale/TARGET_KLXX/i2c_api.c index 981cf7994d2..8cb96962ced 100644 --- a/targets/TARGET_Freescale/TARGET_KLXX/i2c_api.c +++ b/targets/TARGET_Freescale/TARGET_KLXX/i2c_api.c @@ -16,6 +16,8 @@ #include "mbed_assert.h" #include "i2c_api.h" +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "clk_freqs.h" @@ -401,3 +403,4 @@ void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask) { } #endif +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Maxim/TARGET_MAX32600/i2c_api.c b/targets/TARGET_Maxim/TARGET_MAX32600/i2c_api.c index 4387f6b6107..8a533d5cbfb 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32600/i2c_api.c +++ b/targets/TARGET_Maxim/TARGET_MAX32600/i2c_api.c @@ -33,6 +33,9 @@ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "i2cm_regs.h" #include "clkman_regs.h" @@ -446,3 +449,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Maxim/TARGET_MAX32610/i2c_api.c b/targets/TARGET_Maxim/TARGET_MAX32610/i2c_api.c index 4387f6b6107..8a533d5cbfb 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32610/i2c_api.c +++ b/targets/TARGET_Maxim/TARGET_MAX32610/i2c_api.c @@ -33,6 +33,9 @@ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "i2cm_regs.h" #include "clkman_regs.h" @@ -446,3 +449,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Maxim/TARGET_MAX32620/i2c_api.c b/targets/TARGET_Maxim/TARGET_MAX32620/i2c_api.c index 1e23c0a7b2d..39b293b35f7 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32620/i2c_api.c +++ b/targets/TARGET_Maxim/TARGET_MAX32620/i2c_api.c @@ -33,6 +33,9 @@ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "i2cm_regs.h" #include "clkman_regs.h" @@ -450,3 +453,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Maxim/TARGET_MAX32620C/i2c_api.c b/targets/TARGET_Maxim/TARGET_MAX32620C/i2c_api.c index 34b16dccb8b..5b3bff4d224 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32620C/i2c_api.c +++ b/targets/TARGET_Maxim/TARGET_MAX32620C/i2c_api.c @@ -33,6 +33,9 @@ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "i2cm_regs.h" #include "i2cm.h" #include "pinmap.h" @@ -225,3 +228,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/i2c_api.c b/targets/TARGET_Maxim/TARGET_MAX32625/i2c_api.c index 9a4e6d7807b..12ebe88948a 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32625/i2c_api.c +++ b/targets/TARGET_Maxim/TARGET_MAX32625/i2c_api.c @@ -33,6 +33,9 @@ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "i2cm_regs.h" #include "i2cm.h" #include "pinmap.h" @@ -226,3 +229,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Maxim/TARGET_MAX32630/i2c_api.c b/targets/TARGET_Maxim/TARGET_MAX32630/i2c_api.c index a2cf24e3fdc..b20a91dd8de 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32630/i2c_api.c +++ b/targets/TARGET_Maxim/TARGET_MAX32630/i2c_api.c @@ -33,6 +33,9 @@ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "i2cm_regs.h" #include "i2cm.h" #include "pinmap.h" @@ -225,3 +228,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c b/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c index e2f6197aaec..c45d5d41704 100644 --- a/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c +++ b/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c @@ -15,6 +15,9 @@ */ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "twi_master.h" @@ -361,3 +364,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_testing; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_NXP/TARGET_LPC11UXX/i2c_api.c b/targets/TARGET_NXP/TARGET_LPC11UXX/i2c_api.c index 7c169f0522b..eed896272dd 100644 --- a/targets/TARGET_NXP/TARGET_LPC11UXX/i2c_api.c +++ b/targets/TARGET_NXP/TARGET_LPC11UXX/i2c_api.c @@ -15,6 +15,9 @@ */ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "PeripheralPins.h" // For the Peripheral to Pin Definitions found in the individual Target's Platform @@ -399,3 +402,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/i2c_api.c b/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/i2c_api.c index 5704643abaf..0b483a9f1e3 100644 --- a/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/i2c_api.c +++ b/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/i2c_api.c @@ -15,6 +15,9 @@ */ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "mbed_error.h" @@ -411,3 +414,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_NXP/TARGET_LPC13XX/i2c_api.c b/targets/TARGET_NXP/TARGET_LPC13XX/i2c_api.c index 6ac2a5d8a27..ab5f95fa7ad 100644 --- a/targets/TARGET_NXP/TARGET_LPC13XX/i2c_api.c +++ b/targets/TARGET_NXP/TARGET_LPC13XX/i2c_api.c @@ -15,6 +15,9 @@ */ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "mbed_error.h" @@ -410,3 +413,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_NXP/TARGET_LPC15XX/i2c_api.c b/targets/TARGET_NXP/TARGET_LPC15XX/i2c_api.c index ebf970f09b3..15e425e9413 100644 --- a/targets/TARGET_NXP/TARGET_LPC15XX/i2c_api.c +++ b/targets/TARGET_NXP/TARGET_LPC15XX/i2c_api.c @@ -15,6 +15,9 @@ */ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" @@ -247,3 +250,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_NXP/TARGET_LPC176X/i2c_api.c b/targets/TARGET_NXP/TARGET_LPC176X/i2c_api.c index ad15cd6a238..759f06f4892 100644 --- a/targets/TARGET_NXP/TARGET_LPC176X/i2c_api.c +++ b/targets/TARGET_NXP/TARGET_LPC176X/i2c_api.c @@ -15,6 +15,9 @@ */ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" @@ -425,3 +428,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088/i2c_api.c b/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088/i2c_api.c index 88d080c622d..8e7ba6c01b7 100644 --- a/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088/i2c_api.c +++ b/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088/i2c_api.c @@ -15,6 +15,9 @@ */ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" @@ -440,3 +443,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088_DM/i2c_api.c b/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088_DM/i2c_api.c index 014a3b6b7da..198f3df7a61 100644 --- a/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088_DM/i2c_api.c +++ b/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088_DM/i2c_api.c @@ -15,6 +15,9 @@ */ #include "mbed_assert.h" #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" @@ -426,3 +429,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_NXP/TARGET_LPC43XX/i2c_api.c b/targets/TARGET_NXP/TARGET_LPC43XX/i2c_api.c index 028fedb008a..31034237406 100644 --- a/targets/TARGET_NXP/TARGET_LPC43XX/i2c_api.c +++ b/targets/TARGET_NXP/TARGET_LPC43XX/i2c_api.c @@ -16,6 +16,9 @@ * Ported to NXP LPC43XX by Micromint USA */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "cmsis.h" #include "pinmap.h" #include "mbed_error.h" @@ -419,3 +422,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/i2c_api.c b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/i2c_api.c index f52a7920fb1..bbe6e262c02 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/i2c_api.c +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/i2c_api.c @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "i2c_api.h" + +#if DEVICE_I2C + #include "mbed_assert.h" #include "dma_api.h" -#include "i2c_api.h" #include "cmsis.h" #include "PeripheralPins.h" #include "r_typedefs.h" @@ -1155,3 +1158,4 @@ void i2c_abort_asynch(i2c_t *obj) } #endif +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_MCU_RTL8195A/i2c_api.c b/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_MCU_RTL8195A/i2c_api.c index ebb3f3a96ec..3881418b14f 100644 --- a/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_MCU_RTL8195A/i2c_api.c +++ b/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_MCU_RTL8195A/i2c_api.c @@ -13,12 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "i2c_api.h" + +#if DEVICE_I2C #include #include "objects.h" #include "PinNames.h" #include "hal_i2c.h" -#include "i2c_api.h" #if CONFIG_I2C_EN @@ -603,3 +605,4 @@ int i2c_slave_write(i2c_t *obj, const char *data, int length) #endif // CONFIG_I2C_EN +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM066/i2c_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM066/i2c_api.c index fb336467e6f..9a538d909d2 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM066/i2c_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM066/i2c_api.c @@ -14,6 +14,9 @@ * limitations under the License. */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "mbed_error.h" #include "PeripheralNames.h" #include "pinmap.h" @@ -361,3 +364,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM3H6/i2c_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM3H6/i2c_api.c index f85bb676b42..1fe9cc851c7 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM3H6/i2c_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM3H6/i2c_api.c @@ -14,6 +14,9 @@ * limitations under the License. */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "mbed_error.h" #include "pinmap.h" #include "gpio_include.h" @@ -395,3 +398,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM3HQ/i2c_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM3HQ/i2c_api.c index c3bb19f02c1..da747e6f538 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM3HQ/i2c_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM3HQ/i2c_api.c @@ -14,6 +14,9 @@ * limitations under the License. */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "mbed_error.h" #include "pinmap.h" #include "gpio_include.h" @@ -402,3 +405,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM46B/i2c_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM46B/i2c_api.c index 6ae3ba89193..897f92e1183 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM46B/i2c_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM46B/i2c_api.c @@ -14,6 +14,9 @@ * limitations under the License. */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "mbed_error.h" #include "PeripheralNames.h" #include "pinmap.h" @@ -374,3 +377,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM4G9/i2c_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM4G9/i2c_api.c index f54ece07c0f..3bd9e7caf47 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM4G9/i2c_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM4G9/i2c_api.c @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "i2c_api.h" + +#if DEVICE_I2C + #include #include -#include "i2c_api.h" #include "mbed_error.h" #include "PeripheralNames.h" #include "pinmap.h" @@ -221,3 +224,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_TT/TARGET_TT_M3HQ/i2c_api.c b/targets/TARGET_TT/TARGET_TT_M3HQ/i2c_api.c index 929b67e6206..32681ef8013 100644 --- a/targets/TARGET_TT/TARGET_TT_M3HQ/i2c_api.c +++ b/targets/TARGET_TT/TARGET_TT_M3HQ/i2c_api.c @@ -14,6 +14,9 @@ * limitations under the License. */ #include "i2c_api.h" + +#if DEVICE_I2C + #include "mbed_error.h" #include "pinmap.h" #include "gpio_include.h" @@ -374,3 +377,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C diff --git a/targets/TARGET_TT/TARGET_TT_M4G9/i2c_api.c b/targets/TARGET_TT/TARGET_TT_M4G9/i2c_api.c index f7a72ec7d42..57551473c97 100644 --- a/targets/TARGET_TT/TARGET_TT_M4G9/i2c_api.c +++ b/targets/TARGET_TT/TARGET_TT_M4G9/i2c_api.c @@ -13,11 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "i2c_api.h" + +#if DEVICE_I2C + #include #include #include #include "mbed_error.h" -#include "i2c_api.h" #include "txz_i2c_api.h" #include "PeripheralNames.h" #include "pinmap.h" @@ -209,3 +212,5 @@ const PinMap *i2c_slave_scl_pinmap() { return PinMap_I2C_SCL; } + +#endif // #if DEVICE_I2C