All pastes #366883 Raw Edit

Unnamed

public text v1 · immutable
#366883 ·published 2007-02-21 23:43 UTC
rendered paste body
#define SETBIT(reg, bit)      reg |= BIT(bit)
#define SETBITS(reg, bits)    reg |= (bits)
#define CLRBIT(reg, bit)    reg &= ~(BIT(bit))
#define CLRBITS(reg, bits)  reg &= ~(bits)
#define SetBit(BIT, PORT)        PORT |= (1<<BIT)
#define ClearBit(BIT, PORT)      PORT &= ~(1<<BIT)
#define IsHigh(BIT, PORT)       (PORT & (1<<BIT)) != 1
#define IsLow(BIT, PORT)        (PORT & (1<<BIT)) == 1

int y = 0;


while(1)
{
	y++;
	if (y >= 150)	 
	{
	if (IsHigh(PA2,PORTA)) ClearBit(PA2,PORTA);
	else if(IsLow(PA2,PORTA)) SetBit(PA2,PORTA);
	y = 0;
	}	
}