-
Notifications
You must be signed in to change notification settings - Fork 9
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
chore: add FlashOnStBootloaderCommunicator #257
base: main
Are you sure you want to change the base?
Conversation
🦙 MegaLinter status:
|
Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
---|---|---|---|---|---|
✅ ACTION | actionlint | 5 | 0 | 0.02s | |
✅ CPP | clang-format | 14 | 3 | 0 | 0.11s |
✅ DOCKERFILE | hadolint | 1 | 0 | 0.08s | |
✅ JSON | jsonlint | 7 | 0 | 0.12s | |
✅ JSON | prettier | 7 | 2 | 0 | 0.72s |
markdownlint | 6 | 1 | 7 | 1.15s | |
markdown-link-check | 6 | 2 | 58.62s | ||
✅ MARKDOWN | markdown-table-formatter | 6 | 1 | 0 | 0.22s |
✅ REPOSITORY | checkov | yes | no | 28.36s | |
✅ REPOSITORY | git_diff | yes | no | 0.02s | |
✅ REPOSITORY | grype | yes | no | 22.64s | |
✅ REPOSITORY | ls-lint | yes | no | 0.06s | |
✅ REPOSITORY | secretlint | yes | no | 56.07s | |
✅ REPOSITORY | trivy | yes | no | 6.88s | |
✅ REPOSITORY | trivy-sbom | yes | no | 0.7s | |
✅ REPOSITORY | trufflehog | yes | no | 12.31s | |
lychee | 31 | 2 | 69.79s | ||
✅ YAML | prettier | 8 | 1 | 0 | 0.75s |
✅ YAML | v8r | 8 | 0 | 6.69s | |
✅ YAML | yamllint | 8 | 0 | 0.23s |
See detailed report in MegaLinter reports
this->onDone = onDone; | ||
this->beginIndex = beginIndex; | ||
this->endIndex = endIndex; | ||
this->page[1] = static_cast<uint8_t>(beginIndex); |
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.
This suggests that 2 pages are being erased. It turns out the interface is misleading: It should accept a MemoryRange<unt16_t> instead, and then do its little/big endian transformation itself.
@@ -105,7 +106,8 @@ namespace services | |||
|
|||
void StBootloaderCommunicatorUart::ReadMemory(uint32_t address, infra::ByteRange& data, const infra::Function<void()>& onDone) | |||
{ | |||
really_assert(data.size() <= 255); | |||
really_assert(data.size() <= 256); | |||
really_assert(data.size() > 1); |
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.
I think we also should support reading 1 byte, although that may need implementation with a kind of workaround. Otherwise some poor fellow a few years from now will be searching really hard why his application crashes at inconvenient moments
@@ -136,7 +138,8 @@ namespace services | |||
|
|||
void StBootloaderCommunicatorUart::WriteMemory(uint32_t address, infra::ConstByteRange data, const infra::Function<void()>& onDone) | |||
{ | |||
really_assert(data.size() <= 255); | |||
really_assert(data.size() <= 256); | |||
really_assert(data.size() % 4 == 0); |
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.
These kind of conditions need to be documented at the interface, otherwise they're Liskov substitution failures
…t_bootloader_communicator
Co-authored-by: Richard Peters <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
No description provided.