def _idle_thread(self):
if self.gc_enable and (self.last_gc == 0 or after(self.last_gc) > GCTIME):
gc.collect()
gc.threshold(gc.mem_free() // 4 + gc.mem_alloc())
self.last_gc = ticks_us()
if self.heartbeat is not None and (self.last_heartbeat == 0 or after(self.last_heartbeat) > HBTIME):
if platform == 'pyboard':
self.heartbeat.toggle()
elif platform == 'esp8266':
self.heartbeat(not self.heartbeat())
self.last_heartbeat = ticks_us()
评论列表
文章目录