Custom Wrapper Utility Functions
Descriptions of custom wrapper utility functions.
The following function is used to incrementally add code-snippets to the source main.c stored in the string variable mainc.
mainc=vssWrapperGetBlocksCode(mainc,wparams,keyword,indent)
The function takes the current mainc and updates it by including the code snippets associated with the given keyword provided by the block wparams parameter. The indent argument is used to added indentation for the added code.
The following utility function is similar but applies to sysparams of the block.
mainc=vssWrapperGetSystemCode(mainc,sysparams,keyword)
The system-level code associated with the keyword is added to mainc.
To set the main loop frequency, it is often necessary to add wait time to slow down the loop. The following utility function provides a function to add wait time.
mainc=vssWrapperGenerateWaitUntil(mainc)
The variable mainc is updated by including the definition of the C function waituntil.
The following utility function is used to set and get the period of the main loop.
per = vssCGgetMainPeriod(per)
If it is called with no arguments, it returns the period. If it is used with an input argument, the period is set to the value of the argument.
The usages of these utility functions will be illustrated through the RaspberryPi target code generator example presented below.