Skip to content

Commit

Permalink
merge everything from accidental new project doing the same thing
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffdudds committed Oct 7, 2024
1 parent 8ff8d2e commit 918d9af
Show file tree
Hide file tree
Showing 17 changed files with 487 additions and 218 deletions.
23 changes: 10 additions & 13 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
[build]
target = "xtensa-esp32-espidf"

[target.xtensa-esp32-espidf]
linker = "ldproxy"
# runner = "espflash --monitor" # Select this runner for espflash v1.x.x
runner = "espflash flash --monitor" # Select this runner for espflash v2.x.x
rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110
[target.xtensa-esp32-none-elf]
runner = "espflash flash --monitor"

[unstable]
build-std = ["std", "panic_abort"]

[env]
MCU="esp32"
# Note: this variable is not used by the pio builder (`cargo build --features pio`)
ESP_IDF_VERSION = "v5.1.1"
ESP_LOGLEVEL = "INFO"

[build]
rustflags = ["-C", "link-arg=-nostartfiles"]

target = "xtensa-esp32-none-elf"

[unstable]
build-std = ["core"]
62 changes: 0 additions & 62 deletions .devcontainer/Dockerfile

This file was deleted.

38 changes: 14 additions & 24 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"name": "chicken_coop_rs",
// Select between image and build propieties to pull or build the image.
// "image": "docker.io/espressif/idf-rust:esp32_latest",
"build": {
"dockerfile": "Dockerfile",
"args": {
"CONTAINER_USER": "esp",
"CONTAINER_GROUP": "esp",
"ESP_BOARD": "esp32"
}
},
"image": "espressif/idf-rust:esp32_latest",
"customizations": {
"vscode": {
"settings": {
Expand All @@ -28,22 +18,22 @@
}
},
"extensions": [
"ms-azuretools.vscode-docker",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"mhutchie.git-graph",
"albert.TabOut",
"serayuzgur.crates",
"mutantdino.resourcemonitor",
"yzhang.markdown-all-in-one",
"ms-vscode.cpptools",
"actboy168.tasks",
"Wokwi.wokwi-vscode",
"albert.TabOut"
],
}
},
"forwardPorts": [
3333,
8000
],
"workspaceMount": "source=${localWorkspaceFolder},target=/home/esp/chicken_coop_rs,type=bind,consistency=cached",
"workspaceFolder": "/home/esp/chicken_coop_rs"
"tamasfe.even-better-toml"
]
},
"forwardPorts": [
8000,
3333
],
// "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/chicken-coop-rs,type=bind,consistency=cached",
"workspaceFolder": "/workspaces/chicken-coop-rs"
}
}
8 changes: 4 additions & 4 deletions .github/workflows/rust_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ jobs:
- command: fmt
args: --all -- --check --color always
- command: clippy
args: --all-targets --all-features --workspace -- -D warnings
args: --all-features --workspace -- -D warnings
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable caching
uses: Swatinem/rust-cache@v2
- name: Setup Rust
uses: esp-rs/[email protected]
with:
default: true
buildtargets: esp32
ldproxy: true
ldproxy: false
- name: Enable caching
uses: Swatinem/rust-cache@v2
- name: Run command
run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }}
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,18 @@ Cargo.lock
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
*.pdb

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"rust-analyzer.check.allTargets": false,
// "rust-analyzer.check.noDefaultFeatures": true,
// "rust-analyzer.cargo.noDefaultFeatures": true,
// "rust-analyzer.showUnlinkedFileNotification": false,
// "rust-analyzer.cargo.target": "thumbv7em-none-eabi",
// "rust-analyzer.linkedProjects": [
// "Cargo.toml"
// ]
}
8 changes: 5 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{
"label": "Build",
"type": "shell",
"command": "scripts/build.sh ${input:buildMode}",
"command": "scripts/build.sh release",
// "command": "scripts/build.sh ${input:buildMode}",
"options": {
"cwd": "${workspaceFolder}"
},
Expand All @@ -16,7 +17,8 @@
{
"label": "Build & Flash",
"type": "shell",
"command": "scripts/flash.sh ${input:buildMode}",
"command": "scripts/flash.sh release",
// "command": "scripts/flash.sh ${input:buildMode}",
"options": {
"cwd": "${workspaceFolder}"
},
Expand All @@ -38,4 +40,4 @@
"default": "release"
}
]
}
}
78 changes: 47 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,53 @@
[package]
name = "chicken-coop-rs"
name = "chicken-coop"
version = "0.1.0"
authors = ["geoffdudds <[email protected]>"]
authors = ["geoff.dudds <[email protected]>"]
edition = "2021"
resolver = "2"
rust-version = "1.71"

[profile.release]
opt-level = "s"

[profile.dev]
debug = true # Symbols are nice and they don't increase the size on Flash
opt-level = "z"

[features]
default = ["std", "embassy", "esp-idf-svc/native"]

pio = ["esp-idf-svc/pio"]
std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"]
alloc = ["esp-idf-svc/alloc"]
nightly = ["esp-idf-svc/nightly"]
experimental = ["esp-idf-svc/experimental"]
embassy = [
"esp-idf-svc/embassy-sync",
"esp-idf-svc/critical-section",
"esp-idf-svc/embassy-time-driver",
]
license = "MIT OR Apache-2.0"

[dependencies]
log = { version = "0.4", default-features = false }
esp-idf-svc = { version = "0.47.1", default-features = false }
sunrise-next = "1.2"
chrono = "0.4.31"
sunrise-next = { version = "*", features = ["no-std"] }
embassy-executor = { version = "0.6.0" }
embassy-time = { version = "0.3.2", features = ["generic-queue"] }
esp-hal-embassy = { version = "*", features = ["esp32"] }
esp-println = { version = "0.11.0", features = ["esp32", "log"] }
esp-backtrace = { version = "0.14.0", features = [
"esp32",
"exception-handler",
"panic-handler",
"println",
] }
esp-hal = { version = "0.20.1", features = ["esp32"] }
log = { version = "0.4.21" }
embedded-io = "0.6.1"
esp-wifi = { version = "0.9.1", features = [
"esp32",
"phy-enable-usb",
"utils",
"wifi",
] }
heapless = { version = "0.8.0", default-features = false }
smoltcp = { version = "0.11.0", default-features = false, features = [
"medium-ethernet",
"proto-dhcpv4",
"proto-igmp",
"proto-ipv4",
"socket-dhcpv4",
"socket-icmp",
"socket-raw",
"socket-tcp",
"socket-udp",
] }
[profile.dev]
# Rust debug is too slow.
# For debug builds always builds with some optimization
opt-level = "s"

[build-dependencies]
embuild = "0.31.3"
[profile.release]
codegen-units = 1 # LLVM can perform better optimizations using a single thread
debug = 2
debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 's'
overflow-checks = false
Loading

0 comments on commit 918d9af

Please sign in to comment.