use tu_static instead of static _fuzz_thread

This commit is contained in:
hathach 2023-02-22 16:23:40 +07:00
parent 557bf82336
commit 498989ee00
No known key found for this signature in database
GPG Key ID: F5D50C6D51D17CBA
17 changed files with 56 additions and 56 deletions

View File

@ -76,7 +76,7 @@ typedef struct
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION // INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
CFG_TUSB_MEM_SECTION static _fuzz_thread cdcd_interface_t _cdcd_itf[CFG_TUD_CDC]; CFG_TUSB_MEM_SECTION tu_static cdcd_interface_t _cdcd_itf[CFG_TUD_CDC];
static bool _prep_out_transaction (cdcd_interface_t* p_cdc) static bool _prep_out_transaction (cdcd_interface_t* p_cdc)
{ {

View File

@ -56,7 +56,7 @@ typedef struct
} dfu_state_ctx_t; } dfu_state_ctx_t;
// Only a single dfu state is allowed // Only a single dfu state is allowed
CFG_TUSB_MEM_SECTION static _fuzz_thread dfu_state_ctx_t _dfu_ctx; CFG_TUSB_MEM_SECTION tu_static dfu_state_ctx_t _dfu_ctx;
static void reset_state(void) static void reset_state(void)
{ {
@ -74,7 +74,7 @@ static bool process_manifest_get_status(uint8_t rhport, uint8_t stage, tusb_cont
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
#if CFG_TUSB_DEBUG >= 2 #if CFG_TUSB_DEBUG >= 2
static _fuzz_thread tu_lookup_entry_t const _dfu_request_lookup[] = tu_static tu_lookup_entry_t const _dfu_request_lookup[] =
{ {
{ .key = DFU_REQUEST_DETACH , .data = "DETACH" }, { .key = DFU_REQUEST_DETACH , .data = "DETACH" },
{ .key = DFU_REQUEST_DNLOAD , .data = "DNLOAD" }, { .key = DFU_REQUEST_DNLOAD , .data = "DNLOAD" },
@ -85,13 +85,13 @@ static _fuzz_thread tu_lookup_entry_t const _dfu_request_lookup[] =
{ .key = DFU_REQUEST_ABORT , .data = "ABORT" }, { .key = DFU_REQUEST_ABORT , .data = "ABORT" },
}; };
static _fuzz_thread tu_lookup_table_t const _dfu_request_table = tu_static tu_lookup_table_t const _dfu_request_table =
{ {
.count = TU_ARRAY_SIZE(_dfu_request_lookup), .count = TU_ARRAY_SIZE(_dfu_request_lookup),
.items = _dfu_request_lookup .items = _dfu_request_lookup
}; };
static _fuzz_thread tu_lookup_entry_t const _dfu_state_lookup[] = tu_static tu_lookup_entry_t const _dfu_state_lookup[] =
{ {
{ .key = APP_IDLE , .data = "APP_IDLE" }, { .key = APP_IDLE , .data = "APP_IDLE" },
{ .key = APP_DETACH , .data = "APP_DETACH" }, { .key = APP_DETACH , .data = "APP_DETACH" },
@ -106,13 +106,13 @@ static _fuzz_thread tu_lookup_entry_t const _dfu_state_lookup[] =
{ .key = DFU_ERROR , .data = "ERROR" }, { .key = DFU_ERROR , .data = "ERROR" },
}; };
static _fuzz_thread tu_lookup_table_t const _dfu_state_table = tu_static tu_lookup_table_t const _dfu_state_table =
{ {
.count = TU_ARRAY_SIZE(_dfu_state_lookup), .count = TU_ARRAY_SIZE(_dfu_state_lookup),
.items = _dfu_state_lookup .items = _dfu_state_lookup
}; };
static _fuzz_thread tu_lookup_entry_t const _dfu_status_lookup[] = tu_static tu_lookup_entry_t const _dfu_status_lookup[] =
{ {
{ .key = DFU_STATUS_OK , .data = "OK" }, { .key = DFU_STATUS_OK , .data = "OK" },
{ .key = DFU_STATUS_ERR_TARGET , .data = "errTARGET" }, { .key = DFU_STATUS_ERR_TARGET , .data = "errTARGET" },
@ -132,7 +132,7 @@ static _fuzz_thread tu_lookup_entry_t const _dfu_status_lookup[] =
{ .key = DFU_STATUS_ERR_STALLEDPKT , .data = "errSTALLEDPKT" }, { .key = DFU_STATUS_ERR_STALLEDPKT , .data = "errSTALLEDPKT" },
}; };
static _fuzz_thread tu_lookup_table_t const _dfu_status_table = tu_static tu_lookup_table_t const _dfu_status_table =
{ {
.count = TU_ARRAY_SIZE(_dfu_status_lookup), .count = TU_ARRAY_SIZE(_dfu_status_lookup),
.items = _dfu_status_lookup .items = _dfu_status_lookup

View File

@ -58,7 +58,7 @@ typedef struct
tusb_hid_descriptor_hid_t const * hid_descriptor; tusb_hid_descriptor_hid_t const * hid_descriptor;
} hidd_interface_t; } hidd_interface_t;
CFG_TUSB_MEM_SECTION static _fuzz_thread hidd_interface_t _hidd_itf[CFG_TUD_HID]; CFG_TUSB_MEM_SECTION tu_static hidd_interface_t _hidd_itf[CFG_TUD_HID];
/*------------- Helpers -------------*/ /*------------- Helpers -------------*/
static inline uint8_t get_index_by_itfnum(uint8_t itf_num) static inline uint8_t get_index_by_itfnum(uint8_t itf_num)

View File

@ -71,8 +71,8 @@ typedef struct
uint8_t add_sense_qualifier; uint8_t add_sense_qualifier;
}mscd_interface_t; }mscd_interface_t;
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread mscd_interface_t _mscd_itf; CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN tu_static mscd_interface_t _mscd_itf;
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread uint8_t _mscd_buf[CFG_TUD_MSC_EP_BUFSIZE]; CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN tu_static uint8_t _mscd_buf[CFG_TUD_MSC_EP_BUFSIZE];
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION // INTERNAL OBJECT & FUNCTION DECLARATION
@ -202,7 +202,7 @@ uint8_t rdwr10_validate_cmd(msc_cbw_t const* cbw)
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
#if CFG_TUSB_DEBUG >= 2 #if CFG_TUSB_DEBUG >= 2
TU_ATTR_UNUSED static _fuzz_thread tu_lookup_entry_t const _msc_scsi_cmd_lookup[] = TU_ATTR_UNUSED tu_static tu_lookup_entry_t const _msc_scsi_cmd_lookup[] =
{ {
{ .key = SCSI_CMD_TEST_UNIT_READY , .data = "Test Unit Ready" }, { .key = SCSI_CMD_TEST_UNIT_READY , .data = "Test Unit Ready" },
{ .key = SCSI_CMD_INQUIRY , .data = "Inquiry" }, { .key = SCSI_CMD_INQUIRY , .data = "Inquiry" },
@ -217,7 +217,7 @@ TU_ATTR_UNUSED static _fuzz_thread tu_lookup_entry_t const _msc_scsi_cmd_lookup[
{ .key = SCSI_CMD_WRITE_10 , .data = "Write10" } { .key = SCSI_CMD_WRITE_10 , .data = "Write10" }
}; };
TU_ATTR_UNUSED static _fuzz_thread tu_lookup_table_t const _msc_scsi_cmd_table = TU_ATTR_UNUSED tu_static tu_lookup_table_t const _msc_scsi_cmd_table =
{ {
.count = TU_ARRAY_SIZE(_msc_scsi_cmd_lookup), .count = TU_ARRAY_SIZE(_msc_scsi_cmd_lookup),
.items = _msc_scsi_cmd_lookup .items = _msc_scsi_cmd_lookup

View File

@ -61,10 +61,10 @@ typedef struct
#define CFG_TUD_NET_PACKET_PREFIX_LEN sizeof(rndis_data_packet_t) #define CFG_TUD_NET_PACKET_PREFIX_LEN sizeof(rndis_data_packet_t)
#define CFG_TUD_NET_PACKET_SUFFIX_LEN 0 #define CFG_TUD_NET_PACKET_SUFFIX_LEN 0
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN tu_static
uint8_t received[CFG_TUD_NET_PACKET_PREFIX_LEN + CFG_TUD_NET_MTU + CFG_TUD_NET_PACKET_PREFIX_LEN]; uint8_t received[CFG_TUD_NET_PACKET_PREFIX_LEN + CFG_TUD_NET_MTU + CFG_TUD_NET_PACKET_PREFIX_LEN];
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN tu_static
uint8_t transmitted[CFG_TUD_NET_PACKET_PREFIX_LEN + CFG_TUD_NET_MTU + CFG_TUD_NET_PACKET_PREFIX_LEN]; uint8_t transmitted[CFG_TUD_NET_PACKET_PREFIX_LEN + CFG_TUD_NET_MTU + CFG_TUD_NET_PACKET_PREFIX_LEN];
struct ecm_notify_struct struct ecm_notify_struct
@ -73,7 +73,7 @@ struct ecm_notify_struct
uint32_t downlink, uplink; uint32_t downlink, uplink;
}; };
static _fuzz_thread const struct ecm_notify_struct ecm_notify_nc = tu_static const struct ecm_notify_struct ecm_notify_nc =
{ {
.header = { .header = {
.bmRequestType = 0xA1, .bmRequestType = 0xA1,
@ -83,7 +83,7 @@ static _fuzz_thread const struct ecm_notify_struct ecm_notify_nc =
}, },
}; };
static _fuzz_thread const struct ecm_notify_struct ecm_notify_csc = tu_static const struct ecm_notify_struct ecm_notify_csc =
{ {
.header = { .header = {
.bmRequestType = 0xA1, .bmRequestType = 0xA1,
@ -95,7 +95,7 @@ static _fuzz_thread const struct ecm_notify_struct ecm_notify_csc =
}; };
// TODO remove CFG_TUSB_MEM_SECTION, control internal buffer is already in this special section // TODO remove CFG_TUSB_MEM_SECTION, control internal buffer is already in this special section
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread union CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN tu_static union
{ {
uint8_t rndis_buf[120]; uint8_t rndis_buf[120];
struct ecm_notify_struct ecm_buf; struct ecm_notify_struct ecm_buf;
@ -105,9 +105,9 @@ CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread union
// INTERNAL OBJECT & FUNCTION DECLARATION // INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// TODO remove CFG_TUSB_MEM_SECTION // TODO remove CFG_TUSB_MEM_SECTION
CFG_TUSB_MEM_SECTION static _fuzz_thread netd_interface_t _netd_itf; CFG_TUSB_MEM_SECTION tu_static netd_interface_t _netd_itf;
static _fuzz_thread bool can_xmit; tu_static bool can_xmit;
void tud_network_recv_renew(void) void tud_network_recv_renew(void)
{ {

View File

@ -130,7 +130,7 @@ typedef struct
// INTERNAL OBJECT & FUNCTION DECLARATION // INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread const ntb_parameters_t ntb_parameters = { CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN tu_static const ntb_parameters_t ntb_parameters = {
.wLength = sizeof(ntb_parameters_t), .wLength = sizeof(ntb_parameters_t),
.bmNtbFormatsSupported = 0x01, .bmNtbFormatsSupported = 0x01,
.dwNtbInMaxSize = CFG_TUD_NCM_IN_NTB_MAX_SIZE, .dwNtbInMaxSize = CFG_TUD_NCM_IN_NTB_MAX_SIZE,
@ -145,11 +145,11 @@ CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread const ntb_parameters
.wNtbOutMaxDatagrams = 0 .wNtbOutMaxDatagrams = 0
}; };
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread transmit_ntb_t transmit_ntb[2]; CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN tu_static transmit_ntb_t transmit_ntb[2];
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static _fuzz_thread uint8_t receive_ntb[CFG_TUD_NCM_OUT_NTB_MAX_SIZE]; CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN tu_static uint8_t receive_ntb[CFG_TUD_NCM_OUT_NTB_MAX_SIZE];
static _fuzz_thread ncm_interface_t ncm_interface; tu_static ncm_interface_t ncm_interface;
/* /*
* Set up the NTB state in ncm_interface to be ready to add datagrams. * Set up the NTB state in ncm_interface to be ready to add datagrams.
@ -196,7 +196,7 @@ static void ncm_start_tx(void) {
ncm_prepare_for_tx(); ncm_prepare_for_tx();
} }
static _fuzz_thread struct ecm_notify_struct ncm_notify_connected = tu_static struct ecm_notify_struct ncm_notify_connected =
{ {
.header = { .header = {
.bmRequestType_bit = { .bmRequestType_bit = {
@ -210,7 +210,7 @@ static _fuzz_thread struct ecm_notify_struct ncm_notify_connected =
}, },
}; };
static _fuzz_thread struct ecm_notify_struct ncm_notify_speed_change = tu_static struct ecm_notify_struct ncm_notify_speed_change =
{ {
.header = { .header = {
.bmRequestType_bit = { .bmRequestType_bit = {

View File

@ -78,7 +78,7 @@
#ifdef xDEBUG #ifdef xDEBUG
#include "uart_util.h" #include "uart_util.h"
static _fuzz_thread char logMsg[150]; tu_static char logMsg[150];
#endif #endif
// Buffer size must be an exact multiple of the max packet size for both // Buffer size must be an exact multiple of the max packet size for both
@ -143,7 +143,7 @@ typedef struct
usbtmc_capabilities_specific_t const * capabilities; usbtmc_capabilities_specific_t const * capabilities;
} usbtmc_interface_state_t; } usbtmc_interface_state_t;
CFG_TUSB_MEM_SECTION static _fuzz_thread usbtmc_interface_state_t usbtmc_state = CFG_TUSB_MEM_SECTION tu_static usbtmc_interface_state_t usbtmc_state =
{ {
.itf_id = 0xFF, .itf_id = 0xFF,
}; };
@ -154,8 +154,8 @@ TU_VERIFY_STATIC(USBTMCD_BUFFER_SIZE >= 32u,"USBTMC dev buffer size too small");
static bool handle_devMsgOutStart(uint8_t rhport, void *data, size_t len); static bool handle_devMsgOutStart(uint8_t rhport, void *data, size_t len);
static bool handle_devMsgOut(uint8_t rhport, void *data, size_t len, size_t packetLen); static bool handle_devMsgOut(uint8_t rhport, void *data, size_t len, size_t packetLen);
static _fuzz_thread uint8_t termChar; tu_static uint8_t termChar;
static _fuzz_thread uint8_t termCharRequested = false; tu_static uint8_t termCharRequested = false;
#if OSAL_MUTEX_REQUIRED #if OSAL_MUTEX_REQUIRED
static OSAL_MUTEX_DEF(usbtmcLockBuffer); static OSAL_MUTEX_DEF(usbtmcLockBuffer);

View File

@ -59,7 +59,7 @@ typedef struct
CFG_TUSB_MEM_ALIGN uint8_t epin_buf[CFG_TUD_VENDOR_EPSIZE]; CFG_TUSB_MEM_ALIGN uint8_t epin_buf[CFG_TUD_VENDOR_EPSIZE];
} vendord_interface_t; } vendord_interface_t;
CFG_TUSB_MEM_SECTION static _fuzz_thread vendord_interface_t _vendord_itf[CFG_TUD_VENDOR]; CFG_TUSB_MEM_SECTION tu_static vendord_interface_t _vendord_itf[CFG_TUD_VENDOR];
#define ITF_MEM_RESET_SIZE offsetof(vendord_interface_t, rx_ff) #define ITF_MEM_RESET_SIZE offsetof(vendord_interface_t, rx_ff)

View File

@ -125,11 +125,11 @@ typedef struct TU_ATTR_PACKED {
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION // INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
CFG_TUSB_MEM_SECTION static _fuzz_thread videod_interface_t _videod_itf[CFG_TUD_VIDEO]; CFG_TUSB_MEM_SECTION tu_static videod_interface_t _videod_itf[CFG_TUD_VIDEO];
CFG_TUSB_MEM_SECTION static _fuzz_thread videod_streaming_interface_t _videod_streaming_itf[CFG_TUD_VIDEO_STREAMING]; CFG_TUSB_MEM_SECTION tu_static videod_streaming_interface_t _videod_streaming_itf[CFG_TUD_VIDEO_STREAMING];
static _fuzz_thread uint8_t const _cap_get = 0x1u; /* support for GET */ tu_static uint8_t const _cap_get = 0x1u; /* support for GET */
static _fuzz_thread uint8_t const _cap_get_set = 0x3u; /* support for GET and SET */ tu_static uint8_t const _cap_get_set = 0x3u; /* support for GET and SET */
/** Get interface number from the interface descriptor /** Get interface number from the interface descriptor
* *

View File

@ -63,9 +63,9 @@
/* --------------------- Fuzzing types -------------------------------------- */ /* --------------------- Fuzzing types -------------------------------------- */
#ifdef _FUZZ #ifdef _FUZZ
#define _fuzz_thread __thread #define tu_static static __thread
#else #else
#define _fuzz_thread #define tu_static static
#endif #endif
// for declaration of reserved field, make use of _TU_COUNTER_ // for declaration of reserved field, make use of _TU_COUNTER_

View File

@ -114,7 +114,7 @@ typedef struct
static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint32_t key) static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint32_t key)
{ {
static _fuzz_thread char not_found[11]; tu_static char not_found[11];
for(uint16_t i=0; i<p_table->count; i++) for(uint16_t i=0; i<p_table->count; i++)
{ {

View File

@ -529,13 +529,13 @@ TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_edpt_packet_size(tusb_desc_endpo
#if CFG_TUSB_DEBUG #if CFG_TUSB_DEBUG
TU_ATTR_ALWAYS_INLINE static inline const char *tu_edpt_dir_str(tusb_dir_t dir) TU_ATTR_ALWAYS_INLINE static inline const char *tu_edpt_dir_str(tusb_dir_t dir)
{ {
static _fuzz_thread const char *str[] = {"out", "in"}; tu_static const char *str[] = {"out", "in"};
return str[dir]; return str[dir];
} }
TU_ATTR_ALWAYS_INLINE static inline const char *tu_edpt_type_str(tusb_xfer_type_t t) TU_ATTR_ALWAYS_INLINE static inline const char *tu_edpt_type_str(tusb_xfer_type_t t)
{ {
static _fuzz_thread const char *str[] = {"control", "isochronous", "bulk", "interrupt"}; tu_static const char *str[] = {"control", "isochronous", "bulk", "interrupt"};
return str[t]; return str[t];
} }
#endif #endif

View File

@ -76,7 +76,7 @@ typedef struct
}usbd_device_t; }usbd_device_t;
static _fuzz_thread usbd_device_t _usbd_dev; tu_static usbd_device_t _usbd_dev;
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// Class Driver // Class Driver
@ -88,7 +88,7 @@ static _fuzz_thread usbd_device_t _usbd_dev;
#endif #endif
// Built-in class drivers // Built-in class drivers
static _fuzz_thread usbd_class_driver_t const _usbd_driver[] = tu_static usbd_class_driver_t const _usbd_driver[] =
{ {
#if CFG_TUD_CDC #if CFG_TUD_CDC
{ {
@ -238,8 +238,8 @@ static _fuzz_thread usbd_class_driver_t const _usbd_driver[] =
enum { BUILTIN_DRIVER_COUNT = TU_ARRAY_SIZE(_usbd_driver) }; enum { BUILTIN_DRIVER_COUNT = TU_ARRAY_SIZE(_usbd_driver) };
// Additional class drivers implemented by application // Additional class drivers implemented by application
static _fuzz_thread usbd_class_driver_t const * _app_driver = NULL; tu_static usbd_class_driver_t const * _app_driver = NULL;
static _fuzz_thread uint8_t _app_driver_count = 0; tu_static uint8_t _app_driver_count = 0;
// virtually joins built-in and application drivers together. // virtually joins built-in and application drivers together.
// Application is positioned first to allow overwriting built-in ones. // Application is positioned first to allow overwriting built-in ones.
@ -265,17 +265,17 @@ static inline usbd_class_driver_t const * get_driver(uint8_t drvid)
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
enum { RHPORT_INVALID = 0xFFu }; enum { RHPORT_INVALID = 0xFFu };
static _fuzz_thread uint8_t _usbd_rhport = RHPORT_INVALID; tu_static uint8_t _usbd_rhport = RHPORT_INVALID;
// Event queue // Event queue
// usbd_int_set() is used as mutex in OS NONE config // usbd_int_set() is used as mutex in OS NONE config
OSAL_QUEUE_DEF(usbd_int_set, _usbd_qdef, CFG_TUD_TASK_QUEUE_SZ, dcd_event_t); OSAL_QUEUE_DEF(usbd_int_set, _usbd_qdef, CFG_TUD_TASK_QUEUE_SZ, dcd_event_t);
static _fuzz_thread osal_queue_t _usbd_q; tu_static osal_queue_t _usbd_q;
// Mutex for claiming endpoint // Mutex for claiming endpoint
#if OSAL_MUTEX_REQUIRED #if OSAL_MUTEX_REQUIRED
static _fuzz_thread osal_mutex_def_t _ubsd_mutexdef; tu_static osal_mutex_def_t _ubsd_mutexdef;
static _fuzz_thread osal_mutex_t _usbd_mutex; tu_static osal_mutex_t _usbd_mutex;
#else #else
#define _usbd_mutex NULL #define _usbd_mutex NULL
#endif #endif
@ -299,7 +299,7 @@ bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t event,
// Debug // Debug
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
#if CFG_TUSB_DEBUG >= 2 #if CFG_TUSB_DEBUG >= 2
static _fuzz_thread char const* const _usbd_event_str[DCD_EVENT_COUNT] = tu_static char const* const _usbd_event_str[DCD_EVENT_COUNT] =
{ {
"Invalid" , "Invalid" ,
"Bus Reset" , "Bus Reset" ,

View File

@ -53,10 +53,10 @@ typedef struct
usbd_control_xfer_cb_t complete_cb; usbd_control_xfer_cb_t complete_cb;
} usbd_control_xfer_t; } usbd_control_xfer_t;
static _fuzz_thread usbd_control_xfer_t _ctrl_xfer; tu_static usbd_control_xfer_t _ctrl_xfer;
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN
static _fuzz_thread uint8_t _usbd_ctrl_buf[CFG_TUD_ENDPOINT0_SIZE]; tu_static uint8_t _usbd_ctrl_buf[CFG_TUD_ENDPOINT0_SIZE];
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// Application API // Application API

View File

@ -39,7 +39,7 @@ struct State {
uint8_t address; uint8_t address;
}; };
static _fuzz_thread State state = {false, 0, 0}; tu_static State state = {false, 0, 0};
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// Controller API // Controller API

View File

@ -44,7 +44,7 @@
// Invoked when received GET DEVICE DESCRIPTOR // Invoked when received GET DEVICE DESCRIPTOR
// Application return pointer to descriptor // Application return pointer to descriptor
uint8_t const *tud_descriptor_device_cb(void) { uint8_t const *tud_descriptor_device_cb(void) {
static _fuzz_thread tusb_desc_device_t const desc_device = { tu_static tusb_desc_device_t const desc_device = {
.bLength = sizeof(tusb_desc_device_t), .bLength = sizeof(tusb_desc_device_t),
.bDescriptorType = TUSB_DESC_DEVICE, .bDescriptorType = TUSB_DESC_DEVICE,
.bcdUSB = USB_BCD, .bcdUSB = USB_BCD,
@ -184,7 +184,7 @@ char const *string_desc_arr[] = {
}; };
static _fuzz_thread uint16_t _desc_str[32]; tu_static uint16_t _desc_str[32];
// Invoked when received GET STRING DESCRIPTOR request // Invoked when received GET STRING DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long // Application return pointer to descriptor, whose contents must exist long

View File

@ -45,7 +45,7 @@
// Invoked when received GET DEVICE DESCRIPTOR // Invoked when received GET DEVICE DESCRIPTOR
// Application return pointer to descriptor // Application return pointer to descriptor
uint8_t const *tud_descriptor_device_cb(void) { uint8_t const *tud_descriptor_device_cb(void) {
static _fuzz_thread tusb_desc_device_t const desc_device = { tu_static tusb_desc_device_t const desc_device = {
.bLength = sizeof(tusb_desc_device_t), .bLength = sizeof(tusb_desc_device_t),
.bDescriptorType = TUSB_DESC_DEVICE, .bDescriptorType = TUSB_DESC_DEVICE,
.bcdUSB = USB_BCD, .bcdUSB = USB_BCD,
@ -189,7 +189,7 @@ char const *string_desc_arr[] = {
"TinyUSB CDC", // 4: CDC Interface "TinyUSB CDC", // 4: CDC Interface
}; };
static _fuzz_thread uint16_t _desc_str[32]; tu_static uint16_t _desc_str[32];
// Invoked when received GET STRING DESCRIPTOR request // Invoked when received GET STRING DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long // Application return pointer to descriptor, whose contents must exist long