d/qwerty: Implement haptic output

This commit is contained in:
Mateo de Mayo 2021-03-11 17:26:16 -03:00
parent 4ea696bfdd
commit 8b81afeb59

View file

@ -116,7 +116,16 @@ qwerty_update_inputs(struct xrt_device *xd)
static void
qwerty_set_output(struct xrt_device *xd, enum xrt_output_name name, union xrt_output_value *value)
{
return;
struct qwerty_device *qd = qwerty_device(xd);
float frequency = value->vibration.frequency;
float amplitude = value->vibration.amplitude;
time_duration_ns duration = value->vibration.duration;
if (amplitude || duration || frequency) {
QWERTY_INFO(qd,
"[%s] Haptic output: \n"
"\tfrequency=%.2f amplitude=%.2f duration=%ld",
xd->str, frequency, amplitude, duration);
}
}
static void