Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
60427864
Commit
60427864
authored
Apr 12, 2014
by
Damien George
Browse files
stmhal: Move I2C objects to ROM.
parent
8f193175
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/i2c.c
View file @
60427864
...
...
@@ -75,7 +75,7 @@ typedef struct _pyb_i2c_obj_t {
I2C_HandleTypeDef
*
i2c_handle
;
}
pyb_i2c_obj_t
;
STATIC
pyb_i2c_obj_t
pyb_i2c_obj
[
PYB_NUM_I2C
]
=
{{{
&
pyb_i2c_type
},
&
I2cHandle_X
},
{{
&
pyb_i2c_type
},
&
I2cHandle_Y
}};
STATIC
const
pyb_i2c_obj_t
pyb_i2c_obj
[
PYB_NUM_I2C
]
=
{{{
&
pyb_i2c_type
},
&
I2cHandle_X
},
{{
&
pyb_i2c_type
},
&
I2cHandle_Y
}};
STATIC
mp_obj_t
pyb_i2c_make_new
(
mp_obj_t
type_in
,
uint
n_args
,
uint
n_kw
,
const
mp_obj_t
*
args
)
{
// check arguments
...
...
@@ -90,12 +90,12 @@ STATIC mp_obj_t pyb_i2c_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const
}
// get i2c object
pyb_i2c_obj_t
*
i2c_obj
=
&
pyb_i2c_obj
[
i2c_id
];
const
pyb_i2c_obj_t
*
i2c_obj
=
&
pyb_i2c_obj
[
i2c_id
];
// start the peripheral
i2c_start
(
i2c_obj
->
i2c_handle
);
return
&
pyb_
i2c_obj
;
return
(
mp_obj_t
)
i2c_obj
;
}
STATIC
mp_obj_t
pyb_i2c_is_ready
(
mp_obj_t
self_in
,
mp_obj_t
i2c_addr_o
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment