There's a lot of repeated logic that's pretty much identical for all the drives. For examples, things like printing the state of the drive or initializing the drive. All drives also have an upper/lower limit. I think this shows there's a missing abstraction that wraps the drive in a structure containing the pointer to the drive and the associated limits. Once you have that structure, it would also be much easier to just extract shared code like initializing and printing the state.
Inside : markhor_hw_interface_flippers.cpp
There's a lot of repeated logic that's pretty much identical for all the drives. For examples, things like printing the state of the drive or initializing the drive. All drives also have an upper/lower limit. I think this shows there's a missing abstraction that wraps the drive in a structure containing the pointer to the drive and the associated limits. Once you have that structure, it would also be much easier to just extract shared code like initializing and printing the state.
_Originally posted by @IceSentry in https://github.com/clubcapra/markhor/pull/21#discussion_r739869643_