Add initial project structure and implement async main for Pico W

This commit is contained in:
2026-06-04 14:46:22 -05:00
parent 688e5b404b
commit b1d9594b25
15 changed files with 79 additions and 9 deletions
+6 -3
View File
@@ -1,7 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Flash Pico W" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run --release" />
<option name="buildProfileId" value="release" />
<option name="command" value="run" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<envs />
<option name="emulateTerminal" value="true" />
<option name="channel" value="DEFAULT" />
<option name="requiredFeatures" value="true" />
@@ -9,7 +11,8 @@
<option name="withSudo" value="false" />
<option name="buildTarget" value="REMOTE" />
<option name="backtrace" value="SHORT" />
<envs />
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
<method v="2" />
</configuration>
</component>
</component>
Generated
+33
View File
@@ -181,6 +181,15 @@ dependencies = [
"syn 2.0.117",
]
[[package]]
name = "cortex-m-semihosting"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c23234600452033cc77e4b761e740e02d2c4168e11dbf36ab14a0f58973592b0"
dependencies = [
"cortex-m",
]
[[package]]
name = "crc-any"
version = "2.5.0"
@@ -329,6 +338,29 @@ dependencies = [
"defmt 0.3.100",
]
[[package]]
name = "defmt-test"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c1e67ff0e1c6b1a9540a1a3e04454658faacdd188c91987c444d56e469d7dea"
dependencies = [
"cortex-m-rt",
"cortex-m-semihosting",
"defmt 0.3.100",
"defmt-test-macros",
]
[[package]]
name = "defmt-test-macros"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe5520fd36862f281c026abeaab153ebbc001717c29a9b8e5ba9704d8f3a879d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "diff"
version = "0.1.13"
@@ -1368,6 +1400,7 @@ dependencies = [
"cyw43-pio",
"defmt 0.3.100",
"defmt-rtt",
"defmt-test",
"embassy-executor",
"embassy-net",
"embassy-rp",
+11
View File
@@ -18,5 +18,16 @@ cortex-m-rt = "0.7.5"
panic-probe = { version = "0.3.2", features = ["print-defmt"] }
defmt = "0.3.10"
defmt-rtt = "0.4.1"
defmt-test = "0.3.0"
static_cell = "2.1.0"
portable-atomic = { version = "1.11.0", features = ["critical-section"] }
[lib]
harness = false
[[bin]]
name = "rusty-dog"
test = false
path = "src/main.rs"
[[test]]
name = "example_test"
harness = false
View File
View File
View File
View File
+4
View File
@@ -0,0 +1,4 @@
#![no_std]
// Logic and hardware-independent code goes here.
// This allows you to run `cargo test` on your host machine.
+10 -2
View File
@@ -1,3 +1,11 @@
fn main() {
println!("Hello from Rust skeletal app. Edit src/main.rs to get started!");
#![no_std]
#![no_main]
use defmt_rtt as _;
use panic_probe as _;
use embassy_executor::Spawner;
#[embassy_executor::main]
async fn main(_spawner: Spawner) {
defmt::info!("Hello from the Pico W!");
}
View File
+2
View File
@@ -0,0 +1,2 @@
mod mqtt;
mod wifi;
View File
View File
+13
View File
@@ -0,0 +1,13 @@
#![no_std]
#![no_main]
use defmt_rtt as _;
use panic_probe as _;
#[defmt_test::tests]
mod tests {
#[test]
fn it_works() {
assert!(true);
}
}
-4
View File
@@ -1,4 +0,0 @@
#[test]
fn test_sample() {
assert_eq!(1, 1);
}