@@ -154,8 +154,8 @@ struct Pins {
154154// Static and Const Data
155155// -----------------------------------------------------------------------------
156156
157- /// The BIOS version string
158- static BIOS_VERSION : & str = concat ! ( "Neotron Pico BIOS version " , env!( "BIOS_VERSION " ) , "\0 " ) ;
157+ /// Version string auto-generated by git.
158+ static VERSION : & str = include_str ! ( concat!( env!( "OUT_DIR " ) , "/version.txt" ) ) ;
159159
160160/// Ensures we always send a unique read request
161161static USE_ALT : UseAlt = UseAlt :: new ( ) ;
@@ -261,8 +261,8 @@ fn main() -> ! {
261261 // Needed by the clock setup
262262 let mut watchdog = hal:: watchdog:: Watchdog :: new ( pp. WATCHDOG ) ;
263263
264- // BIOS_VERSION has a trailing `\0` as that is what the BIOS/OS API requires.
265- info ! ( "{} starting..." , & BIOS_VERSION [ 0 .. BIOS_VERSION . len ( ) - 1 ] ) ;
264+ // VERSION has a trailing `\0` as that is what the BIOS/OS API requires.
265+ info ! ( "Neotron BIOS {} starting..." , VERSION . trim_matches ( '\0' ) ) ;
266266
267267 // Run at 126 MHz SYS_PLL, 48 MHz, USB_PLL. This is important, we as clock
268268 // the PIO at ÷ 5, to give 25.2 MHz (which is close enough to the 25.175
@@ -827,7 +827,7 @@ fn sign_on() {
827827
828828 tc. move_to ( 0 , 0 ) ;
829829
830- writeln ! ( & tc, "{}" , & BIOS_VERSION [ 0 .. BIOS_VERSION . len ( ) - 1 ] ) . unwrap ( ) ;
830+ writeln ! ( & tc, "Neotron Pico BIOS {}" , VERSION . trim_matches ( '\0' ) ) . unwrap ( ) ;
831831 write ! ( & tc, "{}" , LICENCE_TEXT ) . unwrap ( ) ;
832832
833833 let bmc_ver = critical_section:: with ( |cs| {
@@ -879,7 +879,7 @@ pub extern "C" fn api_version_get() -> common::Version {
879879/// a Rust string. It is unspecified as to whether the string is located
880880/// in Flash ROM or RAM (but it's likely to be Flash ROM).
881881pub extern "C" fn bios_version_get ( ) -> common:: ApiString < ' static > {
882- common:: ApiString :: new ( BIOS_VERSION )
882+ common:: ApiString :: new ( VERSION )
883883}
884884
885885/// Get information about the Serial ports in the system.
0 commit comments