Commit b3e282e2 authored by Stefan Lankes's avatar Stefan Lankes Committed by Stefan Lankes
Browse files

minor changes to pass the format check

parent 59ffa72d
...@@ -16,7 +16,10 @@ pub use self::doublylinkedlist::*; ...@@ -16,7 +16,10 @@ pub use self::doublylinkedlist::*;
/// `irqsave` guarantees that the call of the closure /// `irqsave` guarantees that the call of the closure
/// will be not disturbed by an interrupt /// will be not disturbed by an interrupt
#[inline] #[inline]
pub fn irqsave<F: FnMut()>(mut f: F) where F: FnOnce() { pub fn irqsave<F: FnMut()>(mut f: F)
where
F: FnOnce(),
{
let irq = irq::nested_disable(); let irq = irq::nested_disable();
f(); f();
irq::nested_enable(irq); irq::nested_enable(irq);
......
...@@ -207,13 +207,13 @@ impl PerCoreScheduler { ...@@ -207,13 +207,13 @@ impl PerCoreScheduler {
#[inline] #[inline]
pub fn handle_waiting_tasks(&mut self) { pub fn handle_waiting_tasks(&mut self) {
let closure = || { self.blocked_tasks.handle_waiting_tasks() }; let closure = || self.blocked_tasks.handle_waiting_tasks();
irqsave(closure); irqsave(closure);
} }
pub fn custom_wakeup(&mut self, task: TaskHandle) { pub fn custom_wakeup(&mut self, task: TaskHandle) {
if task.get_core_id() == self.core_id { if task.get_core_id() == self.core_id {
let closure = || { self.blocked_tasks.custom_wakeup(task) }; let closure = || self.blocked_tasks.custom_wakeup(task);
irqsave(closure); irqsave(closure);
} else { } else {
get_scheduler(task.get_core_id()) get_scheduler(task.get_core_id())
...@@ -228,7 +228,10 @@ impl PerCoreScheduler { ...@@ -228,7 +228,10 @@ impl PerCoreScheduler {
#[inline] #[inline]
pub fn block_current_task(&mut self, wakeup_time: Option<u64>) { pub fn block_current_task(&mut self, wakeup_time: Option<u64>) {
let closure = || { self.blocked_tasks.add(self.current_task.clone(), wakeup_time)}; let closure = || {
self.blocked_tasks
.add(self.current_task.clone(), wakeup_time)
};
irqsave(closure); irqsave(closure);
} }
...@@ -247,7 +250,7 @@ impl PerCoreScheduler { ...@@ -247,7 +250,7 @@ impl PerCoreScheduler {
#[cfg(feature = "newlib")] #[cfg(feature = "newlib")]
#[inline] #[inline]
pub fn set_lwip_errno(&self, errno: i32) { pub fn set_lwip_errno(&self, errno: i32) {
let closure = || { self.current_task.borrow_mut().lwip_errno = errno }; let closure = || self.current_task.borrow_mut().lwip_errno = errno;
irqsave(closure); irqsave(closure);
} }
...@@ -255,7 +258,7 @@ impl PerCoreScheduler { ...@@ -255,7 +258,7 @@ impl PerCoreScheduler {
#[cfg(feature = "newlib")] #[cfg(feature = "newlib")]
#[inline] #[inline]
pub fn get_lwip_errno(&self) -> i32 { pub fn get_lwip_errno(&self) -> i32 {
let closure = || { self.current_task.borrow().lwip_errno }; let closure = || self.current_task.borrow().lwip_errno;
irqsave(closure); irqsave(closure);
} }
...@@ -279,7 +282,7 @@ impl PerCoreScheduler { ...@@ -279,7 +282,7 @@ impl PerCoreScheduler {
#[inline] #[inline]
pub fn set_current_task_wakeup_reason(&mut self, reason: WakeupReason) { pub fn set_current_task_wakeup_reason(&mut self, reason: WakeupReason) {
let closure = || { self.current_task.borrow_mut().last_wakeup_reason = reason }; let closure = || self.current_task.borrow_mut().last_wakeup_reason = reason;
irqsave(closure); irqsave(closure);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment