Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
update to TinyUSB v0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
majbthrd committed Mar 21, 2022
1 parent 25d1677 commit 63278f8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ int main(void)
// Invoked when received GET_REPORT control request
// Application must fill buffer report's content and return its length.
// Return zero will cause the stack to STALL request
uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
{
// TODO not Implemented
(void) instance;
(void) report_id;
(void) report_type;
(void) buffer;
Expand All @@ -64,12 +65,13 @@ uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type,
return 0;
}

void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* RxDataBuffer, uint16_t bufsize)
void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const* RxDataBuffer, uint16_t bufsize)
{
static uint8_t TxDataBuffer[CFG_TUD_HID_EP_BUFSIZE];
uint32_t response_size = TU_MIN(CFG_TUD_HID_EP_BUFSIZE, bufsize);

// This doesn't use multiple report and report ID
(void) instance;
(void) report_id;
(void) report_type;

Expand Down
1 change: 1 addition & 0 deletions myboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ __NO_RETURN static void bad_happened(void)

void panic(const char *fmt, ...) { bad_happened(); }
void __assert(const char *__expression, const char *__filename, int __line) { bad_happened(); }
void hard_assertion_failure(void) { bad_happened(); }
3 changes: 2 additions & 1 deletion pico-debug.hzp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
<file file_name="$(TOP)/src/class/midi/midi_device.c" />
<file file_name="$(TOP)/src/class/usbtmc/usbtmc_device.c" />
<file file_name="$(TOP)/src/class/vendor/vendor_device.c" />
<file file_name="$(TOP)/src/class/net/net_device.c" />
<file file_name="$(TOP)/src/class/net/ecm_rndis_device.c" />
<file file_name="$(TOP)/src/class/net/ncm_device.c" />
<file file_name="$(TOP)/src/portable/$(VENDOR)/$(CHIP_FAMILY)/dcd_$(CHIP_FAMILY).c" />
</folder>
<folder Name="System Files">
Expand Down
2 changes: 1 addition & 1 deletion tinyusb
Submodule tinyusb updated 844 files
2 changes: 1 addition & 1 deletion tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
#define CFG_TUD_HID 1
#define CFG_TUD_MIDI 0
#define CFG_TUD_VENDOR 0
#define CFG_TUD_NET 0
#define CFG_TUD_ECM_RNDIS 0

#define CFG_TUD_HID_EP_BUFSIZE 64

Expand Down
5 changes: 3 additions & 2 deletions usb_descriptors.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ static uint8_t const desc_hid_report[] =
// Invoked when received GET HID REPORT DESCRIPTOR
// Application return pointer to descriptor
// Descriptor contents must exist long enough for transfer to complete
uint8_t const * tud_hid_descriptor_report_cb(void)
uint8_t const * tud_hid_descriptor_report_cb(uint8_t instance)
{
(void)instance;
return desc_hid_report;
}

Expand All @@ -78,7 +79,7 @@ uint8_t const desc_configuration[] =
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),

// Interface number, string index, protocol, report descriptor len, EP In & Out address, size & polling interval
TUD_HID_INOUT_DESCRIPTOR(ITF_NUM_HID, 0, HID_PROTOCOL_NONE, sizeof(desc_hid_report), EPNUM_HID, 0x80 | EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 1)
TUD_HID_INOUT_DESCRIPTOR(ITF_NUM_HID, 0, HID_PROTOCOL_REPORT, sizeof(desc_hid_report), EPNUM_HID, 0x80 | EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 1)
};

// Invoked when received GET CONFIGURATION DESCRIPTOR
Expand Down

0 comments on commit 63278f8

Please sign in to comment.