Linking Generated Code with External Data Types : External User-Defined Subroutines

External User-Defined Subroutines

You can have an external user subroutine in your MicroC model. To define a subroutine to be external, set the Selected Implementation to External Code/None. In this case, MicroC generates only the call to the subroutine—not the prototype or body.

When a user-defined function is not defined in the model (that is, unresolved text) the code generator does not generate a prototype for that function. To generate an external user defined function prototype in the model, complete the following steps:

1.
2.
3.
Set the design attribute for the user-defined function “External Function” to “yes.” The OSI's mainloop_sc and mainloop_sc_ext has that attribute for functions.