summaryrefslogtreecommitdiffstatshomepage
path: root/stm/i2c.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-07 15:58:30 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-07 15:58:30 +0000
commit97209d38e17a0f3cb2a2d3f03d726fd322b4808f (patch)
tree514cc35179713b4128ec6218829d769d87d7fe70 /stm/i2c.c
parentd49420e74c721bb6c61925a6c9a2addbaeed3382 (diff)
parenta5a01df81d01705b9f04264cc46fbb1bc32641b3 (diff)
downloadmicropython-97209d38e17a0f3cb2a2d3f03d726fd322b4808f.tar.gz
micropython-97209d38e17a0f3cb2a2d3f03d726fd322b4808f.zip
Merge branch 'cplusplus' of https://github.com/ian-v/micropython into ian-v-cplusplus
Conflicts: py/objcomplex.c
Diffstat (limited to 'stm/i2c.c')
-rw-r--r--stm/i2c.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/stm/i2c.c b/stm/i2c.c
index 9e25ff9839..22c908566d 100644
--- a/stm/i2c.c
+++ b/stm/i2c.c
@@ -326,18 +326,20 @@ static MP_DEFINE_CONST_FUN_OBJ_1(i2c_obj_read_obj, i2c_obj_read);
static MP_DEFINE_CONST_FUN_OBJ_1(i2c_obj_readAndStop_obj, i2c_obj_readAndStop);
static MP_DEFINE_CONST_FUN_OBJ_1(i2c_obj_stop_obj, i2c_obj_stop);
+static const mp_method_t i2c_methods[] = {
+ { "start", &i2c_obj_start_obj },
+ { "write", &i2c_obj_write_obj },
+ { "read", &i2c_obj_read_obj },
+ { "readAndStop", &i2c_obj_readAndStop_obj },
+ { "stop", &i2c_obj_stop_obj },
+ { NULL, NULL },
+};
+
static const mp_obj_type_t i2c_obj_type = {
{ &mp_const_type },
"I2C",
.print = i2c_obj_print,
- .methods = {
- { "start", &i2c_obj_start_obj },
- { "write", &i2c_obj_write_obj },
- { "read", &i2c_obj_read_obj },
- { "readAndStop", &i2c_obj_readAndStop_obj },
- { "stop", &i2c_obj_stop_obj },
- { NULL, NULL },
- }
+ .methods = i2c_methods,
};
// create the I2C object