-
Notifications
You must be signed in to change notification settings - Fork 61
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
Revise I2C HAL gating logic in tpm_to_infineon #347
Conversation
hal/tpm_io_infineon.c
Outdated
@@ -43,6 +43,7 @@ | |||
defined(WOLFTPM_SWTPM) || \ | |||
defined(WOLFTPM_WINAPI) ) | |||
|
|||
#if defined(CY_USING_HAL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to be #if defined(WOLFTPM_INFINEON_TRICORE) || defined(CY_USING_HAL)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch. updated.
4c2bbc7
to
83a92e1
Compare
hal/tpm_io_infineon.c
Outdated
@@ -51,7 +52,6 @@ | |||
#define TPM2_I2C_ADDR 0x2e | |||
#endif | |||
|
|||
#if defined(CY_USING_HAL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't remove this code or the code below at 149-152. Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to read that a few times to understand what's going on.
Does that mean no I2C available / implemented on Infineon Tricore?
hal/tpm_io_infineon.c
Outdated
@@ -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 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update comment | WOLFTPM_INFINEON_TRICORE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch. Updated.
83a92e1
to
e4ff305
Compare
3448ab0
to
ec35cef
Compare
This PR updates the gating logic in the
hal/tpm_io_infineon.c
to be more consistent with other target platforms.For example, note how the
tpm_io_microchip.c
is wrapped withWOLFTPM_MICROCHIP_HARMONY
, disabling the entire file otherwise:Without this modification, enabling
WOLFTPM_INCLUDE_IO_FILE
andWOLFTPM_I2C
causes a compile-time error as the only gate isWOLFTPM_I2C
. In my case, I'm using the Espressf I2C library, not the cyhal here:Here's the content of my wolfTPM
options.h
:Testing
I have not tested this, as I don't have the target library that is being changed.