make all hcd/dcd function used in isr into ram with __no_inline_not_in_flash_func() for faster irq handling
result is 1KB of code moved from rom -> ram
This commit is contained in:
		| @@ -79,7 +79,7 @@ static struct hw_endpoint *get_dev_ep(uint8_t dev_addr, uint8_t ep_addr) | ||||
|   return NULL; | ||||
| } | ||||
|  | ||||
| static inline uint8_t dev_speed(void) | ||||
| TU_ATTR_ALWAYS_INLINE static inline uint8_t dev_speed(void) | ||||
| { | ||||
|     return (usb_hw->sie_status & USB_SIE_STATUS_SPEED_BITS) >> USB_SIE_STATUS_SPEED_LSB; | ||||
| } | ||||
| @@ -91,7 +91,7 @@ static bool need_pre(uint8_t dev_addr) | ||||
|     return hcd_port_speed_get(0) != tuh_speed_get(dev_addr); | ||||
| } | ||||
|  | ||||
| static void hw_xfer_complete(struct hw_endpoint *ep, xfer_result_t xfer_result) | ||||
| static void __no_inline_not_in_flash_func(hw_xfer_complete)(struct hw_endpoint *ep, xfer_result_t xfer_result) | ||||
| { | ||||
|     // Mark transfer as done before we tell the tinyusb stack | ||||
|     uint8_t dev_addr = ep->dev_addr; | ||||
| @@ -101,7 +101,7 @@ static void hw_xfer_complete(struct hw_endpoint *ep, xfer_result_t xfer_result) | ||||
|     hcd_event_xfer_complete(dev_addr, ep_addr, xferred_len, xfer_result, true); | ||||
| } | ||||
|  | ||||
| static void _handle_buff_status_bit(uint bit, struct hw_endpoint *ep) | ||||
| static void __no_inline_not_in_flash_func(_handle_buff_status_bit)(uint bit, struct hw_endpoint *ep) | ||||
| { | ||||
|     usb_hw_clear->buf_status = bit; | ||||
|     bool done = hw_endpoint_xfer_continue(ep); | ||||
| @@ -111,7 +111,7 @@ static void _handle_buff_status_bit(uint bit, struct hw_endpoint *ep) | ||||
|     } | ||||
| } | ||||
|  | ||||
| static void hw_handle_buff_status(void) | ||||
| static void __no_inline_not_in_flash_func(hw_handle_buff_status)(void) | ||||
| { | ||||
|     uint32_t remaining_buffers = usb_hw->buf_status; | ||||
|     pico_trace("buf_status 0x%08x\n", remaining_buffers); | ||||
| @@ -159,7 +159,7 @@ static void hw_handle_buff_status(void) | ||||
|     } | ||||
| } | ||||
|  | ||||
| static void hw_trans_complete(void) | ||||
| static void __no_inline_not_in_flash_func(hw_trans_complete)(void) | ||||
| { | ||||
|   if (usb_hw->sie_ctrl & USB_SIE_CTRL_SEND_SETUP_BITS) | ||||
|   { | ||||
| @@ -175,7 +175,7 @@ static void hw_trans_complete(void) | ||||
|   } | ||||
| } | ||||
|  | ||||
| static void hcd_rp2040_irq(void) | ||||
| static void __no_inline_not_in_flash_func(hcd_rp2040_irq)(void) | ||||
| { | ||||
|     uint32_t status = usb_hw->ints; | ||||
|     uint32_t handled = 0; | ||||
| @@ -240,6 +240,12 @@ static void hcd_rp2040_irq(void) | ||||
|     } | ||||
| } | ||||
|  | ||||
| void __no_inline_not_in_flash_func(hcd_int_handler)(uint8_t rhport) | ||||
| { | ||||
|   (void) rhport; | ||||
|   hcd_rp2040_irq(); | ||||
| } | ||||
|  | ||||
| static struct hw_endpoint *_next_free_interrupt_ep(void) | ||||
| { | ||||
|     struct hw_endpoint *ep = NULL; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach