Skip to content

Commit

Permalink
chore(*): use latest atat, with new urc channel & replace fugit with …
Browse files Browse the repository at this point in the history
…embassy-time (#83)

* - Update ATAT, and implement the new URC subscriber channels
- Remove `fugit` and replace it with `embassy-time`
- Update `ublox-sockets`, facilitating both of above changes
- Remove unimplemented sms, voice and location service skeletons
- Remove pin generics in favor of a single `CellularConfig` trait with associated types

* Make flowcontrol a bool in config trait, and export config trait

* Use latest atat git rev

* Fix sometimes stuck in infinite loop at AT probing on initialization

* Update CI to use nightly and remove unused workflows
  • Loading branch information
MathiasKoch committed Sep 12, 2023
1 parent 0fe4634 commit 15efe78
Show file tree
Hide file tree
Showing 31 changed files with 382 additions and 1,117 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/audit.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on:
push:
branches:
- master
pull_request:

name: CI

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: dsherret/rust-toolchain-file@v1
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all --features "defmt-impl,lara-r6" --target thumbv7em-none-eabihf

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --lib --features "log,lara-r6"
env:
DEFMT_LOG: off

rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: dsherret/rust-toolchain-file@v1
- name: Rustfmt
run: cargo fmt -- --check

clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: dsherret/rust-toolchain-file@v1
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features "lara-r6" -- ${{ env.CLIPPY_PARAMS }}
47 changes: 0 additions & 47 deletions .github/workflows/docs.yml

This file was deleted.

85 changes: 0 additions & 85 deletions .github/workflows/lint.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ members = [
]

[patch.crates-io]
atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "70283be" }
atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "c5caaf7" }
# ublox-sockets = { path = "../ublox-sockets" }
7 changes: 7 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[toolchain]
channel = "nightly-2023-06-28"
components = [ "rust-src", "rustfmt", "llvm-tools-preview", "clippy" ]
targets = [
"x86_64-unknown-linux-gnu",
"thumbv7em-none-eabihf"
]
11 changes: 6 additions & 5 deletions ublox-cellular/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ doctest = false

[dependencies]
# atat = { version = "0.18", features = ["derive", "bytes"] }
atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "70283be", features = ["derive", "defmt", "bytes"] }
atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "c5caaf7", features = ["derive", "defmt", "bytes"] }
embedded-hal = "=1.0.0-rc.1"
embedded-nal = "0.6"
fugit = { version = "0.3" }
fugit-timer = { version = "0.1.3" }
hash32 = "^0.2.1"
hash32-derive = "^0.1.0"
heapless = { version = "^0.7", features = ["serde"] }
nb = "^1"
serde = { version = "^1", default-features = false, features = ["derive"] }
ublox-sockets = "0.5.0"
# ublox-sockets = "0.5.0"
ublox-sockets = { git = "https://github.com/BlackbirdHQ/ublox-sockets", rev = "b1ff942" }
embassy-time = "0.1"
embedded-io = "0.5"

# Enable `serde` feature of `no-std-net`
no-std-net = { version = "^0.5", features = ["serde"] }
Expand All @@ -40,7 +41,7 @@ default = ["socket-udp", "socket-tcp"]
async = ["atat/async"]

# Use `defmt-impl to enable defmt based logging
defmt-impl = ["defmt", "ublox-sockets/defmt", "fugit/defmt", "atat/defmt", "heapless/defmt-impl"]
defmt-impl = ["defmt", "ublox-sockets/defmt", "atat/defmt", "heapless/defmt-impl"]
# Use `log-impl` to enable log based logging
log-impl = ["log", "ublox-sockets/log", "atat/log"]

Expand Down
21 changes: 21 additions & 0 deletions ublox-cellular/src/blocking_timer.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use embassy_time::{Duration, Instant};

pub struct BlockingTimer {
expires_at: Instant,
}

impl BlockingTimer {
pub fn after(duration: Duration) -> Self {
Self {
expires_at: Instant::now() + duration,
}
}

pub fn wait(self) {
loop {
if self.expires_at <= Instant::now() {
break;
}
}
}
}
Loading

0 comments on commit 15efe78

Please sign in to comment.