完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我的问题是:包含在由MHC创建的SysStasks-()例程中的SysStRMRS任务(SysObj.SyrMR)调用的目的是什么?这个调用在超循环中执行数千次/秒。在FRIERTOS DEMOS中,它包含在只运行一次/SEC的任务中。SysStMR的文档不涉及或提及任何需要定期调用该调用,但它意味着在初始化后需要启动服务。我用一个工作项目做了一个快速测试,并从SysStaskSe()中调用了SysStTrMyStask(SysObj.SyrMR)到AppIn RealLeIZE()中的最后一行。我在项目中没有发现任何问题。为什么MHC把这个调用放在SysStasks-()中?
以上来自于百度翻译 以下为原文 My question is: What is the purpose of the SYS_TMR_Tasks(sysObj.sysTmr) call that is included in the SYS_Tasks() routine created by MHC? This call is executed thousands of times/sec in the superloop. In the FreeRTOS demos, it is included in a task that only runs once/sec. The documentation on SYS_TMR does not address or mention anything about a need to make this call periodically, but it does imply that it is needed to start the service after it is initialized. I did a quick test with a working project and moved the SYS_TMR_Tasks(sysObj.sysTmr) call from SYS_Tasks() to the last line in APP_Initialize(). I did not see any problems in my project. So why does MHC put this call in SYS_Tasks()? |
|
相关推荐
10个回答
|
|
|
原因是和谐正在试图将驱动程序与应用程序隔离开来。这样做可以免除开发人员对驱动程序细节的担忧:只有与驱动程序的接口很重要。
以上来自于百度翻译 以下为原文 The reason is because Harmony is trying to isolate the drivers from the application. Doing so frees the developer from having to worry about driver details: only the interface to said driver is important. |
|
|
|
|
|
我明白了。然而,(在我看来)只需要调用一次SysS任务中的驱动程序接口来启动计时器服务。如果是这样,为什么周期性地调用它?
以上来自于百度翻译 以下为原文 I get that. However, it appears (to me) that the driver interface in SYS_TASKS only needs to be called once to start the timer service. If so, why is it being called periodically? |
|
|
|
|
|
你报警了吗?如果是这样,我认为你需要定期调用它。另外,在您的情况下,函数只调用一次。如果调用函数中的DRVIVTMRYORD返回DRVH-HANDLE无效,会发生什么?如果它碰巧是侥幸,那么系统服务将永远不会初始化,因为服务在打开底层计时器时不会再有第二次破解。在任何情况下,查看SysStM.C中的函数。那你就没事了。有人说过,我强烈建议不要把和声单独产生。
以上来自于百度翻译 以下为原文 Have you set up any alarms? If so, I think that you'll need it be called periodically. Additionally, in your case, the function would be called only once. What would happen if the call to DRV_TMR_Open in that function returned DRV_HANDLE_INVALID? If it happened to be a fluke then the system service would never initialize as the service would never get a second crack at opening the underlying timer. In any case, look at the function in sys_tmr.c. You are right in that if everything goes well with a single call, and you're not using any alarms, then you'll be just fine. That having been said, I would strongly advise leaving the call that Harmony generated alone. |
|
|
|
|
|
我同意B祝福
以上来自于百度翻译 以下为原文 I agree with bblessing from sys_tmr.c /* Function: void SYS_TMR_Tasks ( SYS_MODULE_OBJ object ) Summary: Maintains the system Timer's state machine and implements its ISR. Description: This routine is used to maintain the system Timer's internal state machine and implement its ISR for interrupt-driven implementations. Precondition: The SYS_TMR_Initialize function must have been called for the specified Timer driver instance. Parameters: object - SYS TMR object handle, returned from SYS_TMR_Initialize Returns: None. */ |
|
|
|
|
|
|
|
|
|
|
|
我还是很困惑。我曾多次阅读过Vy.V中的SysStTMR文档,但我仍然不明白它为什么在做它所做的事情。我理解所有的SysSi模块都有一个定义的结构和一组调用,包括初始化()和Tasks-(),并且需要在SysStasks-()例程中调用Tasks-()函数。好的。在超循环中,SysStaskSh()被称为每毫秒数千次。SysTrMRTasks-()例程从SysStasks.()调用。在FrReToS示例中,SysTrMrasTaskSe()从单独的任务(非超循环)调用一次/秒。在调用频率中,这是6个数量级的差异,并且在文档中没有关于SysthTrMyTasks-()函数需要的频率的说明。在我看来,一旦建立了基础TMREDRV,任何一个镜头、延迟或周期定时器都应该中断,并触发相关的回调。轮询需要在哪里?我只是想了解SysTMR系统服务的基本逻辑。不必要地调用一百万次/秒的例程,似乎是在嵌入式系统中浪费有限的CPU资源。
以上来自于百度翻译 以下为原文 I am still confused. I have read the SYS_TMR docs in Vol. V many times and I still do not understand why it is doing what it is doing. I understand all the SYS_ modules have a defined structure and set of calls, including Initialize() and Tasks() and that the Tasks() function needs to be called in the SYS_Tasks() routine. OK. In the superloop, the SYS_TASKS() is called thousands of times per millisecond. The SYS_TMR_Tasks() routine is called from SYS_TASKS(). In the FreeRTOS example,the SYS_TMR_Tasks() is called once/second from a separate task (no superloop). That is 6 orders of magnitude difference in the calling frequency and there is no specification that I can find in the documentation as to what the frequency the SYS_TMR_Tasks() function needs to be. Stepping back a bit and just looking at what the SYS_TMR module should do in the interrupt mode, it seems to me that once the underlying TMR_DRV is setup, any one-shot, delay or periodic timer should interrupt and the associated callback is triggered. Where is the polling required? I am just trying to understand the underlying logic for the SYS_TMR system service. Calling a routine a million times/second unnecessarily seems like a waste of limited CPU resources in an embedded system. |
|
|
|
|
|
这是和谐设计的方式,你可能不同意,但这是我们必须共同努力的。欢迎你打开一张支持票,表达你对和谐设计的不满。
以上来自于百度翻译 以下为原文 This is the way Harmony has been designed, you may not agree with it but it is what we have to work with. You are welcome to open a support ticket and express your displeasure with the Harmony design. |
|
|
|
|
|
如果您查看代码,它首先在HW计时器的顶部设置服务。这是因为他们希望能够以任何顺序设置它们,这样它们就不必要地使它变得更复杂。然后它似乎服务于警报回调。您可以看到这些是否用于给定的服务。我猜这是所有任务都有的模板代码。这可能不是最有效的方法。
以上来自于百度翻译 以下为原文 If you Look at the code it first sets up the service on top of the HW Timer. This is because they wanted to be able to set them of in any order so they could unnecessarily make it more complicated. Then it appears to service Alarm callbacks. You can see if those are used to a given service. My Guess here is this is template code that all tasks have. It may not be the most efficient way. |
|
|
|
|
|
吉姆,你误会我了。我对和谐设计并不感到不满。我只是想了解一个系统服务。我认为NKurzman的评论是正确的。我正在寻找对SysTTMR任务做什么的更深入的理解,而不是模糊的解释,它是用来维护系统计时器的内部状态机的。
以上来自于百度翻译 以下为原文 Jim, you misunderstand me. I am not displeased with the Harmony design. I am only trying to understand one system service. I think NKurzman's comment is correct. I was looking for a deeper understanding of what the SYS_TMR tasks does, rather than the vague explanation that it is "used to maintain the system Timer's internal state machine". |
|
|
|
|
|
您可以使用帮助作为参考来逐步执行代码,以查看它是如何工作的。
以上来自于百度翻译 以下为原文 You could step through the code using the help as a reference to see how it works. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
490 浏览 0 评论
5806 浏览 9 评论
2346 浏览 8 评论
2234 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3541 浏览 3 评论
1146浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1115浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
883浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
490浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-9 22:34 , Processed in 0.815949 second(s), Total 90, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1814