Prusa MINI Firmware overview
PrintJobRecovery Class Reference

#include <power_loss_recovery.h>

Collaboration diagram for PrintJobRecovery:

Static Public Member Functions

static void init ()
 
static void prepare ()
 
static void setup ()
 
static uint32_t command_sdpos ()
 
static void commit_sdpos (const uint8_t index_w)
 
static void enable (const bool onoff)
 
static void changed ()
 
static void check ()
 
static void resume ()
 
static bool exists ()
 
static void open (const bool read)
 
static void close ()
 
static void purge ()
 
static void load ()
 
static void save (const bool force=false, const bool save_queue=true)
 
static bool valid ()
 
static void debug (PGM_P const)
 

Static Public Attributes

static const char filename [5]
 
static SdFile file
 
static job_recovery_info_t info
 
static uint8_t queue_index_r
 Queue index of the active command. More...
 
static uint32_t cmd_sdpos
 SD position of the next command. More...
 
static uint32_t sdpos [BUFSIZE]
 SD positions of queued commands. More...
 
static bool enabled
 

Member Function Documentation

◆ init()

static void PrintJobRecovery::init ( )
static

◆ prepare()

static void PrintJobRecovery::prepare ( )
static

◆ setup()

static void PrintJobRecovery::setup ( )
static
120  {
121  #if PIN_EXISTS(POWER_LOSS)
122  #if ENABLED(POWER_LOSS_PULL)
123  #if POWER_LOSS_STATE == LOW
125  #else
127  #endif
128  #else
130  #endif
131  #endif
132  }
Here is the caller graph for this function:

◆ command_sdpos()

static uint32_t PrintJobRecovery::command_sdpos ( )
static
135 { return sdpos[queue_index_r]; }
Here is the caller graph for this function:

◆ commit_sdpos()

static void PrintJobRecovery::commit_sdpos ( const uint8_t  index_w)
static
136 { sdpos[index_w] = cmd_sdpos; }

◆ enable()

static void PrintJobRecovery::enable ( const bool  onoff)
static
Here is the caller graph for this function:

◆ changed()

static void PrintJobRecovery::changed ( )
static

◆ check()

static void PrintJobRecovery::check ( )
static
Here is the caller graph for this function:

◆ resume()

static void PrintJobRecovery::resume ( )
static

◆ exists()

static bool PrintJobRecovery::exists ( )
static
145 { return card.jobRecoverFileExists(); }

◆ open()

static void PrintJobRecovery::open ( const bool  read)
static
146 { card.openJobRecoveryFile(read); }
Here is the call graph for this function:

◆ close()

static void PrintJobRecovery::close ( )
static
147 { file.close(); }
Here is the call graph for this function:

◆ purge()

static void PrintJobRecovery::purge ( )
static

◆ load()

static void PrintJobRecovery::load ( )
static

◆ save()

static void PrintJobRecovery::save ( const bool  force = false,
const bool  save_queue = true 
)
static
Here is the caller graph for this function:

◆ valid()

static bool PrintJobRecovery::valid ( )
static
167 { return info.valid_head && info.valid_head == info.valid_foot; }

◆ debug()

static void PrintJobRecovery::debug ( PGM_P const  )
static
172 {}

Member Data Documentation

◆ filename

const char PrintJobRecovery::filename[5]
static

◆ file

SdFile PrintJobRecovery::file
static

◆ info

job_recovery_info_t PrintJobRecovery::info
static

◆ queue_index_r

uint8_t PrintJobRecovery::queue_index_r
static

Queue index of the active command.

◆ cmd_sdpos

uint32_t PrintJobRecovery::cmd_sdpos
static

SD position of the next command.

◆ sdpos

uint32_t PrintJobRecovery::sdpos[BUFSIZE]
static

SD positions of queued commands.

◆ enabled

bool PrintJobRecovery::enabled
static
SET_INPUT_PULLDOWN
#define SET_INPUT_PULLDOWN(IO)
set pin as input with pulldown wrapper
Definition: fastio.h:95
PrintJobRecovery::info
static job_recovery_info_t info
Definition: power_loss_recovery.h:111
PrintJobRecovery::cmd_sdpos
static uint32_t cmd_sdpos
SD position of the next command.
Definition: power_loss_recovery.h:114
PrintJobRecovery::sdpos
static uint32_t sdpos[BUFSIZE]
SD positions of queued commands.
Definition: power_loss_recovery.h:114
SdBaseFile::close
bool close()
Definition: Marlin_CardReader.cpp:535
PrintJobRecovery::file
static SdFile file
Definition: power_loss_recovery.h:110
PrintJobRecovery::queue_index_r
static uint8_t queue_index_r
Queue index of the active command.
Definition: power_loss_recovery.h:113
SET_INPUT_PULLUP
#define SET_INPUT_PULLUP(IO)
Definition: fastio.h:100
SET_INPUT
#define SET_INPUT(IO)
Definition: fastio.h:99
POWER_LOSS_PIN
#define POWER_LOSS_PIN
Definition: pins_GT2560_V3.h:89
job_recovery_info_t::valid_head
uint8_t valid_head
Definition: power_loss_recovery.h:44
read
static int read(struct _reent *_r, void *pv, char *pc, int n)
Definition: gcode_file.cpp:9
job_recovery_info_t::valid_foot
uint8_t valid_foot
Definition: power_loss_recovery.h:102