Commit Graph

2178 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
fdb6e66b4b time: better docs explaining overflow handling. 2022-02-23 05:16:30 +01:00
bors[bot]
78795d6f56
Merge #628
628: Improve logic for processing button events r=Dirbaio a=ceigel

Allow blinking to be interrupted by button presses in this sample.

Co-authored-by: Cristian Eigel <cristian.eigel@esrlabs.com>
2022-02-23 02:50:12 +00:00
bors[bot]
d70a644681
Merge #633
633: stm32/rcc: fix f3 build failure. r=Dirbaio a=Dirbaio



Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-23 02:43:23 +00:00
Dario Nieuwenhuis
2abb04d4d1 stm32/rcc: fix f3 build failure. 2022-02-23 03:42:46 +01:00
bors[bot]
697be8bbdc
Merge #632
632: Update nightly. r=Dirbaio a=Dirbaio



Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-21 04:28:06 +00:00
Dario Nieuwenhuis
0d76681f58 Update nightly. 2022-02-21 05:27:02 +01:00
Dario Nieuwenhuis
b9cea77ef4
Update getting_started.adoc 2022-02-21 05:02:39 +01:00
Cristian Eigel
f4ac3cf364 Improve logic for processing button events 2022-02-16 21:22:35 +01:00
bors[bot]
59f909e665
Merge #626
626: rp: impl eh1.0 blocking traits r=Dirbaio a=Dirbaio



Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-15 16:29:59 +00:00
Dario Nieuwenhuis
d9aec181a4 rp: impl eh1.0 blocking traits 2022-02-15 17:29:05 +01:00
bors[bot]
d7aea31a85
Merge #625
625: Update nRF PACs r=Dirbaio a=Dirbaio



Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-15 15:37:01 +00:00
Dario Nieuwenhuis
2e8f39ffdd Update nRF PACs 2022-02-15 16:35:54 +01:00
bors[bot]
ef4e156482
Merge #624
624: Update stm32-data r=Dirbaio a=Dirbaio

i2c, uart, RCC fixes

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-14 01:12:58 +00:00
Dario Nieuwenhuis
39d06b59cd Update stm32-data 2022-02-14 02:12:06 +01:00
bors[bot]
c8f9f1bead
Merge #618
618: time: optimize math by reducing fractions at compile time.  r=Dirbaio a=Dirbaio

For example, `as_micros`, `from_micros` now are noops if tick rate is 1MHz.

See: https://godbolt.org/z/fE1bf3ecP

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-13 20:29:06 +00:00
Dario Nieuwenhuis
640ddc9481 time: optimize math by reducing fractions at compile time.
For example, `as_micros`, `from_micros` now are noops if tick rate is 1MHz.
2022-02-13 21:28:03 +01:00
bors[bot]
eb922c4655
Merge #608
608: stm32f4: add adc + example r=Dirbaio a=ain101

Example tested on stm32f407vg Discovery Board.
minimal adc: no vref, dma, complex sequence

Co-authored-by: Frederik <frederik@frederik.at>
2022-02-13 11:44:59 +00:00
Frederik
7a3d34c1ed fix build for stm32f410tb 2022-02-12 23:56:50 +01:00
Frederik
6f0488cbe7 remove unnecessary mod 2022-02-12 23:55:58 +01:00
bors[bot]
b74ccf2d34
Merge #617
617: Add feature defmt-timestamp-uptime r=Dirbaio a=danielzfranklin

Add the feature defmt-timestamp-uptime. Enabling it adds a timestamp of the number of seconds since startup next to defmt log messages using `Instant::now`.

Co-authored-by: Daniel Franklin <daniel@danielzfranklin.org>
2022-02-12 02:12:48 +00:00
Daniel Franklin
04ac488319 Add {from_as}_micros to Instant 2022-02-11 19:01:43 -07:00
bors[bot]
baadd9b234
Merge #616
616: stm32: add rust stable support r=Dirbaio a=Dirbaio



Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-12 01:46:14 +00:00
Dario Nieuwenhuis
340eb4eead stm32: add rust stable support 2022-02-12 02:45:52 +01:00
Daniel Franklin
4c5f5f7169 Add feature defmt-timestamp-uptime
Enabling it adds a timestamp of the number of seconds since startup next
to defmt log messages using `Instant::now`.
2022-02-11 18:45:23 -07:00
bors[bot]
f2eb438905
Merge #615
615: rp: remove OptionalPin r=Dirbaio a=Dirbaio

Mirror of https://github.com/embassy-rs/embassy/pull/605 for rp2040

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-12 00:46:40 +00:00
Dario Nieuwenhuis
0c9b1abb67 rp: remove OptionalPin 2022-02-12 01:34:41 +01:00
Dario Nieuwenhuis
4a75475cfc stm32: remove unused sealed::OptionalPin 2022-02-12 01:34:09 +01:00
Dario Nieuwenhuis
49eb2f769e nrf: remove stray mention of OptionalPin 2022-02-12 01:33:56 +01:00
bors[bot]
e728a32672
Merge #613
613: Rust stable support r=Dirbaio a=Dirbaio

This PR adds (limited) stable Rust support!

The drawbacks are: 

- No `#[embassy::task]`, `#[embassy::main]`. (requires `type_alias_impl_trait`). You have to manually allocate the tasks somewhere they'll live forever. See [example](https://github.com/embassy-rs/embassy/blob/master/examples/nrf/src/bin/raw_spawn.rs)
- No async trait impls (requires GATs). Note that the full API surface of HALs is still available through inherent methods: #552 #581 
- Some stuff is not constructible in const (requires `const_fn_trait_bound`), although there's an (ugly) workaround for the generic `Mutex`.

So it's not that bad in the end, it's fully usable for shipping production-ready firmwares. We'll still recommend nightly as the default, until GATs and `type_alias_impl_trait` are stable.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-12 00:30:47 +00:00
Dario Nieuwenhuis
1904906b36 ci: add build with stable. 2022-02-12 01:16:31 +01:00
Dario Nieuwenhuis
20e14b8edb embassy, embassy-nrf: add nightly Cargo feature to gate nightly-only features. 2022-02-12 01:16:31 +01:00
Dario Nieuwenhuis
611961b499 macros: cleanup, make work in stable. 2022-02-12 01:16:31 +01:00
Dario Nieuwenhuis
6c925b2342 blocking_mutex: refactor to work on stable. No GATs, and can be constructed in const. 2022-02-12 01:16:31 +01:00
bors[bot]
d708be7fe5
Merge #614
614: nrf: remove OptionalPin r=Dirbaio a=Dirbaio

Mirror of #605 for nrf

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-12 00:07:54 +00:00
Dario Nieuwenhuis
6de02bb23e nrf: remove OptionalPin 2022-02-12 01:07:02 +01:00
bors[bot]
5ae4e20f86
Merge #607
607: stm32: Add standard crate-wide macros for pin/dma traits r=Dirbaio a=Dirbaio

All drivers will declare the traits using these macros.

This has a few implications:
- ALL drivers will have an Instance trait, even for drivers that usually have only one instance (for example crc, eth)
- It's no longer possible to have a fn configure() in pin traits, drivers will have to do that some other way

In the future, build.rs will generate all the impls instead of macrotables.

Pin/Dma traits are no longer explicitly sealed, since gpio::Pin and dma::Channel are already sealed, which has the same effect. This means the `af_num()` and `request()` funcs are now public, but IMO that's okay, they're unlikely to change.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-11 23:11:12 +00:00
bors[bot]
621a280042
Merge #612
612: Add button_events example for stm32f3 r=Dirbaio a=ceigel

This is a more elaborate example of using buttons and leds. 
Tested on STM32F3DISCOVERY

Co-authored-by: Cristian Eigel <cristian.eigel@esrlabs.com>
2022-02-11 21:12:58 +00:00
Cristian Eigel
0e0e23c5be Add button_events example for stm32f3 2022-02-11 22:10:47 +01:00
Dario Nieuwenhuis
cf9c157607
Merge pull request #611 from danielzfranklin/patch-1
Document #[embassy::main(config = ...)]
2022-02-11 22:06:47 +01:00
Daniel Franklin
e15d3750ea
Document #[embassy::main(config = ...)]
Add an example documenting the config param based on help I got in the matrix chat.

Because the example is very short and incompatible with the other example code I just included it inline.
2022-02-11 13:00:45 -08:00
bors[bot]
37bd796fb3
Merge #610
610: Update cargo-batch. r=Dirbaio a=Dirbaio

Cargo-batch now prints target+features when buildng a crate fails, which is very handy when one of the 30 `embassy-stm32`s fails in CI.


Before: 
```
error: could not compile embassy-stm32 due to 2 previous errors
```

After:
```
error: could not compile `embassy-stm32` due to 2 previous errors
     target: Target(CompileTarget { name: "thumbv7em-none-eabi" })
     features: ["_time-driver", "defmt", "exti", "stm32f410tb", "time-driver-any"]
```

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-11 19:48:55 +00:00
Dario Nieuwenhuis
63cfa7cd6a Update cargo-batch. 2022-02-11 20:31:37 +01:00
Frederik
e4f240823d adc cleanup retval 2022-02-11 17:48:32 +01:00
Frederik
7a3d28ad00 stm32f4: add adc + example
Example tested on stm32f407vg Discovery Board.
minimal adc: no vref, dma, complex sequence
2022-02-10 23:28:41 +01:00
Dario Nieuwenhuis
b99ab3d5d9 stm32: Add standard crate-wide macros for pin/dma traits, switch all drivers to use them. 2022-02-10 21:38:03 +01:00
bors[bot]
cbc7f620bd
Merge #606
606: Port multiprio example to stm32f3 and stm32f4 platforms r=Dirbaio a=ceigel

Example tested on stm32f303discovery and stm32f405 feather.

Co-authored-by: Cristian Eigel <cristian.eigel@esrlabs.com>
2022-02-10 18:26:56 +00:00
Cristian Eigel
898851ceeb Port multiprio example to stm32f3 and stm32f4 platforms 2022-02-10 19:22:32 +01:00
bors[bot]
9d682aa1fa
Merge #605
605: stm32: Remove OptionalPin r=Dirbaio a=Dirbaio

The idea behind OptionalPin has a few problems:

- you need to impl the signal traits for NoPin which is a bit weird https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L413-L416
- you can pass any combination of set/unset pins, which needs checking at runtime  https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L130

The replacement is to do multiple `new` constructors for each combination of pins you want to take.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-02-10 15:15:06 +00:00
Dario Nieuwenhuis
a8bd3ab952 Add missing + 'd on unborrows. 2022-02-10 16:06:42 +01:00
Dario Nieuwenhuis
550da471be stm32: Remove OptionalPin
The idea behind OptionalPin has a few problems:

- you need to impl the signal traits for NoPin which is a bit weird https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L413-L416
- you can pass any combination of set/unset pins, which needs checking at runtime  https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L130

The replacement is to do multiple `new` constructors for each combination of pins you want to take.
2022-02-10 02:38:10 +01:00