完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
以上代码来自MCC生成的文件。该文件是UPART库的一部分,用于PIC24F设备。UART5YRXXFIFOH长度常数的目的是什么?我想,如果选择了“3/4”或“接收缓冲区已满”的中断而不是“数据可用”中断,则应该将其更改为3或4。这个假设我是对的还是这个常数被用于其他事物?提前THNX
以上来自于百度翻译 以下为原文 #define UART5_TX_FIFO_LENGTH 1 #define UART5_RX_FIFO_LENGTH 1 void __attribute__ ( ( interrupt, no_auto_psv ) ) _U5RXInterrupt( void ) { int count = 0; while((count < UART5_RX_FIFO_LENGTH) && (U5STAbits.URXDA == 1)) { count++; *uart5_obj.rxTail = U5RXREG; uart5_obj.rxTail++; if(uart5_obj.rxTail == (uart5_rxByteQ + UART5_CONFIG_RX_BYTEQ_LENGTH)) { uart5_obj.rxTail = uart5_rxByteQ; } uart5_obj.rxStatus.s.empty = false; if(uart5_obj.rxTail == uart5_obj.rxHead) { //Sets the flag RX full uart5_obj.rxStatus.s.full = true; break; } } IFS6bits.U5RXIF = false; } Hi The above code is from an MCC generated file. The file is a part of the UART library for a pic24f device What is the purpose of the UART5_RX_FIFO_LENGTH constant? I was thinking that this should be changed to 3 or 4 in case the interrupt on "3/4" or "receive buffer full" was selected instead of the "data available" interrupt. Am I right with this assumption or is this constant used for something else? Thnx in advance |
|
相关推荐
4个回答
|
|
UARTXXTXYFIFOH长度和UARTXXRXFIFOH长度存储了一次处理N个字节的硬件能力。不应修改此值。(如果这个值增加,就会损坏数据流。)我已经输入了一张使这个代码更有效率的票。实际上,这个硬件不需要count变量,而代码生成器的目的是帮助排除不适用于特定处理器MCCV3XX-4229的代码。
以上来自于百度翻译 以下为原文 The UARTx_TX_FIFO_LENGTH and UARTx_RX_FIFO_LENGTH store the hardware's capability to handle being fed N bytes at a time. This value should not be modified. (If this value is increased, you will corrupt your data stream.) I've entered a ticket to make this code more efficient. As-is, the count variable is simply not needed for this hardware - and the point of a code generator is to help exclude code that doesn't apply to a specific processor. MCCV3XX-4229. |
|
|
|
它是否反映了PIC的硬件能力?例如,PIC24F GB1或GB4系列具有4-Deep, .-In-.-Out(FIFO)发送数据缓冲区4-Deep FIFO接收数据缓冲区.#defined也设置为1
以上来自于百度翻译 以下为原文 Should it reflect the hardware capabilites of a PIC or not ? For example the PIC24F GB1 or GB4 family has
|
|
|
|
与这些#defines相关的完整代码片段是:因此,如果用户选择的PIC具有4深FIFO,那么应该相应地反映在这里。事实上,它不是bug。上面的票据MCCV3XX-4229是为了提高效率。我已经创建了一个具有更高优先级的新的bug票据,以解决不正确的值:MCCV3XX-4231。
以上来自于百度翻译 以下为原文 The full code snippet related to these #defines is: /** UART Hardware FIFO Buffer Length @Summary Defines the length of the Transmit and Receive FIFOs */ #define UART1_TX_FIFO_LENGTH 1 #define UART1_RX_FIFO_LENGTH 1 So if the user's chosen PIC has a 4-deep FIFO, then it should be reflected here accordingly. The fact that it is not is a bug. The above ticket MCCV3XX-4229 is for an effiency improvement. I've created a new bug ticket with a higher priority to address the incorrect value: MCCV3XX-4231. |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3209 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2260 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
682浏览 0评论
579浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 03:45 , Processed in 1.328955 second(s), Total 54, Slave 48 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号