In the SoftwareSerial library, I see the beginning of recv() as follows
void SoftwareSerial::recv()
{
#if GCC_VERSION < 40302
// Work-around for avr-gcc 4.3.0 OSX version bug
// Preserve the registers that the compiler misses
// (courtesy of Arduino forum user *etracer*)
asm volatile(
"push r18 \n\t"
"push r19 \n\t"
"push r20 \n\t"
"push r21 \n\t"
"push r22 \n\t"
"push r23 \n\t"
"push r26 \n\t"
"push r27 \n\t"
::);
#endif
uint8_t d = 0;
// If RX line is high, then we don't see any start bit
// so interrupt is probably not for us
if (_inverse_logic ? rx_pin_read() : !rx_pin_read())
{
This comment seems to be testing for if the pin change was from low to high, or high to low. If you are using inverse logic - where the line is held high, and start bits are low - then a call to rx_pin_read() should return 0.
This doesn't seem correct. In inverse logic the line is held high and a drop indicates a start bit.
Is the SoftwareSerial library ignoring the start bit and relying on some kind of return to zero break between the start bit and any subsequent bits?
It seems like it can't handle start bits followed by high bits since there would be no change in the pin state.
