diff --git a/firmware/deps/generated-litex-pac/src/GENERATED b/firmware/deps/generated-litex-pac/src/GENERATED new file mode 100644 index 0000000..e69de29 diff --git a/firmware/polyvec-hal/.gitignore b/firmware/polyvec-hal/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/firmware/polyvec-hal/.gitignore @@ -0,0 +1 @@ +/target diff --git a/firmware/polyvec-hal/Cargo.toml b/firmware/polyvec-hal/Cargo.toml new file mode 100644 index 0000000..cc506a6 --- /dev/null +++ b/firmware/polyvec-hal/Cargo.toml @@ -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 diff --git a/firmware/polyvec/src/gw.rs b/firmware/polyvec-hal/src/gw.rs similarity index 100% rename from firmware/polyvec/src/gw.rs rename to firmware/polyvec-hal/src/gw.rs diff --git a/firmware/polyvec-hal/src/lib.rs b/firmware/polyvec-hal/src/lib.rs new file mode 100644 index 0000000..8c53d27 --- /dev/null +++ b/firmware/polyvec-hal/src/lib.rs @@ -0,0 +1,4 @@ +#![no_std] + +pub mod log; +pub mod gw; diff --git a/firmware/polyvec/src/log.rs b/firmware/polyvec-hal/src/log.rs similarity index 98% rename from firmware/polyvec/src/log.rs rename to firmware/polyvec-hal/src/log.rs index fc9ad02..fffdf04 100644 --- a/firmware/polyvec/src/log.rs +++ b/firmware/polyvec-hal/src/log.rs @@ -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 = 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) -> ! { @@ -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; diff --git a/firmware/polyvec-lib/.gitignore b/firmware/polyvec-lib/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/firmware/polyvec-lib/.gitignore @@ -0,0 +1 @@ +/target diff --git a/firmware/polyvec-lib/Cargo.lock b/firmware/polyvec-lib/Cargo.lock new file mode 100644 index 0000000..89ac70d --- /dev/null +++ b/firmware/polyvec-lib/Cargo.lock @@ -0,0 +1,587 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "embedded-graphics" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0649998afacf6d575d126d83e68b78c0ab0e00ca2ac7e9b3db11b4cbe8274ef0" +dependencies = [ + "az", + "byteorder", + "embedded-graphics-core", + "float-cmp", + "micromath", +] + +[[package]] +name = "embedded-graphics-core" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba9ecd261f991856250d2207f6d8376946cd9f412a2165d3b75bc87a0bc7a044" +dependencies = [ + "az", + "byteorder", +] + +[[package]] +name = "exr" +version = "1.71.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8" +dependencies = [ + "bit_field", + "flume", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + +[[package]] +name = "fdeflate" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "spin", +] + +[[package]] +name = "gif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "half" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "spin", + "stable_deref_trait", + "ufmt-write", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "image" +version = "0.24.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "exr", + "gif", + "jpeg-decoder", + "num-rational", + "num-traits", + "png", + "qoi", + "tiff", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" +dependencies = [ + "rayon", +] + +[[package]] +name = "lebe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "micromath" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c8dda44ff03a2f238717214da50f65d5a53b45cd213a7370424ffdb6fae815" + +[[package]] +name = "midi-types" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef0bbe5256e5c434947d790788426bb65773502784aed7b23408f7e7fb4d8eb5" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "png" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +dependencies = [ + "bitflags", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "polyvec-lib" +version = "0.1.0" +dependencies = [ + "critical-section", + "embedded-graphics", + "heapless", + "image", + "micromath", + "midi-types", + "strum", + "strum_macros", + "ufmt", +] + +[[package]] +name = "proc-macro2" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.39", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tiff" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "ufmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a64846ec02b57e9108d6469d98d1648782ad6bb150a95a9baac26900bbeab9d" +dependencies = [ + "ufmt-macros", + "ufmt-write", +] + +[[package]] +name = "ufmt-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d337d3be617449165cb4633c8dece429afd83f84051024079f97ad32a9663716" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ufmt-write" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "weezl" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] diff --git a/firmware/polyvec-lib/Cargo.toml b/firmware/polyvec-lib/Cargo.toml new file mode 100644 index 0000000..ad1d4a4 --- /dev/null +++ b/firmware/polyvec-lib/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "polyvec-lib" +version = "0.1.0" +edition = "2021" + +[lib] +name = "polyvec_lib" +path = "src/lib.rs" + +[dependencies] +embedded-graphics = "0.8.1" +midi-types = "0.1.7" +micromath = "2.0.0" +heapless = { version = "0.7.16", features = ["ufmt-impl"] } +ufmt = "0.2.0" +strum_macros = "0.25.3" +strum = {version = "0.25.0", features = ["derive"], default-features=false} + +[dev-dependencies] +critical-section = { version = "1.1.2", features = ["std"] } +image = "0.24.7" + +[profile.release] +lto = true +opt-level = 3 diff --git a/firmware/polyvec/src/draw.rs b/firmware/polyvec-lib/src/draw.rs similarity index 100% rename from firmware/polyvec/src/draw.rs rename to firmware/polyvec-lib/src/draw.rs diff --git a/firmware/polyvec/src/lib.rs b/firmware/polyvec-lib/src/lib.rs similarity index 100% rename from firmware/polyvec/src/lib.rs rename to firmware/polyvec-lib/src/lib.rs diff --git a/firmware/polyvec/src/opt.rs b/firmware/polyvec-lib/src/opt.rs similarity index 95% rename from firmware/polyvec/src/opt.rs rename to firmware/polyvec-lib/src/opt.rs index a5563f4..8ec304c 100644 --- a/firmware/polyvec/src/opt.rs +++ b/firmware/polyvec-lib/src/opt.rs @@ -43,6 +43,13 @@ pub enum TouchLedMirror { MirrorOn, } +#[derive(Clone, Copy, PartialEq, EnumIter, IntoStaticStr)] +#[strum(serialize_all = "kebab-case")] +pub enum NoteControl { + Touch, + Midi, +} + #[derive(Clone, Copy, PartialEq, EnumIter, IntoStaticStr)] #[strum(serialize_all = "SCREAMING-KEBAB-CASE")] pub enum Screen { @@ -71,7 +78,7 @@ pub struct ScopeOptions { #[derive(Clone)] pub struct TouchOptions { pub selected: Option, - pub threshold: NumOption, + pub note_control: EnumOption, pub led_mirror: EnumOption, } @@ -106,7 +113,7 @@ impl_option_view!(ScopeOptions, delay_len, trig_lvl, trig_sns); impl_option_view!(TouchOptions, - led_mirror, threshold); + note_control, led_mirror); #[derive(Clone)] @@ -184,12 +191,9 @@ impl Options { }, touch: TouchOptions { selected: None, - threshold: NumOption{ - name: "thresh".into(), - value: 128, - step: 1, - min: 0, - max: 255, + note_control: EnumOption{ + name: "control".into(), + value: NoteControl::Touch, }, led_mirror: EnumOption{ name: "led".into(), diff --git a/firmware/polyvec/src/voice.rs b/firmware/polyvec-lib/src/voice.rs similarity index 100% rename from firmware/polyvec/src/voice.rs rename to firmware/polyvec-lib/src/voice.rs diff --git a/firmware/polyvec/Cargo.lock b/firmware/polyvec/Cargo.lock index 796128f..3f40be5 100644 --- a/firmware/polyvec/Cargo.lock +++ b/firmware/polyvec/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "aho-corasick" version = "1.1.2" @@ -59,84 +53,18 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" - [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - [[package]] name = "critical-section" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" -[[package]] -name = "crossbeam-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "defmt" version = "0.3.5" @@ -218,41 +146,6 @@ dependencies = [ "nb 1.1.0", ] -[[package]] -name = "exr" -version = "1.71.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8" -dependencies = [ - "bit_field", - "flume", - "half", - "lebe", - "miniz_oxide", - "rayon-core", - "smallvec", - "zune-inflate", -] - -[[package]] -name = "fdeflate" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - [[package]] name = "float-cmp" version = "0.9.0" @@ -262,15 +155,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "flume" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" -dependencies = [ - "spin 0.9.8", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -281,25 +165,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "gif" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" -dependencies = [ - "color_quant", - "weezl", -] - -[[package]] -name = "half" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" -dependencies = [ - "crunchy", -] - [[package]] name = "hash32" version = "0.2.1" @@ -318,7 +183,7 @@ dependencies = [ "atomic-polyfill", "hash32", "rustc_version", - "spin 0.9.8", + "spin", "stable_deref_trait", "ufmt-write", ] @@ -329,25 +194,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "image" -version = "0.24.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "exr", - "gif", - "jpeg-decoder", - "num-rational", - "num-traits", - "png", - "qoi", - "tiff", -] - [[package]] name = "irq" version = "0.2.3" @@ -363,29 +209,11 @@ dependencies = [ "either", ] -[[package]] -name = "jpeg-decoder" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" -dependencies = [ - "rayon", -] - [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] - -[[package]] -name = "lebe" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "litex-hal" @@ -425,15 +253,6 @@ version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "micromath" version = "2.1.0" @@ -455,16 +274,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef0bbe5256e5c434947d790788426bb65773502784aed7b23408f7e7fb4d8eb5" -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", - "simd-adler32", -] - [[package]] name = "nb" version = "0.1.3" @@ -480,27 +289,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.17" @@ -516,19 +304,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "png" -version = "0.17.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" -dependencies = [ - "bitflags", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - [[package]] name = "polyvec" version = "0.1.0" @@ -538,15 +313,15 @@ dependencies = [ "embedded-graphics", "embedded-midi", "heapless", - "image", "irq", - "lazy_static", "litex-hal", "litex-interrupt", "litex-pac", "micromath", "midi-types", "paste", + "polyvec-hal", + "polyvec-lib", "riscv", "riscv-rt 0.11.0", "ssd1322", @@ -556,6 +331,34 @@ dependencies = [ "vexriscv", ] +[[package]] +name = "polyvec-hal" +version = "0.1.0" +dependencies = [ + "heapless", + "litex-hal", + "litex-pac", + "micromath", + "paste", + "riscv", + "riscv-rt 0.11.0", + "ufmt", + "vexriscv", +] + +[[package]] +name = "polyvec-lib" +version = "0.1.0" +dependencies = [ + "embedded-graphics", + "heapless", + "micromath", + "midi-types", + "strum", + "strum_macros", + "ufmt", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -589,15 +392,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - [[package]] name = "quote" version = "1.0.33" @@ -613,26 +407,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" -[[package]] -name = "rayon" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - [[package]] name = "regex" version = "1.10.2" @@ -751,24 +525,6 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" -[[package]] -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -858,17 +614,6 @@ dependencies = [ "syn 2.0.39", ] -[[package]] -name = "tiff" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" -dependencies = [ - "flate2", - "jpeg-decoder", - "weezl", -] - [[package]] name = "typenum" version = "1.17.0" @@ -931,18 +676,3 @@ name = "void" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "weezl" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" - -[[package]] -name = "zune-inflate" -version = "0.2.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" -dependencies = [ - "simd-adler32", -] diff --git a/firmware/polyvec/Cargo.toml b/firmware/polyvec/Cargo.toml index 2e2ab06..fe04ada 100644 --- a/firmware/polyvec/Cargo.toml +++ b/firmware/polyvec/Cargo.toml @@ -3,10 +3,6 @@ name = "polyvec" version = "0.1.0" edition = "2021" -[lib] -name = "polyvec_lib" -path = "src/lib.rs" - [[bin]] name = "polyvec_main" path = "src/main.rs" @@ -14,6 +10,8 @@ path = "src/main.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +polyvec-lib = { path = "../polyvec-lib" } +polyvec-hal = { path = "../polyvec-hal" } riscv = { version = "0.10.1", features = ["critical-section-single-hart"] } riscv-rt = { path = "../deps/riscv-rt", features = ["single-hart"] } litex-hal = { path = "../deps/rust-litex-hal", features = ["gpio"] } @@ -26,7 +24,6 @@ paste = "1.0.14" embedded-graphics = "0.8.1" heapless = { version = "0.7.16", features = ["ufmt-impl"] } ufmt = "0.2.0" -lazy_static = { version = "1.4.0", features = ["spin_no_std"] } vexriscv = "0.0.3" aligned-array = "1.0.1" irq = "0.2.3" @@ -35,10 +32,6 @@ critical-section = "1.1.2" strum_macros = "0.25.3" strum = {version = "0.25.0", features = ["derive"], default-features=false} -[dev-dependencies] -critical-section = { version = "1.1.2", features = ["std"] } -image = "0.24.7" - [profile.release] lto = true opt-level = 3 diff --git a/firmware/polyvec/src/main.rs b/firmware/polyvec/src/main.rs index eb0adcf..b36cef6 100644 --- a/firmware/polyvec/src/main.rs +++ b/firmware/polyvec/src/main.rs @@ -24,10 +24,9 @@ use polyvec_lib::voice::*; use polyvec_lib::draw; use polyvec_lib::opt; -mod gw; -mod log; -use crate::gw::*; -use crate::log::*; +use polyvec_hal::gw::*; +use polyvec_hal::log::*; +use polyvec_hal::*; const N_VOICES: usize = 4; const SCOPE_SAMPLES: usize = 128; @@ -203,6 +202,7 @@ struct State { midi_in: MidiIn, voice_manager: VoiceManager, encoder: Encoder, + last_control_type: Option, } impl State { @@ -212,6 +212,7 @@ impl State { midi_in, voice_manager: VoiceManager::new(), encoder, + last_control_type: None, } } @@ -245,55 +246,67 @@ impl State { let lpf = get_lpfs(&peripherals); - /* - while let Ok(event) = self.midi_in.read() { - self.voice_manager.event(event, uptime_ms); + if let Some(cv) = self.last_control_type { + if cv != opts.touch.note_control.value { + self.voice_manager = VoiceManager::new(); + } } - self.voice_manager.tick(uptime_ms, opts); - */ - - let pmod1 = &peripherals.EURORACK_PMOD1; - let pmod2 = &peripherals.EURORACK_PMOD2; - let pmod3 = &peripherals.EURORACK_PMOD3; - - let touch1 = pmod1.touch(); - let touch2 = pmod2.touch(); - let touch3 = pmod3.touch(); - - let mut touch_concat: [u8; 8*3] = [0u8; 8*3]; - touch_concat[0..8].copy_from_slice(&touch3); - touch_concat[8..16].copy_from_slice(&touch2); - touch_concat[16..24].copy_from_slice(&touch1); - - // Create a vector of tuples where each tuple consists of the index and value. - let mut touch: Vec<(usize, u8), 24> = touch_concat.iter().enumerate().map(|(i, &item)| (i, item)).collect(); - touch.sort_unstable_by(|a, b| b.1.cmp(&a.1)); - let mut top4_by_pitch: Vec<(usize, u8), 4> = Vec::from_slice(&touch[0..4]).unwrap(); - top4_by_pitch.sort_unstable_by(|a, b| b.0.cmp(&a.0)); - - let minor_map: [usize; 24] = [ - 0, 2, 3, 5, 7, 8, 10, 12, - 12+0, 12+2, 12+3, 12+5, 12+7, 12+8, 12+10, 24, - 24+0, 24+2, 24+3, 24+5, 24+7, 24+8, 24+10, 36, - ]; - - for n_voice in 0..N_VOICES { - //let voice = &self.voice_manager.voices[n_voice]; - let ampl = (top4_by_pitch[n_voice].1 as f32) / 256.0f32; - let note = (minor_map[top4_by_pitch[n_voice].0] + 36) as u8; - let pitch = note_to_pitch(note); - shifter[n_voice].set_pitch(pitch); - let ampl_old = (lpf[n_voice].cutoff() as f32) / 8000f32; - let ampl_new = ampl*0.05 + ampl_old*0.95; - lpf[n_voice].set_cutoff((ampl_new * 8000f32) as i16); - lpf[n_voice].set_resonance(opts.adsr.resonance.value); - - // Push to voice manager to visualizations work - self.voice_manager.voices[n_voice].amplitude = ampl_new; - self.voice_manager.voices[n_voice].note = note; - self.voice_manager.voices[n_voice].state = VoiceState::Sustain; + if opts.touch.note_control.value == opt::NoteControl::Midi { + while let Ok(event) = self.midi_in.read() { + self.voice_manager.event(event, uptime_ms); + } + self.voice_manager.tick(uptime_ms, opts); + for n_voice in 0..N_VOICES { + let voice = &self.voice_manager.voices[n_voice]; + shifter[n_voice].set_pitch(voice.pitch); + lpf[n_voice].set_cutoff((voice.amplitude * 8000f32) as i16); + lpf[n_voice].set_resonance(opts.adsr.resonance.value); + } + } else { + let pmod1 = &peripherals.EURORACK_PMOD1; + let pmod2 = &peripherals.EURORACK_PMOD2; + let pmod3 = &peripherals.EURORACK_PMOD3; + + let touch1 = pmod1.touch(); + let touch2 = pmod2.touch(); + let touch3 = pmod3.touch(); + + let mut touch_concat: [u8; 8*3] = [0u8; 8*3]; + touch_concat[0..8].copy_from_slice(&touch3); + touch_concat[8..16].copy_from_slice(&touch2); + touch_concat[16..24].copy_from_slice(&touch1); + + // Create a vector of tuples where each tuple consists of the index and value. + let mut touch: Vec<(usize, u8), 24> = touch_concat.iter().enumerate().map(|(i, &item)| (i, item)).collect(); + touch.sort_unstable_by(|a, b| b.1.cmp(&a.1)); + let mut top4_by_pitch: Vec<(usize, u8), 4> = Vec::from_slice(&touch[0..4]).unwrap(); + top4_by_pitch.sort_unstable_by(|a, b| b.0.cmp(&a.0)); + + let minor_map: [usize; 24] = [ + 0, 2, 3, 5, 7, 8, 10, 12, + 12, 12+2, 12+3, 12+5, 12+7, 12+8, 12+10, 24, + 24, 24+2, 24+3, 24+5, 24+7, 24+8, 24+10, 36, + ]; + + for n_voice in 0..N_VOICES { + let ampl = (top4_by_pitch[n_voice].1 as f32) / 256.0f32; + let note = (minor_map[top4_by_pitch[n_voice].0] + 36) as u8; + let pitch = note_to_pitch(note); + shifter[n_voice].set_pitch(pitch); + let ampl_old = (lpf[n_voice].cutoff() as f32) / 8000f32; + let ampl_new = ampl*0.05 + ampl_old*0.95; + lpf[n_voice].set_cutoff((ampl_new * 8000f32) as i16); + lpf[n_voice].set_resonance(opts.adsr.resonance.value); + + // Push to voice manager to visualizations work + self.voice_manager.voices[n_voice].amplitude = ampl_new; + self.voice_manager.voices[n_voice].note = note; + self.voice_manager.voices[n_voice].state = VoiceState::Sustain; + } } + + self.last_control_type = Some(opts.touch.note_control.value); } } @@ -351,7 +364,7 @@ fn oled_init(timer: &mut Timer, oled_spi: pac::OLED_SPI) #[no_mangle] pub extern "C" fn _putchar(c: u8) { - _logger_write(&[c]); + log::_logger_write(&[c]); } const USB_DEVICE_CONTROLLER_RESET_ADDRESS: *mut u32 = 0xF0010004 as *mut u32; @@ -365,7 +378,7 @@ fn main() -> ! { let peripherals = unsafe { pac::Peripherals::steal() }; log::init(peripherals.UART_MIDI); - log::info!("hello from litex-fw!"); + info!("hello from litex-fw!"); let mut timer = Timer::new(peripherals.TIMER0, SYSTEM_CLOCK_FREQUENCY);