Commit Graph

3089 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
dd99356062 Add env DEFMT_LOG=trace to all examples. 2022-06-18 01:59:12 +02:00
Dario Nieuwenhuis
b585d54712
Update rust nightly. (#819) 2022-06-18 01:44:02 +02:00
Dion Dokter
1eec7e69f1 Added some more docs 2022-06-17 15:29:42 +02:00
Dion Dokter
9887f18a51 fmt 2022-06-17 15:08:31 +02:00
Dion Dokter
949b548d45 Refactor pub/sub impls into their own files 2022-06-17 15:06:41 +02:00
Dion Dokter
4a5127aead Move the module into a folder 2022-06-17 14:45:07 +02:00
Dion Dokter
5eae020074 Created the possibility to choose between dyn channel and generic channel 2022-06-17 14:44:19 +02:00
Dion Dokter
eb304c2448 Added a function to WakerRegistration to check if it's occupied.
Created a MultiWakerRegistration that can hold multiple wakers.
Got rid of some options and the pub/sub_index
2022-06-17 13:54:34 +02:00
Dion Dokter
2a4cdd05fa Removed all unsafe 2022-06-16 22:13:26 +02:00
Dion Dokter
a614a55c7d Put most behaviour one level lower (under the mutex instead of above).
Changed the PubSubBehavior to only have high level functions.
2022-06-16 22:11:29 +02:00
Dion Dokter
dfde157337 Removed most unsafe code 2022-06-16 20:57:11 +02:00
Dion Dokter
cdacc44c5f Added unpin impls to the futures 2022-06-16 16:37:23 +02:00
Dion Dokter
f92f46f489 Added convenience methods that ignore lag 2022-06-16 14:19:16 +02:00
Dion Dokter
790426e2f6 Stream now ignores lag 2022-06-16 14:11:41 +02:00
Dion Dokter
c7cdecfc93 Renamed subscriber messages 2022-06-16 14:07:04 +02:00
Dion Dokter
98d0bb726c fmt 2022-06-16 13:51:35 +02:00
Dion Dokter
36b363a5b7 Changed names of subscriber methods and implemented the Stream trait for it 2022-06-16 13:48:26 +02:00
Dion Dokter
03996583a1 fmt 2022-06-16 12:36:39 +02:00
Dion Dokter
12a6ddfbcd Added a pubsub channel implementation 2022-06-16 12:28:12 +02:00
bors[bot]
fcc1db078e
Merge #816
816: Fix doc comments for BpskPacketParams r=lulf a=danbev



Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2022-06-16 10:19:28 +00:00
bors[bot]
23177ba7eb
Merge #813
813: Document remaining public APIs in embassy crate r=lulf a=lulf

This also includes the README.md in the toplevel crate documentation, fixing a few formatting issues with it as well. 

Please review the mutex in detail in case I've misunderstood/missed a few things there.

Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
2022-06-16 07:18:43 +00:00
Daniel Bevenius
9031b8f80a Fix doc comments for BpskPacketParams 2022-06-16 07:34:59 +02:00
bors[bot]
a8920bced5
Merge #815
815: Fix typo in LoRaPacketParams::new doc r=Dirbaio a=danbev



Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2022-06-16 04:25:46 +00:00
Daniel Bevenius
d0edd171f8 Fix typo in LoRaPacketParams::new doc 2022-06-16 06:22:03 +02:00
bors[bot]
f9b90212d4
Merge #814
814: Extract setting of lora modulation params r=lulf a=danbev

This commit suggests extracting the lora modulation parameters into a
separate function which can then be called from both the do_tx, and
the do_rx functions.

Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2022-06-15 14:23:16 +00:00
Daniel Bevenius
06a76cd7ce Extract setting of lora modulation params
This commit suggests extracting the lora modulation parameters into a
separate function which can then be called from both the do_tx, and
the do_rx functions.
2022-06-15 16:21:52 +02:00
bors[bot]
03c20604c3
Merge #811
811: Sync subghz peripheral support with stm32wlxx-hal r=lulf a=lulf

* A few more registers exposed 
* Fix for "sleeping"
* Updating comments

Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
2022-06-15 13:29:55 +00:00
Ulf Lilleengen
25ddb26be8 Improve mutex wording 2022-06-15 13:06:35 +02:00
Ulf Lilleengen
eb23733767 Ignore compiling rust code 2022-06-15 10:44:15 +02:00
Ulf Lilleengen
72eb16b46d Add missing documentation for all public modules and types 2022-06-15 10:24:36 +02:00
Ulf Lilleengen
aaebea00eb Ensure links get formatted correctly in cargo doc 2022-06-15 10:24:18 +02:00
Ulf Lilleengen
f8f56c926d Include README.md in crate documentation 2022-06-15 09:06:18 +02:00
Ulf Lilleengen
746bc75a8e FIx broken link warnings 2022-06-15 09:05:48 +02:00
Ulf Lilleengen
faa59efbf6 Cargo fmt 2022-06-15 09:01:22 +02:00
Ulf Lilleengen
3696226fe8 Sync subghz peripheral support with stm32wlxx-hal 2022-06-14 16:27:42 +02:00
bors[bot]
624e46ccfb
Merge #809
809: Allow compiling usb-serial without defmt r=lulf a=lulf



Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
2022-06-13 12:46:39 +00:00
Ulf Lilleengen
0c423cc901 Allow compiling usb-serial without defmt 2022-06-13 14:45:53 +02:00
bors[bot]
db685c0404
Merge #808
808: Add rustfmt.toml with some nice settings. r=lulf a=Dirbaio



Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-06-13 07:22:04 +00:00
Dario Nieuwenhuis
a8703b7598 Run rustfmt. 2022-06-12 22:22:31 +02:00
Dario Nieuwenhuis
6199bdea71 Add rustfmt.toml with some nice settings. 2022-06-12 22:15:28 +02:00
bors[bot]
fff0a03fe0
Merge #806
806: Add embassy-cortex-m crate. r=Dirbaio a=Dirbaio

- Move Interrupt and InterruptExecutor from `embassy` to `embassy-cortex-m`.
- Move Unborrow from `embassy` to `embassy-hal-common` (nothing in `embassy` requires it anymore)
- Move PeripheralMutex from `embassy-hal-common` to `embassy-cortex-m`.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-06-12 19:49:15 +00:00
Dario Nieuwenhuis
5085100df2 Add embassy-cortex-m crate.
- Move Interrupt and InterruptExecutor from `embassy` to `embassy-cortex-m`.
- Move Unborrow from `embassy` to `embassy-hal-common` (nothing in `embassy` requires it anymore)
- Move PeripheralMutex from `embassy-hal-common` to `embassy-cortex-m`.
2022-06-12 21:45:38 +02:00
bors[bot]
6b3499a5c8
Merge #807
807: Rename channel to mpmc r=huntc a=huntc

I've renamed the channel module for the MPMC as `mpmc`. There was a previous debate about this, but I feel that the strategy here avoids importing `channel::channel`. The change leaves `signal::Signal`, but I think that's ok. It is all a bit subjective of course. The bottom line for me is that I really like the term `mpmc` - it means something to me and aligns with broader naming e.g. in Tokio.

Co-authored-by: huntc <huntchr@gmail.com>
2022-06-12 06:27:11 +00:00
huntc
99d19c7dcf Rename channel to mpmc
I've renamed the channel module for the MPMC as mpmc. There was a previous debate about this, but I feel that the strategy here avoids importing `channel::channel`. The change leaves `signal::Signal`, but I think that's ok. It is all a bit subjective of course. The bottom line for me is that I really like the term mpmc - it means something to me and aligns with broader naming e.g. in Tokio.
2022-06-12 15:16:56 +10:00
Dario Nieuwenhuis
db344c2bda
common/PeripheralMutex: remove unsafe API. (#802)
Following the project's decision that "leak unsafe" APIs are not marked as "unsafe",
update PeripheralMutex to accept non-'static state without unsafe.

Fixes #801
2022-06-09 21:28:13 +02:00
bors[bot]
77c7d8f31b
Merge #797
797: Use correct index and bank for stm32 flash r=Dirbaio a=lulf

The page index was wrong because it doesn't take FLASH_BASE into account. 

For l4, the page index register also depends on a bank selection register.

Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
2022-06-07 14:09:54 +00:00
Ulf Lilleengen
7d64f5cda7 Use correct index and bank 2022-06-07 15:59:22 +02:00
bors[bot]
bf09017032
Merge #796
796: nrf/twim: allow zero length transfers. r=Dirbaio a=Dirbaio

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-06-07 12:54:09 +00:00
Dario Nieuwenhuis
2be36122c7 nrf/twim: allow zero length transfers. 2022-06-07 14:52:45 +02:00
bors[bot]
c212f30be0
Merge #709
709: embassy-usb stm32 r=Dirbaio a=Dirbaio

TODO

- [x] Add cfgs for EP_COUNT, EP_MEMORY_ADDR. -- ended up doing it in stm32-data
- [x] Auto-enable PWR USV in stm32l5,
- [x] Auto-enable PWR on other families that need it -- didn't find any
- [ ] ~~Assert at runtime that RCC has valid 48Mhz clock?~~ -- won't do it yet, too messy without rcc cleanup
- [x] Tested on STM32L5
- [x] Tested on STM32F303ZE
- [x] Tested on STM32F103c8
- [x] Fix duplicated irqs on STM32F303 in stm32data, remove workaround in embassy-stm32
- [x] Test HID example
- [x] Test NCM example


Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-06-07 02:01:43 +00:00