diff --git a/demos/bsp/boards/board.c b/demos/bsp/boards/board.c
index 99497400d..c411176da 100644
--- a/demos/bsp/boards/board.c
+++ b/demos/bsp/boards/board.c
@@ -48,6 +48,7 @@ void SysTick_Handler (void)
}
#endif
+#if 0
// FIXME refractor
void boardGetMACaddr(uint8_t *macaddr)
{
@@ -59,6 +60,8 @@ void boardGetMACaddr(uint8_t *macaddr)
macaddr[5] = BOARD_MAC_ADDR5;
}
+#endif
+
void check_failed(uint8_t *file, uint32_t line)
{
(void) file;
diff --git a/demos/host/host_os_none/host_os_none.uvopt b/demos/host/host_os_none/host_os_none.uvopt
index b9da97852..b2adbd490 100644
--- a/demos/host/host_os_none/host_os_none.uvopt
+++ b/demos/host/host_os_none/host_os_none.uvopt
@@ -73,7 +73,7 @@
1
0
- 1
+ 0
8
@@ -264,7 +264,7 @@
1
0
- 0
+ 1
8
@@ -403,10 +403,10 @@
1
0
0
- 3
+ 71
0
- 165
- 192
+ 166
+ 183
0
..\src\main.c
main.c
@@ -507,10 +507,10 @@
1
0
0
- 13
+ 31
0
- 0
- 0
+ 23
+ 55
0
..\..\bsp\boards\board.c
board.c
@@ -525,7 +525,7 @@
0
2
0
- 141
+ 142
146
0
..\..\bsp\boards\embedded_artists\board_ea4357.c
@@ -541,7 +541,7 @@
0
1
0
- 96
+ 97
106
0
..\..\bsp\boards\printf_retarget.c
@@ -677,7 +677,7 @@
0
0
0
- 23
+ 33
69
0
..\..\..\tinyusb\tusb.c
@@ -757,7 +757,7 @@
0
25
0
- 142
+ 143
147
0
..\..\..\tinyusb\host\ehci\ehci.c
@@ -805,7 +805,7 @@
0
7
0
- 67
+ 77
112
0
..\..\..\tinyusb\hal\hal_lpc43xx.c
@@ -915,10 +915,10 @@
1
0
0
- 15
+ 0
0
- 87
- 90
+ 1
+ 1
0
..\..\..\tinyusb\class\msc_host.c
msc_host.c
diff --git a/tests/lpc18xx_43xx/test/host/hid/test_hid_host.c b/tests/lpc18xx_43xx/test/host/hid/test_hid_host.c
index 7abb16428..d2f9f3063 100644
--- a/tests/lpc18xx_43xx/test/host/hid/test_hid_host.c
+++ b/tests/lpc18xx_43xx/test/host/hid/test_hid_host.c
@@ -53,7 +53,7 @@
uint8_t dev_addr;
pipe_handle_t pipe_hdl;
-extern hidh_interface_info_t keyboard_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern hidh_interface_info_t keyboardh_data[TUSB_CFG_HOST_DEVICE_MAX];
tusb_descriptor_interface_t const *p_kbd_interface_desc = &desc_configuration.keyboard_interface;
tusb_hid_descriptor_hid_t const *p_kbh_hid_desc = &desc_configuration.keyboard_hid;
@@ -85,8 +85,8 @@ void tearDown(void)
void test_hidh_close(void)
{
- keyboard_data[dev_addr-1].pipe_hdl = pipe_hdl;
- keyboard_data[dev_addr-1].report_size = 8;
+ keyboardh_data[dev_addr-1].pipe_hdl = pipe_hdl;
+ keyboardh_data[dev_addr-1].report_size = 8;
hcd_pipe_close_ExpectAndReturn(pipe_hdl, TUSB_ERROR_NONE);
tusbh_hid_keyboard_unmounted_isr_Expect(dev_addr);
@@ -94,5 +94,5 @@ void test_hidh_close(void)
//------------- Code Under TEST -------------//
hidh_close(dev_addr);
- TEST_ASSERT_MEM_ZERO(&keyboard_data[dev_addr-1], sizeof(hidh_interface_info_t));
+ TEST_ASSERT_MEM_ZERO(&keyboardh_data[dev_addr-1], sizeof(hidh_interface_info_t));
}
diff --git a/tests/lpc18xx_43xx/test/host/hid/test_hidh_generic.c b/tests/lpc18xx_43xx/test/host/hid/test_hidh_generic.c
index 0afe77596..f367fb821 100644
--- a/tests/lpc18xx_43xx/test/host/hid/test_hidh_generic.c
+++ b/tests/lpc18xx_43xx/test/host/hid/test_hidh_generic.c
@@ -51,7 +51,7 @@
#include "host_helper.h"
-extern hidh_interface_info_t mouse_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern hidh_interface_info_t mouseh_data[TUSB_CFG_HOST_DEVICE_MAX];
hidh_interface_info_t *p_hidh_mouse;
tusb_mouse_report_t report;
diff --git a/tests/lpc18xx_43xx/test/host/hid/test_hidh_keyboard.c b/tests/lpc18xx_43xx/test/host/hid/test_hidh_keyboard.c
index aa786cc92..3cbc5c868 100644
--- a/tests/lpc18xx_43xx/test/host/hid/test_hidh_keyboard.c
+++ b/tests/lpc18xx_43xx/test/host/hid/test_hidh_keyboard.c
@@ -48,7 +48,7 @@
#include "mock_hidh_callback.h"
#include "descriptor_test.h"
-extern hidh_interface_info_t keyboard_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern hidh_interface_info_t keyboardh_data[TUSB_CFG_HOST_DEVICE_MAX];
tusb_keyboard_report_t sample_key[2] =
{
@@ -76,7 +76,7 @@ void setUp(void)
memclr_(&report, sizeof(tusb_keyboard_report_t));
dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
- p_hidh_kbd = &keyboard_data[dev_addr-1];
+ p_hidh_kbd = &keyboardh_data[dev_addr-1];
p_hidh_kbd->report_size = sizeof(tusb_keyboard_report_t);
p_hidh_kbd->pipe_hdl = (pipe_handle_t) {
@@ -95,7 +95,7 @@ void test_keyboard_init(void)
{
hidh_init();
- TEST_ASSERT_MEM_ZERO(keyboard_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ TEST_ASSERT_MEM_ZERO(keyboardh_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
}
//------------- is supported -------------//
diff --git a/tests/lpc18xx_43xx/test/host/hid/test_hidh_mouse.c b/tests/lpc18xx_43xx/test/host/hid/test_hidh_mouse.c
index bade96635..010286ccb 100644
--- a/tests/lpc18xx_43xx/test/host/hid/test_hidh_mouse.c
+++ b/tests/lpc18xx_43xx/test/host/hid/test_hidh_mouse.c
@@ -49,7 +49,7 @@
#include "mock_hidh_callback.h"
#include "descriptor_test.h"
-extern hidh_interface_info_t mouse_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern hidh_interface_info_t mouseh_data[TUSB_CFG_HOST_DEVICE_MAX];
hidh_interface_info_t *p_hidh_mouse;
tusb_mouse_report_t report;
@@ -65,7 +65,7 @@ void setUp(void)
memclr_(&report, sizeof(tusb_mouse_report_t));
dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
- p_hidh_mouse = &mouse_data[dev_addr-1];
+ p_hidh_mouse = &mouseh_data[dev_addr-1];
p_hidh_mouse->report_size = sizeof(tusb_mouse_report_t);
p_hidh_mouse->pipe_hdl = (pipe_handle_t) {
@@ -84,7 +84,7 @@ void test_mouse_init(void)
{
hidh_init();
- TEST_ASSERT_MEM_ZERO(mouse_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ TEST_ASSERT_MEM_ZERO(mouseh_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
}
//------------- is supported -------------//
diff --git a/tinyusb/class/cdc_rndis_host.c b/tinyusb/class/cdc_rndis_host.c
index af0fe9a05..35fb346a1 100644
--- a/tinyusb/class/cdc_rndis_host.c
+++ b/tinyusb/class/cdc_rndis_host.c
@@ -57,7 +57,7 @@
static uint8_t msg_notification[TUSB_CFG_HOST_DEVICE_MAX][8] TUSB_CFG_ATTR_USBRAM;
ATTR_ALIGNED(4) static uint8_t msg_payload[RNDIS_MSG_PAYLOAD_MAX] TUSB_CFG_ATTR_USBRAM;
-STATIC_ rndish_data_t rndish_data[TUSB_CFG_HOST_DEVICE_MAX];
+STATIC_VAR rndish_data_t rndish_data[TUSB_CFG_HOST_DEVICE_MAX];
// TODO Microsoft requires message length for any get command must be at least 4096 bytes
diff --git a/tinyusb/class/hid_host.c b/tinyusb/class/hid_host.c
index f3dff2eed..de44bb416 100644
--- a/tinyusb/class/hid_host.c
+++ b/tinyusb/class/hid_host.c
@@ -119,22 +119,22 @@ uint8_t const hid_keycode_to_ascii_tbl[2][128] =
HID_KEYCODE_TABLE(EXPAND_KEYCODE_TO_ASCII)
};
-STATIC_ hidh_interface_info_t keyboard_data[TUSB_CFG_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
+STATIC_VAR hidh_interface_info_t keyboardh_data[TUSB_CFG_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
//------------- KEYBOARD PUBLIC API (parameter validation required) -------------//
bool tusbh_hid_keyboard_is_mounted(uint8_t dev_addr)
{
- return tusbh_device_is_configured(dev_addr) && pipehandle_is_valid(keyboard_data[dev_addr-1].pipe_hdl);
+ return tusbh_device_is_configured(dev_addr) && pipehandle_is_valid(keyboardh_data[dev_addr-1].pipe_hdl);
}
tusb_error_t tusbh_hid_keyboard_get_report(uint8_t dev_addr, void* report)
{
- return hidh_interface_get_report(dev_addr, report, &keyboard_data[dev_addr-1]);
+ return hidh_interface_get_report(dev_addr, report, &keyboardh_data[dev_addr-1]);
}
tusb_interface_status_t tusbh_hid_keyboard_status(uint8_t dev_addr)
{
- return hidh_interface_status(dev_addr, &keyboard_data[dev_addr-1]);
+ return hidh_interface_status(dev_addr, &keyboardh_data[dev_addr-1]);
}
#endif
@@ -144,22 +144,22 @@ tusb_interface_status_t tusbh_hid_keyboard_status(uint8_t dev_addr)
//--------------------------------------------------------------------+
#if TUSB_CFG_HOST_HID_MOUSE
-STATIC_ hidh_interface_info_t mouse_data[TUSB_CFG_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
+STATIC_VAR hidh_interface_info_t mouseh_data[TUSB_CFG_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
//------------- Public API -------------//
bool tusbh_hid_mouse_is_mounted(uint8_t dev_addr)
{
- return tusbh_device_is_configured(dev_addr) && pipehandle_is_valid(mouse_data[dev_addr-1].pipe_hdl);
+ return tusbh_device_is_configured(dev_addr) && pipehandle_is_valid(mouseh_data[dev_addr-1].pipe_hdl);
}
tusb_error_t tusbh_hid_mouse_get_report(uint8_t dev_addr, void * report)
{
- return hidh_interface_get_report(dev_addr, report, &mouse_data[dev_addr-1]);
+ return hidh_interface_get_report(dev_addr, report, &mouseh_data[dev_addr-1]);
}
tusb_interface_status_t tusbh_hid_mouse_status(uint8_t dev_addr)
{
- return hidh_interface_status(dev_addr, &mouse_data[dev_addr-1]);
+ return hidh_interface_status(dev_addr, &mouseh_data[dev_addr-1]);
}
#endif
@@ -181,11 +181,11 @@ tusb_interface_status_t tusbh_hid_mouse_status(uint8_t dev_addr)
void hidh_init(void)
{
#if TUSB_CFG_HOST_HID_KEYBOARD
- memclr_(&keyboard_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ memclr_(&keyboardh_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
#endif
#if TUSB_CFG_HOST_HID_MOUSE
- memclr_(&mouse_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ memclr_(&mouseh_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
#endif
#if TUSB_CFG_HOST_HID_GENERIC
@@ -243,7 +243,7 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
#if TUSB_CFG_HOST_HID_KEYBOARD
if ( HID_PROTOCOL_KEYBOARD == p_interface_desc->bInterfaceProtocol)
{
- SUBTASK_ASSERT_STATUS ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &keyboard_data[dev_addr-1]) );
+ SUBTASK_ASSERT_STATUS ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &keyboardh_data[dev_addr-1]) );
if ( tusbh_hid_keyboard_mounted_cb )
{
tusbh_hid_keyboard_mounted_cb(dev_addr);
@@ -254,7 +254,7 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
#if TUSB_CFG_HOST_HID_MOUSE
if ( HID_PROTOCOL_MOUSE == p_interface_desc->bInterfaceProtocol)
{
- SUBTASK_ASSERT_STATUS ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &mouse_data[dev_addr-1]) );
+ SUBTASK_ASSERT_STATUS ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &mouseh_data[dev_addr-1]) );
if (tusbh_hid_mouse_mounted_cb)
{
tusbh_hid_mouse_mounted_cb(dev_addr);
@@ -278,9 +278,9 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
{
#if TUSB_CFG_HOST_HID_KEYBOARD
- if ( pipehandle_is_equal(pipe_hdl, keyboard_data[pipe_hdl.dev_addr-1].pipe_hdl) )
+ if ( pipehandle_is_equal(pipe_hdl, keyboardh_data[pipe_hdl.dev_addr-1].pipe_hdl) )
{
- keyboard_data[pipe_hdl.dev_addr-1].status = (event == TUSB_EVENT_XFER_COMPLETE) ? TUSB_INTERFACE_STATUS_COMPLETE : TUSB_INTERFACE_STATUS_ERROR;
+ keyboardh_data[pipe_hdl.dev_addr-1].status = (event == TUSB_EVENT_XFER_COMPLETE) ? TUSB_INTERFACE_STATUS_COMPLETE : TUSB_INTERFACE_STATUS_ERROR;
if (tusbh_hid_keyboard_isr)
{
tusbh_hid_keyboard_isr(pipe_hdl.dev_addr, event);
@@ -290,9 +290,9 @@ void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes
#endif
#if TUSB_CFG_HOST_HID_MOUSE
- if ( pipehandle_is_equal(pipe_hdl, mouse_data[pipe_hdl.dev_addr-1].pipe_hdl) )
+ if ( pipehandle_is_equal(pipe_hdl, mouseh_data[pipe_hdl.dev_addr-1].pipe_hdl) )
{
- mouse_data[pipe_hdl.dev_addr-1].status = (event == TUSB_EVENT_XFER_COMPLETE) ? TUSB_INTERFACE_STATUS_COMPLETE : TUSB_INTERFACE_STATUS_ERROR;
+ mouseh_data[pipe_hdl.dev_addr-1].status = (event == TUSB_EVENT_XFER_COMPLETE) ? TUSB_INTERFACE_STATUS_COMPLETE : TUSB_INTERFACE_STATUS_ERROR;
if (tusbh_hid_mouse_isr)
{
tusbh_hid_mouse_isr(pipe_hdl.dev_addr, event);
@@ -310,17 +310,17 @@ void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes
void hidh_close(uint8_t dev_addr)
{
#if TUSB_CFG_HOST_HID_KEYBOARD
- if ( pipehandle_is_valid( keyboard_data[dev_addr-1].pipe_hdl ) )
+ if ( pipehandle_is_valid( keyboardh_data[dev_addr-1].pipe_hdl ) )
{
- hidh_interface_close(dev_addr, &keyboard_data[dev_addr-1]);
+ hidh_interface_close(dev_addr, &keyboardh_data[dev_addr-1]);
tusbh_hid_keyboard_unmounted_isr(dev_addr);
}
#endif
#if TUSB_CFG_HOST_HID_MOUSE
- if( pipehandle_is_valid( mouse_data[dev_addr-1].pipe_hdl ) )
+ if( pipehandle_is_valid( mouseh_data[dev_addr-1].pipe_hdl ) )
{
- hidh_interface_close(dev_addr, &mouse_data[dev_addr-1]);
+ hidh_interface_close(dev_addr, &mouseh_data[dev_addr-1]);
tusbh_hid_mouse_unmounted_isr( dev_addr );
}
#endif
diff --git a/tinyusb/class/msc.h b/tinyusb/class/msc.h
index efa137a2b..c8662089e 100644
--- a/tinyusb/class/msc.h
+++ b/tinyusb/class/msc.h
@@ -76,6 +76,26 @@ enum {
MSC_REQUEST_RESET = 255
};
+typedef ATTR_PACKED_STRUCT(struct) {
+ uint32_t signature; // const 0x43425355
+ uint32_t tag;
+ uint32_t xfer_bytes;
+ uint8_t flags; // bit7 : direction
+ uint8_t lun;
+ uint8_t cmd_len;
+ uint8_t command[16];
+}msc_cmd_block_wrapper_t;
+
+STATIC_ASSERT(sizeof(msc_cmd_block_wrapper_t) == 31, "size is not correct");
+
+typedef ATTR_PACKED_STRUCT(struct) {
+ uint32_t signature; // const 0x53425355
+ uint32_t tag;
+ uint32_t data_residue;
+ uint8_t status;
+}msc_cmd_status_wrapper_t;
+
+STATIC_ASSERT(sizeof(msc_cmd_status_wrapper_t) == 13, "size is not correct");
//--------------------------------------------------------------------+
// SCSI Primary Command (SPC-4)
@@ -95,7 +115,7 @@ typedef ATTR_PACKED_STRUCT(struct)
uint8_t normal_aca : 1;
uint8_t : 2;
- uint8_t additional_length;
+ uint8_t additional_length;
uint8_t protect : 1;
uint8_t : 2;
@@ -118,11 +138,13 @@ typedef ATTR_PACKED_STRUCT(struct)
uint8_t wbus16 : 1;
uint8_t : 2;
- uint8_t vendor_id[8];
- uint8_t product_id[16];
- uint8_t product_revision[4];
+ uint8_t vendor_id[8];
+ uint8_t product_id[16];
+ uint8_t product_revision[4];
} msc_scsi_inquiry_t;
+STATIC_ASSERT(sizeof(msc_scsi_inquiry_t) == 36, "size is not correct");
+
//--------------------------------------------------------------------+
// SCSI Block Command (SBC-3)
//--------------------------------------------------------------------+
diff --git a/tinyusb/class/msc_host.c b/tinyusb/class/msc_host.c
index 760bc34f5..6dc2d0a65 100644
--- a/tinyusb/class/msc_host.c
+++ b/tinyusb/class/msc_host.c
@@ -55,12 +55,15 @@ typedef struct {
pipe_handle_t bulk_in, bulk_out;
uint8_t interface_number;
uint8_t max_lun;
+
+ msc_cmd_block_wrapper_t cbw;
+ msc_cmd_status_wrapper_t csw;
}msch_interface_t;
-/*STATIC_*/ msch_interface_t msch_data[TUSB_CFG_HOST_DEVICE_MAX]; // TODO to be static
+STATIC_VAR msch_interface_t msch_data[TUSB_CFG_HOST_DEVICE_MAX] TUSB_CFG_ATTR_USBRAM; // TODO to be static
// TODO rename this
-STATIC_ uint8_t msch_buffer[10] TUSB_CFG_ATTR_USBRAM;
+STATIC_VAR uint8_t msch_buffer[10] TUSB_CFG_ATTR_USBRAM;
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
@@ -108,6 +111,7 @@ tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
msch_data[dev_addr-1].interface_number = p_interface_desc->bInterfaceNumber;
(*p_length) += sizeof(tusb_descriptor_interface_t) + 2*sizeof(tusb_descriptor_endpoint_t);
+ //------------- Get Max Lun -------------//
OSAL_SUBTASK_INVOKED_AND_WAIT(
usbh_control_xfer_subtask( dev_addr, bm_request_type(TUSB_DIR_DEV_TO_HOST, TUSB_REQUEST_TYPE_CLASS, TUSB_REQUEST_RECIPIENT_INTERFACE),
MSC_REQUEST_GET_MAX_LUN, 0, msch_data[dev_addr-1].interface_number,
@@ -115,12 +119,14 @@ tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
error
);
- if(TUSB_ERROR_NONE == error /* TODO STALL means zero */)
- {
- msch_data[dev_addr-1].max_lun = msch_buffer[0];
+ SUBTASK_ASSERT( TUSB_ERROR_NONE != error /* && TODO STALL means zero */);
- tusbh_msc_mounted_cb(dev_addr);
- }
+ msch_data[dev_addr-1].max_lun = msch_buffer[0];
+
+ //------------- SCSI Inquiry -------------//
+
+
+ tusbh_msc_mounted_cb(dev_addr);
OSAL_SUBTASK_END
diff --git a/tinyusb/common/compiler/compiler.h b/tinyusb/common/compiler/compiler.h
index 7bba88282..e1f06b307 100644
--- a/tinyusb/common/compiler/compiler.h
+++ b/tinyusb/common/compiler/compiler.h
@@ -55,13 +55,17 @@
#ifdef _TEST_
#define ATTR_ALWAYS_INLINE
#define STATIC_
+ #define STATIC_VAR
#define INLINE_
#else
- #define STATIC_ static
- #define INLINE_ inline
+ #define STATIC_ static
+ #define INLINE_ inline
#if TUSB_CFG_DEBUG == 3
#define ATTR_ALWAYS_INLINE // no inline for debug = 3
+ #define STATIC_VAR
+ #else
+ #define STATIC_VAR static
#endif
#endif
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c
index 4d1a2ebd9..9ec9fc7a8 100644
--- a/tinyusb/host/ehci/ehci.c
+++ b/tinyusb/host/ehci/ehci.c
@@ -57,22 +57,22 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-STATIC_ ehci_data_t ehci_data TUSB_CFG_ATTR_USBRAM;
+STATIC_VAR ehci_data_t ehci_data TUSB_CFG_ATTR_USBRAM;
#if EHCI_PERIODIC_LIST
#if (TUSB_CFG_CONTROLLER0_MODE & TUSB_MODE_HOST)
- ATTR_ALIGNED(4096) STATIC_ ehci_link_t period_frame_list0[EHCI_FRAMELIST_SIZE] TUSB_CFG_ATTR_USBRAM;
+ ATTR_ALIGNED(4096) STATIC_VAR ehci_link_t period_frame_list0[EHCI_FRAMELIST_SIZE] TUSB_CFG_ATTR_USBRAM;
- #ifndef __ICCARM__ // IAR cannot able to determine the alignment with dataalignment pragma
+ #ifndef __ICCARM__ // IAR cannot able to determine the alignment with datalignment pragma
STATIC_ASSERT( ALIGN_OF(period_frame_list0) == 4096, "Period Framelist must be 4k alginment"); // validation
#endif
#endif
#if (TUSB_CFG_CONTROLLER1_MODE & TUSB_MODE_HOST)
- STATIC_ ehci_link_t period_frame_list1[EHCI_FRAMELIST_SIZE] ATTR_ALIGNED(4096) TUSB_CFG_ATTR_USBRAM;
+ STATIC_VAR ehci_link_t period_frame_list1[EHCI_FRAMELIST_SIZE] ATTR_ALIGNED(4096) TUSB_CFG_ATTR_USBRAM;
- #ifndef __ICCARM__ // IAR cannot able to determine the alignment with dataalignment pragma
+ #ifndef __ICCARM__ // IAR cannot able to determine the alignment with datalignment pragma
STATIC_ASSERT( ALIGN_OF(period_frame_list1) == 4096, "Period Framelist must be 4k alginment"); // validation
#endif
#endif
diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c
index 1016ebd0d..dd930845e 100644
--- a/tinyusb/host/usbh.c
+++ b/tinyusb/host/usbh.c
@@ -110,8 +110,9 @@ usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1] TUSB_CFG_ATTR_USBRAM
//------------- Enumeration Task Data -------------//
OSAL_TASK_DEF(usbh_enumeration_task, 150, TUSB_CFG_OS_TASK_PRIO);
OSAL_QUEUE_DEF(enum_queue_def, ENUM_QUEUE_DEPTH, uint32_t);
-osal_queue_handle_t enum_queue_hdl;
-STATIC_ uint8_t enum_data_buffer[TUSB_CFG_HOST_ENUM_BUFFER_SIZE] TUSB_CFG_ATTR_USBRAM;
+
+static osal_queue_handle_t enum_queue_hdl;
+STATIC_VAR uint8_t enum_data_buffer[TUSB_CFG_HOST_ENUM_BUFFER_SIZE] TUSB_CFG_ATTR_USBRAM;
//------------- Reporter Task Data -------------//
diff --git a/tinyusb/tusb_option.h b/tinyusb/tusb_option.h
index 202f6f6be..16e474959 100644
--- a/tinyusb/tusb_option.h
+++ b/tinyusb/tusb_option.h
@@ -102,11 +102,11 @@
// COMMON OPTIONS
//--------------------------------------------------------------------+
-// level 3: ATTR_ALWAYS_INLINE is null, ASSERT has text, Error has its String
+// level 3: ATTR_ALWAYS_INLINE is null, ASSERT has text, Error has its String, STATIC_VAR is NULL
// level 2: ATTR_ALWAYS_INLINE is attribute, ASSERT has no text, Error has no strings
/// 0: no debug information 3: most debug information provided
#ifndef TUSB_CFG_DEBUG
- #define TUSB_CFG_DEBUG 3
+ #define TUSB_CFG_DEBUG 2
#warning TUSB_CFG_DEBUG is not defined, default value is 3
#endif