diff options
author | rufusclark <50201718+rufusclark@users.noreply.github.com> | 2024-08-06 00:32:35 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-02-12 12:53:46 +1100 |
commit | 1a67d720c786fd85c848ffba4b792048d262095f (patch) | |
tree | 71c40d1c6d19ee14a0c1bc8055b6912ba742f3a6 | |
parent | 30acb16ad34babf25d126a7b471616421167cb35 (diff) |
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>
-rwxr-xr-x | tools/pyboard.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py index dac51e7d6..0cf5b3d46 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -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): |