CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

UINT8 TMR0

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
eetrung



Joined: 24 Apr 2006
Posts: 3

View user's profile Send private message

UINT8 TMR0
PostPosted: Fri Apr 28, 2006 6:03 am     Reply with quote

UINT8 TMR0;
UINT8 STATUS;

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

View user's profile Send private message

PostPosted: Fri Apr 28, 2006 7:52 am     Reply with quote

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








PostPosted: Sat Apr 29, 2006 5:19 am     Reply with quote

Thank you. Humberto.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sat Apr 29, 2006 6:08 am     Reply with quote

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;
};

#endif // STDINT_H
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group