Skip to content

Commit

Permalink
Fix frontpanel support for DM8000,
Browse files Browse the repository at this point in the history
modified behaviour on hardware with single frontpanel led (disabled in standby)
  • Loading branch information
tmbinc committed May 24, 2009
1 parent c5bb99f commit 28a0e99
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/python/Components/Renderer/FrontpanelLed.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def changed(self, *args, **kwargs):
pass
if self.which == 0:
try:
open("/proc/stb/fp/led_pattern", "w").write("%08x" % pattern_4bit)
open("/proc/stb/fp/led_set_pattern", "w").write("%08x" % pattern_4bit)
open("/proc/stb/fp/led_set_speed", "w").write("%d" % speed)
except IOError:
pass
try:
Expand Down
17 changes: 16 additions & 1 deletion lib/python/Components/SystemInfo.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
from enigma import eDVBResourceManager
from Tools.Directories import fileExists

SystemInfo = { }

#FIXMEE...
def getNumVideoDecoders():
from Tools.Directories import fileExists
idx = 0
while fileExists("/dev/dvb/adapter0/video%d"%(idx), 'f'):
idx += 1
return idx

SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()


def countFrontpanelLEDs():
leds = 0
if fileExists("/proc/stb/fp/led_set_pattern"):
leds += 1

while fileExists("/proc/stb/fp/led%d_pattern" % leds):
leds += 1

return leds

SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
16 changes: 12 additions & 4 deletions lib/python/Screens/SessionGlobals.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def __init__(self, session):
self["TunerInfo"] = TunerInfo()
self["RecordState"] = RecordState(session)
self["Standby"] = Boolean(fixed = False)

from Components.SystemInfo import SystemInfo

combine = Combine(func = lambda s: {(False, False): 0, (False, True): 1, (True, False): 2, (True, True): 3}[(s[0].boolean, s[1].boolean)])
combine.connect(self["Standby"])
combine.connect(self["RecordState"])
Expand All @@ -33,9 +36,14 @@ def __init__(self, session):
# false true on off off
# true true blnk off blnk

PATTERN_ON = (20, 0xffffffff, 0)
PATTERN_OFF = (20, 0, 0xffffffff)
PATTERN_ON = (20, 0xffffffff, 0xffffffff)
PATTERN_OFF = (20, 0, 0)
PATTERN_BLINK = (20, 0x55555555, 0x84fc8c04)

FrontpanelLed(which = 0, boolean = False, patterns = [PATTERN_OFF, PATTERN_BLINK, PATTERN_ON, PATTERN_BLINK]).connect(combine)
FrontpanelLed(which = 1, boolean = False, patterns = [PATTERN_ON, PATTERN_ON, PATTERN_OFF, PATTERN_OFF]).connect(combine)
nr_leds = SystemInfo.get("NumFrontpanelLEDs", 0)

if nr_leds == 1:
FrontpanelLed(which = 0, boolean = False, patterns = [PATTERN_OFF, PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK]).connect(combine)
elif nr_leds == 2:
FrontpanelLed(which = 0, boolean = False, patterns = [PATTERN_OFF, PATTERN_BLINK, PATTERN_ON, PATTERN_BLINK]).connect(combine)
FrontpanelLed(which = 1, boolean = False, patterns = [PATTERN_ON, PATTERN_ON, PATTERN_OFF, PATTERN_OFF]).connect(combine)

0 comments on commit 28a0e99

Please sign in to comment.