Skip to content

Implement feature flags for conditional compilation#113

Merged
taesungh merged 8 commits intomainfrom
feature/conditional-compilation
Jun 1, 2024
Merged

Implement feature flags for conditional compilation#113
taesungh merged 8 commits intomainfrom
feature/conditional-compilation

Conversation

@taesungh
Copy link
Copy Markdown
Member

@taesungh taesungh commented Jun 1, 2024

The pod program cannot be run properly unless on an actual Raspberry Pi. To simplify testing of state transitions and sending data to the control station as well as testing individual components even on the Pi, we can use feature flags to conditionally enable different component features to use. Each sensor type has a feature and the rpi feature will enable all of them.

Resolves #40.

Changes

  • Implemented mocking for GPIO operation
  • Mock measurement values for components using other I2C-based sensors as well as inverter board using serial
    • Include reasonable placeholder values for sensor measurements
  • Add brpi alias to do a release build with the aarch64 architecture for the Raspberry Pi
  • Update checks workflow and pre-commit script to lint both with and without the rpi feature

taesungh added 7 commits May 31, 2024 20:45
- Create new `rpi` feature which includes `rppal` as a dependency which
  is otherwise optional
- Create mocks for `InputPin` and `OutputPin`
- Mock measurements from ADS1015, INA219, and mpu6050
@taesungh taesungh requested a review from a team June 1, 2024 05:37
@taesungh taesungh force-pushed the feature/conditional-compilation branch 4 times, most recently from c82a42d to 06f9246 Compare June 1, 2024 06:20
- Update checks workflow and precommit hooks
- Resolve clippy lint issues
- Create mod for GPIO mocks
@taesungh taesungh force-pushed the feature/conditional-compilation branch from 06f9246 to 5afbf4a Compare June 1, 2024 06:27
Copy link
Copy Markdown
Contributor

@samderanova samderanova left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. It'll definitely make the testing process a lot easier.

Copy link
Copy Markdown
Contributor

@ryescholin ryescholin left a comment

Choose a reason for hiding this comment

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

!!

@taesungh taesungh merged commit 72ad551 into main Jun 1, 2024
@taesungh taesungh deleted the feature/conditional-compilation branch June 1, 2024 12:28
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.

Pod program cannot be run without cross-compilation

3 participants