Subdirectory provided by Embedded Artists
Dependencies: DM_FATFileSystem DM_HttpServer DM_USBHost EthernetInterface USBDevice mbed-rpc mbed-rtos mbed-src
Dependents: lpc4088_displaymodule_hello_world_Sept_2018
Fork of DMSupport by
Diff: FileSystems/RAMFileSystem.cpp
- Revision:
- 34:fc366bab393f
- Parent:
- 9:a33326afd686
--- a/FileSystems/RAMFileSystem.cpp Thu Feb 19 14:41:14 2015 +0100 +++ b/FileSystems/RAMFileSystem.cpp Mon Mar 09 11:15:56 2015 +0100 @@ -15,9 +15,11 @@ */ #include "RAMFileSystem.h" -#include "mbed_debug.h" +#include "DMBoard.h" + -#define RAMFS_DBG 0 +#define RAMFS_DBG(...) +//#define RAMFS_DBG(...) DMBoard::instance().logger()->isr_printf(__VA_ARGS__) #define SECTOR_SIZE 512 @@ -29,13 +31,13 @@ } int RAMFileSystem::disk_initialize() { - debug_if(RAMFS_DBG, "init RAM fs\n"); + RAMFS_DBG("init RAM fs\n"); status = 0; //OK return status; } int RAMFileSystem::disk_write(const uint8_t *buffer, uint64_t sector, uint8_t count) { - debug_if(RAMFS_DBG, "write to sector(s) %llu..%llu\n", sector, sector+count); + RAMFS_DBG("write to sector(s) %llu..%llu\n", sector, sector+count); if ((sector+count-1) >= disk_sectors()) { return 1; } @@ -45,7 +47,7 @@ } int RAMFileSystem::disk_read(uint8_t *buffer, uint64_t sector, uint8_t count) { - debug_if(RAMFS_DBG, "read from sector(s) %llu..%llu\n", sector, sector+count); + RAMFS_DBG("read from sector(s) %llu..%llu\n", sector, sector+count); if ((sector+count-1) >= disk_sectors()) { return 1; } @@ -55,14 +57,14 @@ } int RAMFileSystem::disk_status() { - debug_if(RAMFS_DBG, "disk status %d\n", status); + RAMFS_DBG("disk status %d\n", status); return status; } int RAMFileSystem::disk_sync() { return 0; } uint64_t RAMFileSystem::disk_sectors() { - debug_if(RAMFS_DBG, "returning fs has %u sectors\n", memSize/SECTOR_SIZE); + RAMFS_DBG("returning fs has %u sectors\n", memSize/SECTOR_SIZE); return memSize/SECTOR_SIZE; }