Update(boards): xpython板卡执行 build:prod
This commit is contained in:
@@ -658,7 +658,7 @@
|
||||
"espnow"
|
||||
],
|
||||
"__file__": true,
|
||||
"__size__": 5431,
|
||||
"__size__": 5454,
|
||||
"__name__": "radio.py"
|
||||
},
|
||||
"rc522": {
|
||||
@@ -690,7 +690,7 @@
|
||||
"ustruct"
|
||||
],
|
||||
"__file__": true,
|
||||
"__size__": 1556,
|
||||
"__size__": 1791,
|
||||
"__name__": "rtctime.py"
|
||||
},
|
||||
"sc7a20": {
|
||||
|
||||
@@ -45,7 +45,7 @@ class ESPNow(espnow.ESPNow):
|
||||
elif err.args[1] == 'ESP_ERR_ESPNOW_IF':
|
||||
self._nic.active(True)
|
||||
elif err.args[1] == 'ESP_ERR_ESPNOW_NOT_FOUND':
|
||||
super().add_peer(_peer)
|
||||
super().add_peer(_peer, channel=self._channel)
|
||||
return super().send(_peer, str(msg))
|
||||
elif err.args[1] == 'ESP_ERR_ESPNOW_NO_MEM':
|
||||
raise OSError("internal ESP-NOW buffers are full")
|
||||
|
||||
@@ -28,18 +28,25 @@ def ntptime(host="pool.ntp.org", utc=28800):
|
||||
def settime(times):
|
||||
if isinstance(times, str):
|
||||
try:
|
||||
val = eval(times)
|
||||
if len(val) >= 6:
|
||||
times=(val[0], val[1], val[2], val[3], val[4], val[5], 0)
|
||||
else:
|
||||
raise ValueError("Clock information format error")
|
||||
times = eval(times)
|
||||
except:
|
||||
raise ValueError("Clock information format error, use ',' to separate at least 6 numerical values")
|
||||
if type(times) in (tuple, list):
|
||||
if 6 <= len(times) <= 8:
|
||||
RTC().datetime((times[0], times[1], times[2], 0, times[3], times[4], times[5], 0))
|
||||
else:
|
||||
raise ValueError("Settime needs a tuple of length 6~8")
|
||||
raise ValueError("Settime needs a type of length 6~8")
|
||||
|
||||
def strtime():
|
||||
return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}'.format(*localtime())
|
||||
def strtime(times=None):
|
||||
if times is None:
|
||||
times = localtime()
|
||||
if isinstance(times, str):
|
||||
try:
|
||||
times = eval(times)
|
||||
except:
|
||||
raise ValueError("Clock information format error, use ',' to separate at least 6 numerical values")
|
||||
if type(times) in (tuple, list):
|
||||
if 6 <= len(times) <= 8:
|
||||
return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}'.format(*times)
|
||||
else:
|
||||
raise ValueError("Settime needs a type of length 6~8")
|
||||
|
||||
Reference in New Issue
Block a user