63 bool click = buttonClickState.
val & mask;
64 buttonClickState.
val &= ~mask;
85 for (uint8_t i = 0; i < len; i++) {
86 D_PrintHex<uint8_t > (buf[i], 0x80);
92 memcpy(&ps5Data, buf + 1, min((uint8_t)(len - 1),
MFK_CASTUINT8T sizeof(ps5Data)));
93 else if (buf[0] == 0x31) {
96 Notify(
PSTR(
"\r\nReport is too short: "), 0x80);
97 D_PrintHex<uint8_t > (len, 0x80);
101 memcpy(&ps5Data, buf + 2, min((uint8_t)(len - 2),
MFK_CASTUINT8T sizeof(ps5Data)));
103 #ifdef DEBUG_USB_HOST
104 Notify(
PSTR(
"\r\nUnknown report id: "), 0x80);
105 D_PrintHex<uint8_t > (buf[0], 0x80);
107 D_PrintHex<uint8_t > (len, 0x80);
112 if (ps5Data.
btn.
val != oldButtonState.
val) {
113 buttonClickState.
val = ps5Data.
btn.
val & ~oldButtonState.
val;
120 if (checkDpad(
RIGHT))
121 newDpad |= 1 <<
RIGHT;
123 newDpad |= 1 <<
DOWN;
125 newDpad |= 1 <<
LEFT;
126 if (newDpad != oldDpad) {
127 buttonClickState.
dpad = newDpad & ~oldDpad;
142 for (i = 0; i <
sizeof(ps5Data.
hatValue); i++)
145 oldButtonState.
val = 0;
146 for (i = 0; i <
sizeof(ps5Data.
trigger); i++)
148 for (i = 0; i <
sizeof(ps5Data.
xy.
finger)/
sizeof(ps5Data.
xy.
finger[0]); i++)
153 buttonClickState.
dpad = 0;
163 ps5Output.
r = ps5Output.
g = ps5Output.
b = 0;