|
|
|
|
|
by lynaghk
1937 days ago
|
|
Author here. I considered the enum "solution" but found the match on usize tuples to be clearer because it requires less code. Introducing an enum doesn't help because it neither: + helps better model the domain: P0 and P1 are already device ports, wrapping doesn't clarify anything, + nor does it buy you safety; arguably I'd say it makes it less safe, since the real risk with this sort of code is that you fat finger when copy/pasting between the electrical schematic and the firmware, so by adding extra wrapping you further obscure the pin assignments. |
|