ebelski / rust-copter

A quadcopter build using a Teensy running Rust and some other cool stuff that's yet to be determined.
MIT License
6 stars 1 forks source link

Upgrade code to new interfaces; add CI definition #10

Closed mciantyre closed 4 years ago

mciantyre commented 4 years ago

The PR addresses some housekeeping items, and adds automated builds and code checks.

We update the demos to use the latest PWM interfaces from the hardware abstraction layer. Now that I'm using the PWM interfaces outside of a simple demo, I realize the interface is limited. The esc-imxrt1062 crate discusses some of the blockers. We should circle-back to that at a later time. It makes it harder to change our four motor pins.

We add some libraries under libs/:

I used these two libraries to update the pwm-control demo.

We use a workspace to share dependencies across all libraries and demos. This should help reduce build times.

Finally, we add a continuous intergration (CI) job. It builds and lints all of the code in the repo (cargo clippy), and it ensures all the code is formatted (cargo fmt).

Other small changes:

Testing

See 3f3945b's commit message. I re-ran the tests from #6. Looks OK.

Notes

The PWM output identifiers in pwm-control (introduced in #3) are now

PWM Output Teensy 4 Pin PWM instance
AC 6 PWM2_2_A
B 7 PWM1_3_B
CA 8 PWM1_3_A
D 9 PWM2_2_B

It makes more sense if you sort by the PWM instance column, rather than the PWM output column.

mciantyre commented 4 years ago

Job failed as expected!

mciantyre commented 4 years ago

Hold on, the workspace broke the hardware-test scripts...

ebelski commented 4 years ago

Ok, let me know when you want me to test this.

mciantyre commented 4 years ago

Would you mind if we moved to a Python script, instead of separate shell and batch scripts, for simplifying building and flashing? The latest commit adds a Python script to the top of the repository. Use the "demo" task to build a demo:

python task.py demo pwm-control

It requires at least Python 3.6.

ebelski commented 4 years ago

bruhhhhhh...I'm always game for Python