I have created a black square in the screen (static image) and other simple modifications.
The first problem that I want to solve is this:
when I type '1' to change resolution, '1' and 'ENTER' are stored into the buffer and read by board. ENTER is seen as '/r','/n' and for this reason is displayed 2 times 'invalid selection'
this is a part of the code
while (!fResSet)
{
DemoCRMenu();
/* Wait for data on UART */
while (!XUartPs_IsReceiveData(UART_BASEADDR))
{}
/* Store the first character in the UART recieve FIFO and echo it */
userInput = XUartPs_ReadReg(UART_BASEADDR, XUARTPS_FIFO_OFFSET);
/*FIRST MOD*/
.
/*first part of code*/
.
switch (userInput)
{
.
.
/*second part of code*/
.
default :
xil_printf("\n\rInvalid Selection");
TimerDelay(500000);
}
}
At the first I try to solve it replacing the SWITCH-CASE and modifying the condition (userInput !='\n' etc) , but this not resolve the problem.
then I try to solve it flushing the UART FIFO when I wrote /*FIRST MOD*/ but this not solve the problem.
this is the code for flush UART FIFO
/* Flush UART FIFO */
while (XUartPs_IsReceiveData(UART_BASEADDR))
{
XUartPs_ReadReg(UART_BASEADDR, XUARTPS_FIFO_OFFSET);
}
Question
Andrea_cau
Hi,
I use zybo board and I want to modify HDMI_IN project.
https://reference.digilentinc.com/learn/programmable-logic/tutorials/zybo-hdmi-demo/start
I have created a black square in the screen (static image) and other simple modifications.
The first problem that I want to solve is this:
when I type '1' to change resolution, '1' and 'ENTER' are stored into the buffer and read by board. ENTER is seen as '/r','/n' and for this reason is displayed 2 times 'invalid selection'
this is a part of the code
while (!fResSet)
{
DemoCRMenu();
/* Wait for data on UART */
while (!XUartPs_IsReceiveData(UART_BASEADDR))
{}
/* Store the first character in the UART recieve FIFO and echo it */
userInput = XUartPs_ReadReg(UART_BASEADDR, XUARTPS_FIFO_OFFSET);
/*FIRST MOD*/
.
/*first part of code*/
.
switch (userInput)
{
.
.
/*second part of code*/
.
default :
xil_printf("\n\rInvalid Selection");
TimerDelay(500000);
}
}
At the first I try to solve it replacing the SWITCH-CASE and modifying the condition (userInput !='\n' etc) , but this not resolve the problem.
then I try to solve it flushing the UART FIFO when I wrote /*FIRST MOD*/ but this not solve the problem.
this is the code for flush UART FIFO
/* Flush UART FIFO */
while (XUartPs_IsReceiveData(UART_BASEADDR))
{
XUartPs_ReadReg(UART_BASEADDR, XUARTPS_FIFO_OFFSET);
}
can you help me?
Andrea
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.