PreviousNext
uns16 DpaTicks
Help > Custom DPA Handler > DPA API Variables > uns16 DpaTicks

Implemented at [C] device only. The value of this variable is decremented every 10 ms after the Init event. The variable is driven by TMR6 driven by an internal PIC RC oscillator. The variable can be used for the implementation of timing algorithms. As this 2-byte wide variable is modified internally within the CPU interrupt routine the whole (both 2 bytes) variable should be accessed (either read or written) only when an interrupt is disabled to ensure atomic access.

 

Example

 

case DpaEvent_Idle:

       // Is the timeout over?

       if ( DpaTicks.15 != 0 )

       {

              // Setup new 10s timeout

              GIE = 0;

              DpaTicks = 10 * 100L;

              GIE = 1;

 

☼ See example codes CustomDpaHandler-Coordinator-PulseLEDs.c for more details.