summaryrefslogtreecommitdiff
path: root/wasp/boards
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-12 21:35:45 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-13 16:07:24 (GMT)
commit784c9bb36d29457ddb3a5ef5af55918e1f4cd93c (patch)
treee44d31b9f8e2402b999555d0eae8ac6ad7b4fa3d /wasp/boards
parent338925b4a8e8d7ce54d0ac7e6c9c7b3bd6110737 (diff)
apps: testapp: Automatically report free memory
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/boards')
-rw-r--r--wasp/boards/k9/watch.py.in4
-rw-r--r--wasp/boards/p8/watch.py.in4
-rw-r--r--wasp/boards/pinetime/watch.py.in4
-rw-r--r--wasp/boards/simulator/watch.py3
4 files changed, 15 insertions, 0 deletions
diff --git a/wasp/boards/k9/watch.py.in b/wasp/boards/k9/watch.py.in
index b7bfabc..8360451 100644
--- a/wasp/boards/k9/watch.py.in
+++ b/wasp/boards/k9/watch.py.in
@@ -13,6 +13,7 @@ from drivers.nrf_rtc import RTC
rtc = RTC(RTCounter(1, mode=RTCounter.PERIODIC, period=1, callback=_callback))
rtc.counter.start()
+import gc
import os
import time
@@ -135,3 +136,6 @@ try:
except:
drawable.string("FAILED", 0, 136, width=240)
backlight.set(2)
+
+gc.collect()
+free = gc.mem_free()
diff --git a/wasp/boards/p8/watch.py.in b/wasp/boards/p8/watch.py.in
index 9018a66..e133fee 100644
--- a/wasp/boards/p8/watch.py.in
+++ b/wasp/boards/p8/watch.py.in
@@ -13,6 +13,7 @@ from drivers.nrf_rtc import RTC
rtc = RTC(RTCounter(1, mode=RTCounter.PERIODIC, period=1, callback=_callback))
rtc.counter.start()
+import gc
import os
import time
@@ -123,3 +124,6 @@ try:
except:
drawable.string("FAILED", 0, 136, width=240)
backlight.set(1)
+
+gc.collect()
+free = gc.mem_free()
diff --git a/wasp/boards/pinetime/watch.py.in b/wasp/boards/pinetime/watch.py.in
index fbda41e..6db9537 100644
--- a/wasp/boards/pinetime/watch.py.in
+++ b/wasp/boards/pinetime/watch.py.in
@@ -13,6 +13,7 @@ from drivers.nrf_rtc import RTC
rtc = RTC(RTCounter(1, mode=RTCounter.PERIODIC, period=1, callback=_callback))
rtc.counter.start()
+import gc
import os
import time
@@ -125,3 +126,6 @@ try:
except:
drawable.string("FAILED", 0, 136, width=240)
backlight.set(1)
+
+gc.collect()
+free = gc.mem_free()
diff --git a/wasp/boards/simulator/watch.py b/wasp/boards/simulator/watch.py
index 98d9246..5aead3f 100644
--- a/wasp/boards/simulator/watch.py
+++ b/wasp/boards/simulator/watch.py
@@ -188,3 +188,6 @@ vibrator = Vibrator(Pin('MOTOR', Pin.OUT, value=0), active_low=True)
def connected():
return not (int(rtc.uptime / 30) & 1)
+
+# Free memory cannot be measured on the simulator
+free = 0