Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ Creator & Designer Forum Discussions

JoBr_1593366
Level 5
Level 5
100 sign-ins 50 questions asked 100 replies posted

Would it make sense to change cytypes.h to use stdbool.h's bool type for CYBIT variables?

Currently, for non-PSoC3, it defines:

#define CYBIT      uint8

But this means when you hover over a CYBIT variable, it shows "uint8" as the type, so it's not obvious if it's meant to be boolean or integer.  If this were changed to bool type, it would show that when hovering over it, to clarify that the variable is meant to be true or false, not an integer.

#define CYBIT      bool

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi JoBr_1593366​,

CYBIT is one of the defines among others which is used to support type modifiers for cross platforms IDE's like Keil. You can find information on these in page number 8 under the section "Keil 8051 Compatibility Defines" (Link: http://www.cypress.com/file/130561/download )

Since there were a few issues with bool in different compiler versions it might have been defined as uint8 type. You can go ahead and modify the type based on your application.

Hope this helps,

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

View solution in original post

3 Replies
Rakshith
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi JoBr_1593366​,

CYBIT is one of the defines among others which is used to support type modifiers for cross platforms IDE's like Keil. You can find information on these in page number 8 under the section "Keil 8051 Compatibility Defines" (Link: http://www.cypress.com/file/130561/download )

Since there were a few issues with bool in different compiler versions it might have been defined as uint8 type. You can go ahead and modify the type based on your application.

Hope this helps,

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

RakshithM_16 wrote:

used to support type modifiers for cross platforms IDE's like Keil.

Yes, I know. I'm just suggesting that you define it as a boolean type for platforms that support it.  I don't want to change it in my projects since it's part of the Generated Source.

0 Likes

Hi JoBr_1593366,

Thank you for your suggestion. We will file an enhancement request for the same.

Thank you for the continuous interest in Cypress products.

Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes