diff --git a/README.md b/README.md index 3caed6e0..e4f37790 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This branch is dedicated to maintaining updating Novusk v3, [this issue](https://github.com/NathanMcMillan54/novusk/issues/14) has a list of things that are needed in this current major version and in future major versions. -Join the [Discord](https://discord.gg/hcVcCugVFP) server for updates on the kernel and projects for the kernel. +Join the [Discord](https://discord.gg/hcVcCugVFP) server for updates and discussion related to the kernel. Also, this is Jared: ```commandline diff --git a/drivers/rpi/src/lib.rs b/drivers/rpi/src/lib.rs index 44313834..01f0b4f6 100644 --- a/drivers/rpi/src/lib.rs +++ b/drivers/rpi/src/lib.rs @@ -30,28 +30,6 @@ pub use rpi2::registers::*; #[cfg(feature = "rpi3")] pub use rpi3::*; - -#[cfg(all(feature = "rpi3", not(feature = "rpi2")))] -#[no_mangle] -// #[export_name = "device_init"] -pub extern "C" fn device_init() -> (Result<(), &'static str>, &'static str) { - let mut pi = Rpi3::new(); - pi.init(); - - if pi.error.0 { - return (Err(pi.error.1), "RPi 3"); - } else { return (Ok(()), "RPi 3"); } -} - -#[cfg(all(feature = "rpi2", not(feature = "rpi3")))] -#[no_mangle] -pub extern "C" fn device_init() -> (Result<(), &'static str>, &'static str) { - let mut pi = Rpi2::new(); - pi.init(); - - return (Ok(()), "RPi 2"); -} - fn irq_init() { } diff --git a/drivers/rpi/src/rpi2/mod.rs b/drivers/rpi/src/rpi2/mod.rs index deaa00f8..d38a0993 100644 --- a/drivers/rpi/src/rpi2/mod.rs +++ b/drivers/rpi/src/rpi2/mod.rs @@ -7,6 +7,14 @@ pub mod registers; pub mod mb; pub mod uart; +#[no_mangle] +pub extern "C" fn device_init() -> (Result<(), &'static str>, &'static str) { + let mut pi = Rpi2::new(); + pi.init(); + + return (Ok(()), "RPi 2"); +} + extern "C" { static mut BOARD: Board; fn rpi2_kernel_init(); diff --git a/drivers/rpi/src/rpi3/mod.rs b/drivers/rpi/src/rpi3/mod.rs index 8737a5fd..dbe955fd 100644 --- a/drivers/rpi/src/rpi3/mod.rs +++ b/drivers/rpi/src/rpi3/mod.rs @@ -6,6 +6,17 @@ use mailbox::MailBox; pub mod gpio; pub mod led; +#[no_mangle] +// #[export_name = "device_init"] +pub extern "C" fn device_init() -> (Result<(), &'static str>, &'static str) { + let mut pi = Rpi3::new(); + pi.init(); + + if pi.error.0 { + return (Err(pi.error.1), "RPi 3"); + } else { return (Ok(()), "RPi 3"); } +} + pub struct Rpi3 { pub error: (bool, &'static str), pub gpio: gpio::Rpi3Gpio,