Skip to content

domneedham/pico-clock-green-rs

Repository files navigation

Pico Clock Green

Rust port of the C code for the Waveshare Pico Clock Green product.

See the usage guide for clock operation.

Table of Contents

  1. Development requirements
  2. Installation of development dependencies
  3. Running
  4. Roadmap
  5. Contributing
  6. License

Development Requirements

  • 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

Installation of development dependencies

rustup install nightly
rustup +nightly target add thumbv6m-none-eabi
cargo +nightly install flip-link
cargo +nightly install probe-run --locked

Running

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:

Linux/MacOS/unix

export DEFMT_LOG=trace

Setting the DEFMT_LOG level for the current session
for bash

export DEFMT_LOG=trace

Windows

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

Roadmap

NOTE: This software is under active development. As such, it is likely to remain volatile until a 1.0.0 release.

Contributing

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:

  1. Fork the Project by clicking the 'Fork' button at the top of the page.
  2. Create your Feature Branch (git checkout -b features/AmazingFeature)
  3. Make some changes to the code or documentation.
  4. Commit your Changes (git commit -m 'Add some AmazingFeature')
  5. Push to the Feature Branch (git push origin features/AmazingFeature)
  6. Create a new pull request
  7. An admin will review the Pull Request and discuss any changes that may be required.
  8. 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.

Code of Conduct

See the code of conduct.

License

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.