This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can I call void function with parameters ?

void PWM_Config(uint8_t TIM_PERIOD, uint8_t TIM_PULSE)
{
.
.
.
}

int main()
{

TIMConfig();   // THIS LINE SHOWS AN ERROR

.
.
.
}

ERROR LIST:

main.c(251): error: #165: too few arguments in function call PWM_Config();

BUT, If I write the program below, there is an no error

void PWM_Config()
{
.
.
.
}

int main()
{

TIMConfig();   // THIS LINE SHOWS AN ERROR

.
.
.
}

KINDLY HELP!

Parents
  • Any reason the functions have different names?

    The required syntax is pretty well defined in the language documentation, it doesn't change just because it is inconvenient for you. And the compiler is pretty good at spotting these types of error.

Reply
  • Any reason the functions have different names?

    The required syntax is pretty well defined in the language documentation, it doesn't change just because it is inconvenient for you. And the compiler is pretty good at spotting these types of error.

Children