Skip to content

Commit 57aa554

Browse files
committed
update tinyusb to latest for scsi write10 complete fix
1 parent 9ed3f5e commit 57aa554

File tree

5 files changed

+15
-27
lines changed

5 files changed

+15
-27
lines changed

.gitmodules

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[submodule "tinyusb"]
22
path = lib/tinyusb
33
url = https://github.com/hathach/tinyusb.git
4-
branch = develop
54
[submodule "lib/nrfx"]
65
path = lib/nrfx
76
url = https://github.com/NordicSemiconductor/nrfx.git

lib/sdk11/components/libraries/bootloader_dfu/bootloader.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ static void wait_for_events(void)
130130
#ifdef NRF52840_XXAA
131131
// skip if usb is not inited ( e.g OTA / finializing sd/bootloader )
132132
extern bool usb_inited(void);
133-
if ( usb_inited() )
133+
if ( tusb_inited() )
134134
{
135-
tusb_task();
135+
tud_task();
136136
tud_cdc_write_flush();
137137
}
138138
#endif

lib/tinyusb

Submodule tinyusb updated 1050 files

src/usb/usb.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,9 @@ extern uint16_t usb_desc_str_serial[1+16];
6363
* We must call it within SD's SOC event handler, or set it as power event handler if SD is not enabled. */
6464
extern void tusb_hal_nrf_power_event(uint32_t event);
6565

66-
6766
//------------- IMPLEMENTATION -------------//
68-
static bool _inited = false;
69-
70-
bool usb_inited(void)
71-
{
72-
return _inited;
73-
}
74-
7567
void usb_init(bool cdc_only)
7668
{
77-
// skipped if already inited
78-
if ( _inited ) return;
79-
80-
_inited = true;
81-
8269
NVIC_SetPriority(USBD_IRQn, 2);
8370

8471
// USB power may already be ready at this time -> no event generated

src/usb/usb_desc.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,21 @@ enum {
5959
};
6060

6161
/*------------- Endpoint Numbering & Size -------------*/
62-
#define _EP_IN(x) (0x80 | (x))
63-
#define _EP_OUT(x) (x)
62+
#define _EP_IN(x) (0x80 | (x))
63+
#define _EP_OUT(x) (x)
6464

6565
// CDC
66-
#define EP_CDC_NOTIF _EP_IN ( ITF_NUM_CDC+1 )
67-
#define EP_CDC_NOTIF_SIZE 8
66+
#define EP_CDC_NOTIF _EP_IN ( ITF_NUM_CDC+1 )
67+
#define EP_CDC_NOTIF_SIZE 8
6868

69-
#define EP_CDC_OUT _EP_OUT( ITF_NUM_CDC+2 )
70-
#define EP_CDC_IN _EP_IN ( ITF_NUM_CDC+2 )
69+
#define EP_CDC_OUT _EP_OUT( ITF_NUM_CDC+2 )
70+
#define EP_CDC_IN _EP_IN ( ITF_NUM_CDC+2 )
7171

7272
// Mass Storage
73-
#define EP_MSC_OUT _EP_OUT( ITF_NUM_MSC+1 )
74-
#define EP_MSC_IN _EP_IN ( ITF_NUM_MSC+1 )
73+
#define EP_MSC_OUT _EP_OUT( ITF_NUM_MSC+1 )
74+
#define EP_MSC_IN _EP_IN ( ITF_NUM_MSC+1 )
75+
76+
#define EP_MSC_SIZE 64
7577

7678
//--------------------------------------------------------------------+
7779
// STRING DESCRIPTORS
@@ -280,7 +282,7 @@ usb_desc_cfg_t usb_desc_cfg =
280282
.bDescriptorType = TUSB_DESC_ENDPOINT,
281283
.bEndpointAddress = EP_MSC_OUT,
282284
.bmAttributes = { .xfer = TUSB_XFER_BULK },
283-
.wMaxPacketSize = { .size = CFG_TUD_MSC_EPSIZE},
285+
.wMaxPacketSize = { .size = EP_MSC_SIZE},
284286
.bInterval = 1
285287
},
286288

@@ -290,7 +292,7 @@ usb_desc_cfg_t usb_desc_cfg =
290292
.bDescriptorType = TUSB_DESC_ENDPOINT,
291293
.bEndpointAddress = EP_MSC_IN,
292294
.bmAttributes = { .xfer = TUSB_XFER_BULK },
293-
.wMaxPacketSize = { .size = CFG_TUD_MSC_EPSIZE},
295+
.wMaxPacketSize = { .size = EP_MSC_SIZE },
294296
.bInterval = 1
295297
}
296298
}

0 commit comments

Comments
 (0)