Skip to content

Commit 02178e0

Browse files
committed
Report the git version on start-up.
1 parent 655eb70 commit 02178e0

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ defmt = "0.2"
2727
defmt-rtt = "0.2"
2828
# Send panics to the debugger
2929
panic-probe = "0.2"
30+
# Fetches the BIOS version from git
31+
git-version = "0.3"
3032

3133
[features]
3234
default = [

src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ use defmt::*;
4242
use defmt_rtt as _;
4343
use embedded_hal::digital::v2::OutputPin;
4444
use embedded_time::rate::*;
45+
use git_version::git_version;
4546
use hal::clocks::Clock;
4647
use panic_probe as _;
4748
use pico;
@@ -62,6 +63,9 @@ use pico::hal::pac;
6263
#[used]
6364
pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER;
6465

66+
/// BIOS version
67+
const GIT_VERSION: &str = git_version!();
68+
6569
// -----------------------------------------------------------------------------
6670
// Types
6771
// -----------------------------------------------------------------------------
@@ -76,7 +80,7 @@ pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER;
7680
/// `.bss` and `.data` sections have been initialised.
7781
#[entry]
7882
fn main() -> ! {
79-
info!("Neotron BIOS starting...");
83+
info!("Neotron BIOS {} starting...", GIT_VERSION);
8084

8185
// Grab the singleton containing all the RP2040 peripherals
8286
let mut pac = pac::Peripherals::take().unwrap();

0 commit comments

Comments
 (0)