PreviousNext
Init
Help > Custom DPA Handler > Events > Init

This event is called just before the main loop starts after the Reset event i.e. where the [N] might be (un)bonded. Also, Enumerate Peripherals is called before this event is raised to find out the hardware profile ID (HWPID). This event is typically used to initialize peripherals and global variables. If the initialization is needed as soon as possible and even if the device is not bonded yet then it can be implemented inside the 1st call of a Reset event. Make sure the Init event is processed quickly especially when the [N] was bonded in the Reset event (NodeWasBonded indicates the [N] was just bonded) to process Ping FRC issued by [C] to verify the [N] is bonded.

 

Example

 

 case DpaEvent_Init:

       myVariable = 123;

                T6CON = 0b0.0110.1.00;

                TMR6IE = 1;

                return Carry;

 

☼ See example code CustomDpaHandler-Timer.c for more details.