Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
FsStatic Class Reference

Class that holds information and code for the single-file filesystem for emulating eeprom. More...

#include <ArduinoFs.hxx>

Classes

struct  FileInfo
 We have one of these for each open file descriptor. More...
 

Static Public Member Functions

static FileInfoget_file (int fd)
 Lookup a file descriptor.
 
static int new_fd ()
 Allocates a new file descriptor.
 
static void flush_if_dirty ()
 If there is unflushed writes, performs the flash write.
 

Static Public Attributes

static constexpr unsigned MAX_FD = 8
 Number of possible open file desriptors.
 
static constexpr off_t UNUSED_FILE = (off_t)-1
 Offset markng that a file descriptor is not in use.
 
static FileInfo fds [MAX_FD]
 Stores all file descriptors.
 
static uint8_t loaded_ = 0
 1 if we have filled the eeprom buffer at least once since startup.
 
static uint8_t dirty_ = 0
 1 if we have unflushed written data in the eeprom buffer.
 

Detailed Description

Class that holds information and code for the single-file filesystem for emulating eeprom.

Definition at line 57 of file ArduinoFs.hxx.

Member Function Documentation

◆ flush_if_dirty()

static void FsStatic::flush_if_dirty ( )
inlinestatic

If there is unflushed writes, performs the flash write.

Definition at line 125 of file ArduinoFs.hxx.

◆ get_file()

static FileInfo * FsStatic::get_file ( int  fd)
inlinestatic

Lookup a file descriptor.

Parameters
fdthe file descriptor.
Returns
nullptr if fd is an invalid file descriptor (in which case also sets errno), otherwise the file descriptor structure.

Definition at line 97 of file ArduinoFs.hxx.

◆ new_fd()

static int FsStatic::new_fd ( )
inlinestatic

Allocates a new file descriptor.

Returns
new fd. If there is no free file descriptor, returns -1 and sets errno.

Definition at line 110 of file ArduinoFs.hxx.

Member Data Documentation

◆ dirty_

uint8_t FsStatic::dirty_ = 0
static

1 if we have unflushed written data in the eeprom buffer.

Definition at line 137 of file ArduinoFs.hxx.

◆ fds

FsStatic::FileInfo FsStatic::fds
static

Stores all file descriptors.

Definition at line 91 of file ArduinoFs.hxx.

◆ loaded_

uint8_t FsStatic::loaded_ = 0
static

1 if we have filled the eeprom buffer at least once since startup.

Definition at line 135 of file ArduinoFs.hxx.

◆ MAX_FD

constexpr unsigned FsStatic::MAX_FD = 8
staticconstexpr

Number of possible open file desriptors.

Definition at line 61 of file ArduinoFs.hxx.

◆ UNUSED_FILE

constexpr off_t FsStatic::UNUSED_FILE = (off_t)-1
staticconstexpr

Offset markng that a file descriptor is not in use.

Definition at line 63 of file ArduinoFs.hxx.


The documentation for this class was generated from the following file: