Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Bug Report: Wrong return value type in i2c_rw.c

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Bug Report: Wrong return value type in i2c_rw.c
Moderator:
RSKV

Post Reply
Follow this topic



Bug Report: Wrong return value type in i2c_rw.c

RobinD posted on 27 Feb 2013 5:45 AM PST

1 Forum Post

Hello Cypress Developers Team,

I found a bug in the file i2c_rw.c which contains the I2C read and write functions used by the framework users.

The functions

BOOL EZUSB_ReadI2C(BYTE addr, BYTE length, BYTE xdata *dat)

BOOL EZUSB_WriteI2C(BYTE addr, BYTE length, BYTE xdata *dat)

return an "I2C status byte" defined in lp.h which looks like "I2C_OK".

However, the defined return value in the function is defined as BOOL thus the "I2C status byte" is cast to BOOL and loses its information. And worst of all EVERY return value of the functions casts to TRUE!

The return value could simply be defined as int or similar to keep the "I2C status byte" information.

I know I can fix the bug locally in my repository but the framework should be fixed too in my opinion.

 

Regards,

Robin




Re: Bug Report: Wrong return value type in i2c_rw.c

Gayathri posted on 27 Feb 2013 06:47 AM PST
Cypress Employee
428 Forum Posts

 Hi,

 

Yes I understood what you are conveying. I will check on this and report this to the concerned team. Thank you for bringing this to our notice.

 

Regards,

Gayathri






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20