mirror of https://github.com/proxmox/mirror_qemu
hw/char/stm32f2xx_usart: Do not update data register when device is disabled
When the device is disabled, the internal circuitry keeps the data register loaded and doesn't update it. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20190104182057.8778-1-philmd@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>master
parent
a8d2b06856
commit
4076618095
|
@ -53,14 +53,13 @@ static void stm32f2xx_usart_receive(void *opaque, const uint8_t *buf, int size)
|
||||||
{
|
{
|
||||||
STM32F2XXUsartState *s = opaque;
|
STM32F2XXUsartState *s = opaque;
|
||||||
|
|
||||||
s->usart_dr = *buf;
|
|
||||||
|
|
||||||
if (!(s->usart_cr1 & USART_CR1_UE && s->usart_cr1 & USART_CR1_RE)) {
|
if (!(s->usart_cr1 & USART_CR1_UE && s->usart_cr1 & USART_CR1_RE)) {
|
||||||
/* USART not enabled - drop the chars */
|
/* USART not enabled - drop the chars */
|
||||||
DB_PRINT("Dropping the chars\n");
|
DB_PRINT("Dropping the chars\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s->usart_dr = *buf;
|
||||||
s->usart_sr |= USART_SR_RXNE;
|
s->usart_sr |= USART_SR_RXNE;
|
||||||
|
|
||||||
if (s->usart_cr1 & USART_CR1_RXNEIE) {
|
if (s->usart_cr1 & USART_CR1_RXNEIE) {
|
||||||
|
|
Loading…
Reference in New Issue