fix esp32 msc example
This commit is contained in:
@@ -31,9 +31,7 @@
|
||||
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
|
||||
//------------- IMPLEMENTATION -------------//
|
||||
|
||||
// helper
|
||||
size_t get_console_inputs(uint8_t *buf, size_t bufsize) {
|
||||
size_t count = 0;
|
||||
while (count < bufsize) {
|
||||
@@ -47,6 +45,10 @@ size_t get_console_inputs(uint8_t *buf, size_t bufsize) {
|
||||
return count;
|
||||
}
|
||||
|
||||
void cdc_app_init(void) {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
void cdc_app_task(void* param) {
|
||||
(void) param;
|
||||
|
||||
|
@@ -48,6 +48,10 @@ static void process_kbd_report(hid_keyboard_report_t const *report);
|
||||
static void process_mouse_report(hid_mouse_report_t const *report);
|
||||
static void process_generic_report(uint8_t dev_addr, uint8_t instance, uint8_t const *report, uint16_t len);
|
||||
|
||||
void hid_app_init(void) {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// TinyUSB Callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
|
@@ -82,10 +82,15 @@ StaticTask_t cdc_taskdef;
|
||||
TimerHandle_t blinky_tm;
|
||||
|
||||
static void led_blinky_cb(TimerHandle_t xTimer);
|
||||
static void usb_host_task(void* param);
|
||||
extern void cdc_app_init(void);
|
||||
extern void hid_app_init(void);
|
||||
extern void msc_app_init(void);
|
||||
|
||||
static void usb_host_task(void* param);
|
||||
extern void cdc_app_task(void* param);
|
||||
|
||||
|
||||
|
||||
/*------------- MAIN -------------*/
|
||||
int main(void) {
|
||||
board_init();
|
||||
@@ -131,6 +136,10 @@ static void usb_host_task(void *param) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
|
||||
cdc_app_init();
|
||||
hid_app_init();
|
||||
msc_app_init();
|
||||
|
||||
// RTOS forever loop
|
||||
while (1) {
|
||||
// put this thread to waiting state until there is new events
|
||||
@@ -154,7 +163,6 @@ void tuh_umount_cb(uint8_t dev_addr) {
|
||||
printf("A device with address %d is unmounted \r\n", dev_addr);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLINKING TASK
|
||||
//--------------------------------------------------------------------+
|
||||
|
@@ -25,10 +25,12 @@
|
||||
|
||||
#include "tusb.h"
|
||||
|
||||
#if CFG_TUH_MSC
|
||||
|
||||
static scsi_inquiry_resp_t inquiry_resp;
|
||||
|
||||
void msc_app_init(void) {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
bool inquiry_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const *cb_data) {
|
||||
msc_cbw_t const *cbw = cb_data->cbw;
|
||||
msc_csw_t const *csw = cb_data->csw;
|
||||
@@ -63,5 +65,3 @@ void tuh_msc_umount_cb(uint8_t dev_addr) {
|
||||
(void) dev_addr;
|
||||
printf("A MassStorage device is unmounted\r\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user