Description
libgps is using pst.spin's full-duplex serial code, and is currently always reading from an Rx pin and setting a Tx pin to an output.
We need to have it either always disable the Tx pin (ie: leave that pin as an input), or conditionally disable it if the given pin is a certain value (ie: 32).
The choice depends on whether we only need to receive (Rx) from GPSes.
The pst.spin serial object's PASM code (used in the cog to perform full-duplex serial) always sets the Tx pin to an output, UNLESS you specify mode 0b0100 (open drain/source tx), in which case it will leave it as an input (which is what we want).
Problem is, gps_run.c always sets the mode to 0:
gps_ser = fdserial_open(_gps_rx_pin, _gps_tx_pin, 0, _gps_baud);
I'm not sure if we ever need to have receive and transmit for any current of future GPS, but the solution would be to update gps_run.c to either
- always set mode to 0b0100, or
- set mode to 0 except when _gps_tx_pin is the special-value 32, in which case mode is set to 0b0100