summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pwm_appl/df10ch_pwm_appl.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/pwm_appl/df10ch_pwm_appl.c b/pwm_appl/df10ch_pwm_appl.c
index f31240a..25623b3 100644
--- a/pwm_appl/df10ch_pwm_appl.c
+++ b/pwm_appl/df10ch_pwm_appl.c
@@ -321,19 +321,17 @@ ISR(USART0_RXC_vect)
uint8_t i = rxwpos;
uint8_t p = i + 1;
CHECK_RXBUF_END(p);
-
- if (bit_is_set(UCSR0A, FE0))
- set_bit(rx_err_status, COMM_ERR_FRAME);
- else if (bit_is_set(UCSR0A, DOR0))
- set_bit(rx_err_status, COMM_ERR_OVERRUN);
- else if (p == rxrpos)
+ if (p == rxrpos)
set_bit(rx_err_status, COMM_ERR_OVERFLOW);
else
- {
- if (bit_is_set(UCSR0B, RXB80))
- rxspos = i; // save start of request message
rxwpos = p; // set data valid
- }
+
+ if (bit_is_set(UCSR0A, DOR0))
+ set_bit(rx_err_status, COMM_ERR_OVERRUN);
+ if (bit_is_set(UCSR0A, FE0))
+ set_bit(rx_err_status, COMM_ERR_FRAME);
+ if (bit_is_set(UCSR0B, RXB80))
+ rxspos = i; // save start of request message
rxbuf[i] = UDR0; // read data
}
while (bit_is_set(UCSR0A, RXC0));