Move blinky and temp/rh measurement into separate binaries
This commit is contained in:
parent
c785894ef9
commit
b71a23cd67
@ -19,7 +19,7 @@ embedded-storage-async = "0.4.1"
|
|||||||
fixed = "1.28.0"
|
fixed = "1.28.0"
|
||||||
futures = { version = "0.3.31", default-features = false }
|
futures = { version = "0.3.31", default-features = false }
|
||||||
heapless = "0.8.0"
|
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"
|
nrf-softdevice-s112 = "0.1.2"
|
||||||
panic-probe = { version = "0.3.2", features = ["print-defmt"] }
|
panic-probe = { version = "0.3.2", features = ["print-defmt"] }
|
||||||
static_cell = "2.1.0"
|
static_cell = "2.1.0"
|
||||||
|
|||||||
2
memory.x
2
memory.x
@ -3,6 +3,6 @@ MEMORY
|
|||||||
/* NOTE 1 K = 1 KiB = 1024 bytes */
|
/* NOTE 1 K = 1 KiB = 1024 bytes */
|
||||||
/* These values correspond to the NRF52810 with SoftDevice S112 v7.x */
|
/* These values correspond to the NRF52810 with SoftDevice S112 v7.x */
|
||||||
FLASH : ORIGIN = 0x00000000 + 100K, LENGTH = 192K - 100K
|
FLASH : ORIGIN = 0x00000000 + 100K, LENGTH = 192K - 100K
|
||||||
RAM : ORIGIN = 0x20000000 + 6K, LENGTH = 24K - 6K
|
RAM : ORIGIN = 0x20000000 + 0x24b8, LENGTH = 24K - 0x24b8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
24
src/bin/blinky.rs
Normal file
24
src/bin/blinky.rs
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
@ -47,29 +43,3 @@ async fn main(_spawner: Spawner) {
|
|||||||
Timer::after_millis(50).await;
|
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");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
Loading…
Reference in New Issue
Block a user