add usb hard reset
This commit is contained in:
parent
dd00c560eb
commit
49cf68ab63
12
main.py
12
main.py
|
@ -3,13 +3,12 @@
|
||||||
import os, time, signal, traceback, logging
|
import os, time, signal, traceback, logging
|
||||||
import RPi.GPIO as GPIO
|
import RPi.GPIO as GPIO
|
||||||
|
|
||||||
from sharedLogging import unmountGluster
|
from sharedLogging import unmountGluster # this should be first program module
|
||||||
|
from stateMachine import StateMachine
|
||||||
|
from auxilary import resetUSBDevice
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
def printTrace(t):
|
|
||||||
logger.critical('\n' + t)
|
|
||||||
|
|
||||||
def clean():
|
def clean():
|
||||||
GPIO.cleanup()
|
GPIO.cleanup()
|
||||||
|
|
||||||
|
@ -34,10 +33,10 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
GPIO.setwarnings(False)
|
GPIO.setwarnings(False)
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
|
resetUSBDevice('1-1')
|
||||||
|
|
||||||
from notifier import criticalError
|
from notifier import criticalError
|
||||||
|
|
||||||
from stateMachine import StateMachine
|
|
||||||
stateMachine = StateMachine()
|
stateMachine = StateMachine()
|
||||||
|
|
||||||
# TODO: segfaults are annoying :(
|
# TODO: segfaults are annoying :(
|
||||||
|
@ -55,9 +54,6 @@ if __name__ == '__main__':
|
||||||
except NameError:
|
except NameError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
|
||||||
logger.critical(t)
|
|
||||||
except NameError:
|
|
||||||
logger.critical(t)
|
logger.critical(t)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in New Issue