Skip to content

Commit 2c4b77b

Browse files
committed
more esp32 sync issue
1 parent b79a383 commit 2c4b77b

File tree

15 files changed

+240
-10
lines changed

15 files changed

+240
-10
lines changed

src/class/audio/audio_device.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@
6060

6161
#include "audio_device.h"
6262

63+
//--------------------------------------------------------------------+
64+
// ESP32 out-of-sync
65+
//--------------------------------------------------------------------+
66+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
67+
#define tu_static static
68+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
69+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
70+
#endif
71+
72+
#ifndef CFG_TUD_MEM_SECTION
73+
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
74+
#endif
75+
76+
#ifndef CFG_TUD_LOG_LEVEL
77+
#define CFG_TUD_LOG_LEVEL 2
78+
#endif
79+
6380
//--------------------------------------------------------------------+
6481
// MACRO CONSTANT TYPEDEF
6582
//--------------------------------------------------------------------+

src/class/bth/bth_device.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@
3434
#include "bth_device.h"
3535
#include <device/usbd_pvt.h>
3636

37+
//--------------------------------------------------------------------+
38+
// ESP32 out-of-sync
39+
//--------------------------------------------------------------------+
40+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
41+
#define tu_static static
42+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
43+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
44+
#endif
45+
46+
#ifndef CFG_TUD_MEM_SECTION
47+
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
48+
#endif
49+
50+
#ifndef CFG_TUD_LOG_LEVEL
51+
#define CFG_TUD_LOG_LEVEL 2
52+
#endif
53+
3754
//--------------------------------------------------------------------+
3855
// MACRO CONSTANT TYPEDEF
3956
//--------------------------------------------------------------------+

src/class/cdc/cdc_device.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,27 @@
3333

3434
#include "cdc_device.h"
3535

36+
//--------------------------------------------------------------------+
3637
// ESP32 out-of-sync
38+
//--------------------------------------------------------------------+
39+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
40+
#define tu_static static
41+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
42+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
43+
#endif
44+
3745
#ifndef CFG_TUD_MEM_SECTION
3846
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
3947
#endif
4048

41-
#ifndef tu_static
42-
#define tu_static static
49+
#ifndef CFG_TUD_LOG_LEVEL
50+
#define CFG_TUD_LOG_LEVEL 2
4351
#endif
4452

53+
//--------------------------------------------------------------------+
54+
//
55+
//--------------------------------------------------------------------+
56+
4557
// Level where CFG_TUSB_DEBUG must be at least for this driver is logged
4658
#ifndef CFG_TUD_CDC_LOG_LEVEL
4759
#define CFG_TUD_CDC_LOG_LEVEL CFG_TUD_LOG_LEVEL

src/class/dfu/dfu_device.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@
3333

3434
#include "dfu_device.h"
3535

36+
//--------------------------------------------------------------------+
37+
// ESP32 out-of-sync
38+
//--------------------------------------------------------------------+
39+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
40+
#define tu_static static
41+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
42+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
43+
#endif
44+
45+
#ifndef CFG_TUD_MEM_SECTION
46+
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
47+
#endif
48+
49+
#ifndef CFG_TUD_LOG_LEVEL
50+
#define CFG_TUD_LOG_LEVEL 2
51+
#endif
52+
3653
//--------------------------------------------------------------------+
3754
// MACRO CONSTANT TYPEDEF
3855
//--------------------------------------------------------------------+

src/class/dfu/dfu_rt_device.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@
3333

3434
#include "dfu_rt_device.h"
3535

36+
//--------------------------------------------------------------------+
37+
// ESP32 out-of-sync
38+
//--------------------------------------------------------------------+
39+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
40+
#define tu_static static
41+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
42+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
43+
#endif
44+
45+
#ifndef CFG_TUD_MEM_SECTION
46+
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
47+
#endif
48+
49+
#ifndef CFG_TUD_LOG_LEVEL
50+
#define CFG_TUD_LOG_LEVEL 2
51+
#endif
52+
3653
//--------------------------------------------------------------------+
3754
// MACRO CONSTANT TYPEDEF
3855
//--------------------------------------------------------------------+

src/class/hid/hid_device.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,21 @@
3636

3737
#include "hid_device.h"
3838

39+
//--------------------------------------------------------------------+
3940
// ESP32 out-of-sync
41+
//--------------------------------------------------------------------+
42+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
43+
#define tu_static static
44+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
45+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
46+
#endif
47+
4048
#ifndef CFG_TUD_MEM_SECTION
4149
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
4250
#endif
4351

44-
#ifndef tu_static
45-
#define tu_static static
52+
#ifndef CFG_TUD_LOG_LEVEL
53+
#define CFG_TUD_LOG_LEVEL 2
4654
#endif
4755

4856
//--------------------------------------------------------------------+

src/class/midi/midi_device.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,21 @@
3636

3737
#include "midi_device.h"
3838

39+
//--------------------------------------------------------------------+
3940
// ESP32 out-of-sync
41+
//--------------------------------------------------------------------+
42+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
43+
#define tu_static static
44+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
45+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
46+
#endif
47+
4048
#ifndef CFG_TUD_MEM_SECTION
4149
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
4250
#endif
4351

44-
#ifndef tu_static
45-
#define tu_static static
52+
#ifndef CFG_TUD_LOG_LEVEL
53+
#define CFG_TUD_LOG_LEVEL 2
4654
#endif
4755

4856
//--------------------------------------------------------------------+

src/class/msc/msc_device.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,27 @@
3434

3535
#include "msc_device.h"
3636

37+
//--------------------------------------------------------------------+
3738
// ESP32 out-of-sync
39+
//--------------------------------------------------------------------+
40+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
41+
#define tu_static static
42+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
43+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
44+
#endif
45+
3846
#ifndef CFG_TUD_MEM_SECTION
3947
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
4048
#endif
4149

42-
#ifndef tu_static
43-
#define tu_static static
50+
#ifndef CFG_TUD_LOG_LEVEL
51+
#define CFG_TUD_LOG_LEVEL 2
4452
#endif
4553

54+
//--------------------------------------------------------------------+
55+
//
56+
//--------------------------------------------------------------------+
57+
4658
// Level where CFG_TUSB_DEBUG must be at least for this driver is logged
4759
#ifndef CFG_TUD_MSC_LOG_LEVEL
4860
#define CFG_TUD_MSC_LOG_LEVEL CFG_TUD_LOG_LEVEL

src/class/net/ncm_device.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,27 @@
3434
#include "device/usbd_pvt.h"
3535
#include "net_device.h"
3636

37+
//--------------------------------------------------------------------+
38+
// ESP32 out-of-sync
39+
//--------------------------------------------------------------------+
40+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
41+
#define tu_static static
42+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
43+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
44+
#endif
45+
46+
#ifndef CFG_TUD_MEM_SECTION
47+
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
48+
#endif
49+
50+
#ifndef CFG_TUD_LOG_LEVEL
51+
#define CFG_TUD_LOG_LEVEL 2
52+
#endif
53+
54+
//--------------------------------------------------------------------+
55+
//
56+
//--------------------------------------------------------------------+
57+
3758
// Level where CFG_TUSB_DEBUG must be at least for this driver is logged
3859
#ifndef CFG_TUD_NCM_LOG_LEVEL
3960
#define CFG_TUD_NCM_LOG_LEVEL CFG_TUD_LOG_LEVEL

src/class/usbtmc/usbtmc_device.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@
7676

7777
#include "usbtmc_device.h"
7878

79+
//--------------------------------------------------------------------+
80+
// ESP32 out-of-sync
81+
//--------------------------------------------------------------------+
82+
#if defined(ARDUINO_ARCH_ESP32) && !defined(tu_static)
83+
#define tu_static static
84+
static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) { if (count > destsz) { return -1; } memset(dest, ch, count); return 0; }
85+
static inline int tu_memcpy_s(void *dest, size_t destsz, const void * src, size_t count ) { if (count > destsz) { return -1; } memcpy(dest, src, count); return 0; }
86+
#endif
87+
88+
#ifndef CFG_TUD_MEM_SECTION
89+
#define CFG_TUD_MEM_SECTION CFG_TUSB_MEM_SECTION
90+
#endif
91+
92+
#ifndef CFG_TUD_LOG_LEVEL
93+
#define CFG_TUD_LOG_LEVEL 2
94+
#endif
95+
96+
//--------------------------------------------------------------------+
97+
//
98+
//--------------------------------------------------------------------+
99+
79100
#ifdef xDEBUG
80101
#include "uart_util.h"
81102
tu_static char logMsg[150];

0 commit comments

Comments
 (0)