diff options
author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-02-03 06:44:20 +0100 |
---|---|---|
committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-02-03 06:44:20 +0100 |
commit | 9400ecccb5271e03a46a07825b2775bc3bf7f609 (patch) | |
tree | 0ab12661720efd27ebf71ce23b9ee17e9c6a4f72 | |
parent | 96e625fc3baa4f258e9e9f761845a76751710b0d (diff) | |
download | nrf-softdevice-9400ecccb5271e03a46a07825b2775bc3bf7f609.zip |
update embassy
-rw-r--r-- | Cargo.lock | 246 | ||||
-rw-r--r-- | examples/Cargo.toml | 2 | ||||
-rw-r--r-- | examples/src/bin/ble_bas_central.rs | 13 | ||||
-rw-r--r-- | examples/src/bin/ble_bas_peripheral.rs | 13 | ||||
-rw-r--r-- | examples/src/bin/ble_l2cap_central.rs | 13 | ||||
-rw-r--r-- | examples/src/bin/ble_l2cap_peripheral.rs | 16 | ||||
-rw-r--r-- | examples/src/bin/ble_peripheral_onoff.rs | 16 | ||||
-rw-r--r-- | examples/src/bin/ble_scan.rs | 13 | ||||
-rw-r--r-- | examples/src/bin/flash.rs | 13 | ||||
-rw-r--r-- | examples/src/bin/interrupts.rs | 13 | ||||
-rw-r--r-- | examples/src/bin/rtic.rs | 13 |
11 files changed, 166 insertions, 205 deletions
@@ -30,20 +30,15 @@ dependencies = [ [[package]] name = "alloc-cortex-m" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46567ff10c713079e2b9ee67638073471a6b265e22c0bcd8ca96f63545cc90b" +checksum = "a67ad0fe14be887ed94e5722d14861c1877b128edbda2dd372e64d5243d614ae" dependencies = [ - "cortex-m", + "cortex-m 0.6.7", "linked_list_allocator", ] [[package]] -name = "anyfmt" -version = "0.1.0" -source = "git+https://github.com/akiles/embassy#2e062f562773f4f4ff978e7976c2d4b08b968a6c" - -[[package]] name = "as-slice" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -78,9 +73,9 @@ checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "cast" @@ -98,14 +93,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] name = "cortex-m" -version = "0.6.4" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cdafeafba636c00c467ded7f1587210725a1adfab0c24028a7844b87738263" +checksum = "9075300b07c6a56263b9b582c214d0ff037b00d45ec9fde1cc711490c56f1bb9" dependencies = [ "aligned", "bare-metal", "bitfield", + "cortex-m 0.7.1", + "volatile-register", +] + +[[package]] +name = "cortex-m" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0b756a8bffc56025de45218a48ff9b801180440c0ee49a722b32d49dcebc771" +dependencies = [ + "bare-metal", + "bitfield", + "embedded-hal", "volatile-register", ] @@ -136,7 +150,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b30efcb6b7920d9016182c485687f0012487032a14c415d2fce6e9862ef8260e" dependencies = [ - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", "cortex-m-rtic-macros", "heapless", @@ -222,9 +236,9 @@ checksum = "812b30ff14930407c86a23e256ac050b8e6913f597adcc88e29d40517f7a16de" [[package]] name = "derivative" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", @@ -234,21 +248,19 @@ dependencies = [ [[package]] name = "embassy" version = "0.1.0" -source = "git+https://github.com/akiles/embassy#2e062f562773f4f4ff978e7976c2d4b08b968a6c" +source = "git+https://github.com/akiles/embassy#42c9a603bbe0a98db140e252b6ab2ad7eab56425" dependencies = [ - "anyfmt", - "cortex-m", + "cortex-m 0.6.7", "defmt", "embassy-macros", "futures", - "futures-intrusive", - "pin-project 0.4.27", + "pin-project", ] [[package]] name = "embassy-macros" version = "0.1.0" -source = "git+https://github.com/akiles/embassy#2e062f562773f4f4ff978e7976c2d4b08b968a6c" +source = "git+https://github.com/akiles/embassy#42c9a603bbe0a98db140e252b6ab2ad7eab56425" dependencies = [ "darling", "quote", @@ -258,20 +270,28 @@ dependencies = [ [[package]] name = "embassy-nrf" version = "0.1.0" -source = "git+https://github.com/akiles/embassy#2e062f562773f4f4ff978e7976c2d4b08b968a6c" +source = "git+https://github.com/akiles/embassy#42c9a603bbe0a98db140e252b6ab2ad7eab56425" dependencies = [ - "anyfmt", - "bare-metal", - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", "defmt", "embassy", + "embedded-dma", "embedded-hal", "nrf52840-hal", "nrf52840-pac", ] [[package]] +name = "embedded-dma" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c8c02e4347a0267ca60813c952017f4c5948c232474c6010a381a337f1bda4" +dependencies = [ + "stable_deref_trait", +] + +[[package]] name = "embedded-hal" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -298,9 +318,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3b0c040a1fe6529d30b3c5944b280c7f0dcb2930d2c3062bca967b602583d0" +checksum = "da9052a1a50244d8d5aa9bf55cbc2fb6f357c86cc52e46c62ed390a7180cf150" dependencies = [ "futures-channel", "futures-core", @@ -312,9 +332,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" dependencies = [ "futures-core", "futures-sink", @@ -322,48 +342,38 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" - -[[package]] -name = "futures-intrusive" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc1529d07bd55fa54fc6c2d8460f621cfde0ae3fd2b96b2fa7eb4883478e1703" -dependencies = [ - "futures-core", - "lock_api", -] +checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" [[package]] name = "futures-io" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" +checksum = "28be053525281ad8259d47e4de5de657b25e7bac113458555bb4b70bc6870500" [[package]] name = "futures-sink" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" +checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" [[package]] name = "futures-task" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" +checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" [[package]] name = "futures-util" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" dependencies = [ "futures-core", "futures-sink", "futures-task", - "pin-project 1.0.1", + "pin-project-lite", "pin-utils", ] @@ -430,9 +440,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" +checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" dependencies = [ "autocfg", "hashbrown", @@ -446,26 +456,17 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "linked_list_allocator" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84565678e403453d1a27a0886882b3b271701e65146d972d9d7d9a4c4a0ff498" - -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] +checksum = "822add9edb1860698b79522510da17bef885171f75aa395cff099d770c609c24" [[package]] name = "log" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -491,13 +492,14 @@ checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" [[package]] name = "nrf-hal-common" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "299e8e5b67542ae134c93722f03f3137d349b3786a35dd2b02a87701ea779201" +checksum = "675eee40228591a1991eade1d4adc1a23fd7ff750b5c895ca068b9c2f0878b72" dependencies = [ "cast", - "cfg-if", - "cortex-m", + "cfg-if 0.1.10", + "cortex-m 0.6.7", + "embedded-dma", "embedded-hal", "fixed", "nb 1.0.0", @@ -510,7 +512,7 @@ dependencies = [ name = "nrf-softdevice" version = "0.1.0" dependencies = [ - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", "defmt", "embassy", @@ -535,7 +537,7 @@ dependencies = [ name = "nrf-softdevice-defmt-rtt" version = "0.1.0" dependencies = [ - "cortex-m", + "cortex-m 0.6.7", "defmt", "nrf-softdevice", ] @@ -545,7 +547,7 @@ name = "nrf-softdevice-examples" version = "0.1.0" dependencies = [ "alloc-cortex-m", - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", "cortex-m-rtic", "defmt", @@ -604,7 +606,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "136a10e0a338c3b46370a37c7986d78880714abae701d6a9a5fbdfde9a6397ea" dependencies = [ "bare-metal", - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", "vcell", ] @@ -616,7 +618,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ef7b4920d2f4316e54af7180bef23d64b5749eaa48ddb22398026c14e716036" dependencies = [ "bare-metal", - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", "vcell", ] @@ -628,7 +630,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72920484274fae0792a40345049da2723612465c7202561b6a17ad3c127259db" dependencies = [ "bare-metal", - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", "vcell", ] @@ -640,16 +642,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed3dee38c8f33516f9fab44ac568f79f82cfcd0d5747f1cb6276a17d0fd9801d" dependencies = [ "bare-metal", - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", "vcell", ] [[package]] name = "nrf52840-hal" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f7e01810b986e03c6cbe24dbcdd479a930e23e6b738540fe71c8b6389f475c" +checksum = "c1f9e382ab941f46db0e2f086fa64f54faf3473eddb16a0e350c0a5b37febba2" dependencies = [ "embedded-hal", "nrf-hal-common", @@ -663,7 +665,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1b780a5afd2621774652f28c82837f6aa6d19cf0ad71c734fc1fe53298a2d73" dependencies = [ "bare-metal", - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", "vcell", ] @@ -690,12 +692,18 @@ dependencies = [ ] [[package]] +name = "once_cell" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" + +[[package]] name = "panic-probe" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de06adf67ed4f46572b31ac5340b8137f8a37d5e89fd68101d92767c9feb5f0" dependencies = [ - "cortex-m", + "cortex-m 0.6.7", "cortex-m-rt", ] @@ -710,27 +718,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.27" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" +checksum = "95b70b68509f17aa2857863b6fa00bf21fc93674c7a8893de2f469f6aa7ca2f2" dependencies = [ - "pin-project-internal 0.4.27", -] - -[[package]] -name = "pin-project" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee41d838744f60d959d7074e3afb6b35c7456d0f61cad38a24e35e6553f73841" -dependencies = [ - "pin-project-internal 1.0.1", + "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "0.4.27" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" +checksum = "caa25a6393f22ce819b0f50e0be89287292fda8d425be38ee0ca14c4931d9e71" dependencies = [ "proc-macro2", "quote", @@ -738,15 +737,10 @@ dependencies = [ ] [[package]] -name = "pin-project-internal" -version = "1.0.1" +name = "pin-project-lite" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a4ffa594b66bff340084d4081df649a7dc049ac8d7fc458d8e628bfbbb2f86" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" [[package]] name = "pin-utils" @@ -765,9 +759,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" dependencies = [ "proc-macro2", ] @@ -786,9 +780,9 @@ checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" [[package]] name = "regex" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" dependencies = [ "aho-corasick", "memchr", @@ -798,15 +792,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "rtic-core" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab51fe832317e805f869b3d859f91aadf855c2c3da51f9b84bc645c201597158" +checksum = "8bd58a6949de8ff797a346a28d9f13f7b8f54fa61bb5e3cb0985a4efb497a5ef" [[package]] name = "rtic-syntax" @@ -829,12 +823,6 @@ dependencies = [ ] [[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -849,7 +837,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser 0.10.1", + "semver-parser 0.10.2", ] [[package]] @@ -860,9 +848,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "semver-parser" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ef146c2ad5e5f4b037cd6ce2ebb775401729b19a82040c1beac9d36c7d1428" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" dependencies = [ "pest", ] @@ -881,9 +869,9 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "syn" -version = "1.0.48" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" dependencies = [ "proc-macro2", "quote", @@ -892,11 +880,11 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.0.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "d8208a331e1cb318dd5bd76951d2b8fc48ca38a69f5f4e4af1b6a9f8c6236915" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -919,15 +907,15 @@ checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "uuid" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "vcell" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876e32dcadfe563a4289e994f7cb391197f362b6315dc45e8ba4aa6f564a4b3c" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" [[package]] name = "version_check" diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 4413169..caa6dc5 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -31,7 +31,7 @@ cortex-m-rtic = { version = "0.5.5", optional = true } defmt = "0.1.3" nrf-softdevice-defmt-rtt = { path = "../nrf-softdevice-defmt-rtt", version = "0.1.0" } panic-probe = "0.1.0" -nrf52840-hal = { version = "0.11.0" } +nrf52840-hal = { version = "0.12.0" } nrf-softdevice = { version = "0.1.0", path = "../nrf-softdevice", features = ["defmt", "defmt-trace", "nrf52840", "s140", "ble-peripheral", "ble-central"] } nrf-softdevice-s140 = { version = "0.1.1", path = "../nrf-softdevice-s140" } futures = { version = "0.3.5", default-features = false } diff --git a/examples/src/bin/ble_bas_central.rs b/examples/src/bin/ble_bas_central.rs index be90a4c..eabc539 100644 --- a/examples/src/bin/ble_bas_central.rs +++ b/examples/src/bin/ble_bas_central.rs @@ -98,12 +98,9 @@ fn main() -> ! { let (sdp, p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); - let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); - unwrap!(executor.spawn(softdevice_task(sd))); - unwrap!(executor.spawn(ble_central_task(sd))); - - loop { - executor.run(); - cortex_m::asm::wfe(); - } + let executor = EXECUTOR.put(Executor::new()); + executor.run(|spawner| { + unwrap!(spawner.spawn(softdevice_task(sd))); + unwrap!(spawner.spawn(ble_central_task(sd))); + }); } diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs index 53b4e34..7d754b0 100644 --- a/examples/src/bin/ble_bas_peripheral.rs +++ b/examples/src/bin/ble_bas_peripheral.rs @@ -128,12 +128,9 @@ fn main() -> ! { let (sdp, p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); - let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); - unwrap!(executor.spawn(softdevice_task(sd))); - unwrap!(executor.spawn(bluetooth_task(sd, peripheral::Config::default()))); - - loop { - executor.run(); - cortex_m::asm::wfe(); - } + let executor = EXECUTOR.put(Executor::new()); + executor.run(|spawner| { + unwrap!(spawner.spawn(softdevice_task(sd))); + unwrap!(spawner.spawn(bluetooth_task(sd, peripheral::Config::default()))); + }); } diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs index e5f3e3c..7440bd2 100644 --- a/examples/src/bin/ble_l2cap_central.rs +++ b/examples/src/bin/ble_l2cap_central.rs @@ -174,12 +174,9 @@ fn main() -> ! { let (sdp, p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); - let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); - unwrap!(executor.spawn(softdevice_task(sd))); - unwrap!(executor.spawn(ble_central_task(sd))); - - loop { - executor.run(); - cortex_m::asm::wfe(); - } + let executor = EXECUTOR.put(Executor::new()); + executor.run(|spawner| { + unwrap!(spawner.spawn(softdevice_task(sd))); + unwrap!(spawner.spawn(ble_central_task(sd))); + }); } diff --git a/examples/src/bin/ble_l2cap_peripheral.rs b/examples/src/bin/ble_l2cap_peripheral.rs index bc20437..54716af 100644 --- a/examples/src/bin/ble_l2cap_peripheral.rs +++ b/examples/src/bin/ble_l2cap_peripheral.rs @@ -12,7 +12,6 @@ use core::mem; use core::ptr::NonNull; use cortex_m_rt::entry; use defmt::{panic, *}; -use heapless::consts::*; use nrf_softdevice::ble; use nrf_softdevice::ble::{l2cap, peripheral, Connection}; @@ -30,7 +29,7 @@ async fn softdevice_task(sd: &'static Softdevice) { } #[task] -async fn bluetooth_task(sd: &'static Softdevice, config: peripheral::Config) { +async fn bluetooth_task(sd: &'static Softdevice) { info!("My address: {:?}", ble::get_address(sd)); #[rustfmt::skip] @@ -151,12 +150,9 @@ fn main() -> ! { let (sdp, p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); - let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); - unwrap!(executor.spawn(softdevice_task(sd))); - unwrap!(executor.spawn(bluetooth_task(sd, peripheral::Config::default()))); - - loop { - executor.run(); - cortex_m::asm::wfe(); - } + let executor = EXECUTOR.put(Executor::new()); + executor.run(|spawner| { + unwrap!(spawner.spawn(softdevice_task(sd))); + unwrap!(spawner.spawn(bluetooth_task(sd))); + }); } diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs index 50f31bf..cad1145 100644 --- a/examples/src/bin/ble_peripheral_onoff.rs +++ b/examples/src/bin/ble_peripheral_onoff.rs @@ -13,6 +13,7 @@ use defmt::{panic, *}; use embassy::executor::{task, Executor}; use embassy::util::Forever; use embassy_nrf::gpiote::{Gpiote, PortInputPolarity}; +use embassy_nrf::interrupt; use futures::pin_mut; use nrf52840_hal::gpio; @@ -77,7 +78,7 @@ async fn bluetooth_task(sd: &'static Softdevice, gpiote: pac::GPIOTE, p0: pac::P let server: FooService = unwrap!(gatt_server::register(sd)); let port0 = gpio::p0::Parts::new(p0); - let gpiote = Gpiote::new(gpiote); + let gpiote = Gpiote::new(gpiote, interrupt::take!(GPIOTE)); info!("Bluetooth is OFF"); info!("Press nrf52840-dk button 1 to enable, button 2 to disable"); @@ -165,12 +166,9 @@ fn main() -> ! { let (sdp, p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); - let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); - unwrap!(executor.spawn(softdevice_task(sd))); - unwrap!(executor.spawn(bluetooth_task(sd, p.GPIOTE, p.P0,))); - - loop { - executor.run(); - cortex_m::asm::wfe(); - } + let executor = EXECUTOR.put(Executor::new()); + executor.run(|spawner| { + unwrap!(spawner.spawn(softdevice_task(sd))); + unwrap!(spawner.spawn(bluetooth_task(sd, p.GPIOTE, p.P0,))); + }); } diff --git a/examples/src/bin/ble_scan.rs b/examples/src/bin/ble_scan.rs index 7250364..c8b71e3 100644 --- a/examples/src/bin/ble_scan.rs +++ b/examples/src/bin/ble_scan.rs @@ -109,12 +109,9 @@ fn main() -> ! { let (sdp, p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); - let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); - unwrap!(executor.spawn(softdevice_task(sd))); - unwrap!(executor.spawn(ble_task(sd))); - - loop { - executor.run(); - cortex_m::asm::wfe(); - } + let executor = EXECUTOR.put(Executor::new()); + executor.run(|spawner| { + unwrap!(spawner.spawn(softdevice_task(sd))); + unwrap!(spawner.spawn(ble_task(sd))); + }); } diff --git a/examples/src/bin/flash.rs b/examples/src/bin/flash.rs index 825a62b..1d765c7 100644 --- a/examples/src/bin/flash.rs +++ b/examples/src/bin/flash.rs @@ -42,12 +42,9 @@ fn main() -> ! { let (sdp, p) = take_peripherals(); let sd = Softdevice::enable(sdp, &Default::default()); - let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); - unwrap!(executor.spawn(softdevice_task(sd))); - unwrap!(executor.spawn(flash_task(sd))); - - loop { - executor.run(); - cortex_m::asm::wfe(); - } + let executor = EXECUTOR.put(Executor::new()); + executor.run(|spawner| { + unwrap!(spawner.spawn(softdevice_task(sd))); + unwrap!(spawner.spawn(flash_task(sd))); + }); } diff --git a/examples/src/bin/interrupts.rs b/examples/src/bin/interrupts.rs index 1c777b5..55c896c 100644 --- a/examples/src/bin/interrupts.rs +++ b/examples/src/bin/interrupts.rs @@ -92,12 +92,9 @@ fn main() -> ! { let (sdp, p) = take_peripherals(); let sd = Softdevice::enable(sdp, &Default::default()); - let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); - unwrap!(executor.spawn(softdevice_task(sd))); - unwrap!(executor.spawn(interrupt_task(sd))); - - loop { - executor.run(); - cortex_m::asm::wfe(); - } + let executor = EXECUTOR.put(Executor::new()); + executor.run(|spawner| { + unwrap!(spawner.spawn(softdevice_task(sd))); + unwrap!(spawner.spawn(interrupt_task(sd))); + }); } diff --git a/examples/src/bin/rtic.rs b/examples/src/bin/rtic.rs index 988b124..583325e 100644 --- a/examples/src/bin/rtic.rs +++ b/examples/src/bin/rtic.rs @@ -126,14 +126,11 @@ const APP: () = { let temp = unwrap!(temperature_celsius(&sd)); info!("{:i32}°C", temp.to_num::<i32>()); - let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); - unwrap!(executor.spawn(softdevice_task(sd))); - unwrap!(executor.spawn(bluetooth_task(sd))); - - loop { - executor.run(); - cortex_m::asm::wfe(); - } + let executor = EXECUTOR.put(Executor::new()); + executor.run(|spawner| { + unwrap!(spawner.spawn(softdevice_task(sd))); + unwrap!(spawner.spawn(bluetooth_task(sd))); + }); } #[task(binds = TIMER1, resources = [timer], priority = 1)] |