cargo fmt

This commit was merged in pull request #396.
This commit is contained in:
2025-06-11 10:56:31 +08:00
committed by mwojcik
parent 0c642c48c0
commit 2340b44dae
31 changed files with 44 additions and 44 deletions

View File

@@ -6,7 +6,7 @@ use log::debug;
use crate::{cxp_ctrl::Error as CtrlErr,
cxp_packet::{read_u32, read_u64, reset_tag, send_test_packet, write_bytes_no_ack, write_u32, write_u64},
cxp_phys::{rx, tx, CXPSpeed},
cxp_phys::{CXPSpeed, rx, tx},
pl::csr};
// Bootstrap registers address

View File

@@ -3,7 +3,7 @@ use libcortex_a9::mutex::Mutex;
use log::{error, info};
#[cfg(has_cxp_led)]
use crate::cxp_led::{update_led, LEDState};
use crate::cxp_led::{LEDState, update_led};
use crate::{cxp_camera_setup::{camera_setup, discover_camera, master_channel_ready},
pl::csr};

View File

@@ -4,7 +4,7 @@ use byteorder::{ByteOrder, NetworkEndian};
use io::Cursor;
use libboard_zynq::{time::Milliseconds, timer::GlobalTimer};
use crate::{cxp_ctrl::{Error, RXCTRLPacket, TXCTRLPacket, CTRL_PACKET_MAXSIZE, DATA_MAXSIZE},
use crate::{cxp_ctrl::{CTRL_PACKET_MAXSIZE, DATA_MAXSIZE, Error, RXCTRLPacket, TXCTRLPacket},
mem::mem,
pl::csr};

View File

@@ -2,11 +2,11 @@ use core::{arch::asm, slice};
use byteorder::NativeEndian;
use core_io::{Error as IoError, ErrorKind as IoErrorKind};
use io::{proto::{ProtoRead, ProtoWrite},
Cursor};
use io::{Cursor,
proto::{ProtoRead, ProtoWrite}};
use libboard_zynq::{time::Milliseconds, timer::GlobalTimer};
pub use crate::drtioaux_proto::{Packet, MAX_PACKET};
pub use crate::drtioaux_proto::{MAX_PACKET, Packet};
use crate::{drtioaux_proto::Error as ProtocolError, mem::mem::DRTIOAUX_MEM, pl::csr::DRTIOAUX};
#[derive(Debug)]

View File

@@ -2,14 +2,14 @@ use core::slice;
use byteorder::NativeEndian;
use core_io::{Error as IoError, ErrorKind as IoErrorKind};
use io::{proto::{ProtoRead, ProtoWrite},
Cursor};
use io::{Cursor,
proto::{ProtoRead, ProtoWrite}};
use libasync::{block_async, task};
use libboard_zynq::{time::Milliseconds, timer::GlobalTimer};
use void::Void;
pub use crate::drtioaux_proto::{Packet, MAX_PACKET};
use crate::{drtioaux::{copy_work_buffer, has_rx_error, Error},
pub use crate::drtioaux_proto::{MAX_PACKET, Packet};
use crate::{drtioaux::{Error, copy_work_buffer, has_rx_error},
mem::mem::DRTIOAUX_MEM,
pl::csr::DRTIOAUX};

View File

@@ -2,7 +2,7 @@ use core::{mem,
ops::{Deref, Range},
ptr};
use super::{elf::*, Arch};
use super::{Arch, elf::*};
fn read_unaligned<T: Copy>(data: &[u8], offset: usize) -> Option<T> {
if data.len() < offset + mem::size_of::<T>() {

View File

@@ -1,9 +1,9 @@
use alloc::alloc::{alloc_zeroed, dealloc, Layout, LayoutError};
use alloc::alloc::{Layout, LayoutError, alloc_zeroed, dealloc};
use core::{mem,
ops::{Deref, DerefMut, Range},
slice};
use super::{elf::*, Error};
use super::{Error, elf::*};
pub struct DynamicSection {
pub strtab: Range<usize>,

View File

@@ -4,7 +4,7 @@ use libcortex_a9::{asm::{dsb, isb},
cache::{bpiall, dcci_slice, iciallu}};
use log::trace;
use super::{elf::*, image::Image, Arch, Error, Library};
use super::{Arch, Error, Library, elf::*, image::Image};
pub trait Relocatable {
fn offset(&self) -> usize;

View File

@@ -4,7 +4,7 @@ use core::fmt;
use byteorder::{ByteOrder, NetworkEndian};
use cslice::CMutSlice;
use libboard_artiq::{cxp_ctrl::{Error as CtrlErr, DATA_MAXSIZE},
use libboard_artiq::{cxp_ctrl::{DATA_MAXSIZE, Error as CtrlErr},
cxp_grabber::{camera_connected, with_tag},
cxp_packet::{read_bytes, read_u32, write_u32}};
use log::info;

View File

@@ -3,7 +3,7 @@ use core::mem::{forget, transmute};
use cslice::{AsCSlice, CSlice};
use super::{Message, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0};
use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, Message};
pub extern "C" fn get(key: CSlice<u8>) -> &CSlice<'static, i32> {
let key = String::from_utf8(key.as_ref().to_vec()).unwrap();

View File

@@ -3,7 +3,7 @@ use core::mem::{forget, replace};
use libcortex_a9::sync_channel::{Receiver, Sender};
use libsupport_zynq::boot::Core1;
use super::{Message, CHANNEL_0TO1, CHANNEL_1TO0, CHANNEL_SEM, INIT_LOCK};
use super::{CHANNEL_0TO1, CHANNEL_1TO0, CHANNEL_SEM, INIT_LOCK, Message};
use crate::irq::restart_core1;
pub struct Control {

View File

@@ -4,7 +4,7 @@ use alloc::borrow::ToOwned;
use core::{cell::UnsafeCell, mem, ptr};
use cslice::CSlice;
use dyld::{elf::EXIDX_Entry, Library};
use dyld::{Library, elf::EXIDX_Entry};
use libboard_zynq::{gic, mpcore};
use libcortex_a9::{asm::{dsb, isb},
cache::{bpiall, dcci_slice, iciallu},
@@ -12,8 +12,8 @@ use libcortex_a9::{asm::{dsb, isb},
use libsupport_zynq::ram;
use log::{debug, error, info};
use super::{api::resolve, dma, rpc::rpc_send_async, Message, CHANNEL_0TO1, CHANNEL_1TO0, CHANNEL_SEM, INIT_LOCK,
KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, KERNEL_IMAGE};
use super::{CHANNEL_0TO1, CHANNEL_1TO0, CHANNEL_SEM, INIT_LOCK, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0,
KERNEL_IMAGE, Message, api::resolve, dma, rpc::rpc_send_async};
use crate::{eh_artiq, get_async_errors};
// linker symbols

View File

@@ -3,7 +3,7 @@ use core::{mem, ptr};
use cslice::CSlice;
use super::{rtio, Message, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, KERNEL_IMAGE};
use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, KERNEL_IMAGE, Message, rtio};
use crate::{artiq_raise, pl::csr};
#[repr(C)]

View File

@@ -3,7 +3,7 @@ use core::mem::MaybeUninit;
use libboard_zynq::i2c::{Error, I2c};
#[cfg(has_drtio)]
use super::{Message, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0};
use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, Message};
use crate::artiq_raise;
static mut I2C_BUS: MaybeUninit<I2c> = MaybeUninit::uninit();

View File

@@ -3,7 +3,7 @@ use core::ptr;
use libcortex_a9::{mutex::Mutex, semaphore::Semaphore, sync_channel};
use crate::{eh_artiq, RPCException};
use crate::{RPCException, eh_artiq};
mod control;
pub use control::Control;

View File

@@ -4,7 +4,7 @@ use alloc::vec::Vec;
use cslice::CSlice;
use super::{Message, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0};
use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, Message};
use crate::{eh_artiq, rpc::send_args};
fn rpc_send_common(is_async: bool, service: u32, tag: &CSlice<u8>, data: *const *const ()) {

View File

@@ -1,11 +1,11 @@
use core::sync::atomic::{fence, Ordering};
use core::sync::atomic::{Ordering, fence};
use cslice::CSlice;
use libcortex_a9::asm;
use vcell::VolatileCell;
#[cfg(has_drtio)]
use super::{Message, KERNEL_CHANNEL_1TO0};
use super::{KERNEL_CHANNEL_1TO0, Message};
use crate::{artiq_raise, pl::csr, resolve_channel_name, rtio_core};
pub const RTIO_O_STATUS_WAIT: i32 = 1;

View File

@@ -3,7 +3,7 @@ use core::ptr::{read_volatile, write_volatile};
use cslice::CSlice;
#[cfg(has_drtio)]
use super::{Message, KERNEL_CHANNEL_1TO0};
use super::{KERNEL_CHANNEL_1TO0, Message};
use crate::{artiq_raise, pl::csr, resolve_channel_name, rtio_core};
pub const RTIO_O_STATUS_WAIT: u8 = 1;

View File

@@ -2,7 +2,7 @@ use alloc::vec::Vec;
use cslice::CSlice;
use super::{rtio::now_mu, Message, SubkernelStatus, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0};
use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, Message, SubkernelStatus, rtio::now_mu};
use crate::{artiq_raise, eh_artiq, rpc::send_args};
pub extern "C" fn load_run(id: u32, destination: u8, run: bool) {

View File

@@ -6,7 +6,7 @@ use cslice::{CMutSlice, CSlice};
use io::{ProtoRead, ProtoWrite};
use log::trace;
use self::tag::{split_tag, Tag, TagIterator};
use self::tag::{Tag, TagIterator, split_tag};
#[inline]
pub fn round_up(val: usize, power_of_two: usize) -> usize {

View File

@@ -21,7 +21,7 @@ use libboard_zynq::{self as zynq,
time::Instant,
wire::IpCidr},
timer::GlobalTimer};
use libconfig::{net_settings, Config};
use libconfig::{Config, net_settings};
use libcortex_a9::{mutex::Mutex,
semaphore::Semaphore,
sync_channel::{Receiver, Sender}};

View File

@@ -138,7 +138,7 @@ mod remote_coremgmt {
use core_io::Read;
use io::ProtoWrite;
use libboard_artiq::{drtioaux_async,
drtioaux_proto::{Packet, MASTER_PAYLOAD_MAX_SIZE}};
drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, Packet}};
use super::*;

View File

@@ -1,7 +1,7 @@
use alloc::{collections::BTreeMap, rc::Rc};
use core::{cell::RefCell, fmt};
use futures::{pin_mut, select_biased, FutureExt};
use futures::{FutureExt, pin_mut, select_biased};
use libasync::{block_async, nb, smoltcp::TcpStream, task};
use libboard_artiq::drtio_routing;
use libboard_zynq::{smoltcp, time::Milliseconds, timer::GlobalTimer};

View File

@@ -4,11 +4,11 @@ use embedded_hal::blocking::delay::DelayMs;
use ksupport::kernel::i2c;
#[cfg(not(feature = "target_ebaz4205"))]
use libboard_artiq::pl;
#[cfg(has_si5324)]
use libboard_artiq::si5324;
#[cfg(has_si549)]
use libboard_artiq::si549;
#[cfg(has_si5324)]
use libboard_artiq::si5324;
#[cfg(has_si5324)]
use libboard_zynq::i2c::I2c;
use libboard_zynq::timer::GlobalTimer;
use libconfig::Config;

View File

@@ -15,15 +15,15 @@ pub mod drtio {
use embedded_hal::blocking::delay::DelayMs;
#[cfg(has_drtio_eem)]
use embedded_hal::blocking::delay::DelayUs;
use ksupport::{kernel::Message as KernelMessage, resolve_channel_name, ASYNC_ERROR_BUSY, ASYNC_ERROR_COLLISION,
ASYNC_ERROR_SEQUENCE_ERROR, SEEN_ASYNC_ERRORS};
use ksupport::{ASYNC_ERROR_BUSY, ASYNC_ERROR_COLLISION, ASYNC_ERROR_SEQUENCE_ERROR, SEEN_ASYNC_ERRORS,
kernel::Message as KernelMessage, resolve_channel_name};
use libasync::{delay, task};
#[cfg(has_drtio_eem)]
use libboard_artiq::drtio_eem;
use libboard_artiq::{drtioaux::Error as DrtioError,
drtioaux_async,
drtioaux_async::Packet,
drtioaux_proto::{PayloadStatus, MASTER_PAYLOAD_MAX_SIZE}};
drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, PayloadStatus}};
use libboard_zynq::time::Milliseconds;
use log::{error, info, warn};

View File

@@ -2,7 +2,7 @@ use alloc::{collections::BTreeMap, rc::Rc, vec::Vec};
use libasync::task;
use libboard_artiq::{drtio_routing::RoutingTable,
drtioaux_proto::{PayloadStatus, MASTER_PAYLOAD_MAX_SIZE}};
drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, PayloadStatus}};
use libboard_zynq::{time::Milliseconds, timer::GlobalTimer};
use libcortex_a9::mutex::Mutex;
use log::{error, warn};

View File

@@ -3,7 +3,7 @@ use core::mem;
use ksupport::kernel::DmaRecorder;
use libboard_artiq::{drtio_routing::RoutingTable,
drtioaux_proto::{Packet, PayloadStatus, MASTER_PAYLOAD_MAX_SIZE},
drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, Packet, PayloadStatus},
pl::csr};
use libcortex_a9::cache::dcci_slice;

View File

@@ -35,10 +35,10 @@ use libboard_artiq::drtio_eem;
use libboard_artiq::grabber;
#[cfg(feature = "target_kasli_soc")]
use libboard_artiq::io_expander;
#[cfg(has_si5324)]
use libboard_artiq::si5324;
#[cfg(has_si549)]
use libboard_artiq::si549;
#[cfg(has_si5324)]
use libboard_artiq::si5324;
use libboard_artiq::{drtio_routing, drtioaux,
drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, SAT_PAYLOAD_MAX_SIZE},
identifier_read, logger,

View File

@@ -7,7 +7,7 @@ use io::ProtoRead;
use libboard_artiq::{drtioaux_proto::SAT_PAYLOAD_MAX_SIZE,
logger::{BufferLogger, LogBufferRef}};
use libconfig::Config;
use log::{debug, error, info, warn, LevelFilter};
use log::{LevelFilter, debug, error, info, warn};
use crate::routing::{SliceMeta, Sliceable};

View File

@@ -4,7 +4,7 @@ use core::cmp::min;
#[cfg(has_drtio_routing)]
use libboard_artiq::pl::csr;
use libboard_artiq::{drtio_routing, drtioaux,
drtioaux_proto::{PayloadStatus, MASTER_PAYLOAD_MAX_SIZE, SAT_PAYLOAD_MAX_SIZE}};
drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, PayloadStatus, SAT_PAYLOAD_MAX_SIZE}};
pub struct SliceMeta {
pub destination: u8,

View File

@@ -11,7 +11,7 @@ use io::{Cursor, ProtoWrite};
use ksupport::{eh_artiq, kernel, kernel::rtio, rpc};
use libboard_artiq::{drtio_routing::RoutingTable,
drtioaux,
drtioaux_proto::{PayloadStatus, MASTER_PAYLOAD_MAX_SIZE},
drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, PayloadStatus},
pl::csr};
use libboard_zynq::{time::Milliseconds, timer::GlobalTimer};
use libcortex_a9::sync_channel::Receiver;