Fix spacing in diskio

This commit is contained in:
hexkyz 2019-07-01 20:20:34 +01:00
parent e3b968fa80
commit 382a0192f9
3 changed files with 79 additions and 79 deletions

View file

@ -9,8 +9,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include "ff.h" /* Obtains integer types */ #include "ff.h" /* Obtains integer types */
#include "diskio.h" /* Declarations of disk functions */ #include "diskio.h" /* Declarations of disk functions */
#include "../../fs_utils.h" #include "../../fs_utils.h"
@ -19,10 +19,10 @@
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DSTATUS disk_status ( DSTATUS disk_status (
BYTE pdrv /* Physical drive nmuber to identify the drive */ BYTE pdrv /* Physical drive nmuber to identify the drive */
) )
{ {
return 0; return 0;
} }
@ -32,10 +32,10 @@ DSTATUS disk_status (
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DSTATUS disk_initialize ( DSTATUS disk_initialize (
BYTE pdrv /* Physical drive nmuber to identify the drive */ BYTE pdrv /* Physical drive nmuber to identify the drive */
) )
{ {
return 0; return 0;
} }
@ -45,13 +45,13 @@ DSTATUS disk_initialize (
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DRESULT disk_read ( DRESULT disk_read (
BYTE pdrv, /* Physical drive nmuber to identify the drive */ BYTE pdrv, /* Physical drive nmuber to identify the drive */
BYTE *buff, /* Data buffer to store read data */ BYTE *buff, /* Data buffer to store read data */
DWORD sector, /* Start sector in LBA */ DWORD sector, /* Start sector in LBA */
UINT count /* Number of sectors to read */ UINT count /* Number of sectors to read */
) )
{ {
switch (pdrv) { switch (pdrv) {
case 0: case 0:
return sdmmc_device_read(&g_sd_device, sector, count, (void *)buff) ? RES_OK : RES_ERROR; return sdmmc_device_read(&g_sd_device, sector, count, (void *)buff) ? RES_OK : RES_ERROR;
default: default:
@ -68,13 +68,13 @@ DRESULT disk_read (
#if FF_FS_READONLY == 0 #if FF_FS_READONLY == 0
DRESULT disk_write ( DRESULT disk_write (
BYTE pdrv, /* Physical drive nmuber to identify the drive */ BYTE pdrv, /* Physical drive nmuber to identify the drive */
const BYTE *buff, /* Data to be written */ const BYTE *buff, /* Data to be written */
DWORD sector, /* Start sector in LBA */ DWORD sector, /* Start sector in LBA */
UINT count /* Number of sectors to write */ UINT count /* Number of sectors to write */
) )
{ {
switch (pdrv) { switch (pdrv) {
case 0: case 0:
return sdmmc_device_write(&g_sd_device, sector, count, (void *)buff) ? RES_OK : RES_ERROR; return sdmmc_device_write(&g_sd_device, sector, count, (void *)buff) ? RES_OK : RES_ERROR;
default: default:
@ -90,11 +90,11 @@ DRESULT disk_write (
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DRESULT disk_ioctl ( DRESULT disk_ioctl (
BYTE pdrv, /* Physical drive nmuber (0..) */ BYTE pdrv, /* Physical drive nmuber (0..) */
BYTE cmd, /* Control code */ BYTE cmd, /* Control code */
void *buff /* Buffer to send/receive control data */ void *buff /* Buffer to send/receive control data */
) )
{ {
return RES_OK; return RES_OK;
} }

View file

@ -9,8 +9,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include "ff.h" /* Obtains integer types */ #include "ff.h" /* Obtains integer types */
#include "diskio.h" /* Declarations of disk functions */ #include "diskio.h" /* Declarations of disk functions */
#include "ffconf.h" #include "ffconf.h"
#include "../../device_partition.h" #include "../../device_partition.h"
@ -22,10 +22,10 @@ extern device_partition_t *g_volume_to_devparts[FF_VOLUMES];
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DSTATUS disk_status ( DSTATUS disk_status (
BYTE pdrv /* Physical drive nmuber to identify the drive */ BYTE pdrv /* Physical drive nmuber to identify the drive */
) )
{ {
device_partition_t *devpart = g_volume_to_devparts[pdrv]; device_partition_t *devpart = g_volume_to_devparts[pdrv];
if (devpart) if (devpart)
return devpart->initialized ? RES_OK : STA_NOINIT; return devpart->initialized ? RES_OK : STA_NOINIT;
else else
@ -39,16 +39,16 @@ DSTATUS disk_status (
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DSTATUS disk_initialize ( DSTATUS disk_initialize (
BYTE pdrv /* Physical drive nmuber to identify the drive */ BYTE pdrv /* Physical drive nmuber to identify the drive */
) )
{ {
/* We aren't using FF_MULTI_PARTITION, so pdrv = volume id. */ /* We aren't using FF_MULTI_PARTITION, so pdrv = volume id. */
device_partition_t *devpart = g_volume_to_devparts[pdrv]; device_partition_t *devpart = g_volume_to_devparts[pdrv];
if (!devpart) if (!devpart)
return STA_NODISK; return STA_NODISK;
else if (devpart->initializer) else if (devpart->initializer)
return devpart->initializer(devpart) ? STA_NOINIT : RES_OK; return devpart->initializer(devpart) ? STA_NOINIT : RES_OK;
else else
return RES_OK; return RES_OK;
} }
@ -59,19 +59,19 @@ DSTATUS disk_initialize (
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DRESULT disk_read ( DRESULT disk_read (
BYTE pdrv, /* Physical drive nmuber to identify the drive */ BYTE pdrv, /* Physical drive nmuber to identify the drive */
BYTE *buff, /* Data buffer to store read data */ BYTE *buff, /* Data buffer to store read data */
DWORD sector, /* Start sector in LBA */ DWORD sector, /* Start sector in LBA */
UINT count /* Number of sectors to read */ UINT count /* Number of sectors to read */
) )
{ {
/* We aren't using FF_MULTI_PARTITION, so pdrv = volume id. */ /* We aren't using FF_MULTI_PARTITION, so pdrv = volume id. */
device_partition_t *devpart = g_volume_to_devparts[pdrv]; device_partition_t *devpart = g_volume_to_devparts[pdrv];
if (!devpart) if (!devpart)
return RES_PARERR; return RES_PARERR;
else if (devpart->reader) else if (devpart->reader)
return device_partition_read_data(devpart, buff, sector, count) ? RES_ERROR : RES_OK; return device_partition_read_data(devpart, buff, sector, count) ? RES_ERROR : RES_OK;
else else
return RES_ERROR; return RES_ERROR;
} }
@ -84,19 +84,19 @@ DRESULT disk_read (
#if FF_FS_READONLY == 0 #if FF_FS_READONLY == 0
DRESULT disk_write ( DRESULT disk_write (
BYTE pdrv, /* Physical drive nmuber to identify the drive */ BYTE pdrv, /* Physical drive nmuber to identify the drive */
const BYTE *buff, /* Data to be written */ const BYTE *buff, /* Data to be written */
DWORD sector, /* Start sector in LBA */ DWORD sector, /* Start sector in LBA */
UINT count /* Number of sectors to write */ UINT count /* Number of sectors to write */
) )
{ {
/* We aren't using FF_MULTI_PARTITION, so pdrv = volume id. */ /* We aren't using FF_MULTI_PARTITION, so pdrv = volume id. */
device_partition_t *devpart = g_volume_to_devparts[pdrv]; device_partition_t *devpart = g_volume_to_devparts[pdrv];
if (!devpart) if (!devpart)
return RES_PARERR; return RES_PARERR;
else if (devpart->writer) else if (devpart->writer)
return device_partition_write_data(devpart, buff, sector, count) ? RES_ERROR : RES_OK; return device_partition_write_data(devpart, buff, sector, count) ? RES_ERROR : RES_OK;
else else
return RES_ERROR; return RES_ERROR;
} }
@ -108,13 +108,13 @@ DRESULT disk_write (
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DRESULT disk_ioctl ( DRESULT disk_ioctl (
BYTE pdrv, /* Physical drive nmuber (0..) */ BYTE pdrv, /* Physical drive nmuber (0..) */
BYTE cmd, /* Control code */ BYTE cmd, /* Control code */
void *buff /* Buffer to send/receive control data */ void *buff /* Buffer to send/receive control data */
) )
{ {
device_partition_t *devpart = g_volume_to_devparts[pdrv]; device_partition_t *devpart = g_volume_to_devparts[pdrv];
switch (cmd) { switch (cmd) {
case GET_SECTOR_SIZE: case GET_SECTOR_SIZE:
*(WORD *)buff = devpart ? (WORD)devpart->sector_size : 512; *(WORD *)buff = devpart ? (WORD)devpart->sector_size : 512;
return RES_OK; return RES_OK;

View file

@ -9,8 +9,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include "ff.h" /* Obtains integer types */ #include "ff.h" /* Obtains integer types */
#include "diskio.h" /* Declarations of disk functions */ #include "diskio.h" /* Declarations of disk functions */
#include "../../fs_utils.h" #include "../../fs_utils.h"
@ -19,10 +19,10 @@
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DSTATUS disk_status ( DSTATUS disk_status (
BYTE pdrv /* Physical drive nmuber to identify the drive */ BYTE pdrv /* Physical drive nmuber to identify the drive */
) )
{ {
return 0; return 0;
} }
@ -32,10 +32,10 @@ DSTATUS disk_status (
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DSTATUS disk_initialize ( DSTATUS disk_initialize (
BYTE pdrv /* Physical drive nmuber to identify the drive */ BYTE pdrv /* Physical drive nmuber to identify the drive */
) )
{ {
return 0; return 0;
} }
@ -45,13 +45,13 @@ DSTATUS disk_initialize (
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DRESULT disk_read ( DRESULT disk_read (
BYTE pdrv, /* Physical drive nmuber to identify the drive */ BYTE pdrv, /* Physical drive nmuber to identify the drive */
BYTE *buff, /* Data buffer to store read data */ BYTE *buff, /* Data buffer to store read data */
DWORD sector, /* Start sector in LBA */ DWORD sector, /* Start sector in LBA */
UINT count /* Number of sectors to read */ UINT count /* Number of sectors to read */
) )
{ {
switch (pdrv) { switch (pdrv) {
case 0: case 0:
return sdmmc_device_read(&g_sd_device, sector, count, (void *)buff) ? RES_OK : RES_ERROR; return sdmmc_device_read(&g_sd_device, sector, count, (void *)buff) ? RES_OK : RES_ERROR;
default: default:
@ -68,13 +68,13 @@ DRESULT disk_read (
#if FF_FS_READONLY == 0 #if FF_FS_READONLY == 0
DRESULT disk_write ( DRESULT disk_write (
BYTE pdrv, /* Physical drive nmuber to identify the drive */ BYTE pdrv, /* Physical drive nmuber to identify the drive */
const BYTE *buff, /* Data to be written */ const BYTE *buff, /* Data to be written */
DWORD sector, /* Start sector in LBA */ DWORD sector, /* Start sector in LBA */
UINT count /* Number of sectors to write */ UINT count /* Number of sectors to write */
) )
{ {
switch (pdrv) { switch (pdrv) {
case 0: case 0:
return sdmmc_device_write(&g_sd_device, sector, count, (void *)buff) ? RES_OK : RES_ERROR; return sdmmc_device_write(&g_sd_device, sector, count, (void *)buff) ? RES_OK : RES_ERROR;
default: default:
@ -90,11 +90,11 @@ DRESULT disk_write (
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
DRESULT disk_ioctl ( DRESULT disk_ioctl (
BYTE pdrv, /* Physical drive nmuber (0..) */ BYTE pdrv, /* Physical drive nmuber (0..) */
BYTE cmd, /* Control code */ BYTE cmd, /* Control code */
void *buff /* Buffer to send/receive control data */ void *buff /* Buffer to send/receive control data */
) )
{ {
return RES_OK; return RES_OK;
} }