diff --git a/firmware/README.md b/firmware/README.md new file mode 100644 index 0000000..f0c4b42 --- /dev/null +++ b/firmware/README.md @@ -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. diff --git a/firmware/src/modules/rgb.rs b/firmware/src/modules/rgb.rs index 185dc50..e9adf9a 100644 --- a/firmware/src/modules/rgb.rs +++ b/firmware/src/modules/rgb.rs @@ -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, } @@ -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(); diff --git a/hardware-case/case.scad b/hardware-case/case.scad index c2cc46d..35f8261 100644 --- a/hardware-case/case.scad +++ b/hardware-case/case.scad @@ -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 @@ -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() { @@ -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]); } } } @@ -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]); }