PaulStoffregen / AltSoftSerial

Software emulated serial using hardware timers for improved compatibility
http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html
328 stars 131 forks source link

Half duplex? #38

Closed lutorm closed 7 years ago

lutorm commented 7 years ago

Hi,

I want to use AltSoftSerial for a half-duplex TTL level serial link. The simplest way to do this would be to have the Rx pin directly hooked to the line, but that requires being able to temporarily disable reception while a transmission is in progress (to avoid self-reception).

It looks like I should be able to do this just by calling DISABLE_INT_INPUT_CAPTURE(); to disable the input capture interrupt before calling write(), and then enabling it again with ENABLE_INT_INPUT_CAPTURE(); when the transmission is over.

Do you see any problems with this approach?

Thanks,

/Patrik J.

PaulStoffregen commented 7 years ago

Sorry, can't help with this (maybe on a forum, but not here as a github issue). Might work, but you're on your own.