8#if (defined ESP32 || defined ROO_TESTING)
19#if (defined ESP32 || defined ROO_TESTING)
28MountImpl::MountResult ArduinoSdFs::mountImpl(
29 std::function<
void()> unmount_fn) {
30 if (!sd_.begin(cs_pin_, *spi_, frequency(), mountPoint(), maxOpenFiles(),
31 formatIfMountFailed())) {
32 return MountImpl::MountError(kGenericMountError);
34 return MountImpl::Mounted(std::unique_ptr<MountImpl>(
35 new PosixMountImpl(mountPoint(), readOnly(), unmount_fn)));
38Filesystem::MediaPresence ArduinoSdFs::checkMediaPresence() {
39 return sd_.totalBytes() > 0 ? kMediaPresent : kMediaAbsent;
44ArduinoSdFs::ArduinoSdFs(uint8_t cs_pin)
46#if defined(ARDUINO_ARCH_RP2040)
53MountImpl::MountResult ArduinoSdFs::mountImpl(
54 std::function<
void()> unmount_fn) {
55 if (!sd_.begin(cs_pin_)) {
56 return MountImpl::MountError(kGenericMountError);
58 return MountImpl::Mounted(std::unique_ptr<MountImpl>(
59#
if defined(ARDUINO_ARCH_RP2040)
60 new ArduinoMountImpl(sdfs_, read_only_, unmount_fn)));
62 new ArduinoMountImpl(sd_, read_only_, unmount_fn)));
66Filesystem::MediaPresence ArduinoSdFs::checkMediaPresence() {
67 return kMediaPresenceUnknown;
72void ArduinoSdFs::unmountImpl() { sd_.end(); }
74ArduinoSdFs CreateArduinoSdFs() {
return ArduinoSdFs(); }
76ArduinoSdFs SD = CreateArduinoSdFs();
roo::basic_string_view< CharT, Traits > basic_string_view