Possible issue with lib_uart
Posted: Wed Jul 18, 2018 4:29 pm
There is fragment of code in uart library to wait for stop bit
In the case when level_test is 0 - event is set to wait for 1 and with one stop bit the second event is set to wait for 0 in state WAITING_FOR_INPUT - no real wait for hi (stop bit)
It causes the problem in the case that there is just single one to zero (start bit) transition at the input which causes library to read bits until zero to one transition.
Is it intended?
wbr
malo
Code: Select all
case INPUTTING_STOP_BIT:
int level_test = p_rxd.input();
if (level_test == 0) {
p_rxd.event_when_pins_eq(1);
state = WAITING_FOR_HIGH;
}
stop_bit_count--;
t += bit_time;
if (stop_bit_count == 0) {
p_rxd.event_when_pins_eq(0);
state = WAITING_FOR_INPUT;
}
break;
}
break;
It causes the problem in the case that there is just single one to zero (start bit) transition at the input which causes library to read bits until zero to one transition.
Is it intended?
wbr
malo