We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello!In the program, I decided to redo some of the functions and added the structure:
typedef struct { GPIO_TypeDef * GPIOx; uint16_t PINx; }GPIO_PINdef;
Previously, the function looked like this: void GPIO_InitPIN(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin_x)
Now it looks like this: void GPIO_InitPIN(GPIO_PINdef GPIOx)
So here is the question, calling a new function now works both in the old and new way, i.e. to call a function in this form: GPIO_InitPIN(GPIOB, GPIO_Pin_8)
and in this form:
GPIO_PINdef SPI_CS;GPIO_InitPIN(SPI_CS);the compiler does not swear and the program runs correctly.But everything was fine until I started getting rid of "warning" during compilation, namely "function" GPIO_InitPIN "declared implicitly".I copy the function description into the header file and after that everything stops working:void GPIO_InitPIN (GPIO_PINdef x); - adding this description in header file, swears that there are too many arguments when calling this function GPIO_InitPIN(GPIOB, GPIO_Pin_8)How can this function be written in the header file to get rid of "warning"?