From b02be234e1981d42fc890bac5cc7cf3b7e05dfa8 Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Tue, 12 Sep 2017 16:00:21 +1000
Subject: [PATCH] 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.
---
 extmod/machine_pinbase.c | 7 +++----
 1 file 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) {
-- 
GitLab