Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i2c_driver should use a counted ringbuf #1660

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions drv/stm32xx-i2c-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,37 @@ build-util = { path = "../../build/util" }
build-i2c = { path = "../../build/i2c" }

[features]
h743 = ["stm32h7/stm32h743", "drv-stm32xx-i2c/h743", "drv-stm32xx-sys-api/h743", "build-i2c/h743", "panic-messages"]
h753 = ["stm32h7/stm32h753", "drv-stm32xx-i2c/h753", "drv-stm32xx-sys-api/h753", "build-i2c/h753", "panic-messages"]
g031 = ["stm32g0/stm32g031", "drv-stm32xx-i2c/g031", "drv-stm32xx-sys-api/g031", "build-i2c/g031", "ringbuf/disabled", "panic-messages"]
g030 = ["stm32g0/stm32g030", "drv-stm32xx-i2c/g030", "drv-stm32xx-sys-api/g030", "build-i2c/g030", "ringbuf/disabled"]
h743 = [
"stm32h7/stm32h743",
"drv-stm32xx-i2c/h743",
"drv-stm32xx-sys-api/h743",
"build-i2c/h743",
"panic-messages",
]
h753 = [
"stm32h7/stm32h753",
"drv-stm32xx-i2c/h753",
"drv-stm32xx-sys-api/h753",
"build-i2c/h753",
"panic-messages",
]
g031 = [
"stm32g0/stm32g031",
"drv-stm32xx-i2c/g031",
"drv-stm32xx-sys-api/g031",
"build-i2c/g031",
"ringbuf-disabled",
"panic-messages",
]
g030 = [
"stm32g0/stm32g030",
"drv-stm32xx-i2c/g030",
"drv-stm32xx-sys-api/g030",
"build-i2c/g030",
"ringbuf-disabled",
]

ringbuf-disabled = ["ringbuf/disabled", "ringbuf/counters-disabled"]
panic-messages = ["userlib/panic-messages"]
no-ipc-counters = ["idol/no-counters"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It occurs to me that, since some of the target features disable ringbufs and counters, we should maybe just have the features for those targets also disable IPC counters, rather than explicitly setting the no-ipc-counters feature in the app.toml for those targets...but that's something to do separately.


Expand Down
4 changes: 2 additions & 2 deletions drv/stm32xx-i2c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ enum Trace {
WaitTx,
BusySleep,
Stop,
RepeatedStart(bool),
RepeatedStart(#[count(children)] bool),
LostInterrupt,
Panic(Register, u32),
#[count(skip)]
None,
}

ringbuf!(Trace, 48, Trace::None);
counted_ringbuf!(Trace, 48, Trace::None);

impl I2cMux<'_> {
/// A convenience routine to translate an error induced by in-band
Expand Down
Loading