Closed dbrgn closed 4 years ago
Should we keep the hardware version as an integer, or should I map it to an enum (where 0 would correspond to V2_0 and others would correspond to Unknown(u8))?
The enum would probably make the handling more readable:
match hw_version {
HardwareVersion::V2_0 => {},
HardwareVersion::Unsupported(version) => { panic!("Unsupported hardware version {}", version); }
}
Updated, I confirmed that it works!
A simple hardware version detector on PA12 / PB4 / PB5.
Current output via serial:
Should we keep the hardware version as an integer, or should I map it to an enum (where 0 would correspond to
V2_0
and others would correspond toUnknown(u8)
)?