summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-03-31 12:56:53 +0700
committerhathach <[email protected]>2022-03-31 12:56:53 +0700
commite94d11a5b39cae08f39722eaa5f6ac4d527a329b (patch)
tree5fb0e2dfbe23978536aa106960acd692644a534a /src
parente2f0aef93b246368e1f6bdf101604e73d252801a (diff)
implement pio_usb_irq_handler
Diffstat (limited to 'src')
-rw-r--r--src/portable/raspberrypi/pio/hcd_pio.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/portable/raspberrypi/pio/hcd_pio.c b/src/portable/raspberrypi/pio/hcd_pio.c
index e4a4e2450..254acf1d2 100644
--- a/src/portable/raspberrypi/pio/hcd_pio.c
+++ b/src/portable/raspberrypi/pio/hcd_pio.c
@@ -101,7 +101,7 @@ void hcd_port_reset_end(uint8_t rhport)
if (fullspeed_flag && get_port_pin_status(root) == PORT_PIN_FS_IDLE) {
root->root_device = &usb_device[0];
if (!root->root_device->connected) {
- configure_fullspeed_host(pp, &pio_host_config, root);
+// configure_fullspeed_host(pp, &pio_host_config, root);
root->root_device->is_fullspeed = true;
root->root_device->is_root = true;
root->root_device->connected = true;
@@ -111,7 +111,7 @@ void hcd_port_reset_end(uint8_t rhport)
} else if (!fullspeed_flag && get_port_pin_status(root) == PORT_PIN_LS_IDLE) {
root->root_device = &usb_device[0];
if (!root->root_device->connected) {
- configure_lowspeed_host(pp, &pio_host_config, root);
+// configure_lowspeed_host(pp, &pio_host_config, root);
root->root_device->is_fullspeed = false;
root->root_device->is_root = true;
root->root_device->connected = true;
@@ -217,6 +217,7 @@ bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet
return false;
}
+
bool hcd_edpt_control_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8], uint8_t* data)
{
int ret;
@@ -242,7 +243,6 @@ bool hcd_edpt_control_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t const setup
return ret == 0;
}
-
//bool hcd_edpt_busy(uint8_t dev_addr, uint8_t ep_addr)
//{
// // EPX is shared, so multiple device addresses and endpoint addresses share that
@@ -265,4 +265,24 @@ bool hcd_edpt_clear_stall(uint8_t dev_addr, uint8_t ep_addr)
return true;
}
+// IRQ Handler
+void pio_usb_irq_handler(uint8_t root_id)
+{
+ root_port_t* port = PIO_USB(root_id);
+
+ if ( port->ints & PIO_USB_INTS_CONNECT_BITS )
+ {
+ hcd_event_device_attach(root_id+1, true);
+
+ port->ints &= ~PIO_USB_INTS_CONNECT_BITS;
+ }
+
+ if ( port->ints & PIO_USB_INTS_DISCONNECT_BITS )
+ {
+ hcd_event_device_remove(root_id+1, true);
+
+ port->ints &= ~PIO_USB_INTS_DISCONNECT_BITS;
+ }
+}
+
#endif