summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-09-12 16:00:21 +1000
committerDamien George <damien.p.george@gmail.com>2017-09-12 16:00:21 +1000
commitb02be234e1981d42fc890bac5cc7cf3b7e05dfa8 (patch)
treefe5712a04608965a4525f84c6a027d7d6f749d7f
parent52620c6b0e8a601e49866d0db37abbe217b16a0d (diff)
extmod/machine_pinbase: Put PinBase singleton in ROM.
This patch also removes the empty type "pinbase_type" (which crashes if accessed) and uses "machine_pinbase_type" instead as the type of the PinBase singleton.
-rw-r--r--extmod/machine_pinbase.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/extmod/machine_pinbase.c b/extmod/machine_pinbase.c
index 3c1f09483..070c5cde9 100644
--- a/extmod/machine_pinbase.c
+++ b/extmod/machine_pinbase.c
@@ -30,6 +30,7 @@
#include "py/obj.h"
#include "py/runtime.h"
#include "extmod/virtpin.h"
+#include "extmod/machine_pinbase.h"
// PinBase class
@@ -40,10 +41,8 @@ typedef struct _mp_pinbase_t {
mp_obj_base_t base;
} mp_pinbase_t;
-STATIC const mp_obj_type_t pinbase_type;
-
-STATIC mp_pinbase_t pinbase_singleton = {
- .base = { &pinbase_type },
+STATIC const mp_pinbase_t pinbase_singleton = {
+ .base = { &machine_pinbase_type },
};
STATIC mp_obj_t pinbase_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {