Fixed original softserial code
Bit end timer must by shifted by half-bit period to startbit edge, so that next edges are in middle of bit interval. This behavior was masked with old timer code, but noise immunity was probably very low.
This commit is contained in:
parent
98c0d0b5dd
commit
3b20b74c00
|
@ -337,7 +337,7 @@ void onSerialRxPinChange(timerCCHandlerRec_t *cbRec, captureCompare_t capture)
|
|||
// synchronise bit counter
|
||||
// FIXME this reduces functionality somewhat as receiving breaks concurrent transmission on all ports because
|
||||
// the next callback to the onSerialTimer will happen too early causing transmission errors.
|
||||
TIM_SetCounter(softSerial->rxTimerHardware->tim, 0);
|
||||
TIM_SetCounter(softSerial->rxTimerHardware->tim, softSerial->rxTimerHardware->tim->ARR / 2);
|
||||
if (softSerial->isTransmittingData) {
|
||||
softSerial->transmissionErrors++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue