- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all:
I want to use sprintf() in EZ USB Suite - FX3 FW, but it met compiler fail.
I've added "#include <stdio.h>", but it still fail...
Hope someone could provide any suggestion.
Thanks a lot!
Hughes
Solved! Go to Solution.
- Tags:
- fx3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please use the API CyU3PDebugStringPrint(); for implementing snprintf();. This API make use of following parameters as shown in its definition.
extern CyU3PReturnStatus_t
CyU3PDebugStringPrint (
uint8_t *buffer, /**< Buffer into which the data is to be printed. */
uint16_t maxLength, /**< Buffer size. */
char *fmt, /**< Format specifier string. */
... /**< Variable argument list. */
);
I have implemented your requirement as shown below.
char c1[20];
uint8_t n =5;
CyU3PDebugStringPrint ((uint8_t*)c1, 20, "He has %d books.\n", n);
CyU3PDebugPrint(4,c1);
I got the following output in teraterm.
Best Regards,
Jayakrishna
Jayakrishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please use the API CyU3PDebugStringPrint(); for implementing snprintf();. This API make use of following parameters as shown in its definition.
extern CyU3PReturnStatus_t
CyU3PDebugStringPrint (
uint8_t *buffer, /**< Buffer into which the data is to be printed. */
uint16_t maxLength, /**< Buffer size. */
char *fmt, /**< Format specifier string. */
... /**< Variable argument list. */
);
I have implemented your requirement as shown below.
char c1[20];
uint8_t n =5;
CyU3PDebugStringPrint ((uint8_t*)c1, 20, "He has %d books.\n", n);
CyU3PDebugPrint(4,c1);
I got the following output in teraterm.
Best Regards,
Jayakrishna
Jayakrishna