Skip to content

Commit

Permalink
add readme for firmware building, update case for final pcb
Browse files Browse the repository at this point in the history
  • Loading branch information
NotQuiteApex committed Dec 12, 2024
1 parent 04cd90a commit 1ec882b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
19 changes: 19 additions & 0 deletions firmware/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Building the firmware
This is a small document for setting up a development environment to build the firmware. You'll need a couple things to get started.

1. (Linux only) Install the [RPi Pico udev rules](https://github.com/raspberrypi/picotool/blob/master/udev/99-picotool.rules). Add the following rules:
```
SUBSYSTEM=="usb", \
ATTRS{idVendor}=="2e8a", \
ATTRS{idProduct}=="000c", \
TAG+="uaccess" \
MODE="660", \
GROUP="plugdev"
```

2. Install the appropriate target toolchain: `rustup target add thumbv6m-none-eabi`.
3. Install cmake for tool compilation.
4. (Linux only) Install libudev-dev.
5. Install tools: `cargo install flip-link`.
5. Install tools: `cargo install --locked probe-rs-tools`. This is for installing firmware over Pico probe.
6. Run `cargo run` to install.
4 changes: 2 additions & 2 deletions firmware/src/modules/rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'timer> RgbMod<'timer> {

RgbMod {
ws: ws,
brightness: 10,
brightness: 40,
buffer: [(0, 0, 0).into(); RGB_LEN],
timer: count_down,
}
Expand All @@ -53,7 +53,7 @@ impl<'timer> RgbMod<'timer> {
return;
}

let t = ((t.duration_since_epoch().ticks() >> 12) % 360) as f32;
let t = ((t.duration_since_epoch().ticks() >> 14) % 360) as f32;

for (i, led) in self.buffer.iter_mut().enumerate() {
*led = hsv2rgb((t + (10 * (RGB_LEN - i)) as f32) % 360.0, 1.0, 1.0).into();
Expand Down
13 changes: 7 additions & 6 deletions hardware-case/case.scad
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cmN = 3.3;
// Face count on rounded objects
$fn=32;
// Case connector hole size
ioHS = 20;
ioHS = 11;
// Case connector hole offset
ioHO = cS-cmO-7;
// Case connector hole buffer
Expand Down Expand Up @@ -241,7 +241,7 @@ module case_bottom() {
square4(clS, cS-clS*2-cpW*2, clH) roundedsquare(cpM, cpM, cpH, cpR);

// USB-C pillar
translate([0, ioHO-ioHS+ioHB, clH]) cube([clS, ioHS-ioHB*2, cpW+1.6]);
translate([0, ioHO-ioHS+ioHB, clH]) cube([1.5, ioHS-ioHB*2, 4]);
}

union() {
Expand All @@ -256,7 +256,7 @@ module case_bottom() {
square4(cpF, cS-cpF, cpFH/2) cylinder(d1=cpFD, d2=cpFD-2, h=cpFH/2);

// cutout for through hole components
translate([clS, ioHO-ioHS+ioHB+1, clH]) cube([10, ioHS-ioHB*2-2, cpH]);
translate([clS, ioHO-ioHS+ioHB, clH]) cube([10, ioHS-ioHB*2, cpH]);
}
}
}
Expand Down Expand Up @@ -315,11 +315,12 @@ difference() {
// cutout for io
union() {
// USB side
translate([0, ioHO-ioHS, clH]) cube([3, ioHS, 10]);
// translate([0, ioHO-ioHS+ioHB, clH]) cube([clS, ioHS-ioHB*2, cpW+1.6]);
// translate([0, ioHO-ioHS, clH]) cube([3, ioHS, 10]);

// Debug pad side
ioHS2 = 23-1.5;
ioHO2 = cS-cmO-2.5;
ioHS2 = 23-3;
ioHO2 = cS-cmO-2.5-1.5;
translate([cS-2.5, ioHO2-ioHS2, clH]) cube([2.5, ioHS2, 3.8]);
translate([cS-12, ioHO2-ioHS2, clH]) cube([12, ioHS2, 3]);
}
Expand Down

0 comments on commit 1ec882b

Please sign in to comment.