Improve debugging

pull/1/head
trivernis 5 years ago
parent 7f9140a97e
commit 8b33077bff

@ -35,7 +35,7 @@ A virtual machine for controlling a wifi led strip.
| jl (rgd, rgi, rgl) | jumps to rgl if rgd < rgi | 0x21 | | jl (rgd, rgi, rgl) | jumps to rgl if rgd < rgi | 0x21 |
| je (rgd, rgi, rgl) | jumps to rgl if rgd == rgi | 0x22 | | je (rgd, rgi, rgl) | jumps to rgl if rgd == rgi | 0x22 |
| pause (rgd) | pauses for rgd milliseconds | 0xF0 | | pause (rgd) | pauses for rgd milliseconds | 0xF0 |
| cmd (rgd) | executes the command in rgd | 0xF1 | | cmd (rgd) (currently not supported) | executes the command in rgd | 0xF1 |
| send (rcr, rcg, rcb)| sends the values stored in the color registers to the strip | 0xF2 | | send (rcr, rcg, rcb)| sends the values stored in the color registers to the strip | 0xF2 |
### Registers ### Registers

@ -143,10 +143,10 @@ impl Runtime {
let text = text_ref.borrow_mut(); let text = text_ref.borrow_mut();
while self.current_index < text.len() { while self.current_index < text.len() {
let token = text.get(self.current_index).unwrap(); let token = text.get(self.current_index).unwrap();
token.invoke(self)?;
if self.debug { if self.debug {
println!("{:?}", token); println!("{:0>4}: {:?}", self.current_index, token);
} }
token.invoke(self)?;
if let Some(code) = self.exit { if let Some(code) = self.exit {
self.strip_controller self.strip_controller

@ -629,8 +629,6 @@ impl Token for CmdToken {
fn invoke(&self, _: &mut Runtime) -> io::Result<()> { fn invoke(&self, _: &mut Runtime) -> io::Result<()> {
unimplemented!(); unimplemented!();
Ok(())
} }
} }

Loading…
Cancel
Save