Skip to content

Commit

Permalink
Fix nrf monotonics (#852)
Browse files Browse the repository at this point in the history
* Fix nrf::timer

* Bootstrap nrf52840-blinky example

* More work on nrf blinky example

* Fix README

* Add asserts for correct timer functionality

* Add correctness check to other monotonics as well

* Update Changelog

* Fix potential timing issues

* Fix race condition in nrf::rtc

* Add changelog

* Add rtc blinky example

* Change rtc example to RC lf clock source

* Add changelog to rtic-time

* Add changelog

* Attempt to fix CI

* Update teensy4-blinky Cargo.lock
  • Loading branch information
Finomnis authored Dec 6, 2023
1 parent 1622f6b commit 89160b7
Show file tree
Hide file tree
Showing 18 changed files with 1,082 additions and 103 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install rust ${{ matrix.toolchain }}
run: |
rustup set profile minimal
Expand All @@ -164,6 +164,9 @@ jobs:
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2

- name: Install flip-link
run: cargo install flip-link

- name: Check the examples
run: cargo xtask usage-example-build

Expand Down Expand Up @@ -275,22 +278,22 @@ jobs:
cp -r target/doc $td/api
echo rtic
lychee --offline --format detailed $td/api/rtic/
echo rtic_common
lychee --offline --format detailed $td/api/rtic_common/
echo rtic_macros
lychee --offline --format detailed $td/api/rtic_macros/
echo rtic_monotonics
lychee --offline --format detailed $td/api/rtic_monotonics/
echo rtic_sync
lychee --offline --format detailed $td/api/rtic_sync/
echo rtic_time
lychee --offline --format detailed $td/api/rtic_time/
- name: Archive the API docs
run: |
Expand Down Expand Up @@ -336,7 +339,7 @@ jobs:
name: apidocs

- name: Extract the API docs
run: tar -xf apidocs.tar
run: tar -xf apidocs.tar

- name: Check links
run: |
Expand Down Expand Up @@ -463,7 +466,7 @@ jobs:
# master branch.
# As master moves on to development, the work on the
# stable version will happen in release/v"stable_version".
# Thus, no need to push changes
# Thus, no need to push changes
#
# This needs to run before book is built, as bookbuilding fetches from the branch
pushtostablebranch:
Expand Down Expand Up @@ -503,8 +506,8 @@ jobs:
runs-on: ubuntu-22.04
needs:
- pushtostablebranch
- docs
- mdbookold
- docs
- mdbookold
- mdbook

# Only run this when pushing to master branch
Expand All @@ -521,7 +524,7 @@ jobs:
uses: taiki-e/install-action@v2
with:
tool: mdbook-mermaid

- name: mdBook Action
uses: peaceiris/actions-mdbook@v1
with:
Expand All @@ -537,7 +540,7 @@ jobs:

- name: Extract the dev-version book and API docs
run: |
tar -xf book.tar
tar -xf book.tar
- name: Download built old versions of books and API docs
uses: actions/download-artifact@v3
Expand All @@ -546,7 +549,7 @@ jobs:

- name: Extract the old version books and API docs
run: |
tar -xf mdbookold.tar
tar -xf mdbookold.tar
- name: Prepare books
shell: 'script --return --quiet --command "bash {0}"'
Expand Down Expand Up @@ -631,7 +634,7 @@ jobs:

- name: Extract the books
run: |
tar -xf bookstodeploy.tar
tar -xf bookstodeploy.tar
- name: Deploy to GH-pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
18 changes: 18 additions & 0 deletions examples/nrf52840_blinky/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-rs run --chip nRF52840_xxAA"

rustflags = [
"-C", "linker=flip-link",
"-C", "link-arg=-Tlink.x",
"-C", "link-arg=-Tdefmt.x",
# This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x
# See https://github.com/rust-embedded/cortex-m-quickstart/pull/95
"-C", "link-arg=--nmagic",
]

[build]
target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)

[alias]
rb = "run --bin"
rrb = "run --release --bin"
1 change: 1 addition & 0 deletions examples/nrf52840_blinky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
9 changes: 9 additions & 0 deletions examples/nrf52840_blinky/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
// override the default setting (`cargo check --all-targets`) which produces the following error
// "can't find crate for `test`" when the default compilation target is a no_std target
// with these changes RA will call `cargo check --bins` on save
"rust-analyzer.checkOnSave.allTargets": false,
"rust-analyzer.checkOnSave.extraArgs": [
"--bins"
]
}
Loading

0 comments on commit 89160b7

Please sign in to comment.