STVD+cosmic怎么调用外部函数?

[复制链接]
 楼主| wanzhilin88 发表于 2015-8-2 17:33 | 显示全部楼层 |阅读模式
#include    "all.h"

Byte_8Bit    Test0;

main()
{
    Uart_Init();
//    Int_Init();
   
    _Bool    TestBit=1;
    Test0.bit0=1;
    PA_CR1=0x00;
    PA_CR2=0x00;
   
    while (1)
    {
        nop();
    }
}


我在另外一个C文件中写的Uart_Init();但是为什么编译时会报错:

#error cpstm8 main.c:14(12) missing ;
main.c:
The command: "cxstm8 +mods0 +debug -pxp -no -pp -l -i"C:\Program Files\COSMIC\CXSTM8\Hstm8" -i"C:\Program Files\COSMIC\CXSTM8\Hstm8"  -clDebug\ -coDebug\ main.c" has failed, the returned value is: 1
exit code=1.
//======================================================================
把这两句都屏蔽掉就不会报错了   
//    Uart_Init();
//    Int_Init();  

另外一个C文件中写的:
/*******************************************************************************
Function:
Description:
*******************************************************************************/
void    Uart_Init(void)
{
   
    return;
}


//================================================================
并且不有头文件中声明为外部函数:
extern    void    Uart_Init(void);


大家帮我分析一下


 楼主| wanzhilin88 发表于 2015-8-2 17:34 | 显示全部楼层
已经在头文件中申明为外部函数
extern        void        Uart_Init(void);
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:书山有路勤为径 学海无涯苦作舟

43

主题

127

帖子

3

粉丝
快速回复 在线客服 返回列表 返回顶部
个人签名:书山有路勤为径 学海无涯苦作舟

43

主题

127

帖子

3

粉丝
快速回复 在线客服 返回列表 返回顶部