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

Implement #311 - support RO SD images. #312

Merged
merged 3 commits into from
Jun 19, 2021
Merged

Conversation

vintagepc
Copy link
Owner

Description

Mount RO SD images appropriately and don't try to open/mmap them in write-mode.

Behaviour/ Breaking changes

N/A - adds functionality if SD file is RO, does not change existing behaviour with RW files.

Have you tested the changes?

Have not checked write commands to a locked SD card; MK3 firmware does not make any write attempts to the card IIRC.
Info message prints correctly if file is detected as RO.

Linked issues:

@wavexx
Copy link
Collaborator

wavexx commented Jun 19, 2021

MK3 firmware does not make any write attempts to the card IIRC.

I was thinking that too, then I realized you can upload a file to the sd card using M28 / M29 and some other PRUSA code we can ignore.

I have no idea though if the FW actually handles write faults ...

@vintagepc
Copy link
Owner Author

Well then... sounds like you might be the one to find out 🤣

@codecov
Copy link

codecov bot commented Jun 19, 2021

Codecov Report

Merging #312 (0746f16) into master (7b5d679) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #312      +/-   ##
==========================================
+ Coverage   89.02%   89.08%   +0.05%     
==========================================
  Files         140      140              
  Lines        6645     6659      +14     
==========================================
+ Hits         5916     5932      +16     
+ Misses        729      727       -2     
Impacted Files Coverage Δ
parts/components/SDCard.h 100.00% <ø> (ø)
parts/components/SDCard.cpp 93.59% <100.00%> (+0.28%) ⬆️
utility/FatImage.cpp 92.68% <0.00%> (+2.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b5d679...0746f16. Read the comment docs.

@vintagepc vintagepc merged commit b243dda into master Jun 19, 2021
@vintagepc vintagepc deleted the 311-sd-card-readonly branch June 19, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Allow mounting SD images in R/O mode
2 participants