1
0
Fork 0
forked from suyu/suyu

Merge pull request #801 from purpasmart96/hid_stubs

HID: Stub DisableAccelerometer and DisableGyroscopeLow
This commit is contained in:
bunnei 2015-05-22 20:44:22 -04:00
commit 41531eeb32
4 changed files with 47 additions and 9 deletions

View file

@ -136,6 +136,16 @@ void EnableAccelerometer(Service::Interface* self) {
LOG_WARNING(Service_HID, "(STUBBED) called");
}
void DisableAccelerometer(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
event_accelerometer->Signal();
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_WARNING(Service_HID, "(STUBBED) called");
}
void EnableGyroscopeLow(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
@ -146,6 +156,16 @@ void EnableGyroscopeLow(Service::Interface* self) {
LOG_WARNING(Service_HID, "(STUBBED) called");
}
void DisableGyroscopeLow(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
event_gyroscope->Signal();
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_WARNING(Service_HID, "(STUBBED) called");
}
void GetSoundVolume(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();

View file

@ -162,12 +162,12 @@ const PadState PAD_CIRCLE_DOWN = {{1u << 31}};
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
* 2 : IPC Command Structure translate-header
* 3 : Handle to HID_User shared memory
* 4 : Event signaled by HID_User
* 5 : Event signaled by HID_User
* 6 : Event signaled by HID_User
* 3 : Handle to HID shared memory
* 4 : Event signaled by HID
* 5 : Event signaled by HID
* 6 : Event signaled by HID
* 7 : Gyroscope event
* 8 : Event signaled by HID_User
* 8 : Event signaled by HID
*/
void GetIPCHandles(Interface* self);
@ -180,6 +180,15 @@ void GetIPCHandles(Interface* self);
*/
void EnableAccelerometer(Interface* self);
/**
* HID::DisableAccelerometer service function
* Inputs:
* None
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void DisableAccelerometer(Interface* self);
/**
* HID::EnableGyroscopeLow service function
* Inputs:
@ -189,6 +198,15 @@ void EnableAccelerometer(Interface* self);
*/
void EnableGyroscopeLow(Interface* self);
/**
* HID::DisableGyroscopeLow service function
* Inputs:
* None
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void DisableGyroscopeLow(Interface* self);
/**
* HID::GetSoundVolume service function
* Inputs:

View file

@ -14,9 +14,9 @@ const Interface::FunctionInfo FunctionTable[] = {
{0x000B0000, nullptr, "StartAnalogStickCalibration"},
{0x000E0000, nullptr, "GetAnalogStickCalibrateParam"},
{0x00110000, EnableAccelerometer, "EnableAccelerometer"},
{0x00120000, nullptr, "DisableAccelerometer"},
{0x00120000, DisableAccelerometer, "DisableAccelerometer"},
{0x00130000, EnableGyroscopeLow, "EnableGyroscopeLow"},
{0x00140000, nullptr, "DisableGyroscopeLow"},
{0x00140000, DisableGyroscopeLow, "DisableGyroscopeLow"},
{0x00150000, nullptr, "GetGyroscopeLowRawToDpsCoefficient"},
{0x00160000, nullptr, "GetGyroscopeLowCalibrateParam"},
{0x00170000, GetSoundVolume, "GetSoundVolume"},

View file

@ -12,9 +12,9 @@ namespace HID {
const Interface::FunctionInfo FunctionTable[] = {
{0x000A0000, GetIPCHandles, "GetIPCHandles"},
{0x00110000, EnableAccelerometer, "EnableAccelerometer"},
{0x00120000, nullptr, "DisableAccelerometer"},
{0x00120000, DisableAccelerometer, "DisableAccelerometer"},
{0x00130000, EnableGyroscopeLow, "EnableGyroscopeLow"},
{0x00140000, nullptr, "DisableGyroscopeLow"},
{0x00140000, DisableGyroscopeLow, "DisableGyroscopeLow"},
{0x00150000, nullptr, "GetGyroscopeLowRawToDpsCoefficient"},
{0x00160000, nullptr, "GetGyroscopeLowCalibrateParam"},
{0x00170000, GetSoundVolume, "GetSoundVolume"},