Skip to content

Commit

Permalink
switchable midi/touch, midi is broken for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
vk2seb committed Dec 9, 2023
1 parent 68c0a1d commit b9060a8
Show file tree
Hide file tree
Showing 16 changed files with 767 additions and 385 deletions.
Empty file.
1 change: 1 addition & 0 deletions firmware/polyvec-hal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
23 changes: 23 additions & 0 deletions firmware/polyvec-hal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "polyvec-hal"
version = "0.1.0"
edition = "2021"

[lib]
name = "polyvec_hal"
path = "src/lib.rs"

[dependencies]
micromath = "2.0.0"
heapless = { version = "0.7.16", features = ["ufmt-impl"] }
ufmt = "0.2.0"
litex-hal = { path = "../deps/rust-litex-hal", features = ["gpio"] }
litex-pac = { path = "../deps/generated-litex-pac", features = ["rt"] }
paste = "1.0.14"
riscv = { version = "0.10.1", features = ["critical-section-single-hart"] }
riscv-rt = { path = "../deps/riscv-rt", features = ["single-hart"] }
vexriscv = "0.0.3"

[profile.release]
lto = true
opt-level = 3
File renamed without changes.
4 changes: 4 additions & 0 deletions firmware/polyvec-hal/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#![no_std]

pub mod log;
pub mod gw;
31 changes: 16 additions & 15 deletions firmware/polyvec/src/log.rs → firmware/polyvec-hal/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@ use litex_pac as pac;
use litex_hal::prelude::*;
use litex_hal::uart::UartError;

use crate::info;

litex_hal::uart! {
Uart: pac::UART_MIDI,
}

static mut UART_WRITER: Option<Uart> = None;

#[macro_export]
macro_rules! info {
() => {
_logger_write(b"\n");
};
($($arg:tt)*) => {{
let mut s: String<256> = String::new();
ufmt::uwrite!(&mut s, $($arg)*).ok();
_logger_write(&s.into_bytes());
_logger_write(b"\r");
_logger_write(b"\n");
}};
}

#[cfg(not(test))]
#[panic_handler]
fn panic(panic_info: &PanicInfo) -> ! {
Expand Down Expand Up @@ -67,18 +83,3 @@ pub fn init(uart: pac::UART_MIDI) {
}
}
}

macro_rules! info {
() => {
_logger_write(b"\n");
};
($($arg:tt)*) => {{
let mut s: String<256> = String::new();
ufmt::uwrite!(&mut s, $($arg)*).ok();
_logger_write(&s.into_bytes());
_logger_write(b"\r");
_logger_write(b"\n");
}};
}

pub(crate) use info;
1 change: 1 addition & 0 deletions firmware/polyvec-lib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading

0 comments on commit b9060a8

Please sign in to comment.