XJTAG 4.3 introduces extended CALL functionality in XJEase.
It is now possible to make CALLs using non-constant device reference and function name arguments. CALLs can now also be made from test device files.
A new built-in function has been added so device reference and function name parameters can be checked for validity before being used to avoid runtime errors.
Example turning on all LEDs that may or may not exist in the current project:
STRING[] LedDevices := {"XJDemo.D1", "XJDemo.D2", "XJDemo.D3", "XJDemo.D4", "XJDemo.D5", "XJDemo.D6", "XJDemo.D7", "XJDemo.D8", "XJDemo.D9", "XJDemo.D10", "XJDemo.D11", "XJDemo.D12"}; STRING LedFunction := "SetLED"; FOREACH STRING LedDevice IN LedDevices IF FUNCTION_EXISTS(LedDevice, LedFunction) THEN CALL(LedDevice, LedFunction)(0); END; END;
In the Demo Board v4 project this would turn on D1 – D9.
Note that it is best practice to include the board as part of the device name, particularly when there is more than 1 board in the project to avoid device reference ambiguity.
Leave A Comment