Gast
#4467984
Hallo, ich versuche gerade die UART Schnittstelle eines ATMega32 anzusprechen. ein Zeichen kann ich bereits versenden, allerdings noch keinen String. kann mir jemand sagen was ich falsch mache? Bin absolute Anfängerin... es kommt golgende Fehlermeldung: ../main.c:73:4: warning: implicit declaration of function ‘uart_putc’ Building target: Test.elf Invoking: AVR C++ Linker avr-g++ -Wl,-Map,Test.map,--cref -mrelax -Wl,--gc-sections -mmcu=atmega32 -o "Test.elf" ./main.o ../main.c: At top level: ../main.c:79:6: warning: return type of ‘main’ is not ‘int’ ../main.c: In function ‘main’: ../main.c:82:2: warning: implicit declaration of function ‘uart_init’ ./main.o: In function `uart_puts': main.c:(.text.uart_puts+0x16): undefined reference to `uart_putc' ./main.o: In function `main': main.c:(.text.main+0x6): undefined reference to `uart_init' collect2: ld returned 1 exit status make: *** [Test.elf] Error 1 **** Build Finished **** #include <avr/io.h> #include <inttypes.h> #include <util/delay.h> void ADC_Init(void) { void USART_Transmit( unsigned char data ) { /* Wait for empty transmit buffer*/ while ( !( UCSRA & (1<<UDRE)) ); /* Put data into buffer, sends the data*/ UDR = data; } void uart_puts( char *s ) { /* while *s != '\0' so unequally "string-end characters (terminator) */ while (*s) { uart_putc(*s); s++; } } void main(void) { USART_Init(0x67); uart_init(); while(1) { USART_Transmit('B'); _delay_ms(10000); uart_puts("Hallo"); } }