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 ")));