Browse Source

new initialization varian to avoid invalid GPIO initialization

master
Michael Preisach 7 years ago
parent
commit
7a8e890b75
  1. 18
      src/protocol.rs

18
src/protocol.rs

@ -35,20 +35,20 @@ pub struct Protocol {
impl Protocol { impl Protocol {
pub fn new() -> Protocol { pub fn new() -> Protocol {
Protocol { Protocol {
segments: Vec::with_capacity(8), segments: Vec::new(),
running: false, running: false,
} }
} }
pub fn init(&mut self) { pub fn init(&mut self) {
self.segments[0] = Segment::new(5); self.segments.push(Segment::new(16));
self.segments[1] = Segment::new(6); self.segments.push(Segment::new(20));
self.segments[2] = Segment::new(13); self.segments.push(Segment::new(21));
self.segments[3] = Segment::new(19); self.segments.push(Segment::new(26));
self.segments[4] = Segment::new(26); self.segments.push(Segment::new(19));
self.segments[5] = Segment::new(21); self.segments.push(Segment::new(13));
self.segments[6] = Segment::new(20); self.segments.push(Segment::new(6));
self.segments[7] = Segment::new(16); self.segments.push(Segment::new(5));
} }
pub fn start(&mut self) { pub fn start(&mut self) {

Loading…
Cancel
Save