Writing application code

In the Components view, expand the TU1: TimerUnit_LDD component's list of events and methods. To view the source code of the TU1_OnCounterRestart in editor, select it and right-click on it to select View Code option from context menu.

Insert the following line into the TU1_OnCounterRestart event handler function body:

GPIO1_ToggleFieldBits(GPIO1_DeviceData, LedPin, 1);
Note: The first parameter of LDD component methods is the LDD_TDeviceData structure pointer. If the component is set to Auto initialization: yes as in this example, then there is generated a {component_name}_DeviceData constant that can be used. If not, it is up to the user to call the Init method first and then use the returned pointer as the first parameter.
Figure 1. Inserted command