Skip to content

Commit

Permalink
update:fatfs设置默认值
Browse files Browse the repository at this point in the history
  • Loading branch information
doudouladou committed Jan 30, 2024
1 parent 2eeed05 commit e625d71
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions components/fatfs/diskio_spitf.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,9 +977,10 @@ const block_disk_opts_t spitf_disk_opts = {
.write = luat_spitf_write,
.ioctl = luat_spitf_ioctl,
};
#ifndef LUAT_COMPILER_NOWEAK
__attribute__((weak)) void luat_spi_set_sdhc_ctrl(
block_disk_t *disk)

void luat_spi_set_sdhc_ctrl_default(
block_disk_t *disk
)
{
luat_fatfs_spi_t* userdata = disk->userdata;
if (userdata->type)
Expand All @@ -1002,6 +1003,13 @@ __attribute__((weak)) void luat_spi_set_sdhc_ctrl(
disk->userdata = NULL;
disk->opts = &spitf_disk_opts;
}

#ifndef LUAT_COMPILER_NOWEAK
__attribute__((weak)) void luat_spi_set_sdhc_ctrl(
block_disk_t *disk)
{
luat_spi_set_sdhc_ctrl_default(disk);
}
#else
void luat_spi_set_sdhc_ctrl(block_disk_t *disk);
#endif
Expand Down

0 comments on commit e625d71

Please sign in to comment.