chore: clean up unused things
This commit is contained in:
parent
df156ffee4
commit
448b8e232c
@ -3,7 +3,6 @@ name = "geode-piano"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-only"
|
||||
license-file = "LICENSE"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
@ -20,12 +20,8 @@
|
||||
//!
|
||||
//! This sets up a queue of MIDI packets to send on behalf of other tasks.
|
||||
|
||||
use embassy_rp::{
|
||||
peripherals::USB,
|
||||
usb::{Driver, Instance},
|
||||
};
|
||||
use embassy_rp::usb::{Driver, Instance};
|
||||
use embassy_sync::{blocking_mutex::raw::ThreadModeRawMutex, channel::Channel};
|
||||
use embassy_time::Timer;
|
||||
use embassy_usb::{class::midi::MidiClass, driver::EndpointError};
|
||||
|
||||
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.
|
||||
pub struct MidiChannel {
|
||||
channel: u8,
|
||||
|
@ -33,12 +33,10 @@ DEALINGS IN THE SOFTWARE.
|
||||
use embassy_futures::join::join;
|
||||
use embassy_rp::{peripherals::USB, usb::Driver};
|
||||
|
||||
use crate::geode_midi;
|
||||
use crate::geode_midi::midi_session;
|
||||
use embassy_usb::class::cdc_acm::CdcAcmClass;
|
||||
use embassy_usb::class::cdc_acm::State;
|
||||
use embassy_usb::class::midi::MidiClass;
|
||||
use embassy_usb::driver::EndpointError;
|
||||
use embassy_usb::{Builder, Config};
|
||||
|
||||
#[embassy_executor::task]
|
||||
@ -96,8 +94,9 @@ pub async fn usb_task(
|
||||
|
||||
let midi_fut = async {
|
||||
loop {
|
||||
midi_class.wait_connection().await;
|
||||
log::info!("Connected");
|
||||
midi_session(&mut midi_class).await;
|
||||
let _ = midi_session(&mut midi_class).await;
|
||||
log::info!("Disconnected");
|
||||
}
|
||||
};
|
||||
|
@ -1,17 +1,13 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused)]
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_futures::join::join;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_rp::gpio::AnyPin;
|
||||
use embassy_rp::gpio::Input;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_rp::peripherals::USB;
|
||||
use embassy_rp::usb::Instance;
|
||||
use embassy_rp::usb::{Driver, InterruptHandler};
|
||||
use embassy_time::Timer;
|
||||
use geode_usb::usb_task;
|
||||
@ -46,7 +42,7 @@ enum Note {
|
||||
#[embassy_executor::task(pool_size = 2)]
|
||||
async fn button(pin: AnyPin, note: Note) {
|
||||
let mut button = Input::new(pin, Pull::Up);
|
||||
let mut chan = geode_midi::MidiChannel::new(0);
|
||||
let chan = geode_midi::MidiChannel::new(0);
|
||||
loop {
|
||||
let mut counter = 10;
|
||||
button.wait_for_falling_edge().await;
|
||||
|
Loading…
Reference in New Issue
Block a user