core: hid: Enable pulling color data from controllers

This commit is contained in:
Narr the Reg 2022-12-20 13:23:31 -06:00
parent a4074001fe
commit ed5fa10e97
9 changed files with 246 additions and 2 deletions

View file

@ -304,6 +304,20 @@ Common::Input::NfcStatus TransformToNfc(const Common::Input::CallbackStatus& cal
return nfc;
}
Common::Input::BodyColorStatus TransformToColor(const Common::Input::CallbackStatus& callback) {
Common::Input::BodyColorStatus color{};
switch (callback.type) {
case Common::Input::InputType::Color:
color = callback.color_status;
break;
default:
LOG_ERROR(Input, "Conversion from type {} to color not implemented", callback.type);
break;
}
return color;
}
void SanitizeAnalog(Common::Input::AnalogStatus& analog, bool clamp_value) {
const auto& properties = analog.properties;
float& raw_value = analog.raw_value;