File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ use logger::BufferLogger;
18
18
extern {
19
19
fn putchar ( c : libc:: c_int ) -> libc:: c_int ;
20
20
fn readchar ( ) -> libc:: c_char ;
21
+ fn readchar_nonblock ( ) -> libc:: c_int ;
21
22
}
22
23
23
24
#[ macro_export]
@@ -100,11 +101,23 @@ pub unsafe extern fn rust_main() {
100
101
static mut LOG_BUFFER : [ u8 ; 65536 ] = [ 0 ; 65536 ] ;
101
102
BufferLogger :: new ( & mut LOG_BUFFER [ ..] )
102
103
. register ( move || {
103
- info ! ( "booting ARTIQ..." ) ;
104
+ clock:: init ( ) ;
105
+ info ! ( "booting ARTIQ" ) ;
104
106
info ! ( "software version {}" , GIT_COMMIT ) ;
105
107
info ! ( "gateware version {}" , :: board:: ident( & mut [ 0 ; 64 ] ) ) ;
106
108
107
- clock:: init ( ) ;
109
+ let t = clock:: get_ms ( ) ;
110
+ info ! ( "press 'e' to erase startup and idle kernels..." ) ;
111
+ while clock:: get_ms ( ) < t + 1000 {
112
+ if readchar_nonblock ( ) != 0 && readchar ( ) == b'e' as libc:: c_char {
113
+ config:: remove ( "startup_kernel" ) ;
114
+ config:: remove ( "idle_kernel" ) ;
115
+ info ! ( "startup and idle kernels erased" ) ;
116
+ break
117
+ }
118
+ }
119
+ info ! ( "continuing boot" ) ;
120
+
108
121
rtio_crg:: init ( ) ;
109
122
network_init ( ) ;
110
123
You can’t perform that action at this time.
0 commit comments