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.
crypto-aes
Damien George 5 years ago
parent 52620c6b0e
commit b02be234e1

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

Loading…
Cancel
Save