Skip to content

Commit

Permalink
[opt][sd_sample][add close file]
Browse files Browse the repository at this point in the history
  • Loading branch information
vangao-gg authored and mysterywolf committed Mar 22, 2024
1 parent af49b31 commit f7cc709
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sd_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ static int sd_sample(int argc, char *argv[])
rt_free(read_buff);
rt_free(write_buff);

ret = rt_device_close(sd_device);
if(ret != RT_EOK)
{
rt_kprintf("close device %s failed!\n", sd_name);
return ret;
}
else
{
rt_kprintf("close device %s ok!\n", sd_name);
}

return RT_EOK;
}
/* 导出到 msh 命令列表中 */
Expand Down

0 comments on commit f7cc709

Please sign in to comment.