资料介绍
keil错误集一、
main.c(35): warning: #128-D: loop is not reachable from preceding code
原因,前面有一个 while(1){ …….}
二、
main.c(54): warning: #1-D: last line of file ends without a newline
少了一个回车在}之后
改后是
三、
initSpi.c(6): error: #268: declaration may not appear after executable statement in block
改正 (定义 变量放前)
四、
错误原因之一,板子复位不正确
重新复位,或重新加电,
五、
下载时没找到文件,原因,有错可能没生成
六、
main.c(31): warning: #223-D: function "initNvic" declared implicitly
main.c(67): error: #159: declaration is incompatible with previous "initNvic" (declared at line 31)
出错原因,没在 main 前声明
七、SPI 相关错误集
7. 1我的错误,
用595做 spi 时,忘了 cs 片选 信号, 发送时如
Cs=0;
Send data;
Cs=1;
7. 2我一朋友的错,
第一步,初始化 gpio,第二步,初始化 Rcc,第三步 spi,结果没反应,
改正,顺序为,init RCC,init Gpio,init Spi
7.3 我另一朋友的错
初始化 Rcc 时,忘了对外设 spi 初始化
7. 4 还有一朋友
在初