[HAL][NOR] Fix support for 8-bit NOR that uses the AMD command set. C… #15
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.
…hanges should be backwards compatible.
In reference to this issue, #14
TThe previous version of the HAL_NOR did not accurately handle 16-bit and 8-bit NOR devices. There were many instances of typecasting to a 16-bit pointer which, when used with 8-bit addressing, results in Misalligned Memory Access faults.
Additionally, the
NOR_ADDR_SHIFT
already handles the address shifting; There does not need to be 2 different address values for 8-bit vs 16-bit.I also turned the
NOR_WRITE
into a wrapper for a function pointer; This ensures backwards compatibility, while ensuring the correctNOR_WRITE
is used in all circumstances.Do note: I was unable to find any Coding Standard for contributing, so i attempted to follow existing code.
Additionally, there are still potential issues in HAL_NOR that I could not adequately address without rewriting; HAL_NOR_ReadCFI, anything in the
NOR_INTEL_SHARP_EXT_COMMAND_SET
.Finally, I am not overly happy with exposing the
extern WriteNORFunc NORWriteFunction; /* Function Pointer to active NOR_Write*/
. I'd much rather have that function pointer be private to the HAL_NOR .c file. But to support backwards compatibility with projects that useNOR_WRITE
, it has to be exposed.IMPORTANT INFORMATION
Contributor License Agreement (CLA)