I,m read all solution but I'm still confuse
in my program like this
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include <stdio.h>
#include <buffer.h>
#include <global.h>
#include <uart2.h>
#include <avrlibdefs.h>
#include <avrlibtypes.h>
I already linked this program on M file
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c uart2.c
but still there is error when I compile
Compiling C: uart2.c
avr-gcc -c -mmcu=atmega16 -I. -gstabs -DF_CPU=11059200UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./uart2.lst -std=gnu99 -Wundef -MMD -MP -MF .dep/uart2.o.d uart2.c -o uart2.o
uart2.c: In function 'uart0Init':
uart2.c:60: error: 'UCSR0B' undeclared (first use in this function)
uart2.c:60: error: (Each undeclared identifier is reported only once
uart2.c:60: error: for each function it appears in.)
uart2.c: In function 'uart1Init':
uart2.c:79: error: 'UCSR1B' undeclared (first use in this function)
uart2.c: In function 'uart0InitBuffers':
uart2.c:95: warning: pointer targets in passing argument 2 of 'bufferInit' differ in signedness
uart2.c:96: warning: pointer targets in passing argument 2 of 'bufferInit' differ in signedness
uart2.c: In function 'uart1InitBuffers':
uart2.c:108: warning: pointer targets in passing argument 2 of 'bufferInit' differ in signedness
uart2.c:109: warning: pointer targets in passing argument 2 of 'bufferInit' differ in signedness
uart2.c: In function 'uartSetBaudRate':
uart2.c:133: error: 'UBRR1' undeclared (first use in this function)
uart2.c:140: error: 'UBRR0' undeclared (first use in this function)
uart2.c: In function 'uartSendByte':
uart2.c:166: error: 'UCSR1A' undeclared (first use in this function)
uart2.c:167: error: 'UDR1' undeclared (first use in this function)
uart2.c:171: error: 'UCSR0A' undeclared (first use in this function)
uart2.c:172: error: 'UDR0' undeclared (first use in this function)
uart2.c: In function 'uartTransmitService':
uart2.c:306: error: 'UDR1' undeclared (first use in this function)
uart2.c:308: error: 'UDR0' undeclared (first use in this function)
uart2.c: In function 'uartReceiveService':
uart2.c:332: error: 'UDR1' undeclared (first use in this function)
uart2.c:334: error: 'UDR0' undeclared (first use in this function)
uart2.c: At top level:
uart2.c:356: warning: 'SIG_UART0_TRANS' appears to be a misspelled signal handler
uart2.c:362: warning: 'SIG_UART1_TRANS' appears to be a misspelled signal handler
uart2.c:368: warning: 'SIG_UART0_RECV' appears to be a misspelled signal handler
uart2.c:374: warning: 'SIG_UART1_RECV' appears to be a misspelled signal handler
make.exe: *** [uart2.o] Error 1
I'm still confuse what mistake I make.. I hope somebody can give me solution....