Skip to content

Commit af23b7c

Browse files
committed
Merge branch '💥-closure' into 🦆
2 parents 2563a3f + 140d370 commit af23b7c

File tree

110 files changed

+640
-392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+640
-392
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
9494
}
9595
}
9696

97-
fn task_body(_: usize) {
97+
fn task_body() {
9898
// ...
9999
}
100100
```

‎examples/basic/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ const fn configure_app(b: &mut r3_kernel::Cfg<'_, SystemTraits>) -> Objects {
4141
}
4242
}
4343

44-
fn task1_body(_: usize) {
44+
fn task1_body() {
4545
log::trace!("COTTAGE = {:#?}", COTTAGE);
4646
log::trace!("KENREL = {:#?}", System::debug());
4747

4848
COTTAGE.task2.activate().unwrap();
4949
}
5050

51-
fn task2_body(_: usize) {
51+
fn task2_body() {
5252
loop {
5353
dbg!(System::time().unwrap());
5454
System::sleep(r3::time::Duration::from_secs(1)).unwrap();

‎examples/basic_gr_peach/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
7171

7272
// Initialize the serial port
7373
StartupHook::define()
74-
.start(|_| {
74+
.start(|| {
7575
use support_rza1::serial::ScifExt;
7676

7777
#[allow(non_snake_case)]
@@ -99,13 +99,13 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
9999
Objects { task1, task2 }
100100
}
101101

102-
fn task1_body(_: usize) {
102+
fn task1_body() {
103103
support_rza1::sprintln!("COTTAGE = {:?}", COTTAGE);
104104

105105
COTTAGE.task2.activate().unwrap();
106106
}
107107

108-
fn task2_body(_: usize) {
108+
fn task2_body() {
109109
loop {
110110
support_rza1::sprintln!("time = {:?}", System::time().unwrap());
111111
System::sleep(r3::time::Duration::from_secs(1)).unwrap();

‎examples/basic_nucleo_f401re/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
4848
// Initialize RTT (Real-Time Transfer) with a single up channel and set
4949
// it as the print channel for the printing macros
5050
StartupHook::define()
51-
.start(|_| {
51+
.start(|| {
5252
rtt_target::rtt_init_print!();
5353
})
5454
.finish(b);
@@ -71,13 +71,13 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
7171
}
7272
}
7373

74-
fn task1_body(_: usize) {
74+
fn task1_body() {
7575
rtt_target::rprintln!("COTTAGE = {:?}", COTTAGE);
7676

7777
COTTAGE.task2.activate().unwrap();
7878
}
7979

80-
fn task2_body(_: usize) {
80+
fn task2_body() {
8181
loop {
8282
rtt_target::rprintln!("time = {:?}", System::time().unwrap());
8383
System::sleep(r3::time::Duration::from_secs(1)).unwrap();

‎examples/basic_rp_pico/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
7474
b.num_task_priority_levels(4);
7575

7676
StartupHook::define()
77-
.start(|_| {
77+
.start(|| {
7878
// Configure peripherals
7979
let p = unsafe { rp2040::Peripherals::steal() };
8080
support_rp2040::clock::init_clock(
@@ -131,13 +131,13 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
131131
}
132132
}
133133

134-
fn task1_body(_: usize) {
134+
fn task1_body() {
135135
support_rp2040::sprintln!("COTTAGE = {:?}", COTTAGE);
136136

137137
COTTAGE.task2.activate().unwrap();
138138
}
139139

140-
fn task2_body(_: usize) {
140+
fn task2_body() {
141141
let p = unsafe { rp2040::Peripherals::steal() };
142142

143143
// <https://github.com/jannic/rp-microcontroller-rs/blob/master/boards/rp-pico/examples/blink/main.rs>

‎examples/basic_wio_terminal/src/main.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
110110

111111
// Register a hook to initialize hardware
112112
StartupHook::define()
113-
.start(|_| {
113+
.start(|| {
114114
init_hardware();
115115
})
116116
.finish(b);
@@ -270,7 +270,7 @@ fn init_hardware() {
270270
// ----------------------------------------------------------------------------
271271

272272
/// The task responsible for outputting messages to the console.
273-
fn noisy_task_body(_: usize) {
273+
fn noisy_task_body() {
274274
let _ = writeln!(Console, "////////////////////////////////");
275275
let _ = writeln!(
276276
Console,
@@ -335,7 +335,7 @@ impl Write for Console {
335335
}
336336

337337
/// The task responsible for blinking the user LED.
338-
fn blink_task_body(_: usize) {
338+
fn blink_task_body() {
339339
let mut st = BLINK_ST.lock();
340340
let st = st.as_mut().unwrap();
341341
loop {
@@ -345,7 +345,7 @@ fn blink_task_body(_: usize) {
345345
}
346346

347347
/// The task responsible for rendering the console.
348-
fn console_task_body(_: usize) {
348+
fn console_task_body() {
349349
let mut lcd = borrow_lcd();
350350

351351
let bg_style = primitives::PrimitiveStyleBuilder::new()
@@ -428,7 +428,7 @@ fn console_task_body(_: usize) {
428428
}
429429

430430
/// The task responsible for rendering an animated image.
431-
fn animation_task_body(_: usize) {
431+
fn animation_task_body() {
432432
let images = r3_example_common::ANIMATION_FRAMES_565;
433433
for image in images.iter().cycle() {
434434
let mut lcd = borrow_lcd();
@@ -447,7 +447,7 @@ fn animation_task_body(_: usize) {
447447
static BUTTON_STATE: AtomicUsize = AtomicUsize::new(0);
448448

449449
/// The task responsible for reporting button events.
450-
fn button_reporter_task_body(_: usize) {
450+
fn button_reporter_task_body() {
451451
let mut st = 0;
452452
loop {
453453
System::park().unwrap();
@@ -592,7 +592,7 @@ fn USB_TRCPT1() {
592592
poll_usb();
593593
}
594594

595-
fn usb_poll_timer_handler(_: usize) {
595+
fn usb_poll_timer_handler() {
596596
poll_usb();
597597
}
598598

@@ -613,7 +613,7 @@ fn set_usb_polling(b: bool) {
613613
}
614614

615615
/// The task to print the data received by the USB serial endpoint
616-
fn usb_in_task_body(_: usize) {
616+
fn usb_in_task_body() {
617617
let mut data = arrayvec::ArrayVec::<u8, USB_BUF_CAP>::new();
618618
loop {
619619
// Get next data to output

‎examples/smp_rp_pico/src/core0.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
5555
b.num_task_priority_levels(4);
5656

5757
StartupHook::define()
58-
.start(|_| {
58+
.start(|| {
5959
// Configure peripherals
6060
let p = unsafe { rp2040::Peripherals::steal() };
6161
support_rp2040::clock::init_clock(
@@ -108,7 +108,7 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
108108
.finish(b);
109109
StaticInterruptHandler::define()
110110
.line(int_fifo)
111-
.start(|_| {
111+
.start(|| {
112112
let p = unsafe { rp2040::Peripherals::steal() };
113113
let sio = p.SIO;
114114
while sio.fifo_st.read().vld().bit_is_set() {
@@ -132,13 +132,13 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
132132
}
133133
}
134134

135-
fn task1_body(_: usize) {
135+
fn task1_body() {
136136
support_rp2040::sprintln!("COTTAGE = {:?}", COTTAGE);
137137

138138
COTTAGE.task2.activate().unwrap();
139139
}
140140

141-
fn task2_body(_: usize) {
141+
fn task2_body() {
142142
loop {
143143
support_rp2040::sprintln!(" 0 | core0: {:?}", System::time().unwrap());
144144
System::sleep(r3::time::Duration::from_millis(700)).unwrap();

‎examples/smp_rp_pico/src/core1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
189189
Objects { task1 }
190190
}
191191

192-
fn task1_body(_: usize) {
192+
fn task1_body() {
193193
let c1 = Core1(());
194194
write_bytes(c1, b"core1: task1 is running\n");
195195

‎src/r3/src/sync/mutex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub struct GenericMutex<Cell, Mutex> {
7878
/// Objects { task2, mutex }
7979
/// }
8080
///
81-
/// fn task1_body(_: usize) {
81+
/// fn task1_body() {
8282
/// let mut guard = COTTAGE.mutex.lock().unwrap();
8383
///
8484
/// // Although `task2` has a higher priority, it's unable to
@@ -89,7 +89,7 @@ pub struct GenericMutex<Cell, Mutex> {
8989
/// *guard = 1;
9090
/// }
9191
///
92-
/// fn task2_body(_: usize) {
92+
/// fn task2_body() {
9393
/// let mut guard = COTTAGE.mutex.lock().unwrap();
9494
/// assert_eq!(*guard, 1);
9595
/// *guard = 2;

‎src/r3/src/sync/recursive_mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub struct GenericRecursiveMutex<Cell, Mutex> {
6969
/// Objects { mutex }
7070
/// }
7171
///
72-
/// fn task1_body(_: usize) {
72+
/// fn task1_body() {
7373
/// let guard = COTTAGE.mutex.lock().unwrap();
7474
/// assert_eq!(guard.get(), 0);
7575
/// guard.set(1);

0 commit comments

Comments
 (0)