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

fix(Examples): Fix return value logic for verifyData function in I2C examples #651

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix verify data return value bug in I2C examples
  • Loading branch information
Jacob-Scheiffler committed Jul 5, 2023
commit 4a8b290ce3c27185f5530e13eb84dc852edfb12b
5 changes: 3 additions & 2 deletions Examples/MAX32650/I2C/main.c
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;
for (i = 0; i < I2C_BYTES; ++i) {
@@ -276,7 +276,8 @@ int main()
printf("\n-->Result: \n");
printData();
printf("\n");
if (verifyData()) {

if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
} else {
printf("\n-->I2C Transaction Failed\n");
4 changes: 2 additions & 2 deletions Examples/MAX32655/I2C/main.c
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;

@@ -271,7 +271,7 @@ int main()

printf("\n");

if (verifyData()) {
if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
} else {
printf("\n-->I2C Transaction Failed\n");
5 changes: 3 additions & 2 deletions Examples/MAX32660/I2C/main.c
Original file line number Diff line number Diff line change
@@ -180,7 +180,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;
for (i = 0; i < I2C_BYTES; ++i) {
@@ -280,7 +280,8 @@ int main()
printf("\n-->Result: \n");
printData();
printf("\n");
if (verifyData()) {

if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
} else {
printf("\n-->I2C Transaction Failed\n");
5 changes: 3 additions & 2 deletions Examples/MAX32662/I2C/main.c
Original file line number Diff line number Diff line change
@@ -177,7 +177,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;
for (i = 0; i < I2C_BYTES; ++i) {
@@ -286,7 +286,8 @@ int main()
printf("\n-->Result: \n");
printData();
printf("\n");
if (!verifyData()) {

if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
} else {
printf("\n-->I2C Transaction Failed\n");
5 changes: 3 additions & 2 deletions Examples/MAX32665/I2C/main.c
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;
for (i = 0; i < I2C_BYTES; ++i) {
@@ -282,7 +282,8 @@ int main()
printf("\n-->Result: \n");
printData();
printf("\n");
if (verifyData()) {

if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
} else {
printf("\n-->I2C Transaction Failed\n");
4 changes: 2 additions & 2 deletions Examples/MAX32670/I2C/main.c
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;

@@ -274,7 +274,7 @@ int main()

printf("\n");

if (verifyData()) {
if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
} else {
printf("\n-->I2C Transaction Failed\n");
2 changes: 1 addition & 1 deletion Examples/MAX32672/I2C/main.c
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;

8 changes: 4 additions & 4 deletions Examples/MAX32675/I2C/main.c
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;

@@ -190,9 +190,9 @@ int verifyData()

if (fails > 0) {
return E_FAIL;
} else {
return E_NO_ERROR;
}

return E_NO_ERROR;
}

// *****************************************************************************
@@ -274,7 +274,7 @@ int main()

printf("\n");

if (verifyData()) {
if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
} else {
printf("\n-->I2C Transaction Failed\n");
4 changes: 2 additions & 2 deletions Examples/MAX32680/I2C/main.c
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;

@@ -271,7 +271,7 @@ int main()

printf("\n");

if (verifyData()) {
if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
} else {
printf("\n-->I2C Transaction Failed\n");
5 changes: 3 additions & 2 deletions Examples/MAX32690/I2C/main.c
Original file line number Diff line number Diff line change
@@ -181,7 +181,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;
for (i = 0; i < I2C_BYTES; ++i) {
@@ -281,7 +281,8 @@ int main()
printf("\n-->Result: \n");
printData();
printf("\n");
if (!verifyData()) {

if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
LED_On(LED_GREEN);
} else {
4 changes: 2 additions & 2 deletions Examples/MAX78002/I2C/main.c
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ void printData(void)
}

//Compare data to see if they are the same
int verifyData()
int verifyData(void)
{
int i, fails = 0;

@@ -275,7 +275,7 @@ int main()

printf("\n");

if (verifyData()) {
if (verifyData() == E_NO_ERROR) {
printf("\n-->I2C Transaction Successful\n");
} else {
printf("\n-->I2C Transaction Failed\n");