Skip to content

Commit

Permalink
Merge pull request #3981 from lschuermann/dev/nrf52840dk-lib-bin-crate
Browse files Browse the repository at this point in the history
boards/nrf52840dk: split into lib+bin crates for configuration/tutorial boards
  • Loading branch information
bradjc committed May 10, 2024
2 parents 26b8d64 + aa4d7a6 commit dbd491e
Show file tree
Hide file tree
Showing 6 changed files with 1,045 additions and 931 deletions.
7 changes: 7 additions & 0 deletions boards/nordic/nrf52840dk/Cargo.toml
Expand Up @@ -9,6 +9,13 @@ authors.workspace = true
build = "../../build.rs"
edition.workspace = true

[lib]
name = "nrf52840dk_lib"

[[bin]]
name = "nrf52840dk"
path = "src/main.rs"

[dependencies]
components = { path = "../../components" }
cortexm4 = { path = "../../../arch/cortex-m4" }
Expand Down
22 changes: 11 additions & 11 deletions boards/nordic/nrf52840dk/src/io.rs
Expand Up @@ -3,20 +3,11 @@
// Copyright Tock Contributors 2022.

use core::fmt::Write;
use core::panic::PanicInfo;
use core::ptr::addr_of;
use core::ptr::addr_of_mut;
use kernel::debug;
use kernel::debug::IoWrite;
use kernel::hil::led;
use kernel::hil::uart;
use kernel::hil::uart::Configure;
use nrf52840::gpio::Pin;
use nrf52840::uart::{Uarte, UARTE0_BASE};

use crate::CHIP;
use crate::PROCESSES;
use crate::PROCESS_PRINTER;
use nrf52840::uart::{Uarte, UARTE0_BASE};

enum Writer {
WriterUart(/* initialized */ bool),
Expand Down Expand Up @@ -99,7 +90,16 @@ impl IoWrite for Writer {
#[no_mangle]
#[panic_handler]
/// Panic handler
pub unsafe fn panic_fmt(pi: &PanicInfo) -> ! {
pub unsafe fn panic_fmt(pi: &core::panic::PanicInfo) -> ! {
use core::ptr::{addr_of, addr_of_mut};
use kernel::debug;
use kernel::hil::led;
use nrf52840::gpio::Pin;

use crate::CHIP;
use crate::PROCESSES;
use crate::PROCESS_PRINTER;

// The nRF52840DK LEDs (see back of board)
let led_kernel_pin = &nrf52840::gpio::GPIOPin::new(Pin::P0_13);
let led = &mut led::LedLow::new(led_kernel_pin);
Expand Down

0 comments on commit dbd491e

Please sign in to comment.