This commit is contained in:
cuu 2018-07-05 17:08:07 +08:00
parent bf58f36be9
commit 15f4839a45
2 changed files with 20 additions and 7 deletions

View File

@ -91,8 +91,21 @@ class CounterScreen(FullScreen):
commands.getstatusoutput("echo 0 > /proc/driver/led1")
pygame.time.delay(800)
commands.getstatusoutput("echo 0 > /proc/driver/led1")
commands.getstatusoutput("echo 0 > /proc/driver/led1")
try:
f = open("/proc/driver/led1","w")
except IOError:
print( "RestoreLastBackLightBrightness open %s failed, try to adjust brightness in Settings" % config.BackLight)
pass
else:
with f:
f.seek(0)
f.write("0")
f.truncate()
f.close()
def Init(self):
self._CanvasHWND = pygame.Surface((self._Width,self._Height))
self._TopLabel = Label()

View File

@ -104,11 +104,6 @@ def RestoreLastBackLightBrightness(main_screen):
gobject.source_remove(gobject_flash_led1)
gobject_flash_led1 = -1
if main_screen._CounterScreen._Counting==True:
main_screen._CounterScreen.StopCounter()
main_screen.Draw()
main_screen.SwapAndShow()
return False
if last_brt == -1:
return True
@ -131,8 +126,13 @@ def RestoreLastBackLightBrightness(main_screen):
last_brt = -1
else:
f.close()
return True
if main_screen._CounterScreen._Counting==True:
main_screen._CounterScreen.StopCounter()
main_screen.Draw()
main_screen.SwapAndShow()
return False
return True
def InspectionTeam(main_screen):