As some of you may know, Atmel provides a software framework (mainly as part of Atmel Studio) that provides drivers and examples and is updated on a more or less regular basis.
In a recent update they explicitly point out, that it is important to manually clear the overflow interrupt flag in the interrupt callback function.
// * \subsection xmega_tc_qs_ovf_setup_code Example code
// *
// * Add a callback function that will be executed when the overflow interrupt
// * trigger.
// * \code
static void my_callback(void)
{
// User code to execute when the overflow occurs here
// THIS WAS ADDED IN LAST UPDATE
// Important to clear Interrupt Flag
tc_clear_overflow(&TCC0);
// THIS WAS ADDED IN LAST UPDATE
}
//\endcode
According to the XMEGAA data sheet:
OVFIF is automatically cleared when the corresponding interrupt vector is executed. The flag can also be cleared by writing a one to its bit location.
Is there a scenario/reason where manually clearing the flag may be required?