Wallacoloo / printipi

3d printing directly through the Raspberry Pi's GPIO pins
MIT License
141 stars 43 forks source link

Warn whenever two IoPins refer to the same physical pin #74

Open Wallacoloo opened 9 years ago

Wallacoloo commented 9 years ago

Right now, if I had two different pieces of code that make use of the same gpio pin on the device, they can easily interfere with eachother; one expects the pin to be in read mode while the other expects it to be in write mode.

Luckily, when a pin is instantiated, we can search the list of living pins to see if another IoPin uses the same PrimitiveIoPin.id() value, in which case we can warn the user of this undefined behavior.