stevieb9 / rpi-wiringpi

Perl interface to Raspberry Pi's board, GPIO and various sensors and ICs
7 stars 1 forks source link

if one script fails (in multi), ensure that only that object's pins are reset #118

Closed stevieb9 closed 5 years ago

stevieb9 commented 5 years ago

Currently, the entire shared memory is wiped, which will clearly break other separate objects in other processes.

stevieb9 commented 5 years ago

Perhaps each Pi object should have a checksum created on initialization, stored both in the object as well as the shared memory, and each pin registered should be associated with that Pi checksum, so only that object's pins are cleaned up on failure or closure.

stevieb9 commented 5 years ago

One way to generate a random identifier:

perl -wMstrict -MDigest::MD5 -E 'say Digest::MD5::md5_hex(rand)'

4f08e6d04f61b97ac8858ce11cf230d1
stevieb9 commented 5 years ago

When an object fails to instantiate due to conflicting pins, don't delete the entire shared memory.