lowRISC / lowRISC/opentitan

[I2C] Code clean up for i2c_host_tx_rx_test.c

Open
#17,172 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component:ChipLevelTest Earlgrey-PROD Candidate IP:i2c Priority:P4 Type:Cleanup
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

Description

Per discussion in #16972 the code for the i2c host test can be improved by:

  • Utilizing function i2c_testutils_connect_i2c_to_pinmux_pins
  • Using anonymous enum instead of a magic number
  • Using an array of structs to simplify switch statements

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with i2c_host_tx_rx_test.c and review the discussion in issue #16972, then inspect how i2c_testutils_connect_i2c_to_pinmux_pins is used elsewhere. The cleanup is complete when the test uses that helper, replaces the magic number with an anonymous enum, and uses an array of structs instead of the switch statements.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, testing-qa
Issue type
Refactor
Difficulty
2/5
Estimated time
Half a day
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.