mirror of
https://github.com/ndeadly/MissionControl
synced 2024-11-22 20:33:07 +00:00
btdrv-mitm: zero motion control data when converting incoming controller reports
This commit is contained in:
parent
a2e1e9159f
commit
a7c22b451c
6 changed files with 7 additions and 3 deletions
|
@ -72,6 +72,7 @@ namespace ams::controller {
|
|||
switch_report->id = 0x30;
|
||||
switch_report->input0x30.conn_info = 0x0;
|
||||
switch_report->input0x30.battery = m_battery | m_charging;
|
||||
std::memset(switch_report->input0x30.motion, 0, sizeof(switch_report->input0x30.motion));
|
||||
switch_report->input0x30.timer = os::ConvertToTimeSpan(os::GetSystemTick()).GetMilliSeconds() & 0xff;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace ams::controller {
|
|||
switch_report->id = 0x30;
|
||||
switch_report->input0x30.conn_info = 0x0;
|
||||
switch_report->input0x30.battery = m_battery | m_charging;
|
||||
std::memset(switch_report->input0x30.motion, 0, sizeof(switch_report->input0x30.motion));
|
||||
switch_report->input0x30.timer = os::ConvertToTimeSpan(os::GetSystemTick()).GetMilliSeconds() & 0xff;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace ams::controller {
|
|||
switch_report->id = 0x30;
|
||||
switch_report->input0x30.conn_info = 0x0;
|
||||
switch_report->input0x30.battery = m_battery | m_charging;
|
||||
std::memset(switch_report->input0x30.motion, 0, sizeof(switch_report->input0x30.motion));
|
||||
switch_report->input0x30.timer = os::ConvertToTimeSpan(os::GetSystemTick()).GetMilliSeconds() & 0xff;
|
||||
}
|
||||
|
||||
|
|
|
@ -102,9 +102,8 @@ namespace ams::controller {
|
|||
SwitchStickData right_stick;
|
||||
uint8_t vibrator;
|
||||
|
||||
Switch6AxisData imu_0ms;
|
||||
Switch6AxisData imu_5ms;
|
||||
Switch6AxisData imu_10ms;
|
||||
// IMU samples at 0, 5 and 10ms
|
||||
Switch6AxisData motion[3];
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
struct SwitchInputReport0x31;
|
||||
|
|
|
@ -73,6 +73,7 @@ namespace ams::controller {
|
|||
switch_report->id = 0x30;
|
||||
switch_report->input0x30.conn_info = 0x0;
|
||||
switch_report->input0x30.battery = m_battery | m_charging;
|
||||
std::memset(switch_report->input0x30.motion, 0, sizeof(switch_report->input0x30.motion));
|
||||
switch_report->input0x30.timer = os::ConvertToTimeSpan(os::GetSystemTick()).GetMilliSeconds() & 0xff;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace ams::controller {
|
|||
switch_report->id = 0x30;
|
||||
switch_report->input0x30.conn_info = 0x0;
|
||||
switch_report->input0x30.battery = m_battery | m_charging;
|
||||
std::memset(switch_report->input0x30.motion, 0, sizeof(switch_report->input0x30.motion));
|
||||
switch_report->input0x30.timer = os::ConvertToTimeSpan(os::GetSystemTick()).GetMilliSeconds() & 0xff;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue