diff --git a/avr/makefile b/avr/makefile index 74e8ac9..de9ce4f 100644 --- a/avr/makefile +++ b/avr/makefile @@ -4,10 +4,12 @@ SOURCES = src/avrtest.c CC = avr-gcc OBJCOPY = avr-objcopy MMCU = atmega88 +F_CPU = 10000000UL +#F_CPU = 11059200UL DUMMY_BINARY:=$(shell mkdir -p binary) -CFLAGS = -mmcu=$(MMCU) -Wall -Os -std=gnu99 +CFLAGS = -mmcu=$(MMCU) -DF_CPU=$(F_CPU) -Wall -Os -std=gnu99 compile : binary/$(PROJECT).out @@ -18,7 +20,7 @@ binary/$(PROJECT).out: $(SOURCES) $(CC) $(CFLAGS) -I./ -o binary/$(PROJECT).out $(SOURCES) program: binary/$(PROJECT).hex - avrdude -p m88 -c buspirate -P /dev/cu.PL2303-003012FA -e -U flash:w:binary/$(PROJECT).hex + avrdude -p m88 -c buspirate -P /dev/cu.PL2303-00* -e -U flash:w:binary/$(PROJECT).hex clean: rm -rf binary/ diff --git a/avr/src/avrtest.c b/avr/src/avrtest.c index 157a5d4..8fc764a 100644 --- a/avr/src/avrtest.c +++ b/avr/src/avrtest.c @@ -3,13 +3,13 @@ #include #ifndef F_CPU - #warning "F_CPU wasn't set in makefile, so we do it now with 8.0 MHz" - #define F_CPU 1000000UL + #warning "F_CPU wasn't set in makefile, so we do it now with 10.0 MHz" + #define F_CPU 10000000UL #endif // setting baud rate -#define BAUD 4800UL +#define BAUD 9600UL // uart baud rate checks #define UBRR_VAL ((F_CPU+BAUD*8)/(BAUD*16)-1) @@ -17,7 +17,7 @@ #define BAUD_ERROR ((BAUD_REAL*1000)/BAUD) #if ((BAUD_ERROR<990) || (BAUD_ERROR>1010)) - #error baudrate error higher than 1%! + #warning baudrate error higher than 1%! #endif