Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
slabua committed Jun 27, 2023
2 parents 77dcb45 + a587e28 commit e1d4832
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion picomotodash.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
)
from pimoroni import RGBLED

gc.enable()
gc.threshold(100000)


# Timer
timer = machine.Timer()
start_time = utime.time()
Expand Down Expand Up @@ -230,7 +234,6 @@ def draw_qr_code(ox, oy, size, code):
left = int((width // 2) - (size // 2))
top = int((height // 2) - (size // 2))

gc.collect()

if USE_BG_IMAGE and width == 240: # TODO check
import jpegdec
Expand Down Expand Up @@ -287,6 +290,8 @@ def display_init(bv):

display_init(BACKLIGHT_VALUES[BV])

gc.collect()


# Buttons
button_a = machine.Pin(12, machine.Pin.IN, machine.Pin.PULL_UP)
Expand Down Expand Up @@ -335,8 +340,10 @@ def int_b(pin):
print("Interrupted (B)")
set_in_use(in_use)

print("Used memory before cleanup: ", gc.mem_alloc())
print("Available memory before cleanup: ", gc.mem_free())
gc.collect()
print("Used memory before cleanup: ", gc.mem_alloc())
print("Available memory after cleanup: ", gc.mem_free())
gc.collect()

Expand Down Expand Up @@ -1013,6 +1020,8 @@ def screen_stats():
screen_stats,
]

gc.collect()


# Main
spinner = "-\|/"
Expand Down

0 comments on commit e1d4832

Please sign in to comment.