Skip to content

Commit 1a67d72

Browse files
rufusclarkdpgeorge
authored andcommitted
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 <[email protected]> Signed-off-by: Damien George <[email protected]>
1 parent 30acb16 commit 1a67d72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/pyboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def execfile(self, filename):
506506
return self.exec_(pyfile)
507507

508508
def get_time(self):
509-
t = str(self.eval("pyb.RTC().datetime()"), encoding="utf8")[1:-1].split(", ")
509+
t = str(self.eval("machine.RTC().datetime()"), encoding="utf8")[1:-1].split(", ")
510510
return int(t[4]) * 3600 + int(t[5]) * 60 + int(t[6])
511511

512512
def fs_exists(self, src):

0 commit comments

Comments
 (0)