update tinyusb, correct neopixel for usb enumeration

added binary for feather nrf52840
This commit is contained in:
hathach
2018-11-23 15:54:02 +07:00
parent 12d68f592c
commit 5e0195ddb4
9 changed files with 1754 additions and 1738 deletions

View File

@ -130,7 +130,7 @@ int32_t tud_msc_read10_cb (uint8_t lun, uint32_t lba, uint32_t offset, void* buf
// Callback invoked when received WRITE10 command.
// Process data in buffer to disk's storage and return number of written bytes
int32_t tud_msc_write10_cb (uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize)
int32_t tud_msc_write10_cb (uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize)
{
(void) lun;
@ -148,4 +148,12 @@ int32_t tud_msc_write10_cb (uint8_t lun, uint32_t lba, uint32_t offset, void* bu
return (wr_ret < 0) ? bufsize : count;
}
void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size)
{
(void) lun;
*block_count = UF2_NUM_BLOCKS;
*block_size = 512;
}
#endif

View File

@ -43,8 +43,6 @@
extern "C" {
#endif
#include "uf2/uf2cfg.h" // for block num
//--------------------------------------------------------------------+
// COMMON CONFIGURATION
//--------------------------------------------------------------------+
@ -98,12 +96,6 @@
// Number of supported Logical Unit Number
#define CFG_TUD_MSC_MAXLUN 1
// Number of Blocks
#define CFG_TUD_MSC_BLOCK_NUM UF2_NUM_BLOCKS
// Block size
#define CFG_TUD_MSC_BLOCK_SZ 512
// Buffer size for each read/write transfer, the more the better
#define CFG_TUD_MSC_BUFSIZE (4*1024)

View File

@ -158,7 +158,7 @@ void usb_teardown(void)
void tud_mount_cb(void)
{
#ifdef LED_NEOPIXEL
uint8_t grb[] = { 255, 0, 0 };
uint8_t grb[3] = { 255, 0, 0 };
neopixel_write(grb);
#endif
}
@ -166,7 +166,7 @@ void tud_mount_cb(void)
void tud_umount_cb(void)
{
#ifdef LED_NEOPIXEL
uint8_t grb[] = { 0, 255, 0 };
uint8_t grb[3] = { 0, 255, 0 };
neopixel_write(grb);
#endif
}