diff --git a/hal/tpm_io_infineon.c b/hal/tpm_io_infineon.c index 7689f7a2..77ae4c20 100644 --- a/hal/tpm_io_infineon.c +++ b/hal/tpm_io_infineon.c @@ -43,6 +43,7 @@ defined(WOLFTPM_SWTPM) || \ defined(WOLFTPM_WINAPI) ) +#if defined(WOLFTPM_INFINEON_TRICORE) || defined(CY_USING_HAL) #ifdef WOLFTPM_I2C #ifndef TPM_I2C_TRIES #define TPM_I2C_TRIES 10 @@ -51,7 +52,6 @@ #define TPM2_I2C_ADDR 0x2e #endif - #if defined(CY_USING_HAL) #include "cyhal_i2c.h" static int tpm_ifx_i2c_read(void* userCtx, word32 reg, byte* data, int len) @@ -146,10 +146,6 @@ return ret; } - #else - #error Infineon I2C support on this platform not supported yet - #endif /* CY_USING_HAL or WOLFTPM_INFINEON_TRICORE */ - #else /* SPI */ #ifndef TPM2_SPI_HZ @@ -211,6 +207,8 @@ #error Infineon I2C support on this platform not supported yet #endif /* CY_USING_HAL or WOLFTPM_INFINEON_TRICORE */ #endif /* SPI or I2C */ +#endif /* CY_USING_HAL */ + #endif /* !(WOLFTPM_LINUX_DEV || WOLFTPM_SWTPM || WOLFTPM_WINAPI) */ #endif /* WOLFTPM_INCLUDE_IO_FILE */