WinAVR template

From pauljmac.com Projects
Jump to: navigation, search

This is a good template for a new WinAVR project.

#define F_CPU 1000000

#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <avr/pgmspace.h> 

#define bit_get(p,m) ((p) & (m))
#define bit_set(p,m) ((p) |= (m))
#define bit_clear(p,m) ((p) &= ~(m))
#define bit_flip(p,m) ((p) ^= (m))
#define bit_write(c,p,m) (c ? bit_set(p,m) : bit_clear(p,m))
#define BIT(x) (0x01 << (x))
#define LONGBIT(x) ((unsigned long)0x00000001 << (x))
#define NOP asm("nop")
#define OUT 1
#define IN 0

volatile uint8_t x=0;
volatile uint16_t y=0;

//Interrupt vector names: http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html
/*
ISR(TIMER0_OVF_vect){

}
*/

void Port_Setup(void){
	
}

int main(void){
	Port_Setup();
	sei();
	for(;;){
		
	}
}