Skip to content

Commit b02be23

Browse files
committed
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.
1 parent 52620c6 commit b02be23

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

extmod/machine_pinbase.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "py/obj.h"
3131
#include "py/runtime.h"
3232
#include "extmod/virtpin.h"
33+
#include "extmod/machine_pinbase.h"
3334

3435
// PinBase class
3536

@@ -40,10 +41,8 @@ typedef struct _mp_pinbase_t {
4041
mp_obj_base_t base;
4142
} mp_pinbase_t;
4243

43-
STATIC const mp_obj_type_t pinbase_type;
44-
45-
STATIC mp_pinbase_t pinbase_singleton = {
46-
.base = { &pinbase_type },
44+
STATIC const mp_pinbase_t pinbase_singleton = {
45+
.base = { &machine_pinbase_type },
4746
};
4847

4948
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) {

0 commit comments

Comments
 (0)