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

[EXTREMELY WIP] integrate calliope #318

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
2,537 changes: 1,570 additions & 967 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions platforms/allwinner-d1/d1-core/src/drivers/spim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use kernel::{
comms::oneshot::Reusable,
maitake::sync::WaitCell,
mnemos_alloc::containers::FixedVec,
registry::{self, uuid, Envelope, KernelHandle, Message, RegisteredDriver, ReplyTo, Uuid},
registry::{self, uuid, Envelope, KernelHandle, Message, ReplyTo, Service, Uuid},
Kernel,
};

Expand Down Expand Up @@ -89,7 +89,7 @@ pub unsafe fn kernel_spim1(mut spi1: SPI_DBI, ccu: &mut Ccu, gpio: &mut GPIO) ->
Spim1 { _x: () }
}

impl RegisteredDriver for SpiSender {
impl Service for SpiSender {
type Request = SpiSenderRequest;
type Response = SpiSenderResponse;
type Error = SpiSenderError;
Expand Down
4 changes: 2 additions & 2 deletions platforms/beepy/src/i2c_puppet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use kernel::{
embedded_hal_async::i2c::{self, I2c},
maitake::sync::WaitCell,
mnemos_alloc::containers::FixedVec,
registry::{self, Envelope, KernelHandle, RegisteredDriver},
registry::{self, Envelope, KernelHandle, Service},
retry::{AlwaysRetry, ExpBackoff, Retry, WithMaxRetries},
services::{
i2c::{I2cClient, I2cError, I2cService},
Expand All @@ -31,7 +31,7 @@ use uuid::{uuid, Uuid};
////////////////////////////////////////////////////////////////////////////////
pub struct I2cPuppetService;

impl RegisteredDriver for I2cPuppetService {
impl Service for I2cPuppetService {
type Request = Request;
type Response = Response;
type Error = Error;
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2023-08-08"
channel = "nightly-2023-10-28"
profile = "minimal"
components = [
"clippy",
Expand Down
6 changes: 6 additions & 0 deletions source/alloc/src/containers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ impl<T> Arc<T> {
pub unsafe fn increment_strong_count(ptr: *const T) {
alloc::sync::Arc::increment_strong_count(ptr)
}

#[inline(always)]
#[must_use]
pub fn into_inner(self) -> alloc::sync::Arc<T> {
self.inner
}
}

impl<T> Clone for Arc<T> {
Expand Down
5 changes: 5 additions & 0 deletions source/kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ serial-trace = ["mnemos-trace-proto", "tracing-core", "tracing-serde-structured"

[dependencies]

[dependencies.calliope]
git = "https://github.com/tosc-rs/mgnp"
branch = "eliza/pub-reqresp"
features = ["alloc"]

[dependencies.futures]
version = "0.3.21"
features = ["async-await"]
Expand Down
1 change: 1 addition & 0 deletions source/kernel/src/comms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
pub mod bbq;
pub mod kchannel;
pub mod oneshot;
pub use calliope::tricky_pipe::{bidi, mpsc};
Loading