software/liblitesdcard: Fix compilation with picolibc.

This commit is contained in:
Florent Kermarrec 2021-09-27 18:56:18 +02:00
parent 727d898a6c
commit 01a906add7
2 changed files with 6 additions and 6 deletions

View File

@ -565,19 +565,19 @@ void sdcard_write(uint32_t block, uint32_t count, uint8_t* buf)
static DSTATUS sdcardstatus = STA_NOINIT;
DSTATUS disk_status(uint8_t drv) {
DSTATUS disk_status(BYTE drv) {
if (drv) return STA_NOINIT;
return sdcardstatus;
}
DSTATUS disk_initialize(uint8_t drv) {
DSTATUS disk_initialize(BYTE drv) {
if (drv) return STA_NOINIT;
if (sdcardstatus)
sdcardstatus = sdcard_init() ? 0 : STA_NOINIT;
return sdcardstatus;
}
DRESULT disk_read(uint8_t drv, uint8_t *buf, uint32_t block, uint32_t count) {
DRESULT disk_read(BYTE drv, BYTE *buf, LBA_t block, UINT count) {
sdcard_read(block, count, buf);
return RES_OK;
}

View File

@ -264,12 +264,12 @@ uint8_t spisdcard_init(void) {
static DSTATUS spisdcardstatus = STA_NOINIT;
DSTATUS disk_status(uint8_t drv) {
DSTATUS disk_status(BYTE drv) {
if (drv) return STA_NOINIT;
return spisdcardstatus;
}
DSTATUS disk_initialize(uint8_t drv) {
DSTATUS disk_initialize(BYTE drv) {
if (drv) return STA_NOINIT;
if (spisdcardstatus) {
spisdcardstatus = spisdcard_init() ? 0 : STA_NOINIT;
@ -278,7 +278,7 @@ DSTATUS disk_initialize(uint8_t drv) {
return spisdcardstatus;
}
DRESULT disk_read(uint8_t drv, uint8_t *buf, uint32_t sector, uint32_t count) {
DRESULT disk_read(BYTE drv, BYTE *buf, LBA_t block, UINT count) {
uint8_t cmd;
if (count > 1)
cmd = CMD18; /* READ_MULTIPLE_BLOCK */