don't reset arduino if we're currently getting good input

This commit is contained in:
Frank DeMarco 2020-10-06 23:53:03 -04:00
parent 7b92f7ee12
commit ad4be8e337
2 changed files with 5 additions and 2 deletions

5
NS.py
View File

@ -199,10 +199,13 @@ class NS(Game, Animation):
Animation.update(self)
last_frame_duration = self.time_filter.get_last_frame_duration()
if self.serial_enabled() or True:
# self.apply_serial()
self.apply_serial()
if self.title.active or self.introduction.active or self.ending.active or \
self.dialogue.active:
self.no_reset_elapsed += last_frame_duration
# if we received good input, reset the auto reset timer
if 0b11 <= self.serial_data <= 0b1100:
self.no_reset_elapsed = 0
if self.no_reset_elapsed >= self.NO_RESET_TIMEOUT:
print("auto arduino reset triggered")
self.reset_arduino()

2
config
View File

@ -1,7 +1,7 @@
[setup]
license = Public Domain
title = Electric Scrapeboard
url = http://A-O.in/
url = http://shampoo.ooo/games/esb
version = 0.2
init-script = OPEN-GAME
additional-packages = lib