eg25-control: fix power-down sequence
This commit is contained in:
@@ -357,7 +357,7 @@ class GpioPhy:
|
||||
return
|
||||
|
||||
self.lines.set_value(self.APREADY, gpiod.line.Value.ACTIVE)
|
||||
self.lines.set_value(self.DISABLE, disable)
|
||||
self.lines.set_value(self.DISABLE, gpiod.line.Value.INACTIVE)
|
||||
self.lines.set_value(self.RESET, gpiod.line.Value.INACTIVE)
|
||||
self.lines.set_value(self.PWRKEY, gpiod.line.Value.INACTIVE)
|
||||
self.lines.set_value(self.DTR, gpiod.line.Value.INACTIVE)
|
||||
@@ -373,15 +373,16 @@ class GpioPhy:
|
||||
self.lines.set_value(self.PWRKEY, gpiod.line.Value.INACTIVE)
|
||||
|
||||
# TODO: switch 'status' key to input (megi's modem-power claims it can be multiplexed with other stuff, so shouldn't be actively driven when possible)
|
||||
for i in range(10):
|
||||
# power-up takes 3-5s; power-down takes 12-15s
|
||||
for i in range(20):
|
||||
self.dump_debug_info()
|
||||
if self.lines.get_value(self.STATUS) == disable:
|
||||
break
|
||||
else:
|
||||
logger.info("modem hasn't pulled STATUS low: sleeping for 1s")
|
||||
logger.info("modem hasn't pulled STATUS: sleeping for 1s")
|
||||
time.sleep(1.0)
|
||||
else:
|
||||
logger.info("modem didn't pull STATUS low after 10s: giving up and continuing")
|
||||
logger.info("modem didn't pull STATUS after 20s: giving up and continuing")
|
||||
|
||||
def power_on(self) -> None:
|
||||
self.power_toggle()
|
||||
|
Reference in New Issue
Block a user