diff options
author | David Crocker <dcrocker@eschertech.com> | 2018-09-12 15:11:27 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2018-09-12 15:11:27 +0300 |
commit | 86849495f7693e7ef90cca1f440c4d33beae3609 (patch) | |
tree | ef2631e9c12ce2f76e67429cad7e58e4e19556e1 /src/Storage/FileStore.cpp | |
parent | 2b36fa68dfbb24074f6fee40962c19ca7b6b59d1 (diff) |
Refactoring to make code sharing easier
Added DmacManager and StepTimer files to make other modules more portable between RRF andDuet3Expansoin firmware
Updated SAME70 builds pin numbering to work with latest CoreNG
Diffstat (limited to 'src/Storage/FileStore.cpp')
-rw-r--r-- | src/Storage/FileStore.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Storage/FileStore.cpp b/src/Storage/FileStore.cpp index 002c31f6..984248d1 100644 --- a/src/Storage/FileStore.cpp +++ b/src/Storage/FileStore.cpp @@ -6,6 +6,7 @@ #include "Platform.h" #include "RepRap.h" #include "Libraries/Fatfs/diskio.h" +#include "Movement/StepTimer.h" uint32_t FileStore::longestWriteTime = 0; @@ -335,10 +336,10 @@ int FileStore::ReadLine(char* buf, size_t nBytes) FRESULT FileStore::Store(const char *s, size_t len, size_t *bytesWritten) { - uint32_t time = Platform::GetInterruptClocks(); + uint32_t time = StepTimer::GetInterruptClocks(); crc.Update(s, len); const FRESULT writeStatus = f_write(&file, s, len, bytesWritten); - time = Platform::GetInterruptClocks() - time; + time = StepTimer::GetInterruptClocks() - time; if (time > longestWriteTime) { longestWriteTime = time; @@ -472,7 +473,7 @@ bool FileStore::Truncate() // Return the file write time in milliseconds, and clear it float FileStore::GetAndClearLongestWriteTime() { - const float ret = (float)longestWriteTime * StepClocksToMillis; + const float ret = (float)longestWriteTime * StepTimer::StepClocksToMillis; longestWriteTime = 0; return ret; } |