@CHIP-RTOS C Library V2.06 - Helper Functions
helper_printf
Formatted console output function like the standard
library printf function. int helper_printf ( const char *fmt, ... ); Parameters
fmt
- Format specifier string. Note: Floating
point types are not suppported by this implementation.
Return Value
- Number of characters output to console. (If @Chip-RTOS version does
not support this function, then this return value will always be zero.)
Comments
- Using this function instead of the standard library printf
will reduce a program's memory requirements.
WARNING for small and medium memory models:
Pointers which are passed to this function after the
first declared argument must be explicitly cast as type "far".
(Compiler has no clue about these additional arguments
so your help is needed.) For example:
helper_printf(format, (char far *)string);
The exception to this rule are pointers
for display with the %p format. These are taken as long by default
(regardless of your program's memory model) and can be specified explicitly
as near with the N input format modifier, in which case you should only
pass a 16 bit pointer. See your compiler's printf
documentation for more details.
CAUTION:
When this function is used with SC1x @Chip-RTOS versions prior to
version 1.20 a stack buffer will overflow if the total number of
characters headed to the console exceeds 179 characters. For
subsequent @Chip-RTOS versions there is no such limitation.
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
Supported since or modified in @CHIP-RTOS version-
SC12 | SC13 | SC11 | SC1x3 |
-
V1.20 | V1.20 | V1.20 | V0.91 |
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|