Commit Graph

4885 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
10d1ad2343 Replace futures::future::join -> embassy_futures::join::join. 2022-09-22 16:48:35 +02:00
Dario Nieuwenhuis
a0487380da Replace futures::future::poll_fn -> core::future::poll_fn. 2022-09-22 16:42:49 +02:00
bors[bot]
c1e25067da
Merge #962
962: Update Rust nightly. r=Dirbaio a=Dirbaio



Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-09-22 14:39:02 +00:00
Dario Nieuwenhuis
897b72c872 Update Rust nightly.
Removes feature(generic_associated_types)
2022-09-22 16:38:14 +02:00
Dario Nieuwenhuis
9db9333d05
Merge pull request #15 from danbev/ioctl-header-type
Introduce IoctlType enum for IOCTL types
2022-09-22 14:17:09 +02:00
Daniel Bevenius
483edf694b Introduce IoctlType enum for IOCTL types
This commit introduces an enum to represent the IOCTL command types
available, the direction of the data transfer (Get and Set).
2022-09-22 14:12:07 +02:00
Andrew Ealovega
5914d80968 Add non blocking Bxcan constructor.
Signed-off-by: Andrew Ealovega <Andrew@Ealovega.dev>
2022-09-21 22:29:57 -04:00
Zoey Riordan
5f7e0eb2ae Fix builds on other nrf pacs 2022-09-21 14:06:56 +02:00
Zoey Riordan
15b4f9db90 Remove unused function 2022-09-21 11:19:47 +02:00
Zoey Riordan
0f55f5a73d Remove left-in comments and logs 2022-09-21 11:06:06 +02:00
Zoey Riordan
3d708a459c Implement proper Drop for BufferedUarte 2022-09-21 10:48:02 +02:00
bors[bot]
3b58ac1bf8
Merge #949
949: (embassy-rp): Implement RealTimeClock r=lulf a=MathiasKoch

Basically a 1:1 port of the great implementation effort made by `rp-hal`

Co-authored-by: Mathias <mk@blackbird.online>
2022-09-21 07:19:23 +00:00
Mathias
1d3e41f970 Remove code-duplication in async bufferedUart implementations 2022-09-21 06:00:35 +02:00
bors[bot]
44d7a84e47
Merge #957
957: Take into account size of revert index r=lulf a=lulf

Fixes a bug in the partition assertions that ensures that the state page(s) have enough space for 2x active partition range.

Add unit test to verify that panic is observed.

Co-authored-by: Ulf Lilleengen <ulf.lilleengen@gmail.com>
2022-09-20 12:56:46 +00:00
Ulf Lilleengen
b418c0e4d6 Take into account size of revert index
Fixes a bug in the partition assertions that ensures that the state
page(s) have enough space for 2x active partition range.

Add unit test to verify that panic is observed.
2022-09-20 14:04:57 +02:00
bors[bot]
11da25800b
Merge #956
956: Remove BootFlash borrow r=lulf a=lulf

Compiler will infer a different lifetime for BootFlash than for the borrowed flash, which makes it require more type annotations than if it was just owning the type. Since it doesn't really matter if it owns or borrows in practical use, change it to own so that it simplifies usage.

Co-authored-by: Ulf Lilleengen <ulf.lilleengen@gmail.com>
2022-09-20 07:55:20 +00:00
Ulf Lilleengen
d0fe654c82 Remove BootFlash borrow
Compiler will infer a different lifetime for BootFlash than for the
borrowed flash, which makes it require more type annotations than if it
was just owning the type. Since it doesn't really matter if it owns or
borrows in practical use, change it to own so that it simplifies usage.
2022-09-20 09:54:37 +02:00
bors[bot]
6663390224
Merge #954
954: rp: fix async SPI read and write r=lulf a=newAM

Closes #953 

Co-authored-by: Alex Martens <alex@thinglab.org>
2022-09-19 07:26:10 +00:00
bors[bot]
ac13675f3a
Merge #955
955: rp: remove extraneous newlines in logs r=Dirbaio a=newAM



Co-authored-by: Alex Martens <alex@thinglab.org>
2022-09-18 23:22:14 +00:00
Alex Martens
0c6933fefb rp: remove extraneous newlines in logs 2022-09-18 14:54:24 -07:00
Alex Martens
295cc997ae rp: let SPI RX overflow during async write 2022-09-18 12:23:17 -07:00
Alex Martens
ab1a6889a6 rp: fix async SPI read and write 2022-09-18 12:02:05 -07:00
Dario Nieuwenhuis
e7d30194e3
Merge pull request #18 from danbev/has_credit
Make self parameter to has_credit non-mutable
2022-09-18 20:57:23 +02:00
Daniel Bevenius
520860622b Make self parameter to has_credit non-mutable 2022-09-17 09:06:23 +02:00
bors[bot]
336ebe54c0
Merge #952
952: (embassy-rp): Feature-gate time-driver r=MathiasKoch a=MathiasKoch



Co-authored-by: Mathias <mk@blackbird.online>
2022-09-16 14:46:35 +00:00
Mathias
1c657d2d55 Add time-driver feature to docs 2022-09-16 16:45:59 +02:00
Mathias
c495c765df Enable embedded-io on nightly 2022-09-16 13:23:52 +02:00
Mathias
feb840c503 First iteration attempt on implementing generic flash mutation access for RP2040 2022-09-16 13:20:22 +02:00
Mathias
feead3ae89 Implement RealTimeClock for embassy-rp 2022-09-16 13:18:23 +02:00
Mathias
f7267d493f Feature-gate time-driver in embassy-rp 2022-09-16 12:54:26 +02:00
bors[bot]
ec10460547
Merge #950
950: Add .into_inner() and .get_mut() to Mutex r=Dirbaio a=hulthe

Similar to the methods on std Mutex, these methods allow accessing the underlying data without locking the mutex when you have exclusive access to it.

Co-authored-by: Joakim Hulthe <joakim@hulthe.net>
2022-09-16 10:32:12 +00:00
Joakim Hulthe
79654510b7
Make rustfmt happy 2022-09-16 10:45:01 +02:00
Joakim Hulthe
70a3b85acc
Add .into_inner() and .get_mut() to Mutex 2022-09-16 10:32:43 +02:00
Dario Nieuwenhuis
e727fe8675
Merge pull request #16 from danbev/alp
Add contants and update comment about ALP
2022-09-15 13:26:31 +02:00
Dario Nieuwenhuis
443e275f1f
Merge pull request #17 from danbev/channel-headers
Add constants for channel types
2022-09-15 13:26:04 +02:00
bors[bot]
9794bc59cc
Merge #948
948: (embassy-stm32): make `State::new()` const, consistent with others r=Dirbaio a=FrozenDroid



Co-authored-by: Vincent Stakenburg <v.stakenburg@sinewave.nl>
2022-09-15 11:14:24 +00:00
Vincent Stakenburg
c4d5c047d7 make State::new() const, consistent with others 2022-09-15 12:34:17 +02:00
Daniel Bevenius
96214f9db6 Add constants for channel types 2022-09-15 09:58:44 +02:00
bors[bot]
809a4a127b
Merge #946
946: sync/signal: wake old waker on overflow instead of panicking. r=Dirbaio a=Dirbaio

This makes behavior consistent with `WakerRegistration`. It allows canceling `wait` in one task and then calling `wait` in another. If two tasks are `wait`ing concurrently the signal will be received by only one of them, randomly.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-09-12 10:30:01 +00:00
Dario Nieuwenhuis
ea5f2c71e0 sync/signal: wake old waker on overflow instead of panicking.
This makes behavior consistent with `WakerRegistration`. It allows canceling `wait`
in one task and then calling `wait` in another. If two tasks are `wait`ing
concurrently the signal will be received by only one of them, randomly.
2022-09-12 12:05:58 +02:00
Daniel Bevenius
be20512f17 Add contants and update comment about ALP
This commit add two constants and updates the comment about ALP.

It was not easy to find the definition of ALP but after searching I
found what I believe is the correct definition in section 3.3 "Clocks"
in the referenced document below.

Active Low Power (ALP):
Supplied by an internal or external oscillator. This clock is
requested by cores when accessing backplane registers in other cores
or when performing minor computations. When an external crystal is
used to provide reference clock, ALP clock frequency is determined by
the frequency of the external oscillator. A 37.4 MHz reference clock
 is recommended.

Refs:
https://www.infineon.com/dgdl/Infineon-AN214828_Power_Consumption_Measurements-ApplicationNotes-v03_00-EN.pdf?fileId=8ac78c8c7cdc391c017d0d2803a4630d
2022-09-12 11:49:09 +02:00
Dario Nieuwenhuis
a19bcb69d1
Merge pull request #14 from danbev/ioctl_set_get_consts
Add constants for ioctl commands
2022-09-09 22:11:55 +02:00
Dario Nieuwenhuis
92136d27f6
Merge pull request #13 from danbev/update_credit_seq_max
Use wrapping_sub in update_credit
2022-09-09 22:11:16 +02:00
Daniel Bevenius
f0b7f43c41 Use wrapping_sub in update_credit
This commit uses wrapping_sub for subtraction in update_credit.

The motivation for this is that currently the rpi-pico-w example panics
(at least for me) with the following error:

3.825277 INFO  init done
└─ cyw43::{impl#4}::init::{async_fn#0} @ /embassy/cyw43/src/fmt.rs:138
3.825486 INFO  Downloading CLM...
└─ cyw43::{impl#2}::init::{async_fn#0} @ /embassy/cyw43/src/fmt.rs:138
3.841328 WARN  TX stalled
└─ cyw43::{impl#4}::run::{async_fn#0} @ /embassy/cyw43/src/fmt.rs:151
3.845549 ERROR panicked at 'attempt to subtract with overflow', /embassy/cyw43/src/lib.rs:919:16
└─ panic_probe::print_defmt::print @ .cargo/registry/src/github.com-1ecc6299db9ec823/panic-probe-0.3.0/src/lib.rs:91
────────────────────────────────────────────────────────────────────────────────
stack backtrace:
   0: HardFaultTrampoline
      <exception entry>
   1: lib::inline::__udf
        at ./asm/inline.rs:181:5
   2: __udf
        at ./asm/lib.rs:51:17
   3: cortex_m::asm::udf
        at .cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.6/src/asm.rs:43:5
   4: rust_begin_unwind
        at .cargo/registry/src/github.com-1ecc6299db9ec823/panic-probe-0.3.0/src/lib.rs:72:9
   5: core::panicking::panic_fmt
        at rustc/1c7b36d4db582cb47513a6c7176baaec1c3346ab/library/core/src/panicking.rs:142:14
   6: core::panicking::panic
        at /rustc/1c7b36d4db582cb47513a6c7176baaec1c3346ab/library/core/src/panicking.rs:48:5
   7: cyw43::Runner<PWR,SPI>::update_credit
        at /embassy/cyw43/src/lib.rs:919:16
   8: cyw43::Runner<PWR,SPI>::rx
        at /embassy/cyw43/src/lib.rs:808:9
   9: cyw43::Runner<PWR,SPI>::run::{{closure}}
        at /embassy/cyw43/src/lib.rs:727:21
  10: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
        at /rustc/1c7b36d4db582cb47513a6c7176baaec1c3346ab/library/core/src/future/mod.rs:91:19
  11: cyw43_example_rpi_pico_w::__wifi_task_task::{{closure}}
        at src/main.rs:32:17
2022-09-09 15:09:54 +02:00
Daniel Bevenius
fe5229670f Add constants for ioctl commands
This commit adds contants for the IOCTL commands that are currently
used in cyw43::Control.
2022-09-09 14:31:00 +02:00
Mathias
b2d0f8d590 Formatting 2022-09-09 10:49:47 +02:00
Mathias
31d85da78a Add bufferedUart, including a split version for only Rx or Tx 2022-09-09 10:48:52 +02:00
Mathias
9611e7c9f2 Add BufferedUart implementation, and feature-guard time-driver initialization, to free up TIMER peripheral if not used with embassy executor 2022-09-09 10:48:30 +02:00
Dario Nieuwenhuis
573c433f64
Merge pull request #945 from danbev/embassy-hal-common-typo
Fix typo in peripheral.rs
2022-09-08 19:09:32 +02:00
Daniel Bevenius
34ed3441ce Fix typo in peripheral.rs 2022-09-08 17:01:45 +02:00