完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,社区,我想使用TMRY5。我是按照“入门”的建议来做的。但是当我想在“App.c”中打开TMRIX驱动程序时,处理程序“AppDATA,TMR.SCRISHORH”仍然处于状态“DrvHAdLeLead无效”,因为我不能到达激活“DrvtTMRMARLARM寄存器”并启动TMR的代码部分,我使用的是HyV2.02BMPLAB X IDE V.3.55 xC32 V1.42Sype。在“App.h”中:“App.c”:然后在“AppStices”中进一步:什么可能出错?谢谢你的支持,亨利
以上来自于百度翻译 以下为原文 Hi Community, I want to use the TMR_5. I`m following the advises in the "Getting Started". But the when I want to open the TMR_Driver in "app.c", the handler "appData.TMR_ScrRefresh" is still in status "DRV_HANDLE_INVALID", because I cannot reach the code part which is activating the "DRV_TMR_AlarmRegister" and starting the TMR. I`m using Harmony v2.02b MPLAB X IDE v.3.55 XC32 v1.42 In "system_config.h": #define TMR5_ForScrRefresh DRV_TMR_INDEX_0 #define TMR5_ForScrRefresh_IS_PERIODIC true #define TMR5_ForScrRefresh_PERIOD 0xFE51 #define TMR5_ForScrRefresh_COUNT_MAX 6 In "app.h": typedef struct { /* The application's current state */ APP_STATES state; /* TODO: Define any additional data used by the application. */ /* TMR5 driver handler for Scr refresh*/ DRV_HANDLE TMR_ScrRefresh; /* TMR5 cycle counter*/ uint16_t TMR_ScrRefreshCount; } APP_DATA; In "app.c": APP_DATA appData; and appData.state = APP_STATE_INIT; appData.TMR_ScrRefresh = DRV_HANDLE_INVALID; appData.TMR_ScrRefreshCount = 0; and then further in the "APP_Tasks": void APP_Tasks ( void ) { /* Check the application's current state. */ switch ( appData.state ) { /* Application's initial state. */ case APP_STATE_INIT: { appData.TMR_ScrRefresh = DRV_TMR_Open( TMR5_ForScrRefresh, DRV_IO_INTENT_EXCLUSIVE); if ( DRV_HANDLE_INVALID != appData.TMR_ScrRefresh ) { DRV_TMR_AlarmRegister(appData.TMR_ScrRefresh, TMR5_ForScrRefresh_PERIOD, TMR5_ForScrRefresh_IS_PERIODIC, (uintptr_t)&appData, TMR5_ISR); DRV_TMR_Start(appData.TMR_ScrRefresh); appData.state = APP_STATE_IDLE; } bool appInitialized = true; if (appInitialized) { appData.state = APP_STATE_SERVICE_TASKS; } break; } case APP_STATE_SERVICE_TASKS: { break; } /* TODO: implement your application state machine.*/ /* The default state should never be executed. */ default: { /* TODO: Handle error in application's state machine. */ break; } } } What could be wrong? Thanks for support. Henry |
|
相关推荐
6个回答
|
|
|
|
|
|
|
|
|
嗨,QHB,是的…那是对的。但我认为这不是必要的,因为和声只是和PIC32一起工作的,在那里他们有相似的建筑。而且,不工作的代码在应用程序级别上。SysCONFIG应该由我信任的OrthyFrigWorkDeal办事器来完成。还是????但是如果你的意思是很重要的话,我正在使用PIC32 MX764 F128H。我想把它作为“TMR驱动程序实例0”的外围设备,带有定时器模块ID“TMRSIDID5”。希望它能帮助你。谢谢和问候。
以上来自于百度翻译 以下为原文 Hi qhb, yeah... that´s right. But I assumed it´s not necsessary, because the Harmony is only work with PIC32...., where they have an similar architecture. And: The code which is not working is on the application level. The SysConfig should be made by the HarmonyFrameworkConfigurator, which I`m trusting. Or??? But if you mean it`s important, I`m working with the PIC32MX764F128H. And I want to have as the "TMR Driver Instance 0" the periphal with the Timer Module ID "TMR_ID_5". I hope it will help you to help me. Thank you and greetings Henry |
|
|
|
|
|
嗨,社区,正如我所写的,我遵循的步骤“开始……”从和谐。已经编写了,我应该创建一个带有索引“DRVIVTMRIX索引X0”的驱动程序。这是行不通的。当我调试代码时,我发现在“SysStM.C”中,一个带有这个索引的TMR驱动程序已经打开。原因是未知的(至少是我:)。当我使用另一个索引“DrvtTMRMixxx1”时,它就工作了。
以上来自于百度翻译 以下为原文 Hi Community, as I wrote, I was following the steps in "Getting started..." from Harmony. There is written, I should create a driver with the index "DRV_TMR_INDEX_0". This was not working. When I debugged the code, I found in "sys_tmr.c" that a TMR driver with this index is already opened. The reason for this is unknown (at least by me :-). When I used another index "DRV_TMR_INDEX_1" then it works. Greetings Henry |
|
|
|
|
|
它可能是默认检查在MHC系统Services。
以上来自于百度翻译 以下为原文 It is probably checked by default in the MHC system sercvices. |
|
|
|
|
|
不确定。可能是因为某种原因我这么做了。最后,我不知道为什么有一个“系统计时器”的可能性。
以上来自于百度翻译 以下为原文 Not sure. Could be, I did it for some reason. In the end, I don´t know why there is the possibility for a "System Timer". |
|
|
|
|
|
它没有列出,但许多和谐服务需要计时器。USB TCP/IP等等,它们都是共享的。
以上来自于百度翻译 以下为原文 It is not listed but many harmony services need a timer. USB TCP/IP etc. they all share the one. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 06:31 , Processed in 0.735988 second(s), Total 82, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1465