本帖最后由 eltonchang2001 于 2022-12-12 13:32 编辑
一,error c267:delay_10us’: requires ANSI-style prototype问题解决方法:
1.未进行 模块化程序设计时,delay_10us该子函数要在主函数前;
2.在进行 模块化程序设计时,这是由于.c文件里函数在.h没有定义的问题;
二,error c236:‘smg_display’:different length of parameter lists(参数列表的长度不同)检查开始的函数声明和这定义的参数是否一致。
.c文件里的函数定义:

.h文件里的函数声明:

不一致,报错:App\smg\smg.c(9): error C236: ‘smg_display’: different length of parameter lists
改为 问题解决;
三,error C174: return-expression on void-function
void 型函数不能return 一个值。
解决办法:将void定义改为int或char型(类似的,图中u8即typedef unsigned char)定义即可

四,keil会自动识别工程目录下的.h文件;但对于不在工程目录而在新建的工程子文件夹下的.h文件,则需要手动进行添加对应路径的操作
|