本文整理汇总了Python中MOD.powerSavingExitCause方法的典型用法代码示例。如果您正苦于以下问题:Python MOD.powerSavingExitCause方法的具体用法?Python MOD.powerSavingExitCause怎么用?Python MOD.powerSavingExitCause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MOD
的用法示例。
在下文中一共展示了MOD.powerSavingExitCause方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: transmitMessage
# 需要导入模块: import MOD [as 别名]
# 或者: from MOD import powerSavingExitCause [as 别名]
transmitMessage(message)
elif Config.Mode == 'Passive':
storeMessage(message)
elif Config.Mode == 'Buffered':
SER.send('Buffered mode, todo!\n')
endTime = MOD.secCounter()
timeSpend = endTime - startTime
sleepTime = Config.Interval - timeSpend
SER.send("Spend: %s, Interval: %s, Sleep: %s\n" % (timeSpend, Config.Interval, sleepTime))
SER.send("GPIO: %s, RTS: %s\n" % (GPIO.getIOvalue(2), SER.getRTS()))
# Sleep, but only if the emergency button isn't set.
if sleepTime > 2 and GPIO.getIOvalue(2) == 0:
SER.send('Going into powerSaving.\n')
MOD.powerSaving(sleepTime)
reason = MOD.powerSavingExitCause()
SER.send("Woke up! Reason (0=ext,1=time): %s\n" % reason)
if reason == 0:
MOD.sleep(20)
elif sleepTime > 0:
SER.send('Idle sleep.\n')
MOD.sleep(10 * sleepTime)
else:
pass # If sleepTime < 0: continue right away.
SER.send('Stopping execution\n')