Skip to content

Commit 76dae8d

Browse files
committed
update host example to use new tuh mem macros
1 parent 71fb646 commit 76dae8d

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

examples/dual/host_hid_to_device_cdc/src/tusb_config.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@
9595
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
9696
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
9797
*/
98-
#ifndef CFG_TUSB_MEM_SECTION
99-
#define CFG_TUSB_MEM_SECTION
98+
#ifndef CFG_TUD_MEM_SECTION
99+
#define CFG_TUD_MEM_SECTION
100100
#endif
101101

102-
#ifndef CFG_TUSB_MEM_ALIGN
103-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
102+
#ifndef CFG_TUD_MEM_ALIGN
103+
#define CFG_TUD_MEM_ALIGN __attribute__ ((aligned(4)))
104104
#endif
105105

106106
//--------------------------------------------------------------------
@@ -128,6 +128,14 @@
128128
// Size of buffer to hold descriptors and other data used for enumeration
129129
#define CFG_TUH_ENUMERATION_BUFSIZE 256
130130

131+
#ifndef CFG_TUH_MEM_SECTION
132+
#define CFG_TUH_MEM_SECTION
133+
#endif
134+
135+
#ifndef CFG_TUH_MEM_ALIGN
136+
#define CFG_TUH_MEM_ALIGN __attribute__ ((aligned(4)))
137+
#endif
138+
131139
#define CFG_TUH_HUB 1
132140
// max device support (excluding hub device)
133141
#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 4 : 1) // hub typically has 4 ports

examples/host/bare_api/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@
8080
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
8181
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
8282
*/
83-
#ifndef CFG_TUSB_MEM_SECTION
84-
#define CFG_TUSB_MEM_SECTION
83+
#ifndef CFG_TUH_MEM_SECTION
84+
#define CFG_TUH_MEM_SECTION
8585
#endif
8686

87-
#ifndef CFG_TUSB_MEM_ALIGN
88-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
87+
#ifndef CFG_TUH_MEM_ALIGN
88+
#define CFG_TUH_MEM_ALIGN __attribute__ ((aligned(4)))
8989
#endif
9090

9191
//--------------------------------------------------------------------

examples/host/cdc_msc_hid/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@
8080
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
8181
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
8282
*/
83-
#ifndef CFG_TUSB_MEM_SECTION
84-
#define CFG_TUSB_MEM_SECTION
83+
#ifndef CFG_TUH_MEM_SECTION
84+
#define CFG_TUH_MEM_SECTION
8585
#endif
8686

87-
#ifndef CFG_TUSB_MEM_ALIGN
88-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
87+
#ifndef CFG_TUH_MEM_ALIGN
88+
#define CFG_TUH_MEM_ALIGN __attribute__ ((aligned(4)))
8989
#endif
9090

9191
//--------------------------------------------------------------------

examples/host/hid_controller/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@
8080
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
8181
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
8282
*/
83-
#ifndef CFG_TUSB_MEM_SECTION
84-
#define CFG_TUSB_MEM_SECTION
83+
#ifndef CFG_TUH_MEM_SECTION
84+
#define CFG_TUH_MEM_SECTION
8585
#endif
8686

87-
#ifndef CFG_TUSB_MEM_ALIGN
88-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
87+
#ifndef CFG_TUH_MEM_ALIGN
88+
#define CFG_TUH_MEM_ALIGN __attribute__ ((aligned(4)))
8989
#endif
9090

9191
//--------------------------------------------------------------------

examples/host/msc_file_explorer/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@
8080
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
8181
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
8282
*/
83-
#ifndef CFG_TUSB_MEM_SECTION
84-
#define CFG_TUSB_MEM_SECTION
83+
#ifndef CFG_TUH_MEM_SECTION
84+
#define CFG_TUH_MEM_SECTION
8585
#endif
8686

87-
#ifndef CFG_TUSB_MEM_ALIGN
88-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
87+
#ifndef CFG_TUH_MEM_ALIGN
88+
#define CFG_TUH_MEM_ALIGN __attribute__ ((aligned(4)))
8989
#endif
9090

9191
//--------------------------------------------------------------------

0 commit comments

Comments
 (0)