Printf () and retailmsg ()

Source: Internet
Author: User

I. Differences between printf () and retailmsg ()

 
This printf () may be familiar to everyone, and retailmsg () is used in the embedded development of S3C2410, ARM9. it is used in the EVC operating system.
When debugging information, you usually use these functions to display output information. EVC also supports both functions.
However, if the system requires high real-time performance, the two functions will be very different;
The time used by the printf function is much larger than that of retailmsg. The call of the printf function takes about 100 milliseconds, while the call of retailmsg () takes about 10 milliseconds;
Therefore, in debugging of the debug version, retailmsg () is used for output information; do not use printf whenever possible;
Of course, in the realcompute version, all functions that output debugging information should be shielded as much as possible. The method is to use # ifdef, as shown below:
# Ifdef debug
Printf ("/n broadcast hello ");
# Endif;
[Or]
# Ifdef debug
Retailmsg (1, (text ("receive a packet/T/N ")));
# Endif;

2. When using the retailmsg macro, pay attention to one problem. Because retailmsg requires a unicode string, it should be written in this way when used.
Retailmsg (1, (text ("% s/n"), text ("Your Str ")));

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.