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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Input and output_medium_writeThe _medium_write formatter has the same functions as _formatted_write, exceptthat floating-point numbers are not supported. Any attempt to use a %f, %g, %G, %e, or%E specifier will produce a runtime error:FLOATS? wrong formatter installed!_medium_write is considerably smaller than _formatted_write._small_writeThe _small_write formatter works in the same way as _medium_write, except thatit supports only the %%, %d, %o, %c, %s, and %x specifiers for integer objects, and doesnot support field width or precision arguments. The size of _small_write is 10–15%that of _formatted_write.Specifying the printf formatter in the <strong>IAR</strong> Embedded WorkbenchIDE1 Choose Project>Options and select the General Options category. Click the Libraryoptions tab.2 Select the appropriate Printf formatter option, which can be either Small, Medium,or Large.Specifying the printf formatter from the command lineTo use the _small_write or _medium_write formatter, add the corresponding line inthe linker command file:-e_small_write=_formatted_writeor-e_medium_write=_formatted_writeTo use the full version, remove the line.Customizing printfFor many embedded applications, sprintf is not required, and even printf with_small_write provides more facilities than are justified, considering the amount ofmemory it consumes. Alternatively, a custom output routine may be required to supportparticular formatting needs or non-standard output devices.For such applications, a much reduced version of the printf function (withoutsprintf) is supplied in source form in the file intwri.c. This file can be modified to78<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!