在线时间9 小时
UID345964
ST金币0
蝴蝶豆0
注册时间2012-3-7
初级会员
- 最后登录
- 2020-9-5
|
a0a.1 0b0c
在编译sd卡程序是出现以下错误,错误程序如下,求各位大侠帮助解决以下,谢谢啦
//发命令到SD卡
void SdCommand(u8 command, u32 argument, u8 CRC)
{
SdWrite(command|0x40);
SdWrite(((unsigned char *)&argument)[0]);
SdWrite(((unsigned char *)&argument)[1]);
SdWrite(((unsigned char *)&argument)[2]);
SdWrite(((unsigned char *)&argument)[3]);
SdWrite(CRC);
}
User\SD.c(64): error: #79: expected a type specifier
User\SD.c: void SdCommand(u8 command, uc32 argument, u8 CRC)
User\SD.c: ^
User\SD.c(64): error: #90: function returning function is not allowed
User\SD.c: void SdCommand(u8 command, uc32 argument, u8 CRC)
User\SD.c: ^
User\SD.c(64): error: #141-D: unnamed prototyped parameters not allowed when body is present
User\SD.c: void SdCommand(u8 command, uc32 argument, u8 CRC)
User\SD.c: ^
User\SD.c(72): error: #167: argument of type "CRC_TypeDef *" is incompatible with parameter of type "unsigned char"
User\SD.c: SdWrite(CRC);
User\SD.c: ^
User\SD.c(88): error: #167: argument of type "int" is incompatible with parameter of type " (*)(CRC_TypeDef *)"
User\SD.c: SdCommand(0x00,0,0x95);
User\SD.c: ^
User\SD.c(103): error: #167: argument of type "int" is incompatible with parameter of type " (*)(CRC_TypeDef *)"
User\SD.c: SdCommand(0x01,0x00ffc000,0xff);
User\SD.c: ^
User\SD.c(78): warning: #177-D: variable "delay" was declared but never referenced
User\SD.c: int delay=0, trials=0;
User\SD.c: ^
User\SD.c(78): warning: #177-D: variable "trials" was declared but never referenced
User\SD.c: int delay=0, trials=0;
User\SD.c: ^
User\SD.c(122): error: #167: argument of type "int" is incompatible with parameter of type " (*)(CRC_TypeDef *)"
User\SD.c: SdCommand(0x18,address,0xff);
User\SD.c: ^
User\SD.c(170): error: #167: argument of type "int" is incompatible with parameter of type " (*)(CRC_TypeDef *)"
User\SD.c: SdCommand(0x11,address,0xff); |
|