From 2a9d939d72a8c22d248450107b26e25506d42160 Mon Sep 17 00:00:00 2001 From: Paul Roukema Date: Sun, 5 Aug 2018 23:59:06 -0400 Subject: Fix incompatible USBH VMTs --- os/hal/src/usbh/hal_usbh_aoa.c | 4 +++- os/hal/src/usbh/hal_usbh_ftdi.c | 5 ++++- os/hal/src/usbh/hal_usbh_msd.c | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/os/hal/src/usbh/hal_usbh_aoa.c b/os/hal/src/usbh/hal_usbh_aoa.c index d565595..c2a7646 100644 --- a/os/hal/src/usbh/hal_usbh_aoa.c +++ b/os/hal/src/usbh/hal_usbh_aoa.c @@ -499,6 +499,7 @@ static size_t _read(USBHAOAChannel *aoacp, uint8_t *bp, size_t n) { } static const struct AOADriverVMT async_channel_vmt = { + (size_t) 0, (size_t (*)(void *, const uint8_t *, size_t))_write, (size_t (*)(void *, uint8_t *, size_t))_read, (msg_t (*)(void *, uint8_t))_put, @@ -506,7 +507,8 @@ static const struct AOADriverVMT async_channel_vmt = { (msg_t (*)(void *, uint8_t, systime_t))_put_timeout, (msg_t (*)(void *, systime_t))_get_timeout, (size_t (*)(void *, const uint8_t *, size_t, systime_t))_write_timeout, - (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout + (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout, + (void*) 0 // FIXME: Implement CTL }; static void _stop_channelS(USBHAOAChannel *aoacp) { diff --git a/os/hal/src/usbh/hal_usbh_ftdi.c b/os/hal/src/usbh/hal_usbh_ftdi.c index 6966028..070dbcf 100644 --- a/os/hal/src/usbh/hal_usbh_ftdi.c +++ b/os/hal/src/usbh/hal_usbh_ftdi.c @@ -150,6 +150,7 @@ alloc_ok: case 0x900: //232H; uinfo("FTDI: Type H chip"); ftdip->type = USBHFTDI_TYPE_H; + break; default: uerr("FTDI: Unrecognized chip type"); return NULL; @@ -615,6 +616,7 @@ static void _vt(void *p) { } static const struct FTDIPortDriverVMT async_channel_vmt = { + (size_t) 0, (size_t (*)(void *, const uint8_t *, size_t))_write, (size_t (*)(void *, uint8_t *, size_t))_read, (msg_t (*)(void *, uint8_t))_put, @@ -622,7 +624,8 @@ static const struct FTDIPortDriverVMT async_channel_vmt = { (msg_t (*)(void *, uint8_t, systime_t))_put_timeout, (msg_t (*)(void *, systime_t))_get_timeout, (size_t (*)(void *, const uint8_t *, size_t, systime_t))_write_timeout, - (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout + (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout, + (void*) 0 // FIXME: Implement CTL }; diff --git a/os/hal/src/usbh/hal_usbh_msd.c b/os/hal/src/usbh/hal_usbh_msd.c index 7233a0b..fe97ff0 100644 --- a/os/hal/src/usbh/hal_usbh_msd.c +++ b/os/hal/src/usbh/hal_usbh_msd.c @@ -683,6 +683,7 @@ static msd_result_t scsi_write10(USBHMassStorageLUNDriver *lunp, uint32_t lba, u USBHMassStorageLUNDriver MSBLKD[HAL_USBHMSD_MAX_LUNS]; static const struct USBHMassStorageDriverVMT blk_vmt = { + (size_t)0, (bool (*)(void *))usbhmsdLUNIsInserted, (bool (*)(void *))usbhmsdLUNIsProtected, (bool (*)(void *))usbhmsdLUNConnect, -- cgit v1.2.3