|
Берем простенькую прогу из AN AVR306: Using the AVR® UART in C
// AVR306: Using the AVR UART in C
// Routines for polled UART
// Last modified: 02-06-21
// Modified by: AR
/* Includes */ /* Prototypes */ /* Main - a simple test program*/ for(;;) /* Forever */ /* Initialize UART */ /* Read and write functions */ void TransmitByte( unsigned char data ) при компиляции выдает ошибки: Errors: 4 Done. 4 error(s), 0 warning(s) если вставить вручную описания битов, то все нормально компилится
E-mail:
info@telesys.ru
#include
void InitUART( unsigned char baudrate );
unsigned char ReceiveByte( void );
void TransmitByte( unsigned char data );
void main( void )
{
InitUART( 11 ); /* Set the baudrate to 19,200 bps using a 3.6864MHz crystal */
{
TransmitByte( ReceiveByte() ); /* Echo the received character */
}
}
void InitUART( unsigned char baudrate )
{
UBRR = baudrate; /* Set the baud rate */
UCR = ( (1<
unsigned char ReceiveByte( void )
{
while ( !(USR & (1<
return UDR;
}
{
while ( !(USR & (1<
UDR = data; /* Start transmittion */
}
IAR Atmel AVR C/EC++ Compiler V3.10C/W32
Copyright 1996-2004 IAR Systems. All rights reserved.
Error[Pe020]: identifier "RXEN" is undefined
Error[Pe020]: identifier "TXEN" is undefined
Error[Pe020]: identifier "RXC" is undefined
Error[Pe020]: identifier "UDRE" is undefined
Warnings: none
Как с этим бороться???
Ответы