Skip to content
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

Don't do check for TRUE or FALSE at this place #20

Open
msin87 opened this issue Aug 28, 2019 · 0 comments
Open

Don't do check for TRUE or FALSE at this place #20

msin87 opened this issue Aug 28, 2019 · 0 comments

Comments

@msin87
Copy link

msin87 commented Aug 28, 2019

while (!I2C_CheckEvent(I2C_PORT,I2C_EVENT_MASTER_MODE_SELECT)); // Wait for EV5

Please, for compatibility with different stm32 microcontrollers, replace this check with the following:
while (I2C_CheckEvent(I2C_PORT,I2C_EVENT_MASTER_MODE_SELECT)==ERROR);

For stm32f4 ErrorStatus defined as:

typedef enum 
{
  ERROR = 0U, 
  SUCCESS = !ERROR
} ErrorStatus;

Please do this in all your code

danie007 added a commit to danie007/stm32 that referenced this issue Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant