-
Notifications
You must be signed in to change notification settings - Fork 6
Embassy ERS #18
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
Open
wjeffreys96
wants to merge
62
commits into
master
Choose a base branch
from
ers-embassy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Embassy ERS #18
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create feature flags to manage can ids between images
Ers embassy motorfix
This wrapper around the motor pins and the dac allows for much simpler and less verbose interaction with the peripherals related to the motors. Instead of having to lock each peripheral's mutex and pass each pin into functions that require the motor interface, we can now simply lock and use the Motor struct. Additionally, to change the mode of the motor, simply pass in a MotorMode enum variant for whichever mode you'd like to set it to.
not handling the error thrown when with_timeout times out was causing the panic. To avoid these panics in the future, whenever something can throw an error, be sure to handle it in some way.
Watch is more suitable for this application as it discards the previous value when it is no longer useful data whereas Channel will wait until a value was received before updating it, leading to stale data.
This is a comprehensive overhaul of the project structure that aims to
improve ergonomics as it pertains to the motor and the sensors.
key changes:
- moved everything in the shared dir to the project src dir
- moved all motor logic into motor.rs.
- motor functions are now impls
- created the ring struct in ring.rs
- sensor functions are now ring impls
- created ring and motor mutex's
- updated "u" and "l" commands to accept pulse and force flags
as well as to utilize the motor struct.
- updated CAN reader to utilize the motor struct.
This use case fits watch much better than channel. See embassy_sync docs for more info as to why.
sender will spam unlock message until it receives an acknowledgement. This will have main/drogue send those messages when it receives the fire can message.
add the same command that's on the sender board to the parachute boards. sending "batt" over picocom will print the last read of the battery voltage from the adc.
flashing blinky with "--features=main" will now flash blinky onto an actual ers board. Before it would only work on a nucleo
This also renames some things to have their intended purpose be clearer. Namely,the can ids and the names of the frames
When the command "beep" is received over uart, access the buzzer's mode and update it accordingly. If it's off turn it to low. If it's anything else, turn it off.
When the motor is driven the adc will read motor_isense and defmt will print the readings as a csv at a debug level log.
There were many instances where there were arguments being unecessarily passed into tasks or struct constructors that could just be imported and used inside the module where the task or struct is defined. Removing these unneeded arguments reduces the amount of "spaghetti code" in the codebase and makes it much easier to read.
The conditional compilation scope should be around this entire arm of the match statement, otherwise the main board will send out the drogue acknowledgement message
It's not the telemetrum that sends the heartbeat its the sender board
README explains the shared modules found in src dir Fix typo
pytest looks for files named test_*.py, so this would conflict with it's usage. Also, this is just a clearer name for the purpose of the script
These two tests should send messages to the drogue and main boards and verify they respond with appropriate acknowledgement messages.
parachute motor constants moved to src/motor.rs
echo_can task to be used with echo_can.py, not test_can.py
If the motor runs for longer than expected the buffer holding the csv values can overflow. I added a check that makes sure that wont happen
Create a flash driver and mutex and use it to store the number of times the motor has been actuated. Create cli commands to print and erase this data.
Embedded test is probe-rs's testing suite for running tests on board. This commit adds the crate with some necessary configs in the Cargo.toml as well as creates a tests directory, blinky sample test, and adds the necessary linker args to the build.rs file.
Using try_get instead of changed when reading the ring position will allow the heartbeat and "pos" cli command to tell users that the ring is not yet intialized instead of blocking until it is initialized.
Instead of using feature flags, which aren't supposed to be mutually exclusive, use the BOARD environment variable to flash the parachute image to either the main or the drogue board. For the main board, set BOARD = "main", or for the drogue board set BOARD = "drogue"
e60c572 to
53015d6
Compare
Instead of hard coding the environment variable in .cargo/config.toml, you can now specify the BOARD environment variable through a commmand line override. This was previously not possible because setting it through the command line wouldnt trigger a rerun of the build. Adjusting the build.rs file fixed this issue. I also wrote cargo aliases to simplify the flash commands, and updated the READMEs.
53015d6 to
3921de8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds new Rust-based ERS firmware for our STM32F0919RCs in its entirety to the repository. The firmware is located at
./controlSystem/RecoveryBoard/firmware-rs. It also adds Rust build files and dirs to the.gitignore.