summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-04-27 17:57:52 +0700
committerhathach <[email protected]>2022-04-27 17:57:52 +0700
commit4a661dead0899cb154325a8257d19281f2536af3 (patch)
tree48850cad386aeba513798ca4907a132ca4bf7ade /src
parentfd827a80a9f3b1e482cc8b1609c055cbad252b37 (diff)
add TU_ATTR_FAST_FUNC for rp2040 __not_in_flash() section
Diffstat (limited to 'src')
-rw-r--r--src/common/tusb_mcu.h7
-rw-r--r--src/device/usbd.c3
2 files changed, 9 insertions, 1 deletions
diff --git a/src/common/tusb_mcu.h b/src/common/tusb_mcu.h
index 8eb4ad475..c1cf2a810 100644
--- a/src/common/tusb_mcu.h
+++ b/src/common/tusb_mcu.h
@@ -228,6 +228,8 @@
#elif TU_CHECK_MCU(OPT_MCU_RP2040)
#define TUP_DCD_ENDPOINT_MAX 16
+ #define TU_ATTR_FAST_FUNC __attribute__((section(".time_critical.tinyusb")))
+
//------------- Silabs -------------//
#elif TU_CHECK_MCU(OPT_MCU_EFM32GG)
#define TUP_USBIP_DWC2
@@ -282,4 +284,9 @@
#define TUP_RHPORT_HIGHSPEED 0x00
#endif
+// fast function, normally mean placing function in SRAM
+#ifndef TU_ATTR_FAST_FUNC
+ #define TU_ATTR_FAST_FUNC
+#endif
+
#endif
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 12b4071af..4c2cd3abd 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -1071,7 +1071,8 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
//--------------------------------------------------------------------+
// DCD Event Handler
//--------------------------------------------------------------------+
-void __no_inline_not_in_flash_func(dcd_event_handler)(dcd_event_t const * event, bool in_isr)
+TU_ATTR_FAST_FUNC
+void dcd_event_handler(dcd_event_t const * event, bool in_isr)
{
switch (event->event_id)
{