IAR intrinsic functions
You can insert asm code example asm("NOP") into the c or c++ source code to get a good performance. But it don’t have problem for the compatibility, and because there are no operands and clobbered resources, inline assembler statements have no interface with the surrounding C source code. IAR compiler provides a good solution is intrinsic functions. For example, the provided interrupt controlling intrinsic functions are __disable_interrupt() and __enable_interrupt().
Another example is that it is the first thing is to disable the watchdog in MSP430. The general method is to put the WDTCTL = WDTPW + WDTHOLD; at the first line of main(). But it may failure to disable the watchdog because it is too later to call it as there are lots of code to initialize global variables. The IAR compiler provides a __low_level_init() intrinsic function which makes sure it will be called firstly.
/* There is a possibility that there is a large memory need to be initialized.
* in that, it will cause the system reset if the watchdog is not initialized.
* using __low_level_init in IAR to make sure that this code will executed firstly
*/
#if defined(__IAR_SYSTEMS_ICC__)
__intrinsic int __low_level_init(void)
{
//Stop watchdog timer to prevent time out reset, shall be first line of main.
WDTCTL = WDTPW + WDTHOLD;
return ;
}
#endif
IAR intrinsic functions的更多相关文章
- Google C++ Style Guide
Background C++ is one of the main development languages used by many of Google's open-source project ...
- Lock-Free 编程
文章索引 Lock-Free 编程是什么? Lock-Free 编程技术 读改写原子操作(Atomic Read-Modify-Write Operations) Compare-And-Swap 循 ...
- Build Instructions (Windows) – The Chromium Projects
转自:http://121.199.54.6/wordpress/?p=1156 原始地址:http://www.chromium.org/developers/how-tos/build-instr ...
- gcc 编译器参数
一.GCC编译过程 参考:http://hi.baidu.com/zengzhaonong/item/c00e079f500adccab625314f------------------------- ...
- shader函数
Intrinsic Functions (DirectX HLSL) The following table lists the intrinsic functions available in HL ...
- VC 宏与预处理使用方法总结
目录(?) C/C++ 预定义宏^ C/C++ 预定义宏用途:诊断与调试输出^ CRT 和 C 标准库中的宏^ NULL 空指针^ limits.h 整数类型常量^ float.h 浮点类型常量^ m ...
- VC编译连接选项详解(转)
大家可能一直在用VC开发软件,但是对于这个编译器却未必很了解.原因是多方面的.大多数情况下,我们只停留在“使用”它,而不会想去“了解”它.因为它只是一个工具,我们宁可把更多的精力放在C++语言和软件设 ...
- VC6.0的工程设置解读Project--Settings
[原文:http://wenku.baidu.com/view/f10a241dff00bed5b9f31ddd.html] 做开发差不多一年多了,突然感觉对VC的工程设置都不是很清楚,天天要和VC见 ...
- VC6.0设置选项解读(转)
其实软件调试还是一个技术熟练过程,得慢慢自己总结,可以去搜索引擎查找一些相关的文章看看,下边是一篇关于VC6使用的小文章,贴出来大家看看: 大家可能一直在用VC开发软件,但是对于这个编译器却未必很了解 ...
随机推荐
- 使用AWR报告诊断Oracle性能问题
在做单交易负载测试时,有的交易响应时间超出了指标值,在排除完测试环境等可能造成交易超时的原因后,去分析数据库问题.数据库用的是Oracle,对于Oracle数据库整体的性能问题, awr的报告是一个非 ...
- SQL-29 使用join查询方式找出没有分类的电影id以及名称
题目描述 film表 字段 说明 film_id 电影id title 电影名称 description 电影描述信息 CREATE TABLE IF NOT EXISTS film ( film_i ...
- Spring boot 导出Excel
Html页面: window.location.href="adjectfkController/exportTemplate?adjOrg="+ adjOrg +"&a ...
- 201621123001 《Java程序设计》第6周学习总结
1. 本周学习总结 1.1 面向对象学习暂告一段落,请使用思维导图,以封装.继承.多态为核心概念画一张思维导图或相关笔记,对面向对象思想进行一个总结. 注1:关键词与内容不求多,但概念之间的联系要清晰 ...
- debug fortran
exmple: gfortran -g -fcheck=all -Wall segf.f90
- Java语法基础学习DayEight
一.异常处理 1.结构 java.lang.Object |-----java.lang.Throwable |-----java.lang.Error:错误,java程序对此无能为力,不显式处理 | ...
- 小波学习之二(单层一维离散小波变换DWT的Mallat算法C++实现优化)--转载
小波学习之二(单层一维离散小波变换DWT的Mallat算法C++实现优化) 在上回<小波学习之一>中,已经详细介绍了Mallat算法C++实现,效果还可以,但也存在一些问题,比如,代码 ...
- Android:DELETE_FAILED_INTERNAL_ERROR Error while Installing APKs
Android studio DELETE_FAILED_INTERNAL_ERROR Error while Installing APKs 一.报错信息 DELETE_FAILED_INTERN ...
- 设置环境下文本格式为UTF-8
1.在页面创建一个template.txt文本格式,默认是ANSI,将其格式改为UTF-8 2.将template.txt丢到C:\Windows\ShellNew文件夹里面 3.打开命令行工具win ...
- 大数据-06-Spark之读写Hive数据
简介 Hive中的表是纯逻辑表,就只是表的定义等,即表的元数据.Hive本身不存储数据,它完全依赖HDFS和MapReduce.这样就可以将结构化的数据文件映射为为一张数据库表,并提供完整的SQL查询 ...