Skip to content

Commit

Permalink
Added no print to the register time (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
quekyj authored Mar 7, 2023
1 parent 344db0e commit 023fc58
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions example/oven_fsm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,16 @@ Future<void> main({bool noPrint = false}) async {
WaveDumper(oven, outputPath: 'oven.vcd');
}

// We can listen to the streams on LED light changes based on time.
oven.led.changed.listen((event) {
// Get the led light enum name from LogicValue.
final ledVal = LEDLight.values[event.newValue.toInt()].name;

// Print the Simulator time when the LED light changes.
print('@t=${Simulator.time}, LED changed to: $ledVal');
});
if (!noPrint) {
// We can listen to the streams on LED light changes based on time.
oven.led.changed.listen((event) {
// Get the led light enum name from LogicValue.
final ledVal = LEDLight.values[event.newValue.toInt()].name;

// Print the Simulator time when the LED light changes.
print('@t=${Simulator.time}, LED changed to: $ledVal');
});
}

// Drop reset at time 25.
Simulator.registerAction(25, () => reset.put(0));
Expand Down

0 comments on commit 023fc58

Please sign in to comment.