Skip to content

Commit ca045d9

Browse files
committed
tools: Update pyboard.py to work with latest changes to RTC.
1 parent 5ea6985 commit ca045d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/pyboard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def execfile(self, filename):
8989
return self.exec(pyfile)
9090

9191
def get_time(self):
92-
t = str(self.exec('pyb.time()'), encoding='ascii').strip().split()[1].split(':')
93-
return int(t[0]) * 3600 + int(t[1]) * 60 + int(t[2])
92+
t = str(self.eval('pyb.RTC().datetime()'), encoding='ascii')[1:-1].split(', ')
93+
return int(t[4]) * 3600 + int(t[5]) * 60 + int(t[6])
9494

9595
def execfile(filename, device='/dev/ttyACM0'):
9696
pyb = Pyboard(device)

0 commit comments

Comments
 (0)