Adopt sources to new HAL.
This commit is contained in:
parent
ccfc910829
commit
7ab18994e7
|
@ -334,6 +334,7 @@ static size_t read(void *ip, uint8_t *bp, size_t n) {
|
|||
}
|
||||
|
||||
static const struct EepromFileStreamVMT vmt = {
|
||||
(size_t)0,
|
||||
write,
|
||||
read,
|
||||
eepfs_put,
|
||||
|
|
|
@ -383,6 +383,7 @@ static size_t read(void *ip, uint8_t *bp, size_t n) {
|
|||
}
|
||||
|
||||
static const struct EepromFileStreamVMT vmt = {
|
||||
(size_t)0,
|
||||
write,
|
||||
read,
|
||||
eepfs_put,
|
||||
|
|
|
@ -498,7 +498,15 @@ static size_t _read(USBHAOAChannel *aoacp, uint8_t *bp, size_t n) {
|
|||
return _read_timeout(aoacp, bp, n, TIME_INFINITE);
|
||||
}
|
||||
|
||||
static msg_t _ctl(USBHAOAChannel *ftdipp, unsigned int operation, void *arg) {
|
||||
(void)ftdipp;
|
||||
(void)operation;
|
||||
(void)arg;
|
||||
return MSG_OK;
|
||||
}
|
||||
|
||||
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 +514,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,
|
||||
(msg_t (*)(void *, unsigned int, void *))_ctl
|
||||
};
|
||||
|
||||
static void _stop_channelS(USBHAOAChannel *aoacp) {
|
||||
|
|
|
@ -600,6 +600,13 @@ static size_t _read(USBHFTDIPortDriver *ftdipp, uint8_t *bp, size_t n) {
|
|||
return _read_timeout(ftdipp, bp, n, TIME_INFINITE);
|
||||
}
|
||||
|
||||
static msg_t _ctl(USBHFTDIPortDriver *ftdipp, unsigned int operation, void *arg) {
|
||||
(void)ftdipp;
|
||||
(void)operation;
|
||||
(void)arg;
|
||||
return MSG_OK;
|
||||
}
|
||||
|
||||
static void _vt(void *p) {
|
||||
USBHFTDIPortDriver *const ftdipp = (USBHFTDIPortDriver *)p;
|
||||
osalSysLockFromISR();
|
||||
|
@ -615,6 +622,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 +630,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,
|
||||
(msg_t (*)(void *, unsigned int, void *))_ctl
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -5,3 +5,7 @@ FATFSSRC = ${CHIBIOS_CONTRIB}/os/various/fatfs_bindings/fatfs_diskio.c \
|
|||
$(CHIBIOS)/ext/fatfs/src/ffunicode.c
|
||||
|
||||
FATFSINC = ${CHIBIOS}/ext/fatfs/src
|
||||
|
||||
# Shared variables
|
||||
ALLCSRC += $(FATFSSRC)
|
||||
ALLINC += $(FATFSINC)
|
||||
|
|
|
@ -243,12 +243,12 @@ DRESULT disk_ioctl (
|
|||
switch (cmd) {
|
||||
case CTRL_SYNC:
|
||||
return RES_OK;
|
||||
#if _MAX_SS > _MIN_SS
|
||||
#if FF_MAX_SS > FF_MIN_SS
|
||||
case GET_SECTOR_SIZE:
|
||||
*((WORD *)buff) = MMCSD_BLOCK_SIZE;
|
||||
return RES_OK;
|
||||
#endif
|
||||
#if _USE_TRIM
|
||||
#if FF_USE_TRIM
|
||||
case CTRL_TRIM:
|
||||
mmcErase(&MMCD1, *((DWORD *)buff), *((DWORD *)buff + 1));
|
||||
return RES_OK;
|
||||
|
@ -264,7 +264,7 @@ DRESULT disk_ioctl (
|
|||
case GET_SECTOR_COUNT:
|
||||
*((DWORD *)buff) = mmcsdGetCardCapacity(&SDCD1);
|
||||
return RES_OK;
|
||||
#if _MAX_SS > _MIN_SS
|
||||
#if FF_MAX_SS > FF_MIN_SS
|
||||
case GET_SECTOR_SIZE:
|
||||
*((WORD *)buff) = MMCSD_BLOCK_SIZE;
|
||||
return RES_OK;
|
||||
|
@ -272,7 +272,7 @@ DRESULT disk_ioctl (
|
|||
case GET_BLOCK_SIZE:
|
||||
*((DWORD *)buff) = 256; /* 512b blocks in one erase block */
|
||||
return RES_OK;
|
||||
#if _USE_TRIM
|
||||
#if FF_USE_TRIM
|
||||
case CTRL_TRIM:
|
||||
sdcErase(&SDCD1, *((DWORD *)buff), *((DWORD *)buff + 1));
|
||||
return RES_OK;
|
||||
|
@ -289,12 +289,12 @@ DRESULT disk_ioctl (
|
|||
case GET_SECTOR_COUNT:
|
||||
*((DWORD *)buff) = MSBLKD[0].info.blk_num;
|
||||
return RES_OK;
|
||||
#if _MAX_SS > _MIN_SS
|
||||
#if FF_MAX_SS > FF_MIN_SS
|
||||
case GET_SECTOR_SIZE:
|
||||
*((WORD *)buff) = MSBLKD[0].info.blk_size;
|
||||
return RES_OK;
|
||||
#endif
|
||||
#if _USE_TRIM
|
||||
#if FF_USE_TRIM
|
||||
#error "unimplemented yet!"
|
||||
// case CTRL_TRIM:
|
||||
// ....
|
||||
|
|
|
@ -139,6 +139,7 @@ static bool get_info(void *instance, BlockDeviceInfo *bdip) {
|
|||
*
|
||||
*/
|
||||
static const struct BaseBlockDeviceVMT vmt = {
|
||||
(size_t)0,
|
||||
is_inserted,
|
||||
is_protected,
|
||||
connect,
|
||||
|
|
Loading…
Reference in New Issue