|
|||||||||||
Technical Support On-Line Manuals µVision User's Guide About µVision User Interface Creating Applications Utilities Debugging Debug Commands Debug Functions Creating Functions Invoking Functions Predefined Functions __acos __asin __atan __cos __exp __log __log10 __sin __sqrt __tan _RBYTE _RDOUBLE _RDWORD _RFLOAT _RWORD _sleep_ _TaskRunning_ _WBYTE _WDOUBLE _WDWORD _WFLOAT _WWORD exec execf (Cortex-M) F32ToRawF16 F32ToRawF32 F64ToRawF64 getdbl getint getlong memset printf rand RawF16ToF32 RawF32ToF32 RawF64ToF64 rwatch swatch twatch wwatch User Functions Signal Functions Differences Between µVision and C Simulation Flash Programming Dialogs Example Programs Command Line Appendix |
User FunctionsUser Functions are created by the developer and can be used for debugging within the µVision Debugger. Create user functions directly in the Command window or with the function editor. Refer to Creating Functions for details. System Variables can be used in user functions. User functions begin with the keyword FUNC and are defined as follows: FUNC return_type fname (parameter_list) { statements } Where
ExampleThe following user function displays the contents of several CPU registers. FUNC void MyRegs (void) { printf ("---------- MyRegs() ----------\n"); printf (" R4 R8 R9 R10 R11 R12\n"); printf (" %04X %04X %04X %04X %04X %04X\n", R4, R8, R9, R10, R11, R12); printf ("------------------------------\n"); } Invoke the function by typing the function name into the Command window. MyRegs() The function output could be: ---------- MyRegs() ---------- R4 R8 R9 R10 R11 R12 B02C 8000 0001 0000 0000 0000 ------------------------------ As an alternative, define a Toolbox button to invoke the user function: DEFINE BUTTON "My Registers", "MyRegs()" Restrictions
| ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.