Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
9156c8b4
Commit
9156c8b4
authored
8 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
stmhal: Enable parsing of all Pin constructor args by machine.Signal.
parent
605ff91e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
stmhal/mpconfigport.h
+1
-0
1 addition, 0 deletions
stmhal/mpconfigport.h
stmhal/pin.c
+2
-2
2 additions, 2 deletions
stmhal/pin.c
with
3 additions
and
2 deletions
stmhal/mpconfigport.h
+
1
−
0
View file @
9156c8b4
...
@@ -123,6 +123,7 @@
...
@@ -123,6 +123,7 @@
#define MICROPY_PY_UTIME_MP_HAL (1)
#define MICROPY_PY_UTIME_MP_HAL (1)
#define MICROPY_PY_MACHINE (1)
#define MICROPY_PY_MACHINE (1)
#define MICROPY_PY_MACHINE_PULSE (1)
#define MICROPY_PY_MACHINE_PULSE (1)
#define MICROPY_PY_MACHINE_PIN_MAKE_NEW mp_pin_make_new
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_I2C_MAKE_NEW machine_hard_i2c_make_new
#define MICROPY_PY_MACHINE_I2C_MAKE_NEW machine_hard_i2c_make_new
#define MICROPY_PY_MACHINE_SPI (1)
#define MICROPY_PY_MACHINE_SPI (1)
...
...
This diff is collapsed.
Click to expand it.
stmhal/pin.c
+
2
−
2
View file @
9156c8b4
...
@@ -245,7 +245,7 @@ STATIC mp_obj_t pin_obj_init_helper(const pin_obj_t *pin, mp_uint_t n_args, cons
...
@@ -245,7 +245,7 @@ STATIC mp_obj_t pin_obj_init_helper(const pin_obj_t *pin, mp_uint_t n_args, cons
/// \classmethod \constructor(id, ...)
/// \classmethod \constructor(id, ...)
/// Create a new Pin object associated with the id. If additional arguments are given,
/// Create a new Pin object associated with the id. If additional arguments are given,
/// they are used to initialise the pin. See `init`.
/// they are used to initialise the pin. See `init`.
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
)
{
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
)
{
mp_arg_check_num
(
n_args
,
n_kw
,
1
,
MP_OBJ_FUN_ARGS_MAX
,
true
);
mp_arg_check_num
(
n_args
,
n_kw
,
1
,
MP_OBJ_FUN_ARGS_MAX
,
true
);
// Run an argument through the mapper and return the result.
// Run an argument through the mapper and return the result.
...
@@ -567,7 +567,7 @@ const mp_obj_type_t pin_type = {
...
@@ -567,7 +567,7 @@ const mp_obj_type_t pin_type = {
{
&
mp_type_type
},
{
&
mp_type_type
},
.
name
=
MP_QSTR_Pin
,
.
name
=
MP_QSTR_Pin
,
.
print
=
pin_print
,
.
print
=
pin_print
,
.
make_new
=
pin_make_new
,
.
make_new
=
mp_
pin_make_new
,
.
call
=
pin_call
,
.
call
=
pin_call
,
.
protocol
=
&
pin_pin_p
,
.
protocol
=
&
pin_pin_p
,
.
locals_dict
=
(
mp_obj_t
)
&
pin_locals_dict
,
.
locals_dict
=
(
mp_obj_t
)
&
pin_locals_dict
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment