11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Choosing formatters for printf and scanfThe following table summarizes the capabilities of the different formatters:Formatting capabilities _PrintfFull _PrintfLarge _PrintfSmall _PrintfTinyBasic specifiers c, d, i, o, p, s, u, X,x, and %† Depends on the library configuration that is used.For information about how to fine-tune the formatting capabilities even further, seeConfiguration symbols for printf and scanf, page 62.Specifying the print formatter in the <strong>IAR</strong> Embedded WorkbenchIDETo use any other formatter than the default (Large), choose Project>Options and selectthe General Options category. Select the appropriate option on the Library optionspage.Specifying printf formatter from the command lineTo use any other formatter than the default (_PrintfFull), add one of the followinglines in the linker command file you are using:-e_PrintfLarge=_Printf-e_PrintfSmall=_Printf-e_PrintfTiny=_PrintfCHOOSING SCANF FORMATTERYes Yes Yes YesMultibyte support † † † NoFloating-point specifiers a, and A Yes No No NoFloating-point specifiers e, E, f, F, g,and GYes Yes No NoConversion specifier n Yes Yes No NoFormat flag space, +, -, #, and 0 Yes Yes Yes NoLength modifiers h, l, L, s, t, and Z Yes Yes Yes NoField width and precision, including * Yes Yes Yes Nolong long support Yes Yes No NoTable 13: Formatters for printfIn a similar way to the printf function, scanf uses a common formatter, called_Scanf. The default version is very large, and provides facilities that are not requiredin many embedded applications. To reduce the memory consumption, two smaller,alternative versions are also provided in the standard C/<strong>C++</strong> library.52<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!