Skip to content

Commit 21282bb

Browse files
committed
examples: buffer macro update
1 parent 405a363 commit 21282bb

File tree

44 files changed

+177
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+177
-178
lines changed

examples/device/audio_4_channel_mic/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ extern "C" {
7171
* Tinyusb use follows macros to declare transferring memory so that they can be put
7272
* into those specific section.
7373
* e.g
74-
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
75-
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
74+
* - CFG_TUSB_MEM_SECTION : TU_ATTR_SECTION(".usb_ram")
75+
* - CFG_TUSB_MEM_ALIGN_SIZE : 4
7676
*/
7777
#ifndef CFG_TUSB_MEM_SECTION
7878
#define CFG_TUSB_MEM_SECTION
7979
#endif
8080

81-
#ifndef CFG_TUSB_MEM_ALIGN
82-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
81+
#ifndef CFG_TUSB_MEM_ALIGN_SIZE
82+
#define CFG_TUSB_MEM_ALIGN_SIZE 4
8383
#endif
8484

8585
//--------------------------------------------------------------------

examples/device/audio_4_channel_mic_freertos/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ extern "C" {
7777
* Tinyusb use follows macros to declare transferring memory so that they can be put
7878
* into those specific section.
7979
* e.g
80-
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
81-
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
80+
* - CFG_TUSB_MEM_SECTION : TU_ATTR_SECTION(".usb_ram")
81+
* - CFG_TUSB_MEM_ALIGN_SIZE : 4
8282
*/
8383
#ifndef CFG_TUSB_MEM_SECTION
8484
#define CFG_TUSB_MEM_SECTION
8585
#endif
8686

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

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

examples/device/audio_test/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ extern "C" {
7474
* Tinyusb use follows macros to declare transferring memory so that they can be put
7575
* into those specific section.
7676
* e.g
77-
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
78-
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
77+
* - CFG_TUSB_MEM_SECTION : TU_ATTR_SECTION(".usb_ram")
78+
* - CFG_TUSB_MEM_ALIGN_SIZE : 4
7979
*/
8080
#ifndef CFG_TUSB_MEM_SECTION
8181
#define CFG_TUSB_MEM_SECTION
8282
#endif
8383

84-
#ifndef CFG_TUSB_MEM_ALIGN
85-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
84+
#ifndef CFG_TUSB_MEM_ALIGN_SIZE
85+
#define CFG_TUSB_MEM_ALIGN_SIZE 4
8686
#endif
8787

8888
//--------------------------------------------------------------------

examples/device/audio_test_freertos/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ extern "C" {
8080
* Tinyusb use follows macros to declare transferring memory so that they can be put
8181
* into those specific section.
8282
* e.g
83-
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
84-
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
83+
* - CFG_TUSB_MEM_SECTION : TU_ATTR_SECTION(".usb_ram")
84+
* - CFG_TUSB_MEM_ALIGN_SIZE : 4
8585
*/
8686
#ifndef CFG_TUSB_MEM_SECTION
8787
#define CFG_TUSB_MEM_SECTION
8888
#endif
8989

90-
#ifndef CFG_TUSB_MEM_ALIGN
91-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
90+
#ifndef CFG_TUSB_MEM_ALIGN_SIZE
91+
#define CFG_TUSB_MEM_ALIGN_SIZE 4
9292
#endif
9393

9494
//--------------------------------------------------------------------

examples/device/audio_test_multi_rate/src/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ static const uint8_t bytesPerSampleAltList[CFG_TUD_AUDIO_FUNC_1_N_FORMATS] =
8383

8484
audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1]; // Volume range state
8585

86-
8786
// Audio test data
88-
CFG_TUD_MEM_ALIGN uint8_t test_buffer_audio[CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX];
87+
TU_ATTR_ALIGNED(4) uint8_t test_buffer_audio[CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX];
8988
uint16_t startVal = 0;
9089

9190
void led_blinking_task(void);

examples/device/audio_test_multi_rate/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ extern "C" {
7676
* Tinyusb use follows macros to declare transferring memory so that they can be put
7777
* into those specific section.
7878
* e.g
79-
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
80-
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
79+
* - CFG_TUSB_MEM_SECTION : TU_ATTR_SECTION(".usb_ram")
80+
* - CFG_TUSB_MEM_ALIGN_SIZE : 4
8181
*/
8282
#ifndef CFG_TUSB_MEM_SECTION
8383
#define CFG_TUSB_MEM_SECTION
8484
#endif
8585

86-
#ifndef CFG_TUSB_MEM_ALIGN
87-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
86+
#ifndef CFG_TUSB_MEM_ALIGN_SIZE
87+
#define CFG_TUSB_MEM_ALIGN_SIZE 4
8888
#endif
8989

9090
//--------------------------------------------------------------------

examples/device/board_test/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@
5959
* Tinyusb use follows macros to declare transferring memory so that they can be put
6060
* into those specific section.
6161
* e.g
62-
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
63-
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
62+
* - CFG_TUSB_MEM_SECTION : TU_ATTR_SECTION(".usb_ram")
63+
* - CFG_TUSB_MEM_ALIGN_SIZE : 4
6464
*/
6565
#ifndef CFG_TUSB_MEM_SECTION
6666
#define CFG_TUSB_MEM_SECTION
6767
#endif
6868

69-
#ifndef CFG_TUSB_MEM_ALIGN
70-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
69+
#ifndef CFG_TUSB_MEM_ALIGN_SIZE
70+
#define CFG_TUSB_MEM_ALIGN_SIZE 4
7171
#endif
7272

7373
#ifdef __cplusplus

examples/device/cdc_dual_ports/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@
7171
* Tinyusb use follows macros to declare transferring memory so that they can be put
7272
* into those specific section.
7373
* e.g
74-
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
75-
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
74+
* - CFG_TUSB_MEM_SECTION : TU_ATTR_SECTION(".usb_ram")
75+
* - CFG_TUSB_MEM_ALIGN_SIZE : 4
7676
*/
7777
#ifndef CFG_TUSB_MEM_SECTION
7878
#define CFG_TUSB_MEM_SECTION
7979
#endif
8080

81-
#ifndef CFG_TUSB_MEM_ALIGN
82-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
81+
#ifndef CFG_TUSB_MEM_ALIGN_SIZE
82+
#define CFG_TUSB_MEM_ALIGN_SIZE 4
8383
#endif
8484

8585
//--------------------------------------------------------------------

examples/device/cdc_msc/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@
7171
* Tinyusb use follows macros to declare transferring memory so that they can be put
7272
* into those specific section.
7373
* e.g
74-
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
75-
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
74+
* - CFG_TUSB_MEM_SECTION : TU_ATTR_SECTION(".usb_ram")
75+
* - CFG_TUSB_MEM_ALIGN_SIZE : 4
7676
*/
7777
#ifndef CFG_TUSB_MEM_SECTION
7878
#define CFG_TUSB_MEM_SECTION
7979
#endif
8080

81-
#ifndef CFG_TUSB_MEM_ALIGN
82-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
81+
#ifndef CFG_TUSB_MEM_ALIGN_SIZE
82+
#define CFG_TUSB_MEM_ALIGN_SIZE 4
8383
#endif
8484

8585
//--------------------------------------------------------------------

examples/device/cdc_msc_freertos/src/tusb_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@
7878
* Tinyusb use follows macros to declare transferring memory so that they can be put
7979
* into those specific section.
8080
* e.g
81-
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
82-
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
81+
* - CFG_TUSB_MEM_SECTION : TU_ATTR_SECTION(".usb_ram")
82+
* - CFG_TUSB_MEM_ALIGN_SIZE : 4
8383
*/
8484
#ifndef CFG_TUSB_MEM_SECTION
8585
#define CFG_TUSB_MEM_SECTION
8686
#endif
8787

88-
#ifndef CFG_TUSB_MEM_ALIGN
89-
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
88+
#ifndef CFG_TUSB_MEM_ALIGN_SIZE
89+
#define CFG_TUSB_MEM_ALIGN_SIZE 4
9090
#endif
9191

9292
//--------------------------------------------------------------------

0 commit comments

Comments
 (0)