stm32f107vc vApplicationIdleHook function undeclared

General discussion on mikroC PRO for ARM.
Post Reply
Author
Message
design4
Posts: 93
Joined: 29 Aug 2019 10:43

stm32f107vc vApplicationIdleHook function undeclared

#1 Post by design4 » 21 May 2020 04:54

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.

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: stm32f107vc vApplicationIdleHook function undeclared

#2 Post by stefan.filipovic » 21 May 2020 14:50

Hi,

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++;
}
Read more about vApplicationIdleHook here:
https://www.freertos.org/wp-content/upl ... _Guide.pdf

Kind regards,
Stefan Filipović

design4
Posts: 93
Joined: 29 Aug 2019 10:43

Re: stm32f107vc vApplicationIdleHook function undeclared

#3 Post by design4 » 22 May 2020 03:17

stefan.filipovic wrote:
21 May 2020 14:50
Hi,

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++;
}
Read more about vApplicationIdleHook here:
https://www.freertos.org/wp-content/upl ... _Guide.pdf

Kind regards,
Hello,

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 );
above this code

Code: Select all

static portTASK_FUNCTION( prvIdleTask, pvParameters )
.

Then you can call its in main or other places.

Kind regards.

Post Reply

Return to “mikroC PRO for ARM General”