These lines added at the end of the function enter_raw_repl in pyboard.py will set the board clock when pyboard.py is used to load a Python script in raw mode. Is there a downside to doing this? The loaded script could even be a dummy if all that is desired is to set the board clock.
....else:
........lt = time.localtime()
........dt = '\rpyb.RTC().datetime((%d,%d,%d,%d,%d,%d,%d,0))\r' % (lt[0],lt[1],lt[2],(lt[6]+1)%7,lt[3],lt[4],lt[5])
........self.serial.write(bytes(dt, encoding='ascii'))
using enter_raw_repl to set the clock
-
- Posts: 5
- Joined: Tue Feb 24, 2015 12:21 am
- Location: Maryland, USA