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.

The DLIB runtime environmentAn application can also exit by calling the abort or the _Exit function. The abortfunction just calls __exit to halt the system, and does not perform any type of cleanup.The _Exit function is equivalent to the abort function, except for the fact that _Exittakes an argument for passing exit status information.If you want your application to perform anything extra at exit, for example resetting thesystem, you can write your own implementation of the __exit(int) function.C-SPY interface to system terminationIf your project is linked with the XLINK options With runtime control modules orWith I/O emulation modules, the normal __exit and abort functions are replacedwith special ones. C-SPY will then recognize when those functions are called and cantake appropriate actions to simulate program termination. For more information, seeC-SPY Debugger runtime interface, page 69.Customizing system initializationIt is likely that you need to customize the code for system initialization. For example,your application might need to initialize memory-mapped special function registers(SFRs), or omit the default initialization of data segments performed by cstartup.You can do this by providing a customized version of the routine __low_level_init,which is called from cstartup.s43 before the data segments are initialized.Modifying the file cstartup directly should be avoided.The code for handling system startup is located in the source files cstartup.s43 andlow_level_init.c, located in the 430\src\lib directory.Note: Normally, there is no need for customizing the file cstartup.s43.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: Regardless of whether you modify the routine __low_level_init or the filecstartup.s43, you do not have to rebuild the library.__LOW_LEVEL_INITTwo skeleton low-level initialization files are supplied with the product: a C source file,low_level_init.c and an alternative assembler source file, low_level_init.s43.The latter is part of the prebuilt runtime environment. The only limitation using the Csource version is that static initialized variables cannot be used within the file, asvariable initialization has not been performed at this point.Part 1. Using the compiler59

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

Saved successfully!

Ooh no, something went wrong!