Skip to content

Init does not return error code #8

@csBlueChip

Description

@csBlueChip

MassStorage::Init() does not return its errorcode - so the sketch cannot detect a failure and act accordingly

eg.

int sderr = SD.Init();
if (sderr == SD_MMC_OK) {
  logToFile();
} else {
  serial.print("SD error ");
  serial.printf(stderr, DEC);
  logToSerial();
}

but the change is not obvious because this function

  • initialises the media controller
  • mounts the media device
  • mounts the filesystem
    each of which can produce an error :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions