summaryrefslogtreecommitdiff
path: root/shared-module/_protomatter
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-04-03 10:52:50 -0500
committerJeff Epler <jepler@gmail.com>2020-04-14 18:24:58 -0500
commita663a7dd30d2cfed78644dcaa6e5ef25566acd82 (patch)
treec215ef6c84d17c99964ffeb68a786e01324ccb84 /shared-module/_protomatter
parentcaea4e010fad5e17089fcfdd8dea13699c3727c1 (diff)
_protomatter: move get/set paused into shared-module
Diffstat (limited to 'shared-module/_protomatter')
-rw-r--r--shared-module/_protomatter/Protomatter.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/shared-module/_protomatter/Protomatter.c b/shared-module/_protomatter/Protomatter.c
index 59dac3e6d..9f67bfad3 100644
--- a/shared-module/_protomatter/Protomatter.c
+++ b/shared-module/_protomatter/Protomatter.c
@@ -180,3 +180,15 @@ void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t* self) {
gc_collect_ptr(self->core.screenData);
}
+void common_hal_protomatter_protomatter_set_paused(protomatter_protomatter_obj_t* self, bool paused) {
+ if (paused && !self->paused) {
+ _PM_stop(&self->core);
+ } else if (!paused && self->paused) {
+ _PM_resume(&self->core);
+ }
+ self->paused = paused;
+}
+
+bool common_hal_protomatter_protomatter_get_paused(protomatter_protomatter_obj_t* self) {
+ return self->paused;
+}