]> patrickod personal git archive - keywing-rs.git/blobdiff - keywing/src/main.rs
2021 nix flake updates & some minor cleanup
[keywing-rs.git] / keywing / src / main.rs
index 28841c15c79ac518989ed4f1c5c24fff83eba6c4..aaa1d488e7e114d422597a8f9efe7d85f180fc82 100644 (file)
@@ -56,6 +56,12 @@ fn inner_main() -> Result<(), &'static str> {
     );
     let mut delay = Delay::new(_core.SYST, &mut _clocks);
 
+    // set pins low to prevent floating values read as data by the pixels
+    let mut front_neopixel_pin = _pins.d11.into_push_pull_output(&mut _pins.port);
+    let mut rear_neopixel_pin = _pins.neopixel.into_push_pull_output(&mut _pins.port);
+    front_neopixel_pin.set_low().unwrap();
+    rear_neopixel_pin.set_high().unwrap();
+
     // use ChannelMode::NoBlockS
     rtt_init_print!(NoBlockSkip, 4096);
 
@@ -107,14 +113,10 @@ fn inner_main() -> Result<(), &'static str> {
 
     lcd.set_orientation(Orientation::Landscape).unwrap();
 
-    let mut _buffy = [0u16; 24 * 32];
     let mut buffy2 = [[0u16; 320]; 240];
 
     let mut fbuffy = buffer::FrameBuffer::new(&mut buffy2);
 
-    // //                                     rrrrr gggggg bbbbb
-    // buffy.iter_mut().for_each(|px| *px = 0b11111_000000_00000);
-
     let mut style = TextStyleBuilder::new(Font8x16)
         .text_color(Rgb565::WHITE)
         .background_color(Rgb565::BLACK)