# to /var/run/sound. A separate program plays the sound.
# - restoring the display to "dim" if it is "off".
#
-#
-# contains lots of old/dead code
-# - vibrator control for GTA02
-# - watches GTA04 accelerometer and locks display when upside-down
-# - look for external network connections. The idea was to disable
-# suspend if there were any, but it is too easy for them to remain
-# after network is disconnected.
-# Needs lots of cleaning up.
import gobject
import gtk
f.close()
except:
pass
-
+
vib_timer = None
def gta02_set_vibrate(on, off, total):
global vib_timer
vib = "/sys/class/leds/neo1973:vibrator"
sysfs_write(vib+"/trigger", "none")
-vib_han = None
+vib_han = None
def set_vibrate(on, off, total):
global vib_han
if vib_han:
except:
pass
set_vibrate(200,400,1800)
-
+
if display.state != 'on':
set_dim()
suspend.abort_cycle()
]
librt = ctypes.CDLL('librt.so.1')
-clock_gettime = librt.clock_gettime
+clock_gettime = librt.clock_gettime
clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(timespec)]
def get_ticks():
clock_gettime(CLOCK_MONOTONIC, ctypes.pointer(t))
return t.tv_sec + t.tv_nsec / 1e9
-
-
timeout = None
state = "full"
dimtime = 15
elif state == "dim":
timeout = gobject.timeout_add(10*1000, set_off)
-
set_ico_file()
global susblock, enable_suspend
if state == "off" and enable_suspend:
return True
return False
-
def wake_all(down_cnt, moment, typ, code, value):
global state, dimtime, alert, suspended
if typ == 0:
global suspended
#print "resumed"
suspended = False
-
+
def main():
global display, ico
global screen, power, aux, accel