diff options
author | Diego Ismirlian <dismirlian (at) google's mail.com> | 2017-07-13 12:57:06 -0300 |
---|---|---|
committer | Diego Ismirlian <dismirlian (at) google's mail.com> | 2017-07-13 12:57:06 -0300 |
commit | c9cc2abf3e6854f68a87f72e73cd4eec92262317 (patch) | |
tree | f150a240f548edd8f840c19cdea7749b146c46af | |
parent | 442b723c127c7e5b808862a50de12d9e49ccf3bf (diff) | |
download | ChibiOS-Contrib-c9cc2abf3e6854f68a87f72e73cd4eec92262317.tar.gz ChibiOS-Contrib-c9cc2abf3e6854f68a87f72e73cd4eec92262317.tar.bz2 ChibiOS-Contrib-c9cc2abf3e6854f68a87f72e73cd4eec92262317.zip |
USBH: cleanup
-rw-r--r-- | os/hal/include/usbh/dev/msd.h | 18 | ||||
-rw-r--r-- | os/hal/src/hal_usbh.c | 9 | ||||
-rw-r--r-- | os/hal/src/usbh/hal_usbh_hid.c | 3 | ||||
-rw-r--r-- | os/hal/src/usbh/hal_usbh_msd.c | 19 |
4 files changed, 22 insertions, 27 deletions
diff --git a/os/hal/include/usbh/dev/msd.h b/os/hal/include/usbh/dev/msd.h index f73836f..3fd2927 100644 --- a/os/hal/include/usbh/dev/msd.h +++ b/os/hal/include/usbh/dev/msd.h @@ -67,19 +67,6 @@ struct USBHMassStorageLUNDriver { USBHMassStorageLUNDriver *next;
};
-struct USBHMassStorageDriver {
- /* inherited from abstract class driver */
- _usbh_base_classdriver_data
-
- usbh_ep_t epin;
- usbh_ep_t epout;
- uint8_t ifnum;
- uint8_t max_lun;
- uint32_t tag;
-
- USBHMassStorageLUNDriver *luns;
-};
-
/*===========================================================================*/
/* Driver macros. */
@@ -91,14 +78,13 @@ struct USBHMassStorageDriver { /*===========================================================================*/
extern USBHMassStorageLUNDriver MSBLKD[HAL_USBHMSD_MAX_LUNS];
-extern USBHMassStorageDriver USBHMSD[HAL_USBHMSD_MAX_INSTANCES];
#ifdef __cplusplus
extern "C" {
#endif
/* Mass Storage LUN Driver (block driver) */
- void usbhmsdLUNStart(USBHMassStorageLUNDriver *lunp);
- void usbhmsdLUNStop(USBHMassStorageLUNDriver *lunp);
+// void usbhmsdLUNStart(USBHMassStorageLUNDriver *lunp);
+// void usbhmsdLUNStop(USBHMassStorageLUNDriver *lunp);
bool usbhmsdLUNConnect(USBHMassStorageLUNDriver *lunp);
bool usbhmsdLUNDisconnect(USBHMassStorageLUNDriver *lunp);
bool usbhmsdLUNRead(USBHMassStorageLUNDriver *lunp, uint32_t startblk,
diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c index d0d3cb7..007ef1b 100644 --- a/os/hal/src/hal_usbh.c +++ b/os/hal/src/hal_usbh.c @@ -20,15 +20,8 @@ #if HAL_USE_USBH #include "usbh/internal.h" -#include <string.h> - -//devices #include "usbh/dev/hub.h" -#include "usbh/dev/aoa.h" -#include "usbh/dev/ftdi.h" -#include "usbh/dev/msd.h" -#include "usbh/dev/hid.h" -#include "usbh/dev/uvc.h" +#include <string.h> #if USBH_DEBUG_ENABLE_TRACE #define udbgf(f, ...) usbDbgPrintf(f, ##__VA_ARGS__) diff --git a/os/hal/src/usbh/hal_usbh_hid.c b/os/hal/src/usbh/hal_usbh_hid.c index 4b20fd3..5b2823f 100644 --- a/os/hal/src/usbh/hal_usbh_hid.c +++ b/os/hal/src/usbh/hal_usbh_hid.c @@ -182,7 +182,8 @@ deinit: } static void _hid_unload(usbh_baseclassdriver_t *drv) { - (void)drv; + USBHHIDDriver *const hidp = (USBHHIDDriver *)drv; + } static void _in_cb(usbh_urb_t *urb) { diff --git a/os/hal/src/usbh/hal_usbh_msd.c b/os/hal/src/usbh/hal_usbh_msd.c index d631484..f212516 100644 --- a/os/hal/src/usbh/hal_usbh_msd.c +++ b/os/hal/src/usbh/hal_usbh_msd.c @@ -65,7 +65,20 @@ static void _lun_object_deinit(USBHMassStorageLUNDriver *lunp); /* USB Class driver loader for MSD */ /*===========================================================================*/ -USBHMassStorageDriver USBHMSD[HAL_USBHMSD_MAX_INSTANCES]; +struct USBHMassStorageDriver { + /* inherited from abstract class driver */ + _usbh_base_classdriver_data + + usbh_ep_t epin; + usbh_ep_t epout; + uint8_t ifnum; + uint8_t max_lun; + uint32_t tag; + + USBHMassStorageLUNDriver *luns; +}; + +static USBHMassStorageDriver USBHMSD[HAL_USBHMSD_MAX_INSTANCES]; static void _msd_init(void); static usbh_baseclassdriver_t *_msd_load(usbh_device_t *dev, const uint8_t *descriptor, uint16_t rem); @@ -184,7 +197,7 @@ alloc_ok: MSBLKD[i].next = msdp->luns; msdp->luns = &MSBLKD[i]; MSBLKD[i].msdp = msdp; - MSBLKD[i].state = BLK_ACTIVE; /* transition directly to active, instead of BLK_STOP */ + MSBLKD[i].state = BLK_ACTIVE; luns--; } } @@ -705,6 +718,7 @@ static void _lun_object_init(USBHMassStorageLUNDriver *lunp) { */ } +/* void usbhmsdLUNStart(USBHMassStorageLUNDriver *lunp) { osalDbgCheck(lunp != NULL); osalSysLock(); @@ -724,6 +738,7 @@ void usbhmsdLUNStop(USBHMassStorageLUNDriver *lunp) { //lunp->state = BLK_STOP; osalSysUnlock(); } +*/ bool usbhmsdLUNConnect(USBHMassStorageLUNDriver *lunp) { osalDbgCheck(lunp != NULL); |