Hi,
Im having issue with idle function. Im using RTOS for easypromxv7. I already define configUSE_IDLE_HOOK in freeRTOS config with value 1 and call vApplicationIdleHook() function in main. I got error when compile said that undeclared identifier '_void vApplicationIdleHook' in expression. Then I try put vApplicationIdleHook() function in tasks.c then got another error said call signature does not match the function definition signature 'vApplicationIdleHook'. When I used this in eclipse, it works fine. But in MikroC IDE it doesnt. Please help me
Thanks in advanced.
stm32f107vc vApplicationIdleHook function undeclared
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: stm32f107vc vApplicationIdleHook function undeclared
Hi,
Try putting this in tasks.c:
Read more about vApplicationIdleHook here:
https://www.freertos.org/wp-content/upl ... _Guide.pdf
Kind regards,
Try putting this in tasks.c:
Code: Select all
/* Declare a variable that will be incremented by the hook function. */
volatile uint32_t ulIdleCycleCount = 0UL;
/* Idle hook functions MUST be called vApplicationIdleHook(), take no parameters,
and return void. */
void vApplicationIdleHook( void )
{
/* This hook function does nothing but increment a counter. */
ulIdleCycleCount++;
}
https://www.freertos.org/wp-content/upl ... _Guide.pdf
Kind regards,
Stefan Filipović
Re: stm32f107vc vApplicationIdleHook function undeclared
Hello,stefan.filipovic wrote: ↑21 May 2020 14:50Hi,
Try putting this in tasks.c:Read more about vApplicationIdleHook here:Code: Select all
/* Declare a variable that will be incremented by the hook function. */ volatile uint32_t ulIdleCycleCount = 0UL; /* Idle hook functions MUST be called vApplicationIdleHook(), take no parameters, and return void. */ void vApplicationIdleHook( void ) { /* This hook function does nothing but increment a counter. */ ulIdleCycleCount++; }
https://www.freertos.org/wp-content/upl ... _Guide.pdf
Kind regards,
Thanks for the idea. I found out that there is no declaration of "vApplicationIdleHook" function in tasks.c before calling extern "vApplicationIdleHook" function. It is compulsary to adding this code
Code: Select all
void vApplicationIdleHook( void );
Code: Select all
static portTASK_FUNCTION( prvIdleTask, pvParameters )
Then you can call its in main or other places.
Kind regards.