-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
WriteCountCheck::OnceOnly is not handled directly, but only in the "catchall"
Lines 214 to 230 in b59a7e4
| *word_writable = match (*word_writable, self.write_count_check) { | |
| (v, WriteCountCheck::Disabled) => v, | |
| (Writable::T, _) => Writable::O, | |
| (Writable::O, WriteCountCheck::Twice) => Writable::N, | |
| (Writable::O, WriteCountCheck::TwiceDifferent) | |
| if source_word == &self.data[address..][..BYTES_PER_WORD] => | |
| { | |
| Writable::O | |
| } | |
| (Writable::O, WriteCountCheck::TwiceDifferent) => Writable::N, | |
| (Writable::O, WriteCountCheck::TwiceWithZero) | |
| if source_word.iter().all(|b| *b == 0) => | |
| { | |
| Writable::N | |
| } | |
| _ => return Err(MockFlashError::NotWritable(address as u32)), | |
| }; |
This seems not ideal:
When working with flash that uses ECC, writing twice is not desirable because it disables/breaks ECC.
It is (usually?) not invalid to do so, but a more precise error message like "writing more than once is invalid on this flash" might help with troubleshooting.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels