-
Notifications
You must be signed in to change notification settings - Fork 3k
impl get_target_default_instance for BlockDevice #13161
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
impl get_target_default_instance for BlockDevice #13161
Conversation
|
@paperchalice, thank you for your changes. |
0xc0170
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution !
Please fix astyle failures. As this is functionality addition, can you improve the commit messages - adding details about what is being added and why.
Do we still need system storage, can these be implemented in each block device and there will always be just one implementation? Same as its done now in the systemstorage using ifdef ?
This commit add get_target_default_instance for: DataFlashBlockDevice FlashIAPBlockDevice QSPIFBlockDevice SDBlockDevice SPIFBlockDevice and let get_default_instance in BlockDevice call target_default_instance, these function now just call the default constructor, therefore there is no functional change. Users can overwrite get_target_default_instance and let it return a subclass of these BlockDevice to use some 3rd party driver for these devices.
|
The event failures are related. Please review travis-ci/events |
|
@ARMmbed/mbed-os-storage would you be able to help reviewing? |
|
Let's see does this go in before the PR #13244. |
|
This does not match the pattern of NetworkInterface or console overrides, and the naming is in direct contradiction. I am aware the the block device imitation of those has always been wonky, but this still keeps it wonky.
If you're documenting this as an application override point, drop the "target_". Really you should have both. That avoids a link failure when trying to build an application that wants to override on a target that wants to override. I guess this sort of has both - it has an application override point for |
Summary of changes
Call
get_target_default_instanceinBlockDevice::get_default_instanceso that the behavior matches the document description.Provide static member function
get_target_default_instanceforDataFlashBlockDeviceFlashIAPBlockDeviceQSPIFBlockDeviceSDBlockDeviceSPIFBlockDevice.Impact of changes
Migration actions required
Documentation
An application can override target settings by implementing
XXXXBlockDevice::get_target_default_instance()- the default definition is weak.The implementation in
FlashIAPBlockDevicecan be improved... When C++20 enabled,the code can be:
Pull request type
Test results
Reviewers