Small correction and fixes - #64
Open
Ntemis wants to merge 2 commits into
Open
Conversation
Added a default: case that returns ERR_UNKNOWN_COMMAND instead of silently dropping unrecognized opcodes (previously the host could hang forever waiting for a reply that would never come). WRITE_FLASH, EMMC_WRITE, ISD1200_WRITE_FLASH now send ERR_SHORT_READ on a truncated payload instead of a bare return; that left the host blocked. New finding I hadn't caught in the first pass: EMMC_WRITE's 0x200-byte payload was never accounted for in the needed_data pre-check (only WRITE_FLASH and ISD1200_WRITE_FLASH were), so the dispatcher could fire before the eMMC write payload had actually arrived. Fixed. READ_FLASH/WRITE_FLASH now refuse to touch the NAND if flash_config reads back as 0 (undetected/uninitialized state) rather than issuing SPI transactions blind — see the comment in the file for exactly why I stopped short of a full capacity bounds-check (I don't have enough of the flash_config bit layout to derive total NAND size safely, and guessing at that number for a flasher is exactly the kind of "fix" that causes real damage). Fixed the available_data typo and the unchecked tud_cdc_peek() return.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.