Eliminate some redundant constants.
This commit is contained in:
parent
71f4bf25a7
commit
f8e52bd83a
|
@ -86,7 +86,7 @@ void Wiimote::QueueReport(u8 rpt_id, const void* _data, unsigned int size)
|
||||||
rpt[0] = WM_SET_REPORT | WM_BT_OUTPUT;
|
rpt[0] = WM_SET_REPORT | WM_BT_OUTPUT;
|
||||||
rpt[1] = rpt_id;
|
rpt[1] = rpt_id;
|
||||||
std::copy_n(data, size, rpt.begin() + 2);
|
std::copy_n(data, size, rpt.begin() + 2);
|
||||||
m_write_reports.Push(rpt);
|
m_write_reports.Push(std::move(rpt));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Wiimote::DisableDataReporting()
|
void Wiimote::DisableDataReporting()
|
||||||
|
@ -163,13 +163,13 @@ void Wiimote::InterruptChannel(const u16 channel, const void* const _data, const
|
||||||
&& !SConfig::GetInstance().m_WiimoteEnableSpeaker)
|
&& !SConfig::GetInstance().m_WiimoteEnableSpeaker)
|
||||||
{
|
{
|
||||||
// Translate speaker data reports into rumble reports.
|
// Translate speaker data reports into rumble reports.
|
||||||
rpt[1] = WM_CMD_RUMBLE;
|
rpt[1] = WM_RUMBLE;
|
||||||
// Keep only the rumble bit.
|
// Keep only the rumble bit.
|
||||||
rpt[2] &= 0x1;
|
rpt[2] &= 0x1;
|
||||||
rpt.resize(3);
|
rpt.resize(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_write_reports.Push(rpt);
|
m_write_reports.Push(std::move(rpt));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Wiimote::Read()
|
bool Wiimote::Read()
|
||||||
|
@ -273,13 +273,13 @@ bool Wiimote::Prepare(int _index)
|
||||||
index = _index;
|
index = _index;
|
||||||
|
|
||||||
// core buttons, no continuous reporting
|
// core buttons, no continuous reporting
|
||||||
u8 const mode_report[] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_CMD_REPORT_TYPE, 0, 0x30};
|
u8 const mode_report[] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_REPORT_MODE, 0, WM_REPORT_CORE};
|
||||||
|
|
||||||
// Set the active LEDs and turn on rumble.
|
// Set the active LEDs and turn on rumble.
|
||||||
u8 const led_report[] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_CMD_LED, u8(WIIMOTE_LED_1 << index | 0x1)};
|
u8 const led_report[] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_LEDS, u8(WIIMOTE_LED_1 << index | 0x1)};
|
||||||
|
|
||||||
// Turn off rumble
|
// Turn off rumble
|
||||||
u8 rumble_report[] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_CMD_RUMBLE, 0};
|
u8 rumble_report[] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_RUMBLE, 0};
|
||||||
|
|
||||||
// Request status report
|
// Request status report
|
||||||
u8 const req_status_report[] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_REQUEST_STATUS, 0};
|
u8 const req_status_report[] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_REQUEST_STATUS, 0};
|
||||||
|
|
|
@ -41,20 +41,6 @@
|
||||||
#define WM_SET_REPORT 0xA0
|
#define WM_SET_REPORT 0xA0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: duplicated in WiimoteHid.h
|
|
||||||
// Commands
|
|
||||||
#define WM_CMD_RUMBLE 0x10
|
|
||||||
#define WM_CMD_LED 0x11
|
|
||||||
#define WM_CMD_REPORT_TYPE 0x12
|
|
||||||
#define WM_CMD_IR 0x13
|
|
||||||
#define WM_CMD_SPEAKER_ENABLE 0x14
|
|
||||||
#define WM_CMD_CTRL_STATUS 0x15
|
|
||||||
#define WM_CMD_WRITE_DATA 0x16
|
|
||||||
#define WM_CMD_READ_DATA 0x17
|
|
||||||
#define WM_CMD_SPEAKER_DATA 0x18
|
|
||||||
#define WM_CMD_SPEAKER_MUTE 0x19
|
|
||||||
#define WM_CMD_IR_2 0x1A
|
|
||||||
|
|
||||||
#define WM_BT_INPUT 0x01
|
#define WM_BT_INPUT 0x01
|
||||||
#define WM_BT_OUTPUT 0x02
|
#define WM_BT_OUTPUT 0x02
|
||||||
|
|
||||||
|
@ -73,12 +59,12 @@
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Available bluetooth stacks for Windows.
|
// Available bluetooth stacks for Windows.
|
||||||
typedef enum win_bt_stack_t
|
enum win_bt_stack_t
|
||||||
{
|
{
|
||||||
MSBT_STACK_UNKNOWN,
|
MSBT_STACK_UNKNOWN,
|
||||||
MSBT_STACK_MS,
|
MSBT_STACK_MS,
|
||||||
MSBT_STACK_BLUESOLEIL
|
MSBT_STACK_BLUESOLEIL
|
||||||
} win_bt_stack_t;
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // WIIMOTE_COMM_H
|
#endif // WIIMOTE_COMM_H
|
||||||
|
|
Loading…
Reference in New Issue