Skip to content

Commit c1c97ba

Browse files
committed
Make MCU-specific crate globals optional
1 parent 0d85de9 commit c1c97ba

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Build documentation (atmega-hal)
2323
run: cd mcu/atmega-hal/ && cargo doc --features atmega328p
2424
- name: Build documentation (attiny-hal)
25-
run: cd mcu/attiny-hal/ && cargo doc --features attiny85
25+
run: cd mcu/attiny-hal/ && cargo doc --features docsrs
2626
- name: Deploy to GH-Pages
2727
uses: peaceiris/actions-gh-pages@v4
2828
with:

mcu/attiny-hal/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ critical-section-impl = ["avr-device/critical-section-impl"]
2424
# Allow certain downstream crates to overwrite the device selection error by themselves.
2525
disable-device-selection-error = []
2626

27-
# We must select a microcontroller to build on docs.rs
28-
docsrs = ["attiny85"]
27+
default = []
28+
all = ["attiny84", "attiny85", "attiny88", "attiny167", "attiny2313", "no-globals"]
29+
docsrs = ["all"]
2930

3031
_peripheral-adc = []
3132
_peripheral-spi = []
3233
_peripheral-simple-pwm = []
34+
no-globals = []
35+
3336

3437
[dependencies]
3538
avr-hal-generic = { path = "../../avr-hal-generic/" }

mcu/attiny-hal/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ pub mod attiny85;
4444
#[cfg(feature = "attiny88")]
4545
pub mod attiny88;
4646

47+
#[cfg(not(feature = "no-globals"))]
4748
mod globals;
49+
#[cfg(not(feature = "no-globals"))]
4850
pub use globals::*;

0 commit comments

Comments
 (0)