Rust port of the C code for the Waveshare Pico Clock Green product.
See the usage guide for clock operation.
-
The standard Rust tooling (cargo, rustup) which you can install from https://rustup.rs/
-
Rust nightly
-
Toolchain support for the cortex-m0+ processors in the rp2040 (thumbv6m-none-eabi)
-
flip-link - this allows you to detect stack-overflows on the first core, which is the only supported target for now.
-
probe-run
-
A CMSIS-DAP probe. (J-Link and other probes will not work with probe-run)
You can use a second Pico as a CMSIS-DAP debug probe. Details on other supported debug probes can be found in debug_probes.md
rustup install nightly
rustup +nightly target add thumbv6m-none-eabi
cargo +nightly install flip-link
cargo +nightly install probe-run --locked
For a debug build
cargo run
For a release build
cargo run --release
If you do not specify a DEFMT_LOG level, it will be set to debug
.
That means println!("")
, info!("")
and debug!("")
statements will be printed.
If you wish to override this, you can change it in .cargo/config.toml
[env]
DEFMT_LOG = "off"
You can also set this inline (on Linux/MacOS)
DEFMT_LOG=trace cargo run
or set the environment variable so that it applies to every cargo run
call that follows:
export DEFMT_LOG=trace
Setting the DEFMT_LOG level for the current session
for bash
export DEFMT_LOG=trace
Windows users can only override DEFMT_LOG through config.toml
or by setting the environment variable as a separate step before calling cargo run
- cmd
set DEFMT_LOG=trace
- powershell
$Env:DEFMT_LOG = trace
cargo run
NOTE: This software is under active development. As such, it is likely to remain volatile until a 1.0.0 release.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
The steps are:
- Fork the Project by clicking the 'Fork' button at the top of the page.
- Create your Feature Branch (
git checkout -b features/AmazingFeature
) - Make some changes to the code or documentation.
- Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Feature Branch (
git push origin features/AmazingFeature
) - Create a new pull request
- An admin will review the Pull Request and discuss any changes that may be required.
- Once everyone is happy, the Pull Request can be merged by an admin, and your work is part of our project!
There are linting policies on the project. Please use
cargo clippy
before submitting a pull request and fix all warnings. The automated builds will fail if a warning is generated.
See the code of conduct.
The contents of this repository are dual-licensed under the MIT OR Apache
2.0 License. That means you can chose either the MIT licence or the
Apache-2.0 licence when you re-use this code. See MIT
or APACHE2.0
for more
information on each specific licence.
Any submissions to this project (e.g. as Pull Requests) must be made available under these terms.