|
@@ -100,10 +100,10 @@ static int32_t pof_thread_worker(void* context) {
|
|
|
uint32_t now = furi_get_tick();
|
|
uint32_t now = furi_get_tick();
|
|
|
uint32_t flags = furi_thread_flags_wait(EventAll, FuriFlagWaitAny, timeout);
|
|
uint32_t flags = furi_thread_flags_wait(EventAll, FuriFlagWaitAny, timeout);
|
|
|
if(flags & EventRx) { //fast flag
|
|
if(flags & EventRx) { //fast flag
|
|
|
- UNUSED(pof_usb_receive);
|
|
|
|
|
|
|
|
|
|
- uint8_t buf[POF_USB_RX_MAX_SIZE];
|
|
|
|
|
|
|
+ // 360 portals use interrupts for everything
|
|
|
if(virtual_portal->speaker || virtual_portal->type == PoFXbox360) {
|
|
if(virtual_portal->speaker || virtual_portal->type == PoFXbox360) {
|
|
|
|
|
+ uint8_t buf[POF_USB_RX_MAX_SIZE];
|
|
|
len_data = pof_usb_receive(dev, buf, POF_USB_RX_MAX_SIZE);
|
|
len_data = pof_usb_receive(dev, buf, POF_USB_RX_MAX_SIZE);
|
|
|
// https://github.com/xMasterX/all-the-plugins/blob/dev/base_pack/wav_player/wav_player_hal.c
|
|
// https://github.com/xMasterX/all-the-plugins/blob/dev/base_pack/wav_player/wav_player_hal.c
|
|
|
if(len_data > 0) {
|
|
if(len_data > 0) {
|
|
@@ -114,8 +114,20 @@ static int32_t pof_thread_worker(void* context) {
|
|
|
}
|
|
}
|
|
|
FURI_LOG_RAW_I("\r\n");
|
|
FURI_LOG_RAW_I("\r\n");
|
|
|
*/
|
|
*/
|
|
|
|
|
+ if(pof_usb->virtual_portal->type == PoFXbox360) {
|
|
|
|
|
+ memset(tx_data, 0, sizeof(tx_data));
|
|
|
|
|
+ // prepend packet with xinput header
|
|
|
|
|
+ int send_len =
|
|
|
|
|
+ virtual_portal_process_message(virtual_portal, buf + 2, tx_data + 2);
|
|
|
|
|
+ if(send_len > 0) {
|
|
|
|
|
+ tx_data[0] = 0x0b;
|
|
|
|
|
+ tx_data[1] = 0x14;
|
|
|
|
|
+ pof_usb_send(dev, tx_data, POF_USB_ACTUAL_OUTPUT_SIZE);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // hid portals use control transfers
|
|
|
if(pof_usb->virtual_portal->type == PoFHID && pof_usb->dataAvailable > 0 ) {
|
|
if(pof_usb->virtual_portal->type == PoFHID && pof_usb->dataAvailable > 0 ) {
|
|
|
memset(tx_data, 0, sizeof(tx_data));
|
|
memset(tx_data, 0, sizeof(tx_data));
|
|
|
int send_len =
|
|
int send_len =
|
|
@@ -124,17 +136,6 @@ static int32_t pof_thread_worker(void* context) {
|
|
|
pof_usb_send(dev, tx_data, POF_USB_ACTUAL_OUTPUT_SIZE);
|
|
pof_usb_send(dev, tx_data, POF_USB_ACTUAL_OUTPUT_SIZE);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(pof_usb->virtual_portal->type == PoFXbox360 && len_data > 0) {
|
|
|
|
|
- memset(tx_data, 0, sizeof(tx_data));
|
|
|
|
|
- // prepend packet with xinput header
|
|
|
|
|
- int send_len =
|
|
|
|
|
- virtual_portal_process_message(virtual_portal, buf + 2, tx_data + 2);
|
|
|
|
|
- if(send_len > 0) {
|
|
|
|
|
- tx_data[0] = 0x0b;
|
|
|
|
|
- tx_data[1] = 0x14;
|
|
|
|
|
- pof_usb_send(dev, tx_data, POF_USB_ACTUAL_OUTPUT_SIZE);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
// Check next status time since the timeout based one might be starved by incoming packets.
|
|
// Check next status time since the timeout based one might be starved by incoming packets.
|
|
|
if(now > lastStatus + timeout) {
|
|
if(now > lastStatus + timeout) {
|