Constant sam4l::ast::ALARM0_SYNC_TICS [] [src]

const ALARM0_SYNC_TICS: u32 = 8

Minimum number of clock tics to make sure ALARM0 register is synchronized

The datasheet has the following ominous language (Section 19.5.3.2):

Because of synchronization, the transfer of the alarm value will not happen immediately. When changing/setting the alarm value, the user must make sure that the counter will not count the selected alarm value before the value is transferred to the register. In that case, the first alarm interrupt after the change will not be triggered.

In practice, we've observed that when the alarm is set for a counter value less than or equal to four tics ahead of the current counter value, the alarm interrupt doesn't fire. Thus, we simply round up to at least eight tics. Seems safe enough and in practice has seemed to work.