diff options
author | ian-v <ianv888@gmail.com> | 2014-01-06 09:52:29 -0800 |
---|---|---|
committer | ian-v <ianv888@gmail.com> | 2014-01-06 09:52:29 -0800 |
commit | 7a16fadbf843ca5d49fb20b5f5785ffccfd9019f (patch) | |
tree | 167d326efc1a1a75d3a371bbeab1a0bc4164fd9e /stm/led.c | |
parent | e03c0533fe467439bae1addd6d2a2ee57a9370e4 (diff) | |
download | micropython-7a16fadbf843ca5d49fb20b5f5785ffccfd9019f.tar.gz micropython-7a16fadbf843ca5d49fb20b5f5785ffccfd9019f.zip |
Co-exist with C++ (issue #85)
Diffstat (limited to 'stm/led.c')
-rw-r--r-- | stm/led.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -176,15 +176,16 @@ mp_obj_t led_obj_off(mp_obj_t self_in) { static MP_DEFINE_CONST_FUN_OBJ_1(led_obj_on_obj, led_obj_on); static MP_DEFINE_CONST_FUN_OBJ_1(led_obj_off_obj, led_obj_off); +static const mp_method_t led_obj_type_methods[] = { + { "on", &led_obj_on_obj }, + { "off", &led_obj_off_obj }, + { NULL, NULL }, +}; static const mp_obj_type_t led_obj_type = { { &mp_const_type }, "Led", .print = led_obj_print, - .methods = { - { "on", &led_obj_on_obj }, - { "off", &led_obj_off_obj }, - { NULL, NULL }, - } + .methods = led_obj_type_methods, }; mp_obj_t pyb_Led(mp_obj_t led_id) { |