Exactly! It could be made simpler. That is the crux of the matter.

You are right i didn't show where i am setting LED0_UPDATE. these flags themselves, at the right time based on certain parameters, are set by other isr running in parrallel with the heartbeat timer

thanks for the reply