@@ -38,7 +38,7 @@ const char *ep_dir_string[] = {
3838 "in" ,
3939};
4040
41- static inline void _hw_endpoint_lock_update (__unused struct hw_endpoint * ep , __unused int delta ) {
41+ TU_ATTR_ALWAYS_INLINE static inline void _hw_endpoint_lock_update (__unused struct hw_endpoint * ep , __unused int delta ) {
4242 // todo add critsec as necessary to prevent issues between worker and IRQ...
4343 // note that this is perhaps as simple as disabling IRQs because it would make
4444 // sense to have worker and IRQ on same core, however I think using critsec is about equivalent.
@@ -69,15 +69,15 @@ void rp2040_usb_init(void)
6969 usb_hw -> muxing = USB_USB_MUXING_TO_PHY_BITS | USB_USB_MUXING_SOFTCON_BITS ;
7070}
7171
72- void hw_endpoint_reset_transfer (struct hw_endpoint * ep )
72+ void __no_inline_not_in_flash_func ( hw_endpoint_reset_transfer ) (struct hw_endpoint * ep )
7373{
7474 ep -> active = false;
7575 ep -> remaining_len = 0 ;
7676 ep -> xferred_len = 0 ;
7777 ep -> user_buf = 0 ;
7878}
7979
80- void _hw_endpoint_buffer_control_update32 (struct hw_endpoint * ep , uint32_t and_mask , uint32_t or_mask ) {
80+ void __no_inline_not_in_flash_func ( _hw_endpoint_buffer_control_update32 ) (struct hw_endpoint * ep , uint32_t and_mask , uint32_t or_mask ) {
8181 uint32_t value = 0 ;
8282 if (and_mask ) {
8383 value = * ep -> buffer_control & and_mask ;
@@ -108,7 +108,7 @@ void _hw_endpoint_buffer_control_update32(struct hw_endpoint *ep, uint32_t and_m
108108}
109109
110110// prepare buffer, return buffer control
111- static uint32_t prepare_ep_buffer (struct hw_endpoint * ep , uint8_t buf_id )
111+ static uint32_t __no_inline_not_in_flash_func ( prepare_ep_buffer ) (struct hw_endpoint * ep , uint8_t buf_id )
112112{
113113 uint16_t const buflen = tu_min16 (ep -> remaining_len , ep -> wMaxPacketSize );
114114 ep -> remaining_len = (uint16_t )(ep -> remaining_len - buflen );
@@ -143,7 +143,7 @@ static uint32_t prepare_ep_buffer(struct hw_endpoint *ep, uint8_t buf_id)
143143}
144144
145145// Prepare buffer control register value
146- static void _hw_endpoint_start_next_buffer (struct hw_endpoint * ep )
146+ static void __no_inline_not_in_flash_func ( _hw_endpoint_start_next_buffer ) (struct hw_endpoint * ep )
147147{
148148 uint32_t ep_ctrl = * ep -> endpoint_control ;
149149
@@ -205,7 +205,7 @@ void hw_endpoint_xfer_start(struct hw_endpoint *ep, uint8_t *buffer, uint16_t to
205205}
206206
207207// sync endpoint buffer and return transferred bytes
208- static uint16_t sync_ep_buffer (struct hw_endpoint * ep , uint8_t buf_id )
208+ static uint16_t __no_inline_not_in_flash_func ( sync_ep_buffer ) (struct hw_endpoint * ep , uint8_t buf_id )
209209{
210210 uint32_t buf_ctrl = _hw_endpoint_buffer_control_get_value32 (ep );
211211 if (buf_id ) buf_ctrl = buf_ctrl >> 16 ;
@@ -241,7 +241,7 @@ static uint16_t sync_ep_buffer(struct hw_endpoint *ep, uint8_t buf_id)
241241 return xferred_bytes ;
242242}
243243
244- static void _hw_endpoint_xfer_sync (struct hw_endpoint * ep )
244+ static void __no_inline_not_in_flash_func ( _hw_endpoint_xfer_sync ) (struct hw_endpoint * ep )
245245{
246246 // Update hw endpoint struct with info from hardware
247247 // after a buff status interrupt
@@ -292,7 +292,7 @@ static void _hw_endpoint_xfer_sync (struct hw_endpoint *ep)
292292}
293293
294294// Returns true if transfer is complete
295- bool hw_endpoint_xfer_continue (struct hw_endpoint * ep )
295+ bool __no_inline_not_in_flash_func ( hw_endpoint_xfer_continue ) (struct hw_endpoint * ep )
296296{
297297 _hw_endpoint_lock_update (ep , 1 );
298298 // Part way through a transfer
0 commit comments