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.

Overriding library modulesNote: If you override a default I/O library module with your own module, C-SPYsupport for the module is turned off. For example, if you replace the module __writewith your own version, the C-SPY Terminal I/O window will not be supported.Overriding library modules using the <strong>IAR</strong> Embedded WorkbenchIDEThis procedure is applicable to any source file in the library, which means thatlibrary_module.c in this example can be any module in the library.1 Copy the appropriate library_module.c file to your project directory.2 Make the required additions to the file (or create your own routine, using the defaultfile as a model), and make sure that it has the same module name as the originalmodule. The easiest way to achieve this is to save the new file under the same name asthe original file.3 Add the customized file to your project.4 Rebuild your project.Overriding library modules from the command lineThis procedure is applicable to any source file in the library, which means thatlibrary_module.c in this example can be any module in the library.1 Copy the appropriate library_module.c to your project directory.2 Make the required additions to the file (or create your own routine, using the defaultfile as a model), and make sure that it has the same module name as the originalmodule. The easiest way to achieve this is to save the new file under the same name asthe original file.3 Compile the modified file using the same options as for the rest of the project:icc430 library_moduleThis creates a replacement object module file named library_module.r43.Note: Make sure to use a library that matches the settings of the rest of your application.4 Add library_module.r43 to the XLINK command line, either directly or by usingan extended linker command file, for example:xlink library_module dl430fn.r43Make sure that library_module is placed before the library on the command line.This ensures that your module is used instead of the one in the library.Run XLINK to rebuild your application.54<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!