Open pablosun opened 5 years ago
Possible implementation
void LRemote_addControls(std::vector<LRemoteUIControl *> lists) {
for (auto control : lists) {
LRemote.addControl(*control);
}
}
Sample usage
LRemote_addControls({
&buttonForward, &buttonBackward,
&buttonTL, &buttonTR,
&buttonSL, &buttonSR,
&buttonRun, &buttonClimb,
&buttonRotateX, &buttonRotateY, &buttonRotateZ,
&buttonTwist,
});
detail usage can be found at: https://github.com/SmallpTsai/hexapod-v2-7697/blob/master/software/hexapod7697/src/normal_mode.cpp
It would be more convenient if we can pass LRemote UI controls in to an {} constructor or array initializers to chain creations together.