Skip to content

Commit

Permalink
A single instance can be static
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 4, 2021
1 parent 402f9a8 commit b7afdce
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,31 @@

class DiskIODriver_USBFlash : public DiskIODriver {
private:
uint32_t pos;
static uint32_t pos;

void usbStateDebug();
static void usbStateDebug();

public:
bool usbStartup();
static bool usbStartup();

bool init(const uint8_t sckRateID=0, const pin_t chipSelectPin=TERN(USE_OTG_USB_HOST, 0, SD_CHIP_SELECT_PIN));
static bool init(const uint8_t sckRateID=0, const pin_t chipSelectPin=TERN(USE_OTG_USB_HOST, 0, SD_CHIP_SELECT_PIN));

void idle();
static void idle();

inline bool readStart(const uint32_t block) { pos = block; return isReady(); }
inline bool readData(uint8_t *dst) { return readBlock(pos++, dst); }
static inline bool readStart(const uint32_t block) { pos = block; return isReady(); }
static inline bool readData(uint8_t *dst) { return readBlock(pos++, dst); }
//static inline bool readStop() { return true; }

inline bool writeStart(const uint32_t block, const uint32_t) { pos = block; return isReady(); }
inline bool writeData(const uint8_t *src) { return writeBlock(pos++, src); }
static inline bool writeStart(const uint32_t block, const uint32_t) { pos = block; return isReady(); }
static inline bool writeData(const uint8_t *src) { return writeBlock(pos++, src); }
//static inline bool writeStop() { return true; }

bool readBlock(uint32_t block, uint8_t *dst);
bool writeBlock(uint32_t blockNumber, const uint8_t *src);
static bool readBlock(uint32_t block, uint8_t *dst);
static bool writeBlock(uint32_t blockNumber, const uint8_t *src);

//static bool readCSD(csd_t*) { return true; }

uint32_t cardSize();
bool isInserted();
bool isReady();
static uint32_t cardSize();
static bool isInserted();
static bool isReady();
};

0 comments on commit b7afdce

Please sign in to comment.