This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::{fs::OpenOptions, io::Write, process::exit, time::Duration}; | |
| use libcamera::{ | |
| camera::CameraConfigurationStatus, | |
| camera_manager::CameraManager, | |
| framebuffer::AsFrameBuffer, | |
| framebuffer_allocator::{FrameBuffer, FrameBufferAllocator}, | |
| framebuffer_map::MemoryMappedFrameBuffer, | |
| geometry::Size, | |
| pixel_format::PixelFormat, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use core::mem::MaybeUninit; | |
| use core::ops::{Deref, DerefMut}; | |
| use core::task::Poll; | |
| use bxcan; | |
| use embassy_cortex_m::interrupt::InterruptExt; | |
| use embassy_hal_common::{into_ref, Peripheral, PeripheralRef}; | |
| use embassy_stm32::can::{BxcanInstance, RxPin, TxPin}; | |
| use embassy_stm32::gpio::low_level::AFType; | |
| use embassy_stm32::interrupt::Interrupt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// Computes bxcan BTR value from peripheral clock and target can bitrate | |
| /// | |
| /// Based on <https://github.com/OpenCyphal-Garage/platform_specific_components/blob/master/stm32/libcanard/bxcan/src/bxcan.c> | |
| pub fn calc_bxcan_timings(periph_clock: Hertz, can_bitrate: u32) -> Option<u32> { | |
| const BS1_MAX: u8 = 16; | |
| const BS2_MAX: u8 = 8; | |
| const MAX_SAMPLE_POINT_PERMILL: u16 = 900; | |
| let periph_clock = periph_clock.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use core::mem::MaybeUninit; | |
| use core::sync::atomic::{AtomicBool, Ordering}; | |
| use rtt_target::rtt::{RttChannel, RttHeader}; | |
| use rtt_target::{ChannelMode, UpChannel}; | |
| const UP_CHANNELS: usize = 1; | |
| const DOWN_CHANNELS: usize = 0; | |
| const TERMINAL_CHANNEL_SIZE: usize = 512; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use core::mem::MaybeUninit; | |
| use rtt_target::{rtt::{RttHeader, RttChannel}, set_print_channel, ChannelMode, UpChannel}; | |
| const UP_CHANNELS: usize = 1; | |
| const DOWN_CHANNELS: usize = 0; | |
| const TERMINAL_CHANNEL_SIZE: usize = 512; | |
| #[repr(C)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use core::sync::atomic::{AtomicBool, Ordering}; | |
| use futures_intrusive::{ | |
| buffer::ArrayBuf, | |
| channel::{ | |
| GenericChannel, GenericOneshotBroadcastChannel, GenericOneshotChannel, | |
| GenericStateBroadcastChannel, | |
| }, | |
| }; | |
| use lock_api::{GuardNoSend, RawMutex}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use smoltcp::socket::SocketSet; | |
| use alloc::vec; | |
| use crate::executor::{Mutex, MutexGuard}; | |
| pub mod tcp; | |
| pub struct SocketContext { | |
| pub set: SocketSet<'static, 'static, 'static>, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use bevy::{ | |
| window::CursorMoved, | |
| render::camera::Camera, | |
| prelude::*, | |
| }; | |
| // const KEY_PAN_SPEED: f32 = 500.0; | |
| // const KEY_ZOOM_SPEED: f32 = 200.0; | |
| const MOUSE_PAN_SPEED: f32 = 100.0; | |
| // const MOUSE_ZOOM_SPEED: f32 = 1000.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// System that polls the window events and pushes them to appropriate event channels. | |
| /// | |
| /// This system must be active for any `GameState` to receive | |
| /// any `StateEvent::Window` event into it's `handle_event` method. | |
| pub fn build_events_loop_system(mut events_loop: EventsLoop) -> | |
| Box<dyn FnOnce(&mut World, &mut Resources) -> Box<dyn Runnable>> | |
| { | |
| let mut events = Vec::with_capacity(128); | |
| Box::new(|_world, _resources| { | |
| SystemBuilder::<()>::new("EventsLoopSystem") |
NewerOlder