dvdouden - 2013-08-20

Thanks for the contribution Linkmar! The reason a few bytes of RAM were sacrificed is to ensure a constant number of clock cycles between the start of the interrupt and the toggling of the output pin. Not that it matters much, your approach makes the pause a few clock cycles longer and the pulse a bit shorter (for software toggled pins). Still this is no problem since only the time between two pulses is important, not the duration of the pulse itself.

The following might even be a bit faster/shorter:

OCR1A += m_timings[m_timingPos & 1 ? ((m_timingPos >> 1) + 1) : 0];

Created ticket [#60]

 

Related

Tickets: #60