featurify all BIO modules

the reason we do this is that if we don't switch off library
modules, they are compiled in and just become dead code in the
OS image. with enough modules, this will eventually become
a significant drag on binary size.
This commit is contained in:
bunnie 2026-02-20 23:53:09 +08:00
parent 85a9579626
commit 905939d8f1
3 changed files with 21 additions and 0 deletions

View file

@ -12,3 +12,19 @@ bao1x-hal = { path = "../../libs/bao1x-hal", features = ["std"] }
bao1x-api = { path = "../../libs/bao1x-api" }
bitbybit = "1.4.0"
arbitrary-int = "1.2"
[features]
# C generated
c-math-test = []
# hand coded
mac-demo = []
ws2812 = []
captouch = []
av-trng = []
# This shouldn't be a default - but provided so that code automation
# targets can easily crawl the whole library with a single flag.
all = ["c-math-test", "mac-demo", "ws2812", "captouch", "av-trng"]
default = []

View file

@ -1 +1,2 @@
#[cfg(feature = "c-math-test")]
pub mod math_test;

View file

@ -33,8 +33,12 @@
//! Core ID & debug:
//! - x31 r/- [31:30] -> core ID; [29:0] -> cpu clocks since reset
#[cfg(feature = "av-trng")]
pub mod av_trng;
pub mod c;
#[cfg(feature = "captouch")]
pub mod captouch;
#[cfg(feature = "mac-demo")]
pub mod mac_demo;
#[cfg(feature = "ws2812")]
pub mod ws2812;