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.

Standard streams for input and outputThe value returned by __low_level_init determines whether or not data segmentsshould be initialized by the system startup code. If the function returns 0, the datasegments will not be initialized.Note: The file intrinsics.h must be included by low_level_init.c to assurecorrect behavior of the __low_level_init routine.MODIFYING THE FILE CSTARTUP.S43As noted earlier, you should not modify the file cstartup.s43 if a customized versionof __low_level_init is enough for your needs. However, if you do need to modifythe file cstartup.s43, we recommend that you follow the general procedure forcreating a modified copy of the file and adding it to your project, see Overriding librarymodules, page 53.Standard streams for input and outputThere are three standard communication channels (streams)—stdin, stdout, andstderr—which are defined in stdio.h. If any of these streams are used by yourapplication, for example by the functions printf and scanf, you need to customize thelow-level functionality to suit your hardware.There are primitive I/O functions, which are the fundamental functions through whichC and <strong>C++</strong> performs all character-based I/O. For any character-based I/O to be available,you must provide definitions for these functions using whatever facilities the hardwareenvironment provides.IMPLEMENTING LOW-LEVEL CHARACTER INPUT ANDOUTPUTTo implement low-level functionality of the stdin and stdout streams, you must writethe functions __read and __write, respectively. You can find template source code forthese functions in the 430\src\lib directory.If you intend to rebuild the library, the source files are available in the template libraryproject, see Building and using a customized library, page 55. Note that customizing thelow-level routines for input and output does not require you to rebuild the library.Note: If you write your own variants of __read or __write, special considerationsfor the C-SPY runtime interface are needed, see C-SPY Debugger runtime interface,page 69.60<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!