PreviousNext
Init
Help > Custom DPA Handler > Events > Init

This event is called just before the main loop starts after Reset event i.e. where the [N] might be (un)bonded. Also, Enumerate Peripherals is called before this event is raised in order to find out the hardware profile ID (HWPID). Immediately after the event is processed the Autoexec is executed. 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.

 

Example

 

 case DpaEvent_Init:

       myVariable = 123;

                T6CON = 0b0.0110.1.00;

                TMR6IE = 1;

                return Carry;

 

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