I saw these lines in a sample code. I don't understand what is it mean?
Is UINT8 a keyword?
Thanks for your help. _________________ Newbie
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
Posted: Fri Apr 28, 2006 7:52 am
UINT8 TMR0;
It is a Data type Specifier and it makes reference to an Unsigned 8 bit INTeger.
(Not applicable to CCS)
For CCS it is not a keyword, surelly another compiler use that notation.
Humberto
Guest
Posted: Sat Apr 29, 2006 5:19 am
Thank you. Humberto.
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
Posted: Sat Apr 29, 2006 6:08 am
I use that. It is just a typedef. I like to do this in a stdint.h file. It makes porting code much easier since compilers treat 'int' differently. I have since changed to using 'uint8_t'
Code:
// Defines the standard integer types that are used in code
// for the Microchip microprocessor.
#ifndef STDINT_H
#define STDINT_H
typedef unsigned char bool;
typedef unsigned char uint8_t; // 1 byte 0 to 255
typedef signed char int8_t; // 1 byte -127 to 127
typedef unsigned int16 uint16_t; // 2 bytes 0 to 65535
typedef signed int16 int16_t; // 2 bytes -32767 to 32767
typedef unsigned int32 uint32_t; // 4 bytes 0 to 4294967295
typedef signed int32 int32_t; // 4 bytes -2147483647 to 2147483647
union wide_data_t
{
uint8_t byte[2];
uint16_t word;
};
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum