Skip to content
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

Hotfix for UART-16550 driver and Arty-Managed example design. #12

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

ooterness
Copy link
Member

Hotfix for UART-16550 driver and Arty-Managed example design.

Description

  • Added read/write functions for s8, s16, s32, and s64.
  • Hotfix for UART-16550 driver and Arty-Managed example design.

Motivation and Context

This hotfix corrects a major bug in the Arty-Managed example design that was discovered just after the v2.0.0 release.
It also incorporates some incidental improvements, including additional data-types for the Readable and Writeable API.

How Has This Been Tested?

Jenkins build passes all unit tests. Arty-Managed bitfile has been loaded on hardware and tested manually.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document and signed a CLA, if applicable.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

* Hotfix for UART-16550 driver and Arty-Managed example design.
@ooterness ooterness changed the title * Added read/write functions for s8, s16, s32, and s64. Hotfix for UART-16550 driver and Arty-Managed example design. Oct 21, 2021
@ooterness ooterness requested a review from Teque5 October 22, 2021 17:14
@@ -193,5 +194,18 @@ namespace satcat5 {
enum {SATCAT5_LITTLE_ENDIAN = 0x03020100ul, SATCAT5_BIG_ENDIAN = 0x00010203ul};
constexpr union {u8 bytes[4]; u32 value;} HOST_ORDER_CANARY = {{0,1,2,3}};
inline u32 HOST_BYTE_ORDER() {return HOST_ORDER_CANARY.value;}

// In-place byte-for-byte format conversion, aka "type-punning".
template<typename T1, typename T2> inline T2 reinterpret(T1 x)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not seen this before, but the reasoning for it (instead of using a traditional cast) checks out.

Copy link

@markubiak markubiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@ooterness ooterness merged commit ae783f1 into main Oct 22, 2021
@ooterness ooterness deleted the hotfix/uart-driver branch October 22, 2021 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants