OpenEdv-开源电子网

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

字库问题

[复制链接]

32

主题

83

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
385
金钱
385
注册时间
2011-11-21
在线时间
32 小时
发表于 2012-3-14 15:56:52 | 显示全部楼层 |阅读模式

(1)字库问题
 编写字库头文件:#ifndef __ZIKU_H__
unsigned char code guang[]={
0x00,0x00,0xFC,0x04,0x04,0x04,0x04,0x05,0x06,0x04,0x04,0x04,0x04,0x04,0x04,0x00,
0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
}                      //广
unsigned char code zhou[]={
0x00,0xE0,0x00,0x00,0xFF,0x20,0xC0,0x00,0xFE,0x10,0x60,0x80,0x00,0xFF,0x00,0x00,
0x01,0x80,0x60,0x18,0x07,0x00,0x00,0x00,0x7F,0x00,0x00,0x01,0x00,0xFF,0x00,0x00,
}                    //州
unsigned char code hui[]={
0x00,0x02,0x02,0xFA,0xAA,0xAA,0xAA,0xFF,0xAA,0xAA,0xAA,0xFA,0x02,0x02,0x00,0x00,
0x00,0x42,0x72,0x02,0x3A,0x42,0x42,0x4B,0x52,0x42,0x62,0x02,0x13,0x66,0x00,0x00,
}                     //恵
unsigned char code he[]={
0x00,0x20,0x24,0x24,0x24,0xA4,0x64,0xFC,0x62,0xA2,0x22,0x23,0x22,0x30,0x20,0x00,
0x20,0x10,0x08,0x04,0x02,0x01,0x00,0xFF,0x00,0x01,0x02,0x0C,0x18,0x30,0x10,0x00,
}                     //禾
usigend char code dian[]={
0x00,0x00,0xF8,0x48,0x48,0x48,0x48,0xFF,0x48,0x48,0x48,0x48,0xF8,0x00,0x00,0x00,
0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0x3F,0x44,0x44,0x44,0x44,0x4F,0x40,0x70,0x00,
}                     //电
unsigned char code zi[]={
0x00,0x00,0x02,0x02,0x02,0x02,0x02,0xE2,0x12,0x0A,0x06,0x02,0x00,0x80,0x00,0x00,
0x01,0x01,0x01,0x01,0x01,0x41,0x81,0x7F,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
}                     //子
unsigned char code ke[]={
0x10,0x12,0x92,0x72,0xFE,0x51,0x91,0x00,0x22,0xCC,0x00,0x00,0xFF,0x00,0x00,0x00,
0x04,0x02,0x01,0x00,0xFF,0x00,0x04,0x04,0x04,0x02,0x02,0x02,0xFF,0x01,0x01,0x00,
}                    //科
unsigned char code ji[]={
0x08,0x08,0x88,0xFF,0x48,0x28,0x00,0xC8,0x48,0x48,0x7F,0x48,0xC8,0x48,0x08,0x00,
0x01,0x41,0x80,0x7F,0x00,0x40,0x40,0x20,0x13,0x0C,0x0C,0x12,0x21,0x60,0x20,0x00,
}                     //技
#endif
编译出现:ZIKU.H(7): error C141: syntax error near 'unsigned'
ZIKU.H(11): error C141: syntax error near 'unsigned'
ZIKU.H(15): error C141: syntax error near 'unsigned'
ZIKU.H(19): error C141: syntax error near 'usigend'
ZIKU.H(23): error C141: syntax error near 'unsigned'
ZIKU.H(27): error C141: syntax error near 'unsigned'
ZIKU.H(31): error C141: syntax error near 'unsigned'
(2)编译问题
#include"intrins.h"
#include"ZIKU.h"
#define LCD_DATA P2 //8 bit数据线

sbit RS=P0^0;    //数据/命令选择
sbit RW=P0^0;    //读写控制
sbit EN=P1^7;    //片选信号
sbit CS1=P0^3;
sbit CS2=P0^4;

//*****************************************************************
//函数名称:writeCmd(uchar value)写指令
//入口参数:value
//返回参数:无
//*****************************************************************
void WriteCmd(uchar value)
{
 ReadBusy();
 RS = 0;
 RW = 0;
 LCD_DATA=value;
 EN=1;
 _nop_();
 _nop_();
 EN=0; 
}
编译出现:
LCD_DRIVE.H(11): error C141: syntax error near 'sbit'
LCD_DRIVE.H(11): error C247: non-address/-constant initializer
LCD_DRIVE.H(22): error C141: syntax error near 'value', expected ')'

实在是想不通。

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

使用道具 举报

36

主题

1105

帖子

5

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
2195
金钱
2195
注册时间
2012-2-8
在线时间
34 小时
发表于 2012-3-14 16:22:45 | 显示全部楼层
数组定义后不用 ; 的吗?
犯这种错误,很不应该啊
https://github.com/roxma
回复 支持 反对

使用道具 举报

32

主题

83

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
385
金钱
385
注册时间
2011-11-21
在线时间
32 小时
 楼主| 发表于 2012-3-14 16:49:36 | 显示全部楼层
的确是,自己的疏忽
回复 支持 反对

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2024-11-22 11:14

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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