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
fb8fc597
Commit
fb8fc597
authored
6 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
cc3200/mods: Access dict map directly instead of using helper func.
parent
a6ea6b08
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ports/cc3200/mods/pybpin.c
+5
-5
5 additions, 5 deletions
ports/cc3200/mods/pybpin.c
ports/cc3200/mods/pybsleep.c
+1
-1
1 addition, 1 deletion
ports/cc3200/mods/pybsleep.c
with
6 additions
and
6 deletions
ports/cc3200/mods/pybpin.c
+
5
−
5
View file @
fb8fc597
...
...
@@ -118,7 +118,7 @@ void pin_init0(void) {
#ifndef DEBUG
// assign all pins to the GPIO module so that peripherals can be connected to any
// pins without conflicts after a soft reset
mp_map_t
*
named_map
=
mp_obj_dict_get_map
((
mp_obj_t
)
&
pin_board_pins_locals_dict
)
;
const
mp_map_t
*
named_map
=
&
pin_board_pins_locals_dict
.
map
;
for
(
uint
i
=
0
;
i
<
named_map
->
used
-
1
;
i
++
)
{
pin_obj_t
*
pin
=
(
pin_obj_t
*
)
named_map
->
table
[
i
].
value
;
pin_deassign
(
pin
);
...
...
@@ -207,8 +207,8 @@ int8_t pin_find_af_index (const pin_obj_t* pin, uint8_t fn, uint8_t unit, uint8_
DEFINE PRIVATE FUNCTIONS
******************************************************************************/
STATIC
pin_obj_t
*
pin_find_named_pin
(
const
mp_obj_dict_t
*
named_pins
,
mp_obj_t
name
)
{
mp_map_t
*
named_map
=
mp_obj_dict_get_map
((
mp_obj_t
)
named_pins
)
;
mp_map_elem_t
*
named_elem
=
mp_map_lookup
(
named_map
,
name
,
MP_MAP_LOOKUP
);
const
mp_map_t
*
named_map
=
&
named_pins
->
map
;
mp_map_elem_t
*
named_elem
=
mp_map_lookup
(
(
mp_map_t
*
)
named_map
,
name
,
MP_MAP_LOOKUP
);
if
(
named_elem
!=
NULL
&&
named_elem
->
value
!=
NULL
)
{
return
named_elem
->
value
;
}
...
...
@@ -216,7 +216,7 @@ STATIC pin_obj_t *pin_find_named_pin(const mp_obj_dict_t *named_pins, mp_obj_t n
}
STATIC
pin_obj_t
*
pin_find_pin_by_port_bit
(
const
mp_obj_dict_t
*
named_pins
,
uint
port
,
uint
bit
)
{
mp_map_t
*
named_map
=
mp_obj_dict_get_map
((
mp_obj_t
)
named_pins
)
;
const
mp_map_t
*
named_map
=
&
named_pins
->
map
;
for
(
uint
i
=
0
;
i
<
named_map
->
used
;
i
++
)
{
if
((((
pin_obj_t
*
)
named_map
->
table
[
i
].
value
)
->
port
==
port
)
&&
(((
pin_obj_t
*
)
named_map
->
table
[
i
].
value
)
->
bit
==
bit
))
{
...
...
@@ -236,7 +236,7 @@ STATIC int8_t pin_obj_find_af (const pin_obj_t* pin, uint8_t fn, uint8_t unit, u
}
STATIC
void
pin_free_af_from_pins
(
uint8_t
fn
,
uint8_t
unit
,
uint8_t
type
)
{
mp_map_t
*
named_map
=
mp_obj_dict_get_map
((
mp_obj_t
)
&
pin_board_pins_locals_dict
)
;
const
mp_map_t
*
named_map
=
&
pin_board_pins_locals_dict
.
map
;
for
(
uint
i
=
0
;
i
<
named_map
->
used
-
1
;
i
++
)
{
pin_obj_t
*
pin
=
(
pin_obj_t
*
)
named_map
->
table
[
i
].
value
;
// af is different than GPIO
...
...
This diff is collapsed.
Click to expand it.
ports/cc3200/mods/pybsleep.c
+
1
−
1
View file @
fb8fc597
...
...
@@ -528,7 +528,7 @@ STATIC void pyb_sleep_obj_wakeup (void) {
}
STATIC
void
pyb_sleep_iopark
(
bool
hibernate
)
{
mp_map_t
*
named_map
=
mp_obj_dict_get_map
((
mp_obj_t
)
&
pin_board_pins_locals_dict
)
;
const
mp_map_t
*
named_map
=
&
pin_board_pins_locals_dict
.
map
;
for
(
uint
i
=
0
;
i
<
named_map
->
used
;
i
++
)
{
pin_obj_t
*
pin
=
(
pin_obj_t
*
)
named_map
->
table
[
i
].
value
;
switch
(
pin
->
pin_num
)
{
...
...
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