interconnect
is (probably) unsound and unclear
#2954
Labels
bug
Something isn't working
peripheral:gpio
GPIO peripheral
status:needs-attention
This should be prioritized
Because
InputConnection
isClone, Send and Sync
, (and to a lesser extent,OutputConnection
is a superset ofInputConnection
), the API is prone to data races, which is UB. Consider cloning an InputSignal, sending it to the second core, and using both clones to set up some peripheral.The behaviour, when connecting multiple peripherals is also undefined (as the different peripherals may overwrite each others' settings).
We can probably leave the output-related implementation unchanged. There can only be one OutputConnection in safe code, and only a single peripheral may drive that.
For the input side, however, I think we will need to make the user set up the pin, before passing it to peripherals. This way we can ensure, that, if the user want to connect peripherals which would, by default use conflicting configuration, the user needs to specify what actually happens.
The text was updated successfully, but these errors were encountered: