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.
pull/3316/head
Damien George 2017-09-12 16:00:21 +10:00
rodzic 52620c6b0e
commit b02be234e1
1 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

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