OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 4621|回复: 2

STM32+UCGUI移植,关于gui手册第六章例程编译错误。。求助

[复制链接]

83

主题

349

帖子

1

精华

高级会员

Rank: 4

积分
908
金钱
908
注册时间
2012-8-10
在线时间
13 小时
发表于 2013-11-20 21:58:27 | 显示全部楼层 |阅读模式

事情是这个样子,小最近在练习GUI手册的例程,在第六章的2d图形库中有如下例程,完整源码如下:


 

上面是完整的例程。出于编写的需要,我特地把这个函数写成一个practice模块,然后再主函数调用这个例程,

模块:practice.c代码如下:

#include"practice.h"
#include "GUI.h"

 

//const GUI_POINT aPoints[]={
//// {0,20},
//// {40,20},
//// {20,0}
//};

GUI_POINT aEnlargedPoints[countof(aPoints)];

/*    第六章 2D图形库练习   */
void Sample(void)
{
     int i;
     GUI_Clear();
     GUI_SetDrawMode(GUI_DM_XOR);
     GUI_FillPolygon(aPoints,countof(aPoints),140,110);
     for(i=1;i<10;i++)
     {
          GUI_EnlargePolygon(aEnlargedPoints,aPoints,countof(aPoints),i*5);
          GUI_FillPolygon(aEnlargedPoints,countof(aPoints),140,110);
     }

}

practice.h代码如下:

#ifndef __PRACTICE_H__
#define __PRACTICE_H__

#include "sys.h"
#include"GUI.h"

#define countof(Array) (sizeof(Array)/sizeof[Array[0]]) //求数组的长度

extern const GUI_POINT aPoints[]={
 {0,20},
 {40,20},
 {20,0}
};

 

void Sample(void);

 

#endif

 

主函数代码:

#include <stm32f10x_lib.h>
#include "sys.h"
#include "usart.h"  
#include "delay.h" 

#include"practice.h"
//#include <math.h>
//#include"dialplate.h" /*界面接口函数*/
//#include "rtc.h"    /*实时时钟*/
 /*章节练习*/
#include "GUI.h"


int main(void)
{    
       Stm32_Clock_Init(9);//系统时钟设置
     delay_init(72);  //延时初始化
     uart_init(72,9600); //串口1初始化 
    // RTC_Init();
     
    // MainTask();
     Sample();

       while(1)    
     {

     }              
}

但是编译之后却出现如下警告:


貌似是在说我practice文件的某个函数需要一个符号表达,但是我go to define之后进去的gui的源文件,没发现有啥不妥,郁闷了一个晚上了,特来求助啊

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

83

主题

349

帖子

1

精华

高级会员

Rank: 4

积分
908
金钱
908
注册时间
2012-8-10
在线时间
13 小时
 楼主| 发表于 2013-11-20 22:08:34 | 显示全部楼层
                 这是源码,3.90a,原子的mini板  

3.5'TFT基于STM32的UCGUI界面调试_1.rar

32.67 MB, 下载次数: 68

回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2013-11-20 23:13:39 | 显示全部楼层
帮顶
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-7-8 22:28

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表