summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-02-17 17:26:44 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-02-17 17:26:44 +0100
commit87a87f5843e71aa9057a091c1790eb2507eac61c (patch)
tree6653ca0b38306069149015ed27190e40515685dc
parentbffcdb4987acb5a49e2756df355ae9d55fdb112d (diff)
system: Reset storage after receipt of START signal
-rw-r--r--src/system.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/system.cc b/src/system.cc
index 864f98a..eb2caf6 100644
--- a/src/system.cc
+++ b/src/system.cc
@@ -60,8 +60,10 @@ void System::receive(void)
rxExpect = START2;
break;
case START2:
- if (rx_byte == 0x99)
+ if (rx_byte == 0x99) {
rxExpect = PATTERN1;
+ storage.reset();
+ }
break;
case PATTERN1:
if (rx_byte == 0xa9)