Prusa MINI Firmware overview
Slot Class Reference
Collaboration diagram for Slot:

Public Types

enum  Type : uint8_t { File, Directory }
 

Public Member Functions

 Slot ()
 

Static Public Member Functions

static Slotallocate (Type type)
 
static void free (Slot *slot)
 
static void free_all ()
 

Public Attributes

Type type
 
union {
   FIL   file
 
   DIR   directory
 
}; 
 

Member Enumeration Documentation

◆ Type

Enumerator
File 
Directory 
33  : uint8_t {
34  File,
35  Directory,
36  };

Constructor & Destructor Documentation

◆ Slot()

Slot::Slot ( )
46  : type(File)
47  , file()
48  , is_used(false) {
49  }

Member Function Documentation

◆ allocate()

static Slot* Slot::allocate ( Type  type)
static
51  {
52  for (int i = 0; i < _pool_size; i++) {
53  auto &slot = _pool[i];
54  if (slot.is_used)
55  continue;
56  slot.type = type;
57  return &slot;
58  }
59  return nullptr;
60  }
Here is the caller graph for this function:

◆ free()

static void Slot::free ( Slot slot)
static
62  {
63  slot->is_used = false;
64  }
Here is the caller graph for this function:

◆ free_all()

static void Slot::free_all ( )
static
65  {
66  for (size_t i = 0; i < Slot::_pool_size; ++i)
67  _pool[i].is_used = false;
68  }

Member Data Documentation

◆ type

Type Slot::type

◆ file

FIL Slot::file

◆ directory

DIR Slot::directory

◆ @69

union { ... }
Slot::type
Type type
Definition: Marlin_CardReader.cpp:38
Slot::file
FIL file
Definition: Marlin_CardReader.cpp:41
i
uint8_t i
Definition: screen_test_graph.c:72
uint8_t
const uint8_t[]
Definition: 404_html.c:3
Slot::File
Definition: Marlin_CardReader.cpp:34
Slot::Directory
Definition: Marlin_CardReader.cpp:35