Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of d7a_1x by
Diff: include/d7a_fs.h
- Revision:
- 34:1311cc53201a
- Parent:
- 33:f9a542d3efaa
- Child:
- 37:e04613e021f2
--- a/include/d7a_fs.h Fri Jun 24 10:11:19 2016 +0000 +++ b/include/d7a_fs.h Mon Aug 22 13:47:39 2016 +0000 @@ -3,14 +3,13 @@ #include "mbed.h" #include "rtos.h" +#include "dbg.h" #include "d7a_common.h" #include "d7a_com.h" #define TO_FS (3000) #define FS_MAX_CONCURRENCY 16 // Maximum number of concurrent access - - // PROP Byte #define FS_BFO_STORAGE_CLASS 0 #define FS_BFO_ACT_COND 4 @@ -234,12 +233,20 @@ TouchFileFunction touch_file; } d7a_fs_callbacks_t; + +// Utils +#define D7A_FS_READ(fid,data,offset,len) do {\ + int status = d7a_fs_read((fid), (data), (offset), (len));\ + ASSERT(status == FS_STAT_OK, "Read file error %d (FID:%d OFF:%d LEN:%d)\r\n", status, (fid), (offset), (len));\ + } while(0); + + void d7a_fs_open(const d7a_fs_callbacks_t* config); -void* d7a_fs_wait_done(uint32_t millisec = osWaitForever); +int8_t d7a_fs_wait_done(const uint8_t id, uint32_t millisec); void d7a_fs_new_pkt(d7a_com_rx_msg_t* pkt); d7a_com_rx_msg_t* d7a_fs_wait_pkt( uint32_t millisec = osWaitForever ); uint32_t d7a_fs_get_properties(uint8_t fid, d7a_fs_property_t prop, d7a_fs_properties_t* props); -void d7a_fs_distant_stat(uint8_t fid, int* length); +int d7a_fs_distant_stat(uint8_t fid, int* length); int d7a_fs_distant_create(uint8_t fid, d7a_fs_properties_t* props); int d7a_fs_read(uint8_t fid, void *data, uint32_t offset, uint32_t length);