more updates

This commit is contained in:
Arul
2019-02-18 11:17:28 +05:30
parent 108ec3091c
commit 765ff1257d
2 changed files with 10 additions and 4 deletions

View File

@@ -48,15 +48,15 @@
"unit": "mA"
},
"bb_alert_gpio":{
"path":"/sys/devices/soc.0/0.dvt/",
"file":"bb_current_temp_alert_enable",
"path":"/sys/class/gpio/",
"file":"gpio1/value",
"pre": "echo 1 > /sys/class/gpio/export",
"cmd":"cat",
"unit":" interrupt_flag"
},
"fe_alert_gpio":{
"path":"/sys/devices/soc.0/0.dvt/",
"file":"dvt_alert_status",
"path":"/sys/class/gpio/",
"file":"gpio13/value",
"pre":"echo 13 > /sys/class/gpio/export",
"cmd":"cat",
"unit":"interrupt_flag"

View File

@@ -28,6 +28,12 @@ class dvt():
for x in d:
#print x
if((x == self.arglist[PARAM]) or (self.arglist[PARAM] == 'all') ):
try:
if(d[x]['pre']):
#run pre command
buf = self.run_command(d[x]['pre'])
except:
pass
buf = self.run_command(d[x]['cmd']+ ' ' + d[x]['path'] + d[x]['file'])
print x + ' : ' + buf.rstrip('\n') + ' ' + d[x]['unit']
if(self.arglist[PARAM] != 'all'):