完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嘿。。我的问题如下:
我使用PSoC 5,一个UART和LCD作为外围设备,两个中断连接到UART块的RX和TX中断。在主.c中,我定义了一个变量[UntUn8用户控件],我打算用UART中断来更新它:所以在中断头文件ISCXXX.H i中创建了一个条目[EXTEND UntualUnt8UsRuxMeal]。现在的问题是,每当我对顶层设计进行一些更改时,例如更改外围设备或设置——所有的API文件都被重新编译,而我的“外部”条目就消失了,编译失败。 既然我知道这一点,我可以回去再加一次,但是当有更多的变量时,它会变成一个皮塔。有什么解决办法吗?我注意到,在ISR函数内的μ码保持在某种程度上保持完整。 谢谢, 牛宿 以上来自于百度翻译 以下为原文 Hey.. my problem is as follows: I'm using the PSoC 5, with a UART and LCD as peripherals and two interrupts tied to the Rx and Tx interrupts of the UART block. In main.c I have defined a variable [volatile uint8 user_control] which i intend will be updated by the UART interrupt: So in the interrupt header file isc_xxx.h i made an entry [extern volatile uint8 user_control]. Now the problem is that whenever i mak some changes to the top design; e.g. changing peripherals or settings - all the API files are recompiled and my 'extern' entry is gone - and the compile fails. Now since I know this I am able to go back and add it again, but when there are more variables in more it'll be a PITA. Is there some workaround or anything? I notice that _code_ inside the isr functions remains intact somehow... Thanks, Abhijit |
|
相关推荐
4个回答
|
|
在每个中断.c文件中(例如,如果ISR组件实例的名称是ISR1、ISR1.C),则有一个专用区域来定义和包含看起来像这样的区域,
/*’启动ISRL11Inc*/ /*’结尾’* 只要包含,在你的情况下,ExtPin变量被放置在这个开始和结束构造中,即使执行了清洁和构建,也会保留这些内容。附图说明了相同的情况。 异硫氰酸苄氨嘧啶 729.1 K 以上来自于百度翻译 以下为原文 In every Interrupt.c file(For example if the name of ISR component instance is isr1, isr1.c), there is a dedicated region for defines and includes which looks like this, /* `#START isr_1_intc` */ /* `#END` */ As long as the includes, in your case the extern variable is placed within this start and end construct, even if a clean and build is performed the includes will be retained. Picture attached illustrates the same.
|
|
|
|
Abhijit
请不要忘记在ISR文件中包含必要的头文件。在这种情况下,您必须包括使用的UART组件的头文件(如UART.H)。应包含的外部声明和头文件应在以下几行之间写入 /*’启动iSrxRxInc**//*`*端** 下面的快照显示同样的情况。 以上来自于百度翻译 以下为原文 Abhijit, Please don't forget to include the necessary header files in the ISR file. In this case, you'll have to include the header file of the UART component used (like UART.h). The extern declaration and header files to be included should be written between the following lines /* `#START isr_rx_intc` */ /* `#END` */ The snap shot below shows the same. |
|
|
|
在中断发生时必须执行的代码应该写在CysISR(ISRXXXXILE中断)部分。必须执行的语句必须在语句之间写入。
/*’启动ISRYRXXX中断*//*`*端** 在这部分中编写的代码不会在生成时被擦除。 下面的快照显示相同的内容: 以上来自于百度翻译 以下为原文 The code which has to be executed upon occurrence of interrupt should be written in the section CY_ISR(isr_xxx_Interrupt). And the statements which has to be executed has to be written between the statements /* `#START isr_rx_Interrupt` */ /* `#END` */ The code written within this part will not be erased upon build. The snapshot below shows the same: |
|
|
|
啊,是的。谢谢!不知何故完全错过了明显的…
阿布希特 以上来自于百度翻译 以下为原文 Ah yes.. thanks! Somehow completely missed the obvious... ~Abhijit |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2113 浏览 1 评论
1861 浏览 1 评论
3673 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1794 浏览 6 评论
1540 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
582浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
434浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
445浏览 2评论
393浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
1025浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-31 06:25 , Processed in 0.887954 second(s), Total 84, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号