完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
想法是stm32f407IGT6中使用硬件定时器的回调,在触发特定条件后更改该定时器的回调,跳转执行别的动作。在第一个回调中,触发条件后把新的回调函数传入hwtimer_init()来修改原定时器回调,结果在hwtimer_init()中执行rt_device_find后程序直接跳入rt_assert_handle()中.
|
|
相关推荐
1个回答
|
|
|
find函数 不可以在中断中使用。定时器回调实在中断中调用的。
rt_object_t rt_object_find(const char *name, rt_uint8_t type) { struct rt_object *object = RT_NULL; struct rt_list_node *node = RT_NULL; struct rt_object_information *information = RT_NULL; information = rt_object_get_information((enum rt_object_class_type)type); /* parameter check */ if ((name == RT_NULL) || (information == RT_NULL)) return RT_NULL; /* which is invoke in interrupt status */ RT_DEBUG_NOT_IN_INTERRUPT; /* enter critical */ rt_enter_critical(); RT_DEBUG_NOT_IN_INTERRUPT; |
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1033 浏览 0 评论
2877 浏览 0 评论
图腾柱PFC无法上升至400V,且电感电流为正弦波形,但是幅值极小
9386 浏览 0 评论
飞凌嵌入式ElfBoard-Vim编辑器之静态链接和动态链接
2898 浏览 0 评论
使用 LinkBoy 将程序导出为 C 语言代码并烧录至 Arduino ESP32 开发板
2302 浏览 1 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 02:14 , Processed in 0.725188 second(s), Total 72, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1286