tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit fce78a938eafa838424f1f9dda57ce2c3e4dd738
parent 4f2e0e8123e9da8fbaac077602a4320b689d2025
Author: rbckman <rbckman@localhost.localdomain>
Date:   Thu,  9 Mar 2017 11:33:03 +0200

shutdown fix

Diffstat:
MVERSION | 2+-
Rmcp23017_pinout.png -> extras/mcp23017_pinout.png | 0
Mtarina.py | 8+++++---
3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/VERSION b/VERSION @@ -1,2 +1,2 @@ -0.95 +0.965 Tarina 2017 diff --git a/mcp23017_pinout.png b/extras/mcp23017_pinout.png Binary files differ. diff --git a/tarina.py b/tarina.py @@ -998,7 +998,7 @@ def getbutton(lastbutton, buttonpressed, buttontime, holdbutton): buttonpressed = True buttontime = time.time() holdbutton = pressed - if readbus == 255: + if readbus == 255 and readbus2 == 245: buttonpressed = False if float(time.time() - buttontime) > 0.15 and buttonpressed == True: pressed = holdbutton @@ -1157,8 +1157,10 @@ def main(): elif pressed == 'shutdown': time.sleep(0.1) if recording == False: - bus.write_byte_data(DEVICE,OLATA,0) - os.system('shutdown -h now') + writemessage('Hold down 2s to shutdown') + if buttontime > 2.1: + bus.write_byte_data(DEVICE,OLATA,0) + os.system('shutdown -h now') #RECORD AND PAUSE elif pressed == 'record' or pressed == 'retake' or reclenght != 0 and t > reclenght or t > 800: