Skip to content

Commit e55f163

Browse files
authored
Merge pull request #31 from arduino/alvik-instance-error
Alvik instance error
2 parents 3dc79de + e3ce2d5 commit e55f163

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

arduino_alvik/arduino_alvik.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sys
2-
import gc
32
import struct
43
from machine import I2C
54
import _thread
@@ -84,6 +83,14 @@ def __init__(self):
8483
self._move_events = _ArduinoAlvikMoveEvents()
8584
self._timer_events = _ArduinoAlvikTimerEvents(-1)
8685

86+
def __del__(self):
87+
"""
88+
This method is a stub. __del__ is not implemented in MicroPython (https://docs.micropython.org/en/latest/genrst/core_language.html#special-method-del-not-implemented-for-user-defined-classes)
89+
:return:
90+
"""
91+
...
92+
# self.__class__._instance = None
93+
8794
@staticmethod
8895
def is_on() -> bool:
8996
"""
@@ -382,10 +389,6 @@ def stop(self):
382389
# stop touch events thread
383390
self._stop_events_thread()
384391

385-
# delete _instance
386-
del self.__class__._instance
387-
gc.collect()
388-
389392
@staticmethod
390393
def _reset_hw():
391394
"""

0 commit comments

Comments
 (0)