diff --git a/.gitmodules b/.gitmodules index 6681d35..ebe7b44 100644 --- a/.gitmodules +++ b/.gitmodules @@ -67,3 +67,6 @@ [submodule "deps/pythondata-cpu-vexriscv_smp"] path = deps/pythondata-cpu-vexriscv_smp url = https://github.com/litex-hub/pythondata-cpu-vexriscv_smp.git +[submodule "firmware/deps/tinyusb-sys-rs"] + path = firmware/deps/tinyusb-sys-rs + url = git@github.com:schnommus/tinyusb-sys-rs.git diff --git a/firmware/deps/tinyusb-sys-rs b/firmware/deps/tinyusb-sys-rs new file mode 160000 index 0000000..6f877c3 --- /dev/null +++ b/firmware/deps/tinyusb-sys-rs @@ -0,0 +1 @@ +Subproject commit 6f877c356f19728fd55ef3adc48c614275d7ec22 diff --git a/firmware/litex-fw/src/main.rs b/firmware/litex-fw/src/main.rs index 18b1973..b570e13 100644 --- a/firmware/litex-fw/src/main.rs +++ b/firmware/litex-fw/src/main.rs @@ -17,7 +17,7 @@ use critical_section::Mutex; use irq::{handler, scope, scoped_interrupts}; use litex_interrupt::return_as_is; -use tinyusb_sys::tusb_init; +use tinyusb_sys::{tusb_init, dcd_int_handler, tud_task}; use ssd1322 as oled; @@ -304,6 +304,21 @@ fn oled_init(timer: &mut Timer, oled_spi: pac::OLED_SPI) disp } +#[no_mangle] +pub extern "C" fn tud_dfu_get_timeout_cb(alt: u8, state: u8) -> u32 { + // TODO + 0u32 +} + +#[no_mangle] +pub extern "C" fn tud_dfu_download_cb(alt: u8, block_num: u16, data: *const u8, length: u16) { + // TODO +} + +#[no_mangle] +pub extern "C" fn tud_dfu_manifest_cb(alt: u8) { + // TODO +} #[entry] fn main() -> ! { @@ -336,6 +351,8 @@ fn main() -> ! { unsafe { tusb_init(); + dcd_int_handler(0); + tud_task(); } handler!(dma_router0 = || dma_router0_handler(&dma_router, &oscope));