完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
为什么RTC数据表警告:“在调用读取或修改全局变量的函数时,您应该禁用组件的中断。”
在RTC数据表中提到这种谨慎的原因似乎是恰当的。其他组件的数据表(如中断组件)没有提及。 以上来自于百度翻译 以下为原文 Why does the RTC data sheet caution "You should disable the component’s interrupts while calling functions that read or modify global variables." A sentence or two of why this caution is mentioned in the RTC datasheet would seem to be appropriate. Datasheets for other components, such as the Interrupt component make no similar mention. |
|
相关推荐
1个回答
|
|
访问中断可能会改变的数据应该总是用禁用的互操作来完成。
由于访问可能不是原子的,中断可能只发生在数据读取中,给出了23秒59(在int之前)和一天过去(中断之后)的时间。您可以使用CyTimeActualSeCudio()和CyExEx临界()API(来自系统引用指南) 鲍勃 以上来自于百度翻译 以下为原文 Accessing data which might get changed by an interrupt should always be done with interrup disabled. Since the access might not be atomic the interrupt might occur just within the data read, giving a time of 23:59 (before int) and a date of one day past (after the interrupt). You might use the CyEnterCriticalSection() and Cy_ExitCriticalSection() APIs (from System Reference Guide) Bob |
|
|
|
只有小组成员才能发言,加入小组>>
728个成员聚集在这个小组
加入小组1940 浏览 1 评论
1687 浏览 1 评论
3454 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1612 浏览 6 评论
1408 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-7-6 08:05 , Processed in 0.543638 second(s), Total 46, Slave 40 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号