diff --git a/Cargo.toml b/Cargo.toml index 9a87437..394d943 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ embedded-storage-async = "0.4.1" fixed = "1.28.0" futures = { version = "0.3.31", default-features = false } heapless = "0.8.0" -nrf-softdevice = { version = "0.1.0", features = ["defmt", "ble-peripheral", "critical-section-impl", "nrf52810", "s112"] } +nrf-softdevice = { version = "0.1.0", features = ["defmt", "ble-peripheral", "ble-gatt-server", "critical-section-impl", "nrf52810", "s112"] } nrf-softdevice-s112 = "0.1.2" panic-probe = { version = "0.3.2", features = ["print-defmt"] } static_cell = "2.1.0" diff --git a/memory.x b/memory.x index 91483e8..8db0528 100644 --- a/memory.x +++ b/memory.x @@ -3,6 +3,6 @@ MEMORY /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the NRF52810 with SoftDevice S112 v7.x */ FLASH : ORIGIN = 0x00000000 + 100K, LENGTH = 192K - 100K - RAM : ORIGIN = 0x20000000 + 6K, LENGTH = 24K - 6K + RAM : ORIGIN = 0x20000000 + 0x24b8, LENGTH = 24K - 0x24b8 } diff --git a/src/bin/blinky.rs b/src/bin/blinky.rs new file mode 100644 index 0000000..1083a3d --- /dev/null +++ b/src/bin/blinky.rs @@ -0,0 +1,24 @@ +#![no_std] +#![no_main] + +use defmt::info; +use embassy_executor::Spawner; +use embassy_nrf::gpio::{Level, Output, OutputDrive}; +use embassy_time::Timer; +use nrf_softdevice::{raw, Softdevice}; +use {defmt_rtt as _, panic_probe as _}; + +#[embassy_executor::main] +async fn main(_spawner: Spawner) { + let p = embassy_nrf::init(Default::default()); + let mut led = Output::new(p.P0_20, Level::Low, OutputDrive::Standard); + + info!("Starting blinky"); + + loop { + led.set_high(); + Timer::after_millis(300).await; + led.set_low(); + Timer::after_millis(300).await; + } +} diff --git a/src/main.rs b/src/bin/temp_rh_measurement.rs similarity index 61% rename from src/main.rs rename to src/bin/temp_rh_measurement.rs index ac85871..03b9482 100644 --- a/src/main.rs +++ b/src/bin/temp_rh_measurement.rs @@ -1,7 +1,3 @@ -//! Example on how to read a 24C/24LC i2c eeprom. -//! -//! Connect SDA to P0.03, SCL to P0.04 - #![no_std] #![no_main] @@ -47,29 +43,3 @@ async fn main(_spawner: Spawner) { Timer::after_millis(50).await; } } - -// #![no_std] -// #![no_main] -// -// use defmt::info; -// use embassy_executor::Spawner; -// use embassy_nrf::gpio::{Level, Output, OutputDrive}; -// use embassy_time::Timer; -// use nrf_softdevice::{raw, Softdevice}; -// use {defmt_rtt as _, panic_probe as _}; -// -// #[embassy_executor::main] -// async fn main(_spawner: Spawner) { -// let p = embassy_nrf::init(Default::default()); -// let mut led = Output::new(p.P0_20, Level::Low, OutputDrive::Standard); -// -// info!("Starting blinky"); -// -// loop { -// led.set_high(); -// Timer::after_millis(300).await; -// led.set_low(); -// Timer::after_millis(300).await; -// info!("Blinked"); -// } -// }