Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
kiffie committed Jun 9, 2023
1 parent e453f08 commit cfe49f2
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 21 deletions.
7 changes: 2 additions & 5 deletions mips-mcu-alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ use core::arch::asm;
use core::cell::RefCell;
use core::ptr::{self, NonNull};

use critical_section::{self, Mutex};
use linked_list_allocator::Heap;
use mips_rt::heap_start;
use critical_section::{self, Mutex};

/// Heap extension is performed stepwise. This constant defines the size of one extension step.
const EXTEND_INCREMENT: usize = 1024;
Expand Down Expand Up @@ -107,10 +107,7 @@ unsafe impl GlobalAlloc for MipsMcuHeap {
// try to allocate and successively extend by EXTEND_INCREMENT until memory is exhausted
loop {
if let Ok(p) = critical_section::with(|cs| {
self.heap
.borrow(cs)
.borrow_mut()
.allocate_first_fit(layout)
self.heap.borrow(cs).borrow_mut().allocate_first_fit(layout)
}) {
break p.as_ptr();
} else {
Expand Down
4 changes: 3 additions & 1 deletion mips-mcu/src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ pub fn enable_mv_irq() {
extern "C" {
fn mips_enable_mv_irq();
}
unsafe { mips_enable_mv_irq(); }
unsafe {
mips_enable_mv_irq();
}
}

/// Disables all interrupts and return previous status
Expand Down
2 changes: 1 addition & 1 deletion pic32-hal/src/coretimer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use crate::hal::blocking::delay::{DelayMs, DelayUs};
use crate::pac::INT; // interrupt controller
use crate::time::Hertz;

use critical_section::Mutex;
pub use mips_mcu::core_timer::read_count;
use mips_mcu::core_timer::{read_compare, write_compare};
use critical_section::Mutex;

use core::cell::Cell;

Expand Down
5 changes: 1 addition & 4 deletions pic32-hal/src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,7 @@ macro_rules! port {
}

// configuration for general purpose (non-USB) devices
#[cfg(any(
feature = "pic32mx1xxfxxxb",
feature = "pic32mx2xxfxxxb"
))]
#[cfg(any(feature = "pic32mx1xxfxxxb", feature = "pic32mx2xxfxxxb"))]
port!(PORTA, porta, [
RA0: (ra0, 0, Input<Analog>, true),
RA1: (ra1, 1, Input<Analog>, true),
Expand Down
2 changes: 1 addition & 1 deletion pic32-hal/src/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Enable/disable and set priorities of interrupts in Multi-vectored mode

use crate::pac::INT;
use crate::pac_crate::{RegisterSpec, Reg};
use crate::pac_crate::{Reg, RegisterSpec};
use core::convert::TryFrom;
use core::marker::PhantomData;
use core::ptr::{read_volatile, write_volatile};
Expand Down
16 changes: 8 additions & 8 deletions pic32-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ pub use pic32mx4xxfxxxh as pac;

use embedded_hal as hal;

pub mod time;
pub mod int;
pub mod adc;
pub mod clock;
pub mod coretimer;
pub mod dma;
pub mod gpio;
pub mod i2c;
pub mod int;
pub mod pps;
pub mod uart;
pub mod spi;
pub mod i2c;
pub mod coretimer;
pub mod clock;
pub mod dma;
pub mod adc;
pub mod time;
pub mod uart;

#[cfg(any(
feature = "pic32mx2xxfxxxb",
Expand Down
2 changes: 1 addition & 1 deletion pic32-hal/src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use core::fmt;
use core::marker::PhantomData;

use crate::clock::Osc;
use crate::pps::{input, output, MappedPin, IsConnected};
use crate::pac::{UART1, UART2};
use crate::pps::{input, output, IsConnected, MappedPin};

use embedded_hal::prelude::*;
use nb::block;
Expand Down

0 comments on commit cfe49f2

Please sign in to comment.