From 2fb40b504f7596b154dc4cc940b222790ea1f580 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Mon, 7 Aug 2017 18:50:39 -0300 Subject: USBH: Fix compile with FATFS 0.12b --- testhal/STM32/STM32F4xx/USB_HOST/main.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'testhal/STM32/STM32F4xx/USB_HOST/main.c') diff --git a/testhal/STM32/STM32F4xx/USB_HOST/main.c b/testhal/STM32/STM32F4xx/USB_HOST/main.c index 595e454..c540233 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/main.c +++ b/testhal/STM32/STM32F4xx/USB_HOST/main.c @@ -86,6 +86,8 @@ static void ThreadTestFTDI(void *p) { (void)p; USBHFTDIPortDriver *const ftdipp = &FTDIPD[0]; + chRegSetThreadName("FTDI"); + shellInit(); start: @@ -129,7 +131,6 @@ start: shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE, "shell", NORMALPRIO, shellThread, (void *)&shell_cfg1); - } else if (chThdTerminatedX(shelltp)) { chThdRelease(shelltp); if (usbhftdipGetState(ftdipp) != USBHFTDIP_STATE_READY) @@ -218,6 +219,8 @@ static void ThreadTestAOA(void *p) { USBHAOADriver *const aoap = &USBHAOAD[0]; USBHAOAChannel *const aoacp = &aoap->channel; + chRegSetThreadName("AOA"); + start: while (usbhaoaGetState(aoap) != USBHAOA_STATE_READY) { chThdSleepMilliseconds(100); @@ -303,34 +306,26 @@ static FIL file; static FRESULT scan_files(BaseSequentialStream *chp, char *path) { FRESULT res; - FILINFO fno; DIR dir; - int i; - char *fn; + UINT i; + static FILINFO fno; -#if _USE_LFN - fno.lfname = 0; - fno.lfsize = 0; -#endif res = f_opendir(&dir, path); if (res == FR_OK) { - i = strlen(path); for (;;) { res = f_readdir(&dir, &fno); if (res != FR_OK || fno.fname[0] == 0) break; - if (fno.fname[0] == '.') - continue; - fn = fno.fname; if (fno.fattrib & AM_DIR) { + i = strlen(path); path[i++] = '/'; - strcpy(&path[i], fn); + strcpy(&path[i], fno.fname); res = scan_files(chp, path); if (res != FR_OK) break; path[--i] = 0; } else { - usbDbgPrintf("FS: %s/%s", path, fn); + usbDbgPrintf("FS: %s/%s", path, fno.fname); } } } @@ -338,7 +333,7 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { } #endif -static THD_WORKING_AREA(waTestMSD, 1024); +static THD_WORKING_AREA(waTestMSD, 1300); static void ThreadTestMSD(void *p) { (void)p; @@ -346,6 +341,8 @@ static void ThreadTestMSD(void *p) { DWORD clusters; FRESULT res; + chRegSetThreadName("MSD"); + #if !UVC_TO_MSD_PHOTOS_CAPTURE BaseSequentialStream * const chp = (BaseSequentialStream *)&USBH_DEBUG_SD; systime_t st, et; @@ -516,6 +513,8 @@ static void ThreadTestHID(void *p) { uint8_t i; static uint8_t kbd_led_states[HAL_USBHHID_MAX_INSTANCES]; + chRegSetThreadName("HID"); + for (i = 0; i < HAL_USBHHID_MAX_INSTANCES; i++) { hidcfg[i].cb_report = _hid_report_callback; hidcfg[i].protocol = USBHHID_PROTOCOL_BOOT; @@ -626,6 +625,8 @@ static void ThreadTestUVC(void *p) { (void)p; USBHUVCDriver *const uvcdp = &USBHUVCD[0]; + chRegSetThreadName("UVC"); + for(;;) { chThdSleepMilliseconds(100); -- cgit v1.2.3