diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-07 15:58:30 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-07 15:58:30 +0000 |
commit | 97209d38e17a0f3cb2a2d3f03d726fd322b4808f (patch) | |
tree | 514cc35179713b4128ec6218829d769d87d7fe70 /stm/i2c.c | |
parent | d49420e74c721bb6c61925a6c9a2addbaeed3382 (diff) | |
parent | a5a01df81d01705b9f04264cc46fbb1bc32641b3 (diff) | |
download | micropython-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.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 |