Code: Select all
/*
* GPT3 configuration.
*/
static const GPTConfig gpt3cfg = {
10000, /* Timer clock.*/
gpt3Callback, /* Timer callback.*/
0,
0
};
/* callback */
static void gpt3Callback( GPTDriver *gptp )
{
(void)gptp;
palTogglePad( GPIOE, GPIOE_AMB_LED );
}
/* Timer Started by calling */
gptStart( &GPTD3, &gpt3cfg );
gptStartContinuous( &GPTD3, 100 );
Issue is the expected frequency of the callback is not correct. I'm expecting it to be 100Hz, but it is around 101/102Hz.
Ive also tried this in a thread and i get the same error, the led toggles at 101/102Hz.
Code: Select all
while( TRUE )
{
chThdSleepMilliseconds( 10 );
palTogglePad( GPIOE, GPIOE_AMB_LED );
}
Register settings for Timer 3