Erorr库配置文件

Erorr库配置文件

问题描述:

// Created by lenovo on 8/27/2017. 
// 

#ifndef UART_UART_CFG_H 
#define UART_UART_CFG_H 

#define UART_BaudRate  1200 //9600UL 
#define CLK    16 
#define UART_Parity  NONE 
#define UART_TX   EN_TX 
#define UART_RX   EN_RX 
#define UART_STARTBITS  1 
#define UART_STOPBITS  1 
#define UART_DATABITS EightBits 

#endif //UART_UART_CFG_H 

enter image description here 此称为对象的错误不是一个函数或指针 并具有配置文件,第一个文件中的所有单词的地址,这是我的私人文件,Erorr库配置文件

// 
// Created by lenovo on 8/27/2017. 
// 

#ifndef UART_UART_PRIV_H 
#define UART_UART_PRIV_H 

/* Main PINS */ 
#define UCSRA *((volatile u8 *)0x2B) 
#define UCSRB *((volatile u8 *)0x2A) 
#define UCSRC *((volatile u8 *)0x40) 
#define UBRRL *((volatile u8 *)0x29) 
#define UBRRH *((volatile u8 *)0x40) 
#define UDR *((volatile u8 *)0x2C) 
/* END Main PINS */ 
#define NONE  0x00 
#define twoBit  0x08 
#define oneBit  0x00 
/* Bits */ 
#define fiveBits 0x00 
#define SixBits  0x02 
#define SevenBits 0x04 
#define EightBits 0x06 
/* End Bits */ 
#define DIS   0 // Disable 
#define EN   1 // Enable 

#define UART_9600 9600UL 
#endif //UART_UART_PRIV_H 

私人文件,有我的微控制器ATmega16一些地址。此外,我的配置文件是私人文件的引用;其中有私钥定义的密钥,例如,在UART_Partit中,我写了私人定义的NONE和NONE地址,但它显示错误

+0

我敢打赌,Atmel Studio中的“输出”选项卡带有相同的错误信息和更多有用的诊断信息,以复制和可复制的文本形式发布,错误文本。 – Clifford

+0

在帖子中完成了图片 –

+0

你能帮我解决这个问题吗? –

您需要在声明中包含您的文件。

#ifndef UART_UART_CFG_H 
#define UART_UART_CFG_H 

#include "uart_priv.h" 

#define UART_BaudRate  1200 //9600UL 
#define CLK    16 
#define UART_Parity  NONE 
#define UART_TX   EN_TX 
#define UART_RX   EN_RX 
#define UART_STARTBITS  1 
#define UART_STOPBITS  1 
#define UART_DATABITS EightBits 

#endif //UART_UART_CFG_H 

并且在第二个文件中没有为这些常量定义EN_TX或EN_RX。

+0

EN_TX和EN_RX是主程序中的宏,用于检查其EN_TX或EN_RX是否在形式如下#if和#endif –

+1

@MohannedKandil:很显然,EN_TX,EN_RX的定义在它们(或它们的别名UART_TX,UART_RX)被使用。您需要发布原始构建日志(从“输出”选项卡),而不是IDE过滤的消息 - 这会隐藏有用的诊断信息。 – Clifford