Skip to content

Commit 9156c8b

Browse files
committed
stmhal: Enable parsing of all Pin constructor args by machine.Signal.
1 parent 605ff91 commit 9156c8b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

stmhal/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
#define MICROPY_PY_UTIME_MP_HAL (1)
124124
#define MICROPY_PY_MACHINE (1)
125125
#define MICROPY_PY_MACHINE_PULSE (1)
126+
#define MICROPY_PY_MACHINE_PIN_MAKE_NEW mp_pin_make_new
126127
#define MICROPY_PY_MACHINE_I2C (1)
127128
#define MICROPY_PY_MACHINE_I2C_MAKE_NEW machine_hard_i2c_make_new
128129
#define MICROPY_PY_MACHINE_SPI (1)

stmhal/pin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ STATIC mp_obj_t pin_obj_init_helper(const pin_obj_t *pin, mp_uint_t n_args, cons
245245
/// \classmethod \constructor(id, ...)
246246
/// Create a new Pin object associated with the id. If additional arguments are given,
247247
/// they are used to initialise the pin. See `init`.
248-
STATIC mp_obj_t pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
248+
mp_obj_t mp_pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
249249
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
250250

251251
// Run an argument through the mapper and return the result.
@@ -567,7 +567,7 @@ const mp_obj_type_t pin_type = {
567567
{ &mp_type_type },
568568
.name = MP_QSTR_Pin,
569569
.print = pin_print,
570-
.make_new = pin_make_new,
570+
.make_new = mp_pin_make_new,
571571
.call = pin_call,
572572
.protocol = &pin_pin_p,
573573
.locals_dict = (mp_obj_t)&pin_locals_dict,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy