2014-09-24 09:34 AM
hi every body
i declared a void function[CODE]void SPI_MFRC522_Init(void){..............}[/CODE]& used it in a main program[CODE]void RC522_IO_Init(void){ GPIO_InitTypeDef GPIO_InitStruct; RCC_APB2PeriphClockCmd(RC522_RESET_GPIO_CLK,ENABLE); GPIO_InitStruct.GPIO_Pin = RC522_RESET_PIN; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(RC522_RESET_GPIO_PORT, &GPIO_InitStruct);[B][COLOR=''&sharpFF0000''] SPI_MFRC522_Init(void);[/COLOR][/B]}[/CODE]and keil shows me this 2 error:&sharp29:expected an expression &sharp140:too many arguments in function call #keil #stm32f1032014-09-24 11:35 AM
That is a general C language issue.
''void'' is not a valid argument when calling a function. And second ''void'' means (in this context) that a function takes no arguments. Therefore the compiler correctly complains about ''too much arguments''.2014-09-25 12:51 AM
Hi Mahmoud,
You've just to call your function as follows:SPI_MFRC522_Init();
Regards,
Heisenberg.
2014-09-26 12:00 AM
You've just to call your function as follows: ...
Perhaps you should add a special subforum, dedicated to basic C language teachings and questions ...