mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-29 21:32:50 -08:00
Fix battery value HID
This commit is contained in:
1 parent
951b96d548
commit
428f2ba774
1 file changed
+1
-1
@@ -59,7 +59,7 @@ private fun decodeAccel(data: ByteArray, offset: Int): Vector3 {
|
||||
)
|
||||
}
|
||||
|
||||
private fun decodeBattery(raw: Int): Float = if (raw == 128) 1f else (raw and 127).toFloat()
|
||||
private fun decodeBattery(raw: Int): Float = if (raw == 128) 1f else (raw and 127).toFloat() / 100f
|
||||
|
||||
private fun decodeBatteryVoltage(raw: Int): Float = (raw.toFloat() + 245f) / 100f
|
||||
|
||||
|
||||
Reference in new issue
Block a user