forked from cc90202/knx-pico
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
184 lines (163 loc) · 6.58 KB
/
Cargo.toml
File metadata and controls
184 lines (163 loc) · 6.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
[package]
name = "knx-pico"
version = "0.2.4"
edition = "2021"
license = "MIT OR Apache-2.0"
authors = ["Cristiano Chieppa"]
description = "KNXnet/IP protocol implementation for embedded systems"
repository = "https://github.com/cc90202/knx-pico"
homepage = "https://github.com/cc90202/knx-pico"
readme = "README.md"
keywords = ["knx", "knxnet-ip", "embedded", "no-std", "home-automation"]
categories = ["embedded", "no-std", "network-programming"]
exclude = [
"test_runner.py",
"check-all.sh",
".github/",
".claude/",
]
[lib]
name = "knx_pico"
path = "src/lib.rs"
[dependencies]
# Core library dependencies (no_std)
heapless = { version = "0.9.1", default-features = false }
# Optional dependencies for defmt logging
defmt = { version = "1.0.1", optional = true }
# Embassy dependencies (only for binary/examples)
# Using aimdb workspace's local embassy checkout to avoid version conflicts
embassy-sync = { path = "../embassy/embassy-sync", features = ["defmt"], optional = true }
embassy-executor = { path = "../embassy/embassy-executor", features = ["platform-cortex-m", "executor-thread", "executor-interrupt", "defmt"], optional = true }
embassy-time = { path = "../embassy/embassy-time", features = ["defmt", "defmt-timestamp-uptime"], optional = true }
embassy-futures = { path = "../embassy/embassy-futures", optional = true }
embassy-rp = { path = "../embassy/embassy-rp", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl", "rp235xa", "binary-info"], optional = true }
embassy-net = { path = "../embassy/embassy-net", features = ["defmt", "icmp", "tcp", "udp", "raw", "dhcpv4", "medium-ethernet", "dns"], optional = true }
embassy-usb-logger = { version = "0.6.0", optional = true }
# Hardware specific (only for RP2040 binary)
cyw43 = { version = "0.5.0", features = ["defmt", "firmware-logs"], optional = true }
cyw43-pio = { version = "0.8.0", features = ["defmt"], optional = true }
panic-persist = { version = "0.3.0", features = ["utf8"], optional = true }
defmt-rtt = { version = "1.0.0", optional = true }
cortex-m-rt = { version = "0.7.0", optional = true }
static_cell = { version = "2.1", optional = true }
log = { version = "0.4", optional = true }
critical-section = { version = "1.2.0", optional = true }
# Serialization support (optional)
serde = { version = "1.0.206", default-features = false, features = ["derive"], optional = true }
[features]
default = []
# Enable std support (for examples and applications)
std = []
# Enable defmt logging support
defmt = ["dep:defmt", "heapless/defmt"]
# Enable serde support
serde = ["dep:serde", "heapless/serde"]
# USB logger feature (alternative to defmt-rtt)
usb-logger = ["dep:embassy-usb-logger", "dep:log"]
# Feature for building the RP2040 binary with defmt-rtt (default)
embassy-rp = [
"dep:embassy-sync",
"dep:embassy-executor",
"dep:embassy-time",
"dep:embassy-futures",
"dep:embassy-rp",
"dep:embassy-net",
"dep:cyw43",
"dep:cyw43-pio",
"dep:panic-persist",
"dep:defmt",
"defmt",
"dep:defmt-rtt",
"dep:cortex-m-rt",
"dep:static_cell",
"dep:critical-section",
"heapless/defmt",
]
# Feature for building the RP2040 binary with USB logger
# Note: defmt-rtt is still needed because dependencies (cyw43, embassy-rp) use defmt internally
embassy-rp-usb = [
"dep:embassy-sync",
"dep:embassy-executor",
"dep:embassy-time",
"dep:embassy-futures",
"dep:embassy-rp",
"dep:embassy-net",
"dep:cyw43",
"dep:cyw43-pio",
"dep:panic-persist",
"dep:defmt",
"defmt",
"dep:defmt-rtt",
"dep:cortex-m-rt",
"dep:static_cell",
"dep:critical-section",
"usb-logger",
"heapless/defmt",
]
[lints.rust]
# Compiler lints for code quality
ambiguous_negative_literals = "warn"
missing_debug_implementations = "warn"
redundant_imports = "warn"
redundant_lifetimes = "warn"
trivial_numeric_casts = "warn"
unsafe_op_in_unsafe_fn = "warn"
unused_lifetimes = "warn"
[lints.clippy]
# Enable all major lint categories
cargo = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
correctness = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
perf = { level = "warn", priority = -1 }
style = { level = "warn", priority = -1 }
suspicious = { level = "warn", priority = -1 }
# Restriction lints for consistency and quality
allow_attributes_without_reason = "warn"
as_pointer_underscore = "warn"
assertions_on_result_states = "warn"
clone_on_ref_ptr = "warn"
deref_by_slicing = "warn"
disallowed_script_idents = "warn"
empty_drop = "warn"
empty_enum_variants_with_brackets = "warn"
empty_structs_with_brackets = "warn"
fn_to_numeric_cast_any = "warn"
if_then_some_else_none = "warn"
map_err_ignore = "warn"
redundant_type_annotations = "warn"
renamed_function_params = "warn"
semicolon_outside_block = "warn"
undocumented_unsafe_blocks = "warn"
unnecessary_safety_comment = "warn"
unnecessary_safety_doc = "warn"
unneeded_field_pattern = "warn"
unused_result_ok = "warn"
# Custom opt-outs for embedded/no_std context
missing_errors_doc = "allow" # Many embedded functions don't need error docs
missing_panics_doc = "allow" # Panics are rare and documented where needed
module_name_repetitions = "allow" # Common pattern in protocol code
must_use_candidate = "allow" # Too noisy for builder patterns
cast_possible_truncation = "allow" # Common in protocol parsing, checked manually
cast_sign_loss = "allow" # Common in protocol parsing, checked manually
cast_possible_wrap = "allow" # Common in protocol parsing, checked manually
similar_names = "allow" # Protocol fields have similar names by design
too_many_lines = "allow" # Some protocol parsers are legitimately long
struct_excessive_bools = "allow" # Control fields have multiple bools by design
inline_always = "allow" # Hot-path optimizations for embedded performance
cast_precision_loss = "allow" # DPT conversion math requires precision trade-offs
# Workspace-level lint opt-outs (library used in workspace)
cargo_common_metadata = "allow" # Metadata warnings from parent workspace not applicable
redundant_feature_names = "allow" # Feature naming follows semantic conventions for this library
[package.metadata.docs.rs]
# Build documentation without hardware-specific features
default-target = "x86_64-unknown-linux-gnu"
targets = []
# Only document the core library features
features = ["defmt", "serde"]
# Don't build examples that require embedded hardware
no-default-features = false
[package.metadata.embassy]
build = [
{ target = "thumbv8m.main-none-eabihf" }
]