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

PSoC™ Creator & Designer Forum Discussions

JeCo_264681
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

I feel dumb asking this question. It is more of a C language question but I can't find a good answer from online search. I am using the PSoC5LP GCC compiler.
I create a new .C file in an existing project. When I declare a new variable as uint8 or uint16, it is flagged "unknown type name 'uint8'. " If  I declare it as int, the error goes away.  When I open other auto generated .C files, they have uint8 and uint16 variables.
Why can I not declare unsigned and size in a c file?

0 Likes
1 Solution
JeCo_264681
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

It seems that either #include "cytypes.h" or #include "project.h" solves the problem. Thanks to both of you.

View solution in original post

0 Likes
4 Replies
rola_264706
Level 8
50 likes received 25 likes received 10 likes received
Level 8

This is a correct way uint8 Current_time[8]; or 32 or 64. You have to assign a name after the uint Variable then size of the 8,16,32,64.

0 Likes
cadi_1014291
Level 6
25 likes received 10 likes received 10 likes given
Level 6

Hi 78rpm

   

From what i understand i think you should include the cytypes.h file, i can not remember if it's like this: #include "cytypes.h" or like this: #include <cytypes.h>.

   

This file include all the uint8, uint16, uint32 ... etc variable types.

   

Hope it helps

0 Likes
JeCo_264681
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

It seems that either #include "cytypes.h" or #include "project.h" solves the problem. Thanks to both of you.

0 Likes
Bob_Marlowe
Level 10
First like given 50 questions asked 10 questions asked
Level 10

I usually #include <project.h> into every  .h or .c file which gives me access to all cypress-defined variables, components and macros.

   

 

   

Bob