1
0
Fork 0

wasptool: Make mem_free issue data as csv

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
Daniel Thompson 2021-07-25 09:42:26 +01:00
parent e09b951017
commit 04e35d437e

View file

@ -11,6 +11,7 @@ import pexpect
import time import time
import types import types
import string import string
import subprocess
import sys import sys
def draw_pbar(percent, quiet=False, end='\r'): def draw_pbar(percent, quiet=False, end='\r'):
@ -193,10 +194,14 @@ def handle_battery_level(c):
print(f'Battery: {c.run_command("watch.battery.level()")}%') print(f'Battery: {c.run_command("watch.battery.level()")}%')
def handle_memory_free(c): def handle_memory_free(c):
# wasp namespace to avoid having to import into the global space before_gc = c.run_command("wasp.gc.mem_free()")
print(f'Before GC: {c.run_command("wasp.gc.mem_free()"):7}')
c.run_command('wasp.gc.collect()') c.run_command('wasp.gc.collect()')
print(f'After GC: {c.run_command("wasp.gc.mem_free()"):7}') after_gc = c.run_command("wasp.gc.mem_free()")
p = subprocess.run(["git", "describe", "--tags"], capture_output=True)
version = p.stdout.decode('UTF-8').strip()
print(f'"{version}",{before_gc},{after_gc}')
def handle_reset(c, ota=False): def handle_reset(c, ota=False):
cmd = 'reset' cmd = 'reset'