apcountryman / picolibrary

A C++ microcontroller driver/utility library targeted for use with resource constrained microcontrollers.
https://apcountryman.github.io/picolibrary/
Apache License 2.0
2 stars 1 forks source link

Fix microcontroller register and reserved register packing #2500

Closed apcountryman closed 10 months ago

apcountryman commented 10 months ago

Resolves #2499 (Fix microcontroller register and reserved register packing).

This pull request:

Please mark the pull request as "Ready for review" and request a review when the pull request is ready for a review. If changes are requested, please discuss and/or address the review findings before requesting a new review.

@apcountryman

apcountryman commented 10 months ago

Using __attribute__( ( __packed__ ) ) is triggering a lizard CI error. Using #pragma pack( push, 1 ) and #pragma pack( pop ) around microcontroller peripheral definitions may be a better approach.

apcountryman commented 10 months ago

Using __attribute__( ( __packed__ ) ) is triggering a lizard CI error. Using #pragma pack( push, 1 ) and #pragma pack( pop ) around microcontroller peripheral definitions may be a better approach.

Using a macro to apply __attribute__( ( __packed__ ) ) is probably the best approach since it fixes the lizard CI issue and using a macro will allow for platform specific packing solutions to be injected in the future if needed.