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开发软件,但是对于这个编译器却未必很了解 ...
随机推荐
- :工厂模式1:方法模式--Pizza
#ifndef __PIZZA_H__ #define __PIZZA_H__ class Pizza { public: Pizza(){} virtual ~Pizza(){} virtual c ...
- Centos7单主机部署 LAMP + phpmyadmin 服务
LAMP -> centos + apache + mysql + php + phpmyadmin 一:搭建yum仓库: 安装utils: yum -y install yum-utils c ...
- 界面控件DevExpress发布v18.2.5|附下载
DevExpress Universal Subscription(又名DevExpress宇宙版或DXperience Universal Suite)是全球使用广泛的.NET用户界面控件套包,De ...
- rnn-手写数字识别-网络结构-shape
手写数字识别经典案例,目标是: 1. 掌握tf编写RNN的方法 2. 剖析RNN网络结构 tensorflow编程 #coding:utf-8 import tensorflow as tf from ...
- 20165214 2017-2018-2 《Java程序设计》课程总结
20165214 2017-2018-2 <Java程序设计>课程总结 每周任务链接 预备作业1:我期望的师生关系 预备作业2:C语言基础调查和java学习展望 预备作业3:Linux安装 ...
- JS数据的基本类型
字符串 String 数字 Number 布尔 Boolean Null 空 Undefined Object 对象 Array 数组 json function ...
- CHERRY G80 3000L 使用一月有感
就是楼上这家伙.. 都说程序猿用的最多的除了自己的右手就是键盘了.- - SO一个好的键盘必定会令写码的速度提升. 在TB和JD上选择许久,在青轴,红轴,黑轴,茶轴间难以抉择. 最后终于敲定: CHE ...
- 大数据-10-Spark入门之支持向量机SVM分类器
简介 支持向量机SVM是一种二分类模型.它的基本模型是定义在特征空间上的间隔最大的线性分类器.支持向量机学习方法包含3种模型:线性可分支持向量机.线性支持向量机及非线性支持向量机.当训练数据线性可分时 ...
- 终极C语言指针
// ex1.cpp : Defines the entry point for the console application. // #include "stdafx.h" # ...
- Nginx配置之location模块和proxy模块
1.location指令的用法介绍 Location主要用来匹配url,如:http://www.beyond.com/nice,在这里对于location来说www.beyond.com是域名,/n ...