tools/pyboard.py: Make get_time use machine.RTC instead of pyb.RTC.
The current code evaluates `pyb.RTC().datetime()` resulting in a remote side exception, as `pyb` is not defined on most ports (only stm32). The code should evaluate `machine.RTC().datetime()` and hence return the current time. Signed-off-by: rufusclark <50201718+rufusclark@users.noreply.github.com> Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
30acb16ad3
commit
1a67d720c7
1 changed files with 1 additions and 1 deletions
|
|
@ -506,7 +506,7 @@ class Pyboard:
|
|||
return self.exec_(pyfile)
|
||||
|
||||
def get_time(self):
|
||||
t = str(self.eval("pyb.RTC().datetime()"), encoding="utf8")[1:-1].split(", ")
|
||||
t = str(self.eval("machine.RTC().datetime()"), encoding="utf8")[1:-1].split(", ")
|
||||
return int(t[4]) * 3600 + int(t[5]) * 60 + int(t[6])
|
||||
|
||||
def fs_exists(self, src):
|
||||
|
|
|
|||
Loading…
Reference in a new issue