Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage: Consider removing IsMediaPresent() #1428

Open
kammce opened this issue Jan 20, 2021 · 0 comments
Open

Storage: Consider removing IsMediaPresent() #1428

kammce opened this issue Jan 20, 2021 · 0 comments
Labels
L1 Peripheral Driver Layer

Comments

@kammce
Copy link
Member

kammce commented Jan 20, 2021

Feature Request

Remove IsMediaPresent() from the sjsu::Storage interface and have an exception be thrown if the media is not present when Initialize() is called.

Detailed Description

When should IsMediaPresent() be called? Normally it should be called after Initialize(), but without some sort of Enable() or Mount() methods, shouldn't Initialize() handle the duty of setting up peripherals AND mounting the media? At that point, if the media is mounted then checking an additional method is pointless. Initialize could omit the mounting step, then add a Mount() API to storage which would allow a point in time when IsMediaPresent() can be called. But this requires an additional entry on the storage interface's vtable and make the call structure more complicated. Simply making Initialize the only method needed to get storage working and having it throw an exception if it fails seems like the right approach.

The only concern is FAT FS and how there will need to be some work around for checking if media is present.

@kammce kammce added the L1 Peripheral Driver Layer label Jan 20, 2021
@kammce kammce self-assigned this Jan 20, 2021
@kammce kammce removed their assignment Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Peripheral Driver Layer
Projects
None yet
Development

No branches or pull requests

1 participant