Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ path = [
"docs/CNAME",
".husky/**",
"package-lock.json",
"pnpm-lock.yaml",
]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 hexaTune LLC"
Expand Down
2 changes: 1 addition & 1 deletion firmware/src/at/at_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub async fn at_task(
loop {
match at_rx.receive().await {
Msg::AtCmd(MsgDirection::Input, line) => {
if let Some(e) = dispatcher.dispatch(spawner, at_tx, usb_tx, rgb_tx, &line) {
if let Some(e) = dispatcher.dispatch(spawner, at_tx, rgb_tx, &line) {
error!("Dispatch error: {:?}", &e.code());
let compiled = compile_at_error(e);
usb_tx.send(Msg::UsbTxLine(compiled)).await;
Expand Down
1 change: 0 additions & 1 deletion firmware/src/at/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ impl AtDispatcher {
&self,
spawner: Spawner,
at_tx: Sender<'static, Cs, Msg, CAP>,
usb_tx: Sender<'static, Cs, Msg, CAP>,
rgb_tx: Sender<'static, Cs, Msg, CAP>,
input: &str,
) -> Option<Error> {
Expand Down
4 changes: 1 addition & 3 deletions firmware/src/at/handlers/fwupdate_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,5 @@ impl AtHandler for FwUpdateHandler {
async fn fwupdate_task() {
info!("Entering BOOTSEL mode for firmware update");
embassy_time::Timer::after_millis(100).await;
unsafe {
embassy_rp::rom_data::reset_to_usb_boot(0, 0);
}
embassy_rp::rom_data::reset_to_usb_boot(0, 0);
}
32 changes: 9 additions & 23 deletions firmware/src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,15 @@

#[derive(Debug, Clone)]
pub enum Error {
InvalidCommand, // "Not an AT command"
InvalidBase64, // "Invalid base64 param"
InvalidUtf8, // "Invalid UTF-8 in param"
InvalidSysEx, // "Invalid SysEx"
InvalidDataLenght, // "Invalid data length"
ParamCount, // "Param count"
ParamValue, // "Param value"
NotAQuery, // "Not a query"
UnknownCommand, // "Unknown command"
FirmwareUpdateFlow, // "Firmware update flow error"
UpdateNotStarted, // "FW update not started"
InvalidOffset, // "Invalid offset"
FlashWrite, // "Flash write error"
LengthMismatch, // "Length mismatch"
CrcMismatch, // Crc mismatch"
CommitFailed, // Commit failed"
InvalidCommand, // "Not an AT command"
InvalidBase64, // "Invalid base64 param"
InvalidUtf8, // "Invalid UTF-8 in param"
InvalidSysEx, // "Invalid SysEx"
InvalidDataLenght, // "Invalid data length"
ParamCount, // "Param count"
ParamValue, // "Param value"
NotAQuery, // "Not a query"
UnknownCommand, // "Unknown command"
}

impl Error {
Expand All @@ -34,13 +27,6 @@ impl Error {
Error::ParamValue => "E001007",
Error::NotAQuery => "E001008",
Error::UnknownCommand => "E001009",
Error::FirmwareUpdateFlow => "E001010",
Error::UpdateNotStarted => "E001011",
Error::InvalidOffset => "E001012",
Error::FlashWrite => "E001013",
Error::LengthMismatch => "E001014",
Error::CrcMismatch => "E001015",
Error::CommitFailed => "E001016",
}
}
}
1 change: 0 additions & 1 deletion firmware/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#![no_std]
#![no_main]

use core::cell::RefCell;
use defmt::info;
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex as Cs;
use embassy_sync::mutex::Mutex as AsyncMutex;
Expand Down
4 changes: 2 additions & 2 deletions firmware/src/rgb/led.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl RgbLed {
self.led.write(&self.buf).await;
}

pub async fn off(&mut self) {
/*pub async fn off(&mut self) {
self.set_rgb(0, 0, 0).await;
}
}*/
}
15 changes: 6 additions & 9 deletions firmware/src/rgb/rgb_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ pub async fn rgb_task(
) {
info!("Starting RGB task");
loop {
match rgb_rx.receive().await {
Msg::RgbWithValue(r, g, b) => {
info!("Setting RGB to ({}, {}, {})", r, g, b);
rgb_led.set_rgb(r, g, b).await;
info!("RGB set");
info!("Sending OK from RGB task");
at_tx.send(Msg::Ok).await;
}
_ => {}
if let Msg::RgbWithValue(r, g, b) = rgb_rx.receive().await {
info!("Setting RGB to ({}, {}, {})", r, g, b);
rgb_led.set_rgb(r, g, b).await;
info!("RGB set");
info!("Sending OK from RGB task");
at_tx.send(Msg::Ok).await;
}
}
}
1 change: 0 additions & 1 deletion firmware/src/usb/usb_task.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2025 hexaTune LLC
// SPDX-License-Identifier: MIT

use core::sync::atomic::{AtomicBool, Ordering};
use defmt::{error, info};
use embassy_futures::select::{Either, select};
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex as Cs;
Expand Down
Loading
Loading