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

Implement feature flags for conditional compilation #113

Merged
merged 8 commits into from
Jun 1, 2024

Conversation

taesungh
Copy link
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
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
Member

@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
2 checks passed
@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