summaryrefslogtreecommitdiff
path: root/examples/device/cdc_msc_hid/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-11-23 15:28:32 +0700
committerGitHub <[email protected]>2018-11-23 15:28:32 +0700
commita1c596490aa40863cd5f1e36a821157ffeab2af6 (patch)
treec8246e10d303414f222a5ba15480c04010240c8e /examples/device/cdc_msc_hid/src
parent2edfd5b555388d10a9013eb598c9a73a4ee1afa9 (diff)
parent394a22ecf7760cce630a8186260f1c79901af934 (diff)
Merge pull request #13 from hathach/devlocal
add unplugged event for nrf5x
Diffstat (limited to 'examples/device/cdc_msc_hid/src')
-rw-r--r--examples/device/cdc_msc_hid/src/tusb_config.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/examples/device/cdc_msc_hid/src/tusb_config.h b/examples/device/cdc_msc_hid/src/tusb_config.h
index 29ed8a8e0..9bc97ecff 100644
--- a/examples/device/cdc_msc_hid/src/tusb_config.h
+++ b/examples/device/cdc_msc_hid/src/tusb_config.h
@@ -58,10 +58,24 @@
#define CFG_TUSB_DEBUG 2
#define CFG_TUSB_OS OPT_OS_NONE
+/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
+ * Tinyusb use follows macros to declare transferring memory so that they can be put
+ * into those specific section.
+ * e.g
+ * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
+ * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
+ */
+#ifndef CFG_TUSB_MEM_SECTION
+#define CFG_TUSB_MEM_SECTION
+#endif
+
+#ifndef CFG_TUSB_MEM_ALIGN
+#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
+#endif
+
//--------------------------------------------------------------------
// DEVICE CONFIGURATION
//--------------------------------------------------------------------
-
#define CFG_TUD_ENDOINT0_SIZE 64
/*------------- Descriptors -------------*/
@@ -132,12 +146,6 @@
*/
#define CFG_TUD_HID_ASCII_TO_KEYCODE_LOOKUP 1
-//--------------------------------------------------------------------
-// USB RAM PLACEMENT
-//--------------------------------------------------------------------
-#define CFG_TUSB_ATTR_USBRAM
-#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
-
#ifdef __cplusplus
}