Skip to content

Commit 562e31a

Browse files
committed
fix firmware crash, fix icon size in software, fix version numberings
1 parent 0ca65a7 commit 562e31a

13 files changed

Lines changed: 44 additions & 48 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# v0.6.1 - But Not Serialized (August 5, 2025)
2+
- Fix firmware having too big of a serial buffer, causing a crash on startup.
3+
- Fix versioning issue with firmware and software.
4+
- Fix action icon size in software.
5+
16
# v0.6.0 - Defaultized (August 5, 2025)
27
- Added EEPROM support to firmware. A default, app-disconnected profile can now be set. Support in GUI will be added at a later date.
38
- Added "sleep mode" for when host computer goes to sleep (suspends USB), turning off the screen and RGB.

desktop/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

desktop/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "jukebox_desktop"
3-
version = "0.5.0"
3+
version = "0.6.1"
44
edition = "2021"
55
build = "build.rs"
66
license = "MIT"

desktop/src/actions/types.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::{
77
};
88

99
use eframe::egui::{
10-
load::Bytes, vec2, Image, ImageSource, TextureFilter, TextureOptions, TextureWrapMode, Ui,
10+
load::Bytes, Image, ImageSource, TextureFilter, TextureOptions, TextureWrapMode, Ui,
1111
};
1212
use jukebox_util::peripheral::DeviceType;
1313
use serde::{Deserialize, Serialize};
@@ -111,7 +111,6 @@ macro_rules! create_actions {
111111
mipmap_mode: None,
112112
})
113113
.corner_radius(2.0)
114-
.max_size(vec2(64.0, 64.0))
115114
}
116115
}
117116
};

desktop/src/gui/action.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,12 @@ impl JukeBoxGui {
241241
wrap_mode: TextureWrapMode::ClampToEdge,
242242
mipmap_mode: None,
243243
})
244-
.corner_radius(2.0)
245-
.max_size(vec2(64.0, 64.0));
246-
Button::image(i)
244+
.corner_radius(2.0);
245+
Button::new(i)
247246
}
248247
ActionIcon::DefaultActionIcon => {
249248
let i = self.editing_action.icon();
250-
Button::image(i)
249+
Button::new(i)
251250
}
252251
};
253252
let test_btn = ui

desktop/src/gui/device.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,12 @@ impl JukeBoxGui {
114114
wrap_mode: TextureWrapMode::ClampToEdge,
115115
mipmap_mode: None,
116116
})
117-
.corner_radius(2.0)
118-
.max_size(vec2(64.0, 64.0));
119-
Button::image(i)
117+
.corner_radius(2.0);
118+
Button::new(i)
120119
}
121120
ActionIcon::DefaultActionIcon => {
122121
let i = a.icon();
123-
Button::image(i)
122+
Button::new(i)
124123
}
125124
};
126125

firmware/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

firmware/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "jukebox_firmware"
3-
version = "0.5.0"
3+
version = "0.6.1"
44
edition = "2021"
55
license = "MIT"
66

firmware/src/main.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ use usbd_human_interface_device::{
6767
};
6868
use usbd_serial::SerialPort;
6969

70+
use crate::util::USB_SUSPENDED;
7071
#[allow(unused_imports)]
7172
use defmt::*;
73+
7274
use {defmt_rtt as _, panic_probe as _};
7375

7476
use jukebox_util::peripheral::JBInputs;
@@ -385,16 +387,12 @@ fn main() -> ! {
385387
let _ = usb_hid.device::<NKROBootKeyboard<'_, _>, _>().read_report();
386388
}
387389

388-
util::USB_STATUS.with_mut_lock(|s| {
389-
// if *s != usb_dev.state() {
390-
// match usb_dev.state() {
391-
// UsbDeviceState::Default => info!("usb state: default"),
392-
// UsbDeviceState::Addressed => info!("usb state: addressed"),
393-
// UsbDeviceState::Configured => info!("usb state: configured"),
394-
// UsbDeviceState::Suspend => info!("usb state: suspend"),
395-
// }
396-
// }
397-
*s = usb_dev.state();
398-
});
390+
USB_SUSPENDED.store(
391+
match usb_dev.state() {
392+
UsbDeviceState::Configured => false,
393+
_ => true,
394+
},
395+
core::sync::atomic::Ordering::Relaxed,
396+
);
399397
}
400398
}

firmware/src/modules/rgb.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ use rp2040_hal::{
1111
};
1212
use smart_leds::brightness;
1313
use smart_leds_trait::{SmartLedsWrite, RGB8};
14-
use usb_device::device::UsbDeviceState;
1514
use ws2812_pio::Ws2812;
1615

17-
use crate::util::{DEFAULT_RGB_PROFILE, RGB_CONTROLS, USB_STATUS};
16+
use crate::util::{usb_suspended, DEFAULT_RGB_PROFILE, RGB_CONTROLS};
1817

1918
const RGB_LEN: usize = 12;
2019
const FRAME_TIME: u32 = 33;
@@ -24,7 +23,6 @@ pub struct RgbMod {
2423
buffer: [RGB8; RGB_LEN],
2524
timer: CountDown,
2625
rgb_mode: RgbProfile,
27-
usb_state: UsbDeviceState,
2826
}
2927

3028
impl RgbMod {
@@ -41,7 +39,6 @@ impl RgbMod {
4139
buffer: [(0, 0, 0).into(); RGB_LEN],
4240
timer: count_down,
4341
rgb_mode: default_rgb_profile,
44-
usb_state: UsbDeviceState::Default,
4542
}
4643
}
4744

@@ -64,11 +61,10 @@ impl RgbMod {
6461
}
6562
c.0 = false;
6663
});
67-
self.usb_state = USB_STATUS.with_lock(|p| *p);
6864

6965
let buffer = self.rgb_mode.calculate_matrix(t);
7066

71-
let brtns = if self.usb_state == UsbDeviceState::Suspend {
67+
let brtns = if usb_suspended() {
7268
0
7369
} else {
7470
self.rgb_mode.brightness()

0 commit comments

Comments
 (0)