mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Merge pull request #1894 from mdejw/patch-1
Send serial data to sim uart only if rx_ready is set.
This commit is contained in:
commit
7f91baae3a
1 changed files with 7 additions and 5 deletions
|
@ -155,11 +155,13 @@ static int serial2console_tick(void *sess, uint64_t time_ps) {
|
|||
}
|
||||
|
||||
*s->rx_valid = 0;
|
||||
if(s->datalen) {
|
||||
*s->rx = s->databuf[s->data_start];
|
||||
s->data_start = (s->data_start + 1) % 2048;
|
||||
s->datalen--;
|
||||
*s->rx_valid = 1;
|
||||
if(*s->rx_ready) {
|
||||
if(s->datalen) {
|
||||
*s->rx = s->databuf[s->data_start];
|
||||
s->data_start = (s->data_start + 1) % 2048;
|
||||
s->datalen--;
|
||||
*s->rx_valid = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return RC_OK;
|
||||
|
|
Loading…
Reference in a new issue