worked on FileSystem, started to migrate logging class

This commit is contained in:
2021-02-14 15:29:21 +01:00
parent faf6e55bc5
commit 6aa951190e
19 changed files with 612 additions and 241 deletions

View File

@@ -1,13 +1,11 @@
#pragma once
#include <cstdint>
#include <string>
#include "Types.h"
namespace FAT32 {
using ClusterNr = uint32_t;
using AbsOffset = uint32_t;
using AbsPos = uint32_t;
struct FSDesc {
uint16_t bytesPerSector;
@@ -23,7 +21,7 @@ namespace FAT32 {
AbsPos startOfFAT; // absolute byte offset where the FAT begins
AbsPos startOfFirstDataCluster; // absolute byte offset where the first cluster is
AbsPos startOfFirstRootDirCluster; // absolute byte offset where the first root dir cluster is
uint32_t dirEntriesPerSector;
uint32_t dirEntriesPerSector; // number of directory entries that fit into a sector
};
union Attributes {
@@ -63,7 +61,7 @@ namespace FAT32 {
uint8_t pos = 0;
for (uint8_t i = 0; i < 8; ++i) {if (name[i] != ' ') {buf[pos++] = name[i];}}
buf[pos++] = '.';
for (uint8_t i = 0; i < 8; ++i) {if ( ext[i] != ' ') {buf[pos++] = ext[i];}}
for (uint8_t i = 0; i < 3; ++i) {if ( ext[i] != ' ') {buf[pos++] = ext[i];}}
buf[pos] = 0;
return std::string(buf);
}