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

Address initial comments on updates to firmware #19

Open
wants to merge 1 commit into
base: acqboard-v3-support
Choose a base branch
from

Conversation

bparks13
Copy link
Member

  • Find device address for methods based on the given port number
  • Reorder parameters to be consistent with oni_* calls
  • Before reading device IDs from an EEPROM, confirm that the first four bytes contain the characters "OESH"
  • Make readBytes() more flexible, and create readEepromBytes() specifically for EEPROM byte reads
  • Corrected logic for devices with a BNO but no EEPROM

- Reorder parameters to be consistent with oni_* calls
- Before reading device IDs from an EEPROM, confirm that the first four bytes contain the characters "OESH"
- Make readBytes() more flexible, and create readEepromBytes() specifically for EEPROM byte reads
- Corrected logic for devices with a BNO but no EEPROM
@bparks13 bparks13 requested a review from aacuevas February 21, 2025 17:14
@bparks13 bparks13 self-assigned this Feb 21, 2025
Copy link
Collaborator

@aacuevas aacuevas left a comment

Choose a reason for hiding this comment

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

I made a couple of suggestions. Nothing code-breaking, so it could be merged as is, but look into addressing those if possible.

{
evalBoard->setBnoAxisMap (i, 0b00100100);
}
else if (hasI2c[i])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we are using this check to set BNO axis maps, I'd use hasBNO instead of hasI2C here.

@@ -1204,43 +1206,80 @@ bool Rhd2000ONIBoard::isI2cCapable(oni_dev_idx_t device)
return val > 0;
}

int Rhd2000ONIBoard::readByte(uint32_t address, oni_reg_addr_t i2cRawAddress, oni_reg_val_t* value, bool sixteenBitAddress)
int Rhd2000ONIBoard::readByte (oni_dev_idx_t device, uint32_t address, oni_reg_val_t* value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not what I meant. This is basically just a wrapper over oni_read_reg at this point with nothing added to it.
What I meant is int Rhd2000ONIBoard::readI2CByte(oni_dev_idx_t device, uint32_t i2cDevAddress, oni_reg_addr_t i2cRegAddress, oni_reg_val_t* value, bool sixteenBitAddress)
Just not have the eeprom harcoded here as it was before, but make this a general function to read bytes over i2c

then on readEepromByte you call this method with i2cDevAddress = 0x50 and sixteenBitAddress = true

oni_dev_idx_t i2cRawAddress = DEVICE_I2C_RAW_A + port * 2;

// NB: Confirm EEPROM first four bytes contains OESH
const char identifier[] = "OESH";
Copy link
Collaborator

Choose a reason for hiding this comment

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

just to be sure, make it "OESH\x01" to include the spec version, in case we change it later, so even an outdated plugin would not break.

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