我前几天刚用51的做了个240128的液晶屏显示程序,完全可行。可是现在改用16F877A的,发现头文件有的没有,反正问题不小,现在是有很多警告,下面的数组全是警告如下:(我还是头一次看到这种数组,带中文的)
typedef struct typFNT_GB16 // 汉字字模数据结构 { char Index[2]; char Msk[32]; };
bank2 struct typFNT_GB16 GB_16[] = { "风",0x00,0x00,0x1F,0xF8,0x10,0x08,0x10,0x48,0x14,0x68,0x12,0x48,0x11,0x48,0x10,0x88, 0x10,0x88,0x11,0x48,0x12,0x6A,0x24,0x2A,0x28,0x26,0x40,0x06,0x80,0x02,0x00,0x00,
"机",0x10,0x00,0x10,0xF8,0x10,0x88,0xFE,0x88,0x10,0x88,0x10,0x88,0x38,0x88,0x34,0x88, 0x54,0x88,0x50,0x88,0x91,0x08,0x11,0x0A,0x12,0x0A,0x12,0x0A,0x14,0x06,0x10,0x00,
"电",0x01,0x00,0x01,0x00,0x01,0x00,0x3F,0xF8,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08, 0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x01,0x02,0x01,0x02,0x00,0xFE,0x00,0x00,
"太",0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x7F,0xFE,0x01,0x00,0x01,0x00,0x01,0x00, 0x02,0x80,0x02,0x40,0x04,0x20,0x05,0x10,0x08,0x98,0x10,0xCC,0x20,0x86,0x40,0x04, 以下是错误信息:
Build C:pic877lcd for device 16F877A Using driver C:Program FilesHI-TECH SoftwarePICCstd9.60inpicc.exe
Executing: "C:Program FilesHI-TECH SoftwarePICCstd9.60inpicc.exe" -q -g --asmlist --chip=16F877A "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s" -P --char=unsigned -C C:pic877lcd.c Warning [340] C:pic877lcd.c; 126.1 string not terminated by null character. Warning [340] C:pic877lcd.c; 129.1 string not terminated by null character. Warning [340] C:pic877lcd.c; 132.1 string not terminated by null character. Warning [340] C:pic877lcd.c; 135.1 string not terminated by null character. Warning [340] C:pic877lcd.c; 138.1 string not terminated by null character. Warning [340] C:pic877lcd.c; 141.1 string not terminated by null character. Warning [340] C:pic877lcd.c; 144.1 string not terminated by null character. 还只是一部份。
原在51的头文件:
#include "STC12C5410AD.H" #include "absacc.h" #include "stdarg.h" #include "intrins.h" #include "math.h" #include "stdio.h"
改为
#include "pic.h" //#include "absacc.h" #include "stdarg.h" #include "intrins.h" #include "math.h" #include "stdio.h" 反正有好几个没有/。
dprintf(0,5,"DC: 24V P:0000W"); dprintf(0,6,"I:000A F:50.0Hz");
上面的我的显示时的函数,这里也是有警告 如下:
Warning [359] C:pic877lcd.c; 624.44 illegal conversion between pointer types Warning [359] C:pic877lcd.c; 625.45 illegal conversion between pointer types
望高手帮我看看!谢谢,
Warning [340] C:pic877lcd.c; 138.1 string not terminated by null character.
这个是说字符串没有以NULL结束,对程序没有什么影响
Warning [359] C:pic877lcd.c; 625.45 illegal conversion between pointer types 这个是说指针类型不符合,不知道函数的声明是怎么样的
我在定义数组前面加了const,还在涵数定义指针前面也加了,错误少了不少。可是还有数组有汉字那行
"风",0x00,0x00,0x1F,0xF8,0x10,0x08,0x10,0x48,0x14,0x68,0x12,0x48,0x11,0x48,0x10,0x88,
只要有汉字的就有警告,估计是PICC不认汉字吧。也可能要加什么头文件,哎,,,搞得很郁闷。我在写51时算法都可以实现,而且程序都写好了,现在都有点想放弃PIC了。 望PIC人士出来讲解一下。
|
|