完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
你好,
我使用UART给用户信息通过RX缓冲区,然后基于相同的RX中断做出决定。因此,当我给第一个tiMM字符I/P时,分支到ISR,但是当我尝试给另一个用户输入由RXbuffer接收时(当我在ISR内部)并通过变量读取RX缓冲区时,如选择,[选择= UARTHI CRADARCHARE()];选择只剩下先前的用户。价值和控制进入ISR的开始。 当我在ISR内部时,我无法重写RX缓冲区的内容,这是将其分支到函数中适当的代码片段所必需的。这可以做吗?请帮忙。 以上来自于百度翻译 以下为原文 Hi People, I'm using an UART to give user info thru RX buffer and then make decisions based on RX interrupts triggered by the same. So when I give a character i/p for the first tym, branching to ISR occurs but when I try to give another user-input to be received by the RX buffer (when I'm inside the ISR) and read the RX buffer through a variable, say choice, [choice=UART_cReadChar(); ], choice is left with only the previous user value & controls goes to the beginning of the ISR. I'm not able to over-write the contents of RX buffer when I'm inside the ISR, which is essential to branch it to appropriate code fragments in functions. Can this be done ? please help. |
|
相关推荐
7个回答
|
|
项目档案附呈。请帮忙。特别提到的是鲍伯和Dana。
谢谢, 皇家音乐学院 以上来自于百度翻译 以下为原文 Project archive attached. Please help. Special mention - Bob & Dana. Thanks, RAM |
|
|
|
|
|
|
|
这不是要使用中断例程的方式。想象一下,只要ISR被执行,就不会有其他中断。字符串的输出会使系统停滞相当长的时间。
通常(如你所见,这不是我的第一次),我写了一个“循环缓冲区”来保存我在ISR中接收的字符。在主循环中,检查包含字符的缓冲区,如果是,则从缓冲区中读取并适当处理。 鲍勃 以上来自于百度翻译 以下为原文 This is not the way interrupt routines are ment to be used. Imagine, that as long as the isr is executed no other interrupts will be served. The output of a string will stall your system for a comparable long time. Usually (as you see it is not my first time) I write a "Circular Buffer" to save the characters I receive from within the ISR. in the main-loop I check the buffer for containing a character, if so, read it off the buffer and handle appropiately. Bob |
|
|
|
…正如我刚才看到的,您在UART中启用了用LJMP切断到ISR的命令缓冲区。在Flash和RAM中禁用缓冲区来节省一些空间。
平均鲍勃 以上来自于百度翻译 以下为原文 ... and as I just see, you enabled in the UART the command buffer which you cut off with the LJMP to your ISR. Disable the buffer to save some space in flash and ram. Mean Bob |
|
|
|
鲍勃, 谢谢。我不知道他们自己配置了一个ISR的UARTAS RX。 我想把一个字符串转换成一个双值。在我上传的最后一个PROJ中,我想把用户输入的字符串转换成一个字符串,然后用一个“0”结尾。我尝试使用“AOF”函数IVECIFRAFT提供。但它表示数据类型不匹配。const字符的赋值语句 请告诉我同样的语法。例如,双变量CVA= ATOF(*pTrVar);-这是正确的吗?如果我错了请纠正我 皇家音乐学院 以上来自于百度翻译 以下为原文 Bob, Thanks a lot. I wasnt aware that they had themselves configured RX of UART as an ISR. I want to convert a string to a double value. Say in, the last proj I uploaded, I want to convert the gain the user enters into a string after I terminate the same with a ' |