完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我对编程微控制器非常新,所以如果我问一个愚蠢的问题,对不起。我下载了“USB中断回环示例”,但它在主C开头有一个WieloOP,这阻止了我执行我的程序的其余部分。我需要它来运行类似于您的“嵌套中断示例”。有没有办法将环路保持在主C之外,或者在USB电缆插入到电路板之前忽略它?我一直在C编程和Psoc工作不到3个月,所以任何帮助将不胜感激。谢谢。
以上来自于百度翻译 以下为原文 I am very new to programming microcontrollers so if I am asking a dumb question, sorry. I downloaded the "USB Interrupt Loopback Example" but it has a while loop in the beginning of main c that is preventing me from implementing the rest of my program. I need it to operate similar to your "nesting interrupts example". Is there a way to keep the loop out of main c, or a way to ignore it until the u*** cable is plugged into the board? I have been working with c programming and Psoc less than 3 months so any help would be appreciated. Thanks. |
|
相关推荐
1个回答
|
|
你好,
这是一个你问的非常有效的问题。USB的工程实例的Web项目致力于demonstarte USB功能。因此有一个while循环,不退出到USB枚举完成。 一旦你的USB设备(USB芯片,这就是PSoC)插入主机(PC机或类似的装置)分配一个配置了USB设备。的apiu***fs_bgetconfiguration(),检查是否有一个有效的配置已被分配。因此,正如你所指出的,PSoC器件将留在网页环,而(!u***fs_bgetconfiguration()),直到PSoC器件列举作为一个USB设备得到有效的设备配置。 但在一般的应用,这是没有必要的,你可以开发自己的自定义项目代码和添加一个条件,检查是否一个有效的配置已分配“如果(u***fs_bgetconfiguration())”。你可以设置一个标志,一旦USB设备得到了有效的配置一开始你所有的USB事务。 随便问任何问题。每个人都要经历的学习曲线,我们对你有帮助! -乌达扬 以上来自于百度翻译 以下为原文 Hi, It's a very valid question that you have asked. The USB Example projects on the web are projects dedicated to demonstarte the USB capability. Hence there is a while loop which is not exited untill USB enumeration is complete. Once your USB device(any USB chip, here it is PSoC) is inserted, the host(PC or similar device) assigns a configuration to the USB device. The API USBFS_bGetConfiguration ( ), checks if a valid configuration has been assigned. Hence as you pointed out, PSoC device will stay in the while loop, while( ! USBFS_bGetConfiguration ( ) ), untill PSoC device enumerates as a USB device and gets a valid device configuration. However in general application this is not necessary, you can develop your custom project code and add a condition that checks to see if a valid configuration has been assigned "if( USBFS_bGetConfiguration ( ) )". You can set a flag once the USB device has got valid configuration an then start all your USB transactions. Feel free to ask any questions. Everybody has to go through the learning curve, we are there to help you ! -Udayan |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2105 浏览 1 评论
1851 浏览 1 评论
3669 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1786 浏览 6 评论
1536 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
570浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
423浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
437浏览 2评论
384浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
915浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 01:51 , Processed in 0.826398 second(s), Total 78, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号