Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions firmware/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@ use esp_alloc as _;
use esp_backtrace as _;

use embassy_executor::{Spawner, task};
use embassy_sync::{blocking_mutex::raw::NoopRawMutex, channel::Channel};
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::channel::Channel;
use embassy_time::Timer;
use esp_hal::Async;
use esp_hal::clock::CpuClock;
use esp_hal::timer::timg::TimerGroup;
use esp_hal::uart::{Config as UartConfig, DataBits, Parity, StopBits, Uart, UartRx, UartTx};
use esp_println::println;
use firmware::midi::{MidiPacket, MidiParser};
use log::info;

// This creates a default app-descriptor required by the esp-idf bootloader.
// For more information see: <https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/app_image_format.html#application-description>
esp_bootloader_esp_idf::esp_app_desc!();

const MIDI_OUT_CHANNEL: Channel<NoopRawMutex, MidiPacket, 128> = Channel::new();
static MIDI_OUT_CHANNEL: Channel<CriticalSectionRawMutex, MidiPacket, 128> = Channel::new();

// Forward MIDI messages IN to the MIDI_OUT_CHANNEL
#[task]
Expand Down Expand Up @@ -101,5 +104,9 @@ async fn main(spawner: Spawner) -> ! {
info!("MIDI out task spawned");

info!("Startup complete.");
loop {}

loop {
Timer::after_secs(1).await;
println!("Heartbeat");
}
}
6 changes: 6 additions & 0 deletions firmware/src/midi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,9 @@ impl MidiParser {
None
}
}

impl Default for MidiParser {
fn default() -> Self {
Self::new()
}
}