aboutsummaryrefslogtreecommitdiffstats
path: root/src-riscv/log.rs
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2022-10-29 21:48:07 -0400
committerBrian Cully <bjc@kublai.com>2022-10-29 21:48:07 -0400
commitfc0d9fe0e73348e5599bbc232c7dbf4f98d65ea5 (patch)
treeb80eb240bd430ed5213ba0536508a68b2757cccf /src-riscv/log.rs
parent06fa7f990885ec17220df66094cbe6663719a4da (diff)
downloadluchie-fc0d9fe0e73348e5599bbc232c7dbf4f98d65ea5.tar.gz
luchie-fc0d9fe0e73348e5599bbc232c7dbf4f98d65ea5.zip
riscv: remove code
all previous functionality has been replicated, and the code lives in a branch anyway.
Diffstat (limited to 'src-riscv/log.rs')
-rw-r--r--src-riscv/log.rs36
1 files changed, 0 insertions, 36 deletions
diff --git a/src-riscv/log.rs b/src-riscv/log.rs
deleted file mode 100644
index ddb6792..0000000
--- a/src-riscv/log.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-use core::fmt::{write, Arguments};
-
-use gd32vf103xx_hal::{
- serial::Tx,
- pac::USART1,
-};
-use riscv::interrupt::{self, Mutex};
-
-#[macro_export]
-macro_rules! log {
- ($($args:tt)+) => {
- $crate::log::log_args(core::format_args!($($args)+))
- }
-}
-
-#[macro_export]
-macro_rules! logln {
- () => ({ kprint!("\r\n") });
- ($fmt: literal $(, $($arg: tt)+)?) => {
- log!(concat!($fmt, "\n") $(, $($arg)+)?)
- }
-}
-
-static mut TX: Mutex<Option<Tx<USART1>>> = Mutex::new(None);
-
-pub fn init(tx: Tx<USART1>) {
- interrupt::free(|_cs| {
- unsafe { TX.get_mut().insert(tx) };
- });
-}
-
-pub fn log_args(args: Arguments) {
- interrupt::free(|_cs| {
- unsafe { TX.get_mut().as_mut().map(|tx| write(tx, args)) };
- });
-}