Skip to content

Alvik instance error #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions arduino_alvik/arduino_alvik.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import sys
import gc
import struct
from machine import I2C
import _thread
Expand Down Expand Up @@ -84,6 +83,14 @@ def __init__(self):
self._move_events = _ArduinoAlvikMoveEvents()
self._timer_events = _ArduinoAlvikTimerEvents(-1)

def __del__(self):
"""
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)
:return:
"""
...
# self.__class__._instance = None

@staticmethod
def is_on() -> bool:
"""
Expand Down Expand Up @@ -377,10 +384,6 @@ def stop(self):
# stop touch events thread
self._stop_events_thread()

# delete _instance
del self.__class__._instance
gc.collect()

@staticmethod
def _reset_hw():
"""
Expand Down