Skip to content

Sensor: Refactor sensor.c #100

Description

@ETSells

**Requester: @Aaryan-Anand **

(Non-developer requests only): Is your feature request related to a problem? Please describe.
Sensor is, quite frankly, a nightmare. We have code from like 6 different hardware platforms that we're trying to support in this one file via common APIs and I don't think that's the move anymore.

Describe the solution you'd like
I want to remove the following entirely:

  • Code in Liquid Engine Controller Rev 4 pound defines
  • Code in FC Lite pound defines
  • Code in FC Rev 1 pound defines (if any)
  • Code in VC Rev 2 pound defines (if any)

The remaining code should be exclusively Flight Computer and Engine Controller related.

We can then split the file into multiple components. Consider:

  • sensor.c housing common/shared code like the sensor terminal command handler (sensor_cmd_execute), sensor dump, and sensor poll
  • sensor_flight.c housing flight computer specific sensor functions (FC-specific statics can get moved here and defined in either a new header or conditional define blocks in sensor.h).

The above is only a guideline, and you don't have to follow it.

When working this ticket, please keep the following priorities in mind:

  1. We only want to separate, not duplicate. Maintenance of duplicate code sucks (ask me and Nick last year)
  2. As a refactor, we should have no new functional changes as part of this ticket. We'll want to test on flight, engine, and valve due to the fact that this module is critical to all platforms. If you have additional functional changes, please do so in a separate commit and provide the hash of the refactor so we can test and review the additional change separately.

Describe alternatives you've considered
N/A

Additional context
Pinging @niekky for awareness due to common library changes. Nick will likely need to be tagged on the PR when it's ready so he can verify liquids compatibility. If you have any concerns, please let me know before we hit sprint planning tomorrow.

I was going to do this myself after the upcoming release, but it's a request of Aaryan that he kinda just wants to do this weekend.

Points of Contact
Liquids maintainter: @niekky
Sensor SME: @ETSells

Metadata

Metadata

Labels

documentationImprovements or additions to documentationrefactor
No fields configured for Feature.

Projects

Status
Ready
Status
No status
Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions