Daniel,
You can build a generic bit set-reset function if not already provided by
your compiler like:
// Add to .h file
#define SetBit 1
#define ResetBit 0
#ifndef bool
#define bool unsigned char
#endif
#ifndef Bit0
#define Bit0 0
#define Bit1 0
#define Bit2 0
#define Bit3 0
#define Bit4 0
#define Bit5 0
#define Bit6 0
#define Bit7 0
#endif
void SetResetBit(unsigned char Port, unsigned char Bit, bool Value);
// Add to .c file
void SetResetBit(unsigned char Port, unsigned char Bit, bool Value)
{
if(Value == SetBit)
Port |= Bit;
else if(Value == ResetBit)
Port &= ~Bit;
}
When you call the routine, use
SetResetBit(Portname, Bit2, SetBit);
-----Original Message-----
From: Daniel Flor [mailto:[email protected]]
Sent: Friday, April 03, 2009 3:48 PM
To: [email protected]
Subject: [Mspgcc-users] Bit command in mspgcc
Hello,
I am a beginer in mspgcc, and I'm using mspgcc + eclipse for make a program.
I saw some code examples for IAR, and many of the comands are similar in
mspgcc. However, there are commands in IAR, like UxTCTL_bit.TXEPT, that
allows us to manipulate bits in the registers.
Are there similar commands in mspgcc?
Thank you
Daniel.
PS: Please, forgive- me for my english.
----------------------------------------------------------------------------
--
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users