完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛扫一扫,分享给好友
|
我的代码试图用一个不存在的USB棒打开一个带有SysffsdiDROPEN的目录。(这是因为我已经设置了代码来检查一个文件在安装时是否在棒上,如果不是,那么它继续。)返回的目录句柄是SysSFDFDANLYLE无效,因为这个目录不退出。在发生这种情况后,我删除了USB棒,出现了一个通用的异常处理程序故障。目录没有打开,没有句柄被返回,因此目录不能被关闭。运行时异常是由FununSAMIT函数引起的。该错误指向if语句中的代码,该语句表示FATFSDIROPICAT[HFATFS]。这是在OrthyV1V09文件FF.C,在第2418行,例外是第2420行。我假设UnUE表明USB正在被访问,但它不是这样,我不明白为什么UnUE应该是真的,如果目录不存在。我错过了什么?如果打开目录失败,是否有一个和声函数来清除任何设置?
以上来自于百度翻译 以下为原文 My code tries to open a directory with SYS_FS_DirOpen on a USB stick that isn't there. (This is being done to because I've set up the code to check if a file is on the stick when it has been mounted, if not then it continues on.) The directory handle returned is SYS_FD_HANDLE_INVALID since this directory doesn't exit. I remove the USB stick after this occurs and a general exception handler fault occurs. The directory isn't opened and no handle has been returned, so the directory can't be closed. The runtime exception is caused by f_unmount function. The fault is pointing to code in an if statement that indicates FATFSDirObject[hFATfs].inUse is true. This is in HARMony_v1_09 file ff.c at line number 2418 and the exception is line 2420. I'm assuming inUse indicates that the USB is being accessed, but it isn't so I don't understand why inUse should be true if the directory doesn't exist. What am I missing here? Is there a Harmony function to call to clear out any settings if opening a directory fails? |
|
相关推荐
8个回答
|
|
|
将USB代码与Hyv1.V11进行比较,看看是否能发现任何更改。如果您看到修复程序,您可能需要移到V1.11。否则,您将需要编写一个修复程序或围绕自己工作。它们不会修复V1.XX版本。他们死了,你可能被迫搬到2.xx
以上来自于百度翻译 以下为原文 Compare the USB code to Harmony V1.11 See if you can spot any changes. You may need to move up to V1.11 if you see fixes. Otherwise you would need to code a fix or work around yourself. They are not going to fix V1.XX versions. They are dead. You maybe forced to move to 2.XX |
|
|
|
|
|
1.11在哪里?我的MPLAB X IDE V3.30只显示下一个可用的和声是1.0.10。我们在这个项目上不会达到2.03B。我们正在做一些小的更新。下一个项目是使用2.03b。
以上来自于百度翻译 以下为原文 Where is 1.11? My MPLAB X IDE v3.30 only shows the next available Harmony is 1.0.10.0. We are not going to 2.03b on this project. We are just doing minor updates. The next project is using 2.03b. |
|
|
|
|
|
您可以从主MPLAB和谐页面下载HynalV1.11:HTTP://www. McCHIP.COM/MPLAB/MPLAB-Orthyy,并在底部的下载选项卡下查看。这是V1.XX系列版本中最新的(也是最后一个)。
以上来自于百度翻译 以下为原文 You can download Harmony v1.11 from the main MPLAB Harmony page: http://www.microchip.com/mplab/mplab-harmony and look under the download tab on the bottom. This is the latest (and last) of the v1.xx series of releases. |
|
|
|
|
|
|
|
|
|
|
|
确保和声版本符合MHC版本。
以上来自于百度翻译 以下为原文 Make sure the harmony version matches the MHC version. |
|
|
|
|
|
FF.C.F.OpenDIR中需要另一个修复。在我们的例子中,SysffsMax文件是1,并且尝试在无效的文件之后访问另一个有效目录,不使用Uness来允许访问另一个目录。FIX是IN fxOpenDR(UntPrTrt句柄,/*指针到目录对象以创建*/const TCHAR *路径/*指针到目录路径*/){FESREST;FATFS *FS;DuffyNAME.BUF;UTIN 32×HFATFS;dir*dj;(HFATFS=0;HFATFS & lt;SysffsMax文件;HFATFS++){if(FATFSDIROPATIOS[HFATFS])E==0){FATFSDIROBASTH[HFATFS],iUn= 1;Dj= & FATFSDIROBIDES[HFATFS]。DIROBJ;*(UUTPtRt**)句柄=(UntPrTrtt)和FATFSDIROBIDESP[HFATFS];中断;}如果(HFATFS & Gt;= SysffsMax文件){Fr.ValueDIO对象;}如果(!)DJ)FrSUnjistIdObjor;RES=CHKYLAMP(ANP;PATH,D&-GT;FS,0);FS=DJ-&FS;IF(RES=FRSK OK){InITYBUF(*DJ);RES=跟随路径(DJ,PATH);/*遵循目录*/FREILUBUFE()的路径;如果(RES=FRSK OK){/*遵循完成的*/IF(DJ-&G.DIR){/*,它不是根DR*/{ Dir[DriAtthi]和Am didir){/*对象是一个目录*/dj&=LDlClSub(fs,dj & gt;dir);} {对象不是目录*/RES=Fr.NosiPATH;}(Res=FrSok){DJ-& Gt;ID=FS & Gt;ID;RES=DrysSDI(DJ,0);/*ReNoDI**/}}(Res=Frx NoIX文件)RES=FR如果(DJ-GT;γ诺维路径;如果函数FAIL**/}否则{DJ->FS=0;}(HFATFS & lt;SysffsMax文件和AMS;RES!):DJ-& Gt=FS=0;/*使DIR对象无效;{FATSOK){FATFSdiDROPICAT[HFATFS],UnIs= 0;}/*FieldIf()*/LaveEfff(FS,RES);}
以上来自于百度翻译 以下为原文 Another fix is needed in f_opendir in ff.c. In our case SYS_FS_MAX_FILES is 1 and you try to access another valid directory after the invalid one, inUse isn't cleared out to allow this accessing another directory. Fix is in Bold. int f_opendir ( uintptr_t handle, /* Pointer to directory object to create */ const TCHAR *path /* Pointer to the directory path */ ) { FRESULT res; FATFS *fs; DEF_NAMEBUF; uint32_t hFATfs; DIR *dj; for(hFATfs = 0; hFATfs < SYS_FS_MAX_FILES; hFATfs++) { if(FATFSDirObject[hFATfs].inUse == 0) { FATFSDirObject[hFATfs].inUse = 1; dj = &FATFSDirObject[hFATfs].dirObj; *(uintptr_t *)handle = (uintptr_t)&FATFSDirObject[hFATfs]; break; } } if(hFATfs >= SYS_FS_MAX_FILES) { return FR_INVALID_OBJECT; } if (!dj) return FR_INVALID_OBJECT; res = chk_mounted(&path, &dj->fs, 0); fs = dj->fs; if (res == FR_OK) { INIT_BUF(*dj); res = follow_path(dj, path); /* Follow the path to the directory */ FREE_BUF(); if (res == FR_OK) { /* Follow completed */ if (dj->dir) { /* It is not the root dir */ if (dj->dir[DIR_Attr] & AM_DIR) { /* The object is a directory */ dj->sclust = ld_clust(fs, dj->dir); } else { /* The object is not a directory */ res = FR_NO_PATH; } } if (res == FR_OK) { dj->id = fs->id; res = dir_sdi(dj, 0); /* Rewind dir */ } } if (res == FR_NO_FILE) res = FR_NO_PATH; if (res != FR_OK) dj->fs = 0; /* Invalidate the dir object if function faild */ } else { dj->fs = 0; } if (hFATfs < SYS_FS_MAX_FILES && res != FR_OK ) { FATFSDirObject[hFATfs].inUse = 0; } /* end if() */ LEAVE_FF(fs, res); } |
|
|
|
|
|
我需要更新我对FXOPEN所做的更改。我希望这些变化能进入下一个和谐版本。我不需要检查HFATFS是否是SysffsMax文件,在另一个代码执行之前有一个检查和退出。{HFATFS.Max文件;HFATFS+++){if(FATFSDIROPATION[HFATFS],iUn==0){FATFSDIROBASTION[HFATFS],UnIs= 1;DJ=和FATFSDIROBIdStudi[HFATFS]。DIROBJ;*(UntPrTrt**)句柄=(UntPrTrtt)和FATFSDIROBIdPAS[HFATFS];中断;} if(HFATFS & Gt;= SysffsMax文件){ HFATFS;DR*DJ;(HFATFS=0)返回Fr.ValueDIO对象;}如果(!)dj){FATFSDIROPATION[HFATFS],UnSuff= 0;返回RIS= CHKYLAMP(AND;PATH,D&-GT;FS,0);FS=DJ-&G.FS;IF(RES=FRSK OK){InITYBUF(*DJ);RES=跟随路径(DJ,PATH);/*遵循目录*/FREFIUBUFE()的路径;如果(RES=FRSK OK){/*遵循完成的*/IF(DJ-&)/*它不是根dir*/f(dj-gt;dir[DriAtthi] and Am didir){/*对象是目录*/dj-gt;sClase= LDlClSub(fs,dj-gt;dir);} {对象不是目录*/RES=Fr.NoYePATH;}(Res=FRSK OK){DJ-GT;ID=FS & Gt;ID;RES=DrysSDI(DJ,0);/*ReDeDIR Dr){*/}}(RES=FRS- NONIX文件)RES=FrSoNoYePATH;IF(RES)!如果函数FAIL**/}否则{DJ-&GT;FS=0;}(RES),DJ & Gt;fs=0;/*使DIR对象无效;{FATSOK){FATFSdiDROPICAT[HFATFS],UnIs= 0;}/*FieldIf()*/LaveEfff(FS,RES);}
以上来自于百度翻译 以下为原文 I need to update the changes I made to f_open. I hope these changes get put into the next Harmony version. I didn't need to check if hFATfs is < SYS_FS_MAX_FILES, there is a check and exits before the other code is executed. int f_opendir ( uintptr_t handle, /* Pointer to directory object to create */ const TCHAR *path /* Pointer to the directory path */ ) { FRESULT res; FATFS *fs; DEF_NAMEBUF; uint32_t hFATfs; DIR *dj; for(hFATfs = 0; hFATfs < SYS_FS_MAX_FILES; hFATfs++) { if(FATFSDirObject[hFATfs].inUse == 0) { FATFSDirObject[hFATfs].inUse = 1; dj = &FATFSDirObject[hFATfs].dirObj; *(uintptr_t *)handle = (uintptr_t)&FATFSDirObject[hFATfs]; break; } } if(hFATfs >= SYS_FS_MAX_FILES) { return FR_INVALID_OBJECT; } if (!dj ) { FATFSDirObject[hFATfs].inUse = 0; return FR_INVALID_OBJECT; } res = chk_mounted(&path, &dj->fs, 0); fs = dj->fs; if (res == FR_OK) { INIT_BUF(*dj); res = follow_path(dj, path); /* Follow the path to the directory */ FREE_BUF(); if (res == FR_OK) { /* Follow completed */ if (dj->dir) { /* It is not the root dir */ if (dj->dir[DIR_Attr] & AM_DIR) { /* The object is a directory */ dj->sclust = ld_clust(fs, dj->dir); } else { /* The object is not a directory */ res = FR_NO_PATH; } } if (res == FR_OK) { dj->id = fs->id; res = dir_sdi(dj, 0); /* Rewind dir */ } } if (res == FR_NO_FILE) res = FR_NO_PATH; if (res != FR_OK) dj->fs = 0; /* Invalidate the dir object if function faild */ } else { dj->fs = 0; } if (res != FR_OK ) { FATFSDirObject[hFATfs].inUse = 0; } /* end if() */ LEAVE_FF(fs, res); } |
|
|
|
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
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 02:38 , Processed in 0.796790 second(s), Total 85, Slave 69 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2280