This commit is contained in:
2026-08-18 20:43:32 -05:00
parent dc935d56ee
commit 985a329da4
4 changed files with 128 additions and 20 deletions
+15 -1
View File
@@ -12,7 +12,8 @@ use embassy_rp::{
use embassy_time::Timer;
use panic_probe as _;
use crate::usb::handle_usb;
use crate::usb::{USB_TX_CHANNEL, handle_usb};
use usb_communication_shared::response::*;
mod usb;
@@ -29,14 +30,27 @@ async fn main(spawner: Spawner) {
let usb_driver = UsbDriver::new(p.USB, Irqs);
let pin = embassy_rp::gpio::Output::new(p.PIN_26, true);
spawner.spawn(handle_usb(usb_driver).unwrap());
let led_future = async {
loop {
info!("led on!");
let response = Packet::LedStatus(LedStatus {
id: 0,
status: LedState::On,
});
USB_TX_CHANNEL.send(response).await;
Timer::after_millis(500).await;
info!("led off!");
let response = Packet::LedStatus(LedStatus {
id: 0,
status: LedState::Off,
});
USB_TX_CHANNEL.send(response).await;
Timer::after_millis(500).await;
}
};