remove useless code

This commit is contained in:
Jonathan BAUDIN 2023-10-05 18:18:08 +02:00
parent 6bfd8100a4
commit 440ea2ea96

View file

@ -1,7 +1,6 @@
use alloc::{ use alloc::{
boxed::Box, boxed::Box,
string::{String, ToString}, string::{String, ToString},
vec::Vec,
}; };
use cortex_m::interrupt::free; use cortex_m::interrupt::free;
use rp_pico::hal::pac; use rp_pico::hal::pac;
@ -75,16 +74,6 @@ impl PicoUsbSerial {
} }
} }
pub fn available_data(&self) -> usize {
unsafe {
return USB_BUFFER.as_ref().unwrap().available_to_read();
};
}
pub fn read(&self) -> u8 {
free(|_cs| unsafe { USB_BUFFER.as_mut().unwrap().read().unwrap_or(0) })
}
pub fn write(&self, data: &[u8]) -> usb_device::Result<usize> { pub fn write(&self, data: &[u8]) -> usb_device::Result<usize> {
free(|_cs| { free(|_cs| {
let serial = unsafe { USB_SERIAL.as_mut().unwrap() }; let serial = unsafe { USB_SERIAL.as_mut().unwrap() };