File tree Expand file tree Collapse file tree 20 files changed +31
-209
lines changed Expand file tree Collapse file tree 20 files changed +31
-209
lines changed Original file line number Diff line number Diff line change 2
2
// SPDX-License-Identifier: Apache-2.0 OR MIT
3
3
// Copyright Tock Contributors 2022.
4
4
5
+ use crate :: scb;
5
6
use core:: ops:: FnOnce ;
6
7
7
8
#[ cfg( all( target_arch = "arm" , target_os = "none" ) ) ]
58
59
{
59
60
unimplemented ! ( )
60
61
}
62
+
63
+ pub fn reset ( ) -> ! {
64
+ unsafe {
65
+ scb:: reset ( ) ;
66
+ }
67
+ loop {
68
+ // This is required to avoid the empty loop clippy
69
+ // warning #[warn(clippy::empty_loop)]
70
+ nop ( ) ;
71
+ }
72
+ }
Original file line number Diff line number Diff line change @@ -138,16 +138,6 @@ fn baud_rate_reset_bootloader_enter() {
138
138
}
139
139
}
140
140
141
- // Function for the process console to use to reboot the board
142
- fn reset ( ) -> ! {
143
- unsafe {
144
- cortexm4:: scb:: reset ( ) ;
145
- }
146
- loop {
147
- cortexm4:: support:: nop ( ) ;
148
- }
149
- }
150
-
151
141
/// Supported drivers by the platform
152
142
pub struct Platform {
153
143
ble_radio : & ' static capsules_extra:: ble_advertising_driver:: BLE <
@@ -738,7 +728,7 @@ pub unsafe fn main() {
738
728
uart_mux,
739
729
mux_alarm,
740
730
process_printer,
741
- Some ( reset) ,
731
+ Some ( cortexm4 :: support :: reset) ,
742
732
)
743
733
. finalize ( components:: process_console_component_static!(
744
734
nrf52840:: rtc:: Rtc
Original file line number Diff line number Diff line change @@ -48,16 +48,6 @@ static mut PROCESS_PRINTER: Option<&'static kernel::process::ProcessPrinterText>
48
48
#[ link_section = ".stack_buffer" ]
49
49
pub static mut STACK_MEMORY : [ u8 ; 0x1000 ] = [ 0 ; 0x1000 ] ;
50
50
51
- // Function for the process console to use to reboot the board
52
- fn reset ( ) -> ! {
53
- unsafe {
54
- cortexm4:: scb:: reset ( ) ;
55
- }
56
- loop {
57
- cortexm4:: support:: nop ( ) ;
58
- }
59
- }
60
-
61
51
/// A structure representing this platform that holds references to all
62
52
/// capsules for this platform.
63
53
struct Hail {
@@ -314,7 +304,7 @@ pub unsafe fn main() {
314
304
uart_mux,
315
305
mux_alarm,
316
306
process_printer,
317
- Some ( reset) ,
307
+ Some ( cortexm4 :: support :: reset) ,
318
308
)
319
309
. finalize ( components:: process_console_component_static!(
320
310
sam4l:: ast:: Ast <' static >
Original file line number Diff line number Diff line change @@ -109,16 +109,6 @@ static mut PROCESS_PRINTER: Option<&'static kernel::process::ProcessPrinterText>
109
109
#[ link_section = ".stack_buffer" ]
110
110
pub static mut STACK_MEMORY : [ u8 ; 0x2000 ] = [ 0 ; 0x2000 ] ;
111
111
112
- // Function for the process console to use to reboot the board
113
- fn reset ( ) -> ! {
114
- unsafe {
115
- cortexm4:: scb:: reset ( ) ;
116
- }
117
- loop {
118
- cortexm4:: support:: nop ( ) ;
119
- }
120
- }
121
-
122
112
struct Imix {
123
113
pconsole : & ' static capsules_core:: process_console:: ProcessConsole <
124
114
' static ,
@@ -416,7 +406,7 @@ pub unsafe fn main() {
416
406
uart_mux,
417
407
mux_alarm,
418
408
process_printer,
419
- Some ( reset) ,
409
+ Some ( cortexm4 :: support :: reset) ,
420
410
)
421
411
. finalize ( components:: process_console_component_static!(
422
412
sam4l:: ast:: Ast
Original file line number Diff line number Diff line change @@ -81,16 +81,6 @@ pub static mut STACK_MEMORY: [u8; 0x2000] = [0; 0x2000];
81
81
// debug mode requires more stack space
82
82
// pub static mut STACK_MEMORY: [u8; 0x2000] = [0; 0x2000];
83
83
84
- // Function for the process console to use to reboot the board
85
- fn reset ( ) -> ! {
86
- unsafe {
87
- cortexm4:: scb:: reset ( ) ;
88
- }
89
- loop {
90
- cortexm4:: support:: nop ( ) ;
91
- }
92
- }
93
-
94
84
/// Supported drivers by the platform
95
85
pub struct MicroBit {
96
86
ble_radio : & ' static capsules_extra:: ble_advertising_driver:: BLE <
@@ -692,7 +682,7 @@ unsafe fn start() -> (
692
682
uart_mux,
693
683
mux_alarm,
694
684
process_printer,
695
- Some ( reset) ,
685
+ Some ( cortexm4 :: support :: reset) ,
696
686
)
697
687
. finalize ( components:: process_console_component_static!(
698
688
nrf52833:: rtc:: Rtc
Original file line number Diff line number Diff line change @@ -115,16 +115,6 @@ fn baud_rate_reset_bootloader_enter() {
115
115
}
116
116
}
117
117
118
- // Function for the process console to use to reboot the board.
119
- fn reset ( ) -> ! {
120
- unsafe {
121
- cortexm4:: scb:: reset ( ) ;
122
- }
123
- loop {
124
- cortexm4:: support:: nop ( ) ;
125
- }
126
- }
127
-
128
118
/// Supported drivers by the platform
129
119
pub struct Platform {
130
120
ble_radio : & ' static capsules_extra:: ble_advertising_driver:: BLE <
@@ -386,7 +376,7 @@ pub unsafe fn main() {
386
376
uart_mux,
387
377
mux_alarm,
388
378
process_printer,
389
- Some ( reset) ,
379
+ Some ( cortexm4 :: support :: reset) ,
390
380
)
391
381
. finalize ( components:: process_console_component_static!(
392
382
nrf52:: rtc:: Rtc <' static >
Original file line number Diff line number Diff line change @@ -49,16 +49,6 @@ mod flash_bootloader;
49
49
#[ link_section = ".stack_buffer" ]
50
50
pub static mut STACK_MEMORY : [ u8 ; 0x1500 ] = [ 0 ; 0x1500 ] ;
51
51
52
- // Function for the process console to reboot the Nano RP2040 Connect.
53
- fn reset_function ( ) -> ! {
54
- unsafe {
55
- cortexm0p:: scb:: reset ( ) ;
56
- }
57
- loop {
58
- cortexm0p:: support:: nop ( ) ;
59
- }
60
- }
61
-
62
52
// Manually setting the boot header section that contains the FCB header
63
53
#[ used]
64
54
#[ link_section = ".flash_bootloader" ]
@@ -545,7 +535,7 @@ pub unsafe fn main() {
545
535
uart_mux,
546
536
mux_alarm,
547
537
process_printer,
548
- Some ( reset_function ) ,
538
+ Some ( cortexm0p :: support :: reset ) ,
549
539
)
550
540
. finalize ( components:: process_console_component_static!( RPTimer ) ) ;
551
541
let _ = process_console. start ( ) ;
Original file line number Diff line number Diff line change @@ -75,16 +75,6 @@ static mut PROCESS_PRINTER: Option<&'static kernel::process::ProcessPrinterText>
75
75
#[ link_section = ".stack_buffer" ]
76
76
pub static mut STACK_MEMORY : [ u8 ; 0x1000 ] = [ 0 ; 0x1000 ] ;
77
77
78
- // Function for the process console to use to reboot the board
79
- fn reset ( ) -> ! {
80
- unsafe {
81
- cortexm4:: scb:: reset ( ) ;
82
- }
83
- loop {
84
- cortexm4:: support:: nop ( ) ;
85
- }
86
- }
87
-
88
78
/// Supported drivers by the platform
89
79
pub struct Platform {
90
80
ble_radio : & ' static capsules_extra:: ble_advertising_driver:: BLE <
@@ -336,7 +326,7 @@ pub unsafe fn main() {
336
326
uart_mux,
337
327
mux_alarm,
338
328
process_printer,
339
- Some ( reset) ,
329
+ Some ( cortexm4 :: support :: reset) ,
340
330
)
341
331
. finalize ( components:: process_console_component_static!(
342
332
nrf52840:: rtc:: Rtc <' static >
Original file line number Diff line number Diff line change @@ -156,16 +156,6 @@ static mut PROCESS_PRINTER: Option<&'static kernel::process::ProcessPrinterText>
156
156
#[ link_section = ".stack_buffer" ]
157
157
pub static mut STACK_MEMORY : [ u8 ; 0x2000 ] = [ 0 ; 0x2000 ] ;
158
158
159
- // Function for the process console to use to reboot the board
160
- fn reset ( ) -> ! {
161
- unsafe {
162
- cortexm4:: scb:: reset ( ) ;
163
- }
164
- loop {
165
- cortexm4:: support:: nop ( ) ;
166
- }
167
- }
168
-
169
159
/// Supported drivers by the platform
170
160
pub struct Platform {
171
161
ble_radio : & ' static capsules_extra:: ble_advertising_driver:: BLE <
@@ -499,7 +489,7 @@ pub unsafe fn main() {
499
489
uart_mux,
500
490
mux_alarm,
501
491
process_printer,
502
- Some ( reset) ,
492
+ Some ( cortexm4 :: support :: reset) ,
503
493
)
504
494
. finalize ( components:: process_console_component_static!(
505
495
nrf52840:: rtc:: Rtc <' static >
Original file line number Diff line number Diff line change @@ -134,16 +134,6 @@ static mut PROCESS_PRINTER: Option<&'static kernel::process::ProcessPrinterText>
134
134
#[ link_section = ".stack_buffer" ]
135
135
pub static mut STACK_MEMORY : [ u8 ; 0x1000 ] = [ 0 ; 0x1000 ] ;
136
136
137
- // Function for the process console to use to reboot the board
138
- fn reset ( ) -> ! {
139
- unsafe {
140
- cortexm4:: scb:: reset ( ) ;
141
- }
142
- loop {
143
- cortexm4:: support:: nop ( ) ;
144
- }
145
- }
146
-
147
137
/// Supported drivers by the platform
148
138
pub struct Platform {
149
139
ble_radio : & ' static capsules_extra:: ble_advertising_driver:: BLE <
@@ -394,7 +384,7 @@ pub unsafe fn main() {
394
384
uart_mux,
395
385
mux_alarm,
396
386
process_printer,
397
- Some ( reset) ,
387
+ Some ( cortexm4 :: support :: reset) ,
398
388
)
399
389
. finalize ( components:: process_console_component_static!( Rtc <' static >) ) ;
400
390
You can’t perform that action at this time.
0 commit comments