求解:stm32有与循环左移/右移类似的 函数吗?
在C语言中,有个循环左移/右移函数_crol_();和_cror_();位于intrins.h头文件中,可以循环移位一个变量,但是在stm32中,无法使用这个函数,包好头文件intrins.h后,编译出错,提示无法打开这个头文件?可以看看 core_cmInstr.h 这个文件。
core_cmInstr.h - Defines intrinsic functions to access special Cortex-M instructions.
未必会有循环移位。 uint32_t __ROR ( uint32_t value,
uint32_t shift
)
This function rotates a value right by a specified number of bits.
Parameters:
value Value to be shifted right
shift Number of bits in the range
Returns:
Rotated value 本帖最后由 arm8686 于 2015-2-14 20:59 编辑
没有找到左移的。uint32_t __ROR ( uint32_t value,
uint32_t shift
)
This function rotates a value right by a specified number of bits.
Parameters:
value Value to be shifted right
shift Number of bits in the range
Returns:
Rotated value
上面那个是右移的,应该是循环的。
自己使用C写一个,也费不了多少工夫 自己写一段 学习一下。。。。 arm8686 发表于 2015-2-14 19:51
可以看看 core_cmInstr.h 这个文件。
core_cmInstr.h - Defines intrinsic functions to access special C ...
恩,现在知道stm32的循环左移函数需要自己却写了,没有现成的,谢谢:) QianFan 发表于 2015-2-14 20:12
自己使用C写一个,也费不了多少工夫
恩,的确是,因为刚接触没多久,所以就想问问有没有现成的:) 星辰一方 发表于 2015-2-14 20:32
自己写一段
恩,已经搞定:P
页:
[1]
2