BlinkenArea - GitList
Repositories
Blog
Wiki
flaneth
Code
Commits
Branches
Tags
Search
Tree:
80d3768
Branches
Tags
master
flaneth
firmware
dosfs_user.c
added dosfs code to read FAT filesystems
Stefan Schuermans
commited
80d3768
at 2012-05-03 18:43:13
dosfs_user.c
Blame
History
Raw
/* flaneth - flash and ethernet Copyright (C) 2007-2012 Stefan Schuermans <stefan@schuermans.info> Copyleft: GNU public license V2 - http://www.gnu.org/copyleft/gpl.html a BlinkenArea project - http://www.blinkenarea.org/ */ #include "cf.h" #include "dosfs.h" /** * @brief read sector(s) from disk * @param[in] unit identifies the disk * @param[in] buffer to put data into * @param[in] sector number of sector * @param[in] count number of sectors to read * @return 0 on success, -1 on error */ uint32_t DFS_ReadSector(uint8_t unit, uint8_t *buffer, uint32_t sector, uint32_t count) { // read sectros from CF card for ( ; count > 0; count--, buffer += SECTOR_SIZE) if (CfRead(sector, buffer) != 0) return -1; return 0; (void)unit; } /** * @brief write sector(s) to disk * @param[in] unit identifies the disk * @param[in] buffer to get data from * @param[in] sector number of sector * @param[in] count number of sectors to write * @return 0 on success, -1 on error */ uint32_t DFS_WriteSector(uint8_t unit, uint8_t *buffer, uint32_t sector, uint32_t count) { // writing not supported return -1; (void)unit; (void)buffer; (void)sector; (void)count; }