Open FFBoard
Open source force feedback firmware
PersistentStorage Class Reference

#include <PersistentStorage.h>

Inheritance diagram for PersistentStorage:
AnalogSource Axis ButtonSource CANPort EffectsCalculator EncoderBissC EncoderLocal EncoderSSI FFBHIDMain I2CPort MotorPWM MtEncoderSPI ODriveCAN RmdMotorCAN TMC4671 VescCAN

Public Member Functions

 PersistentStorage ()
 
virtual ~PersistentStorage ()
 
virtual void saveFlash ()
 
virtual void restoreFlash ()
 
void restoreFlashDelayed ()
 

Static Public Member Functions

static std::vector< PersistentStorage * > & getFlashHandlers ()
 
static void restoreFlashStartupCb ()
 

Protected Attributes

bool restoreDelayedFlag = false
 

Static Protected Attributes

static bool startupComplete = false
 

Detailed Description

Definition at line 14 of file PersistentStorage.h.

Constructor & Destructor Documentation

◆ PersistentStorage()

PersistentStorage::PersistentStorage ( )

Definition at line 14 of file PersistentStorage.cpp.

◆ ~PersistentStorage()

PersistentStorage::~PersistentStorage ( )
virtual

Definition at line 18 of file PersistentStorage.cpp.

Member Function Documentation

◆ getFlashHandlers()

static std::vector< PersistentStorage * > & PersistentStorage::getFlashHandlers ( )
inlinestatic

Definition at line 25 of file PersistentStorage.h.

◆ restoreFlash()

void PersistentStorage::restoreFlash ( )
virtual

Should be implemented to restore settings. This is not automatically called and should be called when appropriate.

Reimplemented in CANPort_2B, EffectsCalculator, I2CPort, ADS111X_AnalogSource, CanAnalogBase, CanButtons, EncoderBissC, EncoderLocal, EncoderSSI, FFBHIDMain, LocalAnalog, LocalButtons, MotorPWM, PCF8574Buttons, SPI_Buttons, Axis, MtEncoderSPI, ODriveCAN, RmdMotorCAN, ShifterAnalog, TMC4671, and VescCAN.

Definition at line 33 of file PersistentStorage.cpp.

◆ restoreFlashDelayed()

void PersistentStorage::restoreFlashDelayed ( )

Should be used to restore settings after startup if class is created before startup finished. This is preferred to calling restoreFlash directly and calls restoreFlash after startup is finished This is not automatically called and should be called when appropriate. Normally this is done in the constructor of the class

Definition at line 43 of file PersistentStorage.cpp.

◆ restoreFlashStartupCb()

void PersistentStorage::restoreFlashStartupCb ( )
static

Called after storage has been initialized Will call restoreFlash on any storage handler that is currently waiting

Definition at line 55 of file PersistentStorage.cpp.

◆ saveFlash()

void PersistentStorage::saveFlash ( )
virtual

Called when the user uses the "save" command and presses the save button in the configurator Automatically called by the command parser thread for every class that inherits from PersistentStorage

Reimplemented in CANPort_2B, EffectsCalculator, I2CPort, ADS111X_AnalogSource, CanAnalogBase, CanButtons, EncoderBissC, EncoderLocal, EncoderSSI, FFBHIDMain, LocalAnalog, LocalButtons, MotorPWM, PCF8574Buttons, SPI_Buttons, Axis, MtEncoderSPI, ODriveCAN, RmdMotorCAN, ShifterAnalog, TMC4671, and VescCAN.

Definition at line 26 of file PersistentStorage.cpp.

Member Data Documentation

◆ restoreDelayedFlag

bool PersistentStorage::restoreDelayedFlag = false
protected

Definition at line 33 of file PersistentStorage.h.

◆ startupComplete

bool PersistentStorage::startupComplete = false
staticprotected

Definition at line 34 of file PersistentStorage.h.


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