DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

AN720 データシートの表示(PDF) - Silicon Laboratories

部品番号
コンポーネント説明
メーカー
AN720 Datasheet PDF : 28 Pages
First Prev 21 22 23 24 25 26 27 28
AN720
6.4. Function Library Usage
The removal of debugging printf() statements can dramatically reduce the code size of a project. A simple way to
do this is to redefine the printf function at the top of the file containing the printf() calls using the following
statement:
#define printf(args...)
For si32Library examples such as demo_si32UsbAudio, define the statement at the top of myBuildOptions.h to
remove all calls to printf(). Additionally, reduce the footprint by disabling logging in myBuildOptions.h:
#define si32BuildOption_enable_logging 0
This method preserves the printf() statements for later use, if needed. The printf() define can also be
encapsulated with preprocessor #if statements to automatically include this define when building with a Release
configuration.
To verify that all instances of printf() have been removed, search the map file for the project for the printf library. In
the sim3u1xx_Blinky example, this means adding the statement to both the main.c and gCpu.c files.
Using the sim3u1xx_Blinky and demo_si32UsbAudio default examples in the si32HAL 1.0.1 software package,
Table 19 and Table 20 show the relative build sizes with the different printf() settings. This section does not include
the CoreMark tests since printf is not part of the CoreMark benchmark.
Table 19. Keil printf() Comparison—sim3u1xx_Blinky Debug
Library
µVision MicroLIB with printf
µVision MicroLIB without printf
Code (bytes)
2068
1392
Read Only Data Read-Write Data
(bytes)
(bytes)
296
24
296
12
Zero-Initialized
Data (bytes)
1536
1536
Table 20. Keil printf() Comparison—demo_si32UsbAudio Debug
Library
µVision MicroLIB with printf
µVision MicroLIB without printf
Code (bytes)
47264
39760
Read Only Data Read-Write Data
(bytes)
(bytes)
3832
5208
4312
5196
Zero-Initialized
Data (bytes)
17972
17972
Rev. 0.1
21

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]