chore: clean up unused things

This commit is contained in:
dogeystamp 2024-04-08 16:25:39 -04:00
parent df156ffee4
commit 448b8e232c
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
4 changed files with 4 additions and 24 deletions

View File

@ -3,7 +3,6 @@ name = "geode-piano"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-only" license = "GPL-3.0-only"
license-file = "LICENSE"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -20,12 +20,8 @@
//! //!
//! This sets up a queue of MIDI packets to send on behalf of other tasks. //! This sets up a queue of MIDI packets to send on behalf of other tasks.
use embassy_rp::{ use embassy_rp::usb::{Driver, Instance};
peripherals::USB,
usb::{Driver, Instance},
};
use embassy_sync::{blocking_mutex::raw::ThreadModeRawMutex, channel::Channel}; use embassy_sync::{blocking_mutex::raw::ThreadModeRawMutex, channel::Channel};
use embassy_time::Timer;
use embassy_usb::{class::midi::MidiClass, driver::EndpointError}; use embassy_usb::{class::midi::MidiClass, driver::EndpointError};
struct NoteMsg { struct NoteMsg {
@ -112,16 +108,6 @@ pub async fn midi_session<'d, T: Instance + 'd>(
} }
} }
/// Wrapper to reconnect to MIDI upon disconnection.
#[embassy_executor::task]
pub async fn midi_task(mut midi: MidiClass<'static, Driver<'static, USB>>) -> ! {
loop {
log::info!("Connected");
midi_session(&mut midi);
log::info!("Disconnected");
}
}
/// Public MIDI interface that can be used to send notes/control packets. /// Public MIDI interface that can be used to send notes/control packets.
pub struct MidiChannel { pub struct MidiChannel {
channel: u8, channel: u8,

View File

@ -33,12 +33,10 @@ DEALINGS IN THE SOFTWARE.
use embassy_futures::join::join; use embassy_futures::join::join;
use embassy_rp::{peripherals::USB, usb::Driver}; use embassy_rp::{peripherals::USB, usb::Driver};
use crate::geode_midi;
use crate::geode_midi::midi_session; use crate::geode_midi::midi_session;
use embassy_usb::class::cdc_acm::CdcAcmClass; use embassy_usb::class::cdc_acm::CdcAcmClass;
use embassy_usb::class::cdc_acm::State; use embassy_usb::class::cdc_acm::State;
use embassy_usb::class::midi::MidiClass; use embassy_usb::class::midi::MidiClass;
use embassy_usb::driver::EndpointError;
use embassy_usb::{Builder, Config}; use embassy_usb::{Builder, Config};
#[embassy_executor::task] #[embassy_executor::task]
@ -96,8 +94,9 @@ pub async fn usb_task(
let midi_fut = async { let midi_fut = async {
loop { loop {
midi_class.wait_connection().await;
log::info!("Connected"); log::info!("Connected");
midi_session(&mut midi_class).await; let _ = midi_session(&mut midi_class).await;
log::info!("Disconnected"); log::info!("Disconnected");
} }
}; };

View File

@ -1,17 +1,13 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#![allow(dead_code)]
#![allow(unused)]
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_futures::join::join;
use embassy_rp::bind_interrupts; use embassy_rp::bind_interrupts;
use embassy_rp::gpio; use embassy_rp::gpio;
use embassy_rp::gpio::AnyPin; use embassy_rp::gpio::AnyPin;
use embassy_rp::gpio::Input; use embassy_rp::gpio::Input;
use embassy_rp::gpio::Pull; use embassy_rp::gpio::Pull;
use embassy_rp::peripherals::USB; use embassy_rp::peripherals::USB;
use embassy_rp::usb::Instance;
use embassy_rp::usb::{Driver, InterruptHandler}; use embassy_rp::usb::{Driver, InterruptHandler};
use embassy_time::Timer; use embassy_time::Timer;
use geode_usb::usb_task; use geode_usb::usb_task;
@ -46,7 +42,7 @@ enum Note {
#[embassy_executor::task(pool_size = 2)] #[embassy_executor::task(pool_size = 2)]
async fn button(pin: AnyPin, note: Note) { async fn button(pin: AnyPin, note: Note) {
let mut button = Input::new(pin, Pull::Up); let mut button = Input::new(pin, Pull::Up);
let mut chan = geode_midi::MidiChannel::new(0); let chan = geode_midi::MidiChannel::new(0);
loop { loop {
let mut counter = 10; let mut counter = 10;
button.wait_for_falling_edge().await; button.wait_for_falling_edge().await;