| 182 | } |
| 183 | |
| 184 | void SwitchHDLHandler::UpdateOutput() |
| 185 | { |
| 186 | // Process a single output packet from a buffer |
| 187 | if (R_SUCCEEDED(m_controller->OutputBuffer())) |
| 188 | return; |
| 189 | |
| 190 | // Process rumble values if supported |
| 191 | if (DoesControllerSupport(m_controller->GetType(), SUPPORTS_RUMBLE)) |
| 192 | { |
| 193 | Result rc; |
| 194 | HidVibrationValue value; |
| 195 | rc = hidGetActualVibrationValue(m_vibrationDeviceHandle, &value); |
| 196 | if (R_SUCCEEDED(rc)) |
| 197 | m_controller->SetRumble(static_cast<uint8_t>(value.amp_high * 255.0f), static_cast<uint8_t>(value.amp_low * 255.0f)); |
| 198 | } |
| 199 | |
| 200 | svcSleepThread(1e+7L); |
| 201 | } |
| 202 | |
| 203 | HiddbgHdlsSessionId &SwitchHDLHandler::GetHdlsSessionId() |
| 204 | { |
no test coverage detected