Skip to content

Instantly share code, notes, and snippets.

text data bss dec hex filename
1764 0 1112 2876 b3c target/thumbv7m-none-eabi/release/examples/cortex-m-ufmt
File .text Size Crate Name
0.0% 17.0% 146B rtt_target rtt_target::rtt::RttWriter::write_with_mode
0.0% 15.8% 136B [Unknown] __aeabi_memset4
0.0% 13.5% 116B cortex_m_ufmt cortex_m_ufmt::__cortex_m_rt_main
0.0% 12.1% 104B [Unknown] __aeabi_memcpy
0.0% 9.8% 84B [Unknown] __aeabi_memset
mod stream_body {
use std::marker::Unpin;
use std::pin::Pin;
use std::task::*;
use bytes::*;
use futures_core::{Stream, ready};
use http_body::{Body, SizeHint};
use warp::hyper::HeaderMap;
pub struct StreamBody<S> {
use stm32_usbd::UsbCore;
use usbd_serial::SerialPort;
usb usbd_hid::HidKeyboard;
// This macro generates a constructor (pub fn new) and all the required descriptors as a bunch of
// &'static [u8] at compile time.
//
// Problem: it needs complicated information from the crates that implement SerialPort and
// HidKeyboard and it doesn't seem to be feasible to access those from a procmacro (except via
// extremely sketchy and brittle hacks such as writing to temporary files or whatnot)
MacBook Pro (15-inch, Early 2008)
MacBook Pro (17-inch, Early 2008)
MacBook Pro (15-inch, Late 2008)
MacBook Pro (13-inch, Mid 2009)
MacBook Pro (15-inch, 2.53GHz, Mid 2009)
MacBook Pro (15-inch, Mid 2009)
MacBook Pro (17-inch, Early 2009)
MacBook Pro (17-inch, Mid 2009)
MacBook Pro (13-inch, Mid 2010)
MacBook Pro (15-inch, Mid 2010)
@mvirkkunen
mvirkkunen / midi.rs
Created September 13, 2019 13:29
Extremely crude USB MIDI class
#![no_std]
#![no_main]
extern crate panic_semihosting;
//use stlinky::{stlinky_buffer, sprintln};
use nb::block;
use cortex_m_rt::entry;
use stm32f1xx_hal::{prelude::*, stm32, timer::Timer};
use core::cell::{Cell, UnsafeCell};
use core::mem::MaybeUninit;
use core::ops::{Deref, DerefMut};
use core::ptr;
use core::sync::atomic::AtomicU8;
use cortex_m::interrupt::{self, CriticalSection};
pub struct Mutex<T> {
state: Cell<u8>,
inner: UnsafeCell<MaybeUninit<T>>,
use vcell::VolatileCell;
use stm32f1xx_hal::dma::Event;
use stm32f1xx_hal::dma::dma1;
use stm32f1xx_hal::stm32::TIM1;
pub type DmaBuffer = [VolatileCell<u16>];
pub struct PulseInput {
dma: dma1::C2,
tim: TIM1,
#[macro_export]
macro_rules! println {
($($arg:tt)*) => {
cortex_m::interrupt::free(|_| {
let itm = unsafe { &mut *cortex_m::peripheral::ITM::ptr() };
cortex_m::iprintln!(&mut itm.stim[0], $($arg)*);
});
}
}
error[E0599]: no method named `release` found for type `sh1106::mode::displaymode::DisplayMode<sh1106::mode::raw::RawMode<sh1106::interface::spi::SpiInterface<shared_bus::proxy::BusProxy<'_, bare_metal::Mutex<core::cell::RefCell<stm32f1xx_hal::spi::Spi<stm32f1::stm32f103::SPI1, (stm32f1xx_hal::gpio::gpioa::PA5<stm32f1xx_hal::gpio::Alternate<stm32f1xx_hal::gpio::PushPull>>, stm32f1xx_hal::gpio::gpioa::PA6<stm32f1xx_hal::gpio::Input<stm32f1xx_hal::gpio::Floating>>, stm32f1xx_hal::gpio::gpioa::PA7<stm32f1xx_hal::gpio::Alternate<stm32f1xx_hal::gpio::PushPull>>)>>>, stm32f1xx_hal::spi::Spi<stm32f1::stm32f103::SPI1, (stm32f1xx_hal::gpio::gpioa::PA5<stm32f1xx_hal::gpio::Alternate<stm32f1xx_hal::gpio::PushPull>>, stm32f1xx_hal::gpio::gpioa::PA6<stm32f1xx_hal::gpio::Input<stm32f1xx_hal::gpio::Floating>>, stm32f1xx_hal::gpio::gpioa::PA7<stm32f1xx_hal::gpio::Alternate<stm32f1xx_hal::gpio::PushPull>>)>>, stm32f1xx_hal::gpio::gpioa::PA2<stm32f1xx_hal::gpio::Output<stm32f1xx_hal::gpio::PushPull>>, stm32f1xx_hal::gpio::gpio
macro_rules! println {
($($arg:tt)*) => {
cortex_m::interrupt::free(|_| {
let itm = unsafe { &mut *cortex_m::peripheral::ITM::ptr() };
cortex_m::iprintln!(&mut itm.stim[0], $($arg)*);
});
}
}